time_context
time_context
¶
The user's local time, for grounding prompts in their time zone.
Tools such as mail and calendar servers usually return timestamps in UTC. Telling the model the user's time zone and current local time lets it answer "08:54 UTC" as "10:54" for a user in Cairo.
The zone comes from, in order:
- the request, via the
X-OpenJarvis-Timezoneheader the web UI sends with chat and agent requests (the device's zone, or the one picked in Settings); [system_prompt] timezonein config.toml;- the server machine's local zone.
Scheduled and queued work without a request uses the configured default. One browser's zone is never retained as a process-wide preference.
Functions¶
valid_timezone
¶
Return name if it is a known IANA zone, else None.
Source code in src/openjarvis/prompt/time_context.py
resolve_timezone
¶
Return the zone's IANA name (None for an unnamed local zone) and tzinfo.
Source code in src/openjarvis/prompt/time_context.py
current_time_section
¶
A short prompt section with the user's time zone and local time.