|
7 | 7 | }, |
8 | 8 | "kernelspec": { |
9 | 9 | "name": "python3", |
10 | | - "display_name": "Python 3" |
| 10 | + "display_name": "Python 3 (ipykernel)", |
| 11 | + "language": "python" |
11 | 12 | }, |
12 | 13 | "language_info": { |
13 | 14 | "name": "python" |
|
34 | 35 | "colab": { |
35 | 36 | "base_uri": "https://localhost:8080/" |
36 | 37 | }, |
37 | | - "outputId": "06daf601-2ed5-45f2-b3cb-9c5d8ba85654" |
| 38 | + "outputId": "06daf601-2ed5-45f2-b3cb-9c5d8ba85654", |
| 39 | + "ExecuteTime": { |
| 40 | + "end_time": "2025-03-06T17:01:18.767327Z", |
| 41 | + "start_time": "2025-03-06T17:01:18.083827Z" |
| 42 | + } |
38 | 43 | }, |
39 | | - "execution_count": 3, |
40 | 44 | "outputs": [ |
41 | 45 | { |
42 | | - "output_type": "stream", |
43 | 46 | "name": "stdout", |
| 47 | + "output_type": "stream", |
44 | 48 | "text": [ |
45 | | - "Requirement already satisfied: vectorize-client in /usr/local/lib/python3.11/dist-packages (0.1.2)\n", |
46 | | - "Requirement already satisfied: pydantic>=2 in /usr/local/lib/python3.11/dist-packages (from vectorize-client) (2.10.6)\n", |
47 | | - "Requirement already satisfied: python-dateutil>=2.8.2 in /usr/local/lib/python3.11/dist-packages (from vectorize-client) (2.8.2)\n", |
48 | | - "Requirement already satisfied: typing-extensions>=4.7.1 in /usr/local/lib/python3.11/dist-packages (from vectorize-client) (4.12.2)\n", |
49 | | - "Requirement already satisfied: urllib3<3.0.0,>=1.25.3 in /usr/local/lib/python3.11/dist-packages (from vectorize-client) (2.3.0)\n", |
50 | | - "Requirement already satisfied: annotated-types>=0.6.0 in /usr/local/lib/python3.11/dist-packages (from pydantic>=2->vectorize-client) (0.7.0)\n", |
51 | | - "Requirement already satisfied: pydantic-core==2.27.2 in /usr/local/lib/python3.11/dist-packages (from pydantic>=2->vectorize-client) (2.27.2)\n", |
52 | | - "Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.11/dist-packages (from python-dateutil>=2.8.2->vectorize-client) (1.17.0)\n" |
| 49 | + "Requirement already satisfied: vectorize-client in /Users/nicoloboschi/dev/vectorize-client-generator/tests/python/.venv/lib/python3.11/site-packages (1.0.0)\r\n", |
| 50 | + "Requirement already satisfied: urllib3<3.0.0,>=1.25.3 in /Users/nicoloboschi/dev/vectorize-client-generator/tests/python/.venv/lib/python3.11/site-packages (from vectorize-client) (2.3.0)\r\n", |
| 51 | + "Requirement already satisfied: python-dateutil>=2.8.2 in /Users/nicoloboschi/dev/vectorize-client-generator/tests/python/.venv/lib/python3.11/site-packages (from vectorize-client) (2.9.0.post0)\r\n", |
| 52 | + "Requirement already satisfied: pydantic>=2 in /Users/nicoloboschi/dev/vectorize-client-generator/tests/python/.venv/lib/python3.11/site-packages (from vectorize-client) (2.10.6)\r\n", |
| 53 | + "Requirement already satisfied: typing-extensions>=4.7.1 in /Users/nicoloboschi/dev/vectorize-client-generator/tests/python/.venv/lib/python3.11/site-packages (from vectorize-client) (4.12.2)\r\n", |
| 54 | + "Requirement already satisfied: annotated-types>=0.6.0 in /Users/nicoloboschi/dev/vectorize-client-generator/tests/python/.venv/lib/python3.11/site-packages (from pydantic>=2->vectorize-client) (0.7.0)\r\n", |
| 55 | + "Requirement already satisfied: pydantic-core==2.27.2 in /Users/nicoloboschi/dev/vectorize-client-generator/tests/python/.venv/lib/python3.11/site-packages (from pydantic>=2->vectorize-client) (2.27.2)\r\n", |
| 56 | + "Requirement already satisfied: six>=1.5 in /Users/nicoloboschi/dev/vectorize-client-generator/tests/python/.venv/lib/python3.11/site-packages (from python-dateutil>=2.8.2->vectorize-client) (1.17.0)\r\n", |
| 57 | + "\r\n", |
| 58 | + "\u001B[1m[\u001B[0m\u001B[34;49mnotice\u001B[0m\u001B[1;39;49m]\u001B[0m\u001B[39;49m A new release of pip is available: \u001B[0m\u001B[31;49m24.3.1\u001B[0m\u001B[39;49m -> \u001B[0m\u001B[32;49m25.0.1\u001B[0m\r\n", |
| 59 | + "\u001B[1m[\u001B[0m\u001B[34;49mnotice\u001B[0m\u001B[1;39;49m]\u001B[0m\u001B[39;49m To update, run: \u001B[0m\u001B[32;49mpip install --upgrade pip\u001B[0m\r\n" |
53 | 60 | ] |
54 | 61 | } |
55 | | - ] |
| 62 | + ], |
| 63 | + "execution_count": 2 |
56 | 64 | }, |
57 | 65 | { |
58 | 66 | "cell_type": "code", |
|
66 | 74 | "base_uri": "https://localhost:8080/" |
67 | 75 | }, |
68 | 76 | "id": "Wtp1hi4Reh8q", |
69 | | - "outputId": "39503ec7-e8ca-4ff3-bf3b-ba80fff2af0b" |
70 | | - }, |
71 | | - "execution_count": 6, |
72 | | - "outputs": [ |
73 | | - { |
74 | | - "name": "stdout", |
75 | | - "output_type": "stream", |
76 | | - "text": [ |
77 | | - "Vectorize Organization ID:582893ba-291c-4ec7-a6ee-e85c26888817\n", |
78 | | - "Vectorize Token:··········\n" |
79 | | - ] |
| 77 | + "outputId": "39503ec7-e8ca-4ff3-bf3b-ba80fff2af0b", |
| 78 | + "ExecuteTime": { |
| 79 | + "end_time": "2025-03-06T17:02:02.626216Z", |
| 80 | + "start_time": "2025-03-06T17:01:29.119649Z" |
80 | 81 | } |
81 | | - ] |
| 82 | + }, |
| 83 | + "outputs": [], |
| 84 | + "execution_count": 3 |
82 | 85 | }, |
83 | 86 | { |
84 | 87 | "cell_type": "code", |
85 | 88 | "source": [ |
86 | 89 | "import vectorize_client as v\n", |
87 | 90 | "\n", |
88 | 91 | "\n", |
89 | | - "api = v.ApiClient(v.Configuration(access_token=token))\n", |
| 92 | + "api = v.ApiClient(v.Configuration(access_token=token, host=\"http://localhost:3000/api\"), \"x-lambda-api-key\", token)\n", |
90 | 93 | "pipelines = v.PipelinesApi(api)\n", |
91 | 94 | "\n", |
92 | 95 | "response = pipelines.get_pipelines(org)\n", |
|
98 | 101 | "colab": { |
99 | 102 | "base_uri": "https://localhost:8080/" |
100 | 103 | }, |
101 | | - "outputId": "694382e2-27e4-42c2-9da0-304ce9b588ce" |
| 104 | + "outputId": "694382e2-27e4-42c2-9da0-304ce9b588ce", |
| 105 | + "ExecuteTime": { |
| 106 | + "end_time": "2025-03-06T17:09:50.998069Z", |
| 107 | + "start_time": "2025-03-06T17:09:32.057335Z" |
| 108 | + } |
102 | 109 | }, |
103 | | - "execution_count": 13, |
104 | 110 | "outputs": [ |
105 | 111 | { |
106 | | - "output_type": "stream", |
107 | 112 | "name": "stdout", |
| 113 | + "output_type": "stream", |
108 | 114 | "text": [ |
109 | 115 | "Pipeline: My Pipeline From API\n", |
110 | | - "Pipeline: from api\n", |
| 116 | + "Pipeline: Test pipeline\n", |
111 | 117 | "Pipeline: Test pipeline\n", |
112 | 118 | "Pipeline: Test pipeline\n" |
113 | 119 | ] |
114 | 120 | } |
115 | | - ] |
| 121 | + ], |
| 122 | + "execution_count": 9 |
116 | 123 | }, |
117 | 124 | { |
118 | 125 | "cell_type": "code", |
119 | 126 | "source": "!wget -O apple.pdf https://www.apple.com/newsroom/pdfs/fy2024-q1/FY24_Q1_Consolidated_Financial_Statements.pdf ", |
120 | 127 | "metadata": { |
121 | | - "id": "sb43XYA1mEfN" |
| 128 | + "id": "sb43XYA1mEfN", |
| 129 | + "ExecuteTime": { |
| 130 | + "end_time": "2025-03-06T17:12:57.720738Z", |
| 131 | + "start_time": "2025-03-06T17:12:52.794818Z" |
| 132 | + } |
122 | 133 | }, |
123 | | - "execution_count": 25, |
124 | | - "outputs": [] |
| 134 | + "outputs": [ |
| 135 | + { |
| 136 | + "name": "stdout", |
| 137 | + "output_type": "stream", |
| 138 | + "text": [ |
| 139 | + "--2025-03-06 18:12:53-- https://www.apple.com/newsroom/pdfs/fy2024-q1/FY24_Q1_Consolidated_Financial_Statements.pdf\r\n", |
| 140 | + "Resolving www.apple.com (www.apple.com)... 23.205.48.213\r\n", |
| 141 | + "Connecting to www.apple.com (www.apple.com)|23.205.48.213|:443... connected.\r\n", |
| 142 | + "HTTP request sent, awaiting response... 200 OK\r\n", |
| 143 | + "Length: 3129308 (3.0M) [application/pdf]\r\n", |
| 144 | + "Saving to: ‘apple.pdf’\r\n", |
| 145 | + "\r\n", |
| 146 | + "apple.pdf 100%[===================>] 2.98M 778KB/s in 3.8s \r\n", |
| 147 | + "\r\n", |
| 148 | + "2025-03-06 18:12:57 (799 KB/s) - ‘apple.pdf’ saved [3129308/3129308]\r\n", |
| 149 | + "\r\n" |
| 150 | + ] |
| 151 | + } |
| 152 | + ], |
| 153 | + "execution_count": 12 |
125 | 154 | }, |
126 | 155 | { |
127 | 156 | "cell_type": "code", |
|
140 | 169 | "height": 35 |
141 | 170 | }, |
142 | 171 | "id": "FHuFKLufe0fi", |
143 | | - "outputId": "5d1b887e-1925-4ff9-d44c-3479fa394575" |
| 172 | + "outputId": "5d1b887e-1925-4ff9-d44c-3479fa394575", |
| 173 | + "ExecuteTime": { |
| 174 | + "end_time": "2025-03-06T17:12:30.433445Z", |
| 175 | + "start_time": "2025-03-06T17:12:16.696363Z" |
| 176 | + } |
144 | 177 | }, |
145 | | - "execution_count": 8, |
146 | 178 | "outputs": [ |
147 | 179 | { |
148 | | - "output_type": "execute_result", |
149 | 180 | "data": { |
150 | 181 | "text/plain": [ |
151 | | - "'cdfa4981-c0fa-4b1d-9fba-83845cc103f0'" |
152 | | - ], |
153 | | - "application/vnd.google.colaboratory.intrinsic+json": { |
154 | | - "type": "string" |
155 | | - } |
| 182 | + "'e49a6ede-83cb-4698-b751-dd0364918c53'" |
| 183 | + ] |
156 | 184 | }, |
| 185 | + "execution_count": 10, |
157 | 186 | "metadata": {}, |
158 | | - "execution_count": 8 |
| 187 | + "output_type": "execute_result" |
159 | 188 | } |
160 | | - ] |
| 189 | + ], |
| 190 | + "execution_count": 10 |
161 | 191 | }, |
162 | 192 | { |
163 | 193 | "cell_type": "code", |
|
190 | 220 | "base_uri": "https://localhost:8080/" |
191 | 221 | }, |
192 | 222 | "id": "TZs5os0Ae4kb", |
193 | | - "outputId": "3f47b11e-556b-464b-e3a4-4ebca7bfba52" |
| 223 | + "outputId": "3f47b11e-556b-464b-e3a4-4ebca7bfba52", |
| 224 | + "ExecuteTime": { |
| 225 | + "end_time": "2025-03-06T17:13:10.495588Z", |
| 226 | + "start_time": "2025-03-06T17:13:00.038846Z" |
| 227 | + } |
194 | 228 | }, |
195 | | - "execution_count": 10, |
196 | 229 | "outputs": [ |
197 | 230 | { |
198 | | - "output_type": "stream", |
199 | 231 | "name": "stdout", |
| 232 | + "output_type": "stream", |
200 | 233 | "text": [ |
201 | 234 | "Upload successful\n" |
202 | 235 | ] |
203 | 236 | } |
204 | | - ] |
| 237 | + ], |
| 238 | + "execution_count": 13 |
205 | 239 | }, |
206 | 240 | { |
207 | 241 | "cell_type": "code", |
|
213 | 247 | "builtin_vector_db = [c.id for c in vector_databases.destination_connectors if c.type == \"VECTORIZE\"][0]" |
214 | 248 | ], |
215 | 249 | "metadata": { |
216 | | - "id": "3rqzxB3aeoif" |
| 250 | + "id": "3rqzxB3aeoif", |
| 251 | + "ExecuteTime": { |
| 252 | + "end_time": "2025-03-06T17:13:33.985317Z", |
| 253 | + "start_time": "2025-03-06T17:13:11.451383Z" |
| 254 | + } |
217 | 255 | }, |
218 | | - "execution_count": 11, |
219 | | - "outputs": [] |
| 256 | + "outputs": [], |
| 257 | + "execution_count": 14 |
220 | 258 | }, |
221 | 259 | { |
222 | 260 | "cell_type": "code", |
223 | 261 | "source": [ |
224 | 262 | "response = pipelines.create_pipeline(org, v.PipelineConfigurationSchema(\n", |
225 | 263 | " source_connectors=[v.SourceConnectorSchema(id=source_connector_id, type=\"FILE_UPLOAD\", config={})],\n", |
226 | 264 | " destination_connector=v.DestinationConnectorSchema(id=builtin_vector_db, type=\"VECTORIZE\", config={}),\n", |
227 | | - " ai_platform=v.AIPlatformSchema(id=builtin_ai_platform, type=\"VECTORIZE\", config={}),\n", |
| 265 | + " ai_platform=v.AIPlatformSchema(id=builtin_ai_platform, type=\"VECTORIZE\", config={\n", |
| 266 | + " \"chunkSize\": 600,\n", |
| 267 | + " \"chunkingStrategy\": \"FIXED\",\n", |
| 268 | + " \"embeddingModel\": \"VECTORIZE_OPEN_AI_TEXT_EMBEDDING_3_LARGE\",\n", |
| 269 | + " #\"extractionStrategy\": \"MIXED\"\n", |
| 270 | + " }),\n", |
228 | 271 | " pipeline_name=\"My Pipeline From API\",\n", |
229 | 272 | " schedule=v.ScheduleSchema(type=\"manual\")\n", |
230 | 273 | "))\n", |
|
237 | 280 | "height": 35 |
238 | 281 | }, |
239 | 282 | "id": "59b9VSaykDSh", |
240 | | - "outputId": "f43499ce-08e3-4f23-c502-cead17f2e1c0" |
| 283 | + "outputId": "f43499ce-08e3-4f23-c502-cead17f2e1c0", |
| 284 | + "ExecuteTime": { |
| 285 | + "end_time": "2025-03-06T17:25:59.003091Z", |
| 286 | + "start_time": "2025-03-06T17:25:29.022232Z" |
| 287 | + } |
241 | 288 | }, |
242 | | - "execution_count": 12, |
243 | 289 | "outputs": [ |
244 | 290 | { |
245 | | - "output_type": "execute_result", |
246 | 291 | "data": { |
247 | 292 | "text/plain": [ |
248 | | - "'aipf9ab5-702c-40de-a2f7-8a2139129ba5'" |
249 | | - ], |
250 | | - "application/vnd.google.colaboratory.intrinsic+json": { |
251 | | - "type": "string" |
252 | | - } |
| 293 | + "'aipea5dd-bfa6-4e78-9211-019f65e106d2'" |
| 294 | + ] |
253 | 295 | }, |
| 296 | + "execution_count": 21, |
254 | 297 | "metadata": {}, |
255 | | - "execution_count": 12 |
| 298 | + "output_type": "execute_result" |
256 | 299 | } |
257 | | - ] |
| 300 | + ], |
| 301 | + "execution_count": 21 |
258 | 302 | }, |
259 | 303 | { |
260 | 304 | "cell_type": "code", |
|
786 | 830 | ] |
787 | 831 | } |
788 | 832 | ] |
789 | | - }, |
790 | | - { |
791 | | - "cell_type": "code", |
792 | | - "source": [], |
793 | | - "metadata": { |
794 | | - "id": "hCLlbeZ3lprg" |
795 | | - }, |
796 | | - "execution_count": null, |
797 | | - "outputs": [] |
798 | | - }, |
799 | | - { |
800 | | - "cell_type": "code", |
801 | | - "source": [], |
802 | | - "metadata": { |
803 | | - "id": "GAbtIAv8lFdB" |
804 | | - }, |
805 | | - "execution_count": null, |
806 | | - "outputs": [] |
807 | 833 | } |
808 | 834 | ] |
809 | 835 | } |
0 commit comments