adkv2

package module
v0.15.3 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Overview

Package adkv2 adapts core-models to the ADK major its import path names. mast and core-agent are both on ADK v2, and this is the only adapter module; a future ADK major gets its own module beside it.

Every conversion is a field copy: llm.Request and llm.Response mirror ADK's types, and this module's tests fail the day ADK adds a field the mirror lacks. Pointers and maps are shared, not cloned, exactly as passing the ADK value through would share them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ADKRequest

func ADKRequest(r *llm.Request) *model.LLMRequest

ADKRequest converts a core-models request. Tools is left nil.

func ADKResponse

func ADKResponse(r *llm.Response) *model.LLMResponse

ADKResponse converts a core-models response.

func FromADK

func FromADK(m model.LLM) llm.LLM

FromADK adapts an ADK model.LLM to llm.LLM, so a decorator written against core-models can sit in front of a model ADK built. Unwrapping the result of Wrap hands back the original.

func GroundingProjection added in v0.7.0

func GroundingProjection(inner session.Service) session.Service

GroundingProjection wraps a session.Service so that every event carrying Gemini Google Search grounding is followed by synthetic events surfacing that evidence: one per search query the model issued, then one per grounded web source, each authored gemini.AuthorGoogleSearch. The lines come from gemini.GroundingEvidence, the ADK-free half of this projection.

The synthetic events share the parent's InvocationID and Branch, so event-log queries by invocation, author or branch find them. Their Content.Role is empty, so ADK's content processor leaves them out of the conversation it sends the model: they are for audit and display, not context.

Wrap the service before handing it to the runner:

svc = adkv2.GroundingProjection(svc)

func Request

func Request(r *model.LLMRequest) *llm.Request

Request converts an ADK request. Its Tools map has no counterpart and is dropped: it holds ADK tool objects for ADK's own dispatch, and the declarations a provider sends are in Config.Tools.

func Response

func Response(r *model.LLMResponse) *llm.Response

Response converts an ADK response.

func Wrap

func Wrap(m llm.LLM) model.LLM

Wrap adapts a core-models LLM to ADK's model.LLM. Wrapping the result of FromADK hands back the original ADK model rather than stacking two adapters.

Types

This section is empty.

Jump to

Keyboard shortcuts

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