Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/a2a/utils/artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@


def new_artifact(
parts: list[Part], name: str, description: str = ''
parts: list[Part],
name: str,
description: str | None = None,
) -> Artifact:
"""Creates a new Artifact object.

Expand All @@ -32,7 +34,7 @@ def new_artifact(
def new_text_artifact(
name: str,
text: str,
description: str = '',
description: str | None = None,
) -> Artifact:
"""Creates a new Artifact object containing only a single TextPart.

Expand All @@ -54,7 +56,7 @@ def new_text_artifact(
def new_data_artifact(
name: str,
data: dict[str, Any],
description: str = '',
description: str | None = None,
) -> Artifact:
"""Creates a new Artifact object containing only a single DataPart.

Expand Down
2 changes: 1 addition & 1 deletion tests/utils/test_artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_new_artifact_empty_description_if_not_provided(self):
parts = [Part(root=TextPart(text='Another sample'))]
name = 'Artifact_No_Desc'
artifact = new_artifact(parts=parts, name=name)
self.assertEqual(artifact.description, '')
self.assertEqual(artifact.description, None)

def test_new_text_artifact_creates_single_text_part(self):
text = 'This is a text artifact.'
Expand Down
Loading