Skip to content

Instantly share code, notes, and snippets.

@monotykamary
Created April 18, 2026 20:11
Show Gist options
  • Select an option

  • Save monotykamary/64c485377a53ffd535128e42750c506d to your computer and use it in GitHub Desktop.

Select an option

Save monotykamary/64c485377a53ffd535128e42750c506d to your computer and use it in GitHub Desktop.
wafer thinking test
echo "=== WITHOUT tools ==="
curl -s --max-time 30 "https://pass.wafer.ai/v1/chat/completions" \
-H "Authorization: Bearer $WAFER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "GLM-5.1",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Read the file /tmp/test.txt"}
],
"max_completion_tokens": 512,
"stream": false
}' | python3 -c "
import json,sys
r = json.load(sys.stdin)
msg = r['choices'][0]['message']
print(f'reasoning_tokens: {r[\"usage\"].get(\"reasoning_tokens\",0)}, reasoning_len: {len(msg.get(\"reasoning_content\",\"\") or
\"\")}')
"
echo ""
echo "=== WITH tools ==="
curl -s --max-time 30 "https://pass.wafer.ai/v1/chat/completions" \
-H "Authorization: Bearer $WAFER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "GLM-5.1",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Read the file /tmp/test.txt"}
],
"tools": [{"type": "function", "function": {"name": "read", "description": "Read a file", "parameters": {"type": "object",
"properties": {"path": {"type": "string"}}, "required": ["path"]}}}],
"max_completion_tokens": 512,
"stream": false
}' | python3 -c "
import json,sys
r = json.load(sys.stdin)
msg = r['choices'][0]['message']
print(f'reasoning_tokens: {r[\"usage\"].get(\"reasoning_tokens\",0)}, reasoning_len: {len(msg.get(\"reasoning_content\",\"\") or
\"\")}')
print(f'has_tool_calls: {msg.get(\"tool_calls\") is not None}')
"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment