Class MessageStage
- java.lang.Object
-
- bg.codexio.ai.openai.api.sdk.chat.ChatConfigurationStage
-
- bg.codexio.ai.openai.api.sdk.chat.MessageStage
-
- All Implemented Interfaces:
TerminalStage
public class MessageStage extends ChatConfigurationStage implements TerminalStage
Configures messages such as system and assistant messages. Used to provide context to the AI Model. For example, it can be provided some prior knowledge or instruction how to act, such as to act as a software developer or not to excuse when proven wrong.
-
-
Field Summary
-
Fields inherited from class bg.codexio.ai.openai.api.sdk.chat.ChatConfigurationStage
executor, requestBuilder
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedMessageStage(ChatHttpExecutor executor, bg.codexio.ai.openai.api.payload.chat.request.ChatMessageRequest.Builder requestBuilder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ChatRuntimeSelectionStageandRespond()Goes ahead.MessageStageassist(String assistedMessage)Provides knowledge the AI Model should operate withMessageStagedeveloper()Provides context to AI Model to act as a generic software developer.MessageStagedeveloper(String language)Provides context to AI Model to act as a software developer of some kind.MessageStagenoExcuses()Provides context to AI Model to not excuse when pointed wrong.MessageStagenoRepetition()Provides context to AI Model to not repeat old suggestions.MessageStagetraveller()Provides context to AI Model to act as a travel advisor.MessageStagewithContext(String messageContext)Provides context to the AI Model.protected MessageStagewithRoledMessage(String role, String message)
-
-
-
Constructor Detail
-
MessageStage
protected MessageStage(ChatHttpExecutor executor, bg.codexio.ai.openai.api.payload.chat.request.ChatMessageRequest.Builder requestBuilder)
-
-
Method Detail
-
withRoledMessage
protected MessageStage withRoledMessage(String role, String message)
-
withContext
public MessageStage withContext(String messageContext)
Provides context to the AI Model. It can be instructed to act in certain manner.- Returns:
- self
-
assist
public MessageStage assist(String assistedMessage)
Provides knowledge the AI Model should operate with- Returns:
- self
-
traveller
public MessageStage traveller()
Provides context to AI Model to act as a travel advisor.- Returns:
- self
-
developer
public MessageStage developer()
Provides context to AI Model to act as a generic software developer.- Returns:
- self
-
developer
public MessageStage developer(String language)
Provides context to AI Model to act as a software developer of some kind.- Returns:
- self
-
noExcuses
public MessageStage noExcuses()
Provides context to AI Model to not excuse when pointed wrong.- Returns:
- self
-
noRepetition
public MessageStage noRepetition()
Provides context to AI Model to not repeat old suggestions.- Returns:
- self
-
andRespond
public ChatRuntimeSelectionStage andRespond()
Goes ahead.- Specified by:
andRespondin interfaceTerminalStage- Returns:
ChatRuntimeSelectionStageto select runtime and then prompt the API.
-
-