Class TurRagContextBuilder
java.lang.Object
com.viglet.turing.genai.TurRagContextBuilder
Shared builder for RAG infrastructure (EmbeddingModel + VectorStore).
Eliminates duplication between SN GenAI, Asset Training, and RAG Search Tool.
- Since:
- 2026.1.14
- Author:
- Alexandre Oliveira
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordResult of building RAG infrastructure. -
Constructor Summary
ConstructorsConstructorDescriptionTurRagContextBuilder(TurGenAiLlmProviderFactory llmProviderFactory, TurGenAiStoreProviderFactory storeProviderFactory, TurSecretCryptoService secretCryptoService, TurGlobalSettingsService globalSettingsService, TurEmbeddingModelRepository embeddingModelRepository, TurStoreInstanceRepository storeInstanceRepository) -
Method Summary
Modifier and TypeMethodDescriptionbuild(TurEmbeddingModel embModel, TurStoreInstance storeInstance, String collectionNameOverride) Builds the full RAG infrastructure from resolved entities with an optional collection name override.Builds the full RAG infrastructure (EmbeddingModel + VectorStore) from explicit IDs.Builds the full RAG infrastructure with an optional collection name override.Builds RAG infrastructure using the Global Settings defaults.buildFromGlobalSettings(String collectionNameOverride) Builds RAG infrastructure using the Global Settings defaults with a collection name override.org.springframework.ai.embedding.EmbeddingModelresolveEmbeddingModel(TurEmbeddingModel embModel) Resolves a TurEmbeddingModel into a Spring AI EmbeddingModel.
-
Constructor Details
-
TurRagContextBuilder
public TurRagContextBuilder(TurGenAiLlmProviderFactory llmProviderFactory, TurGenAiStoreProviderFactory storeProviderFactory, TurSecretCryptoService secretCryptoService, TurGlobalSettingsService globalSettingsService, TurEmbeddingModelRepository embeddingModelRepository, TurStoreInstanceRepository storeInstanceRepository)
-
-
Method Details
-
resolveEmbeddingModel
public org.springframework.ai.embedding.EmbeddingModel resolveEmbeddingModel(TurEmbeddingModel embModel) Resolves a TurEmbeddingModel into a Spring AI EmbeddingModel. Creates a detached LLM instance with the embedding model's reference overriding the modelName. -
build
public Optional<TurRagContextBuilder.RagInfrastructure> build(String embeddingModelId, String storeInstanceId) Builds the full RAG infrastructure (EmbeddingModel + VectorStore) from explicit IDs. -
build
public Optional<TurRagContextBuilder.RagInfrastructure> build(String embeddingModelId, String storeInstanceId, String collectionNameOverride) Builds the full RAG infrastructure with an optional collection name override. -
build
public Optional<TurRagContextBuilder.RagInfrastructure> build(TurEmbeddingModel embModel, TurStoreInstance storeInstance, String collectionNameOverride) Builds the full RAG infrastructure from resolved entities with an optional collection name override. -
buildFromGlobalSettings
Builds RAG infrastructure using the Global Settings defaults. -
buildFromGlobalSettings
public Optional<TurRagContextBuilder.RagInfrastructure> buildFromGlobalSettings(String collectionNameOverride) Builds RAG infrastructure using the Global Settings defaults with a collection name override.
-