Class PlannerModelResponse
java.lang.Object
dev.langchain4j.agentic.observability.PlannerModelResponse
The token usage and the model name of the response of a model called by the planner of an agent, like the one a
supervisor asks which subagent to invoke next or the decision model of a decision router, reported to
AgentListener.onPlannerModelResponse(PlannerModelResponse) when the planner receives that response. These
are the model calls that the planner makes itself and reports through
reportChatModelResponse or
reportDecisionModelResponse, and not the ones of its subagents,
which are reported by their own invocations.-
Constructor Summary
ConstructorsConstructorDescriptionPlannerModelResponse(AgenticScope agenticScope, AgentInstance agent, @Nullable TokenUsage tokenUsage, @Nullable String modelName) -
Method Summary
Modifier and TypeMethodDescriptionagent()agentId()booleaninthashCode()@Nullable StringReturns the name of the model that answered this call, ornullif the provider didn't report it.@Nullable TokenUsageReturns the token usage of this model call, ornullif the provider didn't report it.toString()
-
Constructor Details
-
PlannerModelResponse
public PlannerModelResponse(AgenticScope agenticScope, AgentInstance agent, @Nullable TokenUsage tokenUsage, @Nullable String modelName) - Parameters:
agenticScope- the scope of the agentic system running the planneragent- the agent whose planner called the modeltokenUsage- the token usage of this model call, ornullif the provider didn't report itmodelName- the name of the model that answered this call, ornullif the provider didn't report it
-
-
Method Details
-
agenticScope
-
agent
-
tokenUsage
Returns the token usage of this model call, ornullif the provider didn't report it. -
modelName
Returns the name of the model that answered this call, ornullif the provider didn't report it. -
agentName
-
agentId
-
equals
-
hashCode
-
toString
-