I have trained the API with a series of my own documents, but when making queries, ChatGPT generates responses using data that is not in the set of documents used in the fine-tuning.
Is there a way to force the API to base its responses exclusively on my submitted documents and to give a negative response when the user asks a question outside this context?
Is there a way to tell the API not to use its own data when generating responses, and only base them on my documents?
Easy way out - Use the Open AI Assistants API, upload your files in the vector store and attach file search to your tool definition(make sure you follow the format and include vector store id). Modify the system prompt so it knows to invoke file search when user asks a question in that context.
Workaround - Write your own retriever function as a method which takes a query as input and outputs related context. You could use this context and pass it on too the LLM to answer the question. Pros: You can enable tool_choice as required to force it to use this function to answer.
If need assistance with system prompt check this discussion out. Building assistants should be straight forward, OpenAI documentation should be sufficient or you could refer to my previous post for step by step instructions. Cheers!