Class AiServiceTokenStreamParameters.Builder
java.lang.Object
dev.langchain4j.service.AiServiceTokenStreamParameters.Builder
- Enclosing class:
AiServiceTokenStreamParameters
Builder for
AiServiceTokenStreamParameters.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionavailableTools(List<ToolSpecification> availableTools) Deprecated.build()Builds a newAiServiceTokenStreamParameters.commonGuardrailParams(GuardrailRequestParams commonGuardrailParams) Sets the common guardrail parameters for validating interactions between a user and a language model.context(AiServiceContext context) Sets the AI service context.effectiveTools(List<ToolSpecification> effectiveTools) Deprecated.usetoolServiceContext(ToolServiceContext)insteadinvocationContext(InvocationContext invocationContext) messages(List<ChatMessage> messages) Sets the messages.Sets the method key.retrievedContents(List<Content> retrievedContents) Sets the retrieved contents.toolExecutor(Executor toolExecutor) toolExecutors(Map<String, ToolExecutor> toolExecutors) Deprecated.usetoolServiceContext(ToolServiceContext)insteadtoolServiceContext(ToolServiceContext toolServiceContext) Sets the tool service context.toolSpecifications(List<ToolSpecification> toolSpecifications) Deprecated.usetoolServiceContext(ToolServiceContext)instead
-
Constructor Details
-
Builder
protected Builder()
-
-
Method Details
-
messages
Sets the messages.- Parameters:
messages- the messages- Returns:
- this builder
-
toolServiceContext
public AiServiceTokenStreamParameters.Builder toolServiceContext(ToolServiceContext toolServiceContext) Sets the tool service context.- Since:
- 1.13.0
-
effectiveTools
@Deprecated(since="1.13.0") public AiServiceTokenStreamParameters.Builder effectiveTools(List<ToolSpecification> effectiveTools) Deprecated.usetoolServiceContext(ToolServiceContext)insteadSets effective tool specifications that should be included in the nextChatRequest.- See Also:
-
toolSpecifications
@Deprecated(since="1.12.0") public AiServiceTokenStreamParameters.Builder toolSpecifications(List<ToolSpecification> toolSpecifications) Deprecated.usetoolServiceContext(ToolServiceContext)insteadSets tool specifications that should be included in the nextChatRequest. -
availableTools
@Deprecated(since="1.13.0") public AiServiceTokenStreamParameters.Builder availableTools(List<ToolSpecification> availableTools) Deprecated.usetoolServiceContext(ToolServiceContext)insteadSets all available tool specifications configured for AI service.- See Also:
-
toolExecutors
@Deprecated(since="1.13.0") public AiServiceTokenStreamParameters.Builder toolExecutors(Map<String, ToolExecutor> toolExecutors) Deprecated.usetoolServiceContext(ToolServiceContext)insteadSets the tool executors. -
toolArgumentsErrorHandler
public AiServiceTokenStreamParameters.Builder toolArgumentsErrorHandler(ToolArgumentsErrorHandler handler) - Since:
- 1.4.0
-
toolExecutionErrorHandler
public AiServiceTokenStreamParameters.Builder toolExecutionErrorHandler(ToolExecutionErrorHandler handler) - Since:
- 1.4.0
-
toolExecutor
- Since:
- 1.4.0
-
retrievedContents
Sets the retrieved contents.- Parameters:
retrievedContents- the retrieved contents- Returns:
- this builder
-
context
Sets the AI service context.- Parameters:
context- the AI service context- Returns:
- this builder
-
invocationContext
public AiServiceTokenStreamParameters.Builder invocationContext(InvocationContext invocationContext) -
commonGuardrailParams
public AiServiceTokenStreamParameters.Builder commonGuardrailParams(GuardrailRequestParams commonGuardrailParams) Sets the common guardrail parameters for validating interactions between a user and a language model.- Parameters:
commonGuardrailParams- an instance ofGuardrailRequestParamscontaining the shared parameters required for guardrail checks, such as chat memory, user message template, and additional variables.- Returns:
- this builder instance.
-
methodKey
Sets the method key.- Parameters:
methodKey- the method key- Returns:
- this builder
-
build
Builds a newAiServiceTokenStreamParameters.- Returns:
- a new
AiServiceTokenStreamParameters
-
toolServiceContext(ToolServiceContext)instead