3 ms·
Every time you send a prompt to a model you actually send the entire previous conversation along with it, in an array that looks like this: curl https://api.
by simonw 1y ago
Every time you send a prompt to a model you actually send the entire previous conversation along with it, in an array that looks like this:
curl https://api.anthropic.com/v1/messages \
-H "content-type: application/json" \
-H "x-api-key: $(llm keys get anthropic)" \
-H "anthropic-version: 2023-06-01" \
-d '{
"model": "claude-haiku-4-5-20251001",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
},
{
"role": "assistant",
"content": "The capital of France is Paris."
},
{
"role": "user",
"content": "Germany?"
},
{
"role": "assistant",
"content": "The capital of Germany is Berlin."
},
{
"role": "user",
"content": "Belgium?"
}
]
}'
You can see this yourself if you use their APIs.
- behnamoh 1y agothat is true unless you use the Response API endpoint...
- simonw 1y agoThat's true, the signature feature of that API is that OpenAI can now manage your conversation state server-side for you. You still have the option to send the full conversation JSON every time if you want to. You can send "store": false to turn off the feature where it persists your conversation server-side for you.