delete_ai_chat_file¶
- ArtificialIntelligenceApi.delete_ai_chat_file(role_id, file_name, chat_id=None, project_id=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Delete a file
Deletes one file from S3 and the Files list. file_name is required. chat_id defaults to the user’s global files (use global). project_id (not N/A) deletes from project files instead. Chat/global delete requires owner access. No request body.
- Parameters:
role_id (str) – Amorphic role ID of the requesting user. Must be a role the authenticated user belongs to. (required)
file_name (str) – Name of the file to delete. (required)
chat_id (str) – Chat to delete from. Defaults to global-files-{user_id}. Use global for the same. Ignored when project_id is set.
project_id (str) – When set and not N/A, deletes from that project’s files instead of a chat.
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
- Returns:
Returns the result object.
Request and Response Examples¶
HTTP: DELETE /ai/playground/files
Parameter examples¶
Name |
In |
Example |
|---|---|---|
|
header |
|
|
query |
|
|
query |
|
|
query |
|
Success (HTTP 200)¶
File removed from storage and metadata.
Request / response example
{
"Message": "File deleted successfully"
}
Errors¶
Documented error codes: IPV-1001, IPV-1002, AUTH-1012, AUTH-1001, AUTH-1011, GE-1008, DB-1002.
HTTP 400
Input validation or authorization failure. Body is {“Message”: “<CODE> - <text>”}. Codes: IPV-1001 (missing file_name), IPV-1002 (file/chat not found), AUTH-1012 (not owner), AUTH-1001 (missing role_id), AUTH-1011 (caller not authorized).
Missing role_id header
{
"Message": "AUTH-1001 - Missing role information in event header"
}
Caller not authorized
{
"Message": "AUTH-1011 - User does not have sufficient permission to perform this action"
}
HTTP 500
Backend failure. Body is {“Message”: “<CODE> - <text>”}. Codes: GE-1008 (unexpected backend failure), DB-1002 (persistence failure).
Unexpected backend failure
{
"Message": "GE-1008 - Could not complete the request. Please try again."
}