INNER CODE UNIT · Python
answer_from_facts
skyportal/skyportal · services/assistant/app.py:304
def answer_from_facts(obj_id, analysis_id, token):
"""A FLARE triage the model only interprets, or None when the analysis is not one."""
trace = []
def read(name, **arguments):
try:
result = call_tool(token, name, arguments, {name})
value, ok = json.loads(result), True
except Exception as exc:
result, value, ok = f"tool {name} failed: {exc}", None, False
trace.append(record_call(name, arguments, result, ok))
return value
flare = flare_result(read("get_analysis", analysis_id=analysis_id))
if flare is None:
return None
source = read("get_sources", obj_id=obj_id) or {}
catalogs = None