Suggest a title and description

SDK platic.files.suggestMetadata()

Ask AI to suggest a title and description from the file’s content. Send its fileId; if you want to use the suggestion, save it with Update a file. This request saves no changes.

Example

await platic.files.suggestMetadata("file_123");

Path parameters

ParameterTypeDescriptionRequired
fileIdstringThe file✓

Request body

Optional. Without a body, it suggests both:

{ "fields": ["title", "description"] }
FieldTypeDescriptionDefault
fieldsarrayWhat to suggest: title, description or both.Both

Response

{
  "status": "success",
  "data": {
    "title": "Returns and refunds policy",
    "description": "Deadlines to return a product, conditions, exceptions and how the refund is made. Consult it when the customer wants to return or exchange something."
  }
}

Response fields

FieldTypeDescription
titlestringSuggested title, up to 200 characters.
descriptionstringSuggested description, up to 1024 characters.

The suggestion comes in the language of the content (Spanish if it is not clear).

Errors

Statusdetails.codeWhen
403RESOURCE_NOT_ACCESSIBLEYou do not have Integrations nor can you edit all the agents that use it.
409FILE_NOT_READYThe file does not have content ready yet.
410FILE_DELETEDThe file was already deleted.
503INTERNAL_ERRORThe model did not answer. Try again.

The ones that apply to all operations are in common errors.

Notes

  • You do not need to ask for it when creating: if you create a file without a title or without a description, Platica generates them by itself when the content is ready (see automatic names).
  • It requires the same permission as Get a file.