Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(vertex_ai): Support task type and title in embeddings models #149

Merged
merged 1 commit into from
Sep 4, 2023

Conversation

davidmigloz
Copy link
Owner

The embeddings API now support a "task type" parameter to define the kind of task the embedding will be used for to help the model produce better quality embeddings.

  • RETRIEVAL_QUERY: Specifies the given text is a query in a search/retrieval setting.
  • RETRIEVAL_DOCUMENT: Specifies the given text is a document in a search/retrieval setting.
  • SEMANTIC_SIMILARITY: Specifies the given text will be used for Semantic Textual Similarity (STS).
  • CLASSIFICATION: Specifies that the embeddings will be used for classification.
  • CLUSTERING: Specifies that the embeddings will be used for clustering.

For RETRIEVAL_DOCUMENT task, a "title" parameter can also be attached.

These two new parameters are only supported in models released in or after August 2023.

Docs:
https://cloud.google.com/vertex-ai/docs/generative-ai/embeddings/get-text-embeddings#api_changes_to_models_released_in_or_after_august_2023

The embeddings API now support a "task type" parameter to define the kind of task the embedding will be used for to help the model produce better quality embeddings.

- RETRIEVAL_QUERY: Specifies the given text is a query in a search/retrieval setting.
- RETRIEVAL_DOCUMENT: Specifies the given text is a document in a search/retrieval setting.
- SEMANTIC_SIMILARITY: Specifies the given text will be used for Semantic Textual Similarity (STS).
- CLASSIFICATION: Specifies that the embeddings will be used for classification.
- CLUSTERING: Specifies that the embeddings will be used for clustering.

For RETRIEVAL_DOCUMENT task, a "title" parameter can also be attached.

These two new parameters are only supported in models released in or after August 2023.

Docs:
https://cloud.google.com/vertex-ai/docs/generative-ai/embeddings/get-text-embeddings#api_changes_to_models_released_in_or_after_august_2023
@davidmigloz davidmigloz self-assigned this Sep 4, 2023
@davidmigloz davidmigloz added t:enhancement New feature or request p:vertex_ai vertex_ai package. labels Sep 4, 2023
@davidmigloz davidmigloz added this to the v0.0.12 milestone Sep 4, 2023
@davidmigloz davidmigloz merged commit 421d36b into main Sep 4, 2023
1 check passed
@davidmigloz davidmigloz deleted the task_type branch September 4, 2023 12:12
KennethKnudsen97 pushed a commit to KennethKnudsen97/langchain_dart that referenced this pull request Sep 29, 2023
…vidmigloz#149)

The embeddings API now support a "task type" parameter to define the kind of task the embedding will be used for to help the model produce better quality embeddings.

- RETRIEVAL_QUERY: Specifies the given text is a query in a search/retrieval setting.
- RETRIEVAL_DOCUMENT: Specifies the given text is a document in a search/retrieval setting.
- SEMANTIC_SIMILARITY: Specifies the given text will be used for Semantic Textual Similarity (STS).
- CLASSIFICATION: Specifies that the embeddings will be used for classification.
- CLUSTERING: Specifies that the embeddings will be used for clustering.

For RETRIEVAL_DOCUMENT task, a "title" parameter can also be attached.

These two new parameters are only supported in models released in or after August 2023.

Docs:
https://cloud.google.com/vertex-ai/docs/generative-ai/embeddings/get-text-embeddings#api_changes_to_models_released_in_or_after_august_2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p:vertex_ai vertex_ai package. t:enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant