From e7bb2487eb4e77ec70125d2471aa58b1277d3865 Mon Sep 17 00:00:00 2001 From: tstadel <60758086+tstadel@users.noreply.github.com> Date: Thu, 16 Feb 2023 19:56:08 +0100 Subject: [PATCH] make all OpenAI API params controllable via model_kwargs (#4183) Co-authored-by: Massimiliano Pippi --- haystack/nodes/prompt/prompt_node.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/haystack/nodes/prompt/prompt_node.py b/haystack/nodes/prompt/prompt_node.py index 32baf4ce7..3cff64f1f 100644 --- a/haystack/nodes/prompt/prompt_node.py +++ b/haystack/nodes/prompt/prompt_node.py @@ -474,8 +474,8 @@ class OpenAIInvocationLayer(PromptModelInvocationLayer): "stop": kwargs_with_defaults.get("stop", None), "presence_penalty": kwargs_with_defaults.get("presence_penalty", 0), "frequency_penalty": kwargs_with_defaults.get("frequency_penalty", 0), - "best_of": kwargs.get("best_of", 1), - "logit_bias": kwargs.get("logit_bias", {}), + "best_of": kwargs_with_defaults.get("best_of", 1), + "logit_bias": kwargs_with_defaults.get("logit_bias", {}), } headers = {"Authorization": f"Bearer {self.api_key}", "Content-Type": "application/json"} response = requests.request("POST", self.url, headers=headers, data=json.dumps(payload), timeout=30)