agentops icon indicating copy to clipboard operation
agentops copied to clipboard

Fix sse streaming function call error with agentops

Open areibman opened this issue 4 months ago • 3 comments

📥 Pull Request

📘 Description Fixes a TypeError (can only concatenate str (not "NoneType") to str) that occurred when AgentOps instrumented Google ADK run_async calls with streaming_mode="sse" and response_modalities=["TEXT"], and the LLM response included non-text parts (e.g., function calls). The issue was caused by None values from these non-text parts being passed to string concatenation. The fix adds defensive checks to ensure only valid text is processed.

🧪 Testing A new example (agentops/examples/google_adk/sse_text_function_call.py) was created to reproduce the reported scenario. Manual testing was performed by running this example, confirming that the TypeError no longer occurs and that streaming events (including function calls and responses) are processed correctly. Automated tests were not run in the current environment.


Open in Cursor Open in Web

areibman avatar Aug 13 '25 20:08 areibman

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch. Learn more about Cursor Agents

cursor[bot] avatar Aug 13 '25 20:08 cursor[bot]

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests.

:loudspeaker: Thoughts on this report? Let us know!

codecov[bot] avatar Aug 13 '25 20:08 codecov[bot]

This pull request has been automatically marked as stale because it has not had any activity in the last 14 days.

If no updates are made within 7 days, this PR will be automatically closed.

github-actions[bot] avatar Aug 28 '25 00:08 github-actions[bot]