alexrudall / ruby-openai

OpenAI API + Ruby! 🤖❤️
https://insertrobot.com
MIT License
2.8k stars 333 forks source link

Openai's new function calling feature #278

Closed JCSnap closed 1 year ago

JCSnap commented 1 year ago

https://openai.com/blog/function-calling-and-other-api-updates Openai released a new feature which allows us to call functions using the chat completion endpoint. This should be added.

Accept a new argument to the chat parameter to accept function

joshling1919 commented 1 year ago

@JCSnap Was this issue closed because function calling is already supported?

JCSnap commented 1 year ago

@joshling1919 Yep. after reading the source code, I realised that the parameters are arbitrary as whatever parameters you passed will be passed directly to openai's endpoint. The function parameter should work with the current implementation. Remember to use "gpt-3.5-turbo-0613" instead of "got-3.5-turbo", same with "gpt-4-0613"!