Skip to content

Commit 0afd59f

Browse files
committed
feat: Add append and last_chunk to add_artifact method on TaskUpdater
1 parent d5e5f5f commit 0afd59f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/a2a/server/tasks/task_updater.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,14 @@ async def update_status(
6565
)
6666
)
6767

68-
async def add_artifact(
68+
async def add_artifact( # noqa: PLR0913
6969
self,
7070
parts: list[Part],
7171
artifact_id: str | None = None,
7272
name: str | None = None,
7373
metadata: dict[str, Any] | None = None,
74+
append: bool | None = None,
75+
last_chunk: bool | None = None,
7476
) -> None:
7577
"""Adds an artifact chunk to the task and publishes a `TaskArtifactUpdateEvent`.
7678
@@ -79,6 +81,8 @@ async def add_artifact(
7981
artifact_id: The ID of the artifact. A new UUID is generated if not provided.
8082
name: Optional name for the artifact.
8183
metadata: Optional metadata for the artifact.
84+
append: Optional boolean indicating if this chunk appends to a previous one.
85+
last_chunk: Optional boolean indicating if this is the last chunk.
8286
"""
8387
if not artifact_id:
8488
artifact_id = str(uuid.uuid4())
@@ -93,6 +97,8 @@ async def add_artifact(
9397
parts=parts,
9498
metadata=metadata,
9599
),
100+
append=append,
101+
last_chunk=last_chunk
96102
)
97103
)
98104

0 commit comments

Comments
 (0)