TypeError: argument should be a bytes-like object or ASCII string, not 'list' #881

Closed
opened 2026-02-21 17:28:50 -05:00 by yindo · 5 comments
Owner

Originally created by @yuec on GitHub (Jan 8, 2024).

Originally assigned to: @takatost, @JohnJyong on GitHub.

Self Checks

Dify version

0.4.4

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

image

✔️ Expected Behavior

Return recall data normally

Actual Behavior

report an error "typeError: argument should be a bytes-like object or ASCII string, not 'list'"

image

exception traceback:
image

According to openai's api documentation, response.data should be an array, but data.embedding used in dify.

Is this a bug caused by version upgrades?

image

image

Originally created by @yuec on GitHub (Jan 8, 2024). Originally assigned to: @takatost, @JohnJyong on GitHub. ### Self Checks - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to file this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). ### Dify version 0.4.4 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce ![image](https://github.com/langgenius/dify/assets/4444125/f775f8b2-11fa-4f9b-a775-02bcb235a4b8) ### ✔️ Expected Behavior Return recall data normally ### ❌ Actual Behavior report an error "typeError: argument should be a bytes-like object or ASCII string, not 'list'" ![image](https://github.com/langgenius/dify/assets/4444125/1995745c-85fc-4b87-839d-0ad2da7cba11) exception traceback: ![image](https://github.com/langgenius/dify/assets/4444125/1909ff83-3f27-400c-be35-63644fc91309) According to openai's api documentation, response.data should be an array, but data.embedding used in dify. Is this a bug caused by version upgrades? ![image](https://github.com/langgenius/dify/assets/4444125/e579fea8-ae01-4c6e-bc06-bddc37a38221) ![image](https://github.com/langgenius/dify/assets/4444125/6284bdb5-6e83-4050-9659-4b47ede610ab)
yindo added the 🐞 bug label 2026-02-21 17:28:50 -05:00
yindo closed this issue 2026-02-21 17:28:50 -05:00
Author
Owner

@JohnJyong commented on GitHub (Jan 12, 2024):

image
The embedding is a string encrypted by base64, so there is no problem with the logic here.
Are you using the proxied openai interface?

@JohnJyong commented on GitHub (Jan 12, 2024): ![image](https://github.com/langgenius/dify/assets/76649700/88645359-c0b1-4df5-95df-257ea02b764e) The embedding is a string encrypted by base64, so there is no problem with the logic here. Are you using the proxied openai interface?
Author
Owner

@yuec commented on GitHub (Jan 13, 2024):

Sorry, I just saw this message.

Yes, we used a proxy, and this is indeed a bug caused by the proxy.

@yuec commented on GitHub (Jan 13, 2024): Sorry, I just saw this message. Yes, we used a proxy, and this is indeed a bug caused by the proxy.
Author
Owner

@wangliqing870209 commented on GitHub (May 30, 2024):

后来是怎么处理的呢

@wangliqing870209 commented on GitHub (May 30, 2024): 后来是怎么处理的呢
Author
Owner

@imxieqing commented on GitHub (Sep 12, 2024):

后来是怎么处理的呢

dify不给修复 也没有给出可选项好像

@imxieqing commented on GitHub (Sep 12, 2024): > 后来是怎么处理的呢 dify不给修复 也没有给出可选项好像
Author
Owner

@shengxiagit commented on GitHub (Sep 14, 2024):

后来是怎么处理的呢

dify不给修复 也没有给出可选项好像

可以使用 OpenAI-API-compatible 这个模型供应商类型解决
image

@shengxiagit commented on GitHub (Sep 14, 2024): > > 后来是怎么处理的呢 > > dify不给修复 也没有给出可选项好像 可以使用 OpenAI-API-compatible 这个模型供应商类型解决 <img width="816" alt="image" src="https://github.com/user-attachments/assets/9232cd87-b240-469c-8dce-dcbae0b62eb4">
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#881