🏁/v1/batch/generate-query

Available at https://api.theproductllm.com/v1/batch/filter-search-results

Processes batch query generation for product searches.

This endpoint generates optimized search queries for products. It supports both initial query generation (just product data) and refined query generation (product data with past queries and result sets). Files should contain either all initial OR all refined queries, not mixed.

Required Parameters

  • file: JSONL file upload. Each line must be a valid JSON object with one of the following structures:

Initial Query Format

{
  "product": {
    "title": "string (required)",
    "brand": "string (optional)",
    "code": "string (optional)",
    "description": "string or dict (optional)",
    "id": "string (optional)",
    "price": "string or float (optional)"
  }
}

Refined Query Format (2nd round after initial query generation + search)

{
  "product": {
    "title": "string (required)",
    "brand": "string (optional)",
    "code": "string (optional)",
    "description": "string or dict (optional)",
    "id": "string (optional)",
    "price": "string or float (optional)"
  },
  "past_queries": ["query1", "query2"],
  "result_sets": [
    [
      {"title": "string", "brand": "string"},
      {"title": "string", "brand": "string"}
    ],
    [
      {"title": "string", "brand": "string"}
    ]
  ]
}

Request

Example JSONL Content (Initial Queries)

Example JSONL Content (Refined Queries)

Response

Last updated