Skip to content

Conversation

@priyansh4320
Copy link
Collaborator

@priyansh4320 priyansh4320 commented Dec 17, 2025

Why are these changes needed?

This PR adds Support for additionalModelRequestFields in BedrockConfigEntry. handled in parse params.

  • passively also adds support for Thinking configuration for bedrock converse client.
  • Added a notebook example show casing both.
  • llmconfig with addionalModelRequestFields - ThinkingConfig:
llm_config = LLMConfig(
    config_list={
        "api_type": "bedrock",
        "model": "eu.anthropic.claude-3-7-sonnet-20250219-v1:0",
        "api_key": os.getenv("BEDROCK_API_KEY"),
        "aws_region": os.getenv("AWS_REGION"),
        "aws_access_key": os.getenv("AWS_ACCESS_KEY"),
        "aws_secret_key": os.getenv("AWS_SECRET_ACCESS_KEY"),
        "aws_profile_name": os.getenv("AWS_PROFILE"),
        # Enable thinking mode via additional_model_request_fields
        "additionalModelRequestFields": {
            "thinking": {
                "type": "enabled",
                "budget_tokens": 1024,  # Allocate 1024 tokens for thinking
            }
        },
        "temperature": 1,
        "max_tokens": 4096,  # Must be greater than budget_tokens
    },
)```
- Output format:
```python
  • llmconfig with addionalModelRequestFields - ThinkingConfig:
=== Example 1: Simple question with thinking mode ===
�[33muser�[0m (to conv_agent):

 """What is the capital of France? Also add a small research on it."""

{'ResponseMetadata': {'HTTPHeaders': {'connection': 'keep-alive',
                                      'content-length': '3178',
                                      'content-type': 'application/json',
                                      'date': 'Wed, 17 Dec 2025 15:37:12 GMT',
                                      'x-amzn-requestid': '2675966e-fe06-48e9-8a73-c9cfe1fbfd76'},
                      'HTTPStatusCode': 200,
                      'RequestId': '2675966e-fe06-48e9-8a73-c9cfe1fbfd76',
                      'RetryAttempts': 0},
 'metrics': {'latencyMs': 11164},
 'output': {'message': {'content': [{'reasoningContent': {'reasoningText': {'signature': 'ErcBCkgIChABGAIiQFexzXd9/I0M5/kKqBkqyV6xNPYEHDU4kayuot/oVsAUe7+gv4WdzUY77gMhjgv9OcbTqzWY5hw8MvSXtUj1DskSDGpvLvyLzdxz8h/r+xoM9GmlFr+AuiXcTkA1IjDpRAAC3479o+R0VSFI0imqV6assBfvzGcM3Tn/sarmcfmaakYDBmtynH2CVGvTgfEqHeCWV/OMJXwpzpLW7OVF10e9n7uDyCIx+w3/UglbGAI=',
                                                                            'text': 'The '
                                                                                    'capital '
                                                                                    'of '
                                                                                    'France '
                                                                                    'is '
                                                                                    'Paris. '
                                                                                    "I'll "
                                                                                    'provide '
                                                                                    'a '
                                                                                    'small '
                                                                                    'research '
                                                                                    'on '
                                                                                    'Paris.\n'
                                                                                    '\n'
                                                                                    'Paris '
                                                                                    'is '
                                                                                    'the '
                                                                                    'largest '
                                                                                    'city '
                                                                                    'and '
                                                                                    'capital '
                                                                                    'of '
                                                                                    'France, '
                                                                                    'situated '
                                                                                    'on '
                                                                                    'the '
                                                                                    'Seine '
                                                                                    'River '
                                                                                    'in '
                                                                                    'the '
                                                                                    'north-central '
                                                                                    'part '
                                                                                    'of '
                                                                                    'the '
                                                                                    'country. '
                                                                                    "It's "
                                                                                    'one '
                                                                                    'of '
                                                                                    'the '
                                                                                    "world's "
                                                                                    'major '
                                                                                    'global '
                                                                                    'cities '
                                                                                    'and '
                                                                                    'an '
                                                                                    'important '
                                                                                    'hub '
                                                                                    'for '
                                                                                    'finance, '
                                                                                    'diplomacy, '
                                                                                    'commerce, '
                                                                                    'fashion, '
                                                                                    'and '
                                                                                    'arts.\n'
                                                                                    '\n'
                                                                                    'Some '
                                                                                    'key '
                                                                                    'facts '
                                                                                    'about '
                                                                                    'Paris:\n'
                                                                                    '- '
                                                                                    'Population: '
                                                                                    'Approximately '
                                                                                    '2.2 '
                                                                                    'million '
                                                                                    'in '
                                                                                    'the '
                                                                                    'city '
                                                                                    'proper, '
                                                                                    'with '
                                                                                    'about '
                                                                                    '12 '
                                                                                    'million '
                                                                                    'in '
                                                                                    'the '
                                                                                    'metropolitan '
                                                                                    'area\n'
                                                                                    '- '
                                                                                    'Founded: '
                                                                                    'Around '
                                                                                    '259 '
                                                                                    'BC '
                                                                                    'by '
                                                                                    'a '
                                                                                    'Celtic '
                                                                                    'people '
                                                                                    'called '
                                                                                    'Parisii, '
                                                                                    'though '
                                                                                    'it '
                                                                                    'was '
                                                                                    'later '
                                                                                    'developed '
                                                                                    'as '
                                                                                    'Lutetia '
                                                                                    'by '
                                                                                    'the '
                                                                                    'Romans\n'
                                                                                    '- '
                                                                                    'Landmarks: '
                                                                                    'Eiffel '
                                                                                    'Tower, '
                                                                                    'Louvre '
                                                                                    'Museum, '
                                                                                    'Notre-Dame '
                                                                                    'Cathedral, '
                                                                                    'Arc '
                                                                                    'de '
                                                                                    'Triomphe, '
                                                                                    'Champs-Élysées\n'
                                                                                    '- '
                                                                                    'Districts: '
                                                                                    'Paris '
                                                                                    'is '
                                                                                    'divided '
                                                                                    'into '
                                                                                    '20 '
                                                                                    'arrondissements '
                                                                                    '(administrative '
                                                                                    'districts)\n'
                                                                                    '- '
                                                                                    'Nickname: '
                                                                                    '"City '
                                                                                    'of '
                                                                                    'Light" '
                                                                                    '(La '
                                                                                    'Ville '
                                                                                    'Lumière)\n'
                                                                                    '- '
                                                                                    'Culture: '
                                                                                    'Known '
                                                                                    'for '
                                                                                    'its '
                                                                                    'art '
                                                                                    'museums, '
                                                                                    'fashion '
                                                                                    'houses, '
                                                                                    'culinary '
                                                                                    'excellence, '
                                                                                    'and '
                                                                                    'architectural '
                                                                                    'beauty\n'
                                                                                    '\n'
                                                                                    'Paris '
                                                                                    'has '
                                                                                    'been '
                                                                                    'a '
                                                                                    'center '
                                                                                    'of '
                                                                                    'European '
                                                                                    'culture '
                                                                                    'for '
                                                                                    'centuries '
                                                                                    'and '
                                                                                    'played '
                                                                                    'important '
                                                                                    'roles '
                                                                                    'in '
                                                                                    'many '
                                                                                    'historical '
                                                                                    'events, '
                                                                                    'including '
                                                                                    'the '
                                                                                    'French '
                                                                                    'Revolution, '
                                                                                    'the '
                                                                                    'Belle '
                                                                                    'Époque, '
                                                                                    'and '
                                                                                    'as '
                                                                                    'a '
                                                                                    'center '
                                                                                    'of '
                                                                                    'artistic '
                                                                                    'movements '
                                                                                    'like '
                                                                                    'Impressionism.'}}},
                                    {'text': '# Paris: The Capital of France\n'
                                             '\n'
                                             'Paris is the capital and most '
                                             'populous city of France. Located '
                                             'on the Seine River in the '
                                             'north-central part of the '
                                             'country, it has been a major '
                                             'European center of finance, '
                                             'diplomacy, commerce, culture, '
                                             'fashion, and arts for '
                                             'centuries.\n'
                                             '\n'
                                             '## Brief Research on Paris\n'
                                             '\n'
                                             '**History**: Founded in the 3rd '
                                             'century BC by a Celtic people '
                                             'called the Parisii, later '
                                             'developed by Romans as Lutetia. '
                                             'Paris has been the capital of '
                                             'France since 987 CE, when Hugh '
                                             'Capet, the first king of the '
                                             'Capetian dynasty, made the city '
                                             'his seat of government.\n'
                                             '\n'
                                             '**Population**: Approximately '
                                             '2.2 million within city limits, '
                                             'with over 12 million in the '
                                             'greater Paris metropolitan '
                                             'area.\n'
                                             '\n'
                                             '**Cultural Significance**:\n'
                                             '- Home to world-renowned '
                                             'landmarks including the Eiffel '
                                             'Tower, Louvre Museum, Notre-Dame '
                                             'Cathedral, and Arc de Triomphe\n'
                                             '- Divided into 20 administrative '
                                             'districts called '
                                             'arrondissements\n'
                                             '- Often referred to as the "City '
                                             'of Light" (La Ville Lumière)\n'
                                             '- Global center for art, '
                                             'fashion, gastronomy, and '
                                             'culture\n'
                                             '\n'
                                             '**Economy**: Paris has one of '
                                             "Europe's largest city economies "
                                             'and serves as a hub for '
                                             'international business and '
                                             'cultural affairs.\n'
                                             '\n'
                                             '**Education**: Home to several '
                                             'prestigious universities and '
                                             'grands écoles (elite higher '
                                             'education institutions).\n'
                                             '\n'
                                             'Paris continues to be one of the '
                                             "world's most visited tourist "
                                             'destinations, welcoming '
                                             'approximately 30 million '
                                             'visitors annually.'}],
                        'role': 'assistant'}},
 'stopReason': 'end_turn',
 'usage': {'cacheReadInputTokens': 0,
           'cacheWriteInputTokens': 0,
           'inputTokens': 64,
           'outputTokens': 606,
           'totalTokens': 670}}

Related issue number

#2259

Checks

@priyansh4320 priyansh4320 self-assigned this Dec 17, 2025
@joggrbot
Copy link
Contributor

joggrbot bot commented Dec 17, 2025

📝 Documentation Analysis

All docs are up to date! 🎉


✅ Latest commit analyzed: dfe6bef | Powered by Joggr

@priyansh4320 priyansh4320 changed the title Feat: extended thinking on bedrock client Feat: addionalModelRequestFields support on bedrock client Dec 17, 2025
@priyansh4320 priyansh4320 linked an issue Dec 17, 2025 that may be closed by this pull request
@priyansh4320 priyansh4320 marked this pull request as draft December 17, 2025 17:41
@marklysze marklysze changed the title Feat: addionalModelRequestFields support on bedrock client Feat: additionalModelRequestFields support on bedrock client Dec 18, 2025
@priyansh4320 priyansh4320 force-pushed the feat-extended-thinking-on-bedrock-client branch from b1c883c to 2892cf9 Compare December 31, 2025 18:09
@priyansh4320 priyansh4320 marked this pull request as ready for review January 2, 2026 17:25
@priyansh4320 priyansh4320 requested a review from marklysze January 7, 2026 04:41
Copy link
Collaborator

@marklysze marklysze left a comment

Choose a reason for hiding this comment

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

Amazing, thanks @priyansh4320

@marklysze marklysze added this pull request to the merge queue Jan 8, 2026
Merged via the queue into main with commit 65c9e74 Jan 8, 2026
20 checks passed
@marklysze marklysze deleted the feat-extended-thinking-on-bedrock-client branch January 8, 2026 08:35
@codecov
Copy link

codecov bot commented Jan 8, 2026

Codecov Report

❌ Patch coverage is 22.22222% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
autogen/oai/bedrock.py 22.22% 7 Missing ⚠️
Files with missing lines Coverage Δ
autogen/oai/bedrock.py 23.16% <22.22%> (+0.04%) ⬆️

... and 20 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

[Feature Request]: Exposing thinking config for Bedrock Models

3 participants