Skip to content

Citation

Namespace: Vercel.AI.Provider

public sealed class Citation

A reference that supports generated text: the source it points at, plus the optional range of the text it supports and the cited passage. It is not a second copy of the retrieved sources.

Inheritance: object

View source

Citation(GeneratedDocumentSource, int?, int?, string?)

Section titled “Citation(GeneratedDocumentSource, int?, int?, string?)”
public Citation(GeneratedDocumentSource source, int? startIndex = null, int? endIndex = null, string? citedText = null)

Creates a citation for a document source.

Parameters

Name Type Description
source GeneratedDocumentSource
startIndex int?
endIndex int?
citedText string

View source

Citation(GeneratedSource, int?, int?, string?)

Section titled “Citation(GeneratedSource, int?, int?, string?)”
public Citation(GeneratedSource source, int? startIndex = null, int? endIndex = null, string? citedText = null)

Creates a citation for a URL source.

Parameters

Name Type Description
source GeneratedSource
startIndex int?
endIndex int?
citedText string

View source

public string? CitedText { get; }

The supporting passage from the source, when the provider supplied one.

Value: string

View source

public int? EndIndex { get; }

Exclusive end offset in the containing generated text, when the provider supplied one.

Value: int?

View source

public GeneratedContent Source { get; }

The referenced source: a GeneratedSource (URL) or a GeneratedDocumentSource.

Value: GeneratedContent

View source

public int? StartIndex { get; }

Start offset in the containing generated text, when the provider supplied one.

Value: int?

View source

Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product