[GH-ISSUE #1407] When using chat, no error when param names are wrong #748

Closed
opened 2026-04-12 10:25:41 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @technovangelist on GitHub (Dec 6, 2023).
Original GitHub issue: https://github.com/ollama/ollama/issues/1407

This works and gives the output I expect:

POST http://localhost:11434/api/chat
Content-Type: application/json

{
  "model": "llama2", 
  "messages": [
    {
      "role": "user", 
      "content": "Why is the sky blue"
    }
  ]
}

But this:

POST http://localhost:11434/api/chat
Content-Type: application/json

{
  "model": "llama2", 
  "messages": [
    {
      "role": "user", 
      "context": "Why is the sky blue"
    }
  ]
}

gives me

HTTP/1.1 200 OK
Content-Type: application/x-ndjson
Date: Wed, 06 Dec 2023 21:33:44 GMT
Connection: close
Transfer-Encoding: chunked

{
  "model": "registry.ollama.ai/library/llama2:latest",
  "created_at": "2023-12-06T21:33:44.440469Z",
  "done": true,
  "total_duration": 4962667,
  "prompt_eval_count": 25,
  "prompt_eval_duration": 290212000,
  "eval_count": 457,
  "eval_duration": 107065386000
}

So it sort of works, but not really. The difference is that I put the content in a field called context instead of content.

Originally created by @technovangelist on GitHub (Dec 6, 2023). Original GitHub issue: https://github.com/ollama/ollama/issues/1407 This works and gives the output I expect: ``` POST http://localhost:11434/api/chat Content-Type: application/json { "model": "llama2", "messages": [ { "role": "user", "content": "Why is the sky blue" } ] } ``` But this: ``` POST http://localhost:11434/api/chat Content-Type: application/json { "model": "llama2", "messages": [ { "role": "user", "context": "Why is the sky blue" } ] } ``` gives me ``` HTTP/1.1 200 OK Content-Type: application/x-ndjson Date: Wed, 06 Dec 2023 21:33:44 GMT Connection: close Transfer-Encoding: chunked { "model": "registry.ollama.ai/library/llama2:latest", "created_at": "2023-12-06T21:33:44.440469Z", "done": true, "total_duration": 4962667, "prompt_eval_count": 25, "prompt_eval_duration": 290212000, "eval_count": 457, "eval_duration": 107065386000 } ``` So it sort of works, but not really. The difference is that I put the content in a field called context instead of content.
GiteaMirror added the feature request label 2026-04-12 10:25:41 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#748