Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

500 error: json: cannot unmarshal string into Go struct field ChatRequest.messages of type api.ToolCallFunctionArguments #89

Open
lrq3000 opened this issue Aug 25, 2024 · 2 comments · May be fixed by #92

Comments

@lrq3000
Copy link

lrq3000 commented Aug 25, 2024

I get the following error when I try to do a search (especially when in Expert mode):

500: {"error":"json: cannot unmarshal string into Go struct field ChatRequest.messages of type api.ToolCallFunctionArguments"}

I am using the Docker approach and ollama and phi3:14b on Windows 11.

@jandoerntlein
Copy link

jandoerntlein commented Sep 5, 2024

Same error here. To me this looks like an issue on ollama side maybe? Refer to ollama/ollama#5909

Update: As the ollama issue suggests, I tried to change the litellm endpoint:

-    ChatModel.LOCAL_LLAMA_3: "ollama_chat/llama3",
+    ChatModel.LOCAL_LLAMA_3: "ollama/llama3.1",

This now results in the following error

[...]
File "/workspace/.venv/lib/python3.12/site-packages/instructor/retry.py", line 173, in retry_sync
    raise InstructorRetryException(
instructor.retry.InstructorRetryException: 1 validation error for RelatedQueries
related_questions
  Input should be a valid array [type=list_type, input_value='[', input_type=str]
    For further information visit https://errors.pydantic.dev/2.9/v/list_type

Looks like the input_value='[' is passed incomplete, instead of '[]' if empty?

A simple fix for this issue (for me) seems to just not use llama3. Gemma2 works fine for me. I did not try phi3.

(Sidenote: I upgraded to python3.12 and pydantic 2.9.0)

@jandoerntlein
Copy link

jandoerntlein commented Sep 8, 2024

Found a workaround to fix the issue... give it a try.

0001-fix-issues-89-unmarshallling-string-failed.patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants