Table of Contents

Class Citation

Namespace
Google.GenAI.Types
Assembly
Google.GenAI.dll

A citation for a piece of generatedcontent. This data type is not supported in Gemini API.

public record Citation : IEquatable<Citation>
Inheritance
Citation
Implements
Inherited Members

Properties

EndIndex

Output only. The end index of the citation in the content.

[JsonPropertyName("endIndex")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? EndIndex { get; set; }

Property Value

int?

License

Output only. The license of the source of the citation.

[JsonPropertyName("license")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? License { get; set; }

Property Value

string

PublicationDate

Output only. The publication date of the source of the citation.

[JsonPropertyName("publicationDate")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public GoogleTypeDate? PublicationDate { get; set; }

Property Value

GoogleTypeDate

StartIndex

Output only. The start index of the citation in the content.

[JsonPropertyName("startIndex")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? StartIndex { get; set; }

Property Value

int?

Title

Output only. The title of the source of the citation.

[JsonPropertyName("title")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Title { get; set; }

Property Value

string

Uri

Output only. The URI of the source of the citation.

[JsonPropertyName("uri")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Uri { get; set; }

Property Value

string

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a Citation object.

public static Citation? FromJson(string jsonString, JsonSerializerOptions? options = null)

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

Citation

The deserialized Citation object, or null if deserialization fails.