Skip to content

Commit 0d2791f

Browse files
authored
Merge pull request #165 from ggozad/fix/fix-parameter-passing
Fix passing options to ollama client.
2 parents daee8f9 + 5896339 commit 0d2791f

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

CHANGES.txt

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Changelog
22
=========
33

4+
0.8.2 - 2025-02-03
5+
------------------
6+
7+
- Fix merging chat and additional options properly.
8+
[ggozad]
9+
410
0.8.1 - 2025-01-29
511
------------------
612

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "oterm"
3-
version = "0.8.1"
3+
version = "0.8.2"
44
description = "A text-based terminal client for Ollama."
55
authors = [{ name = "Yiorgis Gozadinos", email = "[email protected]" }]
66
license = { text = "MIT" }

src/oterm/ollamaclient.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,15 @@ async def stream(
147147
user_prompt.images = images # type: ignore
148148

149149
self.history.append(user_prompt)
150+
options = {
151+
k: v for k, v in self.options.model_dump().items() if v is not None
152+
} | {k: v for k, v in additional_options.model_dump().items() if v is not None}
153+
150154
stream: AsyncIterator[ChatResponse] = await client.chat(
151155
model=self.model,
152156
messages=self.history,
153157
stream=True,
154-
options={**self.options.model_dump(), **additional_options.model_dump()},
158+
options=options,
155159
keep_alive=f"{self.keep_alive}m",
156160
format=parse_format(self.format),
157161
tools=self.tools,

uv.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)