TTickFable
Product

Product features · Strict duration tokens

01

Keep the accepted token grammar beside the millisecond cap and review leading zeros, whitespace and unit spelling at the parser boundary.

01

Connection

Base URL, credentials and a reachable server.

02

Selection

A model available through the configured endpoint.

03

Capabilities

Context limits and tool support are determined by the model and server.

Strict duration tokens

● ● ●TickFable●
A concrete starting point · Strict duration tokens ×
import re

def duration_ms(text):
    if not isinstance(text, str):
        raise ValueError("duration.text")
    match = re.fullmatch(r"(0|[1-9][0-9]{0,8})(ms|s|m|h)", text)
    if not match:
        raise ValueError("duration.syntax")
    result = int(match[1]) * {"ms": 1, "s": 1000, "m": 60000, "h": 3600000}[match[2]]
    if result > 86400000:
        raise ValueError("duration.range")
    return result
✳Parse an ASCII integer followed by ms, s, m or h into milliseconds capped at one day.
✓ ChangesReview before applying ↗
Illustrative workspace
AI coding workspace

Your next change starts here.

Get the Windows app ↗