Repository navigation
Release 0.4.0
🎉 Support for function calling syntax, typehinted with Pydantic
gpt-3.5-turbo-0613 and gpt-4-0613 were fine-tuned to support a specific syntax for function calls. This release adds support for these function calls, alongside typehinted support for their input arguments.
This PR is slightly backwards incompatible with 0.3.0. Instead of expanding the tuple list that is returned by gpt_json.run(), we migrate to a RunResponse object. This object will return the JSON object, fix transformations, and now the functions that were parsed from the response payload. If there was a failure in parsing, all the fields will be None. This saves users from having to independently parse the different response types.
Migrations should be straightforward.
# old syntax
response, _ = await gpt_json.run(...)
print(response)
# new syntax
payload = await gpt_json.run(...)
print(payload.response)We also now require Pydantic V2. If you want to continue to use Pydantic V1, lock your version to the 0.3.x minor version.