Оптимизатор промптов
Дайте оптимизатору промпт и несколько размеченных примеров. Он выполнит цикл оптимизации DSPy, вернёт улучшенный промпт и покажет версию до, версию после и оценки, которые подтверждают изменение.
Один реальный запуск
Что оптимизатор возвращает на самом деле
Это реальный запуск сервиса, а не иллюстрация. Самое показательное здесь, как именно ошибается исходный промпт: он не выбирает не ту очередь, а игнорирует задачу маршрутизации и отвечает на обращение так, как ответил бы сотрудник поддержки.
- Задача:
- 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.
| Обращение | До | После | Верная очередь |
|---|---|---|---|
| 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 |
Исходный промпт отвечает клиенту вместо маршрутизации.
Оптимизированный промпт возвращает только очередь.
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 размеченных обращений на входе, проверка на 8, которых оптимизатор не видел.
8 из 8 отложенных обращений направлены верно после оптимизации.
Записано с реального запуска. Измеряется заново при каждом изменении оптимизатора. anthropic/claude-sonnet-4.5 · DSPy 3.2.1 · BootstrapFewShot