Skip to content

Commit 27c8828

Browse files
authored
Updated to v0.3.3 with changes to options handling (#3593)
1 parent 3a6b88e commit 27c8828

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

autogen/oai/ollama.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def parse_params(self, params: Dict[str, Any]) -> Dict[str, Any]:
127127

128128
if "num_predict" in params:
129129
# Maximum number of tokens to predict, note: -1 is infinite, -2 is fill context, 128 is default
130-
ollama_params["num_predict"] = validate_parameter(params, "num_predict", int, False, 128, None, None)
130+
options_dict["num_predict"] = validate_parameter(params, "num_predict", int, False, 128, None, None)
131131

132132
if "repeat_penalty" in params:
133133
options_dict["repeat_penalty"] = validate_parameter(
@@ -138,15 +138,15 @@ def parse_params(self, params: Dict[str, Any]) -> Dict[str, Any]:
138138
options_dict["seed"] = validate_parameter(params, "seed", int, False, 42, None, None)
139139

140140
if "temperature" in params:
141-
ollama_params["temperature"] = validate_parameter(
141+
options_dict["temperature"] = validate_parameter(
142142
params, "temperature", (int, float), False, 0.8, None, None
143143
)
144144

145145
if "top_k" in params:
146-
ollama_params["top_k"] = validate_parameter(params, "top_k", int, False, 40, None, None)
146+
options_dict["top_k"] = validate_parameter(params, "top_k", int, False, 40, None, None)
147147

148148
if "top_p" in params:
149-
ollama_params["top_p"] = validate_parameter(params, "top_p", (int, float), False, 0.9, None, None)
149+
options_dict["top_p"] = validate_parameter(params, "top_p", (int, float), False, 0.9, None, None)
150150

151151
if self._native_tool_calls and self._tools_in_conversation and not self._should_hide_tools:
152152
ollama_params["tools"] = params["tools"]

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
"mistral": ["mistralai>=1.0.1"],
106106
"groq": ["groq>=0.9.0"],
107107
"cohere": ["cohere>=5.5.8"],
108-
"ollama": ["ollama>=0.3.1", "fix_busted_json>=0.0.18"],
108+
"ollama": ["ollama>=0.3.3", "fix_busted_json>=0.0.18"],
109109
"bedrock": ["boto3>=1.34.149"],
110110
}
111111

test/oai/test_ollama.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,13 @@ def test_parsing_params(ollama_client):
6565
}
6666
expected_params = {
6767
"model": "llama3.1:8b",
68-
"temperature": 0.8,
69-
"num_predict": 128,
70-
"top_k": 40,
71-
"top_p": 0.9,
7268
"options": {
7369
"repeat_penalty": 1.1,
7470
"seed": 42,
71+
"temperature": 0.8,
72+
"num_predict": 128,
73+
"top_k": 40,
74+
"top_p": 0.9,
7575
},
7676
"stream": False,
7777
}

0 commit comments

Comments
 (0)