fix(vision): NaN/inf/bool di uno strumento non diventano più una quota (#16)
runner.run_graph esclude bool e NaN/inf dagli output numerici, con il motivo in RunOutcome.invalid_outputs. vision_service tratta una quota mappata con valore None/assente/non finito come "non prodotta" (422), invece di arrivare a float(None) e sollevare TypeError. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -48,6 +48,9 @@ async def run(
|
||||
) from exc
|
||||
|
||||
return {
|
||||
# `outcome.outputs` never carries NaN/inf/bool (see runner.run_graph):
|
||||
# a JSON encoder that accepts non-finite floats (Python's stdlib json
|
||||
# does, by default) must never get the chance to emit them here.
|
||||
"outputs": outcome.outputs,
|
||||
"failures": [
|
||||
{"tool_id": f.tool_id, "tool_name": f.tool_name, "error": f.error}
|
||||
@@ -55,4 +58,5 @@ async def run(
|
||||
],
|
||||
"engine_version": outcome.engine_version,
|
||||
"duration_ms": outcome.duration_ms,
|
||||
"invalid_outputs": outcome.invalid_outputs,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user