ChatCompletionsToolSelection Class

  • java.lang.Object
    • com.azure.ai.openai.models.ChatCompletionsToolSelection

public final class 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

Constructor Description
ChatCompletionsToolSelection(ChatCompletionsNamedToolSelection namedToolSelection)

Creates a ChatCompletionsToolSelection with the provided named tool selection.

ChatCompletionsToolSelection(ChatCompletionsToolSelectionPreset preset)

Creates a ChatCompletionsToolSelection with the provided preset.

Method Summary

Modifier and Type Method and Description
static ChatCompletionsToolSelection fromBinaryData(BinaryData chatCompletionsToolSelectionJson)

Converts a JSON string to a ChatCompletionsToolSelection.

ChatCompletionsNamedToolSelection getNamedToolSelection()

Gets the named tool selection.

ChatCompletionsToolSelectionPreset getPreset()

Gets the preset tool selection.

Methods inherited from java.lang.Object

Constructor Details

ChatCompletionsToolSelection

public ChatCompletionsToolSelection(ChatCompletionsNamedToolSelection namedToolSelection)

Creates a ChatCompletionsToolSelection with the provided named tool selection.

Parameters:

namedToolSelection - The named tool selection.

ChatCompletionsToolSelection

public ChatCompletionsToolSelection(ChatCompletionsToolSelectionPreset preset)

Creates a ChatCompletionsToolSelection with the provided preset.

Parameters:

preset - The preset tool selection.

Method Details

fromBinaryData

public static ChatCompletionsToolSelection fromBinaryData(BinaryData chatCompletionsToolSelectionJson)

Converts a JSON string to a ChatCompletionsToolSelection.

Parameters:

chatCompletionsToolSelectionJson - The JSON string representing the chat completions tool selection.

Returns:

The ChatCompletionsToolSelection represented by the provided JSON string.

getNamedToolSelection

public ChatCompletionsNamedToolSelection getNamedToolSelection()

Gets the named tool selection.

Returns:

The named tool selection.

getPreset

public ChatCompletionsToolSelectionPreset getPreset()

Gets the preset tool selection.

Returns:

The preset tool selection.

Applies to