Class CodeSessionsController
- Namespace
- FoundationaLLM.Context.API.Controllers
- Assembly
- FoundationaLLM.Context.API.dll
Provdes methods for managing code sessions.
[ApiController]
[APIKeyAuthentication]
[Route("instances/{instanceId}/[controller]")]
public class CodeSessionsController : ControllerBase
- Inheritance
-
CodeSessionsController
- Inherited Members
- Extension Methods
Constructors
CodeSessionsController(ICodeSessionService, IOrchestrationContext, ILogger<CodeSessionsController>)
Provdes methods for managing code sessions.
public CodeSessionsController(ICodeSessionService codeSessionService, IOrchestrationContext callContext, ILogger<CodeSessionsController> logger)
Parameters
codeSessionServiceICodeSessionServiceThe ICodeSessionService providing code sessions services.
callContextIOrchestrationContextThe IOrchestrationContext call context associated with the current request.
loggerILogger<CodeSessionsController>The ILogger used for logging.
Methods
CreateCodeSessions(string, CreateCodeSessionRequest)
Creates a new code session.
[HttpPost]
public Task<IActionResult> CreateCodeSessions(string instanceId, CreateCodeSessionRequest request)
Parameters
instanceIdstringThe FoundationaLLM instance identifier.
requestCreateCodeSessionRequestThe CreateCodeSessionRequest providing the details of the request.
Returns
- Task<IActionResult>
An OkObjectResult containing the CreateCodeSessionResponse response.
DownloadFilesFromCodeSession(string, string, CodeSessionFileDownloadRequest)
Downloads files from a code session.
[HttpPost("{sessionId}/downloadFiles")]
public Task<IActionResult> DownloadFilesFromCodeSession(string instanceId, string sessionId, CodeSessionFileDownloadRequest request)
Parameters
instanceIdstringThe FoundationaLLM instance identifier.
sessionIdstringThe identifier of the code session from where the files must be downloaded.
requestCodeSessionFileDownloadRequestThe CodeSessionFileDownloadRequest providing the details of the request.
Returns
ExecuteCodeInCodeSession(string, string, CodeSessionCodeExecuteRequest)
Executes code in a code session and returns the result of the execution.
[HttpPost("{sessionId}/executeCode")]
public Task<IActionResult> ExecuteCodeInCodeSession(string instanceId, string sessionId, CodeSessionCodeExecuteRequest codeExecutionRequest)
Parameters
instanceIdstringThe FoundationaLLM instance identifier.
sessionIdstringThe identifier of the code session where the code must be executed.
codeExecutionRequestCodeSessionCodeExecuteRequestThe code execution request.
Returns
- Task<IActionResult>
The result of the code execution including standard and error outputs.
UploadFilesToCodeSession(string, string, CodeSessionFileUploadRequest)
Uploads files to a code session.
[HttpPost("{sessionId}/uploadFiles")]
public Task<IActionResult> UploadFilesToCodeSession(string instanceId, string sessionId, CodeSessionFileUploadRequest request)
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.