mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-11-02 02:39:51 +00:00
make all OpenAI API params controllable via model_kwargs (#4183)
Co-authored-by: Massimiliano Pippi <mpippi@gmail.com>
This commit is contained in:
parent
9f5a3344d5
commit
e7bb2487eb
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user