mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-21 17:45:23 -04:00
[OpenAI-API-compatible Plugin] Adjustment Needed for rerank Field Transmission #411
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 @acshmily on GitHub (Jun 30, 2025).
Self Checks
Dify version
1.3.0
Plugin version
0.0.16
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
Here is the translated version of your issue report for GitHub:
Title
[OpenAI-API-compatible Plugin] Adjust
docsField todocumentsfor Rerank Endpoint CompatibilityDescription
Problem Summary
When integrating an external rerank model using the OpenAI-API-compatible Plugin, I encountered a field mismatch error:
API Documentation Analysis
The target rerank API (https://wishub-x1.ctyun.cn/v1/rerank) expects the input field
documents:However, the plugin uses the field
docsinstead, as defined in:models/openai_api_compatible/models/rerank/rerank.pyReference to Standard API
The official VLLM OpenAI-compatible server (https://docs.vllm.ai/en/latest/serving/openai_compatible_server.html#extra-parameters_8) also uses
documents:Proposed Solution
Update the plugin's rerank implementation to use the
documentsfield instead ofdocsto align with standard OpenAI-compatible APIs and third-party services.This change should be made in:
models/openai_api_compatible/models/rerank/rerank.pyLet me know if you need further information or testing assistance!
Key Points
docs, but external APIs requiredocuments.Let me know if you need further adjustments!
✔️ Error log
No response
@hjlarry commented on GitHub (Jul 2, 2025):
I believe there might be another reason causing your error.
The
docsfield is an internal attribute of the plugin. When the plugin sends a request to the model provider, it utilizes thedocumentsfield, as you can observe here. https://github.com/langgenius/dify-plugin-sdks/blob/c1e36d653c2dca771649981792c64ceb2e4e8476/python/dify_plugin/interfaces/model/openai_compatible/rerank.py#L68