Table of Contents

Interface IFileService

Namespace
FoundationaLLM.Context.Interfaces
Assembly
FoundationaLLM.Context.dll

Defines the service interface for the FoundationaLLM File service.

public interface IFileService
Extension Methods

Methods

CreateFile(string, string, string, string, string, Stream, UnifiedUserIdentity, Dictionary<string, string>?)

Create a new file.

Task<ContextFileRecord> CreateFile(string instanceId, string origin, string conversationId, string fileName, string contentType, Stream content, UnifiedUserIdentity userIdentity, Dictionary<string, string>? metadata = null)

Parameters

instanceId string

The FoundationaLLM instance identifier.

origin string

The origin of the file.

conversationId string

The conversation identifier.

fileName string

The original name of the file.

contentType string

The content type of the file.

content Stream

The Stream providing the raw content of the file.

userIdentity UnifiedUserIdentity

The UnifiedUserIdentity providing details about the user identity.

metadata Dictionary<string, string>

Optional metadata dictionary associated with the file.

Returns

Task<ContextFileRecord>

A ContextFileRecord instance with details about the newly created file.

GetFileContent(string, string, UnifiedUserIdentity)

Get the binary content of a file.

Task<ContextFileContent?> GetFileContent(string instanceId, string fileId, UnifiedUserIdentity userIdentity)

Parameters

instanceId string

The FoundationaLLM instance identifier.

fileId string

The identifier of the file.

userIdentity UnifiedUserIdentity

The UnifiedUserIdentity providing details about the user identity.

Returns

Task<ContextFileContent>

A ContextFileContent instance with the content of the file.

GetFileContent(string, string, string, UnifiedUserIdentity)

Get the binary content of a file.

Task<ContextFileContent?> GetFileContent(string instanceId, string conversationId, string fileName, UnifiedUserIdentity userIdentity)

Parameters

instanceId string

The FoundationaLLM instance identifier.

conversationId string

The conversation identifier.

fileName string

The name of the file to retrieve.

userIdentity UnifiedUserIdentity

The UnifiedUserIdentity providing details about the user identity.

Returns

Task<ContextFileContent>

A ContextFileContent instance with the content of the file.

GetFileRecord(string, string, UnifiedUserIdentity)

Get the file record associated with a file.

Task<ContextFileRecord?> GetFileRecord(string instanceId, string fileId, UnifiedUserIdentity userIdentity)

Parameters

instanceId string

The FoundationaLLM instance identifier.

fileId string

The identifier of the file.

userIdentity UnifiedUserIdentity

The UnifiedUserIdentity providing details about the user identity.

Returns

Task<ContextFileRecord>

A ContextFileRecord with the file record.