{"record":{"id":"a07af1ad27eecbfe","repo":"diegosouzapw/OmniRoute","slug":"invalid-embedding-model-modelstr-use-provide","errorCode":null,"errorMessage":"Invalid embedding model '${modelStr}'. Use provider/model format.","messagePattern":"Invalid embedding model '(.+?)'\\. Use provider/model format\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/lib/memory/qdrant.ts","lineNumber":287,"sourceCode":"  if (!vectors || typeof vectors !== \"object\" || Array.isArray(vectors)) {\n    return null;\n  }\n  // Unnamed/single-vector config: { size, distance, ... } (not a named map)\n  if (\n    Object.prototype.hasOwnProperty.call(vectors, \"size\") &&\n    (typeof vectors.size === \"number\" || typeof vectors.size === \"string\")\n  ) {\n    return null;\n  }\n  const names = Object.keys(vectors);\n  if (names.length === 0) return null;\n  return names[0] || null;\n}\n\nasync function embedText(cfg: QdrantConfig, text: string): Promise<number[]> {\n  const modelStr = cfg.embeddingModel.trim();\n  if (!modelStr.includes(\"/\")) {\n    throw new Error(`Invalid embedding model '${modelStr}'. Use provider/model format.`);\n  }\n\n  const res = await createEmbeddingResponse({\n    model: modelStr,\n    input: text,\n  });\n  if (!res.ok) {\n    const txt = await res.text().catch(() => \"\");\n    throw new Error(txt.slice(0, 300) || `Embeddings request failed (${res.status})`);\n  }\n  const data = (await res.json().catch(() => null)) as any;\n  const vec = data?.data?.[0]?.embedding;\n  if (!Array.isArray(vec) || vec.length === 0) {\n    throw new Error(\"Embedding response missing vector\");\n  }\n  return vec as number[];\n}\n","sourceCodeStart":269,"sourceCodeEnd":305,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/memory/qdrant.ts#L269-L305","documentation":"Error \"Invalid embedding model '${modelStr}'. Use provider/model format.\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/memory/qdrant.ts:287 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}