Skip to content

Examples and guides for using the OpenAI API

added data creation loop

James Briggs1dd1c0ef33a9
diff --git a/examples/vector_databases/pinecone/GPT4_Retrieval_Augmentation.ipynb b/examples/vector_databases/pinecone/GPT4_Retrieval_Augmentation.ipynb
index d0f77da4..7c5cad6e 100644
--- a/examples/vector_databases/pinecone/GPT4_Retrieval_Augmentation.ipynb
+++ b/examples/vector_databases/pinecone/GPT4_Retrieval_Augmentation.ipynb
@@ -203,6 +203,29 @@
"docs[5].metadata['source'].replace('rtdocs/', 'https://')"
]
},
+ {
+ "attachments": {},
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "We can use these to create our `data` list:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "data = []\n",
+ "\n",
+ "for doc in docs:\n",
+ " data.append({\n",
+ " 'url': doc.metadata['source'].replace('rtdocs/', 'https://'),\n",
+ " 'text': doc.page_content\n",
+ " })"
+ ]
+ },
{
"cell_type": "code",
"execution_count": 60,
@@ -280,6 +303,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {
"id": "bLdvW8eq06Zd"
@@ -345,6 +369,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {
"id": "JegURaAg2PuN"
@@ -354,6 +379,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {
"id": "zGIZbQqJ2WBh"
@@ -388,6 +414,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {
"id": "aNZ7IWekNLbu"
@@ -423,6 +450,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {
"id": "zStnHFpkNVIU"
@@ -484,6 +512,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {
"id": "XPd41MjANhmp"
@@ -493,6 +522,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {
"id": "WPi4MZvMNvUH"
@@ -502,6 +532,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {
"id": "H5RRQArrN2lN"
@@ -561,6 +592,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {
"id": "ezSTzN2rPa2o"
@@ -649,6 +681,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {
"id": "YttJOrEtQIF9"
@@ -658,6 +691,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {
"id": "FumVmMRlQQ7w"
@@ -667,6 +701,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {
"id": "nLRODeL-QTJ9"
@@ -892,6 +927,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {
"id": "MoBSiDLIUADZ"
@@ -901,6 +937,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {
"id": "qfzS4-6-UXgX"
@@ -910,6 +947,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {
"id": "XPC1jQaKUcy0"
@@ -976,6 +1014,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {
"id": "sihH_GMiV5_p"
@@ -1009,6 +1048,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {
"id": "QvS1yJhOWpiJ"
@@ -1086,6 +1126,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {
"id": "eJ-a8MHg0eYQ"
@@ -1131,6 +1172,7 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {
"id": "5CSsA-dW0m_P"