Fornire al modello istruzioni su cosa fare è un modo efficace ed efficiente per personalizzarne il comportamento. Nelle istruzioni, sii chiaro, conciso e diretto, fornendo il contesto necessario e delineando l'output desiderato. Le istruzioni possono essere semplici come un elenco di istruzioni passo passo o complesse come la mappatura dell'esperienza e della mentalità di un utente.
Come scrivere istruzioni efficaci
Le istruzioni efficaci applicano i seguenti principi:
- Di' al modello cosa fare.
- Sii chiaro e specifico.
- Specifica eventuali vincoli o requisiti di formattazione per l'output.
Esempio
Supponiamo, ad esempio, di avere un ristorante di cheeseburger e di voler utilizzare un modello per scoprire quali voci di menu sono le più richieste. Vuoi che il modello formatti le trascrizioni degli ordini dei clienti in JSON in modo da poter identificare rapidamente le voci di menu. Le tabelle seguenti mostrano le diverse risposte fornite dal modello quando vengono fornite istruzioni generiche e istruzioni specifiche che seguono i principi delle istruzioni:
| Istruzioni generiche |
|---|
Extract the transcript in JSON.
Transcript:
Speaker 1 (Customer): Hi, can I get a cheeseburger and large fries, please?
Speaker 2 (Restaurant employee): Coming right up! Anything else you'd like to add to your order?
Speaker 1: Hmmm, maybe a small orange juice. And could I get the fries with ketchup on the side?
Speaker 2: No problem, one cheeseburger, one large fries with ketchup on the side, and a small
orange juice. That'll be $5.87. Drive through to the next window please.
{
"speakers": [
{
"speaker": "Customer",
"utterances": [
"Hi, can I get a cheeseburger and large fries, please?"
]
},
{
"speaker": "Restaurant Employee",
"utterances": [
"Coming right up! Anything else you'd like to add to your order?"
]
},
{
"speaker": "Customer",
"utterances": [
"Hmm, maybe a small orange juice. And could I get the fries with ketchup on the
side?"
]
},
{
"speaker": "Restaurant Employee",
"utterances": [
"No problem, one cheeseburger, one large fries with ketchup on the side, and a
small orange juice. That'll be $5.87. Drive through to the next window please."
]
}
]
}
|
| Istruzioni specifiche |
|---|
Extract the items from this transcript in JSON and separate drinks from food.
Transcript:
Speaker 1 (Customer): Hi, can I get a cheeseburger and large fries, please?
Speaker 2 (Restaurant employee): Coming right up! Anything else you'd like to add to your order?
Speaker 1: Hmmm, maybe a small orange juice. And could I get the fries with ketchup on the side?
Speaker 2: No problem, one cheeseburger, one large fries with ketchup on the side, and a small
orange juice. That'll be $5.87. Drive through to the next window please.
{
"drinks": [
"orange juice"
],
"food": [
"cheeseburger",
"large fries"
]
}
|
Applicando i principi delle istruzioni, questo esempio è passato da una risposta che conteneva troppi dati a una che conteneva esattamente i dati richiesti per questo caso d'uso. Le istruzioni che utilizzano i principi delle istruzioni possono aiutarti a guidare il modello per fornire la risposta più utile per il tuo caso d'uso.