Class OrchestrationSpringEmbeddingModel
java.lang.Object
com.sap.ai.sdk.orchestration.spring.OrchestrationSpringEmbeddingModel
- All Implemented Interfaces:
org.springframework.ai.embedding.EmbeddingModel,org.springframework.ai.model.Model<org.springframework.ai.embedding.EmbeddingRequest,org.springframework.ai.embedding.EmbeddingResponse>
public class OrchestrationSpringEmbeddingModel
extends Object
implements org.springframework.ai.embedding.EmbeddingModel
A Spring-based implementation of the
EmbeddingModel interface that integrates with the
Orchestration SDK to provide embedding functionality.- Since:
- 1.13.0
-
Constructor Summary
ConstructorsConstructorDescriptionOrchestrationSpringEmbeddingModel(org.springframework.ai.embedding.EmbeddingOptions defaultOptions) Constructs an instance with default options, a newOrchestrationClient, and sets the metadata mode toMetadataMode.EMBED.OrchestrationSpringEmbeddingModel(org.springframework.ai.embedding.EmbeddingOptions defaultOptions, OrchestrationClient client, org.springframework.ai.document.MetadataMode metadataMode) Creates a newOrchestrationSpringEmbeddingModelinstance. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.ai.embedding.EmbeddingResponsecall(org.springframework.ai.embedding.EmbeddingRequest request) Calls the embedding model with the given request and returns the response.List<float[]> float[]embed(org.springframework.ai.document.Document document) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.ai.embedding.EmbeddingModel
dimensions, embed, embed, embedForResponse, getEmbeddingContent
-
Constructor Details
-
OrchestrationSpringEmbeddingModel
public OrchestrationSpringEmbeddingModel(@Nonnull org.springframework.ai.embedding.EmbeddingOptions defaultOptions) Constructs an instance with default options, a newOrchestrationClient, and sets the metadata mode toMetadataMode.EMBED.- Parameters:
defaultOptions- Default embedding options.
-
OrchestrationSpringEmbeddingModel
public OrchestrationSpringEmbeddingModel(@Nonnull org.springframework.ai.embedding.EmbeddingOptions defaultOptions, @Nonnull OrchestrationClient client, @Nonnull org.springframework.ai.document.MetadataMode metadataMode) Creates a newOrchestrationSpringEmbeddingModelinstance.- Parameters:
defaultOptions- Default embedding options to provide model name and other parameters.Can be overridden by options in the request.
client- Client for interacting with the Orchestration SDK.metadataMode- Metadata mode to determine how document metadata is handled.- See Also:
-
-
Method Details
-
call
@Nonnull public org.springframework.ai.embedding.EmbeddingResponse call(@Nonnull org.springframework.ai.embedding.EmbeddingRequest request) Calls the embedding model with the given request and returns the response.Note: The request's options takes precedence over the defaultOptions.
- Specified by:
callin interfaceorg.springframework.ai.embedding.EmbeddingModel- Specified by:
callin interfaceorg.springframework.ai.model.Model<org.springframework.ai.embedding.EmbeddingRequest,org.springframework.ai.embedding.EmbeddingResponse> - Parameters:
request- The embedding request containing input texts and options.- Returns:
- The embedding response containing results and metadata.
-
embed
@Nonnull public float[] embed(@Nonnull org.springframework.ai.document.Document document) - Specified by:
embedin interfaceorg.springframework.ai.embedding.EmbeddingModel
-
embed
- Specified by:
embedin interfaceorg.springframework.ai.embedding.EmbeddingModel
-