Interface InvocationContext
- All Known Implementing Classes:
DefaultInvocationContext
public interface InvocationContext
Represents the context of a single AI Service invocation.
A new instance is created each time an AI Service method is invoked,
and it exists until the end of the AI Service invocation,
potentially spanning multiple calls to the
ChatModel.- Since:
- 1.6.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classA builder class to createInvocationContextinstances. -
Method Summary
Modifier and TypeMethodDescriptionstatic InvocationContext.Builderbuilder()Creates a new instance of theBuilderclass for constructing instances ofDefaultInvocationContext.The chat memory id parameter of the methodThe fully-qualified name of the AI Service interface where the invocation was initiated fromUnique identifier for an entire AI Service invocationThe invocation parametersdefault Map<Class<? extends LangChain4jManaged>, LangChain4jManaged> LangChain4j managed parametersThe arguments passed into the AI Service methodThe method name oninterfaceName()where the invocation was initiated fromRetrieves the point in time when the invocation occurred.default InvocationContext.BuilderConverts the current instance ofDefaultInvocationContextinto aInvocationContext.Builder, pre-populated with the current values of the instance.
-
Method Details
-
invocationId
UUID invocationId()Unique identifier for an entire AI Service invocation -
interfaceName
String interfaceName()The fully-qualified name of the AI Service interface where the invocation was initiated from- See Also:
-
methodName
String methodName()The method name oninterfaceName()where the invocation was initiated from -
methodArguments
-
chatMemoryId
Object chatMemoryId()The chat memory id parameter of the method -
invocationParameters
InvocationParameters invocationParameters()The invocation parameters -
managedParameters
LangChain4j managed parameters- Since:
- 1.8.0
-
timestamp
Instant timestamp()Retrieves the point in time when the invocation occurred. -
toBuilder
Converts the current instance ofDefaultInvocationContextinto aInvocationContext.Builder, pre-populated with the current values of the instance. -
builder
Creates a new instance of theBuilderclass for constructing instances ofDefaultInvocationContext.
-