Variables for rag_context and fallback algorithms added to Tenant and parts of the implementation.

This commit is contained in:
Josako
2024-06-13 15:23:35 +02:00
parent cbddaee810
commit b77e1ab321
6 changed files with 63 additions and 17 deletions

View File

@@ -79,6 +79,7 @@ class Config(object):
```{text}```"""
GPT4_RAG_TEMPLATE = """Answer the question based on the following context, delimited between triple backquotes.
{tenant_context}
Use the following {language} in your communication, and cite the sources used.
If the question cannot be answered using the given context, say "I have insufficient information to answer this question."
Context:
@@ -86,6 +87,7 @@ class Config(object):
Question:
{question}"""
GPT3_5_RAG_TEMPLATE = """Answer the question based on the following context, delimited between triple backquotes.
{tenant_context}
Use the following {language} in your communication.
If the question cannot be answered using the given context, say "I have insufficient information to answer this question."
Context:
@@ -95,6 +97,7 @@ class Config(object):
GPT4_HISTORY_TEMPLATE = """You are a helpful assistant that details a question based on a previous context,
in such a way that the question is understandable without the previous context.
{tenant_context}
The context is a conversation history, with the HUMAN asking questions, the AI answering questions.
The history is delimited between triple backquotes.
Your answer by stating the question in {language}.
@@ -103,6 +106,13 @@ class Config(object):
Question to be detailed:
{question}"""
# Fallback Algorithms
FALLBACK_ALGORITHMS = [
"RAG_TENANT",
"RAG_WIKIPEDIA",
"RAG_GOOGLE",
"LLM"
]
# SocketIO settings
# SOCKETIO_ASYNC_MODE = 'threading'