Record Class CurrentPlanningContext
java.lang.Object
java.lang.Record
dev.langchain4j.agentic.internal.CurrentPlanningContext
- All Implemented Interfaces:
LangChain4jManaged
public record CurrentPlanningContext(PlanningContext planningContext)
extends Record
implements LangChain4jManaged
The
PlanningContext of the planner calling a model on the current thread. A planner puts it in the
LangChain4jManaged parameters around a model call that it cannot report itself, because the call is made
by a component with no access to the planning context: an AI service shared by all the invocations on the same
scope, which reports through its listener, or the summarizer of the supervisor
context, which runs inside the request transformer of that AI service.-
Field Summary
Fields inherited from interface LangChain4jManaged
CURRENT -
Constructor Summary
ConstructorsConstructorDescriptionCurrentPlanningContext(PlanningContext planningContext) Creates an instance of aCurrentPlanningContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the listener that a planner registers on an AI service that it calls with its planning context in the managed parameters.Returns the value of theplanningContextrecord component.static voidreportChatModelResponse(ChatResponse chatResponse) Reports the response of a model to the planning context of the current thread, if there is one.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CurrentPlanningContext
Creates an instance of aCurrentPlanningContextrecord class.- Parameters:
planningContext- the value for theplanningContextrecord component
-
-
Method Details
-
reportChatModelResponse
Reports the response of a model to the planning context of the current thread, if there is one. -
modelResponseListener
Returns the listener that a planner registers on an AI service that it calls with its planning context in the managed parameters. It reports each response that the AI service receives from its model to the planning context found in the invocation context of the event, if there is one, as soon as the response is received: so also a response that the AI service then fails to parse. -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
planningContext
Returns the value of theplanningContextrecord component.- Returns:
- the value of the
planningContextrecord component
-