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
IKnowledgeServiceThe IKnowledgeService knowledge service.
callContext
IOrchestrationContextThe IOrchestrationContext call context associated with the current request.
logger
ILogger<KnowledgeController>The ILogger used for logging.
Methods
GetKnowledgeSource(string, string)
Retrieves a specified knowledge source.
[HttpGet("knowledgeSources/{knowledgeSourceId}")]
public Task<IActionResult> GetKnowledgeSource(string instanceId, string knowledgeSourceId)
Parameters
instanceId
stringThe FoundationaLLM instance identifier.
knowledgeSourceId
stringThe knowledge source identifier.
Returns
GetKnowledgeSources(string, ContextKnowledgeResourceListRequest)
Retrieves the list of knowledge sources.
[HttpPost("knowledgeSources/list")]
public Task<IActionResult> GetKnowledgeSources(string instanceId, ContextKnowledgeResourceListRequest listRequest)
Parameters
instanceId
stringThe FoundationaLLM instance identifier.
listRequest
ContextKnowledgeResourceListRequestThe request containing the information used to filter the knowledge resources.
Returns
GetKnowledgeUnit(string, string)
Retrieves a specified knowledge unit.
[HttpGet("knowledgeUnits/{knowledgeUnitId}")]
public Task<IActionResult> GetKnowledgeUnit(string instanceId, string knowledgeUnitId)
Parameters
instanceId
stringThe FoundationaLLM instance identifier.
knowledgeUnitId
stringThe knowledge unit identifier.
Returns
GetKnowledgeUnits(string, ContextKnowledgeResourceListRequest)
Retrieves the list of knowledge units.
[HttpPost("knowledgeUnits/list")]
public Task<IActionResult> GetKnowledgeUnits(string instanceId, ContextKnowledgeResourceListRequest listRequest)
Parameters
instanceId
stringThe FoundationaLLM instance identifier.
listRequest
ContextKnowledgeResourceListRequestThe request containing the information used to filter the knowledge resources.
Returns
QueryKnowledgeSource(string, string, ContextKnowledgeSourceQueryRequest)
Queries a knowledge graph.
[HttpPost("knowledgeSources/{knowledgeSourceId}/query")]
public Task<IActionResult> QueryKnowledgeSource(string instanceId, string knowledgeSourceId, ContextKnowledgeSourceQueryRequest queryRequest)
Parameters
instanceId
stringThe FoundationaLLM instance identifier.
knowledgeSourceId
stringqueryRequest
ContextKnowledgeSourceQueryRequest
Returns
RenderKnowledgeUnitGraph(string, string, ContextKnowledgeSourceQueryRequest?)
Retrieves the knowledge graph in a format suitable for rendering.
[HttpPost("knowledgeUnits/{knowledgeUnitId}/render-graph")]
public Task<IActionResult> RenderKnowledgeUnitGraph(string instanceId, string knowledgeUnitId, ContextKnowledgeSourceQueryRequest? queryRequest)
Parameters
instanceId
stringThe FoundationaLLM instance identifier.
knowledgeUnitId
stringqueryRequest
ContextKnowledgeSourceQueryRequest
Returns
SetKnowledgeUnitGraph(string, string, ContextKnowledgeUnitSetGraphRequest)
Sets the knowledge graph for a knowledge unit.
[HttpPost("knowledgeUnits/{knowledgeUnitId}/set-graph")]
public Task<IActionResult> SetKnowledgeUnitGraph(string instanceId, string knowledgeUnitId, ContextKnowledgeUnitSetGraphRequest setGraphRequest)
Parameters
instanceId
stringThe FoundationaLLM instance identifier.
knowledgeUnitId
stringThe knowledge unit identifier.
setGraphRequest
ContextKnowledgeUnitSetGraphRequestThe request containing the information used to set the knowledge graph.
Returns
UpsertKnowledgeSource(string, KnowledgeSource)
Creates or updates a knowledge source.
[HttpPost("knowledgeSources")]
public Task<IActionResult> UpsertKnowledgeSource(string instanceId, KnowledgeSource knowledgeSource)
Parameters
instanceId
stringThe FoundationaLLM instance identifier.
knowledgeSource
KnowledgeSourceThe knowledge source to be created or updated.
Returns
UpsertKnowledgeUnit(string, KnowledgeUnit)
Creates or updates a knowledge unit.
[HttpPost("knowledgeUnits")]
public Task<IActionResult> UpsertKnowledgeUnit(string instanceId, KnowledgeUnit knowledgeUnit)
Parameters
instanceId
stringThe FoundationaLLM instance identifier.
knowledgeUnit
KnowledgeUnitThe knowledge unit to be created or updated.