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

"AttributeError: 'FetchResponse' object has no attribute 'get'" for pinecone #2332

Open
roys4data opened this issue Mar 7, 2025 · 1 comment · May be fixed by #2353
Open

"AttributeError: 'FetchResponse' object has no attribute 'get'" for pinecone #2332

roys4data opened this issue Mar 7, 2025 · 1 comment · May be fixed by #2353

Comments

@roys4data
Copy link

roys4data commented Mar 7, 2025

I am unable to use embedchain app using pinecone as vectordb as it is not allowing to save data.
Below the code that can be run on collab notebook to reproduce the error,

!pip install --upgrade embedchain pinecone pinecone_text

import os
from embedchain import App
os.environ["PINECONE_API_KEY"] = "YOUR API KEY"

elon_bot = App.from_config(
    config={
      'vectordb':{
          'provider': 'pinecone',
          'config': {
              'index_name': 'myindex'
          }
      },
      'app': {'config':{'id':'test'}}
    }
)
elon_bot.add("web_page", "https://en.wikipedia.org/wiki/Elon_Musk")

It gives following error message,

WARNING:embedchain.embedchain:Starting from version v0.0.40, Embedchain can automatically detect the data type. So, in the `add` method, the argument order has changed. You no longer need to specify 'web_page' for the `source` argument. So the code snippet will be `.add("https://en.wikipedia.org/wiki/Elon_Musk", "web_page")`
WARNING:embedchain.embedchain:Embedchain is swapping the arguments for you. This functionality might be deprecated in the future, so please adjust your code.
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
[<ipython-input-29-8019c35f7ee9>](https://localhost:8080/#) in <cell line: 0>()
----> 1 elon_bot.add("web_page", "https://en.wikipedia.org/wiki/Elon_Musk")

2 frames
[/usr/local/lib/python3.11/dist-packages/embedchain/vectordb/pinecone.py](https://localhost:8080/#) in get(self, ids, where, limit)
    106             for i in range(0, len(ids), self.batch_size):
    107                 result = self.pinecone_index.fetch(ids=ids[i : i + self.batch_size])
--> 108                 vectors = result.get("vectors")
    109                 batch_existing_ids = list(vectors.keys())
    110                 existing_ids.extend(batch_existing_ids)

AttributeError: 'FetchResponse' object has no attribute 'get'
parshvadaftari added a commit to parshvadaftari/mem0 that referenced this issue Mar 10, 2025
@parshvadaftari parshvadaftari linked a pull request Mar 10, 2025 that will close this issue
15 tasks
@parshvadaftari
Copy link
Contributor

Hey @roys4data fixed the issue with the new PR.

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

Successfully merging a pull request may close this issue.

2 participants