Conversations & Persistence
The SDKs save analyses by default. Create a CaesuraO conversation once, then reuse its ID for each turn. Use a different ID for each independent chat.
Create once and reuse
Call createConversation() in JavaScript or create_conversation() in Python. Save the returned ID so you can continue the same conversation after an application restart.
import OpenAI from 'openai';
import { createCaesura } from '@caesura-io/openai';
const client = createCaesura(new OpenAI(), {});
const conversationId = await client.createConversation({ name: 'Support session' });
await client.responses.create(
{ model: 'gpt-5.4-mini', input: 'Help me prepare for a meeting.' },
{ caesura: { conversationId } },
);
from openai import OpenAI
from caesura_openai import CaesuraOpenAIOptions, create_caesura
client = create_caesura(OpenAI(), CaesuraOpenAIOptions())
conversation_id = client.create_conversation(name="Support session")
client.responses.create(
model="gpt-5.4-mini",
input="Help me prepare for a meeting.",
caesura_conversation_id=conversation_id,
)
The AI SDK middleware also exposes createConversation(). With Python async clients, await create_conversation(). Creation errors are returned to your application.
Use local session labels
If your application already has stable local chat IDs, enable automatic creation:
| JavaScript option | Python option | Value |
|---|---|---|
autoCreateConversation | auto_create_conversation | true / True |
Pass your local chat ID on every model call. The SDK creates a CaesuraO conversation automatically before analysis and reuses it for that chat. Automatic creation is off by default; a local ID alone does not create a saved conversation.
Automatic mappings are held in memory and can be lost when the app restarts or the store clears old sessions. For conversations that must survive restarts or run across servers, create explicitly and save the returned ID.
Analyze without saving
Set persist: false in JavaScript or persist=False in Python. Analysis and guidance still work, but no conversation is created automatically or saved. Use a stable local chat ID to keep guidance separate for each conversation.
Send dialogue history
Include your application's conversation history on each request: user messages and actual model replies. A conversation ID does not load history for you. Keep CaesuraO guidance out of that history; the SDK adds it when needed.
Always pass a conversation ID when serving multiple chats. Omitting it uses a shared local session named "default".