Skip to main content

Include Current Date

Provide the LLM with today's date so that date-relative calculations in your extractions produce correct results.

Overview

LLMs do not inherently know the current date. If your extraction prompt or schema relies on date-dependent logic — for example computing the age of a vehicle, the remaining term of a contract, or how many days until an expiry date — the model may hallucinate or return inaccurate values.

Setting includeCurrentDate: true injects a short message containing today's date (ISO 8601 format) into the LLM conversation, giving the model the context it needs.

When to Use

  • Age / duration calculations: "How old is this vehicle?" or "Years since manufacture"
  • Relative date references: "Is this contract still valid?" or "Days until expiry"
  • Depreciation or tax formulas: Anything that compares a document date to "today"

If your extraction does not involve date arithmetic, you can leave the flag off (the default).

Enabling Include Current Date

from docudevs.docudevs_client import DocuDevsClient
import os

client = DocuDevsClient(token=os.getenv("API_KEY"))

job_guid = await client.submit_and_process_document(
document=document_bytes,
document_mime_type="application/pdf",
prompt="Extract vehicle registration details including vehicle age in years",
schema=schema_json,
include_current_date=True,
)

result = await client.wait_until_ready(job_guid)

The parameter is also available on map-reduce methods:

job_guid = await client.submit_and_process_document_map_reduce(
document=document_bytes,
document_mime_type="application/pdf",
prompt="Extract line items with remaining warranty days",
schema=schema_json,
pages_per_chunk=2,
include_current_date=True,
)

How It Works

When includeCurrentDate is true, the system adds a message to the LLM conversation before the document content:

Current date: 2025-07-17

The date is always in ISO 8601 format (YYYY-MM-DD) and represents the server's current date at the time the extraction runs.

Notes

  • The flag defaults to false — existing requests are unaffected.
  • Works with all extraction modes: SIMPLE, STEPS, and map-reduce.
  • When used with map-reduce, every chunk receives the current date.
  • The date is injected once per LLM call; it does not add significant token overhead.