Kushwanth Chowday Kandala commited on
Commit
dcca063
1 Parent(s): 788269b

ImportError: cannot import name 'GRPCIndex' from 'pinecone'

Browse files
Files changed (1) hide show
  1. app.py +11 -11
app.py CHANGED
@@ -35,8 +35,8 @@ st.divider()
35
  import os
36
  import pinecone
37
 
38
- from pinecone.client import Index
39
- from pinecone.grpc import GRPCIndex
40
 
41
  PINECONE_API_KEY=os.getenv("PINECONE_API_KEY")
42
  PINECONE_ENV=os.getenv("PINECONE_ENV")
@@ -63,7 +63,7 @@ def get_pinecone_semantic_index(pinecone):
63
  metric="cosine",
64
  )
65
  # now connect to index
66
- index = pinecone.GRPCIndex(index_name)
67
  st.text(f"Succesfully connected to the pinecone")
68
  return index
69
 
@@ -97,15 +97,15 @@ for i in st.session_state["chat_history"]:
97
 
98
  ### Creating a Index(Pinecone Vector Database)
99
  # %%writefile .env
100
- PINECONE_API_KEY=os.getenv("PINECONE_API_KEY")
101
- PINECONE_ENV=os.getenv("PINECONE_ENV")
102
- PINECONE_ENVIRONMENT=os.getenv("PINECONE_ENVIRONMENT")
103
 
104
- import os
105
- import pinecone
106
 
107
- from pinecone import Index, GRPCIndex
108
- pinecone.init(api_key=PINECONE_API_KEY, environment=PINECONE_ENV)
109
- st.text(pinecone)
110
 
111
 
 
35
  import os
36
  import pinecone
37
 
38
+ from pinecone.grpc import PineconeGRPC
39
+
40
 
41
  PINECONE_API_KEY=os.getenv("PINECONE_API_KEY")
42
  PINECONE_ENV=os.getenv("PINECONE_ENV")
 
63
  metric="cosine",
64
  )
65
  # now connect to index
66
+ index = PineconeGRPC(index_name)
67
  st.text(f"Succesfully connected to the pinecone")
68
  return index
69
 
 
97
 
98
  ### Creating a Index(Pinecone Vector Database)
99
  # %%writefile .env
100
+ # PINECONE_API_KEY=os.getenv("PINECONE_API_KEY")
101
+ # PINECONE_ENV=os.getenv("PINECONE_ENV")
102
+ # PINECONE_ENVIRONMENT=os.getenv("PINECONE_ENVIRONMENT")
103
 
104
+ # import os
105
+ # import pinecone
106
 
107
+ # from pinecone import Index, GRPCIndex
108
+ # pinecone.init(api_key=PINECONE_API_KEY, environment=PINECONE_ENV)
109
+ # st.text(pinecone)
110
 
111