Skip to content

Commit e88320d

Browse files
committed
Revert "Use Nova Lite in AgentCore Strands sample"
This reverts commit ccdf317.
1 parent ccdf317 commit e88320d

4 files changed

Lines changed: 12 additions & 28 deletions

File tree

bedrock_agentcore/strands_agent/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ workflows kick off.
3131
- AWS permissions for the AgentCore CLI (S3, IAM, CloudFormation): see [Use the
3232
AgentCore
3333
CLI](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-permissions.html#runtime-permissions-cli)
34-
- Access to the Amazon Nova Lite model in your target Region. The sample uses
35-
the model ID `amazon.nova-lite-v1:0`.
34+
- Access to an [Amazon
35+
Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/model-access-modify.html)
36+
foundation model in your region -- the agent uses the plugin's default
37+
`BedrockModel()`
3638

3739

3840
Docker is not needed. With the CodeZip build there is no image: the CLI uploads a
@@ -73,8 +75,8 @@ This sample opts to utilize the new AgentCore CLI for creating and updating both
7375
### 1. Choose the AWS account and region
7476

7577
Edit `agentcore/aws-targets.json` with the account ID and region to deploy into. AgentCore is only available in
76-
[certain regions](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/agentcore-regions.html), and the Region
77-
must support Amazon Nova Lite.
78+
[certain regions](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/agentcore-regions.html), and the region
79+
needs the Bedrock model enabled.
7880

7981
### 2. Configure the Temporal connection
8082

bedrock_agentcore/strands_agent/agentcore_worker.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
from datetime import timedelta
2424

2525
from bedrock_agentcore.runtime import BedrockAgentCoreApp
26-
from strands.models import BedrockModel
2726
from temporalio.client import Client
2827
from temporalio.common import VersioningBehavior
2928
from temporalio.contrib.strands import StrandsPlugin
@@ -112,15 +111,7 @@ async def run_worker() -> None:
112111
namespace=os.environ.get("TEMPORAL_NAMESPACE", "default"),
113112
api_key=api_key,
114113
tls=bool(api_key),
115-
plugins=[
116-
StrandsPlugin(
117-
models={
118-
workflows.MODEL_NAME: lambda: BedrockModel(
119-
model_id=workflows.MODEL_ID
120-
)
121-
}
122-
)
123-
],
114+
plugins=[StrandsPlugin()],
124115
)
125116

126117
tracker = ActivityTracker()

bedrock_agentcore/strands_agent/starter.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import asyncio
22
import sys
33

4-
from strands.models import BedrockModel
54
from temporalio.client import Client
65
from temporalio.contrib.strands import StrandsPlugin
76
from temporalio.envconfig import ClientConfig
87

9-
from workflows import MODEL_ID, MODEL_NAME, TASK_QUEUE, StrandsAgentWorkflow
8+
from workflows import TASK_QUEUE, StrandsAgentWorkflow
109

1110
DEFAULT_PROMPT = (
1211
"What is the 30th Fibonacci number, and is it divisible by 7? "
@@ -22,12 +21,7 @@ async def main() -> None:
2221
# automatically alongside an API key.
2322
config = ClientConfig.load_client_connect_config()
2423
config.setdefault("target_host", "localhost:7233")
25-
client = await Client.connect(
26-
**config,
27-
plugins=[
28-
StrandsPlugin(models={MODEL_NAME: lambda: BedrockModel(model_id=MODEL_ID)})
29-
],
30-
)
24+
client = await Client.connect(**config, plugins=[StrandsPlugin()])
3125
print("Connected to Temporal Service")
3226

3327
result = await client.execute_workflow(

bedrock_agentcore/strands_agent/workflows.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
DEPLOYMENT_NAME = "agentcore-strands-agent-python"
99
BUILD_ID = "1.0.0"
1010

11-
# @@@SNIPSTART python-agentcore-strands-workflow
12-
MODEL_NAME = "nova-lite"
13-
MODEL_ID = "amazon.nova-lite-v1:0"
14-
1511
with workflow.unsafe.imports_passed_through():
1612
from activities import execute_code
1713

@@ -22,12 +18,13 @@
2218
the code you ran and its output."""
2319

2420

21+
# @@@SNIPSTART python-agentcore-strands-workflow
2522
@workflow.defn
2623
class StrandsAgentWorkflow:
2724
def __init__(self) -> None:
28-
# Configure the model, custom system prompt and code interpreter tool.
25+
# Configure with the plugin's default BedrockModel(), custom system
26+
# prompt and code interpreter tool.
2927
self.agent = TemporalAgent(
30-
model=MODEL_NAME,
3128
start_to_close_timeout=timedelta(seconds=60),
3229
system_prompt=SYSTEM_PROMPT,
3330
tools=[

0 commit comments

Comments
 (0)