run-llama / LlamaIndexTS

Data framework for your LLM applications. Focus on server side solution
https://ts.llamaindex.ai
MIT License
1.96k stars 365 forks source link

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

Open GiveMeMoreLoansZeroInterest opened 1 month ago

GiveMeMoreLoansZeroInterest commented 1 month ago

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

dosubot[bot] commented 1 month ago

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 commented 1 month ago

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

dosubot[bot] commented 1 month ago

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 commented 1 month ago

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

dosubot[bot] commented 1 month ago

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.