| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…trumentation In get_response_tool_web_search_attributes() and get_response_tool_file_search_attributes(), hasattr() returns True for optional fields set to None, but accessing .__dict__ on None raises AttributeError. Added is not None guard for user_location, filters, and ranking_options fields. Fixes modelcontextprotocol#1285
|
Closing — this adds files under agentops/instrumentation/..., which doesn't exist in this repo. It looks like this PR was intended for a different project. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
In get_response_tool_web_search_attributes() and get_response_tool_file_search_attributes(), hasattr() returns True for optional fields set to None, but accessing .__dict__ on None raises AttributeError.
Fix
Added is not None guard for user_location, filters, and ranking_options fields in agentops/instrumentation/providers/openai/attributes/response.py:
Same pattern applied to filters and ranking_options.
Testing
Added regression tests in tests/unit/instrumentation/providers/openai/test_response_issue_1285.py covering all three None-field cases. All 5 tests pass.
Fixes #1285