Documentation
¶
Index ¶
- func BuildModel(ctx context.Context, cfg *ModelConfig, opts ...BuildOption) (model.ToolCallingChatModel, error)
- func SupportedModelClass(modelClass ModelClass) bool
- type ArkConnectionInfo
- type BuildOption
- func WithLLMEnableThinking(enable bool) BuildOption
- func WithLLMFrequencyPenalty(penalty float32) BuildOption
- func WithLLMMaxTokens(maxTokens int) BuildOption
- func WithLLMPresencePenalty(penalty float32) BuildOption
- func WithLLMResponseFormat(format ResponseFormat) BuildOption
- func WithLLMTemperature(temp float32) BuildOption
- func WithLLMTopK(topK int32) BuildOption
- func WithLLMTopP(topP float32) BuildOption
- type Builder
- type ConnectionInfo
- type GeminiConnectionInfo
- type LLMParams
- type ModelClass
- type ModelConfig
- type OpenAIConnectionInfo
- type ResponseFormat
- type ThinkingType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildModel ¶
func BuildModel(ctx context.Context, cfg *ModelConfig, opts ...BuildOption) (model.ToolCallingChatModel, error)
func SupportedModelClass ¶
func SupportedModelClass(modelClass ModelClass) bool
Types ¶
type ArkConnectionInfo ¶
type ArkConnectionInfo struct {
Region string `json:"region,omitempty" yaml:"region,omitempty"`
}
type BuildOption ¶
type BuildOption func(p *LLMParams)
func WithLLMEnableThinking ¶
func WithLLMEnableThinking(enable bool) BuildOption
func WithLLMFrequencyPenalty ¶
func WithLLMFrequencyPenalty(penalty float32) BuildOption
func WithLLMMaxTokens ¶
func WithLLMMaxTokens(maxTokens int) BuildOption
func WithLLMPresencePenalty ¶
func WithLLMPresencePenalty(penalty float32) BuildOption
func WithLLMResponseFormat ¶
func WithLLMResponseFormat(format ResponseFormat) BuildOption
func WithLLMTemperature ¶
func WithLLMTemperature(temp float32) BuildOption
func WithLLMTopK ¶
func WithLLMTopK(topK int32) BuildOption
func WithLLMTopP ¶
func WithLLMTopP(topP float32) BuildOption
type Builder ¶
type Builder interface {
Build(ctx context.Context, params *LLMParams) (model.ToolCallingChatModel, error)
}
func NewBuilder ¶
func NewBuilder(cfg *ModelConfig) (Builder, error)
type ConnectionInfo ¶
type ConnectionInfo struct {
APIKey string `json:"api_key" yaml:"api_key"`
BaseURL string `json:"base_url,omitempty" yaml:"base_url,omitempty"`
Model string `json:"model" yaml:"model"`
Ark *ArkConnectionInfo `json:"ark,omitempty" yaml:"ark,omitempty"`
OpenAI *OpenAIConnectionInfo `json:"openai,omitempty" yaml:"openai,omitempty"`
Gemini *GeminiConnectionInfo `json:"gemini,omitempty" yaml:"gemini,omitempty"`
}
type GeminiConnectionInfo ¶
type LLMParams ¶
type LLMParams struct {
Temperature *float32 `json:"temperature,omitempty" yaml:"temperature,omitempty"`
FrequencyPenalty *float32 `json:"frequency_penalty,omitempty" yaml:"frequency_penalty,omitempty"`
PresencePenalty *float32 `json:"presence_penalty,omitempty" yaml:"presence_penalty,omitempty"`
MaxTokens *int `json:"max_tokens,omitempty" yaml:"max_tokens,omitempty"`
TopP *float32 `json:"top_p,omitempty" yaml:"top_p,omitempty"`
TopK *int32 `json:"top_k,omitempty" yaml:"top_k,omitempty"`
ResponseFormat ResponseFormat `json:"response_format,omitempty" yaml:"response_format,omitempty"`
EnableThinking *bool `json:"enable_thinking,omitempty" yaml:"enable_thinking,omitempty"`
}
type ModelClass ¶
type ModelClass string
const ( ModelClassArk ModelClass = "ark" ModelClassOpenAI ModelClass = "openai" ModelClassClaude ModelClass = "claude" ModelClassDeepSeek ModelClass = "deepseek" ModelClassGemini ModelClass = "gemini" ModelClassOllama ModelClass = "ollama" ModelClassQwen ModelClass = "qwen" )
func ListSupportedModelClasses ¶
func ListSupportedModelClasses() []ModelClass
type ModelConfig ¶
type ModelConfig struct {
ModelClass ModelClass `json:"model_class" yaml:"model_class"`
Connection *ConnectionInfo `json:"connection" yaml:"connection"`
ThinkingType ThinkingType `json:"thinking_type,omitempty" yaml:"thinking_type,omitempty"`
}
func LoadConfigFromEnv ¶
func LoadConfigFromEnv() *ModelConfig
type OpenAIConnectionInfo ¶
type ResponseFormat ¶
type ResponseFormat string
const ( ResponseFormatText ResponseFormat = "text" ResponseFormatJSON ResponseFormat = "json" ResponseFormatMarkdown ResponseFormat = "markdown" )
type ThinkingType ¶
type ThinkingType string
const ( ThinkingTypeAuto ThinkingType = "auto" ThinkingTypeEnable ThinkingType = "enable" ThinkingTypeDisable ThinkingType = "disable" )
Click to show internal directories.
Click to hide internal directories.