Class FilesController
- Namespace
- FoundationaLLM.Core.API.Controllers
- Assembly
- FoundationaLLM.Core.API.dll
Provides methods for retrieving and managing files.
[Authorize(AuthenticationSchemes = "Bearer", Policy = "MicrosoftEntraIDStandard")]
[Authorize(AuthenticationSchemes = "AgentAccessToken", Policy = "FoundationaLLMAgentAccessToken")]
[ApiController]
[Route("instances/{instanceId}/[controller]")]
public class FilesController : ControllerBase
- Inheritance
-
FilesController
- Inherited Members
- Extension Methods
Constructors
FilesController(IOrchestrationContext, IOptions<InstanceSettings>, ICoreService, ILogger<FilesController>)
The controller for managing files.
public FilesController(IOrchestrationContext callContext, IOptions<InstanceSettings> instanceOptions, ICoreService coreService, ILogger<FilesController> logger)
Parameters
callContextIOrchestrationContextThe IOrchestrationContext call context of the request being handled.
instanceOptionsIOptions<InstanceSettings>The options providing the InstanceSettings with instance settings.
coreServiceICoreServiceThe ICoreService core service.
loggerILogger<FilesController>
Exceptions
Methods
Delete(string, List<string>)
Deletes the specified file(s).
[HttpPost("delete")]
public Task<IActionResult> Delete(string instanceId, List<string> resourcePaths)
Parameters
instanceIdstringThe instance ID.
resourcePathsList<string>The list of object identifiers to be deleted.
Returns
Download(string, string, string)
Downloads a file.
[HttpGet("{fileProvider}/{fileId}")]
public Task<IActionResult> Download(string instanceId, string fileProvider, string fileId)
Parameters
instanceIdstringThe instance ID.
fileProviderstringThe name of the file provider.
fileIdstringThe identifier of the file.
Returns
- Task<IActionResult>
The file content.
Remarks
The following file providers are supported:
- FoundationaLLM.Attachments
- FoundationaLLM.AzureOpenAI
Upload(string, string, string, IFormFile)
Uploads an attachment.
[HttpPost("upload")]
public Task<IActionResult> Upload(string instanceId, string sessionId, string agentName, IFormFile file)
Parameters
instanceIdstringThe instance ID.
sessionIdstringThe session ID from which the file is uploaded.
agentNamestringThe agent name.
fileIFormFileThe file sent with the HTTP request.