Skip to content

Instantly share code, notes, and snippets.

View gravitymonkey's full-sized avatar

gravitymonkey gravitymonkey

View GitHub Profile
@gravitymonkey
gravitymonkey / gist:04393648c7f8f6a116a2e4d331e6d60b
Created May 23, 2024 16:12
Mistral 0.3 (May '24) with Ollama for Function Calling (ish)
# here's the RAW curl from their example in a copy/paste format to see the TOOLS response
curl -X POST http://localhost:11434/api/generate -H "Content-Type: application/json" -d '{
"model": "mistral",
"prompt": "[AVAILABLE_TOOLS] [{\"type\": \"function\", \"function\": {\"name\": \"get_current_weather\", \"description\": \"Get the current weather\", \"parameters\": {\"type\": \"object\", \"properties\": {\"location\": {\"type\": \"string\", \"description\": \"The city and state, e.g. San Francisco, CA\"}, \"format\": {\"type\": \"string\", \"enum\": [\"celsius\", \"fahrenheit\"], \"description\": \"The temperature unit to use. Infer this from the users location.\"}}, \"required\": [\"location\", \"format\"]}}}][/AVAILABLE_TOOLS][INST] What is the weather like today in San Francisco [/INST]",
"raw": true,
"stream": false
}'