mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-22 01:55:27 -04:00
OpenAI-API-compatible add m3e error #335
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @yanwencheng on GitHub (Jun 4, 2025).
Self Checks
Dify version
master
Cloud or Self Hosted
Self Hosted (Source)
Steps to reproduce
1、m3e install
docker run -d --name m3e -p 6008:6008 registry.cn-hangzhou.aliyuncs.com/fastgpt_docker/m3e-large-api
key:sk-aaabbbcccdddeeefffggghhhiiijjjkkk
test:
curl --location --request POST 'https://domain/v1/embeddings'
--header 'Authorization: Bearer xxxx'
--header 'Content-Type: application/json'
--data-raw '{
"model": "m3e",
"input": ["laf是什么"]
}'
✔️ Expected Behavior
No response
❌ Actual Behavior
No response
@dosubot[bot] commented on GitHub (Jun 4, 2025):
Hi @yanwencheng! I'm Dosu and I’m helping the dify team.
Your "OpenAI-API-compatible add m3e error" is related to model credential validation for a text-embedding model in Dify. Based on similar issues and the Dify codebase, here are the most likely causes and solutions:
Model Name or Credential Schema Issue: The most common cause for credential validation errors is an incorrect or unsupported model name. For example, if "m3e" is not recognized by Dify or the underlying provider, you will get a validation error. Double-check that "m3e" is a valid model identifier for your provider and that it matches the expected schema. A similar issue was resolved by correcting a typo in the model name "my bad, I was used an invalid modle name".
422 Status Code: Dify itself does not typically return a 422 error. This often comes from a third-party intermediary, such as a reverse proxy or a service like Cloudflare. If you are running Dify behind such a service, try bypassing it or checking its logs for more details "A 422 error is usually not returned by Dify itself. It is typically caused by third-party intermediaries or possibly due to the use of certain serverless proxies, such as Cloudflare.".
Credential Format: The credential validation process is strict. Required fields must be present, types must match, and values must be within allowed options. If any required credential is missing or misformatted, validation will fail. Review the credential schema for your provider and ensure all required fields (like
api_key,endpoint_url, etc.) are filled in correctly. See the schema validation logic for details.Recent Changes: There are no recent changes in the Dify codebase that specifically affect credential validation for the "text-embedding" model type. The validation process is centralized and schema-driven, so any changes would impact all model types, not just "text-embedding".
Plugin Daemon/Request Format: If you are using a third-party embedding service, Dify may send requests with a different JSON structure than expected (e.g., using
documentsinstead oftexts). If your backend expects a different format, you may need to adjust your service or use a proxy to translate the request "instead documents with texts, then you don't need any proxy".Troubleshooting steps:
If you can share the full error traceback or the exact payload you are submitting, I can help pinpoint the issue further.
To reply, just mention my name @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report ���� | Other
