This repository was archived by the owner on Dec 16, 2025. It is now read-only.
Commit c3c90f8
Add ability to configure timeouts (#204)
* Add ability to configure timeouts
* Add timeout to docstrings
* Replace timeout default w/ None
* Add missing timeout arg to mocked methed
* Make async/sync generate_content have same formatting
* Add missing timeout arg to embedding mocks
* Add request_options param
* Test generate answer called w/ req opts
* Test embed_content called w/ req opts
* Test count_tokens called w/ req opts
* Test async generate_content called w/ req opts
* Test embed/generate text called w/ req opts
* Fixup mocked methods w/ missing req opts
* Test batch_embed_text called w/ req opts
* Test count_text_tokens called w/ req opts
* Test create_corpus called w/ req opts
* Test corpus called w/ req opts
* Unpack req opts, hande None case
* Handle exc instead of assert raises
* Handle failing tests
* Test batch_embed_contents called w/ req opts
* Test get_model called w/ req opts
* Test get_tuned_model called w/ req opts
* Test list_models called w/ req opts
* Test list_tuned_models called w/ req opts
* Test update_tuned_model called w/ req opts
* Test delete_tuned_model called w/ req opts
* Test create_tuned_model called w/ req opts
* Add missing kwarg to mocked client method
* Pass req opts to update tuned model client method
* Test update_corpus called w/ req opts
* Test list_corpora called w/ req opts
* Test query_corpus called w/ req opts
* Test delete_corpus called w/ req opts
* Rm unneeded try catch on delete corpus
* Test create_document called w/ req opts
* Import missing Any
* Test embed_content called w/ req opts
* Test sync count_tokens called w/ req opts
* Test create_corpus called w/ req opts
* Test async embed_content called w/ req opts
* Test generate_message called w/ req opts
* Test get_corpus called w/ req opts
* Test update_corpus called w/ req opts
* Test get_document called w/ req opts
* Test update_document called w/ req opts
* Test list_documents called w/ req opts
* Test delete_document called w/ req opts
* Test query_document called w/ req opts
* Test create_chunk called w/ req opts
* Test batch_create_chunks called w/ req opts
* Test get_chunk called w/ req opts
* Test list_chunks called w/ req opts
* Test update_chunk called w/ req opts
* Test batch_update_chunks called w/ req opts
* Test delete_chunk called w/ req opts
* Test batch_delete_chunks called w/ req opts
* Add req opts to docstrings
* Add couple more docstrs 4 req opts
* Remove stray timeout.
---------
Co-authored-by: Mark Daoust <[email protected]>1 parent bcec1b5 commit c3c90f8
File tree
21 files changed
+1197
-129
lines changed- google/generativeai
- types
- tests
21 files changed
+1197
-129
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| 168 | + | |
168 | 169 | | |
169 | 170 | | |
170 | 171 | | |
| |||
177 | 178 | | |
178 | 179 | | |
179 | 180 | | |
| 181 | + | |
180 | 182 | | |
181 | 183 | | |
182 | 184 | | |
183 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
184 | 189 | | |
185 | 190 | | |
186 | 191 | | |
| |||
193 | 198 | | |
194 | 199 | | |
195 | 200 | | |
196 | | - | |
| 201 | + | |
197 | 202 | | |
198 | 203 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
| 319 | + | |
319 | 320 | | |
320 | 321 | | |
321 | 322 | | |
| |||
382 | 383 | | |
383 | 384 | | |
384 | 385 | | |
| 386 | + | |
385 | 387 | | |
386 | 388 | | |
387 | 389 | | |
| |||
398 | 400 | | |
399 | 401 | | |
400 | 402 | | |
401 | | - | |
| 403 | + | |
402 | 404 | | |
403 | 405 | | |
404 | 406 | | |
| |||
414 | 416 | | |
415 | 417 | | |
416 | 418 | | |
| 419 | + | |
417 | 420 | | |
418 | 421 | | |
419 | 422 | | |
| |||
427 | 430 | | |
428 | 431 | | |
429 | 432 | | |
430 | | - | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
431 | 436 | | |
432 | 437 | | |
433 | 438 | | |
| |||
461 | 466 | | |
462 | 467 | | |
463 | 468 | | |
464 | | - | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
465 | 474 | | |
466 | 475 | | |
467 | 476 | | |
| |||
477 | 486 | | |
478 | 487 | | |
479 | 488 | | |
480 | | - | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
481 | 492 | | |
482 | 493 | | |
483 | 494 | | |
| |||
526 | 537 | | |
527 | 538 | | |
528 | 539 | | |
| 540 | + | |
529 | 541 | | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
530 | 545 | | |
531 | 546 | | |
532 | 547 | | |
533 | | - | |
| 548 | + | |
534 | 549 | | |
535 | 550 | | |
536 | 551 | | |
537 | 552 | | |
538 | 553 | | |
539 | 554 | | |
540 | 555 | | |
| 556 | + | |
541 | 557 | | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
542 | 561 | | |
543 | 562 | | |
544 | 563 | | |
545 | | - | |
| 564 | + | |
546 | 565 | | |
547 | 566 | | |
548 | 567 | | |
| |||
555 | 574 | | |
556 | 575 | | |
557 | 576 | | |
| 577 | + | |
558 | 578 | | |
559 | 579 | | |
560 | 580 | | |
561 | 581 | | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
562 | 585 | | |
563 | 586 | | |
564 | 587 | | |
565 | | - | |
| 588 | + | |
566 | 589 | | |
567 | 590 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| 98 | + | |
98 | 99 | | |
99 | 100 | | |
100 | 101 | | |
| |||
105 | 106 | | |
106 | 107 | | |
107 | 108 | | |
| 109 | + | |
108 | 110 | | |
109 | 111 | | |
110 | 112 | | |
| |||
114 | 116 | | |
115 | 117 | | |
116 | 118 | | |
| 119 | + | |
117 | 120 | | |
118 | 121 | | |
119 | 122 | | |
| |||
132 | 135 | | |
133 | 136 | | |
134 | 137 | | |
| 138 | + | |
| 139 | + | |
135 | 140 | | |
136 | 141 | | |
137 | 142 | | |
138 | 143 | | |
139 | 144 | | |
140 | 145 | | |
141 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
142 | 150 | | |
143 | 151 | | |
144 | 152 | | |
| |||
160 | 168 | | |
161 | 169 | | |
162 | 170 | | |
163 | | - | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
164 | 175 | | |
165 | 176 | | |
166 | 177 | | |
167 | 178 | | |
168 | 179 | | |
169 | 180 | | |
170 | 181 | | |
171 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
172 | 186 | | |
173 | 187 | | |
174 | 188 | | |
| |||
181 | 195 | | |
182 | 196 | | |
183 | 197 | | |
| 198 | + | |
184 | 199 | | |
185 | 200 | | |
186 | 201 | | |
| |||
191 | 206 | | |
192 | 207 | | |
193 | 208 | | |
| 209 | + | |
194 | 210 | | |
195 | 211 | | |
196 | 212 | | |
| |||
200 | 216 | | |
201 | 217 | | |
202 | 218 | | |
| 219 | + | |
203 | 220 | | |
204 | 221 | | |
205 | 222 | | |
206 | 223 | | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
207 | 227 | | |
208 | 228 | | |
209 | 229 | | |
| |||
225 | 245 | | |
226 | 246 | | |
227 | 247 | | |
228 | | - | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
229 | 252 | | |
230 | 253 | | |
231 | 254 | | |
232 | 255 | | |
233 | 256 | | |
234 | 257 | | |
235 | 258 | | |
236 | | - | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
237 | 263 | | |
238 | 264 | | |
239 | 265 | | |
0 commit comments