Skip to content

fix: specify type for tool_calls in openai_responses#9530

Merged
phact merged 2 commits into
openai-compatibilityfrom
fix-open-ai-compatibility
Aug 26, 2025
Merged

fix: specify type for tool_calls in openai_responses#9530
phact merged 2 commits into
openai-compatibilityfrom
fix-open-ai-compatibility

Conversation

@edwinjosechittilappilly
Copy link
Copy Markdown
Collaborator

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.

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.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Aug 25, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-open-ai-compatibility

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@edwinjosechittilappilly edwinjosechittilappilly changed the title fix: specify type for tool_calls in openai_responses.py fix: specify type for tool_calls in openai_responses Aug 25, 2025
@github-actions github-actions Bot added the bug Something isn't working label Aug 25, 2025
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Aug 25, 2025
@github-actions github-actions Bot added the lgtm This PR has been approved by a maintainer label Aug 26, 2025
@phact phact merged commit e3b77b1 into openai-compatibility Aug 26, 2025
8 of 9 checks passed
@phact phact deleted the fix-open-ai-compatibility branch August 26, 2025 13:57
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Aug 26, 2025
@sonarqubecloud
Copy link
Copy Markdown

jordanrfrazier added a commit that referenced this pull request Aug 27, 2025
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working lgtm This PR has been approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants