Package com.github.copilot.sdk.json
Class CustomAgentConfig
java.lang.Object
com.github.copilot.sdk.json.CustomAgentConfig
Configuration for a custom agent in a Copilot session.
Custom agents extend the capabilities of the base Copilot assistant with
specialized behavior, tools, and prompts. Each agent can be referenced in
messages using the @agent-name mention syntax.
Example Usage
var agent = new CustomAgentConfig().setName("code-reviewer").setDisplayName("Code Reviewer")
.setDescription("Reviews code for best practices").setPrompt("You are a code review expert...")
.setTools(List.of("read_file", "search_code"));
var config = new SessionConfig().setCustomAgents(List.of(agent));
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the agent description.Gets the human-readable display name.getInfer()Gets whether inference mode is enabled.Gets the MCP server configurations for this agent.getName()Gets the unique identifier name for this agent.Gets the system prompt for this agent.getTools()Gets the list of tool names available to this agent.setDescription(String description) Sets a description of the agent's capabilities.setDisplayName(String displayName) Sets the human-readable display name.Sets whether to enable inference mode for this agent.setMcpServers(Map<String, Object> mcpServers) Sets MCP (Model Context Protocol) servers available to this agent.Sets the unique identifier name for this agent.Sets the system prompt that defines this agent's behavior.Sets the tools available to this agent.
-
Constructor Details
-
CustomAgentConfig
public CustomAgentConfig()
-
-
Method Details
-
getName
Gets the unique identifier name for this agent.- Returns:
- the agent name used for
@mentions
-
setName
Sets the unique identifier name for this agent.This name is used to mention the agent in messages (e.g.,
@code-reviewer).- Parameters:
name- the agent identifier (alphanumeric and hyphens)- Returns:
- this config for method chaining
-
getDisplayName
Gets the human-readable display name.- Returns:
- the display name shown to users
-
setDisplayName
Sets the human-readable display name.- Parameters:
displayName- the friendly name for the agent- Returns:
- this config for method chaining
-
getDescription
Gets the agent description.- Returns:
- the description of what this agent does
-
setDescription
Sets a description of the agent's capabilities.This helps users understand when to use this agent.
- Parameters:
description- the agent description- Returns:
- this config for method chaining
-
getTools
Gets the list of tool names available to this agent.- Returns:
- the list of tool identifiers
-
setTools
Sets the tools available to this agent.These can reference both built-in tools and custom tools registered in the session.
- Parameters:
tools- the list of tool names- Returns:
- this config for method chaining
-
getPrompt
Gets the system prompt for this agent.- Returns:
- the agent's system prompt
-
setPrompt
Sets the system prompt that defines this agent's behavior.This prompt is used to customize the agent's responses and capabilities.
- Parameters:
prompt- the system prompt- Returns:
- this config for method chaining
-
getMcpServers
Gets the MCP server configurations for this agent.- Returns:
- the MCP servers map
-
setMcpServers
Sets MCP (Model Context Protocol) servers available to this agent.- Parameters:
mcpServers- the MCP server configurations- Returns:
- this config for method chaining
-
getInfer
Gets whether inference mode is enabled.- Returns:
- the infer flag, or
nullif not set
-
setInfer
Sets whether to enable inference mode for this agent.- Parameters:
infer-trueto enable inference mode- Returns:
- this config for method chaining
-