Package sk.iway.iwcm.rag.embedding
Class EmbeddingService
java.lang.Object
sk.iway.iwcm.rag.embedding.EmbeddingService
Adapts CMS assistant and domain context to the framework-neutral embedding action.
-
Constructor Summary
ConstructorsConstructorDescriptionEmbeddingService(com.webjetcms.ai.AiClient aiClient, WebjetAiConfigurationService configurationService, List<AiInterface> providers) -
Method Summary
Modifier and TypeMethodDescriptionembedWithUsage(List<String> texts, AssistantDefinitionEntity assistant, jakarta.servlet.http.HttpServletRequest request) Creates embeddings using the provider and model stored in the selected system assistant.embedWithUsage(List<String> texts, AssistantDefinitionEntity assistant, String domainName) Creates embeddings using provider configuration resolved for the specified domain.intReturns the dimension required by the configured pgvector column.
-
Constructor Details
-
EmbeddingService
public EmbeddingService(com.webjetcms.ai.AiClient aiClient, WebjetAiConfigurationService configurationService, List<AiInterface> providers)
-
-
Method Details
-
embedWithUsage
public EmbeddingBatchResult embedWithUsage(List<String> texts, AssistantDefinitionEntity assistant, jakarta.servlet.http.HttpServletRequest request) throws ProviderCallException Creates embeddings using the provider and model stored in the selected system assistant.- Throws:
ProviderCallException
-
embedWithUsage
public EmbeddingBatchResult embedWithUsage(List<String> texts, AssistantDefinitionEntity assistant, String domainName) throws ProviderCallException Creates embeddings using provider configuration resolved for the specified domain.- Throws:
ProviderCallException
-
getDimensions
public int getDimensions()Returns the dimension required by the configured pgvector column.
-