• I would like to have the option to dynamically process the assistant function if it requires certain action.

    Currently I have forked your package and added this code inside the chatbot-call-assistant.php file

    if ('requires_action' === $status) {
    if (function_exists('chatgpt_assistant_function_handle')) {
    call_user_func('chatgpt_assistant_function_handle',
    [
    'apiKey' => $api_key,
    'threadId' => $thread_id,
    'runId' => $runId,
    ],
    $responseArray
    );
    }
    }

    I have my custom plugin for parsing the calling the function itself. You are activly developing this plugin that is why I do not want to fork it any longer but propose my ideas and provide them to you
    regards

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author kognetiks

    (@kognetiks)

    Hello skyferix (@skyferix),

    Can you provide more details or insights into what you’re trying to accomplish with the function ‘chatgpt_assistant_function_handle’? I am concerned about creating a backdoor and a vulnerability.

    Stephen

    Thread Starter skyferix

    (@skyferix)

    I am trying to achieve something like code provided on this website -> https://platform.openai.com/docs/guides/function-calling

    Basically instruction says something like this if you user asks that he wants to see weather, call the get_weather function. When this scenario happens assistant changes status to requires_action(see previously provided code snippet). Your current code does not support this functionality and goes into forever loop as required_action will not changed without manual intervetion.

    What I want to do is to give instruction for users that if they run assistant with custom functions, they can create they own plugin or use any other method to tie themself to specific function (It can be enabled in settings ect.). There will be warning that user is fully responsible for how chatbot works after enabling and using this functionality.

    What I am proposing is delegate responsibility of dealing with more complex assistants to users itself

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Chatbot assistant function required action handling’ is closed to new replies.