Resolve Model Output • AI Agent SDK

resolve_model_output: Return a tool result's own compact, model-facing view, or “None“.

resolve_model_output

Function

</div>

This function is defined in the base module.

Return a tool result’s own compact, model-facing view, or `None`.

This reads `result.model_output (e.g. a ToolResult that carries its own compact view). It does not invoke any to_model_output()` hook on the producing tool; the executor resolves that hook separately after this result-carried view misses.

`None` means “no compact view carried on the result”; callers then fall back to today’s full stringification, so behaviour is unchanged for tools that opt out.

Signature

python
def resolve_model_output(result: Any) -> Optional[Any]

Parameters

ParamField Any

No description available.

Returns

ResponseField Optional[Any]

The result of the operation.

Source

View on GitHub

praisonaiagents/tools/base.py at line 112


Related Documentation