ruoccofabrizio / azure-open-ai-embeddings-qna

A simple web application for a OpenAI-enabled document search. This repo uses Azure OpenAI Service for creating embeddings vectors from documents. For answering the question of a user, it retrieves the most relevant document and then uses GPT-3, GPT-3.5 or GPT-4 to extract the matching answer for the question.
https://azure.microsoft.com/en-us/products/cognitive-services/openai-service
MIT License
846 stars 510 forks source link

OpenAI Queries also responds to questions not contained in the embeddings #103

Open marcos99-sap opened 1 year ago

marcos99-sap commented 1 year ago

The system seems to give answer that is not related to the information present into the embedding. For example, give an answer using the wikipedia information

marcos99-sap commented 1 year ago

Hi all,

if I have correctly understood, seems to be a problem related to the following pieces of customprompt:

Each source has a name followed by a colon and the actual information, always include the source name for each fact you use in the response. Always use double square brackets to reference the filename source, e.g. [[info1.pdf.txt]]. Don't combine sources, list each source separately, e.g. [[info1.pdf]][[info2.txt]]. After answering the question generate three very brief follow-up questions that the user would likely ask next. Only use double angle brackets to reference the questions, e.g. <<Are there exclusions for prescriptions?>>. Only generate questions and do not generate any text before or after the questions, such as 'Follow-up Questions:'. Try not to repeat questions that have already been asked.