Class CreateAndRunThreadOptions

java.lang.Object
com.azure.ai.openai.assistants.models.CreateAndRunThreadOptions
All Implemented Interfaces:
com.azure.json.JsonSerializable<CreateAndRunThreadOptions>

public final class CreateAndRunThreadOptions extends Object implements com.azure.json.JsonSerializable<CreateAndRunThreadOptions>
The details used when creating and immediately running a new assistant thread.
  • Constructor Details

    • CreateAndRunThreadOptions

      public CreateAndRunThreadOptions(String assistantId)
      Creates an instance of CreateAndRunThreadOptions class.
      Parameters:
      assistantId - the assistantId value to set.
  • Method Details

    • getAssistantId

      public String getAssistantId()
      Get the assistantId property: The ID of the assistant for which the thread should be created.
      Returns:
      the assistantId value.
    • getThread

      public AssistantThreadCreationOptions getThread()
      Get the thread property: The details used to create the new thread. If no thread is provided, an empty one will be created.
      Returns:
      the thread value.
    • setThread

      Set the thread property: The details used to create the new thread. If no thread is provided, an empty one will be created.
      Parameters:
      thread - the thread value to set.
      Returns:
      the CreateAndRunThreadOptions object itself.
    • getModel

      public String getModel()
      Get the model property: The overridden model that the assistant should use to run the thread.
      Returns:
      the model value.
    • setModel

      public CreateAndRunThreadOptions setModel(String model)
      Set the model property: The overridden model that the assistant should use to run the thread.
      Parameters:
      model - the model value to set.
      Returns:
      the CreateAndRunThreadOptions object itself.
    • getInstructions

      public String getInstructions()
      Get the instructions property: The overridden system instructions the assistant should use to run the thread.
      Returns:
      the instructions value.
    • setInstructions

      public CreateAndRunThreadOptions setInstructions(String instructions)
      Set the instructions property: The overridden system instructions the assistant should use to run the thread.
      Parameters:
      instructions - the instructions value to set.
      Returns:
      the CreateAndRunThreadOptions object itself.
    • getTools

      public List<ToolDefinition> getTools()
      Get the tools property: The overridden list of enabled tools the assistant should use to run the thread.
      Returns:
      the tools value.
    • setTools

      public CreateAndRunThreadOptions setTools(List<ToolDefinition> tools)
      Set the tools property: The overridden list of enabled tools the assistant should use to run the thread.
      Parameters:
      tools - the tools value to set.
      Returns:
      the CreateAndRunThreadOptions object itself.
    • getMetadata

      public Map<String,String> getMetadata()
      Get the metadata property: A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.
      Returns:
      the metadata value.
    • setMetadata

      public CreateAndRunThreadOptions setMetadata(Map<String,String> metadata)
      Set the metadata property: A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.
      Parameters:
      metadata - the metadata value to set.
      Returns:
      the CreateAndRunThreadOptions object itself.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<CreateAndRunThreadOptions>
      Throws:
      IOException
    • fromJson

      public static CreateAndRunThreadOptions fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of CreateAndRunThreadOptions from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of CreateAndRunThreadOptions if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
      Throws:
      IllegalStateException - If the deserialized JSON object was missing any required properties.
      IOException - If an error occurs while reading the CreateAndRunThreadOptions.
    • getToolResources

      public UpdateToolResourcesOptions getToolResources()
      Get the toolResources property: Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis.
      Returns:
      the toolResources value.
    • setToolResources

      public CreateAndRunThreadOptions setToolResources(UpdateToolResourcesOptions toolResources)
      Set the toolResources property: Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis.
      Parameters:
      toolResources - the toolResources value to set.
      Returns:
      the CreateAndRunThreadOptions object itself.
    • getTemperature

      public Double getTemperature()
      Get the temperature property: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
      Returns:
      the temperature value.
    • setTemperature

      public CreateAndRunThreadOptions setTemperature(Double temperature)
      Set the temperature property: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
      Parameters:
      temperature - the temperature value to set.
      Returns:
      the CreateAndRunThreadOptions object itself.
    • getTopP

      public Double getTopP()
      Get the topP property: An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or temperature but not both.
      Returns:
      the topP value.
    • setTopP

      public CreateAndRunThreadOptions setTopP(Double topP)
      Set the topP property: An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or temperature but not both.
      Parameters:
      topP - the topP value to set.
      Returns:
      the CreateAndRunThreadOptions object itself.
    • getMaxPromptTokens

      public Integer getMaxPromptTokens()
      Get the maxPromptTokens property: The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info.
      Returns:
      the maxPromptTokens value.
    • setMaxPromptTokens

      public CreateAndRunThreadOptions setMaxPromptTokens(Integer maxPromptTokens)
      Set the maxPromptTokens property: The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info.
      Parameters:
      maxPromptTokens - the maxPromptTokens value to set.
      Returns:
      the CreateAndRunThreadOptions object itself.
    • getMaxCompletionTokens

      public Integer getMaxCompletionTokens()
      Get the maxCompletionTokens property: The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info.
      Returns:
      the maxCompletionTokens value.
    • setMaxCompletionTokens

      public CreateAndRunThreadOptions setMaxCompletionTokens(Integer maxCompletionTokens)
      Set the maxCompletionTokens property: The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info.
      Parameters:
      maxCompletionTokens - the maxCompletionTokens value to set.
      Returns:
      the CreateAndRunThreadOptions object itself.
    • getTruncationStrategy

      public TruncationObject getTruncationStrategy()
      Get the truncationStrategy property: The strategy to use for dropping messages as the context windows moves forward.
      Returns:
      the truncationStrategy value.
    • setTruncationStrategy

      public CreateAndRunThreadOptions setTruncationStrategy(TruncationObject truncationStrategy)
      Set the truncationStrategy property: The strategy to use for dropping messages as the context windows moves forward.
      Parameters:
      truncationStrategy - the truncationStrategy value to set.
      Returns:
      the CreateAndRunThreadOptions object itself.
    • getToolChoice

      public AssistantsApiToolChoiceOption getToolChoice()
      Get the toolChoice property: Controls whether or not and which tool is called by the model.
      Returns:
      the toolChoice value.
    • setToolChoice

      public CreateAndRunThreadOptions setToolChoice(AssistantsApiToolChoiceOption toolChoice)
      Set the toolChoice property: Controls whether or not and which tool is called by the model.
      Parameters:
      toolChoice - the toolChoice value to set.
      Returns:
      the CreateAndRunThreadOptions object itself.
    • getResponseFormat

      public AssistantsApiResponseFormatOption getResponseFormat()
      Get the responseFormat property: Specifies the format that the model must output.
      Returns:
      the responseFormat value.
    • setResponseFormat

      public CreateAndRunThreadOptions setResponseFormat(AssistantsApiResponseFormatOption responseFormat)
      Set the responseFormat property: Specifies the format that the model must output.
      Parameters:
      responseFormat - the responseFormat value to set.
      Returns:
      the CreateAndRunThreadOptions object itself.
    • isParallelToolCalls

      public Boolean isParallelToolCalls()
      Get the parallelToolCalls property: Whether to enable parallel function calling during tool use.
      Returns:
      the parallelToolCalls value.
    • setParallelToolCalls

      public CreateAndRunThreadOptions setParallelToolCalls(Boolean parallelToolCalls)
      Set the parallelToolCalls property: Whether to enable parallel function calling during tool use.
      Parameters:
      parallelToolCalls - the parallelToolCalls value to set.
      Returns:
      the CreateAndRunThreadOptions object itself.