Table of Contents

Class KnowledgeController

Namespace
FoundationaLLM.Context.API.Controllers
Assembly
FoundationaLLM.Context.API.dll

Provdes methods for managing files.

[ApiController]
[APIKeyAuthentication]
[Route("instances/{instanceId}")]
public class KnowledgeController : ControllerBase
Inheritance
KnowledgeController
Inherited Members
Extension Methods

Constructors

KnowledgeController(IKnowledgeService, IOrchestrationContext, ILogger<KnowledgeController>)

Provdes methods for managing files.

public KnowledgeController(IKnowledgeService knowledgeService, IOrchestrationContext callContext, ILogger<KnowledgeController> logger)

Parameters

knowledgeService IKnowledgeService

The IKnowledgeService knowledge service.

callContext IOrchestrationContext

The IOrchestrationContext call context associated with the current request.

logger ILogger<KnowledgeController>

The ILogger used for logging.

Methods

GetKnowledgeSources(string, ContextKnowledgeSourceListRequest)

Retrieves the list of knowledge sources.

[HttpPost("knowledgeSources/list")]
public Task<IActionResult> GetKnowledgeSources(string instanceId, ContextKnowledgeSourceListRequest listRequest)

Parameters

instanceId string

The FoundationaLLM instance identifier.

listRequest ContextKnowledgeSourceListRequest

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

Returns

Task<IActionResult>

QueryKnowledgeSource(string, string, ContextKnowledgeSourceQueryRequest)

Queries a knowledge graph.

[HttpPost("knowledgeSources/{knowledgeSourceId}/query")]
public Task<IActionResult> QueryKnowledgeSource(string instanceId, string knowledgeSourceId, ContextKnowledgeSourceQueryRequest queryRequest)

Parameters

instanceId string

The FoundationaLLM instance identifier.

knowledgeSourceId string
queryRequest ContextKnowledgeSourceQueryRequest

Returns

Task<IActionResult>

RenderKnowledgeSourceGraph(string, string, ContextKnowledgeSourceQueryRequest?)

Retrieves the knowledge graph in a format suitable for rendering.

[HttpPost("knowledgeSources/{knowledgeSourceId}/render-graph")]
public Task<IActionResult> RenderKnowledgeSourceGraph(string instanceId, string knowledgeSourceId, ContextKnowledgeSourceQueryRequest? queryRequest)

Parameters

instanceId string

The FoundationaLLM instance identifier.

knowledgeSourceId string
queryRequest ContextKnowledgeSourceQueryRequest

Returns

Task<IActionResult>

UpdateKnowledgeSource(string, string, ContextKnowledgeSourceUpdateRequest)

Updates a knowledge source.

[HttpPost("knowledgeSources/{knowledgeSourceId}")]
public Task<IActionResult> UpdateKnowledgeSource(string instanceId, string knowledgeSourceId, ContextKnowledgeSourceUpdateRequest updateRequest)

Parameters

instanceId string

The FoundationaLLM instance identifier.

knowledgeSourceId string

The knowledge source identifier.

updateRequest ContextKnowledgeSourceUpdateRequest

The request containing the information used to update the knowledge source.

Returns

Task<IActionResult>