Documentation
¶
Index ¶
- Constants
- func RegisterAgentMaker(agentId string, maker func(APIConfig) Agent)
- type APIConfig
- type Agent
- type ChatMessage
- type ChatMessageContent
- type ChatModelConfig
- func (cmc *ChatModelConfig) GetMaxTokens() int
- func (cmc *ChatModelConfig) GetModel() string
- func (cmc *ChatModelConfig) GetTemperature() float64
- func (cmc *ChatModelConfig) GetTools() map[string]any
- func (cmc *ChatModelConfig) GetTopP() float64
- func (cmc *ChatModelConfig) SetDefault(config *ChatModelConfig)
- type Support
- type TokenUsage
Constants ¶
View Source
const ( TypeText = "text" TypeImage = "image" TypeVideo = "video" RoleSystem = "system" RoleUser = "user" RoleAssistant = "assistant" RoleTool = "tool" ToolCodeInterpreter = "codeInterpreter" ToolWebSearch = "webSearch" )
Variables ¶
This section is empty.
Functions ¶
func RegisterAgentMaker ¶
Types ¶
type APIConfig ¶
type APIConfig struct { Endpoint string ApiKey string DefaultChatModelConfig ChatModelConfig }
type Agent ¶
type Agent interface { Support() Support Ask(messages []ChatMessage, config *ChatModelConfig, callback func(answer string)) (string, TokenUsage, error) FastAsk(messages []ChatMessage, callback func(answer string)) (string, TokenUsage, error) LongAsk(messages []ChatMessage, callback func(answer string)) (string, TokenUsage, error) BatterAsk(messages []ChatMessage, callback func(answer string)) (string, TokenUsage, error) BestAsk(messages []ChatMessage, callback func(answer string)) (string, TokenUsage, error) MultiAsk(messages []ChatMessage, callback func(answer string)) (string, TokenUsage, error) BestMultiAsk(messages []ChatMessage, callback func(answer string)) (string, TokenUsage, error) CodeInterpreterAsk(messages []ChatMessage, callback func(answer string)) (string, TokenUsage, error) WebSearchAsk(messages []ChatMessage, callback func(answer string)) (string, TokenUsage, error) MakeImage(model, prompt, size, refImage string) ([]string, error) FastMakeImage(prompt, size, refImage string) ([]string, error) BestMakeImage(prompt, size, refImage string) ([]string, error) MakeVideo(model, prompt, size, refImage string) ([]string, []string, error) FastMakeVideo(prompt, size, refImage string) ([]string, []string, error) BestMakeVideo(prompt, size, refImage string) ([]string, []string, error) }
func CreateAgent ¶
type ChatMessage ¶
type ChatMessage struct { Role string Contents []ChatMessageContent }
type ChatMessageContent ¶
type ChatModelConfig ¶
type ChatModelConfig struct { Model string Ratio float64 MaxTokens int Temperature float64 TopP float64 Tools map[string]any // contains filtered or unexported fields }
func (*ChatModelConfig) GetMaxTokens ¶
func (cmc *ChatModelConfig) GetMaxTokens() int
func (*ChatModelConfig) GetModel ¶
func (cmc *ChatModelConfig) GetModel() string
func (*ChatModelConfig) GetTemperature ¶
func (cmc *ChatModelConfig) GetTemperature() float64
func (*ChatModelConfig) GetTools ¶
func (cmc *ChatModelConfig) GetTools() map[string]any
func (*ChatModelConfig) GetTopP ¶
func (cmc *ChatModelConfig) GetTopP() float64
func (*ChatModelConfig) SetDefault ¶
func (cmc *ChatModelConfig) SetDefault(config *ChatModelConfig)
type TokenUsage ¶
Click to show internal directories.
Click to hide internal directories.