Vertex AI integration configuration

未关闭
#57 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
java
领域
api

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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

主要语言
Java
星标
90
派生
39
平均合并
22 小时 26 分钟
30 天内合并 PR
1

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

typesense/typesense-java 的其他 Issue

查看 typesense/typesense-java 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。