Vertex AI integration configuration

Abierto
#57 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
48/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
java
Área
api

Línea de trabajo

Start with the FieldEmbedModelConfig model class, which should sit alongside the other generated collection-schema models, and compare its properties with the embed model_config section of the Typesense OpenAPI spec. Check whether refresh_token is in the spec and missing from the Java class, and whether the builder methods follow the same pattern as accessToken. Done when the documented refreshToken(...) call compiles and the serialized request body includes refresh_token.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Description

While configuring Typesense to use Vertex AI it seems the property refreshToken is missing on FieldEmbedModelConfig class, so we cannot setup properly it, so it cannot connect to GCP Vertex AI API, throwing a 400 with the message: Property embed.model_config.refresh_token is missing or is not a string.

Actually, in the documentation it shows the refreshToken property being configured:

CollectionSchema collectionSchema = new CollectionSchema();
ArrayList<String> embedFrom = new ArrayList<>();
embedFrom.add("product_name");
embedFrom.add("categories");

collectionschema.name("products")
                .addFieldsItem(new Field().name("product_name").type(FieldTypes.STRING))
                .addFieldsItem(new Field().name("categories").type(FieldTypes.STRING_ARRAY))
                .addFieldsItem(new Field().name("embedding").type(FieldTypes.FLOAT_ARRAY).embed(
                  new FieldEmbed().from(embedFrom).modelConfig(new FieldEmbedModelConfig().modelName("gcp/embedding-gecko-001")
                      .accessToken("your_gcp_access_token")
                      .refreshToken("your_gcp_refresh_token") <-- this one is missing!
                      .clientId("your_gcp_app_client_id")
                      .clientSecret("your_gcp_client_secret").projectId("your_gcp_project_id")))
                ));
CollectionResponse collectionResponse = client.collections().create(collectionSchema);

Guess the OpenAPI model is not fully synced with the one used in this library.

Steps to reproduce

Follow the steps from the documentation

Expected Behavior

Typesense library is able to connect to Vertex AI to generate embeddings

Actual Behavior

Typesense library is not able to connect to Vertex AI, throwing a 400 with the message: Property embed.model_config.refresh_token is missing or is not a string.

Metadata

Typesense Version: 0.8.1

OS: MacOS Sonoma 14.5

Lenguaje dominante
Java
Estrellas
90
Forks
39
Merge medio
22 h 26 min
PR fusionados (30 d)
1

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de typesense/typesense-java

Todos los issues de typesense/typesense-java

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.