{"meta":{"title":"Microsoft-Agent-Framework-Integration","intro":"Verwenden Sie das Copilot SDK als Agentanbieter innerhalb des Microsoft Agent Framework (MAF), um Multi-Agent-Workflows zusammen mit Azure OpenAI, Anthropic und anderen Anbietern zu verfassen.","product":"GitHub Copilot","breadcrumbs":[{"href":"/de/copilot","title":"GitHub Copilot"},{"href":"/de/copilot/how-tos","title":"Vorgehensweisen"},{"href":"/de/copilot/how-tos/copilot-sdk","title":"Copilot SDK"},{"href":"/de/copilot/how-tos/copilot-sdk/integrations","title":"Integrationen"},{"href":"/de/copilot/how-tos/copilot-sdk/integrations/microsoft-agent-framework","title":"Microsoft Agent Framework"}],"documentType":"article"},"body":"# Microsoft-Agent-Framework-Integration\n\nVerwenden Sie das Copilot SDK als Agentanbieter innerhalb des Microsoft Agent Framework (MAF), um Multi-Agent-Workflows zusammen mit Azure OpenAI, Anthropic und anderen Anbietern zu verfassen.\n\n<!-- markdownlint-disable GHD046 GHD005 -->\n\n<!-- Suppressed: GHD046 (outdated release terminology), GHD005 (hardcoded data variable) -->\n\n## Übersicht\n\nDas Microsoft Agent Framework ist der einheitliche Nachfolger von Semantischer Kernel und AutoGen. Es bietet eine Standardschnittstelle zum Erstellen, Orchestrieren und Bereitstellen von KI-Agents. Mit dedizierten Integrationspaketen können Sie einen Copilot SDK-Client als erstklassigen MAF-Agent umschließen – austauschbar mit jedem anderen Agent-Anbieter im Framework.\n\n| Konzept                       | Beschreibung                                                                                         |\n| ----------------------------- | ---------------------------------------------------------------------------------------------------- |\n| **Microsoft Agent Framework** | Open-Source-Framework für die Einzel- und Multi-Agent-Orchestrierung in .NET und Python              |\n| **Agentanbieter**             | Ein Back-End, das einen Agent unterstützt (Copilot, Azure OpenAI, Anthropic usw.)                    |\n| **Orchestrator**              | Eine MAF-Komponente, die Agenten in sequenziellen, gleichzeitigen oder Übergabeworkflows koordiniert |\n| **A2A-Protokoll**             | Vom Framework unterstützte Agent-zu-Agent-Kommunikationsstandard                                     |\n\n> \\[!NOTE]\n> MAF-Integrationspakete sind für **.NET** und **Python** verfügbar. Verwenden Sie für TypeScript, Go, Java und Rust das Copilot SDK direkt – die standardmäßigen SDK-APIs bieten bereits Toolaufrufe, Streaming und benutzerdefinierte Agents.\n\n## Voraussetzungen\n\nBevor Sie beginnen, stellen Sie sicher, dass Sie folgendes haben:\n\n* Ein funktionierendes [Erstellen Sie Ihre erste Copilot-gestützte App](/de/copilot/how-tos/copilot-sdk/getting-started) in Ihrer Wahlsprache\n* Ein GitHub Copilot-Abonnement (Einzel-, Geschäfts- oder Unternehmensabonnement)\n* Die Copilot-CLI ist installiert oder über die im SDK gebündelte CLI verfügbar\n\n## Installation\n\nInstallieren Sie das Copilot SDK zusammen mit dem MAF-Integrationspaket für Ihre Sprache:\n\n<div class=\"ghd-codetabs\">\n<div class=\"ghd-codetab\" data-lang=\"dotnet\" data-label=\".NET\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">.NET</div>\n\n```shell\ndotnet add package GitHub.Copilot.SDK\ndotnet add package Microsoft.Agents.AI.GitHub.Copilot --prerelease\n```\n\n</div>\n\n<div class=\"ghd-codetab\" data-lang=\"python\" data-label=\"Python\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">Python</div>\n\n```shell\npip install copilot-sdk agent-framework-github-copilot\n```\n\n</div>\n\n<div class=\"ghd-codetab\" data-lang=\"java\" data-label=\"Java\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">Java</div>\n\n> \\[!NOTE]\n> Das Java SDK verfügt nicht über ein dediziertes MAF-Integrationspaket. Verwenden Sie das standardmäßige Copilot SDK direkt – sie stellt Toolaufrufe, Streaming und benutzerdefinierte Agents sofort bereit.\n\n```xml\n<!-- Maven -->\n<!-- Set copilot.sdk.version to the version published in java/README.md / Maven Central -->\n<dependency>\n    <groupId>com.github</groupId>\n    <artifactId>copilot-sdk-java</artifactId>\n    <version>${copilot.sdk.version}</version>\n</dependency>\n```\n\n</div>\n\n</div>\n\n## Grundlegende Nutzung\n\nSchließen Sie den Copilot SDK-Client als MAF-Agent mit einem einzelnen Methodenaufruf um. Der resultierende Agent entspricht der Standardschnittstelle des Frameworks und kann überall verwendet werden, wo ein MAF-Agent erwartet wird.\n\n<div class=\"ghd-codetabs\">\n<div class=\"ghd-codetab\" data-lang=\"dotnet\" data-label=\".NET\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">.NET</div>\n\n<!-- docs-validate: skip -->\n\n```csharp\nusing GitHub.Copilot;\nusing Microsoft.Agents.AI;\n\nawait using var copilotClient = new CopilotClient();\nawait copilotClient.StartAsync();\n\n// Wrap as a MAF agent\nAIAgent agent = copilotClient.AsAIAgent();\n\n// Use the standard MAF interface\nstring response = await agent.RunAsync(\"Explain how dependency injection works in ASP.NET Core\");\nConsole.WriteLine(response);\n```\n\n</div>\n\n<div class=\"ghd-codetab\" data-lang=\"python\" data-label=\"Python\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">Python</div>\n\n<!-- docs-validate: skip -->\n\n```python\nfrom agent_framework.github import GitHubCopilotAgent\n\nasync def main():\n    agent = GitHubCopilotAgent(\n        default_options={\n            \"instructions\": \"You are a helpful coding assistant.\",\n        }\n    )\n\n    async with agent:\n        result = await agent.run(\"Explain how dependency injection works in FastAPI\")\n        print(result)\n```\n\n</div>\n\n<div class=\"ghd-codetab\" data-lang=\"java\" data-label=\"Java\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">Java</div>\n\n<!-- docs-validate: skip -->\n\n```java\nimport com.github.copilot.CopilotClient;\nimport com.github.copilot.rpc.*;\n\nvar client = new CopilotClient();\nclient.start().get();\n\nvar session = client.createSession(new SessionConfig()\n    .setModel(\"gpt-5.4\")\n    .setOnPermissionRequest(PermissionHandler.APPROVE_ALL)\n).get();\n\nvar response = session.sendAndWait(new MessageOptions()\n    .setPrompt(\"Explain how dependency injection works in Spring Boot\")).get();\nSystem.out.println(response.getData().content());\n\nclient.stop().get();\n```\n\n</div>\n\n</div>\n\n## Hinzufügen von benutzerdefinierten Tools\n\nErweitern Sie Ihre Copilot-Agent mit benutzerdefinierten Funktionstools. Tools, die über das Standard-Copilot SDK definiert sind, sind automatisch verfügbar, wenn der Agent innerhalb von MAF ausgeführt wird.\n\n<div class=\"ghd-codetabs\">\n<div class=\"ghd-codetab\" data-lang=\"dotnet\" data-label=\".NET\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">.NET</div>\n\n<!-- docs-validate: skip -->\n\n```csharp\nusing GitHub.Copilot;\nusing Microsoft.Extensions.AI;\nusing Microsoft.Agents.AI;\n\n// Define a custom tool\nAIFunction weatherTool = CopilotTool.DefineTool(\n    (string location) => $\"The weather in {location} is sunny with a high of 25°C.\",\n    factoryOptions: new AIFunctionFactoryOptions\n    {\n        Name = \"GetWeather\",\n        Description = \"Get the current weather for a given location.\",\n    }\n);\n\nawait using var copilotClient = new CopilotClient();\nawait copilotClient.StartAsync();\n\n// Create agent with tools\nAIAgent agent = copilotClient.AsAIAgent(new AIAgentOptions\n{\n    Tools = new[] { weatherTool },\n});\n\nstring response = await agent.RunAsync(\"What's the weather like in Seattle?\");\nConsole.WriteLine(response);\n```\n\n</div>\n\n<div class=\"ghd-codetab\" data-lang=\"python\" data-label=\"Python\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">Python</div>\n\n<!-- docs-validate: skip -->\n\n```python\nfrom agent_framework.github import GitHubCopilotAgent\n\ndef get_weather(location: str) -> str:\n    \"\"\"Get the current weather for a given location.\"\"\"\n    return f\"The weather in {location} is sunny with a high of 25°C.\"\n\nasync def main():\n    agent = GitHubCopilotAgent(\n        default_options={\n            \"instructions\": \"You are a helpful assistant with access to weather data.\",\n        },\n        tools=[get_weather],\n    )\n\n    async with agent:\n        result = await agent.run(\"What's the weather like in Seattle?\")\n        print(result)\n```\n\n</div>\n\n</div>\n\nSie können auch die systemeigene Tooldefinition Copilot SDK zusammen mit MAF-Tools verwenden:\n\n<div class=\"ghd-codetabs\">\n<div class=\"ghd-codetab\" data-lang=\"typescript\" data-label=\"TypeScript\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">TypeScript</div>\n\n```typescript\nimport { CopilotClient, defineTool } from \"@github/copilot-sdk\";\n\nconst getWeather = defineTool(\"GetWeather\", {\n    description: \"Get the current weather for a given location.\",\n    parameters: {\n        type: \"object\",\n        properties: {\n            location: { type: \"string\", description: \"City name\" },\n        },\n        required: [\"location\"],\n    },\n    handler: async ({ location }: { location: string }) =>\n        `The weather in ${location} is sunny, 25°C.`,\n});\n\nconst client = new CopilotClient();\nconst session = await client.createSession({\n    model: \"gpt-5.4\",\n    tools: [getWeather],\n    onPermissionRequest: async () => ({ kind: \"approve-once\" }),\n});\n\nawait session.sendAndWait({ prompt: \"What's the weather like in Seattle?\" });\n```\n\n</div>\n\n<div class=\"ghd-codetab\" data-lang=\"java\" data-label=\"Java\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">Java</div>\n\n```java\nimport com.github.copilot.CopilotClient;\nimport com.github.copilot.rpc.*;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.concurrent.CompletableFuture;\n\nvar getWeather = ToolDefinition.create(\n    \"GetWeather\",\n    \"Get the current weather for a given location.\",\n    Map.of(\n        \"type\", \"object\",\n        \"properties\", Map.of(\n            \"location\", Map.of(\"type\", \"string\", \"description\", \"City name\")),\n        \"required\", List.of(\"location\")),\n    invocation -> {\n        var location = (String) invocation.getArguments().get(\"location\");\n        return CompletableFuture.completedFuture(\n            \"The weather in \" + location + \" is sunny, 25°C.\");\n    });\n\ntry (var client = new CopilotClient()) {\n    client.start().get();\n\n    var session = client.createSession(new SessionConfig()\n        .setModel(\"gpt-5.4\")\n        .setTools(List.of(getWeather))\n        .setOnPermissionRequest(PermissionHandler.APPROVE_ALL)\n    ).get();\n\n    session.sendAndWait(new MessageOptions()\n        .setPrompt(\"What's the weather like in Seattle?\")).get();\n}\n```\n\n</div>\n\n</div>\n\n## Mehragenten-Workflows\n\nDer Hauptvorteil der MAF-Integration besteht darin, Copilot gemeinsam mit anderen Agent-Anbietern in orchestrierten Workflows zu kombinieren. Verwenden Sie die integrierten Orchestratoren des Frameworks, um Pipelines zu erstellen, in denen verschiedene Agents unterschiedliche Schritte ausführen.\n\n### Sequenzieller Workflow\n\nFühren Sie Agenten nacheinander aus, übergeben Sie die Ausgabe von einem an den nächsten:\n\n<div class=\"ghd-codetabs\">\n<div class=\"ghd-codetab\" data-lang=\"dotnet\" data-label=\".NET\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">.NET</div>\n\n<!-- docs-validate: skip -->\n\n```csharp\nusing GitHub.Copilot;\nusing Microsoft.Agents.AI;\nusing Microsoft.Agents.AI.Orchestration;\n\nawait using var copilotClient = new CopilotClient();\nawait copilotClient.StartAsync();\n\n// Copilot agent for code review\nAIAgent reviewer = copilotClient.AsAIAgent(new AIAgentOptions\n{\n    Instructions = \"You review code for bugs, security issues, and best practices. Be thorough.\",\n});\n\n// Azure OpenAI agent for generating documentation\nAIAgent documentor = AIAgent.FromOpenAI(new OpenAIAgentOptions\n{\n    Model = \"gpt-5.4\",\n    Instructions = \"You write clear, concise documentation for code changes.\",\n});\n\n// Compose in a sequential pipeline\nvar pipeline = new SequentialOrchestrator(new[] { reviewer, documentor });\n\nstring result = await pipeline.RunAsync(\n    \"Review and document this pull request: added retry logic to the HTTP client\"\n);\nConsole.WriteLine(result);\n```\n\n</div>\n\n<div class=\"ghd-codetab\" data-lang=\"python\" data-label=\"Python\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">Python</div>\n\n<!-- docs-validate: skip -->\n\n```python\nfrom agent_framework.github import GitHubCopilotAgent\nfrom agent_framework.openai import OpenAIAgent\nfrom agent_framework.orchestration import SequentialOrchestrator\n\nasync def main():\n    # Copilot agent for code review\n    reviewer = GitHubCopilotAgent(\n        default_options={\n            \"instructions\": \"You review code for bugs, security issues, and best practices.\",\n        }\n    )\n\n    # OpenAI agent for documentation\n    documentor = OpenAIAgent(\n        model=\"gpt-5.4\",\n        instructions=\"You write clear, concise documentation for code changes.\",\n    )\n\n    # Compose in a sequential pipeline\n    pipeline = SequentialOrchestrator(agents=[reviewer, documentor])\n\n    async with pipeline:\n        result = await pipeline.run(\n            \"Review and document this PR: added retry logic to the HTTP client\"\n        )\n        print(result)\n```\n\n</div>\n\n<div class=\"ghd-codetab\" data-lang=\"java\" data-label=\"Java\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">Java</div>\n\n<!-- docs-validate: skip -->\n\n```java\nimport com.github.copilot.CopilotClient;\nimport com.github.copilot.rpc.*;\n\n// Java uses the standard SDK directly — no MAF orchestrator needed\nvar client = new CopilotClient();\nclient.start().get();\n\n// Step 1: Code review session\nvar reviewer = client.createSession(new SessionConfig()\n    .setModel(\"gpt-5.4\")\n    .setOnPermissionRequest(PermissionHandler.APPROVE_ALL)\n).get();\n\nvar review = reviewer.sendAndWait(new MessageOptions()\n    .setPrompt(\"Review this PR for bugs, security issues, and best practices: \"\n        + \"added retry logic to the HTTP client\")).get();\n\n// Step 2: Documentation session using review output\nvar documentor = client.createSession(new SessionConfig()\n    .setModel(\"gpt-5.4\")\n    .setOnPermissionRequest(PermissionHandler.APPROVE_ALL)\n).get();\n\nvar docs = documentor.sendAndWait(new MessageOptions()\n    .setPrompt(\"Write documentation for these changes: \" + review.getData().content())).get();\nSystem.out.println(docs.getData().content());\n\nclient.stop().get();\n```\n\n</div>\n\n</div>\n\n### Gleichzeitiger Workflow\n\nFühren Sie mehrere Agents parallel aus, und aggregieren Sie ihre Ergebnisse:\n\n<div class=\"ghd-codetabs\">\n<div class=\"ghd-codetab\" data-lang=\"dotnet\" data-label=\".NET\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">.NET</div>\n\n<!-- docs-validate: skip -->\n\n```csharp\nusing GitHub.Copilot;\nusing Microsoft.Agents.AI;\nusing Microsoft.Agents.AI.Orchestration;\n\nawait using var copilotClient = new CopilotClient();\nawait copilotClient.StartAsync();\n\nAIAgent securityReviewer = copilotClient.AsAIAgent(new AIAgentOptions\n{\n    Instructions = \"Focus exclusively on security vulnerabilities and risks.\",\n});\n\nAIAgent performanceReviewer = copilotClient.AsAIAgent(new AIAgentOptions\n{\n    Instructions = \"Focus exclusively on performance bottlenecks and optimization opportunities.\",\n});\n\n// Run both reviews concurrently\nvar concurrent = new ConcurrentOrchestrator(new[] { securityReviewer, performanceReviewer });\n\nstring combinedResult = await concurrent.RunAsync(\n    \"Analyze this database query module for issues\"\n);\nConsole.WriteLine(combinedResult);\n```\n\n</div>\n\n<div class=\"ghd-codetab\" data-lang=\"java\" data-label=\"Java\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">Java</div>\n\n<!-- docs-validate: skip -->\n\n```java\nimport com.github.copilot.CopilotClient;\nimport com.github.copilot.rpc.*;\nimport java.util.concurrent.CompletableFuture;\n\n// Java uses CompletableFuture for concurrent execution\nvar client = new CopilotClient();\nclient.start().get();\n\nvar securitySession = client.createSession(new SessionConfig()\n    .setModel(\"gpt-5.4\")\n    .setOnPermissionRequest(PermissionHandler.APPROVE_ALL)\n).get();\n\nvar perfSession = client.createSession(new SessionConfig()\n    .setModel(\"gpt-5.4\")\n    .setOnPermissionRequest(PermissionHandler.APPROVE_ALL)\n).get();\n\n// Run both reviews concurrently\nvar securityFuture = securitySession.sendAndWait(new MessageOptions()\n    .setPrompt(\"Focus on security vulnerabilities in this database query module\"));\nvar perfFuture = perfSession.sendAndWait(new MessageOptions()\n    .setPrompt(\"Focus on performance bottlenecks in this database query module\"));\n\nCompletableFuture.allOf(securityFuture, perfFuture).get();\n\nSystem.out.println(\"Security: \" + securityFuture.get().getData().content());\nSystem.out.println(\"Performance: \" + perfFuture.get().getData().content());\n\nclient.stop().get();\n```\n\n</div>\n\n</div>\n\n## Antworten bei Streaming-Diensten\n\nBeim Erstellen interaktiver Anwendungen sollten Antworten von Streaming-Agenten verwendet werden, um die Echtzeitausgabe anzuzeigen. Die MAF-Integration behält die Streamingfunktionen des Copilot SDK bei.\n\n<div class=\"ghd-codetabs\">\n<div class=\"ghd-codetab\" data-lang=\"dotnet\" data-label=\".NET\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">.NET</div>\n\n<!-- docs-validate: skip -->\n\n```csharp\nusing GitHub.Copilot;\nusing Microsoft.Agents.AI;\n\nawait using var copilotClient = new CopilotClient();\nawait copilotClient.StartAsync();\n\nAIAgent agent = copilotClient.AsAIAgent(new AIAgentOptions\n{\n    Streaming = true,\n});\n\nawait foreach (var chunk in agent.RunStreamingAsync(\"Write a quicksort implementation in C#\"))\n{\n    Console.Write(chunk);\n}\nConsole.WriteLine();\n```\n\n</div>\n\n<div class=\"ghd-codetab\" data-lang=\"python\" data-label=\"Python\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">Python</div>\n\n<!-- docs-validate: skip -->\n\n```python\nfrom agent_framework.github import GitHubCopilotAgent\n\nasync def main():\n    agent = GitHubCopilotAgent(\n        default_options={\"streaming\": True}\n    )\n\n    async with agent:\n        async for chunk in agent.run_streaming(\"Write a quicksort in Python\"):\n            print(chunk, end=\"\", flush=True)\n        print()\n```\n\n</div>\n\n</div>\n\nSie können auch direkt über das Copilot SDK ohne MAF streamen:\n\n<div class=\"ghd-codetabs\">\n<div class=\"ghd-codetab\" data-lang=\"typescript\" data-label=\"TypeScript\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">TypeScript</div>\n\n```typescript\nimport { CopilotClient } from \"@github/copilot-sdk\";\n\nconst client = new CopilotClient();\nconst session = await client.createSession({\n    model: \"gpt-5.4\",\n    streaming: true,\n    onPermissionRequest: async () => ({ kind: \"approve-once\" }),\n});\n\nsession.on(\"assistant.message_delta\", (event) => {\n    process.stdout.write(event.data.deltaContent ?? \"\");\n});\n\nawait session.sendAndWait({ prompt: \"Write a quicksort implementation in TypeScript\" });\n```\n\n</div>\n\n<div class=\"ghd-codetab\" data-lang=\"java\" data-label=\"Java\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">Java</div>\n\n<!-- docs-validate: skip -->\n\n```java\nimport com.github.copilot.CopilotClient;\nimport com.github.copilot.rpc.*;\n\nvar client = new CopilotClient();\nclient.start().get();\n\nvar session = client.createSession(new SessionConfig()\n    .setModel(\"gpt-5.4\")\n    .setStreaming(true)\n    .setOnPermissionRequest(PermissionHandler.APPROVE_ALL)\n).get();\n\nsession.on(AssistantMessageDeltaEvent.class, event -> {\n    System.out.print(event.getData().deltaContent());\n});\n\nsession.sendAndWait(new MessageOptions()\n    .setPrompt(\"Write a quicksort implementation in Java\")).get();\nSystem.out.println();\n\nclient.stop().get();\n```\n\n</div>\n\n</div>\n\n## Konfigurationsreferenz\n\n### MAF-Agentoptionen\n\n| Eigentum                        | Typ                     | Beschreibung                                                        |\n| ------------------------------- | ----------------------- | ------------------------------------------------------------------- |\n| `Instructions` / `instructions` | `string`                | Systemaufforderung für den Agent                                    |\n| `Tools` / `tools`               | `AIFunction[]` / `list` | Benutzerdefinierte Funktionstools, die für den Agent verfügbar sind |\n| `Streaming` / `streaming`       | `bool`                  | Streamingantworten aktivieren                                       |\n| `Model` / `model`               | `string`                | Überschreiben des Standardmodells                                   |\n\n### Copilot SDK-Optionen (übergeben)\n\nAlle Standardoptionen [Erstellen Sie Ihre erste Copilot-gestützte App](/de/copilot/how-tos/copilot-sdk/getting-started) stehen beim Erstellen des zugrunde liegenden Copilot Clients weiterhin zur Verfügung. Der MAF-Wrapper delegiert unter der Haube an das SDK:\n\n| SDK-Funktion                                                  | MAF-Unterstützung |\n| ------------------------------------------------------------- | ----------------- |\n| Benutzerdefinierte Tools (`DefineTool` / `AIFunctionFactory`) |                   |\n| ✅ Mit MAF-Tools zusammengeführt                               |                   |\n| MCP-Server                                                    |                   |\n| ✅ Konfiguriert auf dem SDK-Client                             |                   |\n| Benutzerdefinierte Agenten / Unteragenten                     |                   |\n| ✅ Im Copilot-Agent verfügbar                                  |                   |\n| Unendliche Sitzungen                                          |                   |\n| ✅ Konfiguriert auf dem SDK-Client                             |                   |\n| Modellauswahl                                                 |                   |\n| ✅ Überschreibbar pro Agent oder pro Anruf                     |                   |\n| Streamen                                                      |                   |\n| ✅ Vollständige Delta-Ereignisunterstützung                    |                   |\n\n## Bewährte Methoden\n\n### Auswählen der richtigen Integrationsebene\n\nVerwenden Sie den MAF-Wrapper, wenn Sie Copilot in orchestrierten Workflows mit anderen Anbietern kombinieren möchten. Wenn Ihre Anwendung nur Copilot verwendet, ist das eigenständige SDK einfacher und bietet Ihnen die vollständige Kontrolle:\n\n```typescript\n// Standalone SDK — full control, simpler setup\nimport { CopilotClient } from \"@github/copilot-sdk\";\n\nconst client = new CopilotClient();\nconst session = await client.createSession({\n    model: \"gpt-5.4\",\n    onPermissionRequest: async () => ({ kind: \"approve-once\" }),\n});\nconst response = await session.sendAndWait({ prompt: \"Explain this code\" });\n```\n\n### Agenten fokussiert halten\n\nGeben Sie jedem Agent beim Erstellen von Workflows mit mehreren Agents eine bestimmte Rolle mit klaren Anweisungen. Überlappende Zuständigkeiten vermeiden:\n\n```typescript\n// ❌ Too vague — overlapping roles\nconst agents = [\n    { instructions: \"Help with code\" },\n    { instructions: \"Assist with programming\" },\n];\n\n// ✅ Focused — clear separation of concerns\nconst agents = [\n    { instructions: \"Review code for security vulnerabilities. Flag SQL injection, XSS, and auth issues.\" },\n    { instructions: \"Optimize code performance. Focus on algorithmic complexity and memory usage.\" },\n];\n```\n\n### Handhabung von Fehlern auf der Orchestrierungsebene\n\nAgentenaufrufe in die Fehlerbehandlung verpacken, insbesondere in Multi-Agent-Workflows, damit der Fehler eines Agenten nicht die gesamte Pipeline blockiert:\n\n<!-- docs-validate: skip -->\n\n```csharp\ntry\n{\n    string result = await pipeline.RunAsync(\"Analyze this module\");\n    Console.WriteLine(result);\n}\ncatch (AgentException ex)\n{\n    Console.Error.WriteLine($\"Agent {ex.AgentName} failed: {ex.Message}\");\n    // Fall back to single-agent mode or retry\n}\n```\n\n## Siehe auch\n\n* [Erstellen Sie Ihre erste Copilot-gestützte App](/de/copilot/how-tos/copilot-sdk/getting-started): anfängliches Copilot SDK-Setup\n* [Angepasste Agents und Orchestrierung von Unteragenten](/de/copilot/how-tos/copilot-sdk/features/custom-agents): Definieren von spezialisierten Unter-Agents innerhalb des SDK\n* [Benutzerdefinierte Fähigkeiten](/de/copilot/how-tos/copilot-sdk/features/skills): wiederverwendbare Prompt-Module\n* [Microsoft Agent Framework-Dokumentation](https://learn.microsoft.com/en-us/agent-framework/agents/providers/github-copilot): offizielle MAF-Dokumente für den Copilot Anbieter\n* [Blog: Erstellen von KI-Agents mit GitHub Copilot SDK und Microsoft Agent Framework](https://devblogs.microsoft.com/semantic-kernel/build-ai-agents-with-github-copilot-sdk-and-microsoft-agent-framework/)"}