Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a Gemini client wrapper It implements the provider.Provider interface
func NewClient ¶
func NewClient(ctx context.Context, cfg *latest.ModelConfig, env environment.Provider, opts ...options.Opt) (*Client, error)
NewClient creates a new Gemini client from the provided configuration
func (*Client) CreateChatCompletion ¶
func (c *Client) CreateChatCompletion( ctx context.Context, messages []chat.Message, ) (string, error)
CreateChatCompletion creates a non-streaming chat completion
type StreamAdapter ¶
type StreamAdapter struct {
// contains filtered or unexported fields
}
StreamAdapter adapts the Gemini streaming iterator to chat.MessageStream
func NewStreamAdapter ¶
func NewStreamAdapter(iter func(func(*genai.GenerateContentResponse, error) bool), model string) *StreamAdapter
NewStreamAdapter constructs a StreamAdapter from Gemini's iterator
func (*StreamAdapter) Recv ¶
func (g *StreamAdapter) Recv() (chat.MessageStreamResponse, error)
Recv gets the next Gemini content chunk
Click to show internal directories.
Click to hide internal directories.