mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-22 01:55:27 -04:00
Jina rerank fails #684
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 @DavideDelbianco on GitHub (Oct 1, 2025).
Self Checks
Dify version
1.9.1
Plugin version
0.0.8
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
Jina AI has changed the default value of the request parameter "return_documents": false
this means that the body of the document is no longer returned and the rerank call is probably failing for that rason:
✔️ Error log
[jina] Error: req_id: 6ff416ac64 PluginInvokeError: {"args":{"description":"[models] Error: string indices must be integers, not 'str'"},"error_type":"InvokeError","message":"[models] Error: string indices must be integers, not 'str'"}
@dosubot[bot] commented on GitHub (Oct 1, 2025):
The Jina rerank failure is caused by the recent change in Jina's API: when
"return_documents": false, the response no longer includes document bodies, but the Dify plugin code still tries to accessresult["document"]["text"]. This leads to the errorstring indices must be integers, not 'str'because the expected dictionary is missing and the code attempts to index a string or a null value instead.To fix this, update the rerank plugin code to check if
result["document"]exists and is a dictionary before accessing its"text"field. If the document body is missing, you can either skip that result or provide a default value (like an empty string). For example:This change will prevent the plugin from crashing when document bodies are missing and allow it to handle the new Jina API response gracefully. There is no built-in config to handle this in Dify, so a code patch is needed for robust integration with Jina's rerank endpoint [source].
Recent error handling improvements in other plugins show a trend toward more robust error categorization, but do not directly address this Jina rerank issue [source]. For now, patching the plugin code as above is the recommended workaround.
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other
