You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[<ipython-input-41-fbc29f0e30ff>](https://localhost:8080/#) in <module>
7 required_params = ["context", "query"]
8 if all(p in lfqa_prompt.prompt_params for p in required_params):
----> 9 raise ValueError(
10 "The OpenAIAnswerGenerator requires a PromptTemplate that has `context` and "
11 "`query` in its `prompt_params`. Supply a different `prompt_template` or "
ValueError: The OpenAIAnswerGenerator requires a PromptTemplate that has `context` and `query` in its `prompt_params`. Supply a different `prompt_template` or use the default one.
To Reproduce
lfqa_prompt = PromptTemplate(name="lfqa",
prompt_text="""
Synthesize a comprehensive answer from your knowledge and the following topk most relevant paragraphs and the given question.
\n===\Paragraphs: $context\n===\n$query""",
prompt_params=["context", "query"])
# Let's initiate the OpenAIAnswerGenerator
generator = OpenAIAnswerGenerator(
api_key='',
model="text-curie-001",
max_tokens=500,
presence_penalty=0.1,
frequency_penalty=0.1,
top_k=1,
temperature=0.3,
prompt_template=lfqa_prompt
)```
**System:**
- Haystack version (commit or version number): 1.13.2
The text was updated successfully, but these errors were encountered:
Describe the bug
class OpenAIAnswerGenerato
has an error in the required params check.haystack/haystack/nodes/answer_generator/openai.py
Line 141 in e6af353
Error message
To Reproduce
The text was updated successfully, but these errors were encountered: