Package akka.javasdk.agent
Interface ModelCallGuardrail.CallContext
- Enclosing interface:
ModelCallGuardrail
public static interface ModelCallGuardrail.CallContext
Per-call context passed to a
ModelCallGuardrail during ModelCallGuardrail.decide(akka.javasdk.agent.ModelCallGuardrail.CallContext).
For construction-time data that does not change per call, accept a GuardrailContext
parameter in the constructor. That data is the guardrail's configured name and its config
section.
-
Method Summary
Modifier and TypeMethodDescriptionagentId()The component id of the agent this interaction belongs to.messages()All messages entering the model call, oldest first.The name of the model about to be called.The messages after the lastGuardrail.Message.AiMessage, oldest first.The id of the session this interaction belongs to.The system message, or an empty string when the agent has none.tracing()Provides access to tracing for custom application-specific tracing.
-
Method Details
-
agentId
String agentId()The component id of the agent this interaction belongs to. -
sessionId
String sessionId()The id of the session this interaction belongs to. -
modelName
String modelName()The name of the model about to be called. -
systemMessage
String systemMessage()The system message, or an empty string when the agent has none. -
messages
List<Guardrail.Message> messages()All messages entering the model call, oldest first. -
newMessages
List<Guardrail.Message> newMessages()The messages after the lastGuardrail.Message.AiMessage, oldest first. The user message on the first model call; the tool results on each later call. -
tracing
Tracing tracing()Provides access to tracing for custom application-specific tracing.Spans started through this are parented to the model call being checked, so work the guardrail performs (e.g. calling external or internal components) shows up under the interaction's trace.
- Returns:
- tracing interface for custom tracing
-