The Context Engine Studio is now open source.  View on GitHub →
Ingest

Ingest files

Technical preview

Submits PDF, TIFF, JPEG or PNG files as multipart/form-data, one files part per file. Text is extracted page by page before the response is returned.

The response is a receipt: ingestion continues after it is returned, so poll the ingestion to follow it. intake comes back index-aligned with the files you sent. If text extraction fails or runs past its deadline, the request is rejected and nothing is stored.

Usage

javascript
import { ContextEngineClient } from "@clinia/context-engine-js";

// Initialize the client
const client = new ContextEngineClient({
  baseUrl: process.env.CLINIA_WORKSPACE,
  auth: {
    clientId: process.env.CLINIA_CLIENT_ID,
    clientSecret: process.env.CLINIA_CLIENT_SECRET,
  },
});

// Call the API, with the request body the API reference documents
const { data, error } = await client.ingest.ingestFiles("<patient-id>", { files: [file1, file2] });

// Print the response
console.log(data ?? error);

The environment variables are set in Install and authenticate, for JavaScript or Python.

API reference

POST /v1/patients/{patientId}/ingestions/files documents the parameters, the request body and the responses.

On this page