Table of Contents

Interface IAzureCosmosDBFileService

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

Defines the interface for the Azure Cosmos DB service that services the Context API File service.

public interface IAzureCosmosDBFileService
Extension Methods

Methods

DeleteFileRecord(string, string, string)

Deletes the file record for a specified file identifier.

Task DeleteFileRecord(string instanceId, string fileId, string userPrincipalName)

Parameters

instanceId string

The FoundationaLLM instance identifier.

fileId string

The idenfier of the file.

userPrincipalName string

The user principal name of the user associated with the file record.

Returns

Task

Remarks

Bypassing owner check cannot be performed here as we need the partition key (which is the UPN) to perform the delete operation.

FileRecordExists(string, string, string)

Determines whether a file record exists for the specified file and user.

Task<bool> FileRecordExists(string instanceId, string fileId, string userPrincipalName)

Parameters

instanceId string

The FoundationaLLM instance identifier.

fileId string

The unique identifier of the file to check for existence. Cannot be null or empty.

userPrincipalName string

The user principal name associated with the file record. Cannot be null or empty.

Returns

Task<bool>

A task that represents the asynchronous operation. The task result is true if the file record exists for the specified user and instance; otherwise, false.

GetFileRecord(string, string, string, bool)

Gets the file record for a specified file identifier.

Task<ContextFileRecord> GetFileRecord(string instanceId, string fileId, string userPrincipalName, bool bypassOwnerCheck)

Parameters

instanceId string

The FoundationaLLM instance identifier.

fileId string

The idenfier of the file.

userPrincipalName string

The user principal name of the user associated with the file record.

bypassOwnerCheck bool

Indicates whether to bypass the owner check for the file record.

Returns

Task<ContextFileRecord>

GetFileRecords(string, string, string, string, bool)

Gets the file records matching the specified criteria.

Task<List<ContextFileRecord>> GetFileRecords(string instanceId, string conversationId, string fileName, string userPrincipalName, bool bypassOwnerCheck)

Parameters

instanceId string

The FoundationaLLM instance identifier.

conversationId string

The idenfier of the conversation to which the file is associated.

fileName string

The name of the file.

userPrincipalName string

The user principal name of the user associated with the file record.

bypassOwnerCheck bool

Indicates whether to bypass the owner check for the file records.

Returns

Task<List<ContextFileRecord>>

UpsertFileRecord(ContextFileRecord)

Upserts a file record in the Azure Cosmos DB.

Task UpsertFileRecord(ContextFileRecord fileRecord)

Parameters

fileRecord ContextFileRecord

The file record to be upserted.

Returns

Task