Sessions
Sessions allow Florentine.ai to enable a server-side chat history. Just provide a sessionId
in your API request:
ts
const res = await FlorentineAI.ask({
question: "What is the revenue of my products this year?",
sessionId: "<YOUR_SESSION_ID>"
});
bash
curl https://nltm.florentine.ai/ask \
-H "content-type: application/json" \
-H "florentine-token: <FLORENTINE_API_KEY>" \
-d '{
"question": "What is the revenue of my products this year?",
"sessionId": "<YOUR_SESSION_ID>"
}'
Please note
It is strongly recommended to use a sessionId
to have meaningful multi-turn conversations.
I.e. if we follow up the above question What is the revenue of my products this year?
with the question And what was it last year?
we would not have a result without a session as the revenue
context of the previous question would just be lost.