Package io.a2a.server.util
Class ArtifactUtils
java.lang.Object
io.a2a.server.util.ArtifactUtils
Utility functions for creating A2A Artifact objects.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ArtifactnewArtifact(String name, List<Part<?>> parts) Creates a new Artifact object with empty description.static ArtifactnewArtifact(String name, List<Part<?>> parts, String description) Creates a new Artifact object.static ArtifactnewDataArtifact(String name, Map<String, Object> data) Creates a new Artifact object containing only a single DataPart with empty description.static ArtifactCreates a new Artifact object containing only a single DataPart.static ArtifactnewTextArtifact(String name, String text) Creates a new Artifact object containing only a single TextPart with empty description.static ArtifactnewTextArtifact(String name, String text, String description) Creates a new Artifact object containing only a single TextPart.
-
Method Details
-
newArtifact
Creates a new Artifact object.- Parameters:
name- The human-readable name of the artifact.parts- The list ofPartobjects forming the artifact's content.description- An optional description of the artifact.- Returns:
- A new
Artifactobject with a generated artifact_id.
-
newArtifact
Creates a new Artifact object with empty description.- Parameters:
name- The human-readable name of the artifact.parts- The list ofPartobjects forming the artifact's content.- Returns:
- A new
Artifactobject with a generated artifact_id.
-
newTextArtifact
Creates a new Artifact object containing only a single TextPart.- Parameters:
name- The human-readable name of the artifact.text- The text content of the artifact.description- An optional description of the artifact.- Returns:
- A new
Artifactobject with a generated artifact_id.
-
newTextArtifact
Creates a new Artifact object containing only a single TextPart with empty description.- Parameters:
name- The human-readable name of the artifact.text- The text content of the artifact.- Returns:
- A new
Artifactobject with a generated artifact_id.
-
newDataArtifact
Creates a new Artifact object containing only a single DataPart.- Parameters:
name- The human-readable name of the artifact.data- The structured data content of the artifact.description- An optional description of the artifact.- Returns:
- A new
Artifactobject with a generated artifact_id.
-
newDataArtifact
Creates a new Artifact object containing only a single DataPart with empty description.- Parameters:
name- The human-readable name of the artifact.data- The structured data content of the artifact.- Returns:
- A new
Artifactobject with a generated artifact_id.
-