Class WorkersAiChatCompletionRequest
java.lang.Object
dev.langchain4j.model.workersai.client.WorkersAiChatCompletionRequest
Represents a request for AI chat completion.
Contains a list of messages that form part of the chat conversation.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Represents a message in the AI chat.static enum
Defines the roles a message can have in the chat conversation. -
Constructor Summary
ConstructorDescriptionConstructs an empty WorkerAiChatCompletionRequest with an empty list of messages.Constructs a WorkerAiChatCompletionRequest with an initial message. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addMessage
(WorkersAiChatCompletionRequest.MessageRole role, String content) Adds a new message to the chat completion request.
-
Constructor Details
-
WorkersAiChatCompletionRequest
public WorkersAiChatCompletionRequest()Constructs an empty WorkerAiChatCompletionRequest with an empty list of messages. -
WorkersAiChatCompletionRequest
public WorkersAiChatCompletionRequest(WorkersAiChatCompletionRequest.MessageRole role, String content) Constructs a WorkerAiChatCompletionRequest with an initial message.- Parameters:
role
- The role of the initial message.content
- The content of the initial message.
-
-
Method Details
-
addMessage
Adds a new message to the chat completion request.- Parameters:
role
- The role of the message.content
- The content of the message.
-