Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
General fixes for tool calling
Tool calling was incompatible with the openai api on both the stream and non stream implementation.
Fixes:
Small changes
Fixes the following issues I think:
#2461
#2480
#2864
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Details
Arguments are now strings, as per openai's API
Open AI - non stream
Before - non stream
Now - non stream
Streaming has a particular behaviour for tool calling, I did my best to conform to what the openai api was giving out.
Open AI - stream
Before - stream
Now - stream
Testing
The test I could run seem to still pass ( I don't have a premium hugging face account - yet ;). I adapted the tests that needed to be adapted but I'm not sure how to add test for streaming. I welcome any help I can get on that front.
I did some tests by doing the following:
Other PR
A PR was created before I could make mine. As I went bit further I still wanted to finish mine. Of course I'm open to closing mine, or group our changes.
Review
Not sure who to tag here.
FYI: I'm by no means a rust expert and welcomes criticism/improvements.