mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-22 01:55:27 -04:00
[PR #1477] [MERGED] fix(bedrock): Comprehensive inference profile parameter support and response format fix v0.0.30 #1914
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/1477
Author: @akshaysinghas
Created: 8/11/2025
Status: ✅ Merged
Merged: 8/11/2025
Merged by: @crazywoola
Base:
main← Head:fix-response-format-inference-profile-clean📝 Commits (2)
b51eddcfix(bedrock): Comprehensive inference profile parameter support and response format fix505f137refactor(bedrock): Implement schema-driven parameter extraction for inference profiles📊 Changes
2 files changed (+78 additions, -9 deletions)
View changed files
📝
models/bedrock/manifest.yaml(+1 -1)📝
models/bedrock/models/llm/llm.py(+77 -8)📄 Description
🎯 Overview
This PR comprehensively fixes critical issues with Bedrock inference profiles that were causing parameter limitations and missing
functionality compared to direct model access.
🐛 Issues Fixed
🔧 Technical Changes
Core Implementation
Parameter Support by Model Type
📋 Anthropic (Claude): response_format, max_tokens, temperature, top_p, top_k, reasoning_type, reasoning_budget
📋 Nova: max_new_tokens, cross-region, system_cache_checkpoint, latest_two_messages_cache_checkpoint, temperature, top_p, top_k
📋 Llama: max_gen_len, temperature, top_p, top_k, reasoning_type, reasoning_budget
📋 Other models: All parameters from their respective schemas (excluding model_name)
Files Modified
🧪 Test Scenarios
Response Format Testing
Parameter Completeness Testing
🔄 Before/After Comparison
Nova Inference Profile UI
Before: Only showed basic parameter descriptions
After: Shows complete parameter set matching direct Nova model access
Anthropic Inference Profile
Before: Missing Response Format option
After: Response Format available with proper JSON/structured output support
🏗️ Architecture Improvements
Maintainability
Robustness
📚 Implementation Details
Schema-Driven Parameter Extraction
def _get_inference_profile_parameter_rules(self, model_schema, underlying_model_id: str = None) -> list:
# Automatically extracts parameters from model schema
# Excludes model_name (determined by inference profile)
# Applies model-specific filtering (e.g., response_format for Anthropic only)
Response Format Processing
Only processes response_format for Anthropic models
if is_anthropic and model_parameters.get('response_format'):
# Apply ANTHROPIC_BLOCK_MODE_PROMPT transformation
⚡ Performance Impact
🔒 Backward Compatibility
📋 Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.