feat: add spinning favicon during processing and implement rate limiting for Gemini API requests
- Introduced a new hook `useSpinningFavicon` to animate the favicon when processing is ongoing. - Updated the `Header` component to utilize the new spinning favicon feature. - Added a rate limit delay of 100ms between requests to the Gemini API in `GeminiAgent`.
This commit is contained in:
@@ -264,6 +264,9 @@ export class GeminiAgent {
|
||||
|
||||
const url = `${GEMINI_API_URL}/${model}:generateContent?key=${apiKey}`;
|
||||
|
||||
// Rate limit delay - Gemini API requires spacing between requests
|
||||
await new Promise(resolve => setTimeout(resolve, 100));
|
||||
|
||||
const response = await fetch(url, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
|
||||
Reference in New Issue
Block a user