Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefinedTool ¶
type DefinedTool interface {
// contains filtered or unexported methods
}
type OpenAICompatibleLLMProviderArgs ¶
type OpenAICompatibleLLMProviderArgs struct {
// Name is the name of the provider.
// This will be used as a prefix for model names (e.g., "myprovider/model-name").
Name string
// APIKey is the API key to use with the provider.
APIKey string `json:"-"`
// BaseURL is the base URL to use with the provider.
BaseURL string
}
type OpenAICompatibleLLMProviderOpt ¶
type OpenAICompatibleLLMProviderOpt func(*oai.OpenAICompatible)
func OpenAIWithHTTPClient ¶
func OpenAIWithHTTPClient(client *http.Client) OpenAICompatibleLLMProviderOpt
OpenAIWithHTTPClient sets the HTTP client to use with the provider.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider allows defining various LLM providers.
func NewOpenAICompatibleLLMProvider ¶
func NewOpenAICompatibleLLMProvider( args OpenAICompatibleLLMProviderArgs, opts ...OpenAICompatibleLLMProviderOpt, ) *Provider
type ReadSessionParams ¶
type ReadSessionParams = internal.ReadSessionParams
type ReadSessionResult ¶
type ReadSessionResult = internal.ReadSessionResult
type RunParams ¶
func NewTextRunParams ¶
NewTextRunParams returns parameters for a single user text message.
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
func (*Runner) ReadSession ¶
func (r *Runner) ReadSession(ctx context.Context, params ReadSessionParams) (*ReadSessionResult, error)
ReadSession reads the events for a session from the configured session service.
type RunnerArgs ¶
type RunnerArgs struct {
// Providers is a list of providers to use for the runner.
// Must include at least one provider.
Providers []*Provider
}
type RunnerOpt ¶
type RunnerOpt func(*runnerOpts)
func WithDefaultModel ¶
WithDefaultModel sets the default model to use for the runner. If caller does not set a model, the runner will use the default model.
func WithFileSystemStorage ¶
WithFileSystemStorage configures the runner to persist state under baseDir on disk. The directory is created if it does not exist. When this option is omitted, storage is in-memory only. If WithFileSystemStorage is passed multiple times, the last call wins.
func WithLogger ¶
WithLogger sets the logger to use for the runner.
func WithSystemPromptFragments ¶
func WithSystemPromptFragments(fragments ...SystemPromptFragment) RunnerOpt
WithSystemPromptFragments appends extra system prompt sections after the base template and the default assistant instruction fragment. Multiple calls append in order.
func WithToolsRegistry ¶
func WithToolsRegistry(reg *ToolsRegistry) RunnerOpt
WithToolsRegistry sets an optional tools registry. When non-nil, Genkit tool stubs are registered on the runner's Genkit instance and ADK tools are supplied from the registry.
type SystemPromptFragment ¶
type SystemPromptFragment = internal.SystemPromptFragment
SystemPromptFragment is an extra section appended after the runtime base system prompt.
type ToolContext ¶
ToolContext is the invocation context passed to agent tool handlers. It is created only inside this package (ADK bridge or test-only helpers). It embeds context.Context so a *ToolContext may be passed where a context.Context is required. ADK-specific state is not exposed on the public type.
type ToolDef ¶
type ToolDef[TArgs, TResults any] struct { Name string Description string Handler func(ctx *ToolContext, input TArgs) (TResults, error) // contains filtered or unexported fields }
ToolDef is a generic tool definition for LLM agents with typed args and results.
func NewToolDef ¶
func NewToolDef[TArgs, TResults any]( name, description string, handler func(ctx *ToolContext, input TArgs) (TResults, error), ) ToolDef[TArgs, TResults]
func (ToolDef[TArgs, TResults]) WithOutputSchema ¶
WithOutputSchema returns a copy of the tool definition with a custom output schema provided as raw JSON bytes. Use this when the output type cannot be inferred automatically (e.g., recursive types that would cause cycle-detection errors).
type ToolsRegistry ¶
type ToolsRegistry struct {
// contains filtered or unexported fields
}
ToolsRegistry allows to register tools available to the agent.
func NewToolsRegistry ¶
func NewToolsRegistry() *ToolsRegistry
NewToolsRegistry creates a new ToolsRegistry.
func (*ToolsRegistry) AddTools ¶
func (r *ToolsRegistry) AddTools(tools ...DefinedTool)