Skip to content

Conversation

@jonathan343
Copy link
Contributor

@jonathan343 jonathan343 commented Sep 21, 2025

Important

This PR is reliant on the packages in Release: Smithy Python Packages v0.1.0 being released to PyPI.

Summary

This PR creates v0.1.0 of aws-sdk-bedrock-runtime and aws-sdk-python using the latest Smithy Python code generator and core packages.

The following is a list of the exact changes:

  • Pulls all missing commits from develop onto main since aws-sdk-bedrock-runtime v0.0.2
  • Bumps version from v0.0.2 to v0.1.0
  • Replaces existing source code and docs with the latest code generated code.
  • Renames the changelog from CHANGES.md to CHANGELOG.md and adds entries for v0.1.0.

Testing

  • Pulled Release: Smithy Python Packages v0.1.0

  • In smithy-python

    • Created smithy python v0.1.0 distributions by running uv build. These are stored in dist/ by default.
  • In aws-sdk-python

    • uv venv -p 3.12
    • . .venv/bin/activate
    • uv pip install . --find-links <path_to_smithy_python>/dist/
    Resolved 9 packages in 3ms
          Built aws-sdk-bedrock-runtime @ file:///Users/gytndd/dev/GitHub/aws-sdk-python/clients/aws-sdk-bedrock-runtime
    Prepared 1 package in 748ms
    Installed 9 packages in 941ms
     + aws-sdk-bedrock-runtime==0.1.0 (from file:///Users/gytndd/dev/GitHub/aws-sdk-python/clients/aws-sdk-bedrock-runtime)
     + aws-sdk-signers==0.1.0
     + awscrt==0.28.1
     + ijson==3.4.0
     + smithy-aws-core==0.1.0
     + smithy-aws-event-stream==0.1.0
     + smithy-core==0.1.0
     + smithy-http==0.1.0
     + smithy-json==0.1.0
    
    • Copied temporary AWS credentials to my environment
    • Ran python test.py where test.py had the following content:
    import asyncio
    
    from smithy_aws_core.identity import EnvironmentCredentialsResolver
    from aws_sdk_bedrock_runtime.client import BedrockRuntimeClient, ConverseStreamInput
    from aws_sdk_bedrock_runtime.models import Message, ContentBlockText
    from aws_sdk_bedrock_runtime.config import Config
    
    
    TITAN_PREMIER_TEXT_MODEL = "amazon.titan-text-premier-v1:0"
    
    
    async def test_async():
        message_1 = Message(
            role="user",
            content=[
                ContentBlockText(
                    value=(
                        "What is the GIL in Python?"
                    )
                )
            ],
        )
        messages = [message_1]
        c = BedrockRuntimeClient(
            config=Config(
                endpoint_uri="https://bedrock-runtime.us-east-1.amazonaws.com",
                region="us-east-1",
                aws_credentials_identity_resolver=EnvironmentCredentialsResolver(),
            )
        )
        response = c.converse_stream(
            ConverseStreamInput(model_id=TITAN_PREMIER_TEXT_MODEL, messages=messages)
        )
        async with await response as stream:
            output = ""
            async for r in stream.output_stream:
                try:
                    output += r.value.delta.value
                except Exception:
                    continue
        print(f"Response:\n------------\n{''.join(output)}")
    
    
    if __name__ == "__main__":
        asyncio.run(test_async())

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@jonathan343 jonathan343 requested a review from a team September 22, 2025 14:18

```
$ uv pip install ".[docs]"
$ uv pip install --group docs .
Copy link
Contributor Author

@jonathan343 jonathan343 Sep 22, 2025

Choose a reason for hiding this comment

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

Note

I made this change manually since the install command is wrong. Here is the permanent fix:
smithy-lang/smithy-python#563

@jonathan343 jonathan343 changed the title aws-sdk-bedrock-runtime v0.1.0 Release: AWS SDK for Python v0.1.0 Sep 22, 2025
Copy link
Contributor Author

@jonathan343 jonathan343 Sep 22, 2025

Choose a reason for hiding this comment

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

Something for us to think about:

Generating all the .rst files for a client is really gonna bloat this repo. I think we should use the client to dynamically generate them when building/releasing docs. This is what we do for botocore/boto3.

* Fixed stop sequence limit for converse API.
* Launch CountTokens API to allow token counting
* This release adds support for Automated Reasoning checks output models for the Amazon Bedrock Guardrails ApplyGuardrail API.
* document update to support on demand custom model.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* document update to support on demand custom model.
* Document update to support on demand custom model.

@jonathan343 jonathan343 merged commit d1372f6 into main Sep 25, 2025
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.

2 participants