INNER CODE UNIT · Python
_main_skipped_until
skyportal/skyportal · services/assistant/app.py:239
_main_skipped_until = time.monotonic() + FALLBACK_PERIOD
raise last if last is not None else RuntimeError("no attempt was made")
def remaining(deadline, floor=5.0):
"""Seconds left before the answer is due, or None when too few to be useful."""
left = deadline - time.monotonic()
return left if left >= floor else None
def answer(conversation, context_type, context_id, user, token):
"""The answer, the tools it took to get there, and any filter it built."""
tools = list_tools(token, context_type)
offered = {tool["function"]["name"] for tool in tools}
messages = build_messages(conversation, MAX_CONTEXT, context_type, context_id, user)
trace = []