package embedding.model;

import dev.langchain4j.data.embedding.Embedding;
import dev.langchain4j.model.embedding.EmbeddingModel;
import dev.langchain4j.model.output.Response;
import dev.langchain4j.model.vertexai.VertexAiEmbeddingModel;

public class VertexAiEmbeddingModelExample {

    public static void main(String[] args) {

        EmbeddingModel embeddingModel = VertexAiEmbeddingModel.builder()
                .endpoint("us-central1-aiplatform.googleapis.com:443")
                .project("langchain4j")
                .location("us-central1")
                .publisher("google")
                .modelName("textembedding-gecko@001")
                .build();

        Response<Embedding> response = embeddingModel.embed("Hello, how are you?");
        System.out.println(response);
    }
}

dev.langchain4j.model.vertexai.VertexAiEmbeddingModel.builder
[((371, 671), 'dev.langchain4j.model.vertexai.VertexAiEmbeddingModel.builder'), ((371, 646), 'dev.langchain4j.model.vertexai.VertexAiEmbeddingModel.builder'), ((371, 592), 'dev.langchain4j.model.vertexai.VertexAiEmbeddingModel.builder'), ((371, 555), 'dev.langchain4j.model.vertexai.VertexAiEmbeddingModel.builder'), ((371, 514), 'dev.langchain4j.model.vertexai.VertexAiEmbeddingModel.builder'), ((371, 474), 'dev.langchain4j.model.vertexai.VertexAiEmbeddingModel.builder')]