Interface IContextServiceClient
- Namespace
- FoundationaLLM.Common.Interfaces
- Assembly
- FoundationaLLM.Common.dll
Provides methods to call the FoundationaLLM Context API service.
public interface IContextServiceClient
- Extension Methods
Methods
CreateCodeSession(string, string, string, string, string, string)
Calls the Context API service to create a code session.
Task<ContextServiceResponse<CreateCodeSessionResponse>> CreateCodeSession(string instanceId, string agentName, string conversationId, string context, string endpointProvider, string language)
Parameters
instanceIdstringThe FoundationaLLM instance identifier.
agentNamestringThe name of the agent.
conversationIdstringThe conversation identifier.
contextstringThe context within the conversation in which the code session must be created (e.g., an agent tool name).
endpointProviderstringThe name of the code session endpoint provider.
languagestringThe programming language of the code session.
Returns
- Task<ContextServiceResponse<CreateCodeSessionResponse>>
A ContextServiceResponse<T> instance where
Tis of type CreateCodeSessionResponse.
CreateFileForAgent(string, string, string, string, Stream)
Calls the Context API service to create a file.
Task<ContextServiceResponse<ContextFileRecord>> CreateFileForAgent(string instanceId, string agentName, string fileName, string fileContentType, Stream fileContent)
Parameters
instanceIdstringThe FoundationaLLM instance identifier.
agentNamestringThe name of the agent.
fileNamestringThe name of the file to be created.
fileContentTypestringThe content type of the file to be created.
fileContentStreamThe binary content of the file.
Returns
- Task<ContextServiceResponse<ContextFileRecord>>
A ContextServiceResponse<T> instance where
Tis of type ContextFileRecord.
CreateFileForConversation(string, string, string, string, Stream)
Calls the Context API service to create a file.
Task<ContextServiceResponse<ContextFileRecord>> CreateFileForConversation(string instanceId, string conversationId, string fileName, string fileContentType, Stream fileContent)
Parameters
instanceIdstringThe FoundationaLLM instance identifier.
conversationIdstringThe conversation identifier.
fileNamestringThe name of the file to be created.
fileContentTypestringThe content type of the file to be created.
fileContentStreamThe binary content of the file.
Returns
- Task<ContextServiceResponse<ContextFileRecord>>
A ContextServiceResponse<T> instance where
Tis of type ContextFileRecord.
DeleteFileRecord(string, string)
Calls the Context API service to delete a file record.
Task<ContextServiceResponse> DeleteFileRecord(string instanceId, string fileId)
Parameters
instanceIdstringThe FoundationaLLM instance identifier.
fileIdstringThe unique identifier of the file.
Returns
- Task<ContextServiceResponse>
A ContextServiceResponse instance .
GetFileContent(string, string)
Calls the Context API service to get the content of a file.
Task<ContextServiceResponse<ContextFileContent>> GetFileContent(string instanceId, string fileId)
Parameters
instanceIdstringThe FoundationaLLM instance identifier.
fileIdstringThe unique identifier of the file.
Returns
- Task<ContextServiceResponse<ContextFileContent>>
A ContextServiceResponse<T> instance where
Tis of type ContextFileContent.
GetFileRecord(string, string)
Calls the Context API service to get a file record.
Task<ContextServiceResponse<ContextFileRecord>> GetFileRecord(string instanceId, string fileId)
Parameters
instanceIdstringThe FoundationaLLM instance identifier.
fileIdstringThe unique identifier of the file.
Returns
- Task<ContextServiceResponse<ContextFileRecord>>
A ContextServiceResponse<T> instance where
Tis of type ContextFileRecord.
GetKnowledgeSource(string, string, string?)
Call the Context API to retrieve a knowledge source.
Task<ContextServiceResponse<ResourceProviderGetResult<KnowledgeSource>>> GetKnowledgeSource(string instanceId, string knowledgeSourceId, string? agentName = null)
Parameters
instanceIdstringThe FoundationaLLM instance identifier.
knowledgeSourceIdstringThe knowledge source identifier.
agentNamestringThe agent name if the request is being made on behalf of an agent.
Returns
- Task<ContextServiceResponse<ResourceProviderGetResult<KnowledgeSource>>>
The requested knowledge source.
GetKnowledgeSources(string, IEnumerable<string>?)
Call the Context API to retrieve the list of knowledge sources.
Task<ContextServiceResponse<IEnumerable<ResourceProviderGetResult<KnowledgeSource>>>> GetKnowledgeSources(string instanceId, IEnumerable<string>? knowledgeSourceNames = null)
Parameters
instanceIdstringThe FoundationaLLM instance identifier.
knowledgeSourceNamesIEnumerable<string>An optional list of specific knowledge sources to retrieve.
Returns
- Task<ContextServiceResponse<IEnumerable<ResourceProviderGetResult<KnowledgeSource>>>>
The list of knowledge sources.
GetKnowledgeUnit(string, string, string?)
Call the Context API to retrieve the a knowledge unit.
Task<ContextServiceResponse<ResourceProviderGetResult<KnowledgeUnit>>> GetKnowledgeUnit(string instanceId, string knowledgeUnitId, string? agentName = null)
Parameters
instanceIdstringThe FoundationaLLM instance identifier.
knowledgeUnitIdstringThe knowledge unit identifier.
agentNamestringThe agent name if the request is being made on behalf of an agent.
Returns
- Task<ContextServiceResponse<ResourceProviderGetResult<KnowledgeUnit>>>
The requested knowledge unit.
GetKnowledgeUnits(string, IEnumerable<string>?)
Call the Context API to retrieve the list of knowledge units.
Task<ContextServiceResponse<IEnumerable<ResourceProviderGetResult<KnowledgeUnit>>>> GetKnowledgeUnits(string instanceId, IEnumerable<string>? knowledgeUnitNames = null)
Parameters
instanceIdstringThe FoundationaLLM instance identifier.
knowledgeUnitNamesIEnumerable<string>An optional list of specific knowledge units to retrieve.
Returns
- Task<ContextServiceResponse<IEnumerable<ResourceProviderGetResult<KnowledgeUnit>>>>
The list of knowledge units.
QueryKnowledgeSource(string, string, ContextKnowledgeSourceQueryRequest)
Calls the Context API to query a knowledge source.
Task<ContextKnowledgeSourceQueryResponse> QueryKnowledgeSource(string instanceId, string knowledgeSourceId, ContextKnowledgeSourceQueryRequest queryRequest)
Parameters
instanceIdstringThe FoundationaLLM instance identifier.
knowledgeSourceIdstringThe knowledge source identifier.
queryRequestContextKnowledgeSourceQueryRequestThe request object containing query parameters and options.
Returns
- Task<ContextKnowledgeSourceQueryResponse>
A response containing the result of the query execution.
RenderKnowledgeUnitGraph(string, string, ContextKnowledgeSourceQueryRequest?)
Retrieves the knowledge unit's knowledge graph in a format suitable for visualization or further processing.
Task<ContextKnowledgeUnitRenderGraphResponse> RenderKnowledgeUnitGraph(string instanceId, string knowledgeUnitId, ContextKnowledgeSourceQueryRequest? queryRequest)
Parameters
instanceIdstringThe FoundationaLLM instance identifier.
knowledgeUnitIdstringThe knowledge unit identifier.
queryRequestContextKnowledgeSourceQueryRequestThe request containing the details of the query.
Returns
SetKnowledgeUnitGraph(string, string, ContextKnowledgeUnitSetGraphRequest)
Sets the knowledge graph for a knowledge unit.
Task<ContextServiceResponse<ResourceProviderActionResult>> SetKnowledgeUnitGraph(string instanceId, string knowledgeUnitId, ContextKnowledgeUnitSetGraphRequest setGraphRequest)
Parameters
instanceIdstringThe FoundationaLLM instance identifier.
knowledgeUnitIdstringThe knowledge unit identifier.
setGraphRequestContextKnowledgeUnitSetGraphRequestThe request containing the knowledge graph details.
Returns
- Task<ContextServiceResponse<ResourceProviderActionResult>>
A response indicating the success of the operation and an optional error message.
UpsertKnowledgeSource(string, KnowledgeSource)
Creates or updates a knowledge source in the context service.
Task<ContextServiceResponse<ResourceProviderUpsertResult<KnowledgeSource>>> UpsertKnowledgeSource(string instanceId, KnowledgeSource knowledgeSource)
Parameters
instanceIdstringThe FoundationaLLM instance identifier.
knowledgeSourceKnowledgeSourceThe knowledge source resource to be created or updated.
Returns
UpsertKnowledgeUnit(string, KnowledgeUnit)
Creates or updates a knowledge unit in the context service.
Task<ContextServiceResponse<ResourceProviderUpsertResult<KnowledgeUnit>>> UpsertKnowledgeUnit(string instanceId, KnowledgeUnit knowledgeUnit)
Parameters
instanceIdstringThe FoundationaLLM instance identifier.
knowledgeUnitKnowledgeUnitThe knowledge unit resource to be created or updated.