How to do it
In a chat API, the cleanest way is to write each example as a pair of messages: a user message with the example input, then an assistant message with the ideal output. Then add the real input as the last user message.
Tips:
- Make examples match the real task. Same length, same kind of input.
- Cover the edge cases. If some inputs should get "unknown", include one.
- Vary them. If every example has the same answer, the model may just repeat it.
- Keep the format exact. The model copies small details, like punctuation and capital letters.
If the model does well with no examples at all, you may not need them. See Zero-Shot Prompting.
Example
This teaches a simple sentiment label with two examples.
curl https://api.luv13.ai/v1/chat/completions \
-H "Authorization: Bearer $LUV13_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "luv13/glm-5.3-flash",
"messages": [
{"role": "system", "content": "Label each review as positive, negative or mixed. Reply with the label only."},
{"role": "user", "content": "Fast shipping and it works great."},
{"role": "assistant", "content": "positive"},
{"role": "user", "content": "Nice screen, but the battery dies by noon."},
{"role": "assistant", "content": "mixed"},
{"role": "user", "content": "It broke on day two."}
]
}'