mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-21 17:45:23 -04:00
report 'relevance_score' error #527
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 @CreamyLong on GitHub (Aug 6, 2025).
Self Checks
Dify version
1.7.1
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
add rerank model in OpenAI-API-compatible
✔️ Expected Behavior
❌ Actual Behavior
unable to add rerank model
@dosubot[bot] commented on GitHub (Aug 6, 2025):
Hi @CreamyLong! I'm Dosu and I’m helping the dify team.
Dify expects rerank model outputs to use the field
score(float) for each document, notrelevance_score. If your rerank plugin or external model returns results usingrelevance_score, Dify won't recognize it and will raise a schema validation error, which prevents you from adding the rerank model. This is a common integration issue—Dify does not provide a built-in mapping or configuration to acceptrelevance_scorein place ofscorereference.To fix this, make sure your rerank plugin or proxy transforms the response so that each document object uses
scoreinstead ofrelevance_score. If you can't modify the plugin directly, you can use a simple proxy to rewrite the response JSON. For example, in JavaScript:Also, check that your plugin daemon returns error responses as JSON objects (not lists), since Dify expects errors in dict/object format—otherwise, you'll see errors like
list indices must be integers or slices, not strreference.If you want help reviewing your rerank model config or plugin logs, feel free to share them.
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other
