OpenAI chatcompletion prompt for inferring user intent from chat history

This is more an issue of your prompt and the model used. Some models will recognize what you mean, others won’t. A better follow up question would be “What is the publication date for the first title?” Prompt Engineering 101: The more specific you are in your query, the better your chances of a good response.

So, it would appear that your chat history is being passed along. Another little trick you can add is to create a “Standalone Question”. I use to do this instead of passing chat history in the completion, and it worked extremely well for maintaining conversation history. I now employ both.

This is where creating a standalone question along with the chat history would probably help you. If you are doing a query to a vector store for your context, I would also use the same strategy for creating that query prompt. I call it the “Concept” prompt in my methodology.