Package com.github.copilot.sdk.json
Class MessageOptions
java.lang.Object
com.github.copilot.sdk.json.MessageOptions
Options for sending a message to a Copilot session.
This class specifies the message content and optional attachments to send to
the assistant. All setter methods return this for method chaining.
Example Usage
var options = new MessageOptions().setPrompt("Explain this code")
.setAttachments(List.of(new Attachment().setType("file").setPath("/path/to/file.java")));
session.send(options).get();
- Since:
- 1.0.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the file attachments.getMode()Gets the delivery mode.Gets the message prompt.setAttachments(List<Attachment> attachments) Sets file attachments to include with the message.Sets the message delivery mode.Sets the message prompt to send to the assistant.
-
Constructor Details
-
MessageOptions
public MessageOptions()
-
-
Method Details
-
getPrompt
Gets the message prompt.- Returns:
- the prompt text
-
setPrompt
Sets the message prompt to send to the assistant.- Parameters:
prompt- the message text- Returns:
- this options instance for method chaining
-
getAttachments
Gets the file attachments.- Returns:
- the list of attachments
-
setAttachments
Sets file attachments to include with the message.Attachments provide additional context to the assistant, such as source code files, documents, or other relevant files.
- Parameters:
attachments- the list of file attachments- Returns:
- this options instance for method chaining
- See Also:
-
setMode
Sets the message delivery mode.Valid modes:
- "enqueue" - Queue the message for processing (default)
- "immediate" - Process the message immediately
- Parameters:
mode- the delivery mode- Returns:
- this options instance for method chaining
-
getMode
Gets the delivery mode.- Returns:
- the delivery mode
-