Working with gpt3.5-turbo API. I configure the text of my context documents like this:
// Construct the context document string with labeled elements
$documentString = "Document Title: {$documentTitle}. ";
$documentString .= "Content: {$contextDocument}. ";
$documentString .= "Event Date: {$documentDate}. ";
$documentString .= "Document Groups: {$documentGroups}. ";
$documentString .= “Document Taxonomy/Tags: {$documentTaxonomy}.”;
$documentString .= “Source document summary: {$documentSummary}.”;
$documentString .= “URL: {$documentURL}.”;
So, the full document context submitted in the prompt will look something like this:
Question: What documents are available with the title “Drupal AI SolrAI - CSS”? Number of context documents: 2
Context document 1: Document Title: Drupal AI SolrAI - CSS. Content: blah, blah… . Event Date: . Document Groups: Documentation, Development, D9 Development, AI. Document Taxonomy/Tags: .Source document summary: blah, blah…URL: https://master1and1-9.schoolboard.net/node/1445. -----
Context document 2: Document Title: AI: Drupal SolrAI Module. Content: blah, blah… Event Date: . Document Groups: Documentation, Development, D9 Development, AI. Document Taxonomy/Tags: AI ToDo.Source document summary: blah, blah…URL: https://master1and1-9.schoolboard.net/node/1402. -----
I use “-----” as the context document separator. The model seems to understand this.
I am trying to generate a chat completion where I ask the model to recognize the “Title” field in the context documents submitted to it. Currently, with the above format, I get:
I’m sorry, but I couldn’t find any documents with the exact title “Drupal AI SolrAI - CSS” in the provided context documents. Please try rephrasing your question or consider using a keyword search to find the desired documents.
Where, clearly, there is a document titled 'Drupal AI SolrAI - CSS" in the context documents supplied above.
Clearly, I need a better way to separate my fields in the context text returned. Any suggestions for making it easier for gpt-3.5-turbo to recognize these fields?
BTW, gpt-4 doesn’t have a problem recognizing the title field.