Package io.dapr.client.domain
Class ConversationRequestAlpha2
java.lang.Object
io.dapr.client.domain.ConversationRequestAlpha2
Represents the Alpha2 conversation configuration with enhanced features including
tools, improved message handling, and better compatibility with OpenAI ChatCompletion API.
-
Constructor Summary
ConstructorsConstructorDescriptionConversationRequestAlpha2(String name, List<ConversationInputAlpha2> inputs) Constructs a ConversationRequestAlpha2 with a component name and conversation inputs. -
Method Summary
Modifier and TypeMethodDescriptionGets the context identifier.Gets the list of Dapr conversation input (Alpha2 format).Gets the metadata passing to conversation components.getName()Gets the conversation component name.Gets the parameters for all custom fields.doubleGets the temperature of the model.Gets the tool choice setting which controls which (if any) tool is called by the model.getTools()Gets the tools available to be used by the LLM during the conversation.booleanChecks if PII scrubbing is enabled.setContextId(String contextId) Sets the context identifier.setMetadata(Map<String, String> metadata) Sets the metadata passing to conversation components.setParameters(Map<String, Object> parameters) Sets the parameters for all custom fields.setScrubPii(boolean scrubPii) Enable obfuscation of sensitive information returning from the LLM.setTemperature(double temperature) Sets the temperature of the model.setToolChoice(String toolChoice) Sets the tool choice setting which controls which (if any) tool is called by the model.setTools(List<ConversationTools> tools) Sets the tools available to be used by the LLM during the conversation.
-
Constructor Details
-
Method Details
-
getName
Gets the conversation component name.- Returns:
- the conversation component name
-
getInputs
Gets the list of Dapr conversation input (Alpha2 format).- Returns:
- the list of conversation input
-
getContextId
Gets the context identifier.- Returns:
- the context identifier
-
setContextId
Sets the context identifier.- Parameters:
contextId- the context identifier to set- Returns:
- the current instance of
ConversationRequestAlpha2
-
isScrubPii
public boolean isScrubPii()Checks if PII scrubbing is enabled.- Returns:
- true if PII scrubbing is enabled, false otherwise
-
setScrubPii
Enable obfuscation of sensitive information returning from the LLM. Optional.- Parameters:
scrubPii- whether to enable PII scrubbing- Returns:
- the current instance of
ConversationRequestAlpha2
-
getTemperature
public double getTemperature()Gets the temperature of the model. Used to optimize for consistency and creativity. Optional- Returns:
- the temperature value
-
setTemperature
Sets the temperature of the model. Used to optimize for consistency and creativity. Optional- Parameters:
temperature- the temperature value to set- Returns:
- the current instance of
ConversationRequestAlpha2
-
getTools
Gets the tools available to be used by the LLM during the conversation.- Returns:
- the list of tools
-
setTools
Sets the tools available to be used by the LLM during the conversation. These are sent on a per request basis.- Parameters:
tools- the tools to set- Returns:
- the current instance of
ConversationRequestAlpha2
-
getToolChoice
Gets the tool choice setting which controls which (if any) tool is called by the model.- Returns:
- the tool choice setting
-
setToolChoice
Sets the tool choice setting which controls which (if any) tool is called by the model. - "none" means the model will not call any tool and instead generates a message - "auto" means the model can pick between generating a message or calling one or more tools - "required" requires one or more functions to be called - Alternatively, a specific tool name may be used here- Parameters:
toolChoice- the tool choice setting to set- Returns:
- the current instance of
ConversationRequestAlpha2
-
getParameters
Gets the parameters for all custom fields.- Returns:
- the parameters map
-
setParameters
Sets the parameters for all custom fields.- Parameters:
parameters- the parameters to set- Returns:
- the current instance of
ConversationRequestAlpha2
-
getMetadata
Gets the metadata passing to conversation components.- Returns:
- the metadata map
-
setMetadata
Sets the metadata passing to conversation components.- Parameters:
metadata- the metadata to set- Returns:
- the current instance of
ConversationRequestAlpha2
-