diff --git a/OpenAI-DotNet-Tests/TestFixture_11_Assistants.cs b/OpenAI-DotNet-Tests/TestFixture_11_Assistants.cs index e24fd3fd..1caaaa76 100644 --- a/OpenAI-DotNet-Tests/TestFixture_11_Assistants.cs +++ b/OpenAI-DotNet-Tests/TestFixture_11_Assistants.cs @@ -90,7 +90,9 @@ public async Task Test_04_DeleteAssistantFile() foreach (var file in filesList.Items) { Assert.IsNotNull(file); - var isDeleted = await OpenAIClient.AssistantsEndpoint.DeleteAssistantFileAsync(file); + var isRemoved = await OpenAIClient.AssistantsEndpoint.DeleteAssistantFileAsync(file); + Assert.IsTrue(isRemoved); + var isDeleted = await OpenAIClient.FilesEndpoint.DeleteFileAsync(file); Assert.IsTrue(isDeleted); } diff --git a/OpenAI-DotNet/Assistants/AssistantFile.cs b/OpenAI-DotNet/Assistants/AssistantFile.cs index 9abca6b6..3865b12b 100644 --- a/OpenAI-DotNet/Assistants/AssistantFile.cs +++ b/OpenAI-DotNet/Assistants/AssistantFile.cs @@ -38,5 +38,9 @@ public sealed class AssistantFile : BaseResponse [JsonInclude] [JsonPropertyName("assistant_id")] public string AssistantId { get; private set; } + + public static implicit operator string(AssistantFile file) => file?.ToString(); + + public override string ToString() => Id; } } \ No newline at end of file diff --git a/OpenAI-DotNet/Assistants/AssistantsEndpoint.cs b/OpenAI-DotNet/Assistants/AssistantsEndpoint.cs index 460bc8ed..b3b9c157 100644 --- a/OpenAI-DotNet/Assistants/AssistantsEndpoint.cs +++ b/OpenAI-DotNet/Assistants/AssistantsEndpoint.cs @@ -122,6 +122,11 @@ public async Task RetrieveAssistantFileAsync(string assistantId, /// /// Delete an assistant file. /// + /// + /// Note that deleting an AssistantFile does not delete the original File object, + /// it simply deletes the association between that File and the Assistant. + /// To delete a File, use the File delete endpoint instead. + /// /// . /// Optional, . /// True, if file was deleted. @@ -131,6 +136,11 @@ public async Task DeleteAssistantFileAsync(AssistantFile file, Cancellatio /// /// Delete an assistant file. /// + /// + /// Note that deleting an AssistantFile does not delete the original File object, + /// it simply deletes the association between that File and the Assistant. + /// To delete a File, use the File delete endpoint instead. + /// /// The ID of the assistant that the file belongs to. /// The ID of the file to delete. /// Optional, .