Skip to main content

Module dynamic_handler

Module dynamic_handler 

Source
Expand description

Dynamic agent card handler with HTTP caching.

DynamicAgentCardHandler calls an AgentCardProducer on every request to generate a fresh AgentCard. This is useful when the card contents depend on runtime state (e.g. feature flags, authenticated context). Supports HTTP caching via Cache-Control, ETag and If-None-Match (spec §8.6). It sends no Last-Modified, which §8.6.1 leaves optional: a card produced per request has no modification date, so the header could only claim the card changed at every request. Without one, If-Modified-Since is ignored (RFC 9110 §8.8.2.1, §13.1.3); the ETag is the validator.

Structs§

DynamicAgentCardHandler
Serves a dynamically generated AgentCard as a JSON HTTP response.

Traits§

AgentCardProducer
Trait for producing an AgentCard dynamically.