Package com.google.genkit.ai.agent
Class AgentOutput<S>
java.lang.Object
com.google.genkit.ai.agent.AgentOutput<S>
- Type Parameters:
S- the type of custom state
AgentOutput represents the output of an agent turn.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <S> AgentOutput.Builder<S> builder()Creates a builder for AgentOutput.Returns the output artifacts.getError()Returns the runtime error, if any.Returns the finish reason.Returns the output message.Returns the session ID.Returns the snapshot ID.getState()Returns the session state.voidsetArtifacts(List<Artifact> artifacts) Sets the output artifacts.voidsetError(RuntimeError error) Sets the runtime error.voidsetFinishReason(AgentFinishReason finishReason) Sets the finish reason.voidsetMessage(Message message) Sets the output message.voidsetSessionId(String sessionId) Sets the session ID.voidsetSnapshotId(String snapshotId) Sets the snapshot ID.voidsetState(SessionState<S> state) Sets the session state.
-
Constructor Details
-
AgentOutput
public AgentOutput()Default constructor.
-
-
Method Details
-
builder
Creates a builder for AgentOutput.- Type Parameters:
S- the type of custom state- Returns:
- a new builder
-
getSessionId
Returns the session ID.- Returns:
- the session ID
-
setSessionId
Sets the session ID.- Parameters:
sessionId- the session ID
-
getSnapshotId
Returns the snapshot ID.- Returns:
- the snapshot ID
-
setSnapshotId
Sets the snapshot ID.- Parameters:
snapshotId- the snapshot ID
-
getState
Returns the session state.- Returns:
- the state
-
setState
Sets the session state.- Parameters:
state- the state
-
getMessage
Returns the output message.- Returns:
- the message
-
setMessage
Sets the output message.- Parameters:
message- the message
-
getArtifacts
Returns the output artifacts.- Returns:
- the artifacts
-
setArtifacts
Sets the output artifacts.- Parameters:
artifacts- the artifacts
-
getFinishReason
Returns the finish reason.- Returns:
- the finish reason
-
setFinishReason
Sets the finish reason.- Parameters:
finishReason- the finish reason
-
getError
Returns the runtime error, if any.- Returns:
- the error, or null if no error
-
setError
Sets the runtime error.- Parameters:
error- the error
-