Class ChatCompletionMessageParam
-
- All Implemented Interfaces:
public final class ChatCompletionMessageParam
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interface
ChatCompletionMessageParam.Visitor
An interface that defines how to map each variant of ChatCompletionMessageParam to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<ChatCompletionDeveloperMessageParam>
developer()
Developer-provided instructions that the model should follow, regardless of messages sent by the user. final Optional<ChatCompletionSystemMessageParam>
system()
Developer-provided instructions that the model should follow, regardless of messages sent by the user. final Optional<ChatCompletionUserMessageParam>
user()
Messages sent by an end user, containing prompts or additional context information. final Optional<ChatCompletionAssistantMessageParam>
assistant()
Messages sent by the model in response to user messages. final Optional<ChatCompletionToolMessageParam>
tool()
final Optional<ChatCompletionFunctionMessageParam>
function()
final Boolean
isDeveloper()
final Boolean
isSystem()
final Boolean
isUser()
final Boolean
isAssistant()
final Boolean
isTool()
final Boolean
isFunction()
final ChatCompletionDeveloperMessageParam
asDeveloper()
Developer-provided instructions that the model should follow, regardless of messages sent by the user. final ChatCompletionSystemMessageParam
asSystem()
Developer-provided instructions that the model should follow, regardless of messages sent by the user. final ChatCompletionUserMessageParam
asUser()
Messages sent by an end user, containing prompts or additional context information. final ChatCompletionAssistantMessageParam
asAssistant()
Messages sent by the model in response to user messages. final ChatCompletionToolMessageParam
asTool()
final ChatCompletionFunctionMessageParam
asFunction()
final Optional<JsonValue>
_json()
final <T extends Any> T
accept(ChatCompletionMessageParam.Visitor<T> visitor)
final ChatCompletionMessageParam
validate()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static ChatCompletionMessageParam
ofDeveloper(ChatCompletionDeveloperMessageParam developer)
Developer-provided instructions that the model should follow, regardless of messages sent by the user. final static ChatCompletionMessageParam
ofSystem(ChatCompletionSystemMessageParam system)
Developer-provided instructions that the model should follow, regardless of messages sent by the user. final static ChatCompletionMessageParam
ofUser(ChatCompletionUserMessageParam user)
Messages sent by an end user, containing prompts or additional context information. final static ChatCompletionMessageParam
ofAssistant(ChatCompletionAssistantMessageParam assistant)
Messages sent by the model in response to user messages. final static ChatCompletionMessageParam
ofTool(ChatCompletionToolMessageParam tool)
final static ChatCompletionMessageParam
ofFunction(ChatCompletionFunctionMessageParam function)
-
-
Method Detail
-
developer
final Optional<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.
-
system
final Optional<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.
-
user
final Optional<ChatCompletionUserMessageParam> user()
Messages sent by an end user, containing prompts or additional context information.
-
assistant
final Optional<ChatCompletionAssistantMessageParam> assistant()
Messages sent by the model in response to user messages.
-
tool
final Optional<ChatCompletionToolMessageParam> tool()
-
function
@Deprecated(message = "deprecated") final Optional<ChatCompletionFunctionMessageParam> function()
-
isDeveloper
final Boolean isDeveloper()
-
isAssistant
final Boolean isAssistant()
-
isFunction
@Deprecated(message = "deprecated") final Boolean isFunction()
-
asDeveloper
final ChatCompletionDeveloperMessageParam asDeveloper()
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.
-
asSystem
final ChatCompletionSystemMessageParam asSystem()
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.
-
asUser
final ChatCompletionUserMessageParam asUser()
Messages sent by an end user, containing prompts or additional context information.
-
asAssistant
final ChatCompletionAssistantMessageParam asAssistant()
Messages sent by the model in response to user messages.
-
asTool
final ChatCompletionToolMessageParam asTool()
-
asFunction
@Deprecated(message = "deprecated") final ChatCompletionFunctionMessageParam asFunction()
-
accept
final <T extends Any> T accept(ChatCompletionMessageParam.Visitor<T> visitor)
-
validate
final ChatCompletionMessageParam validate()
-
ofDeveloper
final static ChatCompletionMessageParam ofDeveloper(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.
-
ofSystem
final static ChatCompletionMessageParam ofSystem(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.
-
ofUser
final static ChatCompletionMessageParam ofUser(ChatCompletionUserMessageParam user)
Messages sent by an end user, containing prompts or additional context information.
-
ofAssistant
final static ChatCompletionMessageParam ofAssistant(ChatCompletionAssistantMessageParam assistant)
Messages sent by the model in response to user messages.
-
ofTool
final static ChatCompletionMessageParam ofTool(ChatCompletionToolMessageParam tool)
-
ofFunction
@Deprecated(message = "deprecated") final static ChatCompletionMessageParam ofFunction(ChatCompletionFunctionMessageParam function)
-
-
-
-