Files
gemini-cli/packages/sdk/test-data/tool-error-recovery.json
Michael Bleigh c7866e6a92 feat(sdk): implement runtime hooks support in GeminiCliAgent
- Introduced a new Hook type and hook() helper for strongly-typed SDK hooks.
- Integrated runtime hooks into GeminiCliSession lifecycle (startup, close, and tool execution).
- Added hooks option to GeminiCliAgentOptions.
- Exported executeToolWithHooks from core to facilitate SDK integration.
- Updated SDK_DESIGN.md to reflect implemented features and remaining tasks.
- Added and re-recorded SDK integration tests for hooks.
2026-02-25 13:44:16 -08:00

3 lines
1.0 KiB
JSON

{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"functionCall":{"name":"failVisible","args":{"input":"fail"}}}],"role":"model"},"finishReason":"STOP"}],"usageMetadata":{"promptTokenCount":7073,"candidatesTokenCount":4,"totalTokenCount":7077,"promptTokensDetails":[{"modality":"TEXT","tokenCount":7073}],"candidatesTokensDetails":[{"modality":"TEXT","tokenCount":4}]}}]}
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"text":"The"}],"role":"model"}}],"usageMetadata":{"promptTokenCount":9867,"totalTokenCount":9867,"promptTokensDetails":[{"modality":"TEXT","tokenCount":9867}]}},{"candidates":[{"content":{"parts":[{"text":" tool failed visibly with the error message: \"Error: Tool failed visibly\"."}],"role":"model"},"finishReason":"STOP"}],"usageMetadata":{"promptTokenCount":7085,"candidatesTokenCount":16,"totalTokenCount":7101,"promptTokensDetails":[{"modality":"TEXT","tokenCount":7085}],"candidatesTokensDetails":[{"modality":"TEXT","tokenCount":16}]}}]}