Class ResumeSessionConfig

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

public class ResumeSessionConfig extends Object
Configuration for resuming an existing Copilot session.

This class provides options for configuring a resumed session, including tool registration, provider configuration, and streaming. All setter methods return this for method chaining.

Example Usage


 var config = new ResumeSessionConfig().setStreaming(true).setTools(List.of(myTool));

 var session = client.resumeSession(sessionId, config).get();
 
See Also:
  • Constructor Details

    • ResumeSessionConfig

      public ResumeSessionConfig()
  • Method Details

    • getTools

      public List<ToolDefinition> getTools()
      Gets the custom tools for this session.
      Returns:
      the list of tool definitions
    • setTools

      public ResumeSessionConfig setTools(List<ToolDefinition> tools)
      Sets custom tools that the assistant can invoke during the session.
      Parameters:
      tools - the list of tool definitions
      Returns:
      this config for method chaining
      See Also:
    • getProvider

      public ProviderConfig getProvider()
      Gets the custom API provider configuration.
      Returns:
      the provider configuration
    • setProvider

      public ResumeSessionConfig setProvider(ProviderConfig provider)
      Sets a custom API provider for BYOK scenarios.
      Parameters:
      provider - the provider configuration
      Returns:
      this config for method chaining
      See Also:
    • getOnPermissionRequest

      public PermissionHandler getOnPermissionRequest()
      Gets the permission request handler.
      Returns:
      the permission handler
    • setOnPermissionRequest

      public ResumeSessionConfig setOnPermissionRequest(PermissionHandler onPermissionRequest)
      Sets a handler for permission requests from the assistant.
      Parameters:
      onPermissionRequest - the permission handler
      Returns:
      this config for method chaining
      See Also:
    • isStreaming

      public boolean isStreaming()
      Returns whether streaming is enabled.
      Returns:
      true if streaming is enabled
    • setStreaming

      public ResumeSessionConfig setStreaming(boolean streaming)
      Sets whether to enable streaming of response chunks.
      Parameters:
      streaming - true to enable streaming
      Returns:
      this config for method chaining
    • getMcpServers

      public Map<String,Object> getMcpServers()
      Gets the MCP server configurations.
      Returns:
      the MCP servers map
    • setMcpServers

      public ResumeSessionConfig setMcpServers(Map<String,Object> mcpServers)
      Sets MCP (Model Context Protocol) server configurations.
      Parameters:
      mcpServers - the MCP servers configuration map
      Returns:
      this config for method chaining
    • getCustomAgents

      public List<CustomAgentConfig> getCustomAgents()
      Gets the custom agent configurations.
      Returns:
      the list of custom agent configurations
    • setCustomAgents

      public ResumeSessionConfig setCustomAgents(List<CustomAgentConfig> customAgents)
      Sets custom agent configurations.
      Parameters:
      customAgents - the list of custom agent configurations
      Returns:
      this config for method chaining
      See Also: