Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LLMProvider ¶
type LLMProvider interface {
// ChatCompletion 普通对话
ChatCompletion(ctx context.Context, messages []Message, config ModelConfig) (string, Usage, error)
// StreamCompletion 流式对话
StreamCompletion(ctx context.Context, messages []Message, config ModelConfig, callback func(chunk string, usage Usage, err error))
// ValidateModel 验证模型配置
ValidateModel(ctx context.Context, config ModelConfig) ([]ModelInfo, error)
}
LLMProvider LLM 提供商接口
type ModelConfig ¶
type ModelConfig struct {
BaseURL string `json:"base_url"`
APIKey string `json:"api_key"`
Model string `json:"model"`
}
ModelConfig LLM 模型配置
type SMSProvider ¶
type SMSProvider interface {
// SendCode 发送验证码
SendCode(phone string, code string) error
// SendMessage 发送普通短信
SendMessage(phone string, content string, templateCode string) error
}
SMSProvider 短信服务提供商接口
Click to show internal directories.
Click to hide internal directories.