needle / scripts /workflow_cpu_app.py
Leon4gr45's picture
Upload folder using huggingface_hub (part 2)
25a2c1c verified
Raw History Blame Contribute Delete
734 Bytes
"""Qualification-only fixed SDK date fact; never a production entrypoint.
Needle 3.0.1 otherwise adds a wall-clock minute on agent construction. This
matches its documented default date prefix at one preregistered instant, using
the ordinary system parameter; no SDK/model/flags/thresholds are modified.
"""
import re
import gateway
DATE_FACT='date: 2026-10-17 Sat 00:00'
original_build=gateway._build_agent
def fixed_date_build(tools,system):
text=system or ''
if 'date:' not in text and not re.search(r'\d{4}-\d{2}-\d{2}',text) and not text.lstrip().startswith('{'):
text=DATE_FACT+('; '+text if text.strip() else '')
return original_build(tools,text)
gateway._build_agent=fixed_date_build
app=gateway.app