Class ConversationRequestAlpha2

java.lang.Object
io.dapr.client.domain.ConversationRequestAlpha2

public class ConversationRequestAlpha2 extends Object
Represents the Alpha2 conversation configuration with enhanced features including tools, improved message handling, and better compatibility with OpenAI ChatCompletion API.
  • Constructor Details

    • ConversationRequestAlpha2

      public ConversationRequestAlpha2(String name, List<ConversationInputAlpha2> inputs)
      Constructs a ConversationRequestAlpha2 with a component name and conversation inputs.
      Parameters:
      name - The name of the Dapr conversation component. See a list of all available conversation components
      inputs - the list of Dapr conversation inputs (Alpha2 format)
      See Also:
  • Method Details

    • getName

      public String getName()
      Gets the conversation component name.
      Returns:
      the conversation component name
    • getInputs

      public List<ConversationInputAlpha2> getInputs()
      Gets the list of Dapr conversation input (Alpha2 format).
      Returns:
      the list of conversation input
    • getContextId

      public String getContextId()
      Gets the context identifier.
      Returns:
      the context identifier
    • setContextId

      public ConversationRequestAlpha2 setContextId(String contextId)
      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

      public ConversationRequestAlpha2 setScrubPii(boolean scrubPii)
      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

      public ConversationRequestAlpha2 setTemperature(double temperature)
      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

      public List<ConversationTools> 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

      public String getToolChoice()
      Gets the tool choice setting which controls which (if any) tool is called by the model.
      Returns:
      the tool choice setting
    • setToolChoice

      public ConversationRequestAlpha2 setToolChoice(String toolChoice)
      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

      public Map<String,Object> getParameters()
      Gets the parameters for all custom fields.
      Returns:
      the parameters map
    • setParameters

      public ConversationRequestAlpha2 setParameters(Map<String,Object> parameters)
      Sets the parameters for all custom fields.
      Parameters:
      parameters - the parameters to set
      Returns:
      the current instance of ConversationRequestAlpha2
    • getMetadata

      public Map<String,String> getMetadata()
      Gets the metadata passing to conversation components.
      Returns:
      the metadata map
    • setMetadata

      public ConversationRequestAlpha2 setMetadata(Map<String,String> metadata)
      Sets the metadata passing to conversation components.
      Parameters:
      metadata - the metadata to set
      Returns:
      the current instance of ConversationRequestAlpha2