Skip to content

Commit d707766

Browse files
committed
fix(sdk): yield types
Signed-off-by: Radek Ježek <radek.jezek@ibm.com>
1 parent e6ae868 commit d707766

File tree

2 files changed

+32
-3
lines changed

2 files changed

+32
-3
lines changed

apps/beeai-cli/src/beeai_cli/commands/agent.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,11 @@ async def _run_agent(
320320
if handle_input is None:
321321
raise ValueError("Agent requires input but no input handler provided")
322322

323-
console.print("\n[bold]Agent requires your input[/bold]\n")
323+
text = ""
324+
for part in task_status.message.parts if task_status.message else []:
325+
if isinstance(part.root, TextPart):
326+
text = part.root.text
327+
console.print(f"\n[bold]Agent requires your input[/bold]: {text}\n")
324328
user_input = handle_input()
325329

326330
# Send the user input back to the agent

apps/beeai-sdk/src/beeai_sdk/a2a/types.py

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,35 @@
33
import uuid
44
from typing import Literal, TypeAlias
55

6-
from a2a.types import Artifact, Message, Part, Role, TaskStatus, TextPart
6+
from a2a.types import (
7+
Artifact,
8+
DataPart,
9+
FilePart,
10+
Message,
11+
Part,
12+
Role,
13+
TaskArtifactUpdateEvent,
14+
TaskStatus,
15+
TaskStatusUpdateEvent,
16+
TextPart,
17+
)
718
from pydantic import Field, model_validator
819

9-
RunYield: TypeAlias = Message | Part | TaskStatus | Artifact | str | None | dict | Exception
20+
RunYield: TypeAlias = (
21+
Message
22+
| Part
23+
| TaskStatus
24+
| Artifact
25+
| TextPart
26+
| FilePart
27+
| DataPart
28+
| TaskStatusUpdateEvent
29+
| TaskArtifactUpdateEvent
30+
| str
31+
| None
32+
| dict
33+
| Exception
34+
)
1035
RunYieldResume: TypeAlias = Message | None
1136

1237

0 commit comments

Comments
 (0)