diff --git a/python/dify_plugin/interfaces/model/openai_compatible/llm.py b/python/dify_plugin/interfaces/model/openai_compatible/llm.py index dcff5ffd..8f5b7ba7 100644 --- a/python/dify_plugin/interfaces/model/openai_compatible/llm.py +++ b/python/dify_plugin/interfaces/model/openai_compatible/llm.py @@ -183,7 +183,8 @@ def validate_credentials(self, model: str, credentials: dict) -> None: endpoint_url += "/" # prepare the payload for a simple ping to the model - data = {"model": credentials.get("endpoint_model_name", model), "max_tokens": 5} + data = {"model": credentials.get("endpoint_model_name", model), + "max_tokens": int(credentials.get("max_tokens_to_sample", 20))} completion_type = LLMMode.value_of(credentials["mode"])