Class VertexAiScoringModel
java.lang.Object
dev.langchain4j.model.vertexai.VertexAiScoringModel
- All Implemented Interfaces:
ScoringModel
Implementation of a
ScoringModel for the Google Cloud Vertex AI
Ranking API.-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic VertexAiScoringModel.Builderbuilder()scoreAll(List<TextSegment> segments, String query) Scores all providedTextSegments against a given query.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ScoringModel
score, score
-
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 usetitleMetadataKey- The name of the key to use as a title.
-
-
Method Details
-
scoreAll
Scores all providedTextSegments against a given query.- Specified by:
scoreAllin interfaceScoringModel- Parameters:
segments- The list ofTextSegments 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
-