Package com.github.copilot.sdk.json


package com.github.copilot.sdk.json
Configuration classes and data transfer objects for the Copilot SDK.

This package contains all the configuration, request, response, and data transfer objects used throughout the SDK. These classes are designed for JSON serialization with Jackson and provide fluent setter methods for convenient configuration.

Client Configuration

Session Configuration

  • SessionConfig - Configuration for creating a new session, including model selection, tools, system message, and MCP server configuration.
  • ResumeSessionConfig - Configuration for resuming an existing session.
  • InfiniteSessionConfig - Configuration for infinite sessions with automatic context compaction.
  • SystemMessageConfig - System message customization options.

Message and Tool Configuration

  • MessageOptions - Options for sending messages, including prompt text and attachments.
  • ToolDefinition - Definition of a custom tool that can be invoked by the assistant.
  • ToolInvocation - Represents a tool invocation request from the assistant.
  • Attachment - File attachment for messages.

Provider Configuration (BYOK)

  • ProviderConfig - Configuration for using your own API keys with custom providers (OpenAI, Azure, etc.).
  • AzureOptions - Azure-specific configuration options.

Model Information

Custom Agents

  • CustomAgentConfig - Configuration for custom agents with specialized behaviors and tools.

Permissions

Usage Example


 var config = new SessionConfig().setModel("gpt-4.1").setStreaming(true)
 		.setSystemMessage(new SystemMessageConfig().setMode(SystemMessageMode.APPEND)
 				.setContent("Be concise in your responses."))
 		.setTools(List.of(ToolDefinition.create("my_tool", "Description", schema, handler)));

 var session = client.createSession(config).get();
 
See Also: