Skip to content

Commit b88c9a1

Browse files
Rana Umar MajeedRana Umar Majeed
authored andcommitted
fix pydantic warning
1 parent 0faffef commit b88c9a1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import asyncio
88
import random
99
import uuid
10-
from typing import List, Dict, Any
10+
from typing import List, Dict, Any, Annotated
1111
from pathlib import Path
1212
from dotenv import load_dotenv
1313
from pydantic import BaseModel, Field
@@ -66,7 +66,7 @@ class TaskStep(BaseModel):
6666
def plan_task_steps(
6767
task: str,
6868
context: str = "",
69-
steps: List[Any] = Field(..., description="4-6 pending steps in gerund form"),
69+
steps: Annotated[List[Any], Field(description="4-6 pending steps in gerund form")] = None,
7070
) -> Dict[str, Any]:
7171
"""
7272
Plan the concrete steps required to accomplish a task.
@@ -79,7 +79,7 @@ def plan_task_steps(
7979
Returns:
8080
JSON payload with the task summary and proposed steps.
8181
"""
82-
normalized_steps = _normalize_steps(steps)
82+
normalized_steps = _normalize_steps(steps) if steps else []
8383
if not normalized_steps:
8484
normalized_steps = _fallback_steps(task or "the task", context)
8585

0 commit comments

Comments
 (0)