Interface ChatCompletionMessageParam.Visitor
-
- All Implemented Interfaces:
public interface ChatCompletionMessageParam.Visitor<T extends Object>
An interface that defines how to map each variant of ChatCompletionMessageParam to a value of type T.
-
-
Method Summary
Modifier and Type Method Description abstract T
visitDeveloper(ChatCompletionDeveloperMessageParam developer)
Developer-provided instructions that the model should follow, regardless of messages sent by the user. abstract T
visitSystem(ChatCompletionSystemMessageParam system)
Developer-provided instructions that the model should follow, regardless of messages sent by the user. abstract T
visitUser(ChatCompletionUserMessageParam user)
Messages sent by an end user, containing prompts or additional context information. abstract T
visitAssistant(ChatCompletionAssistantMessageParam assistant)
Messages sent by the model in response to user messages. abstract T
visitTool(ChatCompletionToolMessageParam tool)
abstract T
visitFunction(ChatCompletionFunctionMessageParam function)
T
unknown(JsonValue json)
Maps an unknown variant of ChatCompletionMessageParam to a value of type T. -
-
Method Detail
-
visitDeveloper
abstract T visitDeveloper(ChatCompletionDeveloperMessageParam developer)
Developer-provided instructions that the model should follow, regardless of messages sent by the user. With o1 models and newer,
developer
messages replace the previoussystem
messages.
-
visitSystem
abstract T visitSystem(ChatCompletionSystemMessageParam system)
Developer-provided instructions that the model should follow, regardless of messages sent by the user. With o1 models and newer, use
developer
messages for this purpose instead.
-
visitUser
abstract T visitUser(ChatCompletionUserMessageParam user)
Messages sent by an end user, containing prompts or additional context information.
-
visitAssistant
abstract T visitAssistant(ChatCompletionAssistantMessageParam assistant)
Messages sent by the model in response to user messages.
-
visitTool
abstract T visitTool(ChatCompletionToolMessageParam tool)
-
visitFunction
@Deprecated(message = "deprecated") abstract T visitFunction(ChatCompletionFunctionMessageParam function)
-
unknown
T unknown(JsonValue json)
Maps an unknown variant of ChatCompletionMessageParam to a value of type T.
An instance of ChatCompletionMessageParam can contain an unknown variant if it was deserialized from data that doesn't match any known variant. For example, if the SDK is on an older version than the API, then the API may respond with new variants that the SDK is unaware of.
-
-
-
-