Documentation
¶
Index ¶
- Constants
- type Client
- func (c *Client) Chat(messages []Message, thinkingEnabled bool, tools []Tool) (string, string, []FunctionCallResult, *TokenUsage, error)
- func (c *Client) ChatStream(messages []Message, thinkingEnabled bool, tools []Tool, ...) (string, []FunctionCallResult, *TokenUsage, error)
- func (c *Client) Close()
- type FunctionCallData
- type FunctionCallResult
- type FunctionResponseData
- type GeminiProvider
- func (p *GeminiProvider) Chat(messages []common.Message, tools []common.Tool, thinkingEnabled bool) (*common.ChatResponse, error)
- func (p *GeminiProvider) ChatStream(messages []common.Message, tools []common.Tool, thinkingEnabled bool, ...) (*common.ChatResponse, error)
- func (p *GeminiProvider) Close() error
- type Message
- type StreamCallback
- type TokenUsage
- type Tool
Constants ¶
const (
MaxOutputTokens = 8192
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps the Google GenAI SDK client.
func NewClientWithConfig ¶
NewClientWithConfig creates a new Gemini client with explicit API key and model.
func (*Client) Chat ¶
func (c *Client) Chat(messages []Message, thinkingEnabled bool, tools []Tool) (string, string, []FunctionCallResult, *TokenUsage, error)
Chat sends a non-streaming chat request.
func (*Client) ChatStream ¶
func (c *Client) ChatStream(messages []Message, thinkingEnabled bool, tools []Tool, callback StreamCallback) (string, []FunctionCallResult, *TokenUsage, error)
ChatStream sends a streaming chat request.
type FunctionCallData ¶
type FunctionCallData struct {
ID string
Name string
Args map[string]interface{}
ThoughtSignature string
}
FunctionCallData is a tool call from a prior assistant message (for history).
type FunctionCallResult ¶
type FunctionCallResult struct {
ID string
Name string
Args map[string]interface{}
ThoughtSignature string
}
FunctionCallResult holds a parsed tool call from the model response.
type FunctionResponseData ¶
FunctionResponseData is the tool result sent back to the model.
type GeminiProvider ¶
type GeminiProvider struct {
// contains filtered or unexported fields
}
GeminiProvider implements common.Provider for Google Gemini.
func NewGeminiProvider ¶
func NewGeminiProvider(config common.ProviderConfig) (*GeminiProvider, error)
NewGeminiProvider creates a new Gemini provider.
func (*GeminiProvider) Chat ¶
func (p *GeminiProvider) Chat(messages []common.Message, tools []common.Tool, thinkingEnabled bool) (*common.ChatResponse, error)
Chat sends a non-streaming chat request.
func (*GeminiProvider) ChatStream ¶
func (p *GeminiProvider) ChatStream(messages []common.Message, tools []common.Tool, thinkingEnabled bool, callback common.StreamCallback) (*common.ChatResponse, error)
ChatStream sends a streaming chat request.
type Message ¶
type Message struct {
Role string
Content string
ReasoningContent string
FunctionResponse *FunctionResponseData
FunctionCalls []FunctionCallData
}
Message is the internal message format for the Gemini client.
type StreamCallback ¶
StreamCallback is called for each chunk during streaming.
type TokenUsage ¶
TokenUsage represents token usage information.