Package com.azure.ai.openai.models
Class ChatCompletionsToolSelection
java.lang.Object
com.azure.ai.openai.models.ChatCompletionsToolSelection
Represents the tool selection for chat completions. The input can be either an enum value from
ChatCompletionsToolSelectionPreset
or a named tool selection passed in the form of ChatCompletionsNamedToolSelection.-
Constructor Summary
ConstructorsConstructorDescriptionChatCompletionsToolSelection(ChatCompletionsNamedToolSelection namedToolSelection) Creates aChatCompletionsToolSelectionwith the provided named tool selection.Creates aChatCompletionsToolSelectionwith the provided preset. -
Method Summary
Modifier and TypeMethodDescriptionstatic ChatCompletionsToolSelectionfromBinaryData(com.azure.core.util.BinaryData chatCompletionsToolSelectionJson) Converts a JSON string to aChatCompletionsToolSelection.Gets the named tool selection.Gets the preset tool selection.
-
Constructor Details
-
ChatCompletionsToolSelection
Creates aChatCompletionsToolSelectionwith the provided preset.- Parameters:
preset- The preset tool selection.
-
ChatCompletionsToolSelection
Creates aChatCompletionsToolSelectionwith the provided named tool selection.- Parameters:
namedToolSelection- The named tool selection.
-
-
Method Details
-
getPreset
Gets the preset tool selection.- Returns:
- The preset tool selection.
-
getNamedToolSelection
Gets the named tool selection.- Returns:
- The named tool selection.
-
fromBinaryData
public static ChatCompletionsToolSelection fromBinaryData(com.azure.core.util.BinaryData chatCompletionsToolSelectionJson) Converts a JSON string to aChatCompletionsToolSelection.- Parameters:
chatCompletionsToolSelectionJson- The JSON string representing the chat completions tool selection.- Returns:
- The
ChatCompletionsToolSelectionrepresented by the provided JSON string. - Throws:
IllegalArgumentException- If the provided JSON string does not match the expected format.
-