// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.cloud.vectorsearch.v1beta;

import "google/api/field_behavior.proto";

option csharp_namespace = "Google.Cloud.VectorSearch.V1Beta";
option go_package = "cloud.google.com/go/vectorsearch/apiv1beta/vectorsearchpb;vectorsearchpb";
option java_multiple_files = true;
option java_outer_classname = "EmbeddingConfigProto";
option java_package = "com.google.cloud.vectorsearch.v1beta";
option php_namespace = "Google\\Cloud\\VectorSearch\\V1beta";
option ruby_package = "Google::Cloud::VectorSearch::V1beta";

// Represents the task the embeddings will be used for.
enum EmbeddingTaskType {
  // Unspecified task type.
  EMBEDDING_TASK_TYPE_UNSPECIFIED = 0;

  // Specifies the given text is a query in a search/retrieval setting.
  RETRIEVAL_QUERY = 1;

  // Specifies the given text is a document from the corpus being searched.
  RETRIEVAL_DOCUMENT = 2;

  // Specifies the given text will be used for STS.
  SEMANTIC_SIMILARITY = 3;

  // Specifies that the given text will be classified.
  CLASSIFICATION = 4;

  // Specifies that the embeddings will be used for clustering.
  CLUSTERING = 5;

  // Specifies that the embeddings will be used for question answering.
  QUESTION_ANSWERING = 6;

  // Specifies that the embeddings will be used for fact verification.
  FACT_VERIFICATION = 7;

  // Specifies that the embeddings will be used for code retrieval.
  CODE_RETRIEVAL_QUERY = 8;
}

// Message describing the configuration for generating embeddings for a vector
// field using Vertex AI embeddings API.
message VertexEmbeddingConfig {
  // Required. Required: ID of the embedding model to use. See
  // https://cloud.google.com/vertex-ai/generative-ai/docs/learn/models#embeddings-models
  // for the list of supported models.
  string model_id = 1 [(google.api.field_behavior) = REQUIRED];

  // Required. Required: Text template for the input to the model. The template
  // must contain one or more references to fields in the DataObject, e.g.:
  // "Movie Title: {title} ---- Movie Plot: {plot}".
  string text_template = 2 [(google.api.field_behavior) = REQUIRED];

  // Required. Required: Task type for the embeddings.
  EmbeddingTaskType task_type = 3 [(google.api.field_behavior) = REQUIRED];
}
