Skip to content

AI DeepSeek 422 Unprocessable Entity #14347

Closed
@ghost

Description

@ghost

AI Error in docker container: Invalid type for 'messages.[3].content'

Is there an existing issue for this?

  • I have searched the existing issues

Can the issue be reproduced with the default theme (daylight/midnight)?

  • I was able to reproduce the issue with the default theme

Could the issue be due to extensions?

  • I've ruled out the possibility that the extension is causing the problem.

Describe the problem

  1. No extension installed
  2. Exact same config works in Windows desktop client
  3. Not working in hosted docker container

Expected result

Should work regardless of platform.

Screenshot or screen recording presentation

Image

Version environment

- Version: v3.1.24 
- Operating System: docker
- Browser (if used): up-to-date Firefox

Log file

E 2025/03/11 09:50:42 openai.go:55: create chat completion failed: error, status code: 400, status: 400 Bad Request, message: Invalid type for 'messages.[3].content': expected one of a string or array of objects, but got an object instead.

More information

Not sure why docker version does not work. Is it because of the networking is different for docker? Does the user need to config something such as DNS to make it work?

Activity

88250

88250 commented on Mar 12, 2025

@88250
Member

Please provide the complete log.

ps: I guess it may be a docker network configuration problem.

sz2013

sz2013 commented on Mar 14, 2025

@sz2013

一样的问题

这就是全部日志
E 2025/03/14 18:19:32 openai.go:55: create chat completion failed: error, status code: 400, status: 400 Bad Request, message: Invalid type for 'messages.[3].content': expected one of a string or array of objects, but got an object instead. (request id: 2025031418193220789630037510643)

winsonet

winsonet commented on Mar 14, 2025

@winsonet

I have the same issue~

ghost

ghost commented on Mar 14, 2025

@ghost

This entry of log is the only one that is related to AI failure. The other logs are unrelated. Please set up a container yourself, it is very easy to reproduce.

winsonet

winsonet commented on Mar 14, 2025

@winsonet

actually, just the Aliyun API has this issue, if using Siliconflow API then it will be fine

88250

88250 commented on Mar 15, 2025

@88250
Member

actually, just the Aliyun API has this issue, if using Siliconflow API then it will be fine

Thanks for the information. It is possible that the Aliyun API is incompatible with the OpenAI API specification in some details. We cannot change this. Thanks for your feedback and discussion.

ghost

ghost commented on Mar 17, 2025

@ghost

As stated, it works in windows client, not in docker. This seems like an platform dependent implementation error instead of an error from aliyun from my perspective.

88250

88250 commented on Mar 17, 2025

@88250
Member

The implementation code of this part has nothing to do with the specific platform and is the same code.

ghost

ghost commented on Mar 20, 2025

@ghost

I tried another AI provider: https://api.deepinfra.com/v1/openai
I got the same error in docker container again.

Not sure why this ticket is closed. Could you verify it before closing it? This should be very easy to verify. Just put in any provider in a docker container frontend. You will see the error.

88250

88250 commented on Mar 21, 2025

@88250
Member

I tested https://api.deepseek.com/v1 with SiYuan Docker and it is available. The configuration is as follows:

Image

I think you could try changing this https://api.deepinfra.com/v1/openai to https://api.deepinfra.com/v1

sz2013

sz2013 commented on Mar 21, 2025

@sz2013

Image

我这不行,docker依然报错,但桌面端不报错

Image

TCOTC

TCOTC commented on Mar 21, 2025

@TCOTC
Contributor

超时时间改成600试试

sz2013

sz2013 commented on Mar 21, 2025

@sz2013

超时时间改成600试试

不行,一样的错
E 2025/03/21 17:01:55 openai.go:55: create chat completion failed: error, status code: 422, status: 422 Unprocessable Entity, message: invalid character 'F' looking for beginning of value, body: Failed to deserialize the JSON body into the target type: messages[0]: missing field content at line 1 column 53

88250

88250 commented on Mar 21, 2025

@88250
Member

你用的是 ai 的哪个功能?

13 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @88250@phdbbs@winsonet@sz2013@TCOTC

      Issue actions

        AI DeepSeek 422 Unprocessable Entity · Issue #14347 · siyuan-note/siyuan