mirror of https://github.com/ollama/ollama
While processing the response stream during a chat or generation if an error is occurred it is parsed and returned to the user. The issue with the existing code is that this assumed the response would be valid JSON, which is not a safe assumption and caused cryptic error messages to be displayed due to parsing failures: `invalid character 'i' looking for beginning of value` This change updates the stream function to return the raw error string if it cant be parsed as JSON. This should help with debugging issues by making sure the actual error reaches the user. |
||
|---|---|---|
| .. | ||
| examples | ||
| client.go | ||
| client_test.go | ||
| types.go | ||
| types_test.go | ||
| types_typescript_test.go | ||