Table of Contents

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 IStorageService

The IStorageService providing storage services.

authorizationServiceClient IAuthorizationServiceClient

The client for the FoundationaLLM Authorization API.

configurationResourceProvider IResourceProviderService

The FoundationaLLM.Configuration resource provider service.

vectorResourceProvider IResourceProviderService

The FoundationaLLM.Vector resource provider service.

httpClientFactory IHttpClientFactoryService

The factory for creating HTTP clients.

settings KnowledgeServiceSettings

The settings for the Knowledge Graph service.

loggerFactory ILoggerFactory

The 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 string

The FoundationaLLM instance identifier.

listRequest ContextKnowledgeSourceListRequest

The request containing the information used to filter the knowledge sources.

userIdentity UnifiedUserIdentity

The identity of the security principal submitting the request.

Returns

Task<IEnumerable<KnowledgeSource>>

QueryKnowledgeSource(string, string, ContextKnowledgeSourceQueryRequest, UnifiedUserIdentity)

Queries a knowledge source.

public Task<ContextKnowledgeSourceQueryResponse> QueryKnowledgeSource(string instanceId, string knowledgeSourceId, ContextKnowledgeSourceQueryRequest queryRequest, UnifiedUserIdentity userIdentity)

Parameters

instanceId string

The FoundationaLLM instance identifier.

knowledgeSourceId string

The knowledge source identifier.

queryRequest ContextKnowledgeSourceQueryRequest

The request containing the details of the query.

userIdentity UnifiedUserIdentity

The identity of the security principal submitting the request.

Returns

Task<ContextKnowledgeSourceQueryResponse>

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 string

The FoundationaLLM instance identifier.

knowledgeSourceId string

The knowledge source identifier.

queryRequest ContextKnowledgeSourceQueryRequest

The request containing the details of the query.

userIdentity UnifiedUserIdentity

The identity of the security principal submitting the request.

Returns

Task<ContextKnowledgeSourceRenderGraphResponse>

UpdateKnowledgeSource(string, string, ContextKnowledgeSourceUpdateRequest, UnifiedUserIdentity)

Updates a knowledge source.

public Task UpdateKnowledgeSource(string instanceId, string knowledgeSourceId, ContextKnowledgeSourceUpdateRequest updateRequest, UnifiedUserIdentity userIdentity)

Parameters

instanceId string

The FoundationaLLM instance identifier.

knowledgeSourceId string

The knowledge source+ identifier.

updateRequest ContextKnowledgeSourceUpdateRequest

The request containing the information to update the knowledge source.

userIdentity UnifiedUserIdentity

The identity of the security principal submitting the request.

Returns

Task