Class AgentInvocation
java.lang.Object
dev.langchain4j.agentic.observability.AgentInvocation
-
Method Summary
Modifier and TypeMethodDescriptionagent()Returns the response of the decision model of a decision agent, with its answers and their probabilities.booleandone()duration()inputs()intReturns the zero-based iteration index when this invocation is part of a loop, or -1 otherwise.Returns the name of the model that answered the last LLM call of an AI agent, or the decision call of a decision agent, as reported by the provider in the response metadata.output()booleanskipped()Returnstrueif the agent was skipped instead of being invoked, because its activation condition was false or because it is optional and one of its arguments was missing.Returns why the agent was skipped, ornullif it was invoked.Returns the token usage of the last LLM call of an AI agent, or of the decision call of a decision agent.toString()int
-
Method Details
-
done
public boolean done() -
skipped
public boolean skipped()Returnstrueif the agent was skipped instead of being invoked, because its activation condition was false or because it is optional and one of its arguments was missing. -
skipReason
Returns why the agent was skipped, ornullif it was invoked. -
startTime
-
finishTime
-
duration
-
agent
-
agenticScope
-
inputs
-
output
-
totalTokenCount
public int totalTokenCount() -
tokenUsage
Returns the token usage of the last LLM call of an AI agent, or of the decision call of a decision agent. It is empty if the agent called no model, like a workflow or a non-AI agent, if it was skipped, or if the provider didn't report the token usage. -
modelName
Returns the name of the model that answered the last LLM call of an AI agent, or the decision call of a decision agent, as reported by the provider in the response metadata. It is empty if the agent called no model, like a workflow or a non-AI agent, if it was skipped, or if the provider didn't report the model name. -
decisionResponse
Returns the response of the decision model of a decision agent, with its answers and their probabilities. It is empty for every other kind of agent, and if the agent was skipped. -
iterationIndex
public int iterationIndex()Returns the zero-based iteration index when this invocation is part of a loop, or -1 otherwise. -
nestedInvocations
-
toolExecutions
-
toString
-