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
instanceId
stringThe FoundationaLLM instance identifier.
agentName
stringThe name of the agent.
conversationId
stringThe conversation identifier.
context
stringThe context within the conversation in which the code session must be created (e.g., an agent tool name).
endpointProvider
stringThe name of the code session endpoint provider.
language
stringThe programming language of the code session.
Returns
- Task<ContextServiceResponse<CreateCodeSessionResponse>>
A ContextServiceResponse<T> instance where
T
is of type CreateCodeSessionResponse.
CreateFile(string, string, string, string, Stream)
Calls the Context API service to create a file.
Task<ContextServiceResponse<ContextFileRecord>> CreateFile(string instanceId, string conversationId, string fileName, string fileContentType, Stream fileContent)
Parameters
instanceId
stringThe FoundationaLLM instance identifier.
conversationId
stringThe conversation identifier.
fileName
stringThe name of the file to be created.
fileContentType
stringThe content type of the file to be created.
fileContent
StreamThe binary content of the file.
Returns
- Task<ContextServiceResponse<ContextFileRecord>>
A ContextServiceResponse<T> instance where
T
is of type ContextFileRecord.
GetFileContent(string, string)
Calls the Context API service to get the content of a file.
Task<ContextServiceResponse<ContextFileContent>> GetFileContent(string instanceId, string fileId)
Parameters
instanceId
stringThe FoundationaLLM instance identifier.
fileId
stringThe unique identifier of the file.
Returns
- Task<ContextServiceResponse<ContextFileContent>>
A ContextServiceResponse<T> instance where
T
is 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
instanceId
stringThe FoundationaLLM instance identifier.
fileId
stringThe unique identifier of the file.
Returns
- Task<ContextServiceResponse<ContextFileRecord>>
A ContextServiceResponse<T> instance where
T
is of type ContextFileRecord.
GetKnowledgeSources(string, IEnumerable<string>?)
Call the Context API to retrieve the list of knowledge sources.
Task<IEnumerable<KnowledgeSource>> GetKnowledgeSources(string instanceId, IEnumerable<string>? knowledgeSourceNames = null)
Parameters
instanceId
stringThe FoundationaLLM instance identifier.
knowledgeSourceNames
IEnumerable<string>An optional list of specific knowledge sources to retrieve.
Returns
- Task<IEnumerable<KnowledgeSource>>
The list of knowledge sources.
QueryKnowledgeSource(string, string, ContextKnowledgeSourceQueryRequest)
Calls the Context API to query a knowledge source.
Task<ContextKnowledgeSourceQueryResponse> QueryKnowledgeSource(string instanceId, string knowledgeSourceId, ContextKnowledgeSourceQueryRequest queryRequest)
Parameters
instanceId
stringThe FoundationaLLM instance identifier.
knowledgeSourceId
stringThe knowledge source identifier.
queryRequest
ContextKnowledgeSourceQueryRequestThe request object containing query parameters and options.
Returns
- Task<ContextKnowledgeSourceQueryResponse>
A response containing the result of the query execution.
RenderKnowledgeSourceGraph(string, string, ContextKnowledgeSourceQueryRequest?)
Retrieves the knowledge source's knowledge graph in a format suitable for visualization or further processing.
Task<ContextKnowledgeSourceRenderGraphResponse> RenderKnowledgeSourceGraph(string instanceId, string knowledgeSourceId, ContextKnowledgeSourceQueryRequest? queryRequest)
Parameters
instanceId
stringThe FoundationaLLM instance identifier.
knowledgeSourceId
stringThe knowledge source identifier.
queryRequest
ContextKnowledgeSourceQueryRequestThe request containing the details of the query.
Returns
UpdateKnowledgeSource(string, string, ContextKnowledgeSourceUpdateRequest)
Calls the Context API service to update a knowledge source with the specified knowledge graph and vector database/store details.
Task<ContextServiceResponse> UpdateKnowledgeSource(string instanceId, string knowledgeSourceId, ContextKnowledgeSourceUpdateRequest updateRequest)
Parameters
instanceId
stringThe FoundationaLLM instance identifier.
knowledgeSourceId
stringThe knowledge source identifier.
updateRequest
ContextKnowledgeSourceUpdateRequestThe update request containing the knowledge graph and vector database/store details.
Returns
- Task<ContextServiceResponse>
A response indicating the success of the operation and an optional error message.