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 custom agent available for selection in a session.Represents a file attachment to include with a message.Azure OpenAI-specific configuration options.Represents an inline base64-encoded binary attachment (blob) for messages.Context passed to a
CommandHandlerwhen a slash command is executed.Defines a slash command that users can invoke from the CLI TUI.Functional interface for handling slash-command executions.Wire-format representation of a command definition for RPC serialization.Configuration options for creating aCopilotClient.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.Context for an elicitation request received from the server or MCP tools.Functional interface for handling elicitation requests from the server.Parameters for an elicitation request sent from the SDK to the host.Result returned from an elicitation dialog.Action value for anElicitationResult.JSON Schema describing the form fields to present for an elicitation dialog.Response from the auth.getStatus RPC call.Response from session.getForeground 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.Internal response object from getting session metadata by ID.Response from the status.get RPC call.Context for a hook invocation.Configuration for infinite sessions with automatic context compaction and workspace persistence.Options for theSessionUiApi.input(String, InputOptions)convenience method.JSON-RPC 2.0 error structure.JSON-RPC 2.0 request structure.JSON-RPC 2.0 response structure.Internal response object from listing sessions.Marker interface for all attachment types that can be included in a message.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.Describes the outcome kind of a permission request result.Response from a ping request to the Copilot CLI server.Handler for post-tool-use hooks.Input for a post-tool-use hook.Output for a post-tool-use hook.Handler for pre-tool-use hooks.Input for a pre-tool-use hook.Output for a pre-tool-use hook.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.Override operation for a single system prompt section inSystemMessageMode#CUSTOMIZEmode.Specifies the operation to perform on a system prompt section inSystemMessageMode#CUSTOMIZEmode.Internal request object for sending a message to a session.Internal response object from sending a message.Represents the capabilities reported by the host for a session.Configuration for creating a new Copilot session.Working directory context for a session.Handler for session-end hooks.Input for a session-end hook.Output for a session-end hook.Hook handlers configuration for a session.Session lifecycle event notification.Metadata for session lifecycle events.Types of session lifecycle events.Handler for session lifecycle events.Filter options for listing sessions.Metadata about an existing Copilot session.Handler for session-start hooks.Input for a session-start hook.Output for a session-start hook.Provides UI methods for eliciting information from the user during a session.UI-specific capability flags for a session.Response from session.setForeground RPC call.Configuration for customizing the system message.Well-known system prompt section identifiers for use withSystemMessageMode#CUSTOMIZEmode.OpenTelemetry configuration for the Copilot CLI server.Binary result from a tool execution.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.Handler for user input requests from the agent.Context for a user input request invocation.Request for user input from the agent.Response to a user input request.Handler for user-prompt-submitted hooks.Input for a user-prompt-submitted hook.Output for a user-prompt-submitted hook.