outlines icon indicating copy to clipboard operation
outlines copied to clipboard

Integrate OpenAI functions with Pydantic

Open rlouf opened this issue 2 years ago • 3 comments

What behavior of the library made you think about the improvement?

OpenAI functions are not available via Outlines. However, we could use it for comparison purposes.

How would you like it to behave?

We would like an API that is similar to the current text.generate.json API or the same.

The main constraint with using the same function is that OpenAI’s response is not always parseable JSON. We could implement it in a separate text.generate.openai.json module.

rlouf avatar Nov 15 '23 21:11 rlouf

@rlouf We may need to change the implementation logic here https://github.com/outlines-dev/outlines/blob/main/outlines/generate/json.py#L71 and https://github.com/outlines-dev/outlines/blob/main/outlines/models/openai.py#L253 right?

JerryKwan avatar Jul 18 '24 05:07 JerryKwan

These are the two entry points indeed.

rlouf avatar Jul 18 '24 10:07 rlouf

Thanks for the feedback, I will work on it ASAP

JerryKwan avatar Jul 19 '24 07:07 JerryKwan