agent

package
v0.0.0-...-fad2d0c Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultGeminiModel    = "gemini-2.0-flash"
	DefaultAnthropicModel = "claude-sonnet-4-20250514"
	DefaultOllamaModel    = "llama3.2"
)

Default model names used when not specified in configuration

Variables

This section is empty.

Functions

func CreateGoogleADKAgent

func CreateGoogleADKAgent(ctx context.Context, agentConfig *adk.AgentConfig, agentName string, stsPlugin *sts.TokenPropagationPlugin, extraTools ...tool.Tool) (agent.Agent, error)

CreateGoogleADKAgent creates a Google ADK agent from AgentConfig. agentName is used as the ADK agent identity (appears in event Author field). extraTools are appended to the agent's tool list (e.g. save_memory). Optional stsPlugin can be provided for token propagation to MCP tools; pass nil if token propagation is not needed.

func CreateLLM

func CreateLLM(ctx context.Context, m adk.Model, log logr.Logger) (adkmodel.LLM, error)

CreateLLM creates an adkmodel.LLM from the model configuration. This is exported to allow reuse of model creation logic (e.g., for memory summarization).

func MakeApprovalCallback

func MakeApprovalCallback(toolsRequiringApproval map[string]bool) llmagent.BeforeToolCallback

MakeApprovalCallback creates a BeforeToolCallback that gates execution of tools in the approval set behind request_confirmation / ToolConfirmation. Port of kagent-adk/src/kagent/adk/_approval.py:make_approval_callback().

func MakeMCPAppModelResultCallback

func MakeMCPAppModelResultCallback(appToolNames map[string]bool) llmagent.BeforeModelCallback

MakeMCPAppModelResultCallback replaces what the model sees for MCP App (UI-rendering) tool results: instead of the heavy render payload it receives a terminal directive (see mcpAppRenderedNotice). The full result is still streamed to the UI separately, so this only changes the model's view and prevents the model from looping on the rendering tool. Errors are passed through so the model can still react to and recover from failures.

func MakeStripConfirmationPartsCallback

func MakeStripConfirmationPartsCallback() llmagent.BeforeModelCallback

stripConfirmationPartsCallback is a BeforeModelCallback that removes adk_request_confirmation FunctionCall and FunctionResponse parts from the LLM request before it reaches any model provider. These are synthetic ADK HITL events the LLM never produced and does not need to reason about. The session still stores them so ADK's resume machinery can find them.

Types

This section is empty.

Jump to

Keyboard shortcuts

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