gemini

package
v0.0.0-...-919d8db Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2026 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AgentToolsToGenAISchema

func AgentToolsToGenAISchema(tools []agent.ToolDefinition) ([]*genai.Tool, error)

AgentToolsToGenAISchema converts a map of tools to a list of function definitions using genai.Schema for the function parameters.

func ConvertJSONSchemaToGenAISchema

func ConvertJSONSchemaToGenAISchema(js *jsonschema.Schema) *genai.Schema

ConvertJSONSchemaToGenAISchema converts a jsonschema.Schema to a genai.Schema.

func GenAISchema

func GenAISchema[T any]() *genai.Schema

GenAISchema converts a Go type to a genai.Schema representation. This is the equivalent of JSONSchema but for genai.Schema.

func ToolToGenAISchema

func ToolToGenAISchema(tool agent.ToolDefinition) (*genai.Schema, error)

ToolToGenAISchema converts a Tool to a genai.Schema.

func TypeToGenAISchema

func TypeToGenAISchema(t reflect.Type) *genai.Schema

TypeToGenAISchema converts a reflect.Type to a genai.Schema.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client wraps the Gemini client to implement agent.LLMClient

func New

func New(client *genai.Client, modelName string) *Client

New creates a new Client

func (*Client) CreateMessages

func (c *Client) CreateMessages(ctx context.Context, req agent.MessagesRequest, onUpdate func(agent.MessagesResponse)) (agent.MessagesResponse, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL