Optimiseur de prompts
Donnez à l’optimiseur un prompt et quelques exemples annotés. Il exécute une boucle d’optimisation DSPy, renvoie un prompt amélioré et montre l’avant, l’après et les scores qui justifient le changement.
Une exécution réelle
Ce que l'optimiseur renvoie vraiment
Il s'agit d'une exécution réelle du service, pas d'une illustration. Le plus révélateur est la façon dont le prompt de départ échoue : il ne choisit pas la mauvaise file, il ignore la tâche de routage et répond au ticket comme le ferait un agent de support.
- Tâche:
- Route a support ticket to one of four queues. The rule is deliberately not guessable from the label names: sales means money has not moved yet, billing means it has, and incident means many users are affected rather than one.
| Ticket | Avant | Après | File correcte |
|---|---|---|---|
| You billed my card after I cancelled. | I sincerely apologize for this billing error. I understand how frustrating it is to be charged after cancelling… | billing | billing |
| Every request from our region is timing out right now. | Thank you for reporting this critical issue. I understand that all requests from your region are currently tim… | incident | incident |
| Is there a nonprofit rate before we sign up? | Thank you for your interest in our services for your nonprofit organization! Yes, we do offer special pricing… | sales | sales |
| My saved filter disappeared after I renamed it. | Thank you for reporting this issue. I understand how frustrating it is to lose a saved filter, especially afte… | support | support |
Le prompt de départ répond au client au lieu de router.
Le prompt optimisé renvoie la file, et rien d’autre.
Route the support ticket to one queue: billing, sales, incident, or support.
Ticket: {ticket}
Queue:Examples:
Example 1:
Ticket: I cannot change my avatar in settings.
Reasoning: This ticket describes a user experiencing an issue with a specific feature (changing avatar in settings). This is a localized problem affecting an individual user's ability to use a particular functionality. It's not a widespread outage or system-wide issue that would constitute an incident. Instead, it's a support request where the user needs help troubleshooting or resolving their specific problem with the avatar change feature.
Response: support
Example 2:
Ticket: Can we get a trial extension before we commit?
Reasoning: This ticket is asking about a trial extension before making a commitment/purchase. This is a sales-related inquiry about extending a trial period, not a technical support issue or a system incident. The customer is in the evaluation/decision-making phase and needs to discuss commercial terms with the sales team.
Response: sales
---
Let me think step by step to solve this task.
Ticket: {ticket}
Reasoning: Let me analyze this step by step.
Response:12 tickets étiquetés en entrée, évalués sur 8 jamais vus par l’optimiseur.
8 tickets sur 8 routés correctement après optimisation.
Capturé lors d’une exécution réelle. Re-mesuré à chaque évolution de l’optimiseur. anthropic/claude-sonnet-4.5 · DSPy 3.2.1 · BootstrapFewShot