Files
grok2api/app/platform/runtime/clock.py
T
ekti123456 65c9e3e544 feat(voice): add custom instructions support for ChatKit Voice
- Add custom_instruction parameter to xai_livekit.py payload builder
- Use 'instructions' + 'is_raw_instructions' fields instead of 'customPersonality'
- Transport layer passes custom_instruction through
- API endpoint accepts 'instruction' query param
- Frontend: add expandable input with popup modal for editing
- CSS: toolbar 520px, 4-column equal width layout, responsive on mobile
2026-04-17 12:45:33 +08:00

24 lines
535 B
Python

"""Monotonic-safe time utilities for hot-path and control-plane use."""
import time
def now_ms() -> int:
"""Return current wall-clock time in milliseconds."""
return int(time.time() * 1000)
def now_s() -> int:
"""Return current wall-clock time in whole seconds."""
return int(time.time())
def ms_to_s(ms: int) -> int:
"""Convert millisecond timestamp to second timestamp."""
return ms // 1000
def s_to_ms(s: int) -> int:
"""Convert second timestamp to millisecond timestamp."""
return s * 1000