mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-09 14:35:50 +00:00
Ollama pass kwargs as options instead of top (#13280)
Noticed params are really in `options` instead while reviewing #12895
This commit is contained in:
parent
46af56dc4f
commit
18acc22f29
@ -136,8 +136,21 @@ class _OllamaCommon(BaseLanguageModel):
|
|||||||
stop = self.stop
|
stop = self.stop
|
||||||
elif stop is None:
|
elif stop is None:
|
||||||
stop = []
|
stop = []
|
||||||
params = {**self._default_params, **kwargs}
|
|
||||||
params["options"]["stop"] = stop
|
params = self._default_params
|
||||||
|
|
||||||
|
if "model" in kwargs:
|
||||||
|
params["model"] = kwargs["model"]
|
||||||
|
|
||||||
|
if "options" in kwargs:
|
||||||
|
params["options"] = kwargs["options"]
|
||||||
|
else:
|
||||||
|
params["options"] = {
|
||||||
|
**params["options"],
|
||||||
|
"stop": stop,
|
||||||
|
**kwargs,
|
||||||
|
}
|
||||||
|
|
||||||
response = requests.post(
|
response = requests.post(
|
||||||
url=f"{self.base_url}/api/generate/",
|
url=f"{self.base_url}/api/generate/",
|
||||||
headers={"Content-Type": "application/json"},
|
headers={"Content-Type": "application/json"},
|
||||||
|
Loading…
Reference in New Issue
Block a user