PhoenixKitAgent.Attachments.Bounds (PhoenixKitAgent v0.1.0)

Copy Markdown View Source

The technical bounds of attachment processing (spec §9): how much of a file the model is given and how long the work may take. They are not settings of the module; a host or a test may override them with config :phoenix_kit_agent, attachment_limits: [text_chars: …].

KeyDefaultMeaning
text_chars16_000characters of one attachment's text (a PDF, a text file, a sheet, a description); in a message the attachments share agent_history_chars between them, so each gets at most that divided by their number
sheet_rows200rows of each sheet or of a CSV file
sheets10sheets of one workbook
sheet_unzipped_bytes40_000_000what a workbook may unpack to. Its parts are held in memory, and read a second time by the sheet reader: a job of this size takes up to about twice as much (80 MB) of binary memory outside the worker's heap limit
pdf_text_pages50pages whose text is read
scan_pages3pages of a scan that become pictures
min_pdf_text_chars20below this a PDF has no text, it is a scan
process_deadline_ms120_000the whole processing of one attachment
tool_timeout_s60one run of pdftotext, pdftoppm or ImageMagick
worker_heap_words32_000_000the heap of one worker, in words of 8 bytes (256 MB); over it the worker is killed and the file is too_large
concurrent_jobs8files processed at the same time on the node; the others wait (Attachments.Slots). The memory ceiling of a node is this times the largest job: with workbooks, about 8 × 80 MB of binaries
jobs_per_user3of those, how many one user's files may take; the rest of theirs wait
queue_wait_ms30_000how long a file waits for a place; then it is unavailable
queued_jobs64files waiting for a place on the node; more are unavailable at once
unsent_files20files of one user that wait for a message (any status, a failed one included)

A picture is shrunk to image_px/0 (1600) on its long side.

Summary

Functions

The value of key (see the moduledoc).

The longest side a picture sent to a model may have, in pixels.

Functions

get(key)

@spec get(atom()) :: non_neg_integer()

The value of key (see the moduledoc).

image_px()

@spec image_px() :: pos_integer()

The longest side a picture sent to a model may have, in pixels.