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

Add support for OpenAI functions #373

Closed
wants to merge 2 commits into from
Closed

Conversation

rlouf
Copy link
Member

@rlouf rlouf commented Nov 16, 2023

We would like to integrate OpenAI functions to make it easy to compare guided generation on OSS model with the feature offered by OpenAI. Here are the design requirement:

  • Usage should be very similar to guided generation, and users should be able to change a single line to switch between OpenAI and OSS models. Since OpenAI's function API does not necessarily return valid JSON I am not sure about dispatching outlines.text.generate.json to different functions depending on the model type. This however makes the model switch even easier;
  • When inferring the output format from the function's docstring we should extract the docstring and add it as the model's description since OpenAI uses this information in their prompt;
  • Output format should be the same as with the current outlines.text.generate.json interface: Pydantic model instance when the input format is a Pydantic model, dictionary when it is a function or a JSON schema.

@A-F-V
Copy link

A-F-V commented Jun 18, 2024

@rlouf I am happy to pick this one up if no one else is working on it :)

@rlouf
Copy link
Member Author

rlouf commented Jun 18, 2024

Would be awesome to add an interface to function calling that uses generate.json 😁 Go for it!

@A-F-V
Copy link

A-F-V commented Jun 18, 2024

I would be up for trying it but I can't setup the repo locally on my mac as per this thread: https://discordapp.com/channels/1182316225284554793/1252592587387310080

@A-F-V
Copy link

A-F-V commented Jun 21, 2024

c.r. #989

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integrate OpenAI functions with Pydantic
2 participants