Skip to content
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

Support for functions #13

Merged
merged 30 commits into from
Nov 10, 2023
Merged

Support for functions #13

merged 30 commits into from
Nov 10, 2023

Conversation

phayes
Copy link
Contributor

@phayes phayes commented Jul 14, 2023

This PR implements preliminary support for functions.

Not ready for merge yet, but the skeleton is here and ready for feedback.

Everything is fairy straightforward with the exception of JSONSchema. Instead of adding a dependency on the schemars crate and requiring a fully-typed SchemaObject, which is hellish, I simply used serde_json::Value and left it up to the user to either use schemars, or construct something by hand, or deserialize something etc.

I'll add some good documentation to this before this PR is ready to merge.

@phayes phayes marked this pull request as draft July 14, 2023 17:51
@Kodylow
Copy link
Contributor

Kodylow commented Nov 8, 2023

Is this ready for testing/review @phayes ? Got a couple function-y things I'm trying to do haha

@phayes
Copy link
Contributor Author

phayes commented Nov 8, 2023

Hi @Kodylow ,

Yes! Although I snuck a bunch of other changes in here as well. Let me know if you'd like me to split it into a bunch of different PRs.

The only thing missing is documentation.

@phayes phayes marked this pull request as ready for review November 8, 2023 17:32
@phayes
Copy link
Contributor Author

phayes commented Nov 8, 2023

I've marked this ready for review:

  1. Function calling works with both standard API and streaming API
  2. To aid in debugging function calls (which is often needed), I've added an optional dependency on the "log" crate and added some debugging log points.
  3. I've documented calling functions in lib.rs for both the regular API and the streaming API.
  4. I've added better handing of stream errors (needed to have visibility into errors in calling function when streaming)

@phayes
Copy link
Contributor Author

phayes commented Nov 9, 2023

My apologies, as I did some final testing I ran into a bunch of small issues that are now fixed. I've also added calling_function and calling_function_stream to the examples directory. I've also impl'ed Default for ChatMessage

I don't intend on making any more changes now. Please review!

@tjardoo tjardoo self-requested a review November 9, 2023 20:00
@tjardoo tjardoo merged commit 7ec05da into tjardoo:master Nov 10, 2023
1 check passed
@Kodylow
Copy link
Contributor

Kodylow commented Nov 10, 2023

🥳

@tjardoo tjardoo linked an issue Nov 13, 2023 that may be closed by this pull request
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.

Adding support for functions
3 participants