Class VertexAiScoringModel

java.lang.Object
dev.langchain4j.model.vertexai.VertexAiScoringModel
All Implemented Interfaces:
dev.langchain4j.model.scoring.ScoringModel

public class VertexAiScoringModel extends Object implements dev.langchain4j.model.scoring.ScoringModel
Implementation of a ScoringModel for the Google Cloud Vertex AI Ranking API.
  • Constructor Details

    • VertexAiScoringModel

      public VertexAiScoringModel(String projectId, String projectNumber, String location, String model, String titleMetadataKey)
      Constructor for the Vertex AI Ranker Scoring Model.
      Parameters:
      projectId - The Google Cloud Project ID.
      projectNumber - The Google Cloud Project Number.
      location - The Google Cloud Region.
      model - The model to use
      titleMetadataKey - The name of the key to use as a title.
  • Method Details

    • scoreAll

      public dev.langchain4j.model.output.Response<List<Double>> scoreAll(List<dev.langchain4j.data.segment.TextSegment> segments, String query)
      Scores all provided TextSegments against a given query.
      Specified by:
      scoreAll in interface dev.langchain4j.model.scoring.ScoringModel
      Parameters:
      segments - The list of TextSegments to score.
      query - The query against which to score the segments.
      Returns:
      the list of scores. The order of scores corresponds to the order of TextSegments.
    • builder

      public static VertexAiScoringModel.Builder builder()