TextEmbeddingFormatContext interface

Formatting context options for task-specific text embeddings (also exported as TextFormatOptions).

Signature:

export declare interface TextEmbeddingFormatContext 

Properties

Property Type Description
textRole TextEmbeddingTextRole | undefined Optional role of the text ('QUERY' or 'DOCUMENT') for asymmetric tasks such as 'QUESTION_ANSWERING', 'FACT_CHECKING', or 'CODE_RETRIEVAL'.
title string | undefined Optional document title when type is 'RETRIEVAL_DOCUMENT'.
type TextEmbeddingType The embedding task type (for example, 'RETRIEVAL_QUERY', 'RETRIEVAL_DOCUMENT', or 'SEMANTIC_SIMILARITY').

TextEmbeddingFormatContext.textRole

Optional role of the text ('QUERY' or 'DOCUMENT') for asymmetric tasks such as 'QUESTION_ANSWERING', 'FACT_CHECKING', or 'CODE_RETRIEVAL'.

Signature:

textRole?: TextEmbeddingTextRole;

TextEmbeddingFormatContext.title

Optional document title when type is 'RETRIEVAL_DOCUMENT'.

Signature:

title?: string;

TextEmbeddingFormatContext.type

The embedding task type (for example, 'RETRIEVAL_QUERY', 'RETRIEVAL_DOCUMENT', or 'SEMANTIC_SIMILARITY').

Signature:

type: TextEmbeddingType;