[PR #260] fix: use configurable max_tokens in credential validation instead of hardcoded value #267

Open
opened 2026-02-15 21:16:30 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langgenius/dify-plugin-sdks/pull/260
Author: @huayaoyue6
Created: 12/7/2025
Status: 🔄 Open

Base: mainHead: main


📝 Commits (1)

  • f4064c0 fix: use configurable max_tokens in credential validation instead of hardcoded value

📊 Changes

1 file changed (+2 additions, -1 deletions)

View changed files

📝 python/dify_plugin/interfaces/model/openai_compatible/llm.py (+2 -1)

📄 Description

The validate_credentials method in OAICompatLargeLanguageModel uses a hardcoded max_tokens: 5 value when testing model connectivity. This can cause credential validation failures for models that have minimum token requirements higher than 5, even when the credentials are correct.

Pull Request Checklist

Thank you for your contribution! Before submitting your PR, please make sure you have completed the following checks:

Compatibility Check

  • [ ✓] I have checked whether this change affects the backward compatibility of the plugin declared in README.md
  • [ ✓] I have checked whether this change affects the forward compatibility of the plugin declared in README.md
  • [ ✓] If this change introduces a breaking change, I have discussed it with the project maintainer and specified the release version in the README.md
  • [ ✓] I have described the compatibility impact and the corresponding version number in the PR description
  • [ ✓] I have checked whether the plugin version is updated in the README.md

Available Checks

  • [ ✓] Code has passed local tests
  • [ ✓] Relevant documentation has been updated (if necessary)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langgenius/dify-plugin-sdks/pull/260 **Author:** [@huayaoyue6](https://github.com/huayaoyue6) **Created:** 12/7/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (1) - [`f4064c0`](https://github.com/langgenius/dify-plugin-sdks/commit/f4064c05d1a5166f95ec86c44a9050911b605920) fix: use configurable max_tokens in credential validation instead of hardcoded value ### 📊 Changes **1 file changed** (+2 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `python/dify_plugin/interfaces/model/openai_compatible/llm.py` (+2 -1) </details> ### 📄 Description The `validate_credentials` method in `OAICompatLargeLanguageModel` uses a hardcoded `max_tokens: 5` value when testing model connectivity. This can cause credential validation failures for models that have minimum token requirements higher than 5, even when the credentials are correct. # Pull Request Checklist Thank you for your contribution! Before submitting your PR, please make sure you have completed the following checks: ## Compatibility Check - [ ✓] I have checked whether this change affects the **backward compatibility** of the plugin declared in `README.md` - [ ✓] I have checked whether this change affects the **forward compatibility** of the plugin declared in `README.md` - [ ✓] If this change introduces a breaking change, I have discussed it with the project maintainer and specified the release version in the `README.md` - [ ✓] I have described the compatibility impact and the corresponding version number in the PR description - [ ✓] I have checked whether the plugin version is updated in the `README.md` ## Available Checks - [ ✓] Code has passed local tests - [ ✓] Relevant documentation has been updated (if necessary) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-15 21:16:30 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-plugin-sdks#267