Skip to main content

Files and uploads from an agent

Before Talonic can read a document, the file has to reach it. This page shows the four ways an agent can do that, which one to use, and what to tell the user while a file is on its way.

Pick a way

  • Already in the workspace. Use its document_id. If the user names the file, find the id with talonic_search (search by file name or one keyword). Free and instant.
  • On a public URL. Pass file_url (https). Talonic fetches it. Good for links the user pastes.
  • On the user's machine, in a local install. Pass file_path; the local server reads the file. Small files can also go as file_data (base64) with filename.
  • Anything else, especially in Claude.ai or ChatGPT. Call talonic_request_upload and give the user the link. They open it in their browser and drop the file.
Hosted chat clients cap the size of a tool call (around 32 KB), which is smaller than most real documents. A file sent as file_data there arrives cut short and comes back with empty fields. Use an upload link instead.
  1. The agent calls talonic_request_upload with the filename. Pass account to file it under one company, and add_to_workspace: true if the user will ask questions about it later (otherwise only its text is kept for the next extraction).
  2. It returns upload_url, a document_id reserved for the file, and expires_at. The agent shows the user the link and says when it expires.
  3. The user opens the link and drops the file. The agent checks talonic_get_document every few seconds.
  4. When status is completed (or extracted without add_to_workspace), the file is ready: extract fields, read its text, or ask about it.

Status while a file is on its way

ParameterTypeDescription
pending_uploadwaitingLink issued; the user has not dropped the file yet.
uploadingin progressThe file is arriving. Keep checking.
queued / extractingin progressTalonic is reading the file.
extractedreadyText is ready (uploads without `add_to_workspace`).
completedreadyFully processed and searchable.
ocr_failed / extraction_failed / errorfailedStop checking and tell the user; the file could not be read. A clearer scan or the original file usually works.

What files work

PDFs (text or scanned), images and phone photos, Word documents (DOCX) and emails. Long documents take longer; very large files are better sent as an upload link or a URL than as bytes.

Keeping companies apart

If the workspace holds documents for several companies (clients, portfolio companies, entities), pass account when uploading. Questions scoped to that account never mix in another company's files. talonic_list_accounts lists them; talonic_create_account adds one.

Cost

Issuing a link and checking status are free. Reading a new file uses credits, as in the web app; talonic_get_pricing shows the rates.

Frequently asked questions

Why does my agent ask me to open a link instead of reading the file I attached?+
Hosted chat clients limit how much data one tool call can carry, so an attached document would arrive incomplete. The upload link sends the whole file straight from your browser to your workspace.
How long is an upload link valid?+
Until the expires_at time returned with it. If it expires, ask the agent for a new link; nothing is lost.