Documentation
¶
Index ¶
- Constants
- func BuildEnvVariable(name string) string
- func BuildEnvVariablePrefix(name string) (ret string)
- func ParseBool(val string) (bool, error)
- func ParseBoolElseFalse(val string) (ret bool)
- func RequireSecureBaseURL(rawURL string) error
- type Plugin
- type PluginBase
- func (o *PluginBase) AddSetting(name string, required bool) (ret *Setting)
- func (o *PluginBase) AddSetupQuestion(name string, required bool) (ret *SetupQuestion)
- func (o *PluginBase) AddSetupQuestionBool(name string, required bool) (ret *SetupQuestion)
- func (o *PluginBase) AddSetupQuestionCustom(name string, required bool, question string) (ret *SetupQuestion)
- func (o *PluginBase) AddSetupQuestionCustomBool(name string, required bool, question string) (ret *SetupQuestion)
- func (o *PluginBase) AddSetupQuestionWithEnvName(envVarName string, required bool, question string) (ret *SetupQuestion)
- func (o *PluginBase) Configure() (err error)
- func (o *PluginBase) GetName() string
- func (o *PluginBase) GetSetupDescription() (ret string)
- func (o *PluginBase) NeedsRawMode(modelName string) bool
- func (o *PluginBase) Setup() (err error)
- func (o *PluginBase) SetupFillEnvFileContent(fileEnvFileContent *bytes.Buffer)
- func (o *PluginBase) SetupOrSkip() (err error)
- type Setting
- type Settings
- type SetupQuestion
- type SetupQuestions
Constants ¶
const AnswerReset = "reset"
const MaskedValue = "********"
MaskedValue stands in for a sensitive value in prompts and printed output.
const SettingTypeBool = "bool"
Variables ¶
This section is empty.
Functions ¶
func BuildEnvVariable ¶
func BuildEnvVariablePrefix ¶
func ParseBoolElseFalse ¶
func RequireSecureBaseURL ¶ added in v1.4.536
RequireSecureBaseURL checks the base URL of a vendor that gets an API key or token. It accepts https, and http only for a loopback host, so that credentials and prompts do not cross a network in plaintext. An empty URL is accepted: the vendor then uses its default.
Types ¶
type PluginBase ¶
type PluginBase struct {
Settings
SetupQuestions
Name string
SetupDescription string
EnvNamePrefix string
ConfigureCustom func() error
}
func NewVendorPluginBase ¶ added in v1.4.376
func NewVendorPluginBase(name string, configure func() error) *PluginBase
NewVendorPluginBase creates a standardized PluginBase for AI vendor plugins. This centralizes the common initialization pattern used by all vendors.
func (*PluginBase) AddSetting ¶
func (o *PluginBase) AddSetting(name string, required bool) (ret *Setting)
func (*PluginBase) AddSetupQuestion ¶
func (o *PluginBase) AddSetupQuestion(name string, required bool) (ret *SetupQuestion)
func (*PluginBase) AddSetupQuestionBool ¶
func (o *PluginBase) AddSetupQuestionBool(name string, required bool) (ret *SetupQuestion)
func (*PluginBase) AddSetupQuestionCustom ¶
func (o *PluginBase) AddSetupQuestionCustom(name string, required bool, question string) (ret *SetupQuestion)
func (*PluginBase) AddSetupQuestionCustomBool ¶
func (o *PluginBase) AddSetupQuestionCustomBool(name string, required bool, question string) (ret *SetupQuestion)
func (*PluginBase) AddSetupQuestionWithEnvName ¶ added in v1.4.356
func (o *PluginBase) AddSetupQuestionWithEnvName(envVarName string, required bool, question string) (ret *SetupQuestion)
AddSetupQuestionWithEnvName creates a setup question with an explicit environment variable name. This is useful when you want the environment variable name to remain constant across languages. The envVarName is used for the environment variable, while the question is localized.
func (*PluginBase) Configure ¶
func (o *PluginBase) Configure() (err error)
func (*PluginBase) GetName ¶
func (o *PluginBase) GetName() string
func (*PluginBase) GetSetupDescription ¶
func (o *PluginBase) GetSetupDescription() (ret string)
func (*PluginBase) NeedsRawMode ¶ added in v1.4.423
func (o *PluginBase) NeedsRawMode(modelName string) bool
NeedsRawMode returns false by default. Vendors that need raw mode (e.g., perplexity, ollama, openai for certain models) override this method.
func (*PluginBase) Setup ¶
func (o *PluginBase) Setup() (err error)
func (*PluginBase) SetupFillEnvFileContent ¶
func (o *PluginBase) SetupFillEnvFileContent(fileEnvFileContent *bytes.Buffer)
func (*PluginBase) SetupOrSkip ¶
func (o *PluginBase) SetupOrSkip() (err error)
type Setting ¶
type Setting struct {
EnvVariable string
Value string
Required bool
Type string // "string" (default), "bool"
Sensitive bool // mask the value in prompts and printed output
}
func NewSetting ¶
func (*Setting) DisplayValue ¶ added in v1.4.532
DisplayValue returns the value as it may be shown to the user.
func (*Setting) FillEnvFileContent ¶
func (*Setting) IsValidErr ¶
type Settings ¶
type Settings []*Setting
func (Settings) FillEnvFileContent ¶
func (Settings) IsConfigured ¶
type SetupQuestion ¶
func NewSetupQuestion ¶
func NewSetupQuestion(question string) *SetupQuestion
func (*SetupQuestion) Ask ¶
func (o *SetupQuestion) Ask(label string) (err error)
func (*SetupQuestion) OnAnswer ¶
func (o *SetupQuestion) OnAnswer(answer string) (err error)
func (*SetupQuestion) OnAnswerWithReset ¶ added in v1.4.341
func (o *SetupQuestion) OnAnswerWithReset(answer string, isReset bool) (err error)
type SetupQuestions ¶
type SetupQuestions []*SetupQuestion
func (SetupQuestions) Ask ¶
func (o SetupQuestions) Ask(label string) (err error)
Directories
¶
| Path | Synopsis |
|---|---|
|
azureaigateway
Package azureaigateway provides a plugin for Azure API Management (APIM) Gateway fronting multiple AI backends (AWS Bedrock, Azure OpenAI, Google Vertex AI).
|
Package azureaigateway provides a plugin for Azure API Management (APIM) Gateway fronting multiple AI backends (AWS Bedrock, Azure OpenAI, Google Vertex AI). |
|
bedrock
Package bedrock provides a plugin to use Amazon Bedrock models.
|
Package bedrock provides a plugin to use Amazon Bedrock models. |
|
claudecode
Package claudecode runs Fabric requests through the Claude Code CLI.
|
Package claudecode runs Fabric requests through the Claude Code CLI. |
|
codex
Package codex provides a subscription-backed OpenAI OAuth vendor that talks to the private Codex backend for supported models.
|
Package codex provides a subscription-backed OpenAI OAuth vendor that talks to the private Codex backend for supported models. |
|
copilot
Package copilot provides integration with Microsoft 365 Copilot Chat API.
|
Package copilot provides integration with Microsoft 365 Copilot Chat API. |
|
geminicommon
Package geminicommon holds helpers shared by the gemini and vertexai vendors.
|
Package geminicommon holds helpers shared by the gemini and vertexai vendors. |
|
perplexity
Package perplexity connects Fabric to the Perplexity Agent API.
|
Package perplexity connects Fabric to the Perplexity Agent API. |
|
Package template provides datetime operations for the template system
|
Package template provides datetime operations for the template system |