Interface IFileService
- Namespace
- FoundationaLLM.Context.Interfaces
- Assembly
- FoundationaLLM.ContextEngine.dll
Defines the service interface for the FoundationaLLM File service.
public interface IFileService
- Extension Methods
Methods
CreateFileForAgent(string, string, string, string, string, Stream, UnifiedUserIdentity, Dictionary<string, string>?)
Create a new file.
Task<Result<ContextFileRecord>> CreateFileForAgent(string instanceId, string origin, string agentName, string fileName, string contentType, Stream content, UnifiedUserIdentity userIdentity, Dictionary<string, string>? metadata = null)
Parameters
instanceIdstringThe FoundationaLLM instance identifier.
originstringThe origin of the file.
agentNamestringThe name of the agent.
fileNamestringThe original name of the file.
contentTypestringThe content type of the file.
contentStreamThe Stream providing the raw content of the file.
userIdentityUnifiedUserIdentityThe UnifiedUserIdentity providing details about the user identity.
metadataDictionary<string, string>Optional metadata dictionary associated with the file.
Returns
- Task<Result<ContextFileRecord>>
A Task producing a Result<T> whose value is a ContextFileRecord describing the newly created file when successful; otherwise a failed result containing a domain error.
CreateFileForConversation(string, string, string?, string, string, string, Stream, UnifiedUserIdentity, Dictionary<string, string>?)
Create a new file.
Task<Result<ContextFileRecord>> CreateFileForConversation(string instanceId, string origin, string? agentName, string conversationId, string fileName, string contentType, Stream content, UnifiedUserIdentity userIdentity, Dictionary<string, string>? metadata = null)
Parameters
instanceIdstringThe FoundationaLLM instance identifier.
originstringThe origin of the file.
agentNamestringThe name of the agent.
conversationIdstringThe conversation identifier.
fileNamestringThe original name of the file.
contentTypestringThe content type of the file.
contentStreamThe Stream providing the raw content of the file.
userIdentityUnifiedUserIdentityThe UnifiedUserIdentity providing details about the user identity.
metadataDictionary<string, string>Optional metadata dictionary associated with the file.
Returns
- Task<Result<ContextFileRecord>>
A Task producing a Result<T> whose value is a ContextFileRecord describing the newly created file when successful; otherwise a failed result containing a domain error.
DeleteFileRecord(string, string, UnifiedUserIdentity)
Deletes the file record associated with a file.
Task<Result> DeleteFileRecord(string instanceId, string fileId, UnifiedUserIdentity userIdentity)
Parameters
instanceIdstringThe FoundationaLLM instance identifier.
fileIdstringThe identifier of the file.
userIdentityUnifiedUserIdentityThe UnifiedUserIdentity providing details about the user identity.
Returns
- Task<Result>
A Task producing a Result indicating success when the record is deleted; otherwise a failed result containing a domain error.
GetFileContent(string, string, UnifiedUserIdentity)
Get the binary content of a file.
Task<Result<ContextFileContent>> GetFileContent(string instanceId, string fileId, UnifiedUserIdentity userIdentity)
Parameters
instanceIdstringThe FoundationaLLM instance identifier.
fileIdstringThe identifier of the file.
userIdentityUnifiedUserIdentityThe UnifiedUserIdentity providing details about the user identity.
Returns
- Task<Result<ContextFileContent>>
A Task producing a Result<T> whose value is a ContextFileContent containing the file's binary content when successful; otherwise a failed result containing a domain error.
GetFileContent(string, string, string, UnifiedUserIdentity)
Get the binary content of a file.
Task<Result<ContextFileContent>> GetFileContent(string instanceId, string conversationId, string fileName, UnifiedUserIdentity userIdentity)
Parameters
instanceIdstringThe FoundationaLLM instance identifier.
conversationIdstringThe conversation identifier.
fileNamestringThe name of the file to retrieve.
userIdentityUnifiedUserIdentityThe UnifiedUserIdentity providing details about the user identity.
Returns
- Task<Result<ContextFileContent>>
A Task producing a Result<T> whose value is a ContextFileContent containing the file's binary content when successful; otherwise a failed result containing a domain error.
GetFileRecord(string, string, UnifiedUserIdentity)
Get the file record associated with a file.
Task<Result<ContextFileRecord>> GetFileRecord(string instanceId, string fileId, UnifiedUserIdentity userIdentity)
Parameters
instanceIdstringThe FoundationaLLM instance identifier.
fileIdstringThe identifier of the file.
userIdentityUnifiedUserIdentityThe UnifiedUserIdentity providing details about the user identity.
Returns
- Task<Result<ContextFileRecord>>
A Task producing a Result<T> whose value is a ContextFileRecord representing the file record when successful; otherwise a failed result containing a domain error.