{"record":{"id":"2c48758a5c1e2fb8","repo":"continuedev/continue","slug":"await-resp-text-2c4875","errorCode":null,"errorMessage":"await resp.text()","messagePattern":"await resp\\.text\\(\\)","errorType":"http","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"core/llm/llms/Nvidia.ts","lineNumber":32,"sourceCode":"  };\n\n  protected async _embed(chunks: string[]): Promise<number[][]> {\n    const resp = await this.fetch(new URL(\"embeddings\", this.apiBase), {\n      method: \"POST\",\n      body: JSON.stringify({\n        input: chunks,\n        model: this.model,\n        input_type: \"passage\",\n        truncate: \"END\",\n      }),\n      headers: {\n        Authorization: `Bearer ${this.apiKey}`,\n        \"Content-Type\": \"application/json\",\n      },\n    });\n\n    if (!resp.ok) {\n      throw new Error(await resp.text());\n    }\n\n    const data = (await resp.json()) as any;\n    return data.data.map((result: { embedding: number[] }) => result.embedding);\n  }\n}\n\nexport default Nvidia;\n","sourceCodeStart":14,"sourceCodeEnd":41,"githubUrl":"https://github.com/continuedev/continue/blob/5522c6f44ca0ac3528b37244818fbfa39b5af470/core/llm/llms/Nvidia.ts#L14-L41","documentation":"Thrown by Nvidia._embed when NVIDIA's NIM embeddings API returns a non-OK status; the raw body is the message. The request sends Authorization: Bearer apiKey plus a JSON payload of the chunks, mirroring an OpenAI-style /embeddings call against build.nvidia.com.","triggerScenarios":"Embedding chunks with provider nvidia and an invalid nvapi key, a model like nvidia/nv-embedqa-e5-v5 that the key can't access, or rate limiting from the NIM catalog.","commonSituations":"Using an expired nvapi-... key, typos in the model name, or hitting free-tier rate limits when indexing a large codebase.","solutions":["Check the body message — 401 means regenerate the nvapi key in config.json; 429 means back off or reduce batch size","Confirm the exact model id from the NVIDIA build catalog","If self-hosting NIM, verify the base URL and that the container is up"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"null","typeGuard":"function isNvidiaQuotaError(e: unknown): boolean { return e instanceof Error && /429|rate|limit/i.test(e.message); }","tryCatchPattern":"try { await llm.embed(chunks); }\ncatch (e) { if (isNvidiaQuotaError(e)) { await sleep(5000); return llm.embed(chunks); } throw e; }","preventionTips":["Batch embeddings to reduce request count","Copy model ids verbatim from the NVIDIA build catalog"],"tags":["nvidia","nim","embedding","api-key","http-error"],"backgroundTag":"rest-api-error-response","analyzedSha":"5522c6f44ca0ac3528b37244818fbfa39b5af470","analyzedAt":"2026-08-27T11:28:54.683Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}