Skip to main content
All Python modules · Import and compatibility guidance

Decision events

Each completed evaluation adds a decision_result item to public output. Its value contains decision/provider versions, typed answers, the policy outcome, duration, and a safe error category when evaluation falls back. Request state, question instructions, and raw provider payloads are excluded. Private graph-to-model inputs are not presented as user turns when restoring conversation history in ADK or LangGraph. SSE and WebSocket use response.decision_result; streaming A2A tasks use metadata.harnest.type: decision_result. Playground displays an expandable Decision panel. Streamed results appear when the backend next yields an event.

Raw metadata

Raw mode keeps the normalized fields and adds raw. ADK uses its native LlmResponse metadata field names. LangGraph namespaces stream_metadata, response_metadata, usage_metadata, and additional_kwargs so fields do not collide. The primary message content and Harnest-owned event state are not copied. Native metadata can still contain provider-defined content-like values, including reasoning annotations in additional_kwargs.

Exports

AgentMetadata

One framework-neutral view of model and provider response metadata. raw is populated only when OutputPolicy explicitly selects :attr:AgentMetadataMode.RAW. The normalized fields remain available in normalized and raw modes so consumers do not need framework-specific keys.
Fields (— means no declared default):

AgentMetadata.as_dict

Return the stable public representation without empty optional fields.

AgentMetadataMode

Select how much model and provider metadata callers receive.

OutputPolicy

Control narration, tool activity, decisions, reasoning, and public metadata.
Fields (— means no declared default):

OutputPolicy.includes_intermediate_message

Return whether narration attached to an intermediate tool call is public.

OutputPolicy.includes_event

Return whether a policy-controlled event may cross public boundaries.

TokenUsage

Provider-reported token counts normalized across ADK and LangGraph.
Fields (— means no declared default):

TokenUsage.as_dict

Return the camel-case representation used by public transports.

TokenUsage.from_dict

Parse either public camel-case or internal snake-case count names.