From 5ae132af30d6539cdfa6a05810c6c8417b695efd Mon Sep 17 00:00:00 2001 From: Nicholas Clegg Date: Tue, 26 Aug 2025 10:07:07 -0400 Subject: [PATCH] fix: Move AgentInput to types submodule --- src/strands/agent/agent.py | 4 +--- src/strands/types/agent.py | 10 ++++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 src/strands/types/agent.py diff --git a/src/strands/agent/agent.py b/src/strands/agent/agent.py index 66099cb1d..e2aed9d2b 100644 --- a/src/strands/agent/agent.py +++ b/src/strands/agent/agent.py @@ -22,7 +22,6 @@ Mapping, Optional, Type, - TypeAlias, TypeVar, Union, cast, @@ -51,6 +50,7 @@ from ..tools.executors._executor import ToolExecutor from ..tools.registry import ToolRegistry from ..tools.watcher import ToolWatcher +from ..types.agent import AgentInput from ..types.content import ContentBlock, Message, Messages from ..types.exceptions import ContextWindowOverflowException from ..types.tools import ToolResult, ToolUse @@ -67,8 +67,6 @@ # TypeVar for generic structured output T = TypeVar("T", bound=BaseModel) -AgentInput: TypeAlias = str | list[ContentBlock] | Messages | None - # Sentinel class and object to distinguish between explicit None and default parameter value class _DefaultCallbackHandlerSentinel: diff --git a/src/strands/types/agent.py b/src/strands/types/agent.py new file mode 100644 index 000000000..151c88f89 --- /dev/null +++ b/src/strands/types/agent.py @@ -0,0 +1,10 @@ +"""Agent-related type definitions for the SDK. + +This module defines the types used for an Agent. +""" + +from typing import TypeAlias + +from .content import ContentBlock, Messages + +AgentInput: TypeAlias = str | list[ContentBlock] | Messages | None