Versions in this module Expand all Collapse all v1 v1.1.0 Jun 15, 2026 Changes in this version type ChatModelConfig + Debug bool v1.0.1 Jun 2, 2026 v1.0.0 May 23, 2026 Changes in this version + type APIMessage struct + Content any + Name string + ReasoningContent string + Role string + ToolCallID string + ToolCalls []schema.ToolCall + type ChatModel struct + func NewChatModel(config *ChatModelConfig) (*ChatModel, error) + func (cm *ChatModel) Generate(ctx context.Context, input []*schema.Message) (*schema.Message, error) + func (cm *ChatModel) GetModelName() string + func (cm *ChatModel) Stream(ctx context.Context, input []*schema.Message) (*schema.StreamReader, error) + type ChatModelConfig struct + APIKey string + BaseURL string + FrequencyPenalty float64 + HTTPClient *http.Client + MaxCompletionTokens uint64 + Model string + N uint8 + PresencePenalty float64 + PromptCacheKey string + ResponseFormat ResponseFormatType + SafetyIdentifier string + Stop string + Temperature float64 + Thinking Thinking + TimeOut time.Duration + Tools []schema.Tool + TopP float64 + type ChatModelResponse struct + Choices []Choice + Created int64 + ID string + Model string + Object string + Usage schema.Usage + type Choice struct + FinishReason string + Index int + Message schema.Message + type Client struct + func NewClient(config *ChatModelConfig) *Client + func (c *Client) Generate(ctx context.Context, in []*schema.Message) (*schema.Message, error) + func (c *Client) Stream(ctx context.Context, in []*schema.Message) (*schema.StreamReader, error) + type Delta struct + Content string + ReasoningContent string + Role string + ToolCalls []schema.ToolCall + type RequestBody struct + FrequencyPenalty float64 + MaxCompletionTokens uint64 + Messages []APIMessage + Model string + N uint8 + PresencePenalty float64 + PromptCacheKey string + ResponseFormat ResponseFormatType + SafetyIdentifier string + Stream bool + StreamOptions *StreamOptions + Temperature float64 + Thinking Thinking + Tools []Tool + TopP float64 + type ResponseFormatType string + const JsonObject + const Text + type StreamChoice struct + Delta Delta + FinishReason string + Index int + type StreamOptions struct + IncludeUsage bool + type StreamResponse struct + Choices []StreamChoice + Usage *schema.Usage + type Thinking struct + Keep ThinkingKeepEnum + Type ThinkingType + type ThinkingKeepEnum string + const All + const Null + type ThinkingType string + const Disabled + const Enabled + type Tool struct + Function schema.Tool + Type ToolType + func WrapTools(tools []schema.Tool) []Tool + type ToolType string + const Function