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
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
ConstructorsModifierConstructorDescriptionprotectedMessageStage(ChatHttpExecutor executor, bg.codexio.ai.openai.api.payload.chat.request.ChatMessageRequest.Builder requestBuilder) -
Method Summary
Modifier and TypeMethodDescriptionGoes ahead.Provides knowledge the AI Model should operate withProvides context to AI Model to act as a generic software developer.Provides context to AI Model to act as a software developer of some kind.Provides context to AI Model to not excuse when pointed wrong.Provides context to AI Model to not repeat old suggestions.Provides context to AI Model to act as a travel advisor.withContext(String messageContext) Provides context to the AI Model.protected MessageStagewithRoledMessage(String role, String message)
-
Constructor Details
-
MessageStage
protected MessageStage(ChatHttpExecutor executor, bg.codexio.ai.openai.api.payload.chat.request.ChatMessageRequest.Builder requestBuilder)
-
-
Method Details
-
withRoledMessage
-
withContext
Provides context to the AI Model. It can be instructed to act in certain manner.- Returns:
- self
-
assist
Provides knowledge the AI Model should operate with- Returns:
- self
-
traveller
Provides context to AI Model to act as a travel advisor.- Returns:
- self
-
developer
Provides context to AI Model to act as a generic software developer.- Returns:
- self
-
developer
Provides context to AI Model to act as a software developer of some kind.- Returns:
- self
-
noExcuses
Provides context to AI Model to not excuse when pointed wrong.- Returns:
- self
-
noRepetition
Provides context to AI Model to not repeat old suggestions.- Returns:
- self
-
andRespond
Goes ahead.- Specified by:
andRespondin interfaceTerminalStage- Returns:
ChatRuntimeSelectionStageto select runtime and then prompt the API.
-