Documentation
¶
Index ¶
Constants ¶
View Source
const ( AzureProvider = "azureopenai" HuggingFaceProvider = "huggingface" OpenAIProvider = "openai" )
View Source
const ( Text2sqlType = "Text2sql" SQLFixType = "SqlFix" )
Variables ¶
View Source
var ServicePromptMap = map[string]string{
"default": defaultPrompt,
"Text2sql": text2sqlPrompt,
"SqlFix": sqlFixPrompt,
}
Functions ¶
This section is empty.
Types ¶
type AIConfig ¶
type AIConfig struct {
Name string
AuthToken string
BaseURL string
Model string
Temperature float32
TopP float32
}
AIConfig represents the configuration settings for an AI client.
func ConvertToAIConfig ¶
func ConvertToAIConfig(c registry.ExtraConfig) AIConfig
type AIProvider ¶
type AIProvider interface {
// Configure sets up the AI service with the provided configuration.
Configure(config AIConfig) error
// Generate generates a response from the AI service based on
// the provided prompt and service type.
Generate(ctx context.Context, prompt string) (string, error)
}
AIProvider is an interface all AI clients.
type AzureAIClient ¶
type AzureAIClient struct {
// contains filtered or unexported fields
}
func (*AzureAIClient) Configure ¶
func (c *AzureAIClient) Configure(cfg AIConfig) error
type HuggingfaceClient ¶
type HuggingfaceClient struct {
// contains filtered or unexported fields
}
func (*HuggingfaceClient) Configure ¶
func (c *HuggingfaceClient) Configure(cfg AIConfig) error
type OpenAIClient ¶
type OpenAIClient struct {
// contains filtered or unexported fields
}
func (*OpenAIClient) Configure ¶
func (c *OpenAIClient) Configure(cfg AIConfig) error
Click to show internal directories.
Click to hide internal directories.