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

LMBDB usage error #182

Closed
benfiratkaya opened this issue Dec 6, 2024 · 3 comments
Closed

LMBDB usage error #182

benfiratkaya opened this issue Dec 6, 2024 · 3 comments
Assignees

Comments

@benfiratkaya
Copy link

benfiratkaya commented Dec 6, 2024

🐛 Describe the bug

I'm using this code. Its working good without setStore. Folder and cache created but query not working:

import {RAGApplicationBuilder, SIMPLE_MODELS} from '@llm-tools/embedjs';
import { LmdbStore } from '@llm-tools/embedjs-lmdb';
import * as path from "path";
import {OpenAiEmbeddings} from "@llm-tools/embedjs-openai";
import {QdrantDb} from "@llm-tools/embedjs-qdrant";

export default async function handler(req, res) {
  const app = await new RAGApplicationBuilder()
      .setModel(SIMPLE_MODELS.OPENAI_GPT4_O)
      .setEmbeddingModel(new OpenAiEmbeddings())
      .setVectorDatabase(new QdrantDb({
        apiKey: process.env.QDRANTDB_API_KEY || '',
        url: process.env.QDRANTDB_API_URL || '',
        clusterName: process.env.QDRANTDB_CLUSTER_NAME || '',
      }))
      .setStore(new LmdbStore({ path: path.resolve('./lmbdb-cache') }))
      .build();
  
  const response = await app.query("What is the LeaderOS");
  
  res.status(200).json({ response });
}

Error:

Cannot read properties of undefined (reading 'entries')
TypeError: Cannot read properties of undefined (reading 'entries')\n    at LmdbStore.addEntryToConversation (file:///Users/firatkaya/WebstormProjects/leaderos-ai-api-v2/node_modules/@llm-tools/embedjs-lmdb/src/lmdb-store.js:86:22)\n    at async OpenAi.query (file:///Users/firatkaya/WebstormProjects/leaderos-ai-api-v2/node_modules/@llm-tools/embedjs-interfaces/src/interfaces/base-model.js:64:13)\n    at async handler (webpack-internal:///(api)/./src/pages/api/create-cache.js:27:22)\n    at async apiResolver (/Users/firatkaya/WebstormProjects/leaderos-ai-api-v2/node_modules/next/dist/compiled/next-server/pages-api.runtime.dev.js:21:3901)\n    at async PagesAPIRouteModule.render (/Users/firatkaya/WebstormProjects/leaderos-ai-api-v2/node_modules/next/dist/compiled/next-server/pages-api.runtime.dev.js:21:5372)\n    at async DevServer.runApi (/Users/firatkaya/WebstormProjects/leaderos-ai-api-v2/node_modules/next/dist/server/next-server.js:618:9)\n    at async NextNodeServer.handleCatchallRenderRequest (/Users/firatkaya/WebstormProjects/leaderos-ai-api-v2/node_modules/next/dist/server/next-server.js:278:37)\n    at async DevServer.handleRequestImpl (/Users/firatkaya/WebstormProjects/leaderos-ai-api-v2/node_modules/next/dist/server/base-server.js:853:17)\n    at async /Users/firatkaya/WebstormProjects/leaderos-ai-api-v2/node_modules/next/dist/server/dev/next-dev-server.js:373:20\n    at async Span.traceAsyncFn (/Users/firatkaya/WebstormProjects/leaderos-ai-api-v2/node_modules/next/dist/trace/trace.js:153:20)\n    at async DevServer.handleRequest (/Users/firatkaya/WebstormProjects/leaderos-ai-api-v2/node_modules/next/dist/server/dev/next-dev-server.js:370:24)\n    at async invokeRender (/Users/firatkaya/WebstormProjects/leaderos-ai-api-v2/node_modules/next/dist/server/lib/router-server.js:183:21)\n    at async handleRequest (/Users/firatkaya/WebstormProjects/leaderos-ai-api-v2/node_modules/next/dist/server/lib/router-server.js:360:24)\n    at async requestHandlerImpl (/Users/firatkaya/WebstormProjects/leaderos-ai-api-v2/node_modules/next/dist/server/lib/router-server.js:384:13)\n    at async Server.requestListener (/Users/firatkaya/WebstormProjects/leaderos-ai-api-v2/node_modules/next/dist/server/lib/start-server.js:142:13)
@benfiratkaya
Copy link
Author

Any help?

@adhityan
Copy link
Collaborator

Will share an update on this tomorrow.

@adhityan
Copy link
Collaborator

Thanks for pointing this bug out. This is addressed in the latest version deployed 0.1.24

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