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
CopilotClientOptions- Options for configuring theCopilotClient, including CLI path, port, transport mode, and auto-start behavior.
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
ModelInfo- Information about an available AI model.ModelCapabilities- Model capabilities and limits.ModelPolicy- Model policy and state information.
Custom Agents
CustomAgentConfig- Configuration for custom agents with specialized behaviors and tools.
Permissions
PermissionHandler- Handler for permission requests from the assistant.PermissionRequest- A permission request from the assistant.PermissionRequestResult- Result of a permission request decision.
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:
-
ClassDescriptionRepresents a file attachment to include with a message.Azure OpenAI-specific configuration options.Configuration options for creating a
CopilotClient.Internal request object for creating a new session.Internal response object from creating a session.Configuration for a custom agent in a Copilot session.Internal response object from deleting a session.Response from the auth.getStatus RPC call.Internal response object from getting the last session ID.Internal response object from getting session messages.Response from the models.list RPC call.Response from the status.get RPC call.Configuration for infinite sessions with automatic context compaction and workspace persistence.JSON-RPC 2.0 error structure.JSON-RPC 2.0 request structure.JSON-RPC 2.0 response structure.Internal response object from listing sessions.Options for sending a message to a Copilot session.Model billing information.Model capabilities and limits.Information about an available model.Model limits.Model policy state.Model support flags.Model vision-specific limits.Functional interface for handling permission requests from the AI assistant.Context information for a permission request invocation.Represents a permission request from the AI assistant.Result of a permission request decision.Response from a ping request to the Copilot CLI server.Configuration for a custom API provider (BYOK - Bring Your Own Key).Configuration for resuming an existing Copilot session.Internal request object for resuming an existing session.Internal response object from resuming a session.Internal request object for sending a message to a session.Internal response object from sending a message.Configuration for creating a new Copilot session.Metadata about an existing Copilot session.Configuration for customizing the system message.Binary result from a tool execution.Low-level tool definition for JSON-RPC communication.Defines a tool that can be invoked by the AI assistant.Functional interface for handling tool invocations from the AI assistant.Represents a tool invocation request from the AI assistant.Result object returned from a tool execution.