Class Artifacts
java.lang.Object
com.google.genkit.plugins.middleware.Artifacts
Factory for artifact tools that let a model read and write named artifacts on the active agent
session.
Both tools operate on AgentSessionContext.currentArtifactStore(). When no agent
session is bound to the current thread, the tools degrade gracefully: read_artifact
reports found = false and write_artifact reports a "no active session"
status without throwing.
Usage:
AgentConfig.builder()
.name("writer")
.tools(Artifacts.tools(ArtifactsOptions.defaults()))
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classInput forread_artifact.static final classOutput forread_artifact.static final classInput forwrite_artifact.static final classOutput forwrite_artifact. -
Field Summary
Fields -
Method Summary
-
Field Details
-
READ_TOOL
Name of the read tool.- See Also:
-
WRITE_TOOL
Name of the write tool.- See Also:
-
-
Method Details
-
tools
Builds the artifact tools using default options (read_artifact+write_artifact).- Returns:
- the artifact tools
-
tools
Builds the artifact tools.Always includes
read_artifact. Includeswrite_artifactunlessoptions.isReadonly()istrue.- Parameters:
options- the options (must not be null)- Returns:
- the artifact tools
-