Class InvocationContext.Builder
java.lang.Object
dev.langchain4j.invocation.InvocationContext.Builder
- Enclosing interface:
InvocationContext
A builder class to create
InvocationContext
instances.- Since:
- 1.6.0
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Builder()
protected
Builder
(InvocationContext invocationContext) -
Method Summary
Modifier and TypeMethodDescription<T extends InvocationContext>
Tbuild()
Constructs an instance ofInvocationContext
using the current state of the builder.chatMemoryId
(Object memoryId) Sets the memory identifier for the builder.interfaceName
(String interfaceName) Sets the name of the interface associated with the builder.invocationId
(UUID invocationId) Sets the invocation ID.invocationParameters
(InvocationParameters invocationParameters) Sets the invocation parameters for the builder.methodArgument
(Object methodArgument) Adds a single method argument to the builder's list of method arguments.methodArguments
(List<Object> methodArguments) Sets the method arguments for the builder.methodName
(String methodName) Sets the name of the method associated with the builder.Sets the timestamp for the builder.Updates the builder's timestamp to the current system time.
-
Constructor Details
-
Builder
protected Builder() -
Builder
-
-
Method Details
-
invocationId
Sets the invocation ID. -
interfaceName
Sets the name of the interface associated with the builder. -
methodName
Sets the name of the method associated with the builder. -
methodArguments
Sets the method arguments for the builder. If the provided list of method arguments is not null, they will be added to the existing list of method arguments. -
methodArgument
Adds a single method argument to the builder's list of method arguments. If the provided argument is not null, it will be added to the collection. -
chatMemoryId
Sets the memory identifier for the builder. -
invocationParameters
Sets the invocation parameters for the builder. -
timestamp
Sets the timestamp for the builder. -
timestampNow
Updates the builder's timestamp to the current system time.- Returns:
- This Builder instance with the timestamp set to the current time.
-
build
Constructs an instance ofInvocationContext
using the current state of the builder. -
invocationId
-
interfaceName
-
methodName
-
methodArguments
-
chatMemoryId
-
invocationParameters
-
timestamp
-