GitHub Copilot

Microsoft Agent Framework 支援建立以 GitHub Copilot SDK 作為後端的代理程式。 GitHub Copilot 代理提供強大的程式導向 AI 功能,包括 shell 指令執行、檔案操作、URL 擷取及模型上下文協定(MCP)伺服器整合。

Important

GitHub Copilot 代理程式需要經過認證的 GitHub Copilot 執行環境。 有些 SDK 使用已安裝的 CLI,而 Go SDK 預設使用捆綁的執行環境。 為了安全起見,建議在容器化環境(Docker/Dev Container)中執行帶有 shell 或檔案權限的代理程式。

使用者入門

將必要的 NuGet 套件新增至您的專案。

dotnet add package Microsoft.Agents.AI.GitHub.Copilot

建立 GitHub Copilot 代理

第一步,先建立一個 CopilotClient 並開始做。 接著用 AsAIAgent 擴充方法建立代理。

using GitHub.Copilot;
using Microsoft.Agents.AI;

await using CopilotClient copilotClient = new();
await copilotClient.StartAsync();

AIAgent agent = copilotClient.AsAIAgent(sessionConfig: null);

Console.WriteLine(await agent.RunAsync("What is Microsoft Agent Framework?"));

附有工具與說明

你可以在建立代理時提供函式工具和自訂指令:

using GitHub.Copilot;
using Microsoft.Agents.AI;
using Microsoft.Extensions.AI;

AIFunction weatherTool = AIFunctionFactory.Create((string location) =>
{
    return $"The weather in {location} is sunny with a high of 25C.";
}, "GetWeather", "Get the weather for a given location.");

await using CopilotClient copilotClient = new();
await copilotClient.StartAsync();

AIAgent agent = copilotClient.AsAIAgent(
    tools: [weatherTool],
    instructions: "You are a helpful weather agent.");

Console.WriteLine(await agent.RunAsync("What's the weather like in Seattle?"));

代理功能

串流回應

即時收到回應:

await using CopilotClient copilotClient = new();
await copilotClient.StartAsync();

AIAgent agent = copilotClient.AsAIAgent(sessionConfig: null);

await foreach (AgentResponseUpdate update in agent.RunStreamingAsync("Tell me a short story."))
{
    Console.Write(update);
}

Console.WriteLine();

會話管理

透過多段對話維持對話上下文:

await using CopilotClient copilotClient = new();
await copilotClient.StartAsync();

await using GitHubCopilotAgent agent = new(
    copilotClient,
    instructions: "You are a helpful assistant. Keep your answers short.");

AgentSession session = await agent.CreateSessionAsync();

// First turn
await agent.RunAsync("My name is Alice.", session);

// Second turn - agent remembers the context
AgentResponse response = await agent.RunAsync("What is my name?", session);
Console.WriteLine(response); // Should mention "Alice"

許可

預設情況下,代理程式無法執行 shell 指令、讀寫檔案或擷取 URL。 為了啟用這些功能,請透過以下 SessionConfig方式提供權限處理程式:

static Task<PermissionDecision> PromptPermission(
    PermissionRequest request, PermissionInvocation invocation)
{
    Console.WriteLine($"\n[Permission Request: {request.Kind}]");
    Console.Write("Approve? (y/n): ");

    string? input = Console.ReadLine()?.Trim().ToUpperInvariant();
    PermissionDecision decision = input is "Y" or "YES"
        ? PermissionDecision.ApproveOnce()
        : PermissionDecision.Reject();

    return Task.FromResult(decision);
}

await using CopilotClient copilotClient = new();
await copilotClient.StartAsync();

SessionConfig sessionConfig = new()
{
    OnPermissionRequest = PromptPermission,
};

AIAgent agent = copilotClient.AsAIAgent(sessionConfig);

Console.WriteLine(await agent.RunAsync("List all files in the current directory"));

工具核准

由於 GitHub Copilot SDK 擁有工具呼叫迴圈,自訂函式工具的核准是透過 SDK 原生的預執行鉤子強制執行,而非標準的代理框架來回核准。 當你註冊一個包裹在 ApprovalRequiredAIFunction的 工具時,代理程式會安裝一個預設 OnPreToolUse 的 hook,回傳 "ask" 該工具,並將決策路由給你的 OnPermissionRequest 處理器:

using GitHub.Copilot;
using Microsoft.Agents.AI;
using Microsoft.Extensions.AI;

AIFunction deleteFile = AIFunctionFactory.Create(
    (string path) => $"Deleted {path}.",
    "DeleteFile",
    "Deletes a file.");

await using CopilotClient copilotClient = new();
await copilotClient.StartAsync();

SessionConfig sessionConfig = new()
{
    // Wrapping the tool marks it approval-required; the agent turns this into an "ask" at OnPreToolUse.
    Tools = [new ApprovalRequiredAIFunction(deleteFile)],

    // OnPermissionRequest decides the "asked" tools (and Copilot's built-in shell/file/URL prompts).
    OnPermissionRequest = PromptPermission,
};

AIAgent agent = copilotClient.AsAIAgent(sessionConfig);

Console.WriteLine(await agent.RunAsync("Delete the file temp.txt"));

Warning

如果你透過 提供自己的 OnPreToolUse hook SessionConfig.Hooks,則優先,代理人 不會 安裝其預設的核准 hook。 你必須完全負責執行你所登記的核 ApprovalRequiredAIFunction 准(例如,透過回傳 a "deny" 或 決定 "ask" )。 代理人會記錄警告,說明任何需要核准的工具,你的鉤子必須處理。

MCP 伺服器

連接本地(stdio)或遠端(HTTP)MCP 伺服器以擴充功能:

await using CopilotClient copilotClient = new();
await copilotClient.StartAsync();

SessionConfig sessionConfig = new()
{
    OnPermissionRequest = PromptPermission,
    McpServers = new Dictionary<string, McpServerConfig>
    {
        // Local stdio server
        ["filesystem"] = new McpStdioServerConfig
        {
            Command = "npx",
            Args = ["-y", "@modelcontextprotocol/server-filesystem", "."],
            Tools = ["*"],
        },
        // Remote HTTP server
        ["microsoft-learn"] = new McpHttpServerConfig
        {
            Url = "https://learn.microsoft.com/api/mcp",
            Tools = ["*"],
        },
    },
};

AIAgent agent = copilotClient.AsAIAgent(sessionConfig);

Console.WriteLine(await agent.RunAsync("Search Microsoft Learn for 'Azure Functions' and summarize the top result"));

Tip

完整可執行範例請參閱 .NET 範例

工具

Tool 狀態 Notes
函式工具 標準 AIFunction 實例。
工具核准 由框架的函式呼叫聊天客戶端提供;適用於任何函式工具呼叫。
程式碼解譯器 不是 Copilot CLI 功能。
檔案搜尋 不是 Copilot CLI 功能。
網路搜尋 未作為託管工具提供。
Shell / 檔案系統 / URL 擷取 內建於 Copilot CLI 的執行環境中,並受你提供的 Permissions 處理常式控管。
託管 MCP 工具 透過 SessionConfig.McpServers 設定的遠端(HTTP)MCP 伺服器。 詳見 MCP 伺服器
本地 MCP 工具 透過 SessionConfig.McpServers 設定的本機(stdio)MCP 伺服器。 詳見 MCP 伺服器

使用代理程式

代理程式是標準 AIAgent ,支援所有標準 AIAgent 作業。

想了解更多如何執行及與代理互動的資訊,請參閱代理 入門教學

先決條件

安裝 Microsoft Agent Framework GitHub Copilot 套件。

pip install agent-framework-github-copilot

Configuration

代理程式可選擇性地使用以下環境變數來設定:

變數 Description
GITHUB_COPILOT_CLI_PATH Copilot CLI 執行檔的路徑
GITHUB_COPILOT_MODEL 使用模型(例如, gpt-5claude-sonnet-4
GITHUB_COPILOT_TIMEOUT 請求逾時時間(秒數)
GITHUB_COPILOT_LOG_LEVEL CLI 日誌層級
GITHUB_COPILOT_BASE_DIRECTORY CLI 會話狀態與設定目錄(預設為 ~/.copilot

使用者入門

從 Agent Framework 匯入所需的類別:

import asyncio
from agent_framework.github import GitHubCopilotAgent, GitHubCopilotOptions

建立 GitHub Copilot 代理

基本代理程式創建

建立 GitHub Copilot 代理最簡單的方法:

async def basic_example():
    agent = GitHubCopilotAgent(
        instructions="You are a helpful assistant.",
    )

    async with agent:
        result = await agent.run("What is Microsoft Agent Framework?")
        print(result)

使用明確配置

您可以透過以下 default_options方式提供明確的設定:

async def explicit_config_example():
    agent = GitHubCopilotAgent(
        instructions="You are a helpful assistant.",
        default_options={
            "model": "gpt-5",
            "timeout": 120,
        },
    )

    async with agent:
        result = await agent.run("What can you do?")
        print(result)

Tip

default_options(以及每次跑options數)它會轉發 Copilot SDK create_session 接受的任何參數——例如 reasoning_effortcontext_tierenable_citationsprovider 帶入你自己的金鑰),或 skill_directories — 不僅僅是這裡顯示的金鑰。 未知參數名稱會觸發 TypeError,因此會發現錯字,而非默許忽略。

攜帶您自己的金鑰 (BYOK)

使用 Copilot SDK 的 BYOK 支援,透過您自己的 OpenAI、Azure OpenAI、Anthropic 或 OpenAI 相容端點路由模型請求,而非 GitHub Copilot 後端。 傳遞一個 ProviderConfigGitHubCopilotOptions(provider=...),並在提供者設定與會話層 model 級選項中設定相同的模型識別碼。

可執行的取樣範例使用以下環境變數:

變數 Description
BYOK_PROVIDER_TYPE 提供者類型: openaiazureanthropic。 預設為 openai
BYOK_BASE_URL 提供者端點的基礎網址。
BYOK_API_KEY 提供者端點的靜態 API 金鑰。
BYOK_MODEL_ID 型號識別碼請求。 預設為 gpt-4o

Warning

BYOK 使用靜態憑證,且不提供自動令牌刷新。 API 金鑰不要直接進入原始碼控制,並從環境變數或秘密儲存庫載入。 使用和帳單是由你的服務提供者追蹤,而非 GitHub。

import asyncio
import os
from typing import Literal, cast

from agent_framework.github import GitHubCopilotAgent, GitHubCopilotOptions
from copilot.session import ProviderConfig


async def main() -> None:
    print("=== GitHub Copilot Agent with BYOK (Bring Your Own Key) ===\n")

    model_id = os.environ.get("BYOK_MODEL_ID", "gpt-4o")
    provider_type = cast(Literal["openai", "azure", "anthropic"], os.environ.get("BYOK_PROVIDER_TYPE", "openai"))

    # ProviderConfig routes the session through a custom endpoint instead of the GitHub
    # Copilot backend. `wire_api="completions"` is the broadly compatible choice; use
    # "responses" for providers that support the OpenAI Responses API.
    provider: ProviderConfig = {
        "type": provider_type,
        "base_url": os.environ["BYOK_BASE_URL"],
        "api_key": os.environ["BYOK_API_KEY"],
        "wire_api": "completions",
        "model_id": model_id,
    }

    # BYOK requires the model to also be set at the session level.
    agent: GitHubCopilotAgent[GitHubCopilotOptions] = GitHubCopilotAgent(
        instructions="You are a helpful assistant.",
        default_options=GitHubCopilotOptions(model=model_id, provider=provider),
    )

    async with agent:
        query = "What are the benefits of using your own API keys with an agent framework?"
        print(f"User: {query}")
        result = await agent.run(query)
        print(f"\nAgent: {result}\n")

代理功能

情境提供者

Python GitHubCopilotAgent 也支援 context_providers=[...]。 提供者會在每次呼叫前後執行,因此提供者新增的訊息與指示會包含在 Copilot 提示中,歷史提供者可觀察最終回應。

from agent_framework import InMemoryHistoryProvider

agent = GitHubCopilotAgent(
    instructions="You are a helpful coding assistant.",
    context_providers=[InMemoryHistoryProvider()],
)

你可以將內建的歷史資料提供者與自訂上下文提供者結合。 關於實作模式,請參見 情境提供者

功能工具

為您的代理程式配備自訂功能:

from typing import Annotated
from pydantic import Field

def get_weather(
    location: Annotated[str, Field(description="The location to get the weather for.")],
) -> str:
    """Get the weather for a given location."""
    return f"The weather in {location} is sunny with a high of 25C."

async def tools_example():
    agent = GitHubCopilotAgent(
        instructions="You are a helpful weather agent.",
        tools=[get_weather],
    )

    async with agent:
        result = await agent.run("What's the weather like in Seattle?")
        print(result)

串流回應

在生成響應時獲取響應以獲得更好的用戶體驗:

async def streaming_example():
    agent = GitHubCopilotAgent(
        instructions="You are a helpful assistant.",
    )

    async with agent:
        print("Agent: ", end="", flush=True)
        async for chunk in agent.run("Tell me a short story.", stream=True):
            if chunk.text:
                print(chunk.text, end="", flush=True)
        print()

線程管理

在多次互動中維持對話脈絡:

async def thread_example():
    agent = GitHubCopilotAgent(
        instructions="You are a helpful assistant.",
    )

    async with agent:
        session = agent.create_session()

        # First interaction
        result1 = await agent.run("My name is Alice.", session=session)
        print(f"Agent: {result1}")

        # Second interaction - agent remembers the context
        result2 = await agent.run("What's my name?", session=session)
        print(f"Agent: {result2}")  # Should remember "Alice"

許可

預設情況下,代理程式無法執行 shell 指令、讀寫檔案或擷取 URL。 為了啟用這些功能,請提供權限處理程序:

import asyncio

from copilot.generated.rpc import PermissionDecisionDeniedInteractivelyByUser
from copilot.session import PermissionHandler, PermissionRequestResult
from copilot.session_events import PermissionRequest


async def prompt_permission(
    request: PermissionRequest, context: dict[str, str]
) -> PermissionRequestResult:
    print(f"\n[Permission Request: {request.kind}]")
    response = (await asyncio.to_thread(input, "Approve? (y/n): ")).strip().lower()
    if response in ("y", "yes"):
        return PermissionHandler.approve_all(request, context)
    return PermissionDecisionDeniedInteractivelyByUser()

async def permissions_example():
    agent = GitHubCopilotAgent(
        instructions="You are a helpful assistant that can execute shell commands.",
        default_options={
            "on_permission_request": prompt_permission,
        },
    )

    async with agent:
        result = await agent.run("List the Python files in the current directory")
        print(result)

對於所有權限都應自動核准的受信任環境,請使用內建的 PermissionHandler.approve_all

from copilot.session import PermissionHandler

agent = GitHubCopilotAgent(
    default_options={
        "on_permission_request": PermissionHandler.approve_all,
    },
)

權限處理器同時支援同步與非同步回調。 在 asyncio.to_thread 非同步處理程序中使用互動式提示,以避免阻塞事件迴圈。

工具核准

由於 GitHub Copilot SDK 擁有工具呼叫迴圈,自訂函式工具的核准是透過 SDK 原生的預執行鉤子強制執行,而非標準的代理框架來回核准。 當你註冊一個宣告的工具 approval_mode="always_require" 但沒有提供自己的 on_pre_tool_use 鉤子時,代理程式會安裝一個預設的鉤子,回傳 "ask" 該工具,並將決策路由給你的 on_permission_request 處理器:

from agent_framework import tool
from agent_framework.github import GitHubCopilotAgent, GitHubCopilotOptions
from copilot.session import PermissionHandler


@tool(approval_mode="always_require")
def delete_file(path: str) -> str:
    """Delete a file."""
    return f"Deleted {path}."


agent = GitHubCopilotAgent(
    tools=[delete_file],
    # The "ask" decision is routed here; approve or deny the call.
    default_options=GitHubCopilotOptions(on_permission_request=PermissionHandler.approve_all),
)

Warning

如果你自己提供 on_pre_tool_use hook,它會優先,代理 程式不會 安裝預設的核准 hook。 接著你必須完全負責執行任何 approval_mode="always_require" 工具的核准(例如,透過回傳 a "deny""ask" decision)。 代理人會記錄警告,說明任何需要核准的工具,你的鉤子必須處理。 使用預設的 deny-all 權限處理程序, always_require 除非你用線路接一個批准 on_permission_request的 。

MCP 伺服器

連接本地(stdio)或遠端(HTTP)MCP 伺服器以擴充功能:

from copilot.session import MCPServerConfig, PermissionHandler

async def mcp_example():
    mcp_servers: dict[str, MCPServerConfig] = {
        # Local stdio server
        "filesystem": {
            "type": "stdio",
            "command": "npx",
            "args": ["-y", "@modelcontextprotocol/server-filesystem", "."],
            "tools": ["*"],
        },
        # Remote HTTP server
        "microsoft-learn": {
            "type": "http",
            "url": "https://learn.microsoft.com/api/mcp",
            "tools": ["*"],
        },
    }

    agent = GitHubCopilotAgent(
        instructions="You are a helpful assistant with access to the filesystem and Microsoft Learn.",
        default_options={
            "on_permission_request": PermissionHandler.approve_all,
            "mcp_servers": mcp_servers,
        },
    )

    async with agent:
        result = await agent.run("Search Microsoft Learn for 'Azure Functions' and summarize the top result")
        print(result)

Observability

GitHubCopilotAgent 內建 OpenTelemetry 追蹤功能。 啟動時只需通話 configure_otel_providers() 一次,即可啟用每次運行的行程範圍、指標與日誌:

from agent_framework.observability import configure_otel_providers
from agent_framework.github import GitHubCopilotAgent

configure_otel_providers(enable_console_exporters=True)

async with GitHubCopilotAgent() as agent:
    response = await agent.run("Hello!")

如果你需要去除監測層的基礎代理(例如用自訂層包裝),請從RawGitHubCopilotAgent匯入agent_framework.github

關於OTLP匯出器及更豐富的範例,請參見 可觀察性樣本

工具

Tool 狀態 Notes
函式工具 標準 Python 可呼叫物件或 @ai_function
工具核准 由框架的函式呼叫聊天客戶端提供;適用於任何函式工具呼叫。
程式碼解譯器 不是 Copilot CLI 功能。
檔案搜尋 不是 Copilot CLI 功能。
網路搜尋 未作為託管工具提供。
Shell / 檔案系統 / URL 擷取 內建於 Copilot CLI 執行階段環境中,並受你提供的 Permissions 處理常式控管。
託管 MCP 工具 透過 default_options["mcp_servers"] 設定的遠端(HTTP)MCP 伺服器。 詳見 MCP 伺服器
本地 MCP 工具 透過 default_options["mcp_servers"] 設定的本機(stdio)MCP 伺服器。 詳見 MCP 伺服器

使用代理程式

代理程式是標準 BaseAgent ,支援所有標準代理程式作業。

想了解更多如何執行及與代理互動的資訊,請參閱代理 入門教學

使用者入門

安裝 Microsoft Agent Framework Go 模組及 GitHub Copilot SDK for Go。 Agent Framework Go SDK 需要 Go 1.25 或更新版本。

go get github.com/microsoft/agent-framework-go github.com/github/copilot-sdk/go

建立 GitHub Copilot 代理

建立並啟動一個 copilot.Client,然後將其傳遞給 copilotprovider.NewAgent

import (
    "context"
    "fmt"

    copilot "github.com/github/copilot-sdk/go"
    "github.com/microsoft/agent-framework-go/provider/copilotprovider"
)

ctx := context.Background()

copilotClient := copilot.NewClient(nil)
if err := copilotClient.Start(ctx); err != nil {
    panic(err)
}
defer func() { _ = copilotClient.Stop() }()

copilotAgent := copilotprovider.NewAgent(
    copilotClient,
    copilotprovider.AgentConfig{
        Instructions: "You are a helpful assistant.",
    },
)

response, err := copilotAgent.RunText(ctx, "What is Microsoft Agent Framework?").Collect()
if err != nil {
    panic(err)
}
fmt.Println(response)

附有工具與說明

你可以在建立代理時提供函式工具和自訂指令:

import (
    "context"
    "fmt"

    copilot "github.com/github/copilot-sdk/go"
    "github.com/microsoft/agent-framework-go/agent"
    "github.com/microsoft/agent-framework-go/provider/copilotprovider"
    "github.com/microsoft/agent-framework-go/tool"
    "github.com/microsoft/agent-framework-go/tool/functool"
)

weatherTool := functool.MustNew(
    functool.Config{
        Name:        "GetWeather",
        Description: "Get the weather for a given location.",
    },
    func(_ context.Context, location string) (string, error) {
        return fmt.Sprintf("The weather in %s is sunny with a high of 25C.", location), nil
    },
)

copilotAgent := copilotprovider.NewAgent(
    copilotClient,
    copilotprovider.AgentConfig{
        Instructions: "You are a helpful weather agent.",
        Config: agent.Config{
            Tools: []tool.Tool{weatherTool},
        },
    },
)

response, err := copilotAgent.RunText(ctx, "What's the weather like in Seattle?").Collect()
if err != nil {
    panic(err)
}
fmt.Println(response)

代理功能

串流回應

即時收到回應:

for update, err := range copilotAgent.RunText(ctx, "Tell me a short story.", agent.Stream(true)) {
    if err != nil {
        panic(err)
    }
    fmt.Print(update)
}

fmt.Println()

會話管理

透過多段對話維持對話上下文:

session, err := copilotAgent.CreateSession(ctx)
if err != nil {
    panic(err)
}

// First turn
response, err := copilotAgent.RunText(ctx, "My name is Alice.", agent.WithSession(session)).Collect()
if err != nil {
    panic(err)
}
fmt.Println(response)

// Second turn - the agent remembers the context
response, err = copilotAgent.RunText(ctx, "What is my name?", agent.WithSession(session)).Collect()
if err != nil {
    panic(err)
}
fmt.Println(response)

許可

預設情況下,代理程式無法執行 shell 指令、讀寫檔案或擷取 URL。 為了啟用這些功能,請透過以下 copilot.SessionConfig方式提供權限處理程式:

import (
    "bufio"
    "fmt"
    "os"
    "strings"

    copilot "github.com/github/copilot-sdk/go"
    "github.com/github/copilot-sdk/go/rpc"
    "github.com/microsoft/agent-framework-go/provider/copilotprovider"
)

func promptPermission(request copilot.PermissionRequest, _ copilot.PermissionInvocation) (rpc.PermissionDecision, error) {
    fmt.Printf("\n[Permission Request: %s]\n", request.Kind())
    fmt.Print("Approve? (y/n): ")

    input, _ := bufio.NewReader(os.Stdin).ReadString('\n')
    input = strings.TrimSpace(strings.ToUpper(input))
    if input == "Y" || input == "YES" {
        return &rpc.PermissionDecisionApproveOnce{}, nil
    }
    return &rpc.PermissionDecisionReject{}, nil
}

copilotAgent := copilotprovider.NewAgent(
    copilotClient,
    copilotprovider.AgentConfig{
        SessionConfig: &copilot.SessionConfig{
            OnPermissionRequest: promptPermission,
        },
    },
)

response, err := copilotAgent.RunText(ctx, "List all files in the current directory").Collect()
if err != nil {
    panic(err)
}
fmt.Println(response)

MCP 伺服器

連接本地(stdio)或遠端(HTTP)MCP 伺服器以擴充功能:

import (
    copilot "github.com/github/copilot-sdk/go"
    "github.com/microsoft/agent-framework-go/provider/copilotprovider"
)

mcpServers := map[string]copilot.MCPServerConfig{
    // Local stdio server
    "filesystem": copilot.MCPStdioServerConfig{
        Command: "npx",
        Args:    []string{"-y", "@modelcontextprotocol/server-filesystem", "."},
        Tools:   []string{"*"},
    },
    // Remote HTTP server
    "microsoft-learn": copilot.MCPHTTPServerConfig{
        URL:   "https://learn.microsoft.com/api/mcp",
        Tools: []string{"*"},
    },
}

copilotAgent := copilotprovider.NewAgent(
    copilotClient,
    copilotprovider.AgentConfig{
        Instructions: "You are a helpful assistant with access to the filesystem and Microsoft Learn.",
        SessionConfig: &copilot.SessionConfig{
            OnPermissionRequest: promptPermission,
            MCPServers:          mcpServers,
        },
    },
)

response, err := copilotAgent.RunText(ctx, "Search Microsoft Learn for 'Azure Functions' and summarize the top result").Collect()
if err != nil {
    panic(err)
}
fmt.Println(response)

Tip

完整可執行範例請參考 Go GitHub Copilot 範例

工具

Tool 狀態 Notes
函式工具 標準的 Go tool.Tool 實例,包括 functool 函式。
工具核准 函式工具可以使用標準的 Go 工具核准支援;Copilot 的執行階段權限由 SessionConfig.OnPermissionRequest 處理。
程式碼解譯器 不是 Copilot CLI 功能。
檔案搜尋 不是 Copilot CLI 功能。
網路搜尋 未作為託管工具提供。
Shell / 檔案系統 / URL 擷取 內建於 Copilot CLI 執行階段環境中,並受你提供的 Permissions 處理常式控管。
託管 MCP 工具 透過 copilot.SessionConfig.MCPServers 設定的遠端(HTTP)MCP 伺服器。 詳見 MCP 伺服器
本地 MCP 工具 透過 copilot.SessionConfig.MCPServers 設定的本機(stdio)MCP 伺服器。 詳見 MCP 伺服器

使用代理程式

代理程式是標準 *agent.Agent ,支援所有標準代理程式作業。

想了解更多如何執行及與代理互動的資訊,請參閱代理 入門教學

下一步