Skip to content

Commit 61dd8a0

Browse files
authored
feat: add STRANDS_ANTHROPIC_BETA environment variable (#34)
* feat: add STRANDS_ANTHROPIC_BETA environment variable * docs(readme): document environment variables
1 parent 963a784 commit 61dd8a0

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,24 @@ export STRANDS_SYSTEM_PROMPT="You are a Python expert."
205205
echo "You are a security expert." > .prompt
206206
```
207207

208+
## 🌍 Environment Variables Configuration
209+
210+
Strands Agent Builder also provides customization through environment variables:
211+
212+
| Environment Variable | Description | Default |
213+
|----------------------|-------------|---------|
214+
| STRANDS_MODEL_ID | Claude model ID to use for inference | us.anthropic.claude-sonnet-4-20250514-v1:0 |
215+
| STRANDS_MAX_TOKENS | Maximum tokens for agent responses | 32768 |
216+
| STRANDS_BUDGET_TOKENS | Token budget for agent thinking/reasoning | 2048 |
217+
| STRANDS_THINKING_TYPE | Type of thinking capability | enabled |
218+
| STRANDS_ANTHROPIC_BETA | Anthropic beta features (comma-separated) | interleaved-thinking-2025-05-14 |
219+
| STRANDS_CACHE_TOOLS | Tool caching strategy | default |
220+
| STRANDS_CACHE_PROMPT | Prompt caching strategy | default |
221+
| STRANDS_SYSTEM_PROMPT | Custom system prompt (overrides .prompt file) | None |
222+
| STRANDS_KNOWLEDGE_BASE_ID | Default Knowledge Base ID | None |
223+
| STRANDS_TOOL_CONSOLE_MODE | Enable rich console UI | enabled |
224+
| BYPASS_TOOL_CONSENT | Skip tool confirmation prompts | false |
225+
208226
## Exit
209227

210228
Type `exit`, `quit`, or press `Ctrl+C`/`Ctrl+D`

src/strands_agents_builder/utils/model_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
retries=dict(max_attempts=3, mode="adaptive"),
2020
),
2121
"additional_request_fields": {
22-
"anthropic_beta": ["interleaved-thinking-2025-05-14"],
2322
"thinking": {
2423
"type": os.getenv("STRANDS_THINKING_TYPE", "enabled"),
2524
"budget_tokens": int(os.getenv("STRANDS_BUDGET_TOKENS", "2048")),
@@ -28,6 +27,9 @@
2827
"cache_tools": os.getenv("STRANDS_CACHE_TOOLS", "default"),
2928
"cache_prompt": os.getenv("STRANDS_CACHE_PROMPT", "default"),
3029
}
30+
ANTHROPIC_BETA_FEATURES = os.getenv("STRANDS_ANTHROPIC_BETA", "interleaved-thinking-2025-05-14")
31+
if len(ANTHROPIC_BETA_FEATURES) > 0:
32+
DEFAULT_MODEL_CONFIG["additional_request_fields"]["anthropic_beta"] = ANTHROPIC_BETA_FEATURES.split(",")
3133

3234

3335
def load_path(name: str) -> pathlib.Path:

0 commit comments

Comments
 (0)