Documentation ¶
Index ¶
Constants ¶
View Source
const ( AzureProvider = "azureopenai" HuggingFaceProvider = "huggingface" OpenAIProvider = "openai" )
View Source
const ( Text2sqlType = "Text2sql" SQLFixType = "SqlFix" )
Variables ¶
This section is empty.
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) // GenerateStream generates a streaming response from the AI service // based on the provided prompt. It returns a channel that will receive // chunks of the response as they are generated. GenerateStream(ctx context.Context, prompt string) (<-chan 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
func (*AzureAIClient) GenerateStream ¶
type HuggingfaceClient ¶
type HuggingfaceClient struct {
// contains filtered or unexported fields
}
func (*HuggingfaceClient) Configure ¶
func (c *HuggingfaceClient) Configure(cfg AIConfig) error
func (*HuggingfaceClient) GenerateStream ¶
type OpenAIClient ¶
type OpenAIClient struct {
// contains filtered or unexported fields
}
func (*OpenAIClient) Configure ¶
func (c *OpenAIClient) Configure(cfg AIConfig) error
func (*OpenAIClient) GenerateStream ¶
Click to show internal directories.
Click to hide internal directories.