PawanOsman / ChatGPT.Net

C# library for ChatGPT using official OpenAI API

Home Page:https://www.nuget.org/packages/ChatGPT.Net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Response status code does not indicate success: 429 (Too Many Requests).

jimyu0217 opened this issue · comments

I had get 429 issue.
Anyone can help me?

private bool createChatGptObj()
{
bool success = false;

        try
        {
            _gptObj = new ChatGpt(_apiKey);
            _gptObj.SetConversations(new List<Net.DTO.ChatGPT.ChatGptConversation>()
            {
                new Net.DTO.ChatGPT.ChatGptConversation(),
            });

            success = true;
        }
        catch(Exception ex)
        {
            MessageBox.Show(ex.Message);
        }

        return success;
    }

    private async void askAndReponse(string question)
    {
        await _gptObj.AskStream(response =>
        {
            this.Invoke(new Action(() =>
            {
                rtbMessage.AppendText(response);
            }));

        }, question);
    }

I encountered this error and it was because I was out of the free trial limits. I fixed this by adding payment options to OpenAI so they could charge me