Class SystemMessageConfig

java.lang.Object
com.github.copilot.sdk.json.SystemMessageConfig

public class SystemMessageConfig extends Object
Configuration for customizing the system message.

The system message controls the behavior and personality of the AI assistant. This configuration allows you to either append to or replace the default system message.

Example - Append Mode


 var config = new SystemMessageConfig().setMode(SystemMessageMode.APPEND)
 		.setContent("Always respond in a formal tone.");
 

Example - Replace Mode


 var config = new SystemMessageConfig().setMode(SystemMessageMode.REPLACE)
 		.setContent("You are a helpful coding assistant.");
 
See Also:
  • Constructor Details

    • SystemMessageConfig

      public SystemMessageConfig()
  • Method Details

    • getMode

      public SystemMessageMode getMode()
      Gets the system message mode.
      Returns:
      the mode (APPEND or REPLACE)
    • setMode

      public SystemMessageConfig setMode(SystemMessageMode mode)
      Sets the system message mode.

      Use SystemMessageMode.APPEND to add to the default system message while preserving guardrails, or SystemMessageMode.REPLACE to fully customize the system message.

      Parameters:
      mode - the mode (APPEND or REPLACE)
      Returns:
      this config for method chaining
    • getContent

      public String getContent()
      Gets the system message content.
      Returns:
      the content to append or use as replacement
    • setContent

      public SystemMessageConfig setContent(String content)
      Sets the system message content.

      This is the text that will be appended to or replace the default system message, depending on the configured mode.

      Parameters:
      content - the system message content
      Returns:
      this config for method chaining