Skip to content

Commit 04d310c

Browse files
committed
Prompt fixes
1 parent 95d315f commit 04d310c

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

apps/dojo/e2e/tests/awsStrandsTests/sharedStatePage.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ test.describe("Shared State Feature", () => {
1313
);
1414

1515
await sharedStateAgent.openChat();
16-
await sharedStateAgent.sendMessage('Please give me a pasta recipe of your choosing, but one of the ingredients should be "Pasta"');
16+
await sharedStateAgent.sendMessage('Please give me a pasta recipe of your choosing, but one of the ingredients should be "Pasta". Not a type of pasta, exactly the word "Pasta".');
1717
await sharedStateAgent.loader();
1818
await sharedStateAgent.awaitIngredientCard('Pasta');
1919
await sharedStateAgent.getInstructionItems(
@@ -44,7 +44,7 @@ test.describe("Shared State Feature", () => {
4444
await page.waitForTimeout(1000);
4545

4646
// Ask chat for all ingredients
47-
await sharedStateAgent.sendMessage("Give me all the ingredients");
47+
await sharedStateAgent.sendMessage("Please list all of the ingredients");
4848
await sharedStateAgent.loader();
4949

5050
// Verify chat response includes both existing and new ingredients

integrations/aws-strands/python/examples/server/api/agentic_chat.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@
4242
@tool
4343
def change_background(background: str):
4444
"""
45-
Change the background color of the chat. Can be anything that the CSS background
45+
Change the background color of the chat. Can be anything that the CSS background
4646
attribute accepts. Regular colors, linear or radial gradients etc.
47-
47+
4848
Args:
4949
background: The background color or gradient. Prefer gradients. Only use when asked.
5050
"""
@@ -54,7 +54,11 @@ def change_background(background: str):
5454
strands_agent = Agent(
5555
model=model,
5656
tools=[change_background], # Register so LLM knows about it
57-
system_prompt="You are a helpful assistant.",
57+
system_prompt="""
58+
You are a helpful assistant.
59+
When the user greets you, always greet them back. Your greeting should always start with "Hello".
60+
Your greeting should also always ask (exact wording) "how can I assist you?"
61+
""",
5862
)
5963

6064
agui_agent = StrandsAgent(
@@ -64,4 +68,3 @@ def change_background(background: str):
6468
)
6569

6670
app = create_strands_app(agui_agent, "/")
67-

integrations/aws-strands/python/examples/server/api/agentic_generative_ui.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,8 @@ def build_state_context(input_data, user_message: str) -> str:
265265
You are an energetic project assistant who decomposes user goals into action plans.
266266
267267
Planning rules:
268-
1. When the user asks for help with a task, call `plan_task_steps` exactly once to create the plan.
269-
2. Do NOT call `plan_task_steps` again unless the user explicitly says to restart or discard the plan.
268+
1. When the user asks for help with a task or making a plan, call `plan_task_steps` exactly once to create the plan.
269+
2. Do NOT call `plan_task_steps` again unless the user explicitly says to restart or discard the plan (or moves on to a new task).
270270
3. Generate 4-6 concise steps in gerund form (e.g., “Setting up repo”, “Testing prototype”) and leave their status as "pending".
271271
4. After the tool call, send a short confirmation (<= 2 sentences) plus one emoji describing what you planned.
272272
5. If the user is just chatting or reviewing progress, respond conversationally and DO NOT call the tool.
@@ -288,4 +288,3 @@ def build_state_context(input_data, user_message: str) -> str:
288288
)
289289

290290
app = create_strands_app(agui_agent, "/")
291-

0 commit comments

Comments
 (0)