{"meta":{"title":"intégration de l’infrastructure d’agent Microsoft","intro":"Utilisez le Kit de développement logiciel (SDK) Copilot en tant que fournisseur d’agents à l’intérieur de Microsoft Agent Framework (MAF) pour composer des flux de travail multi-agents avec Azure OpenAI, Anthropic et d’autres fournisseurs.","product":"GitHub Copilot","breadcrumbs":[{"href":"/fr/copilot","title":"GitHub Copilot"},{"href":"/fr/copilot/how-tos","title":"Procédures"},{"href":"/fr/copilot/how-tos/copilot-sdk","title":"Kit de développement logiciel (SDK) Copilot"},{"href":"/fr/copilot/how-tos/copilot-sdk/integrations","title":"Intégrations"},{"href":"/fr/copilot/how-tos/copilot-sdk/integrations/microsoft-agent-framework","title":"Infrastructure de l’agent Microsoft"}],"documentType":"article"},"body":"# intégration de l’infrastructure d’agent Microsoft\n\nUtilisez le Kit de développement logiciel (SDK) Copilot en tant que fournisseur d’agents à l’intérieur de Microsoft Agent Framework (MAF) pour composer des flux de travail multi-agents avec Azure OpenAI, Anthropic et d’autres fournisseurs.\n\n<!-- markdownlint-disable GHD046 GHD005 -->\n\n<!-- Suppressed: GHD046 (outdated release terminology), GHD005 (hardcoded data variable) -->\n\n## Aperçu\n\nMicrosoft Agent Framework est le successeur unifié du noyau sémantique et de l’autogen. Il fournit une interface standard pour la création, l’orchestration et le déploiement d’agents IA. Les packages d’intégration dédiés vous permettent d’encapsuler un client sdk Copilot en tant qu’agent MAF de première classe, interchangeable avec n’importe quel autre fournisseur d’agent dans l’infrastructure.\n\n| Concept                                 | Description                                                                                             |\n| --------------------------------------- | ------------------------------------------------------------------------------------------------------- |\n| **Infrastructure de l’agent Microsoft** | Infrastructure open source pour l’orchestration à agent unique et multi-agent dans .NET et Python       |\n| **Fournisseur d’agents**                | Back-end qui alimente un agent (Copilot, Azure OpenAI, Anthropic, etc.)                                 |\n| **Orchestrateur**                       | Composant MAF qui coordonne les agents dans des flux de travail séquentiels, simultanés ou de transfert |\n| **Protocole A2A**                       | Norme de communication agent-à-agent prise en charge par l’infrastructure                               |\n\n> \\[!NOTE]\n> Les packages d’intégration MAF sont disponibles pour **.NET** et **Python**. Pour TypeScript, Go, Java et Rust, utilisez directement le SDK Copilot : les API standard du SDK prennent déjà en charge l’appel d’outils, le streaming et les agents personnalisés.\n\n## Prerequisites\n\nAvant de commencer, assurez-vous d’avoir :\n\n* Un [Créez votre première application avec Copilot](/fr/copilot/how-tos/copilot-sdk/getting-started) fonctionnel dans la langue de votre choix\n* Un abonnement GitHub Copilot (individuel, professionnel ou entreprise)\n* L'interface CLI Copilot installée ou disponible via l'interface CLI groupée du Kit de développement logiciel (SDK)\n\n## Installation\n\nInstallez le sdk Copilot en même temps que le package d’intégration MAF pour votre langue :\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> Le sdk Java n’a pas de package d’intégration MAF dédié. Utilisez directement le SDK Copilot standard : il offre l’appel d’outils, le streaming et des agents personnalisés prêts à l’emploi.\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## Utilisation de base\n\nEncapsulez le client Copilot SDK en tant qu’agent MAF à l’aide d’un seul appel de méthode. L’agent résultant est conforme à l’interface standard de l’infrastructure et peut être utilisé n’importe où un agent MAF est attendu.\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## Ajout d’outils personnalisés\n\nÉtendez votre assistant Copilot avec des outils de fonction personnalisés. Les outils définis par le biais du Kit de développement logiciel (SDK) Copilot standard sont automatiquement disponibles lorsque l’agent s’exécute dans MAF.\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\nVous pouvez également utiliser la définition d’outil native du SDK Copilot avec les outils MAF :\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## Flux de travail multi-agent\n\nL’avantage principal de l’intégration de MAF consiste à composer Copilot avec d’autres fournisseurs d’agents dans des workflows orchestrés. Utilisez les orchestrateurs intégrés de l’infrastructure pour créer des pipelines où différents agents gèrent différentes étapes.\n\n### Flux de travail séquentiel\n\nExécutez les agents les uns après les autres, en transmettant la sortie de l’un à l’autre :\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### Flux de travail simultané\n\nExécutez plusieurs agents en parallèle et agrègez leurs résultats :\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## Réponses en streaming\n\nLors de la création d’applications interactives, diffusez les réponses de l’agent afin d'afficher les résultats en temps réel. L'intégration de MAF conserve les fonctionnalités de streaming du KIT de développement logiciel (SDK) Copilot.\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\nVous pouvez également diffuser directement via le kit SDK Copilot sans MAF :\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## Référence de configuration\n\n### Options de l’agent MAF\n\n| Propriété                       | Type                    | Description                                               |\n| ------------------------------- | ----------------------- | --------------------------------------------------------- |\n| `Instructions` / `instructions` | `string`                | Invite de commande du système pour l'agent                |\n| `Tools` / `tools`               | `AIFunction[]` / `list` | Outils de fonction personnalisés disponibles pour l’agent |\n| `Streaming` / `streaming`       | `bool`                  | Activer les réponses en streaming                         |\n| `Model` / `model`               | `string`                | Remplacer le modèle par défaut                            |\n\n### Options du SDK Copilot (transmises telles quelles)\n\nToutes les options standard [Créez votre première application avec Copilot](/fr/copilot/how-tos/copilot-sdk/getting-started) sont toujours disponibles lors de la création du client Copilot sous-jacent. L’enveloppe MAF délègue au SDK en arrière-plan :\n\n| Fonctionnalité du Kit de développement logiciel (SDK             | Prise en charge de MAF |\n| ---------------------------------------------------------------- | ---------------------- |\n| Outils personnalisés (`DefineTool` / `AIFunctionFactory`)        |                        |\n| ✅ Fusionné avec les outils MAF                                   |                        |\n| Serveurs MCP                                                     |                        |\n| ✅ Configuré sur le client du Kit de développement logiciel (SDK) |                        |\n| Agents personnalisés / sous-agents                               |                        |\n| ✅ disponible dans le assistant Copilot                           |                        |\n| Sessions infinies                                                |                        |\n| ✅ Configuré sur le client du Kit de développement logiciel (SDK) |                        |\n| Sélection du modèle                                              |                        |\n| ✅ Remplaçable pour chaque agent ou pour chaque appel.            |                        |\n| Diffusion en continu                                             |                        |\n| ✅ Prise en charge complète des événements delta                  |                        |\n\n## Bonnes pratiques\n\n### Choisir le niveau d’intégration approprié\n\nUtilisez l’encapsuleur MAF lorsque vous devez associer Copilot à d’autres fournisseurs dans des flux de travail orchestrés. Si votre application utilise uniquement Copilot, le Kit de développement logiciel (SDK) autonome est plus simple et vous offre un contrôle total :\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### Garder les agents concentrés\n\nLors de la création de flux de travail multi-agents, donnez à chaque agent un rôle spécifique avec des instructions claires. Évitez les responsabilités qui se chevauchent :\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### Gérer les erreurs au niveau de l’orchestration\n\nEncapsulez les appels d’agent dans une gestion des erreurs, surtout dans les flux de travail multi-agents où l’échec d’un agent ne doit pas bloquer l’ensemble du pipeline :\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## Voir aussi\n\n* [Créez votre première application avec Copilot](/fr/copilot/how-tos/copilot-sdk/getting-started) : configuration initiale du Kit de développement logiciel (SDK) Copilot\n* [Agents personnalisés et orchestration de sous-agents](/fr/copilot/how-tos/copilot-sdk/features/custom-agents) : définir des sous-agents spécialisés dans le Kit de développement logiciel (SDK)\n* [Compétences personnalisées](/fr/copilot/how-tos/copilot-sdk/features/skills) : modules d’invite réutilisables\n* documentation [Microsoft Agent Framework](https://learn.microsoft.com/en-us/agent-framework/agents/providers/github-copilot) : documents MAF officiels pour le fournisseur de Copilot\n* [Blog : Créer des agents IA avec le Kit de développement logiciel (SDK) GitHub Copilot et Microsoft Agent Framework](https://devblogs.microsoft.com/semantic-kernel/build-ai-agents-with-github-copilot-sdk-and-microsoft-agent-framework/)"}