Package org.springframework.ai.oci
Class OCIEmbeddingModel
java.lang.Object
org.springframework.ai.embedding.AbstractEmbeddingModel
org.springframework.ai.oci.OCIEmbeddingModel
- All Implemented Interfaces:
EmbeddingModel
,Model<EmbeddingRequest,
EmbeddingResponse>
EmbeddingModel
implementation that uses the
OCI GenAI Embedding API.- Since:
- 1.0.0
- Author:
- Anders Swanson
-
Field Summary
Fields inherited from class org.springframework.ai.embedding.AbstractEmbeddingModel
embeddingDimensions
-
Constructor Summary
ConstructorDescriptionOCIEmbeddingModel
(com.oracle.bmc.generativeaiinference.GenerativeAiInference genAi, OCIEmbeddingOptions options) OCIEmbeddingModel
(com.oracle.bmc.generativeaiinference.GenerativeAiInference genAi, OCIEmbeddingOptions options, io.micrometer.observation.ObservationRegistry observationRegistry) -
Method Summary
Modifier and TypeMethodDescriptioncall
(EmbeddingRequest request) Executes a method call to the AI model.float[]
Embeds the given document's content into a vector.Methods inherited from class org.springframework.ai.embedding.AbstractEmbeddingModel
dimensions, dimensions
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.ai.embedding.EmbeddingModel
embed, embed, embed, embedForResponse
-
Constructor Details
-
OCIEmbeddingModel
public OCIEmbeddingModel(com.oracle.bmc.generativeaiinference.GenerativeAiInference genAi, OCIEmbeddingOptions options) -
OCIEmbeddingModel
public OCIEmbeddingModel(com.oracle.bmc.generativeaiinference.GenerativeAiInference genAi, OCIEmbeddingOptions options, io.micrometer.observation.ObservationRegistry observationRegistry)
-
-
Method Details
-
call
Description copied from interface:Model
Executes a method call to the AI model.- Parameters:
request
- the request object to be sent to the AI model- Returns:
- the response from the AI model
-
embed
Description copied from interface:EmbeddingModel
Embeds the given document's content into a vector.- Parameters:
document
- the document to embed.- Returns:
- the embedded vector.
-