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.
  • Constructor Details

    • MessageStage

      protected MessageStage(ChatHttpExecutor executor, bg.codexio.ai.openai.api.payload.chat.request.ChatMessageRequest.Builder requestBuilder)
  • Method Details

    • 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:
      andRespond in interface TerminalStage
      Returns:
      ChatRuntimeSelectionStage to select runtime and then prompt the API.