transitive-bullshit / chatgpt-api

Node.js client for the official ChatGPT API. 🔥

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

functions support

mrahmadt opened this issue · comments

commented

Describe the feature

Hello
Just wanted to say that functions is supported in chatgpt-api :)

It's not documented in https://github.com/transitive-bullshit/chatgpt-api/blob/main/docs/interfaces/openai.CreateChatCompletionRequest.md

But it will work

    const completionParamsOptions = {
        functions: functions,
        function_call: "auto"
    };
    chatgptAPI = new ChatGPTAPI({
        apiKey: openAIAPIKey,
        debug: true,
        completionParams: completionParamsOptions
    })