Interface ICodeSessionService
- Namespace
- FoundationaLLM.Context.Interfaces
- Assembly
- FoundationaLLM.ContextEngine.dll
Definest the interface for the FoundationaLLM Code Session service.
public interface ICodeSessionService
- Extension Methods
Methods
CreateCodeSession(string, CreateCodeSessionRequest, UnifiedUserIdentity)
Creates a new code session using one of the registered code session providers.
Task<CreateCodeSessionResponse> CreateCodeSession(string instanceId, CreateCodeSessionRequest codeSessionRequest, UnifiedUserIdentity userIdentity)
Parameters
instanceIdstringThe unique identifier of the FoundationaLLM instance.
codeSessionRequestCreateCodeSessionRequestThe CreateCodeSessionRequest providing the details of the request to create the code session.
userIdentityUnifiedUserIdentityThe UnifiedUserIdentity providing the user identity information.
Returns
- Task<CreateCodeSessionResponse>
The properties of the code execution session.
DownloadFilesFromCodeSession(string, string, string, UnifiedUserIdentity)
Downloads newly created files from a code session.
Task<CodeSessionFileDownloadResponse> DownloadFilesFromCodeSession(string instanceId, string sessionId, string operationId, UnifiedUserIdentity userIdentity)
Parameters
instanceIdstringThe FoundationaLLM instance identifier.
sessionIdstringThe identifier of the code session from where the files must be downloaded.
operationIdstringThe code session file upload operation identifier.
userIdentityUnifiedUserIdentityThe UnifiedUserIdentity providing the user identity information.
Returns
- Task<CodeSessionFileDownloadResponse>
The result of downloading the newly created in the form of a dictionary with file names and file identifiers.
Remarks
By newly created files we mean files that were not uploaded to the code session but were created during the code execution.
The operationId is the identifier of the file upload operation that initially uploaded the files.
ExecuteCodeInCodeSession(string, string, string, UnifiedUserIdentity)
Executes code in a code session and returns the result of the execution.
Task<CodeSessionCodeExecuteResponse> ExecuteCodeInCodeSession(string instanceId, string sessionId, string codeToExecute, UnifiedUserIdentity userIdentity)
Parameters
instanceIdstringThe FoundationaLLM instance identifier.
sessionIdstringThe identifier of the code session where the code must be executed.
codeToExecutestringThe code to execute.
userIdentityUnifiedUserIdentityThe UnifiedUserIdentity providing the user identity information.
Returns
- Task<CodeSessionCodeExecuteResponse>
The result of the code execution including standard and error outputs.
UploadFilesToCodeSession(string, string, CodeSessionFileUploadRequest, UnifiedUserIdentity)
Uploads files to a code session.
Task<CodeSessionFileUploadResponse> UploadFilesToCodeSession(string instanceId, string sessionId, CodeSessionFileUploadRequest request, UnifiedUserIdentity userIdentity)
Parameters
instanceIdstringThe FoundationaLLM instance identifier.
sessionIdstringThe identifier of the code session where the files must be uploaded.
requestCodeSessionFileUploadRequestThe CodeSessionFileUploadRequest providing the details of the request.
userIdentityUnifiedUserIdentityThe UnifiedUserIdentity providing the user identity information.
Returns
- Task<CodeSessionFileUploadResponse>
The result of uploading the files to the code session in the form of a dictionary where the keys are the file names and the values are true/false.