ChatCompletionSkill Class

public final class ChatCompletionSkill
extends SearchIndexerSkill

A skill that calls a language model via Azure AI Foundry's Chat Completions endpoint.

Constructor Summary

Constructor Description
ChatCompletionSkill(List<InputFieldMappingEntry> inputs, List<OutputFieldMappingEntry> outputs, String url)

Creates an instance of ChatCompletionSkill class.

Method Summary

Modifier and Type Method and Description
static ChatCompletionSkill fromJson(JsonReader jsonReader)

Reads an instance of ChatCompletionSkill from the JsonReader.

String getApiKey()

Get the apiKey property: API key for authenticating to the model.

SearchIndexerDataIdentity getAuthIdentity()

Get the authIdentity property: The user-assigned managed identity used for outbound connections.

ChatCompletionCommonModelParameters getCommonModelParameters()

Get the commonModelParameters property: Common language model parameters that customers can tweak.

Map<String,Object> getExtraParameters()

Get the extraParameters property: Open-type dictionary for model-specific parameters that should be appended to the chat completions call.

ChatCompletionExtraParametersBehavior getExtraParametersBehavior()

Get the extraParametersBehavior property: How extra parameters are handled by Azure AI Foundry.

String getOdataType()

Get the odataType property: The discriminator for derived types.

ChatCompletionResponseFormat getResponseFormat()

Get the responseFormat property: Determines how the LLM should format its response.

String getUrl()

Get the url property: The url for the Web API.

ChatCompletionSkill setApiKey(String apiKey)

Set the apiKey property: API key for authenticating to the model.

ChatCompletionSkill setAuthIdentity(SearchIndexerDataIdentity authIdentity)

Set the authIdentity property: The user-assigned managed identity used for outbound connections.

ChatCompletionSkill setCommonModelParameters(ChatCompletionCommonModelParameters commonModelParameters)

Set the commonModelParameters property: Common language model parameters that customers can tweak.

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).

ChatCompletionSkill setDescription(String description)

Set the description property: The description of the skill which describes the inputs, outputs, and usage of the skill.

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.

ChatCompletionSkill setExtraParametersBehavior(ChatCompletionExtraParametersBehavior extraParametersBehavior)

Set the extraParametersBehavior property: How extra parameters are handled by Azure AI Foundry.

ChatCompletionSkill setName(String name)

Set the name property: The name of the skill which uniquely identifies it within the skillset.

ChatCompletionSkill setResponseFormat(ChatCompletionResponseFormat responseFormat)

Set the responseFormat property: Determines how the LLM should format its response.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from SearchIndexerSkill

Methods inherited from java.lang.Object

Constructor Details

ChatCompletionSkill

public ChatCompletionSkill(List<InputFieldMappingEntry> inputs, List<OutputFieldMappingEntry> outputs, String url)

Creates an instance of ChatCompletionSkill class.

Parameters:

inputs - the inputs value to set.
outputs - the outputs value to set.
url - the url value to set.

Method Details

fromJson

public static ChatCompletionSkill fromJson(JsonReader jsonReader)

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:

IOException

- If the deserialized JSON object was missing any required properties.

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.

getAuthIdentity

public SearchIndexerDataIdentity getAuthIdentity()

Get 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.

Returns:

the authIdentity value.

getCommonModelParameters

public ChatCompletionCommonModelParameters getCommonModelParameters()

Get the commonModelParameters property: Common language model parameters that customers can tweak. If omitted, reasonable defaults will be applied.

Returns:

the commonModelParameters value.

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.

getExtraParametersBehavior

public ChatCompletionExtraParametersBehavior getExtraParametersBehavior()

Get the extraParametersBehavior property: How extra parameters are handled by Azure AI Foundry. Default is 'error'.

Returns:

the extraParametersBehavior value.

getOdataType

public String getOdataType()

Get the odataType property: The discriminator for derived types.

Overrides:

ChatCompletionSkill.getOdataType()

Returns:

the odataType value.

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.

getUrl

public String getUrl()

Get the url property: The url for the Web API.

Returns:

the url 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.

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.

Parameters:

authIdentity - the authIdentity value to set.

Returns:

the ChatCompletionSkill object itself.

setCommonModelParameters

public ChatCompletionSkill setCommonModelParameters(ChatCompletionCommonModelParameters 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.

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:

ChatCompletionSkill.setContext(String context)

Parameters:

context

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:

ChatCompletionSkill.setDescription(String description)

Parameters:

description

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.

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.

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:

ChatCompletionSkill.setName(String name)

Parameters:

name

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.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Overrides:

ChatCompletionSkill.toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to