mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-22 01:55:27 -04:00
[PR #1643] [MERGED] fix: bedrock provider "Model name is required for non-converse API models" error #2006
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?
📋 Pull Request Information
Original PR: https://github.com/langgenius/dify-official-plugins/pull/1643
Author: @twjackysu
Created: 9/3/2025
Status: ✅ Merged
Merged: 9/4/2025
Merged by: @crazywoola
Base:
main← Head:main📝 Commits (1)
34716b9fix: bedrock provider "Model name is required for non-converse API models" error📊 Changes
2 files changed (+2 additions, -2 deletions)
View changed files
📝
models/bedrock/manifest.yaml(+1 -1)📝
models/bedrock/models/llm/llm.py(+1 -1)📄 Description
Related Issues or Context
This error occurs sporadically - sometimes the same model configuration works, sometimes it fails.
Root Cause
The issue is in the
_get_model_infomethod wheremodel_parameters.pop('model_name')removes themodel_nameparameter from the dictionary. When the Converse API call fails and the code falls back to the traditional API, the fallback logic tries to retrievemodel_nameusingmodel_parameters.get('model_name'), but the parameter has already been removed by the previouspop()operation.Flow that causes the error:
_get_model_info()is called withmodel_parameterscontainingmodel_namemodel_name = model_parameters.pop('model_name')- removesmodel_namefrom the dictionary_find_model_info(model_id)returnsNone(model not found in Converse API support list), an exception is thrownmodel_name = model_parameters.get('model_name')- butmodel_namehas already been removed!model_nameisNone, causing the error: "Model name is required for non-converse API models"Solution
Change
model_parameters.pop('model_name')tomodel_parameters.get('model_name')in the_get_model_infomethod. This preserves themodel_nameparameter for the fallback logic while maintaining the same functionality.Changes
dify-official-plugins/models/bedrock/models/llm/llm.pymodel_parameters.pop('model_name')tomodel_parameters.get('model_name')Testing
This fix resolves the intermittent failure and ensures that the fallback to traditional API works correctly when Converse API is not available for certain models.
Impact
This PR contains Changes to Non-Plugin
This PR contains Changes to Non-LLM Models Plugin
This PR contains Changes to LLM Models Plugin
Version Control (Any Changes to the Plugin Will Require Bumping the Version)
VersionField, Not in Meta Section)Dify Plugin SDK Version
dify_plugin>=0.3.0,<0.5.0is in requirements.txt (SDK docs)Environment Verification (If Any Code Changes)
Local Deployment Environment
SaaS Environment
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.