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

[Bug]: Attempted import error: 'PineconeVectorStore' is not exported from 'llamaindex' #1361

Open
GiveMeMoreLoansZeroInterest opened this issue Oct 20, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@GiveMeMoreLoansZeroInterest
Copy link

GiveMeMoreLoansZeroInterest commented Oct 20, 2024

Bug Description

Attempting to construct PineconeVectorStore and running into an issue. On Typescript. Any help is much appreciated!

Here's my code:

import {
  Document,
  VectorStoreIndex,
  OpenAI,
  Settings,
  PineconeVectorStore
} from "llamaindex";

const pineconeVectorStore = new PineconeVectorStore({
  indexName: "defiai"
});

Here's my error:

./src/app/api/generate-answer/route.ts
Attempted import error: 'PineconeVectorStore' is not exported from 'llamaindex' (imported as 'PineconeVectorStore').

Import trace for requested module:
./src/app/api/generate-answer/route.ts

 ✓ Linting and checking validity of types    
   Collecting page data  ..TypeError: eG.PineconeVectorStore is not a constructor

Version

"llamaindex": "^0.7.0",

Steps to Reproduce

Attempt to construct PineconeVectorStore

Relevant Logs/Tracbacks

No response

@GiveMeMoreLoansZeroInterest GiveMeMoreLoansZeroInterest added the bug Something isn't working label Oct 20, 2024
Copy link

dosubot bot commented Oct 20, 2024

Hey @GiveMeMoreLoansZeroInterest! 👋 I'm here to help you squash those pesky bugs and answer your burning questions. Let's tackle this issue together!

To resolve the import error for PineconeVectorStore, you need to import it from the correct module path. In your TypeScript code, change the import statement to:

import { PineconeVectorStore } from 'llama_index.vector_stores.pinecone';

This should correctly import the PineconeVectorStore class and resolve the error you're encountering [1].

To continue talking to Dosu, mention @dosu.

@GiveMeMoreLoansZeroInterest
Copy link
Author

@dosu are you sure that's the import statement for typescript?

Copy link

dosubot bot commented Oct 21, 2024

I apologize for the confusion. For TypeScript, the import path might differ slightly. Please try the following import statement:

import { PineconeVectorStore } from 'llamaindex/vector_stores/pinecone';

Ensure that the module path matches the structure in your node_modules directory. If the issue persists, double-check the documentation or the source code for any updates on the export paths.

To continue talking to Dosu, mention @dosu.

@GiveMeMoreLoansZeroInterest
Copy link
Author

@dosu that returns an import error. Are you sure this is the right import from Typescript? The documentation returns import {PineconeVectorStore} from 'llamaindex'

Copy link

dosubot bot commented Oct 21, 2024

The correct import path for PineconeVectorStore in the llamaindex package is "llama_index.vector_stores.pinecone" [1]. However, if you're using TypeScript, the import path might need to be adjusted based on how the package is structured in your node_modules.

If the documentation specifies import { PineconeVectorStore } from 'llamaindex', it might be outdated or incorrect. Please try the following import statement:

import { PineconeVectorStore } from 'llama_index/vector_stores/pinecone';

Make sure to verify the structure in your node_modules to ensure the path is correct. If the issue persists, it might be worth checking for any recent changes in the package or consulting the latest documentation.

To continue talking to Dosu, mention @dosu.

@logan-markewich logan-markewich transferred this issue from run-llama/llama_index Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant