feat: add multi-document answers (#63)

This commit is contained in:
cachho
2023-07-11 14:50:07 +02:00
committed by GitHub
parent 9409e5605a
commit 40dc28406d
3 changed files with 32 additions and 21 deletions

View File

@@ -42,6 +42,7 @@ class QueryConfig(BaseConfig):
def __init__(
self,
number_documents=None,
template: Template = None,
model=None,
temperature=None,
@@ -53,6 +54,7 @@ class QueryConfig(BaseConfig):
"""
Initializes the QueryConfig instance.
:param number_documents: Number of documents to pull from the database as context.
:param template: Optional. The `Template` instance to use as a template for
prompt.
:param model: Optional. Controls the OpenAI model used.
@@ -68,6 +70,11 @@ class QueryConfig(BaseConfig):
:raises ValueError: If the template is not valid as template should
contain $context and $query (and optionally $history).
"""
if number_documents is None:
self.number_documents = 1
else:
self.number_documents = number_documents
if not history:
self.history = None
else: