lucgagan / completions

Node.js SDK for interacting with OpenAI Chat API.
https://ray.run/
MIT License
45 stars 8 forks source link

Add support for functions #2

Closed floomby closed 1 year ago

floomby commented 1 year ago

Add support for functions in chat endpoint. See: https://platform.openai.com/docs/guides/gpt/function-calling

I marked this draft, because in the zod schema for specifying function parameters there is a z.any() which is not ideal. I need to find the official documentation for what is allowed here to understand exactly what this schema should be. Additionally while I did add a test for it I did nothing in regards of documentation in the readme or anything.

floomby commented 1 year ago

I is still lacking validation schema for the parameter schema, but it is usable as is. I do intend to come back and fix this. It appears that it is just json schema, but a cursory search did not render a zod schema that validates if a json schema is valid.

lucgagan commented 1 year ago

This is great! The nitpicks can be addressed in follow up

floomby commented 1 year ago

Yeah, I should have put it as dev.

github-actions[bot] commented 1 year ago

:tada: This PR is included in version 1.4.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: