Skip to content

Conversation

@1018053166
Copy link

Description

Fixes langgenius/dify-official-plugins#1724 by making authorization header handling in OpenAI-compatible rerank model consistent with text_embedding implementation:

  • Only adds Authorization header when api_key is present
  • Matches text_embedding.py behavior exactly
  • Ensures backward compatibility

Changes

  • Modified header generation logic in rerank.py
  • Added null check for api_key
  • Updated all comments to English

"Content-Type": "application/json",
}

# 只有当api_key不为空时才添加Authorization头
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make sure the comment in English.

@1018053166 1018053166 force-pushed the fix/rerank-auth-handling branch from f841890 to 98273d6 Compare September 18, 2025 05:46
Copy link
Collaborator

@Yeuoly Yeuoly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Yeuoly
Copy link
Collaborator

Yeuoly commented Sep 23, 2025

scripts/fix.sh may help

@Mairuis Mairuis closed this Nov 24, 2025
@Mairuis Mairuis reopened this Dec 8, 2025
@Mairuis
Copy link
Collaborator

Mairuis commented Dec 8, 2025

Please accept my sincere apologies for the incorrect closure of your pull request due to a technical issue in the trigger test. This was an operational mistake on our side, and I deeply regret any inconvenience this may have caused. (T.T)
Your PR has been reopened accordingly. Thank you for your understanding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When the API key for the rerank model in the openai_api_compatible module configuration is empty, a 401 error is returned.

4 participants