Improve Inferred Document Search Query Extraction from GPT

Using stop_words = "\n" was preventing JSON responses with newlines in
them
This commit is contained in:
Debanjum Singh Solanky
2024-04-11 19:21:08 +05:30
parent 653681967e
commit 15a78b19ad

View File

@@ -67,7 +67,7 @@ def extract_questions(
model_name=model,
temperature=temperature,
max_tokens=max_tokens,
model_kwargs={"stop": ["A: ", "\n"], "response_format": {"type": "json_object"}},
model_kwargs={"response_format": {"type": "json_object"}},
openai_api_key=api_key,
)