guywaldman / magic-cli

Command line utility to make you a magician in the terminal
https://guywaldman.com/posts/introducing-magic-cli
MIT License
725 stars 18 forks source link

Error: missing field `model` at line 1 column 70 #16

Closed zachschultz closed 4 months ago

zachschultz commented 4 months ago

Hello, I'm running into an issue getting magic-cli to work, the exact error I'm receiving is:

Error: Generation error: Generation error: Text generation error: 
Unexpected error when parsing response from Ollama. 
Error: missing field `model` at line 1 column 70

My magic-cli version is 0.0.2, and I have llama3 running directly on my machine via the Ollama Mac app.

The output of me directly calling /api/generate on llama3 via the below curl command:

curl http://localhost:11434/api/generate -d '{                                                               ─╯
  "model": "llama3",
  "prompt":"Why is the sky blue?"
}'

is (with some information elided for brevity):

{"model":"llama3","created_at":"2024-07-17T15:47:16.496796Z",
"response":"","done":true,"done_reason":"stop",
"context":[128006,882,128007,...],"total_duration":12652309167, ...}

The output of magic-cli sys-info is:

System information as detected by the CLI:

OS: Darwin
OS version: 14.5
CPU architecture: arm64
Shell: zsh
zachschultz commented 4 months ago

I realized that I needed to update the "ollama.model" configuration field to llama3.

guywaldman commented 4 months ago

Thanks @zachschultz. This warrants better error messages, definitely something to improve.