Replies: 1 comment
|
I was able to get this to work after some time learning how tooling works. First, make sure you are using a good model. I used $body = @{
model = "qwen3.5-9b-claude-4.6-opus-reasoning-distilled"
messages = @(
@{ role = "system"; content = "CRITICAL: You must format ALL function calls inside <tool_call> XML tags. NEVER use markdown code blocks or ```json tags." },
@{ role = "user"; content = "Please write a file named test.txt containing the word SUCCESS." }
)
tools = @(
@{
type = "function"
function = @{
name = "Write"
description = "Writes a file to the local filesystem."
parameters = @{ type = "object"; properties = @{ file_path = @{ type = "string" }; content = @{ type = "string" } }; required = @("file_path", "content") }
}
}
)
tool_choice = "auto"
} | ConvertTo-Json -Depth 10
Invoke-RestMethod -Uri "http://localhost:12349/v1/chat/completions" -Method Post -ContentType "application/json" -Body $body
$response.choices[0].message | ConvertTo-Json -Depth 10
{
"role": "assistant",
"content": "",
"reasoning_content": "The user wants me to create a file named test.txt with the content \"SUCCESS\". I need to use the Write function to do this, making sure to format it correctly using XML tags as specified.\n",
"tool_calls": [
{
"type": "function",
"id": "BEqM7JYU9hUwCoRPXqmjkNYDVm0ot49K",
"function": {
"name": "Write",
"arguments": "{\"content\":\"SUCCESS\",\"file_path\":\"test.txt\"}"
}
}
]
}I modified the chat template and added/replaced (insert the critical section part, not sure if it helps but gemma told me to do it as it came about from it not working previous. It may be that sometimes extra junk is added corrupting the output) Then the openclaude prompt and I was able to get it to write to a file. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hello. I'm new to setting up local LLMs but I got most of the way there on my own.

Below is a screenshot but basically, it seems like it's unable to use any tools to actually interact with files or the system.
My configuration is default, using ollama and qwen coder as seen in the screenshot. Any help would be appreciated, thank you. I did look in the existing questions but didn't see any, although with my question being so general, there are good odds I just didn't know what to search to find it.
All reactions