Table of Contents

Enum TaskType

Namespace
GenerativeAI.Types
Assembly
GenerativeAI.dll

Specifies the type of task for which the embedding will be used.

[JsonConverter(typeof(JsonStringEnumConverter<TaskType>))]
public enum TaskType
Extension Methods

Fields

TASK_TYPE_UNSPECIFIED = 0

Unset value, which will default to one of the other enum values.

RETRIEVAL_QUERY = 1

Embeddings optimized for general search queries. Use RETRIEVAL_QUERY for queries; RETRIEVAL_DOCUMENT for documents to be retrieved. Use case: Custom search

RETRIEVAL_DOCUMENT = 2

Embeddings optimized for document search. Indexing articles, books, or web pages for search.

SEMANTIC_SIMILARITY = 3

Embeddings optimized to assess text similarity. Use case: Recommendation systems, duplicate detection

CLASSIFICATION = 4

Embeddings optimized to classify texts according to preset labels. Use case: Sentiment analysis, spam detection

CLUSTERING = 5

Embeddings optimized to cluster texts based on their similarities. Use case: Document organization, market research, anomaly detection

CODE_RETRIEVAL_QUERY = 6

Embeddings optimized for retrieval of code blocks based on natural language queries. Use CODE_RETRIEVAL_QUERY for queries; RETRIEVAL_DOCUMENT for code blocks to be retrieved. Use case: Code suggestions and search

QUESTION_ANSWERING = 7

Embeddings for questions in a question-answering system, optimized for finding documents that answer the question. Use QUESTION_ANSWERING for questions; RETRIEVAL_DOCUMENT for documents to be retrieved. Use case: Chatbox

FACT_VERIFICATION = 8

Embeddings for statements that need to be verified, optimized for retrieving documents that contain evidence supporting or refuting the statement. Use FACT_VERIFICATION for the target text; RETRIEVAL_DOCUMENT for documents to be retrieved. Use case: Automated fact-checking systems

See Also