Class KnowledgeService
- Namespace
- FoundationaLLM.Context.Services
- Assembly
- FoundationaLLM.Context.dll
Provides the implementation for the FoundationaLLM Knowledge Graph service.
public class KnowledgeService : IKnowledgeService
- Inheritance
-
KnowledgeService
- Implements
- Inherited Members
- Extension Methods
Constructors
KnowledgeService(IStorageService, IAuthorizationServiceClient, IResourceProviderService, IResourceProviderService, IHttpClientFactoryService, KnowledgeServiceSettings, ILoggerFactory)
Provides the implementation for the FoundationaLLM Knowledge Graph service.
public KnowledgeService(IStorageService storageService, IAuthorizationServiceClient authorizationServiceClient, IResourceProviderService configurationResourceProvider, IResourceProviderService vectorResourceProvider, IHttpClientFactoryService httpClientFactory, KnowledgeServiceSettings settings, ILoggerFactory loggerFactory)
Parameters
storageService
IStorageServiceThe IStorageService providing storage services.
authorizationServiceClient
IAuthorizationServiceClientThe client for the FoundationaLLM Authorization API.
configurationResourceProvider
IResourceProviderServiceThe FoundationaLLM.Configuration resource provider service.
vectorResourceProvider
IResourceProviderServiceThe FoundationaLLM.Vector resource provider service.
httpClientFactory
IHttpClientFactoryServiceThe factory for creating HTTP clients.
settings
KnowledgeServiceSettingsThe settings for the Knowledge Graph service.
loggerFactory
ILoggerFactoryThe logger factory used to create loggers.
Methods
GetKnowledgeSources(string, ContextKnowledgeSourceListRequest, UnifiedUserIdentity)
Retrieves the list of knowledge sources.
public Task<IEnumerable<KnowledgeSource>> GetKnowledgeSources(string instanceId, ContextKnowledgeSourceListRequest listRequest, UnifiedUserIdentity userIdentity)
Parameters
instanceId
stringThe FoundationaLLM instance identifier.
listRequest
ContextKnowledgeSourceListRequestThe request containing the information used to filter the knowledge sources.
userIdentity
UnifiedUserIdentityThe identity of the security principal submitting the request.
Returns
QueryKnowledgeSource(string, string, ContextKnowledgeSourceQueryRequest, UnifiedUserIdentity)
Queries a knowledge source.
public Task<ContextKnowledgeSourceQueryResponse> QueryKnowledgeSource(string instanceId, string knowledgeSourceId, ContextKnowledgeSourceQueryRequest queryRequest, UnifiedUserIdentity userIdentity)
Parameters
instanceId
stringThe FoundationaLLM instance identifier.
knowledgeSourceId
stringThe knowledge source identifier.
queryRequest
ContextKnowledgeSourceQueryRequestThe request containing the details of the query.
userIdentity
UnifiedUserIdentityThe identity of the security principal submitting the request.
Returns
RenderKnowledgeSourceGraph(string, string, ContextKnowledgeSourceQueryRequest?, UnifiedUserIdentity)
Retrieves the knowledge source's knowledge graph in a format suitable for visualization or further processing.
public Task<ContextKnowledgeSourceRenderGraphResponse> RenderKnowledgeSourceGraph(string instanceId, string knowledgeSourceId, ContextKnowledgeSourceQueryRequest? queryRequest, UnifiedUserIdentity userIdentity)
Parameters
instanceId
stringThe FoundationaLLM instance identifier.
knowledgeSourceId
stringThe knowledge source identifier.
queryRequest
ContextKnowledgeSourceQueryRequestThe request containing the details of the query.
userIdentity
UnifiedUserIdentityThe identity of the security principal submitting the request.
Returns
UpdateKnowledgeSource(string, string, ContextKnowledgeSourceUpdateRequest, UnifiedUserIdentity)
Updates a knowledge source.
public Task UpdateKnowledgeSource(string instanceId, string knowledgeSourceId, ContextKnowledgeSourceUpdateRequest updateRequest, UnifiedUserIdentity userIdentity)
Parameters
instanceId
stringThe FoundationaLLM instance identifier.
knowledgeSourceId
stringThe knowledge source+ identifier.
updateRequest
ContextKnowledgeSourceUpdateRequestThe request containing the information to update the knowledge source.
userIdentity
UnifiedUserIdentityThe identity of the security principal submitting the request.