You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Upload the toys.txt file from the repository to Google Colab:\n",
118
+
"\n",
119
+
"1. Click the folder icon in Google Colab's left rail <--\n",
120
+
"2. Click the upload button and use the file picker to select `toys.txt` from the subdirectory of https://github.com/pinecone-io/examples that contains this notebook\n",
121
+
"3. Run the next cell to upload the toys.txt file to your Pinecone assistant\n"
122
+
],
123
+
"metadata": {
124
+
"id": "nIyz6gYqAbHn"
125
+
}
126
+
},
127
+
{
128
+
"cell_type": "code",
129
+
"source": [
130
+
"import os\n",
131
+
"\n",
132
+
"# Target our existing Pinecone Assistant\n",
133
+
"assistant = pc.assistant.Assistant(\n",
134
+
" assistant_name=assistant_name,\n",
135
+
")\n",
136
+
"\n",
137
+
"file_path = '/content/toys.txt'\n",
138
+
"\n",
139
+
"# Upload the file\n",
140
+
"if os.path.exists(file_path):\n",
141
+
" response = assistant.upload_file(\n",
142
+
" file_path=file_path,\n",
143
+
" timeout=None\n",
144
+
" )\n",
145
+
" print(f\"Uploaded {file_path}\")\n",
146
+
" print(\"Response:\", response)\n",
147
+
"else:\n",
148
+
" print(f\"File not found: {file_path}\")"
149
+
],
150
+
"metadata": {
151
+
"id": "CVixRBQfEKpo"
152
+
},
153
+
"execution_count": null,
154
+
"outputs": []
155
+
},
156
+
{
157
+
"cell_type": "code",
158
+
"source": [
159
+
"# List uploaded files our assistant is aware of\n",
160
+
"files = assistant.list_files()\n",
161
+
"files"
162
+
],
163
+
"metadata": {
164
+
"id": "fqYUFoZ8N487"
165
+
},
166
+
"execution_count": null,
167
+
"outputs": []
168
+
},
169
+
{
170
+
"cell_type": "code",
171
+
"source": [
172
+
"# Chat with your Pinecone assistant, which automatically references\n",
0 commit comments