Skip to content

Commit dd300ed

Browse files
authored
fix: correct new_artifact methods description according to Artifact field type
Artifact class has nullable description with default None `Artifact(description: str | None = None)` But, utilities functions creates and artifact with empty description by default `description=''`
1 parent 051ab20 commit dd300ed

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/a2a/utils/artifact.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88

99

1010
def new_artifact(
11-
parts: list[Part], name: str, description: str = ''
11+
parts: list[Part],
12+
name: str,
13+
description: str | None = None,
1214
) -> Artifact:
1315
"""Creates a new Artifact object.
1416
@@ -31,7 +33,7 @@ def new_artifact(
3133
def new_text_artifact(
3234
name: str,
3335
text: str,
34-
description: str = '',
36+
description: str | None = None,
3537
) -> Artifact:
3638
"""Creates a new Artifact object containing only a single TextPart.
3739
@@ -53,7 +55,7 @@ def new_text_artifact(
5355
def new_data_artifact(
5456
name: str,
5557
data: dict[str, Any],
56-
description: str = '',
58+
description: str | None = None,
5759
) -> Artifact:
5860
"""Creates a new Artifact object containing only a single DataPart.
5961

0 commit comments

Comments
 (0)