Skip to content

v1.2.0 - Support for chat with functions

Latest
Compare
Choose a tag to compare
@leafo leafo released this 16 Jun 17:06
· 8 commits to main since this release

OpenAI allows sending a list of function declarations that the LLM can decide to call based on the prompt. The function calling interface must be used with chat completions and the gpt-4-0613 or gpt-3.5-turbo-0613 models or later.

This update supports providing a function schema to the initialization of the chat session object.

The function result is then detected when parsing the response from a chat message.

See https://github.com/leafo/lua-openai/blob/main/examples/example5.lua or the README for a complete example.