Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

We couldn't find the model "gpt-3.5-turbo", join our discord server if you have any questions, https://discord.pawan.krd #147

Open
BaseMax opened this issue Oct 26, 2024 · 1 comment

Comments

@BaseMax
Copy link

BaseMax commented Oct 26, 2024

output:

C:\Users\MAX\Desktop>php gpttest.php
Array
(
    [status] =>
    [error] => Array
        (
            [message] => We couldn't find the model "gpt-3.5-turbo", join our discord server if you have any questions, https://discord.pawan.krd
            [type] => invalid_request_error
        )

    [support] => https://discord.pawan.krd
)

code:

<?php
$url = "https://api.pawan.krd/v1/chat/completions";
$apiKey = "pk-xxxxxxxxx";

$data = [
    "model" => "gpt-3.5-turbo",
    "messages" => [
        [
            "role" => "user",
            "content" => "Hello, how can I help you today?"
        ]
    ]
];

$ch = curl_init($url);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Authorization: Bearer $apiKey",
    "Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));

$response = curl_exec($ch);

if (curl_errno($ch)) {
    echo 'cURL error: ' . curl_error($ch);
} else {
    $response_data = json_decode($response, true);
    print_r($response_data);
}

curl_close($ch);
@BaseMax
Copy link
Author

BaseMax commented Oct 26, 2024

It seems to be working after changing the URL to $url = "https://api.pawan.krd/cosmosrp/v1/chat/completions"; and disabling my VPN.


C:\Users\MAX\Desktop>php gpttest.php
Array
(
    [id] => chatcmpl-pj6c45WtOyNajCxllJQ8k3eza3Ty
    [created] => 1729982780
    [model] => cosmosrp-001
    [object] => chat.completion
    [choices] => Array
        (
            [0] => Array
                (
                    [finish_reason] => stop
                    [index] => 0
                    [message] => Array
                        (
                            [content] => *sighs* Hi there, I just really need to talk to someone right now. My girlfriend broke up with me yesterday and it's been a rough day. I don't know what to do or how to feel. Can we just chat for a bit? Maybe you could give me some advice or something? *looks down, fidgeting with his hands.*
                            [role] => assistant
                        )

                )

        )

    [usage] => Array
        (
            [prompt_tokens] => 10
            [completion_tokens] => 75
            [total_tokens] => 85
        )

)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant