Class ChatCompletionSkill

All Implemented Interfaces:
com.azure.json.JsonSerializable<SearchIndexerSkill>

public final class ChatCompletionSkill extends WebApiSkill
A skill that calls a language model via Azure AI Foundry's Chat Completions endpoint.
  • Constructor Details

    • ChatCompletionSkill

      public ChatCompletionSkill(List<InputFieldMappingEntry> inputs, List<OutputFieldMappingEntry> outputs, String uri)
      Creates an instance of ChatCompletionSkill class.
      Parameters:
      inputs - the inputs value to set.
      outputs - the outputs value to set.
      uri - the uri value to set.
  • Method Details

    • getOdataType

      public String getOdataType()
      Get the odataType property: A URI fragment specifying the type of skill.
      Overrides:
      getOdataType in class WebApiSkill
      Returns:
      the odataType value.
    • getApiKey

      public String getApiKey()
      Get the apiKey property: API key for authenticating to the model. Both apiKey and authIdentity cannot be specified at the same time.
      Returns:
      the apiKey value.
    • setApiKey

      public ChatCompletionSkill setApiKey(String apiKey)
      Set the apiKey property: API key for authenticating to the model. Both apiKey and authIdentity cannot be specified at the same time.
      Parameters:
      apiKey - the apiKey value to set.
      Returns:
      the ChatCompletionSkill object itself.
    • getCommonModelParameters

      public CommonModelParameters getCommonModelParameters()
      Get the commonModelParameters property: Common language model parameters that customers can tweak. If omitted, reasonable defaults will be applied.
      Returns:
      the commonModelParameters value.
    • setCommonModelParameters

      public ChatCompletionSkill setCommonModelParameters(CommonModelParameters commonModelParameters)
      Set the commonModelParameters property: Common language model parameters that customers can tweak. If omitted, reasonable defaults will be applied.
      Parameters:
      commonModelParameters - the commonModelParameters value to set.
      Returns:
      the ChatCompletionSkill object itself.
    • getExtraParameters

      public Map<String,Object> getExtraParameters()
      Get the extraParameters property: Open-type dictionary for model-specific parameters that should be appended to the chat completions call. Follows Azure AI Foundry’s extensibility pattern.
      Returns:
      the extraParameters value.
    • setExtraParameters

      public ChatCompletionSkill setExtraParameters(Map<String,Object> extraParameters)
      Set the extraParameters property: Open-type dictionary for model-specific parameters that should be appended to the chat completions call. Follows Azure AI Foundry’s extensibility pattern.
      Parameters:
      extraParameters - the extraParameters value to set.
      Returns:
      the ChatCompletionSkill object itself.
    • getExtraParametersBehavior

      public ChatCompletionExtraParametersBehavior getExtraParametersBehavior()
      Get the extraParametersBehavior property: How extra parameters are handled by Azure AI Foundry. Default is 'error'.
      Returns:
      the extraParametersBehavior value.
    • setExtraParametersBehavior

      public ChatCompletionSkill setExtraParametersBehavior(ChatCompletionExtraParametersBehavior extraParametersBehavior)
      Set the extraParametersBehavior property: How extra parameters are handled by Azure AI Foundry. Default is 'error'.
      Parameters:
      extraParametersBehavior - the extraParametersBehavior value to set.
      Returns:
      the ChatCompletionSkill object itself.
    • getResponseFormat

      public ChatCompletionResponseFormat getResponseFormat()
      Get the responseFormat property: Determines how the LLM should format its response. Defaults to 'text' response type.
      Returns:
      the responseFormat value.
    • setResponseFormat

      public ChatCompletionSkill setResponseFormat(ChatCompletionResponseFormat responseFormat)
      Set the responseFormat property: Determines how the LLM should format its response. Defaults to 'text' response type.
      Parameters:
      responseFormat - the responseFormat value to set.
      Returns:
      the ChatCompletionSkill object itself.
    • setHttpHeaders

      public ChatCompletionSkill setHttpHeaders(Map<String,String> httpHeaders)
      Set the httpHeaders property: The headers required to make the http request.
      Overrides:
      setHttpHeaders in class WebApiSkill
      Parameters:
      httpHeaders - the httpHeaders value to set.
      Returns:
      the WebApiSkill object itself.
    • setHttpMethod

      public ChatCompletionSkill setHttpMethod(String httpMethod)
      Set the httpMethod property: The method for the http request.
      Overrides:
      setHttpMethod in class WebApiSkill
      Parameters:
      httpMethod - the httpMethod value to set.
      Returns:
      the WebApiSkill object itself.
    • setTimeout

      public ChatCompletionSkill setTimeout(Duration timeout)
      Set the timeout property: The desired timeout for the request. Default is 30 seconds.
      Overrides:
      setTimeout in class WebApiSkill
      Parameters:
      timeout - the timeout value to set.
      Returns:
      the WebApiSkill object itself.
    • setBatchSize

      public ChatCompletionSkill setBatchSize(Integer batchSize)
      Set the batchSize property: The desired batch size which indicates number of documents.
      Overrides:
      setBatchSize in class WebApiSkill
      Parameters:
      batchSize - the batchSize value to set.
      Returns:
      the WebApiSkill object itself.
    • setDegreeOfParallelism

      public ChatCompletionSkill setDegreeOfParallelism(Integer degreeOfParallelism)
      Set the degreeOfParallelism property: If set, the number of parallel calls that can be made to the Web API.
      Overrides:
      setDegreeOfParallelism in class WebApiSkill
      Parameters:
      degreeOfParallelism - the degreeOfParallelism value to set.
      Returns:
      the WebApiSkill object itself.
    • setAuthResourceId

      public ChatCompletionSkill setAuthResourceId(String authResourceId)
      Set the authResourceId property: Applies to custom skills that connect to external code in an Azure function or some other application that provides the transformations. This value should be the application ID created for the function or app when it was registered with Azure Active Directory. When specified, the custom skill connects to the function or app using a managed ID (either system or user-assigned) of the search service and the access token of the function or app, using this value as the resource id for creating the scope of the access token.
      Overrides:
      setAuthResourceId in class WebApiSkill
      Parameters:
      authResourceId - the authResourceId value to set.
      Returns:
      the WebApiSkill object itself.
    • setAuthIdentity

      public ChatCompletionSkill setAuthIdentity(SearchIndexerDataIdentity authIdentity)
      Set the authIdentity property: The user-assigned managed identity used for outbound connections. If an authResourceId is provided and it's not specified, the system-assigned managed identity is used. On updates to the indexer, if the identity is unspecified, the value remains unchanged. If set to "none", the value of this property is cleared.
      Overrides:
      setAuthIdentity in class WebApiSkill
      Parameters:
      authIdentity - the authIdentity value to set.
      Returns:
      the WebApiSkill object itself.
    • setName

      public ChatCompletionSkill setName(String name)
      Set the name property: The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'.
      Overrides:
      setName in class WebApiSkill
      Parameters:
      name - the name value to set.
      Returns:
      the SearchIndexerSkill object itself.
    • setDescription

      public ChatCompletionSkill setDescription(String description)
      Set the description property: The description of the skill which describes the inputs, outputs, and usage of the skill.
      Overrides:
      setDescription in class WebApiSkill
      Parameters:
      description - the description value to set.
      Returns:
      the SearchIndexerSkill object itself.
    • setContext

      public ChatCompletionSkill setContext(String context)
      Set the context property: Represents the level at which operations take place, such as the document root or document content (for example, /document or /document/content). The default is /document.
      Overrides:
      setContext in class WebApiSkill
      Parameters:
      context - the context value to set.
      Returns:
      the SearchIndexerSkill 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<SearchIndexerSkill>
      Overrides:
      toJson in class WebApiSkill
      Throws:
      IOException
    • fromJson

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