Skip to content

Conversation

aniketmaurya
Copy link
Collaborator

Before submitting
  • Was this discussed/agreed via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure to update the docs?
  • Did you write any new necessary tests?

What does this PR do?

This PR will make sure to use the standard official OpenAI tool-use structure and boost compatibility with other APIs.

  • Update LitTool schema structure to include function type and nested function details as per standard OpenAI format.
  • Updated the as_tool method in LitTool to return a schema with a "type" field and a nested "function" object containing name, description, and parameters.
  • Modified corresponding unit tests to validate the new schema structure for various tools, ensuring compatibility with the updated format.

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in GitHub issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃

… function details

- Updated the `as_tool` method in `LitTool` to return a schema with a "type" field and a nested "function" object containing name, description, and parameters.
- Modified corresponding unit tests to validate the new schema structure for various tools, ensuring compatibility with the updated format.
Copy link

codecov bot commented Aug 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88%. Comparing base (d74c924) to head (d39d15e).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@        Coverage Diff         @@
##           main   #29   +/-   ##
==================================
  Coverage    88%   88%           
==================================
  Files         6     6           
  Lines       378   378           
==================================
  Hits        333   333           
  Misses       45    45           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@aniketmaurya aniketmaurya merged commit 7781212 into main Aug 1, 2025
31 checks passed
@aniketmaurya aniketmaurya deleted the openai-function-format branch August 1, 2025 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants