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

what 's wrong? #51

Open
caixianyu opened this issue Feb 9, 2025 · 1 comment
Open

what 's wrong? #51

caixianyu opened this issue Feb 9, 2025 · 1 comment

Comments

@caixianyu
Copy link

my gemini api is work! but when i try this project ,the error is timeout in the same environment.

Step 1 / Budget used 0.00%
Gaps: [ '1+1=' ]
RetryError [AI_RetryError]: Failed after 3 attempts. Last error: Cannot connect to API: Connect Timeout Error (attempted addresses: 142.250.217.106:443, 172.217.14.234:443, 142.251.211.234:443, 142.251.215.234:443, 142.250.69.202:443, 142.251.33.106:443, 142.251.33.74:443, 142.250.217.74:443, timeout: 10000ms)
at _retryWithExponentialBackoff (D:\node-DeepResearch\node_modules\ai\util\retry-with-exponential-backoff.ts:51:13)
at processTicksAndRejections (node:internal/process/task_queues:105:5)
at async fn (D:\node-DeepResearch\node_modules\ai\core\generate-object\generate-object.ts:457:34)
at async D:\node-DeepResearch\node_modules\ai\core\telemetry\record-span.ts:18:22
at async getResponse (D:\node-DeepResearch\src\agent.ts:344:22)
at async main (D:\node-DeepResearch\src\agent.ts:712:7) {
cause: undefined,
reason: 'maxRetriesExceeded',
errors: [
APICallError [AI_APICallError]: Cannot connect to API: Connect Timeout Error (attempted addresses: 142.250.69.202:443, 142.251.33.106:443, 142.250.217.74:443, 142.251.215.234:443, 172.217.14.234:443, 142.251.33.74:443, 142.251.211.234:443, 142.250.217.106:443, timeout: 10000ms)
at postToApi (D:\node-DeepResearch\node_modules@ai-sdk\provider-utils\src\post-to-api.ts:137:15)
at processTicksAndRejections (node:internal/process/task_queues:105:5)
at async GoogleGenerativeAILanguageModel.doGenerate (D:\node-DeepResearch\node_modules@ai-sdk\google\src\google-generative-ai-language-model.ts:212:50)
at async fn (D:\node-DeepResearch\node_modules\ai\core\generate-object\generate-object.ts:489:32)
at async D:\node-DeepResearch\node_modules\ai\core\telemetry\record-span.ts:18:22
at async _retryWithExponentialBackoff (D:\node-DeepResearch\node_modules\ai\util\retry-with-exponential-backoff.ts:36:12)
at async fn (D:\node-DeepResearch\node_modules\ai\core\generate-object\generate-object.ts:457:34)
at async D:\node-DeepResearch\node_modules\ai\core\telemetry\record-span.ts:18:22
at async getResponse (D:\node-DeepResearch\src\agent.ts:344:22)
at async main (D:\node-DeepResearch\src\agent.ts:712:7) {
cause: [ConnectTimeoutError],
url: 'https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent',
requestBodyValues: [Object],
statusCode: undefined,
responseHeaders: undefined,
responseBody: undefined,
isRetryable: true,
data: undefined,
[Symbol(vercel.ai.error)]: true,
[Symbol(vercel.ai.error.AI_APICallError)]: true
},
APICallError [AI_APICallError]: Cannot connect to API: Connect Timeout Error (attempted addresses: 142.251.33.106:443, 142.250.217.74:443, 142.251.215.234:443, 172.217.14.234:443, 142.251.33.74:443, 142.251.211.234:443, 142.250.217.106:443, 142.250.69.202:443, timeout: 10000ms)
at postToApi (D:\node-DeepResearch\node_modules@ai-sdk\provider-utils\src\post-to-api.ts:137:15)
at processTicksAndRejections (node:internal/process/task_queues:105:5)
at async GoogleGenerativeAILanguageModel.doGenerate (D:\node-DeepResearch\node_modules@ai-sdk\google\src\google-generative-ai-language-model.ts:212:50)
at async fn (D:\node-DeepResearch\node_modules\ai\core\generate-object\generate-object.ts:489:32)
at async D:\node-DeepResearch\node_modules\ai\core\telemetry\record-span.ts:18:22
at async _retryWithExponentialBackoff (D:\node-DeepResearch\node_modules\ai\util\retry-with-exponential-backoff.ts:36:12)
at async fn (D:\node-DeepResearch\node_modules\ai\core\generate-object\generate-object.ts:457:34)
at async D:\node-DeepResearch\node_modules\ai\core\telemetry\record-span.ts:18:22
at async getResponse (D:\node-DeepResearch\src\agent.ts:344:22)
at async main (D:\node-DeepResearch\src\agent.ts:712:7) {
cause: [ConnectTimeoutError],
url: 'https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent',
requestBodyValues: [Object],
statusCode: undefined,
responseHeaders: undefined,
responseBody: undefined,
isRetryable: true,
data: undefined,
[Symbol(vercel.ai.error)]: true,
[Symbol(vercel.ai.error.AI_APICallError)]: true
},
APICallError [AI_APICallError]: Cannot connect to API: Connect Timeout Error (attempted addresses: 142.250.217.106:443, 172.217.14.234:443, 142.251.211.234:443, 142.251.215.234:443, 142.250.69.202:443, 142.251.33.106:443, 142.251.33.74:443, 142.250.217.74:443, timeout: 10000ms)
at postToApi (D:\node-DeepResearch\node_modules@ai-sdk\provider-utils\src\post-to-api.ts:137:15)
at processTicksAndRejections (node:internal/process/task_queues:105:5)
at async GoogleGenerativeAILanguageModel.doGenerate (D:\node-DeepResearch\node_modules@ai-sdk\google\src\google-generative-ai-language-model.ts:212:50)
at async fn (D:\node-DeepResearch\node_modules\ai\core\generate-object\generate-object.ts:489:32)
at async D:\node-DeepResearch\node_modules\ai\core\telemetry\record-span.ts:18:22
at async _retryWithExponentialBackoff (D:\node-DeepResearch\node_modules\ai\util\retry-with-exponential-backoff.ts:36:12)
at async fn (D:\node-DeepResearch\node_modules\ai\core\generate-object\generate-object.ts:457:34)
at async D:\node-DeepResearch\node_modules\ai\core\telemetry\record-span.ts:18:22
at async getResponse (D:\node-DeepResearch\src\agent.ts:344:22)
at async main (D:\node-DeepResearch\src\agent.ts:712:7) {
cause: [ConnectTimeoutError],
url: 'https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent',
requestBodyValues: [Object],
statusCode: undefined,
responseHeaders: undefined,
responseBody: undefined,
isRetryable: true,
data: undefined,
[Symbol(vercel.ai.error)]: true,
[Symbol(vercel.ai.error.AI_APICallError)]: true
}
],
lastError: APICallError [AI_APICallError]: Cannot connect to API: Connect Timeout Error (attempted addresses: 142.250.217.106:443, 172.217.14.234:443, 142.251.211.234:443, 142.251.215.234:443, 142.250.69.202:443, 142.251.33.106:443, 142.251.33.74:443, 142.250.217.74:443, timeout: 10000ms)
at postToApi (D:\node-DeepResearch\node_modules@ai-sdk\provider-utils\src\post-to-api.ts:137:15)
at processTicksAndRejections (node:internal/process/task_queues:105:5)
at async GoogleGenerativeAILanguageModel.doGenerate (D:\node-DeepResearch\node_modules@ai-sdk\google\src\google-generative-ai-language-model.ts:212:50)
at async fn (D:\node-DeepResearch\node_modules\ai\core\generate-object\generate-object.ts:489:32)
at async D:\node-DeepResearch\node_modules\ai\core\telemetry\record-span.ts:18:22
at async _retryWithExponentialBackoff (D:\node-DeepResearch\node_modules\ai\util\retry-with-exponential-backoff.ts:36:12)
at async fn (D:\node-DeepResearch\node_modules\ai\core\generate-object\generate-object.ts:457:34)
at async D:\node-DeepResearch\node_modules\ai\core\telemetry\record-span.ts:18:22
at async getResponse (D:\node-DeepResearch\src\agent.ts:344:22)
at async main (D:\node-DeepResearch\src\agent.ts:712:7) {
cause: ConnectTimeoutError: Connect Timeout Error (attempted addresses: 142.250.217.106:443, 172.217.14.234:443, 142.251.211.234:443, 142.251.215.234:443, 142.250.69.202:443, 142.251.33.106:443, 142.251.33.74:443, 142.250.217.74:443, timeout: 10000ms)
at onConnectTimeout (D:\node-DeepResearch\node_modules\undici\lib\core\connect.js:237:24)
at Immediate._onImmediate (D:\node-DeepResearch\node_modules\undici\lib\core\connect.js:188:35)
at processImmediate (node:internal/timers:491:21) {
code: 'UND_ERR_CONNECT_TIMEOUT'
},
url: 'https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent',
requestBodyValues: {
generationConfig: [Object],
contents: [Array],
systemInstruction: undefined,
safetySettings: undefined,
cachedContent: undefined
},
statusCode: undefined,
responseHeaders: undefined,
responseBody: undefined,
isRetryable: true,
data: undefined,
[Symbol(vercel.ai.error)]: true,
[Symbol(vercel.ai.error.AI_APICallError)]: true
},
[Symbol(vercel.ai.error)]: true,
[Symbol(vercel.ai.error.AI_RetryError)]: true
}

when i try my api is ok:
D:\node-DeepResearch>curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent?key=********" -H "Content-Type: application/json" -X POST -d "{""contents"": [{""parts"":[{""text"": ""1+1=""}]}]}"
{
"candidates": [
{
"content": {
"parts": [
{
"text": "2\n"
}
],
"role": "model"
},
"finishReason": "STOP",
"avgLogprobs": -0.0078399591147899628
}
],
"usageMetadata": {
"promptTokenCount": 4,
"candidatesTokenCount": 2,
"totalTokenCount": 6,
"promptTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 4
}
],
"candidatesTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 2
}
]
},
"modelVersion": "gemini-2.0-flash"
}

@hanxiao
Copy link
Member

hanxiao commented Feb 9, 2025

probably bc too frequent requests and hit the rate limit? edit step_sleep in config.json to 2000 may help?

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

2 participants