camel icon indicating copy to clipboard operation
camel copied to clipboard

feat: Refactor OpenAIFunction to FunctionTool

Open tom-doerr opened this issue 1 year ago • 4 comments

Description

I renamed the OpenAIFunction class to FunctionTool and created a new OpenAIFunction class that throws a deprecation warning when initialized.

Motivation and Context

closes #858

  • [x] I have raised an issue to propose this change (required for new features and bug fixes)

Types of changes

What types of changes does your code introduce? Put an x in all the boxes that apply:

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds core functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] Documentation (update in the documentation)
  • [ ] Example (update in the folder of example)

Checklist

Go over all the following points, and put an x in all the boxes that apply. If you are unsure about any of these, don't hesitate to ask. We are here to help!

  • [x] I have read the CONTRIBUTION guide. (required)
  • [x] My change requires a change to the documentation.
  • [x] I have updated the tests accordingly. (required for a bug fix or a new feature)
  • [x] I have updated the documentation accordingly.

tom-doerr avatar Sep 15 '24 16:09 tom-doerr

Thanks @tom-doerr ! We updated the way we calling tools few days ago, could you help update this PR with latest master branch and resolve the conflicts? Thanks in advance!

Wendong-Fan avatar Sep 18 '24 10:09 Wendong-Fan

Will finish that today!

tom-doerr avatar Sep 23 '24 16:09 tom-doerr

Update from my side: The merge is more comprehensive than I thought, even after I solved all conflicts the tests don't pass.

 ImportError: cannot import name 'OpenAIFunction' from partially initialized module 'camel.toolkits' (most likely due to a circular import

I will try again tomorrow to fix this. If that doesn't work I would just redo the changes on top of the newest master version.

tom-doerr avatar Sep 29 '24 22:09 tom-doerr

Update from my side: The merge is more comprehensive than I thought, even after I solved all conflicts the tests don't pass.

 ImportError: cannot import name 'OpenAIFunction' from partially initialized module 'camel.toolkits' (most likely due to a circular import

I will try again tomorrow to fix this. If that doesn't work I would just redo the changes on top of the newest master version.

Thanks @tom-doerr ! Take your time and if it's hard to be fixed you can also just push the code, I'd love to support further

Wendong-Fan avatar Sep 30 '24 03:09 Wendong-Fan