Assets

Assets can be just about anything, from PDFs to Excel spreadsheets to audio files. These are the unstructured entities Trellis will transform with individual operations.

Assets are referenced with their asset_id. All assets must belong to a project.

Upload

To upload assets:

  1. You will first need a proj_id (see Create Project).

  2. Create pre-signed URLs to securely upload your files.

  3. Upload files from the pre-signed URLs to a project in Trellis, to be processed later.

Extraction

To extract information from assets:

  1. You will first need a proj_id (see Create Project) and a list of asset_id’s (see above).

  2. Create a request to extract information from your assets into markdown.

  3. Fetch the extracted markdown for each asset_id.

Events

Create event subscriptions to run actions like extraction, transformation and even sending webhooks. When an event subscription is triggered, a set action will execute.

  1. Locate the triggering project (proj_id) or transformation (transform_id).

  2. Specify the trigger event (one of asset_extracted, asset_uploaded, transform_completed)

  3. Specify the actions to run (one of refresh_transform, run_extraction, send_webhook)

  4. Specify the triggered project (project_id) or transformation (transform_id) for each action.

If you want to trigger a webhook on a specific event, you must create a webhook first.

Operations

An operation is a step that Trellis takes to process your assets. Examples include extracting information, classification, and generating new data. These operations can stack on each other, but they will eventually derive from the source content in the assets.

Projects

Projects are simply a group of related transformations. While transformations each contain their own assets, you can also upload assets to the entire project, which will propagate the assets to every transformation.

Creating a project is very easy - all you need is a name. Then, you can hit the Create Project endpoint. Make sure to store the proj_id for future API requests (or call the Get Projects endpoint).

Transformations

Transformations group together the assets, operations, and processed data into a single entity. You can define a transformation by specifying a list of operations, as well as a model and an extraction mode. Read our transformation guide for more details.

  1. Specify your transformation parameters.

    1. Model: one of trellis-scale, trellis-premium or trellis-vertix

    2. Mode: one of document or table

    3. Operations: A list of objects. Each must contain:

      1. A column_name

      2. A column_type (one of text, integer, numeric, boolean, list, object, string, number, time, date, text[], jsonb )

      3. A task_description

      4. A transform_type (one of extraction, classification, generation, manual, api_request)

      5. For the full list (including optional params) see body.transform_params.operations

    4. Table Preferences: If table mode is selected, you can specify the table names for table transformations. Must include:

      1. advanced_reasoning: Boolean

      2. included_table_names: Specifies the names to be included for table transformations.

  2. Find the proj_id of the project to add the transformation to (Get Projects)

  3. Specify a transform_name and create the transformation. Make sure to store the transform_id.

Once you create a transformation, if you haven’t already, you should upload assets to the project containing the transformation. Then, you can refresh (run) the transformation with the transform_id.

Webhooks

Creating a webhook helps Trellis communicate with your server in real time. Together with event subscriptions, you can get notified of important events, like when your transformations finish running!

All you need is a URL to your server and an authentication key (optional) to create a webhook. The webhook_id is useful to link with event subscriptions. See here for a full example.