Skip to content

Commit e51ea5c

Browse files
authored
notebooks: update code for llamaindex 0.10.x (#388)
* notebooks: update code for llamaindex 0.10.x * fix * fix
1 parent 587e8bc commit e51ea5c

File tree

2 files changed

+10
-19
lines changed

2 files changed

+10
-19
lines changed

examples/notebooks/llama-astra.ipynb

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
},
131131
"outputs": [],
132132
"source": [
133-
"from llama_index.llama_dataset import download_llama_dataset\n",
133+
"from llama_index.core.llama_dataset import download_llama_dataset\n",
134134
"\n",
135135
"!mkdir -p 'data'\n",
136136
"\n",
@@ -158,12 +158,8 @@
158158
},
159159
"outputs": [],
160160
"source": [
161-
"from llama_index.vector_stores import AstraDBVectorStore\n",
162-
"from llama_index import (\n",
163-
" VectorStoreIndex,\n",
164-
" SimpleDirectoryReader,\n",
165-
" StorageContext,\n",
166-
")\n",
161+
"from llama_index.vector_stores.astra_db import AstraDBVectorStore\n",
162+
"from llama_index.core import VectorStoreIndex, SimpleDirectoryReader, StorageContext\n",
167163
"\n",
168164
"documents = SimpleDirectoryReader(\"./data/source_files\").load_data()\n",
169165
"print(f\"Total documents: {len(documents)}\")\n",
@@ -196,7 +192,7 @@
196192
},
197193
"outputs": [],
198194
"source": [
199-
"from llama_index.vector_stores import AstraDBVectorStore\n",
195+
"from llama_index.vector_stores.astra_db import AstraDBVectorStore\n",
200196
"import os\n",
201197
"\n",
202198
"astra_db_store = AstraDBVectorStore(\n",

examples/notebooks/llama-parse-astra.ipynb

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@
3838
},
3939
"slideshow": {
4040
"slide_type": ""
41-
},
42-
"tags": []
41+
}
4342
},
4443
"outputs": [
4544
{
@@ -230,7 +229,7 @@
230229
"outputs": [],
231230
"source": [
232231
"import os\n",
233-
"from llama_index.vector_stores import AstraDBVectorStore\n",
232+
"from llama_index.vector_stores.astra_db import AstraDBVectorStore\n",
234233
"\n",
235234
"astra_db_store = AstraDBVectorStore(\n",
236235
" token=os.environ[\"ASTRA_DB_APPLICATION_TOKEN\"],\n",
@@ -246,8 +245,8 @@
246245
"metadata": {},
247246
"outputs": [],
248247
"source": [
249-
"from llama_index.node_parser import SimpleNodeParser\n",
250-
"from llama_index.llms import OpenAI\n",
248+
"from llama_index.core.node_parser import SimpleNodeParser\n",
249+
"from llama_index.llms.openai import OpenAI\n",
251250
"\n",
252251
"node_parser = SimpleNodeParser()\n",
253252
"\n",
@@ -260,12 +259,8 @@
260259
"metadata": {},
261260
"outputs": [],
262261
"source": [
263-
"from llama_index import (\n",
264-
" OpenAIEmbedding,\n",
265-
" VectorStoreIndex,\n",
266-
" StorageContext,\n",
267-
" ServiceContext,\n",
268-
")\n",
262+
"from llama_index.embeddings.openai import OpenAIEmbedding\n",
263+
"from llama_index.core import VectorStoreIndex, StorageContext, ServiceContext\n",
269264
"\n",
270265
"storage_context = StorageContext.from_defaults(vector_store=astra_db_store)\n",
271266
"\n",

0 commit comments

Comments
 (0)