Documentation
¶
Index ¶
- func New(ctx context.Context, opts ...ai.ClientOption) (ai.AI, error)
- func NewWithClient(client *genai.Client, model string) ai.AI
- type ChatResponse
- type ChatSession
- type ChatStream
- type Gemini
- func (ai *Gemini) Chat(ctx context.Context, parts ...ai.Part) (ai.ChatResponse, error)
- func (ai *Gemini) ChatSession() ai.ChatSession
- func (ai *Gemini) ChatStream(ctx context.Context, parts ...ai.Part) (ai.ChatStream, error)
- func (Gemini) LLMs() ai.LLMs
- func (gemini *Gemini) Limit() (rpm int64)
- func (gemini *Gemini) Model(ctx context.Context) (string, error)
- func (ai *Gemini) SetCount(i int64)
- func (gemini *Gemini) SetFunctionCall(f []ai.Function, mode ai.FunctionCallingMode)
- func (ai *Gemini) SetJSONResponse(set bool, schema *ai.JSONSchema)
- func (gemini *Gemini) SetLimit(rpm int64)
- func (ai *Gemini) SetMaxTokens(i int64)
- func (ai *Gemini) SetModel(model string)
- func (ai *Gemini) SetTemperature(f float64)
- func (ai *Gemini) SetTopP(f float64)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ChatResponse ¶
type ChatResponse struct {
*genai.GenerateContentResponse
}
func (*ChatResponse) FunctionCalls ¶ added in v1.0.19
func (resp *ChatResponse) FunctionCalls() (res []ai.FunctionCall)
func (*ChatResponse) Raw ¶ added in v1.0.19
func (resp *ChatResponse) Raw() any
func (*ChatResponse) Results ¶
func (resp *ChatResponse) Results() (res []string)
func (*ChatResponse) String ¶ added in v1.0.2
func (resp *ChatResponse) String() string
func (*ChatResponse) TokenCount ¶ added in v1.0.13
func (resp *ChatResponse) TokenCount() (res ai.TokenCount)
type ChatSession ¶
type ChatSession struct {
// contains filtered or unexported fields
}
func (*ChatSession) Chat ¶
func (session *ChatSession) Chat(ctx context.Context, parts ...ai.Part) (ai.ChatResponse, error)
func (*ChatSession) ChatStream ¶
func (session *ChatSession) ChatStream(ctx context.Context, parts ...ai.Part) (ai.ChatStream, error)
func (*ChatSession) History ¶ added in v1.0.2
func (session *ChatSession) History() (history []ai.Content)
type ChatStream ¶
type ChatStream struct {
// contains filtered or unexported fields
}
func (*ChatStream) Close ¶ added in v1.0.2
func (stream *ChatStream) Close() error
func (*ChatStream) Next ¶
func (stream *ChatStream) Next() (ai.ChatResponse, error)
type Gemini ¶
func (*Gemini) ChatSession ¶
func (ai *Gemini) ChatSession() ai.ChatSession
func (*Gemini) ChatStream ¶
func (*Gemini) SetFunctionCall ¶ added in v1.0.19
func (gemini *Gemini) SetFunctionCall(f []ai.Function, mode ai.FunctionCallingMode)
func (*Gemini) SetJSONResponse ¶ added in v1.0.11
func (ai *Gemini) SetJSONResponse(set bool, schema *ai.JSONSchema)
func (*Gemini) SetMaxTokens ¶
func (*Gemini) SetTemperature ¶
Click to show internal directories.
Click to hide internal directories.