Include history to improve query if required.

This commit is contained in:
Josako
2024-06-13 10:35:15 +02:00
parent 50851dc51c
commit 24a3747b99
5 changed files with 77 additions and 4 deletions

View File

@@ -103,15 +103,18 @@ def select_model_variables(tenant):
case 'gpt-4-turbo' | 'gpt-4o':
summary_template = current_app.config.get('GPT4_SUMMARY_TEMPLATE')
rag_template = current_app.config.get('GPT4_RAG_TEMPLATE')
history_template = current_app.config.get('GPT4_HISTORY_TEMPLATE')
tool_calling_supported = True
case 'gpt-3-5-turbo':
summary_template = current_app.config.get('GPT3_5_SUMMARY_TEMPLATE')
rag_template = current_app.config.get('GPT3_5_RAG_TEMPLATE')
history_template = current_app.config.get('GPT3_5_HISTORY_TEMPLATE')
case _:
raise Exception(f'Error setting model variables for tenant {tenant.id} '
f'error: Invalid chat model')
model_variables['summary_template'] = summary_template
model_variables['rag_template'] = rag_template
model_variables['history_template'] = history_template
if tool_calling_supported:
model_variables['cited_answer_cls'] = CitedAnswer
case _: