Open lakshaysethi opened 9 months ago
Not sure about the direct call with curl but the library worked for me, using gpt-4-turbo-preview, and adding a 'tools' param into args for $open_ai->chat(). You need to be real careful with the JSON If using json_decode as it will silently fail on JSON errors unless you specifically check:
$jData = stripslashes(html_entity_decode($tools)); $toolsO = json_decode($jData,true); if ($toolsO === null && json_last_error() !== JSON_ERROR_NONE){ echo '{"success":false,"message": "OpenAI tools JSON parse fail:'.json_last_error().'"}'; exit; }
Describe the feature or improvement you're requesting
does this library not support function calling? Tried but could not get this to work
as also noted in
https://github.com/orhanerday/open-ai/issues/98 https://platform.openai.com/docs/api-reference/chat/create
Additional context
No response