• Resolved Alexandre Froger

    (@frogerme)


    Hello!


    The inclusion of filters for integration with OpenAI-compatible LLM providers is a blessing, thank you for the forethought!

    However, it seems there is one hard coded value missing the filter, on line 1232 of classes/engines/openai.php:

        $url = 'https://api.openai.com/v1' . $url;
    $options = [
    "headers" => $headers,
    "method" => $method,
    "timeout" => MWAI_TIMEOUT,
    "body" => $body,
    "sslverify" => false
    ];

    For next update, would it be possible to edit is as following?

    $url = apply_filters( 'mwai_openai_endpoint', 'https://api.openai.com/v1', $this->envType ) . $url;
    $options = [
    "headers" => $headers,
    "method" => $method,
    "timeout" => MWAI_TIMEOUT,
    "body" => $body,
    "sslverify" => false
    ];

    Best regards

    • This topic was modified 9 months, 1 week ago by Alexandre Froger. Reason: fix parameter name
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Alexandre Froger

    (@frogerme)

    I also noticed the filter applied on line 293 of the same file seems to have an error – the name of the scond parameter does not seem right:

    $endpoint = apply_filters( 'mwai_openai_endpoint', 'https://api.openai.com/v1', $this->env );

    Should be:

    $endpoint = apply_filters( 'mwai_openai_endpoint', 'https://api.openai.com/v1', $this->envType );

    Could you include a fix for that as well in next update?

    Plugin Support Val Meow

    (@valwa)

    Hey @frogerme! ??

    Thanks for reporting this. We will see what we can do on our side. Thank you for your patience and understanding.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Missing mwai_openai_endpoint filter’ is closed to new replies.