Event class
One runtime event emitted during an invocation.
- Inheritance
-
- Object
- LlmResponse
- Event
Constructors
-
Event({required String invocationId, required String author, EventActions? actions, Set<
String> ? longRunningToolIds, String? branch, String? id, double? timestamp, String? modelVersion, Content? content, bool? partial, bool? turnComplete, String? finishReason, String? errorCode, String? errorMessage, bool? interrupted, Map<String, dynamic> ? customMetadata, Object? usageMetadata, Object? inputTranscription, Object? outputTranscription, double? avgLogprobs, Object? logprobsResult, Object? cacheMetadata, Object? citationMetadata, Object? groundingMetadata, String? interactionId}) - Creates an event.
Properties
- actions ↔ EventActions
-
Side-channel actions associated with this event.
getter/setter pair
-
Author label, such as
user,model, or agent name.getter/setter pair - avgLogprobs ↔ double?
-
Average log probability for generated tokens.
getter/setter pairinherited
- branch ↔ String?
-
Optional branch identifier for branching conversations.
getter/setter pair
- cacheMetadata ↔ Object?
-
Provider cache metadata payload.
getter/setter pairinherited
- citationMetadata ↔ Object?
-
Provider citation metadata payload.
getter/setter pairinherited
- content ↔ Content?
-
Generated content payload.
getter/setter pairinherited
-
customMetadata
↔ Map<
String, dynamic> ? -
Optional custom metadata attached by middleware.
getter/setter pairinherited
- errorCode ↔ String?
-
Backend-specific error code.
getter/setter pairinherited
- errorMessage ↔ String?
-
Human-readable error message.
getter/setter pairinherited
- finishReason ↔ String?
-
Backend-specific finish reason string.
getter/setter pairinherited
- groundingMetadata ↔ Object?
-
Provider grounding metadata payload.
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- id ↔ String
-
Event identifier.
getter/setter pair
- inputTranscription ↔ Object?
-
Provider input transcription payload.
getter/setter pairinherited
- interactionId ↔ String?
-
Provider interaction identifier for tracing.
getter/setter pairinherited
- interrupted ↔ bool?
-
Whether generation was interrupted externally.
getter/setter pairinherited
- invocationId ↔ String
-
Invocation ID that produced this event.
getter/setter pair
- logprobsResult ↔ Object?
-
Provider log-probability detail payload.
getter/setter pairinherited
-
longRunningToolIds
↔ Set<
String> ? -
Long-running tool IDs associated with this event.
getter/setter pair
- modelVersion ↔ String?
-
Backend model version that produced this response.
getter/setter pairinherited
- outputTranscription ↔ Object?
-
Provider output transcription payload.
getter/setter pairinherited
- partial ↔ bool?
-
Whether this event is a partial streaming chunk.
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- timestamp ↔ double
-
Event timestamp in seconds since epoch.
getter/setter pair
- turnComplete ↔ bool?
-
Whether the model turn has completed.
getter/setter pairinherited
- usageMetadata ↔ Object?
-
Provider usage metadata payload.
getter/setter pairinherited
Methods
-
copyWith(
{Object? invocationId = _sentinel, Object? author = _sentinel, EventActions? actions, Object? longRunningToolIds = _sentinel, Object? branch = _sentinel, Object? id = _sentinel, Object? timestamp = _sentinel, Object? modelVersion = _sentinel, Object? content = _sentinel, Object? partial = _sentinel, Object? turnComplete = _sentinel, Object? finishReason = _sentinel, Object? errorCode = _sentinel, Object? errorMessage = _sentinel, Object? interrupted = _sentinel, Object? customMetadata = _sentinel, Object? usageMetadata = _sentinel, Object? inputTranscription = _sentinel, Object? outputTranscription = _sentinel, Object? avgLogprobs = _sentinel, Object? logprobsResult = _sentinel, Object? cacheMetadata = _sentinel, Object? citationMetadata = _sentinel, Object? groundingMetadata = _sentinel, Object? interactionId = _sentinel}) → Event -
Returns a copy of this response with optional overrides.
override
-
getFunctionCalls(
) → List< FunctionCall> - Returns function-call parts embedded in content.
-
getFunctionResponses(
) → List< FunctionResponse> - Returns function-response parts embedded in content.
-
hasTrailingCodeExecutionResult(
) → bool - Whether the last content part is a code-execution result.
-
isFinalResponse(
) → bool - Whether this event should be treated as a final user-visible response.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited