> ## Documentation Index
> Fetch the complete documentation index at: https://phaseo.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Trier des tickets avec le SDK Agent C#

> Utilisez le SDK Agent C# pour trier des tickets avec des outils locaux au sein d’un même service .NET.

Utilisez cette recette lorsqu’un service .NET doit classer ou résumer les tickets d’assistance entrants.

## 1. Préparer les SDK

<Note type="warning">Le package C# Agent SDK n’est pas encore disponible sur NuGet. Suivez les [instructions d’installation depuis les sources](../sdk-reference/csharp/agent-sdk-installation.mdx).</Note>

## 2. Définir un outil de recherche interne

```csharp theme={null}
var loadTicket = AgentSdk.DefineTool(new Tool(
    Id: "load-ticket",
    Description: "Load one support ticket by id.",
    Parameters: new Dictionary<string, object?>
    {
        ["type"] = "object",
        ["properties"] = new Dictionary<string, object?>
        {
            ["ticketId"] = new Dictionary<string, object?> { ["type"] = "string" },
        },
        ["required"] = new[] { "ticketId" },
    },
    Execute: (input, ctx) => Task.FromResult<object?>(new Dictionary<string, object?>
    {
        ["ticketId"] = "T-1042",
        ["severity"] = "medium",
        ["summary"] = "Customer cannot find preset routing settings.",
    })
));
```

## 3. Créer et exécuter l’agent

```csharp theme={null}
var agent = AgentSdk.CreateAgent(new AgentDefinition
{
    Id = "ticket-triage-agent",
    Model = "openai/gpt-5.4-nano",
    Instructions = "Use tools when helpful and answer with a short triage summary.",
    Tools = new[] { loadTicket },
});

var result = await agent.Run(new RunOptions
{
    Input = "Review ticket T-1042 and summarize the next action.",
    Client = AgentSdk.CreateGatewayAgentClient(),
});

Console.WriteLine(result.Output);
```

## Quand utiliser cette recette

* le workflow s’exécute dans un service ASP.NET ou un worker unique
* votre runtime local sait déjà récupérer l’état interne des tickets
* vous souhaitez un cycle d’agent limité avant d’ajouter des files d’attente ou des approbations

## À lire aussi

* [SDK Agent C#](../sdk-reference/csharp/agent-sdk.mdx)
* [Trier les demandes d’assistance avec des agents pilotés par des presets](./agent-sdk-support-triage.mdx)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.