Documentation
¶
Index ¶
Constants ¶
View Source
const ( AzureProvider = "azureopenai" HuggingFaceProvider = "huggingface" OpenAIProvider = "openai" DeepseekProvider = "deepseek" )
View Source
const ( Text2sqlType = "Text2sql" SQLFixType = "SqlFix" )
Variables ¶
This section is empty.
Functions ¶
func GetProxyHTTPClient ¶ added in v0.6.2
GetProxyHTTPClient returns a new http.Transport with proxy configuration
Types ¶
type AIConfig ¶
type AIConfig struct {
Name string
AuthToken string
BaseURL string
Model string
Temperature float32
TopP float32
ProxyEnabled bool
HTTPProxy string
HTTPSProxy string
NoProxy string
}
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 ¶ added in v0.5.9
type DeepseekClient ¶ added in v0.6.3
type DeepseekClient struct {
// contains filtered or unexported fields
}
func (*DeepseekClient) Configure ¶ added in v0.6.3
func (c *DeepseekClient) Configure(cfg AIConfig) error
func (*DeepseekClient) GenerateStream ¶ added in v0.6.3
type HuggingfaceClient ¶
type HuggingfaceClient struct {
// contains filtered or unexported fields
}
func (*HuggingfaceClient) Configure ¶
func (c *HuggingfaceClient) Configure(cfg AIConfig) error
func (*HuggingfaceClient) GenerateStream ¶ added in v0.5.9
type OpenAIClient ¶
type OpenAIClient struct {
// contains filtered or unexported fields
}
func (*OpenAIClient) Configure ¶
func (c *OpenAIClient) Configure(cfg AIConfig) error
func (*OpenAIClient) GenerateStream ¶ added in v0.5.9
Click to show internal directories.
Click to hide internal directories.