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

The original usage seems broken: new GenerativeModel(...) #5

Closed
doggy8088 opened this issue Mar 26, 2024 · 4 comments
Closed

The original usage seems broken: new GenerativeModel(...) #5

doggy8088 opened this issue Mar 26, 2024 · 4 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@doggy8088
Copy link
Contributor

Here is my code:

async Task Main()
{
	var model = new GenerativeModel(apiKey: Util.GetPassword("GEMINI_API_KEY"), model: Model.GeminiPro);

	var prompt = "I love Taipei.";

	var response = await model.GenerateContent(prompt);

	response.Text.Dump();
}

LINQPad Query: https://share.linqpad.net/s5ftv46u.linq

Screenshot:

image

@jochenkirstaetter
Copy link
Contributor

You got an HTTP 429 Too many requests.

You exceeded the default limit 60 qpm (queries per minute).

@doggy8088
Copy link
Contributor Author

I know the limitation of the 60 QPM. The point is that, I am NOT request that much at that moment. The Google AI Gemini API will returned HTTP 429 from time to time. Unknown reason! Don't you met that before?

@jochenkirstaetter
Copy link
Contributor

Hardly.
However, that's an external issue which I cannot control in the package itself. That's probably something that could be handled by a Retry pattern/approach. There are times when Google AI has too many loads and rejects calls even though you might be below the 60 QPMs. It's discussed among other developers, too.

@jochenkirstaetter jochenkirstaetter added the documentation Improvements or additions to documentation label Mar 26, 2024
@jochenkirstaetter
Copy link
Contributor

Considering this as a use case of #2

@jochenkirstaetter jochenkirstaetter self-assigned this Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants