Currently it only allows either a text or image response due to how it collects the results from the tool:
https://github.com/anthropics/claude-agent-sdk-python/blob/main/src/claude_agent_sdk/__init__.py#L322
When I want to return JSON now, I have to JSON marshal it, and then return that, causing a lot of extra tokens and also makes it harder to read for the Agent when it goes over the amount of tokens and has to write away the tool results to a file, because everything is written away to a single line in this format.
Currently it only allows either a text or image response due to how it collects the results from the tool:
https://github.com/anthropics/claude-agent-sdk-python/blob/main/src/claude_agent_sdk/__init__.py#L322
When I want to return JSON now, I have to JSON marshal it, and then return that, causing a lot of extra tokens and also makes it harder to read for the Agent when it goes over the amount of tokens and has to write away the tool results to a file, because everything is written away to a single line in this format.