GenerateContentResponse class
A class representing the response from a content generation API.
To parse this JSON data, use:
final generateContentResponse = generateContentResponseFromJson(jsonString);
Constructors
-
GenerateContentResponse({String? id, List<
Choice> ? choices, int? created, String? model, String? object, dynamic systemFingerprint, Usage? usage, dynamic serviceTier, List? prompt, double? duration}) -
GenerateContentResponse.fromJson(Map<
String, dynamic> json) -
Creates a GenerateContentResponse instance from a JSON map.
factory
Properties
-
choices
↔ List<
Choice> ? -
List of generated choices/completions
getter/setter pair
- created ↔ int?
-
Unix timestamp of when the response was created
getter/setter pair
- duration ↔ double?
-
Duration of the request in seconds
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- id ↔ String?
-
Unique identifier for the response
getter/setter pair
- model ↔ String?
-
The model used for generation
getter/setter pair
- object ↔ String?
-
Type of the object
getter/setter pair
- prompt ↔ List?
-
The original prompt that generated this response
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- serviceTier ↔ dynamic
-
Service tier used for the request
getter/setter pair
- systemFingerprint ↔ dynamic
-
System fingerprint for the response
getter/setter pair
- usage ↔ Usage?
-
Usage statistics for the request
getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Converts this GenerateContentResponse instance to a JSON map.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited