欲沉 Greetings!
Hi, I'm building a chat service using Azure's Openai service, and I'm not sure how to make the interface capable of contextual conversations. Do I have to bring in the previous conversation every time I request it? Is this too token consuming.
It's great to hear that you're building a chat service using Azure's OpenAI service.
To answer your question, Azure OpenAI doesn't remember the context of your conversation, so you'll need to bring in the previous conversation every time you request it. Please see Creating a basic conversation loop for more details.
I see that each response has an id, whether I can use this to complete the context conversation?
The response ID is simply a unique identifier for each response that Azure OpenAI generates. It can be useful for tracking and logging purposes, but it doesn't provide any contextual information about the conversation. It's not intended to be used to complete the context conversation.
If you want to maintain context between conversations, you can store the conversation history in a database or other storage solution. This way, you can retrieve the previous conversation when needed and provide it to Azure OpenAI as part of the input. I would suggest you, check Cosmos DB + ChatGPT sample application for more details.
I hope this helps! Let me know if you have any other questions.
If the response helped, please do click Accept Answer and Yes for was this answer helpful.
Doing so would help other community members with similar issue identify the solution. I highly appreciate your contribution to the community.