Class Assistant

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

public final class Assistant extends Object implements com.azure.json.JsonSerializable<Assistant>
Represents an assistant that can call the model and use tools.
  • Method Summary

    Modifier and Type
    Method
    Description
    static Assistant
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of Assistant from the JsonReader.
    Get the createdAt property: The Unix timestamp, in seconds, representing when this object was created.
    Get the description property: The description of the assistant.
    Get the id property: The identifier, which can be referenced in API endpoints.
    Get the instructions property: The system instructions for the assistant to use.
    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.
    Get the model property: The ID of the model to use.
    Get the name property: The name of the assistant.
    Get the object property: The object type, which is always assistant.
    Get the responseFormat property: The response format of the tool calls used by this assistant.
    Get the temperature property: What sampling temperature to use, between 0 and 2.
    Get the toolResources property: A set of resources that are used by the assistant's tools.
    Get the tools property: The collection of tools enabled for the assistant.
    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.
    com.azure.json.JsonWriter
    toJson(com.azure.json.JsonWriter jsonWriter)

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.azure.json.JsonSerializable

    toJson, toJson, toJsonBytes, toJsonString
  • Method Details

    • getId

      public String getId()
      Get the id property: The identifier, which can be referenced in API endpoints.
      Returns:
      the id value.
    • getObject

      public String getObject()
      Get the object property: The object type, which is always assistant.
      Returns:
      the object value.
    • getCreatedAt

      public OffsetDateTime getCreatedAt()
      Get the createdAt property: The Unix timestamp, in seconds, representing when this object was created.
      Returns:
      the createdAt value.
    • getName

      public String getName()
      Get the name property: The name of the assistant.
      Returns:
      the name value.
    • getDescription

      public String getDescription()
      Get the description property: The description of the assistant.
      Returns:
      the description value.
    • getModel

      public String getModel()
      Get the model property: The ID of the model to use.
      Returns:
      the model value.
    • getInstructions

      public String getInstructions()
      Get the instructions property: The system instructions for the assistant to use.
      Returns:
      the instructions value.
    • getTools

      public List<ToolDefinition> getTools()
      Get the tools property: The collection of tools enabled for the assistant.
      Returns:
      the tools value.
    • 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.
    • toJson

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

      public static Assistant fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of Assistant from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of Assistant 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 Assistant.
    • getToolResources

      public ToolResources getToolResources()
      Get the toolResources property: A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs.
      Returns:
      the toolResources value.
    • 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.
    • 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.
    • getResponseFormat

      public AssistantsApiResponseFormatOption getResponseFormat()
      Get the responseFormat property: The response format of the tool calls used by this assistant.
      Returns:
      the responseFormat value.