Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
cc9555af
Unverified
Commit
cc9555af
authored
Dec 02, 2025
by
Nathan Hook
Committed by
GitHub
Dec 02, 2025
Browse files
Update user message format for temperature query (#13256)
parent
20aee967
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
docs/capabilities/tool-calling.mdx
docs/capabilities/tool-calling.mdx
+6
-6
No files found.
docs/capabilities/tool-calling.mdx
View file @
cc9555af
...
...
@@ -15,7 +15,7 @@ Also known as "single-shot" tool calling.
```shell
curl -s http://localhost:11434/api/chat -H "Content-Type: application/json" -d '{
"model": "qwen3",
"messages": [{"role": "user", "content": "What
'
s the temperature in New York?"}],
"messages": [{"role": "user", "content": "What
i
s the temperature in New York?"}],
"stream": false,
"tools": [
{
...
...
@@ -41,7 +41,7 @@ Also known as "single-shot" tool calling.
curl -s http://localhost:11434/api/chat -H "Content-Type: application/json" -d '{
"model": "qwen3",
"messages": [
{"role": "user", "content": "What
'
s the temperature in New York?"},
{"role": "user", "content": "What
i
s the temperature in New York?"},
{
"role": "assistant",
"tool_calls": [
...
...
@@ -90,7 +90,7 @@ Also known as "single-shot" tool calling.
}
return temperatures.get(city, "Unknown")
messages = [{"role": "user", "content": "What
'
s the temperature in New York?"}]
messages = [{"role": "user", "content": "What
i
s the temperature in New York?"}]
# pass functions directly as tools in the tools list or as a JSON schema
response = chat(model="qwen3", messages=messages, tools=[get_temperature], think=True)
...
...
@@ -146,7 +146,7 @@ Also known as "single-shot" tool calling.
},
]
const messages = [{ role: 'user', content: "What
'
s the temperature in New York?" }]
const messages = [{ role: 'user', content: "What
i
s the temperature in New York?" }]
const response = await ollama.chat({
model: 'qwen3',
...
...
@@ -609,7 +609,7 @@ def get_temperature(city: str) -> str:
return temperatures.get(city, 'Unknown')
messages = [{'role': 'user', 'content': "What
'
s the temperature in New York?"}]
messages = [{'role': 'user', 'content': "What
i
s the temperature in New York?"}]
while True:
stream = chat(
...
...
@@ -684,7 +684,7 @@ const getTemperatureTool = {
}
async function agentLoop() {
const messages = [{ role: 'user', content: "What
'
s the temperature in New York?" }]
const messages = [{ role: 'user', content: "What
i
s the temperature in New York?" }]
while (true) {
const stream = await ollama.chat({
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment