TsgcHTTP_API_Anthropic › 메서드 › DeleteFile
Anthropic Files API에서 이전에 업로드된 파일을 삭제합니다
function DeleteFile(const aFileId: string) : TsgcAnthropicClass_Response_File_Deleted;
| Name | Type | 설명 |
|---|---|---|
aFileId | const string | 삭제할 파일의 식별자로, UploadFile 또는 ListFiles가 반환한 것입니다. |
파일 Id와 Deleted 플래그로 삭제를 확인하는 응답입니다(TsgcAnthropicClass_Response_File_Deleted).
Anthropic Files API에 DELETE /v1/files/{file_id} 요청을 보냅니다. 삭제되면 파일 id를 새 메시지에서 더 이상 참조할 수 없지만, 이미 파일 콘텐츠를 포함했던 기존 메시지 기록은 영향을 받지 않습니다. AnthropicOptions의 anthropic-version 헤더가 자동으로 포함됩니다. 반환된 객체는 호출자가 해제해야 합니다.
oResponse := oAPI.DeleteFile('file_01ABCxyz');
try
if oResponse.Deleted then ShowMessage('file removed');
finally
oResponse.Free;
end;