Skip to content

TypeError: openrouter.textEmbeddingModel is not a functionΒ #298

@jacksonwen001

Description

@jacksonwen001

const openrouter = createOpenRouter({
apiKey: "sk-or-v1-xxxxx",
});
const { embeddings } = await embedMany({
model: openrouter.textEmbeddingModel("openai/text-embedding-3-small"),
values: [
"sunny day at the beach",
"rainy day in the city",
"snowy mountain peak",
],
});
console.log(embeddings);

projects/ai-agent/test-rag.ts:126
model: openrouter.textEmbeddingModel("openai/text-embedding-3-small"),
^

TypeError: openrouter.textEmbeddingModel is not a function
at (/Users/xxx/projects/ai-agent/test-rag.ts:126:20)
at ModuleJob.run (node:internal/modules/esm/module_job:377:25)
at async onImport.tracePromise.proto (node:internal/modules/esm/loader:671:26)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:101:5)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions