Skip to content

Commit e1e7917

Browse files
amizer12AmizerAWS
andauthored
fix(01-tutorials): Minor fixes (#66)
* Notebook fixes Sample notebook fixes * openai notebook updates --------- Co-authored-by: Andrzej Mizerkiewicz <mizerkie@amazon.com>
1 parent 6b94ff2 commit e1e7917

File tree

6 files changed

+19
-24
lines changed

6 files changed

+19
-24
lines changed

01-tutorials/01-fundamentals/01-first-agent/01-first-agent.ipynb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@
6868
")\n",
6969
"\n",
7070
"# Send a message to the agent\n",
71-
"response = agent(\"Hello! Tell me a joke.\")\n",
72-
"print(response)"
71+
"response = agent(\"Hello! Tell me a joke.\")"
7372
]
7473
},
7574
{

01-tutorials/01-fundamentals/02-model-providers/01-ollama-model/ollama_file_ops_agent.ipynb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,7 @@
332332
"outputs": [],
333333
"source": [
334334
"# Example 2: List files in the current directory\n",
335-
"response = local_agent(\"Show me the files in the current directory\")\n",
336-
"print(response)"
335+
"response = local_agent(\"Show me the files in the current directory\")"
337336
]
338337
},
339338
{
@@ -345,8 +344,7 @@
345344
"# Example 3: Create a sample file\n",
346345
"response = local_agent(\n",
347346
" \"Create a file called 'sample.txt' with the content 'This is a test file created by my Ollama agent.'\"\n",
348-
")\n",
349-
"print(response)"
347+
")"
350348
]
351349
},
352350
{
@@ -356,8 +354,7 @@
356354
"outputs": [],
357355
"source": [
358356
"# Example 4: create a readme file after reading and understanding multiple files\n",
359-
"response = local_agent(\"Create a readme.md for the current directory\")\n",
360-
"print(response)"
357+
"response = local_agent(\"Create a readme.md for the current directory\")"
361358
]
362359
},
363360
{

01-tutorials/01-fundamentals/02-model-providers/02-openai-model/openai-mcp-agent.ipynb renamed to 01-tutorials/01-fundamentals/02-model-providers/02-openai-model/openai-litellm-agent.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,13 +250,13 @@
250250
"source": [
251251
"### Congratulations!\n",
252252
"\n",
253-
"In this notebook you learned how to connect with MCP servers using Strands Agent and two MCP transport protocols: stdio and Streamable HTTP. You also learned how to connect multiple MCP servers to the same agent. Next, let's see how to use different models with your agent"
253+
"In this notebook you learned how to use LiteLLM with OpeanAi serving answers for weather agent."
254254
]
255255
}
256256
],
257257
"metadata": {
258258
"kernelspec": {
259-
"display_name": "Python 3 (ipykernel)",
259+
"display_name": "base",
260260
"language": "python",
261261
"name": "python3"
262262
},
@@ -270,7 +270,7 @@
270270
"name": "python",
271271
"nbconvert_exporter": "python",
272272
"pygments_lexer": "ipython3",
273-
"version": "3.12.9"
273+
"version": "3.12.4"
274274
}
275275
},
276276
"nbformat": 4,

01-tutorials/01-fundamentals/03-connecting-with-aws-services/connecting-with-aws-services.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
}
1313
},
1414
"source": [
15-
"# Connecting you Strands Agents with AWS services\n",
15+
"# Connecting Strands Agents with AWS services\n",
1616
"\n",
1717
"## Overview\n",
1818
"In this example we will guide you through how to connect your Strands Agents to AWS services. We will create an agent that connects to an [Amazon Bedrock Knowledge Base](https://aws.amazon.com/bedrock/knowledge-bases/) and an [Amazon DynamoDB](https://aws.amazon.com/dynamodb/) to handle reservation tasks in a restaurant assistant.\n",

01-tutorials/01-fundamentals/06-guardrail-integration/bedrock_guardrails_sample.ipynb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@
340340
"source": [
341341
"# Create a Bedrock model with guardrail configuration\n",
342342
"bedrock_model = BedrockModel(\n",
343-
" model_id=\"anthropic.claude-3-5-sonnet-20240620-v1:0\",\n",
343+
" model_id=\"us.anthropic.claude-3-7-sonnet-20250219-v1:0\",\n",
344344
" guardrail_id=guardrail_id,\n",
345345
" guardrail_version=guardrail_version,\n",
346346
" # Enable trace info for debugging\n",
@@ -387,9 +387,7 @@
387387
" print(\"\\n ⚠️ GUARDRAIL INTERVENED!\")\n",
388388
" #print(f\"Response: {response}\")\n",
389389
" else:\n",
390-
" print(f\"Response: {response}\")\n",
391-
"\n",
392-
" return response"
390+
" return response"
393391
]
394392
},
395393
{
@@ -451,7 +449,7 @@
451449
"outputs": [],
452450
"source": [
453451
"bedrock_model = BedrockModel(\n",
454-
" model_id=\"anthropic.claude-3-5-sonnet-20240620-v1:0\",\n",
452+
" model_id=\"us.anthropic.claude-3-7-sonnet-20250219-v1:0\",\n",
455453
" guardrail_id=guardrail_id, # Your Bedrock guardrail ID\n",
456454
" guardrail_version=guardrail_version, # Guardrail version\n",
457455
" guardrail_trace=\"enabled\",\n",

01-tutorials/01-fundamentals/06-guardrail-integration/customer_profile_tools.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def get_customer_profile(customer_id: str = None, email: str = None) -> Dict:
1818
dict: Customer profile information or error message
1919
"""
2020
if not customer_id and not email:
21-
return {"status": "error", content: [{"text": "Either customer_id or email must be provided"}]}
21+
return {"Either customer_id or email must be provided"}
2222

2323
profile = None
2424
if customer_id:
@@ -27,7 +27,7 @@ def get_customer_profile(customer_id: str = None, email: str = None) -> Dict:
2727
profile = profile_manager.get_profile_by_email(email)
2828

2929
if not profile:
30-
return {"status": "error", content: [{"text": "Customer profile not found"}]}
30+
return {"Customer profile not found"}
3131

3232
return profile.to_dict()
3333

@@ -45,16 +45,17 @@ def list_customer_purchases(customer_id: str = None, email: str = None) -> List[
4545
list: List of customer purchases or error message
4646
"""
4747
if not customer_id and not email:
48-
return {"status": "error", content: [{"text": "Either customer_id or email must be provided"}]}
48+
return {"Either customer_id or email must be provided"}
4949

5050
profile = None
5151
if customer_id:
5252
profile = profile_manager.get_profile(customer_id)
53+
5354
elif email:
5455
profile = profile_manager.get_profile_by_email(email)
5556

5657
if not profile:
57-
return {"status": "error", content: [{"text": "Customer profile not found"}]}
58+
return {"Customer profile not found"}
5859

5960
return profile.purchase_history
6061

@@ -72,7 +73,7 @@ def list_customer_tickets(customer_id: str = None, email: str = None) -> List[Di
7273
list: List of customer support tickets or error message
7374
"""
7475
if not customer_id and not email:
75-
return {"status": "error", content: [{"text": "Either customer_id or email must be provided"}]}
76+
return {"Either customer_id or email must be provided"}
7677

7778
profile = None
7879
if customer_id:
@@ -81,7 +82,7 @@ def list_customer_tickets(customer_id: str = None, email: str = None) -> List[Di
8182
profile = profile_manager.get_profile_by_email(email)
8283

8384
if not profile:
84-
return {"status": "error", content: [{"text": "Customer profile not found"}]}
85+
return {"Customer profile not found"}
8586

8687
return profile.support_tickets
8788

@@ -100,6 +101,6 @@ def update_customer_profile(customer_id: str, updates: Dict) -> Dict:
100101
"""
101102
profile = profile_manager.update_profile(customer_id, updates)
102103
if not profile:
103-
return {"status": "error", content: [{"text": "Customer profile not found"}]}
104+
return {"Customer profile not found"}
104105

105106
return profile.to_dict()

0 commit comments

Comments
 (0)