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
codeSessionService
ICodeSessionServiceThe ICodeSessionService providing code sessions services.
callContext
IOrchestrationContextThe IOrchestrationContext call context associated with the current request.
logger
ILogger<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
instanceId
stringThe FoundationaLLM instance identifier.
request
CreateCodeSessionRequestThe 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
instanceId
stringThe FoundationaLLM instance identifier.
sessionId
stringThe identifier of the code session from where the files must be downloaded.
request
CodeSessionFileDownloadRequestThe 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
instanceId
stringThe FoundationaLLM instance identifier.
sessionId
stringThe identifier of the code session where the code must be executed.
codeExecutionRequest
CodeSessionCodeExecuteRequestThe 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
instanceId
stringThe FoundationaLLM instance identifier.
sessionId
stringThe identifier of the code session where the files must be uploaded.
request
CodeSessionFileUploadRequestThe CodeSessionFileUploadRequest providing the details of the request.