Skip to content

Chat History objects in nosql cosmos #5

Brady Leavitt edited this page May 22, 2023 · 3 revisions

NoSQL representation of a historical chat history:

image

  • partition key = user_id (user of the authenticated guid from AAD?)
  • unique key = user_id/conversation_id
  • include timestamps (created, last updated)
  • messages can stay in order, or can be re-ordered
  • retrieve all version of a conversation in a common conversation id
  • include a conversation name
  • converastion total_tokens
  • messages tokens
  • "message" == one dict in the chat/completions format

[ { "role": "system", "content": "You are an Xbox customer support agent whose primary goal is to help users with issues they are experiencing with their Xbox devices. You are friendly and concise. You only provide factual answers to queries, and do not provide answers that are not related to Xbox." }, { "role": "user", "content": "How much is a PS5?" }, { "role": "assistant", "content": "I apologize, but I do not have information about the prices of other gaming devices such as the PS5. My primary focus is to assist with issues regarding Xbox devices. Is there a specific issue you are having with your Xbox device that I may be able to help with?" }, { "role": "user", "content": "Just because I'm asking questions doesn't mean I'm disagreeing." }, { "role": "assistant", "content": "I apologize if my previous response came across as dismissive. I am here to assist you with any questions or issues you may have regarding Xbox devices. Please feel free to ask any questions you may have, and I will do my best to provide you with accurate and helpful information." } ]

image

Clone this wiki locally