Tools

Tabular Data Analysis

Analyze structured tabular data using a natural language query.

post/v1/tools/tabular-data-analysis

Request body

querystring required

The analysis question or prompt related to tabular data.

Example request

{
  "query": "Show average revenue by department over the last 3 quarters.",
  "context_filter": {
    "collection": "collection_name",
    "artifacts": [
      "artifact_id_1, artifact_id_2"
    ],
    "metadata_filter": [
      {
        "key": "file_id",
        "operator": "==",
        "value": "artifact_id_1"
      }
    ]
  }
}

Response

Tabular analysis completed successfully.

is_errorboolean

True if the tool encountered an error during execution.

Example response

{
  "content": [
    {
      "sources": [
        {
          "content_type": "text/plain",
          "document": {
            "artifact": "quarterly_report_q3",
            "doc_metadata": {
              "department": "finance",
              "file_name": "Q3_Financial_Report.pdf",
              "page_number": 5
            },
            "object": "ingest.document"
          },
          "id": "chunk_123e4567-e89b-12d3-a456-426614174000",
          "metadata": {
            "abs_idx": 8,
            "author": "Finance Team",
            "date": "2023-10-15",
            "rel_idx": 3,
            "section": "Revenue Analysis",
            "title": "Q3 Financial Report"
          },
          "next_texts": [
            "The technology sector contributed 60% of total growth.",
            "Marketing expenses remained within budget projections."
          ],
          "object": "context.chunk",
          "previous_texts": [
            "Q3 FINANCIAL SUMMARY",
            "This report covers the third quarter performance metrics."
          ],
          "score": 0.856,
          "text": "Revenue increased by 15% compared to the previous quarter, primarily driven by strong performance in the technology sector."
        }
      ]
    }
  ]
}

Changes