Skip to content

Commit c08f3fd

Browse files
authored
Merge branch 'strands-agents:main' into main
2 parents ef92bf2 + cb4da3c commit c08f3fd

File tree

19 files changed

+1045
-779
lines changed

19 files changed

+1045
-779
lines changed

.github/workflows/test-lint-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
- name: Checkout code
5757
uses: actions/checkout@v4
5858
with:
59-
ref: ${{ github.event.pull_request.head.sha }} # Explicitly define which commit to checkout
59+
ref: ${{ github.event.pull_request.head.sha }} # Explicitly define which commit to check out
6060
persist-credentials: false # Don't persist credentials for subsequent actions
6161
- name: Set up Python
6262
uses: actions/setup-python@v5

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ This project uses [hatchling](https://hatch.pypa.io/latest/build/#hatchling) as
3333

3434
1. Install development dependencies:
3535
```bash
36-
pip install -e ".[dev]" && pip install -e ".[litellm]
36+
pip install -e ".[dev]" && pip install -e ".[litellm]"
3737
```
3838

3939
2. Set up pre-commit hooks:
4040
```bash
4141
pre-commit install -t pre-commit -t commit-msg
4242
```
43-
This will automatically run formatters and convention commit checks on your code before each commit.
43+
This will automatically run formatters and conventional commit checks on your code before each commit.
4444

4545
3. Run code formatters manually:
4646
```bash

STYLE_GUIDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ logger.debug("field1=<%s>, field2=<%s>, ... | human readable message", field1, f
2626
- This is an optimization to skip string interpolation when the log level is not enabled
2727

2828
1. **Messages**:
29-
- Add human readable messages at the end of the log
29+
- Add human-readable messages at the end of the log
3030
- Use lowercase for consistency
3131
- Avoid punctuation (periods, exclamation points, etc.) to reduce clutter
3232
- Keep messages concise and focused on a single statement

pyproject.toml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ dev = [
5454
"commitizen>=4.4.0,<5.0.0",
5555
"hatch>=1.0.0,<2.0.0",
5656
"moto>=5.1.0,<6.0.0",
57-
"mypy>=0.981,<1.0.0",
57+
"mypy>=1.15.0,<2.0.0",
5858
"pre-commit>=3.2.0,<4.2.0",
5959
"pytest>=8.0.0,<9.0.0",
6060
"pytest-asyncio>=0.26.0,<0.27.0",
@@ -69,15 +69,18 @@ docs = [
6969
litellm = [
7070
"litellm>=1.69.0,<2.0.0",
7171
]
72+
llamaapi = [
73+
"llama-api-client>=0.1.0,<1.0.0",
74+
]
7275
ollama = [
7376
"ollama>=0.4.8,<1.0.0",
7477
]
75-
llamaapi = [
76-
"llama-api-client>=0.1.0,<1.0.0",
78+
openai = [
79+
"openai>=1.68.0,<2.0.0",
7780
]
7881

7982
[tool.hatch.envs.hatch-static-analysis]
80-
features = ["anthropic", "litellm", "llamaapi", "ollama"]
83+
features = ["anthropic", "litellm", "llamaapi", "ollama", "openai"]
8184
dependencies = [
8285
"mypy>=1.15.0,<2.0.0",
8386
"ruff>=0.11.6,<0.12.0",
@@ -100,7 +103,7 @@ lint-fix = [
100103
]
101104

102105
[tool.hatch.envs.hatch-test]
103-
features = ["anthropic", "litellm", "llamaapi", "ollama"]
106+
features = ["anthropic", "litellm", "llamaapi", "ollama", "openai"]
104107
extra-dependencies = [
105108
"moto>=5.1.0,<6.0.0",
106109
"pytest>=8.0.0,<9.0.0",

src/strands/models/bedrock.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,21 @@ def __init__(
112112
session = boto_session or boto3.Session(
113113
region_name=region_name or os.getenv("AWS_REGION") or "us-west-2",
114114
)
115-
client_config = boto_client_config or BotocoreConfig(user_agent_extra="strands-agents")
115+
116+
# Add strands-agents to the request user agent
117+
if boto_client_config:
118+
existing_user_agent = getattr(boto_client_config, "user_agent_extra", None)
119+
120+
# Append 'strands-agents' to existing user_agent_extra or set it if not present
121+
if existing_user_agent:
122+
new_user_agent = f"{existing_user_agent} strands-agents"
123+
else:
124+
new_user_agent = "strands-agents"
125+
126+
client_config = boto_client_config.merge(BotocoreConfig(user_agent_extra=new_user_agent))
127+
else:
128+
client_config = BotocoreConfig(user_agent_extra="strands-agents")
129+
116130
self.client = session.client(
117131
service_name="bedrock-runtime",
118132
config=client_config,

0 commit comments

Comments
 (0)