我正在尝试在 Micronaut 应用程序中使用 Langchain4J 来使用顶点 API 文本嵌入
@Singleton
public record VertexAiEmbedding(GoogleCloudConfiguration googleCloudConfiguration, VertexAiConfig vertexAiConfig) implements IVertexAiEmbedding {
private static Embedding embedding;
@Override
public float[] embedVector(String text) {
EmbeddingModel embeddingModel = VertexAiEmbeddingModel.builder()
.endpoint(vertexAiConfig.endPoint())
.project(googleCloudConfiguration.getProjectId())
.location(vertexAiConfig.location())
.publisher(vertexAiConfig.publisher())
.modelName(vertexAiConfig.modelName())
.build();
Response<Embedding> response = embeddingModel.embed(text);
embedding = response.content();
return embedding.vector();
}
例外:
Caused by: com.google.api.gax.rpc.ResourceExhaustedException: io.grpc.StatusRuntimeException: RESOURCE_EXHAUSTED: Quota exceeded for quota metric 'LLM utility requests' and limit 'LLM utility requests per minute per region' of service 'aiplatform.googleapis.com' for consumer 'project_number:974067563912'.
我正在使用 GCP 的免费试用期。