ECA sends null JSON items to Mistral models
To upvote this issue, give it a thumbs up. See this list for the most upvoted issues.
Describe the bug
When I send prompts in an Emacs ECA session to a Mistral model, I get the error OpenAI response status: 400 body: {"object":"error","message":"input: Value error, Input items of type None are not supported.","type":"invalid_request_error","param":null,"code":"3051","raw_status_code":400}.
This is because ECA sends null items in its JSON input (see the attached files for examples; I replaced some ids there with ... to avoid posting possibly sensitive information). It happens at least with mistral-small (when sending the first prompt already) and mistral-large-4 (when sending a followup prompt in the same session) models.
eca-mistral-small.json eca-mistral-large-4.json
To Reproduce
Steps to reproduce the behavior:
- Run Emacs.
- Open let's say eca-emacs/Eask file and run `M-x eca' there.
- Select mistral-small model.
- Run prompt "what is the package version?".
- You should get the error.
Expected behavior
ECA sends valid JSON inputs.
Doctor
Paste the relevant parts of /doctor command from chat if applicable:
ECA version: 0.169.0
Server cmd: /home/pdm/.emacs.d/eca/eca server
Workspaces: /home/pdm/git/github.com/editor-code-assistant/eca-emacs
Default model: mistral/mistral-large-4 (API key (...))
Logged providers: mistral: API key (...)
Relevant env vars:
Credential files: None found
@mz-pdm hey, should be fixed in the latest release. Can you confirm? Thanks.
Hi, I still get the same errors with ECA 0.170.0.
@mz-pdm Are you using openai-chat as API? openai (responses) API is not compatible with Mistral and I am not sure it is worth doing changes there.
edit: Yes, it looks like you use responses api. I think there is 0 reasons to use it. So after you switch to openai-chat then it should be fine.
Indeed, I was using responses API (perhaps copied from older docs), after updating the configuration from the current docs, it works. Thanks!