fix: specify type for tool_calls in openai_responses#9530
Conversation
Updated the type annotation for the tool_calls variable to explicitly define it as a list of dictionaries with string keys and Any values, enhancing type safety and clarity in the code.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
|
* take0 * previous response id and streaming fix * add tool calls to streaming responses * integration test * integration test * better response output -- works with sdk * [autofix.ci] apply automated fixes * Refactor logging in integration tests to use loguru for improved clarity and consistency. Replace print statements with appropriate logging levels, enhancing error handling and debugging capabilities. * Refactor `has_chat_input` function to use `any()` for improved readability. Enhance error messaging in `run_flow_for_openai_responses` for clarity. Update response yielding format for better readability. Add noqa comments for linting compliance. * Add comprehensive OpenAI compatibility tests for edge cases and error handling Extend integration test coverage with new test file containing validation for empty inputs, invalid models, tools parameter rejection, timeout scenarios, and concurrent request handling. Update existing integration tests to improve error handling and response validation. * streaming * [autofix.ci] apply automated fixes * format * loguru * [autofix.ci] apply automated fixes * ruff * delta fix * support includes [tool_call.results] in response.output_item.done * [autofix.ci] apply automated fixes * include results non streaming * [autofix.ci] apply automated fixes * support global variable override with http headers via openai response api * [autofix.ci] apply automated fixes * ruff * ruff * ruff * ruff * ruff * refactor: use Depends for telemetry service * [autofix.ci] apply automated fixes * load_dotenv(find_dotenv()) * check for chat output * openai key dummy check * [autofix.ci] apply automated fixes * mypy fix * fix: specify type for tool_calls in openai_responses (#9530) fix: specify type for tool_calls in openai_responses.py Updated the type annotation for the tool_calls variable to explicitly define it as a list of dictionaries with string keys and Any values, enhancing type safety and clarity in the code. Co-authored-by: Sebastián Estévez <estevezsebastian@gmail.com> * import fix * [autofix.ci] apply automated fixes * response_model=None is required becase create_response 3 different types --------- Co-authored-by: phact <estevez.sebastian@gmail.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> Co-authored-by: Edwin Jose <edwin.jose@datastax.com> Co-authored-by: Carlos Coelho <80289056+carlosrcoelho@users.noreply.github.com> Co-authored-by: Jordan Frazier <122494242+jordanrfrazier@users.noreply.github.com>



Updated the type annotation for the tool_calls variable to explicitly define it as a list of dictionaries with string keys and Any values, enhancing type safety and clarity in the code.