Skip to content

feat: ChatMessage.to_openai_dict_format - add require_tool_call_ids parameter #9481

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 3, 2025

Conversation

anakin87
Copy link
Member

@anakin87 anakin87 commented Jun 3, 2025

Related Issues

Proposed Changes:

  • add require_tool_call_ids parameter to ChatMessage.to_openai_dict_format
    • If True (default), if the id field is missing in a Tool Call, an error is raised.
    • Using False is useful for shallow OpenAI-compatible APIs, where the id field is not
      required.

How did you test it?

CI; new tests

Checklist

  • I have read the contributors guidelines and the code of conduct
  • I have updated the related issue with new insights and changes
  • I added unit tests and updated the docstrings
  • I've used one of the conventional commit types for my PR title: fix:, feat:, build:, chore:, ci:, docs:, style:, refactor:, perf:, test: and added ! in case the PR includes breaking changes.
  • I documented my code
  • I ran pre-commit hooks and fixed any issue

@github-actions github-actions bot added topic:tests type:documentation Improvements on the docs labels Jun 3, 2025
@anakin87 anakin87 marked this pull request as ready for review June 3, 2025 13:06
@anakin87 anakin87 requested review from a team as code owners June 3, 2025 13:06
@anakin87 anakin87 requested review from dfokina and Amnah199 and removed request for a team June 3, 2025 13:06
@anakin87 anakin87 self-assigned this Jun 3, 2025
@anakin87 anakin87 requested review from vblagoje and sjrl and removed request for Amnah199 June 3, 2025 13:06
Copy link
Member

@vblagoje vblagoje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice looks great - 🙏 @anakin87

Copy link
Contributor

@sjrl sjrl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@anakin87 anakin87 merged commit 1e2214a into main Jun 3, 2025
25 checks passed
@anakin87 anakin87 deleted the to_openai_dict_format-tool-calls-id-validation branch June 3, 2025 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic:tests type:documentation Improvements on the docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants