tavily-python 0.7.12__tar.gz → 0.7.13__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (22) hide show
  1. {tavily_python-0.7.12 → tavily_python-0.7.13}/PKG-INFO +2 -2
  2. {tavily_python-0.7.12 → tavily_python-0.7.13}/setup.py +2 -2
  3. {tavily_python-0.7.12 → tavily_python-0.7.13}/tavily/async_tavily.py +13 -20
  4. {tavily_python-0.7.12 → tavily_python-0.7.13}/tavily/errors.py +1 -1
  5. {tavily_python-0.7.12 → tavily_python-0.7.13}/tavily/tavily.py +15 -24
  6. {tavily_python-0.7.12 → tavily_python-0.7.13}/tavily_python.egg-info/PKG-INFO +2 -2
  7. {tavily_python-0.7.12 → tavily_python-0.7.13}/LICENSE +0 -0
  8. {tavily_python-0.7.12 → tavily_python-0.7.13}/README.md +0 -0
  9. {tavily_python-0.7.12 → tavily_python-0.7.13}/setup.cfg +0 -0
  10. {tavily_python-0.7.12 → tavily_python-0.7.13}/tavily/__init__.py +0 -0
  11. {tavily_python-0.7.12 → tavily_python-0.7.13}/tavily/config.py +0 -0
  12. {tavily_python-0.7.12 → tavily_python-0.7.13}/tavily/hybrid_rag/__init__.py +0 -0
  13. {tavily_python-0.7.12 → tavily_python-0.7.13}/tavily/hybrid_rag/hybrid_rag.py +0 -0
  14. {tavily_python-0.7.12 → tavily_python-0.7.13}/tavily/utils.py +0 -0
  15. {tavily_python-0.7.12 → tavily_python-0.7.13}/tavily_python.egg-info/SOURCES.txt +0 -0
  16. {tavily_python-0.7.12 → tavily_python-0.7.13}/tavily_python.egg-info/dependency_links.txt +0 -0
  17. {tavily_python-0.7.12 → tavily_python-0.7.13}/tavily_python.egg-info/requires.txt +0 -0
  18. {tavily_python-0.7.12 → tavily_python-0.7.13}/tavily_python.egg-info/top_level.txt +0 -0
  19. {tavily_python-0.7.12 → tavily_python-0.7.13}/tests/test_crawl.py +0 -0
  20. {tavily_python-0.7.12 → tavily_python-0.7.13}/tests/test_errors.py +0 -0
  21. {tavily_python-0.7.12 → tavily_python-0.7.13}/tests/test_map.py +0 -0
  22. {tavily_python-0.7.12 → tavily_python-0.7.13}/tests/test_search.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tavily-python
3
- Version: 0.7.12
3
+ Version: 0.7.13
4
4
  Summary: Python wrapper for the Tavily API
5
5
  Home-page: https://github.com/tavily-ai/tavily-python
6
6
  Author: Tavily AI
@@ -8,7 +8,7 @@ Author-email: support@tavily.com
8
8
  Classifier: Programming Language :: Python :: 3
9
9
  Classifier: License :: OSI Approved :: MIT License
10
10
  Classifier: Operating System :: OS Independent
11
- Requires-Python: >=3.6
11
+ Requires-Python: >=3.8
12
12
  Description-Content-Type: text/markdown
13
13
  License-File: LICENSE
14
14
  Requires-Dist: requests
@@ -5,7 +5,7 @@ with open('README.md', 'r', encoding='utf-8') as f:
5
5
 
6
6
  setup(
7
7
  name='tavily-python',
8
- version='0.7.12',
8
+ version='0.7.13',
9
9
  url='https://github.com/tavily-ai/tavily-python',
10
10
  author='Tavily AI',
11
11
  author_email='support@tavily.com',
@@ -19,5 +19,5 @@ setup(
19
19
  'License :: OSI Approved :: MIT License',
20
20
  'Operating System :: OS Independent',
21
21
  ],
22
- python_requires='>=3.6',
22
+ python_requires='>=3.8',
23
23
  )
@@ -66,7 +66,7 @@ class AsyncTavilyClient:
66
66
  include_answer: Union[bool, Literal["basic", "advanced"]] = None,
67
67
  include_raw_content: Union[bool, Literal["markdown", "text"]] = None,
68
68
  include_images: bool = None,
69
- timeout: int = 60,
69
+ timeout: float = 60,
70
70
  country: str = None,
71
71
  auto_parameters: bool = None,
72
72
  include_favicon: bool = None,
@@ -141,7 +141,7 @@ class AsyncTavilyClient:
141
141
  include_answer: Union[bool, Literal["basic", "advanced"]] = None,
142
142
  include_raw_content: Union[bool, Literal["markdown", "text"]] = None,
143
143
  include_images: bool = None,
144
- timeout: int = 60,
144
+ timeout: float = 60,
145
145
  country: str = None,
146
146
  auto_parameters: bool = None,
147
147
  include_favicon: bool = None,
@@ -183,7 +183,7 @@ class AsyncTavilyClient:
183
183
  include_images: bool = None,
184
184
  extract_depth: Literal["basic", "advanced"] = None,
185
185
  format: Literal["markdown", "text"] = None,
186
- timeout: int = 30,
186
+ timeout: float = 30,
187
187
  include_favicon: bool = None,
188
188
  **kwargs
189
189
  ) -> dict:
@@ -205,8 +205,6 @@ class AsyncTavilyClient:
205
205
  if kwargs:
206
206
  data.update(kwargs)
207
207
 
208
- timeout = min(timeout, 120)
209
-
210
208
  async with self._client_creator() as client:
211
209
  try:
212
210
  response = await client.post("/extract", content=json.dumps(data), timeout=timeout)
@@ -239,7 +237,7 @@ class AsyncTavilyClient:
239
237
  include_images: bool = None,
240
238
  extract_depth: Literal["basic", "advanced"] = None,
241
239
  format: Literal["markdown", "text"] = None,
242
- timeout: int = 30,
240
+ timeout: float = 30,
243
241
  include_favicon: bool = None,
244
242
  **kwargs, # Accept custom arguments
245
243
  ) -> dict:
@@ -247,7 +245,6 @@ class AsyncTavilyClient:
247
245
  Combined extract method.
248
246
  include_favicon: If True, include the favicon in the extraction results.
249
247
  """
250
- timeout = min(timeout, 120)
251
248
  response_dict = await self._extract(urls,
252
249
  include_images,
253
250
  extract_depth,
@@ -279,7 +276,7 @@ class AsyncTavilyClient:
279
276
  include_images: bool = None,
280
277
  extract_depth: Literal["basic", "advanced"] = None,
281
278
  format: Literal["markdown", "text"] = None,
282
- timeout: int = 60,
279
+ timeout: float = 150,
283
280
  include_favicon: bool = None,
284
281
  **kwargs
285
282
  ) -> dict:
@@ -300,6 +297,7 @@ class AsyncTavilyClient:
300
297
  "include_images": include_images,
301
298
  "extract_depth": extract_depth,
302
299
  "format": format,
300
+ "timeout": timeout,
303
301
  "include_favicon": include_favicon,
304
302
  }
305
303
 
@@ -308,8 +306,6 @@ class AsyncTavilyClient:
308
306
 
309
307
  data = {k: v for k, v in data.items() if v is not None}
310
308
 
311
- timeout = min(timeout, 120)
312
-
313
309
  async with self._client_creator() as client:
314
310
  try:
315
311
  response = await client.post("/crawl", content=json.dumps(data), timeout=timeout)
@@ -350,7 +346,7 @@ class AsyncTavilyClient:
350
346
  extract_depth: Literal["basic", "advanced"] = None,
351
347
  include_images: bool = None,
352
348
  format: Literal["markdown", "text"] = None,
353
- timeout: int = 60,
349
+ timeout: float = 150,
354
350
  include_favicon: bool = None,
355
351
  **kwargs
356
352
  ) -> dict:
@@ -358,7 +354,6 @@ class AsyncTavilyClient:
358
354
  Combined crawl method.
359
355
 
360
356
  """
361
- timeout = min(timeout, 120)
362
357
  response_dict = await self._crawl(url,
363
358
  max_depth=max_depth,
364
359
  max_breadth=max_breadth,
@@ -390,7 +385,7 @@ class AsyncTavilyClient:
390
385
  exclude_domains: Sequence[str] = None,
391
386
  allow_external: bool = None,
392
387
  include_images: bool = None,
393
- timeout: int = 60,
388
+ timeout: float = 150,
394
389
  **kwargs
395
390
  ) -> dict:
396
391
  """
@@ -408,6 +403,7 @@ class AsyncTavilyClient:
408
403
  "exclude_domains": exclude_domains,
409
404
  "allow_external": allow_external,
410
405
  "include_images": include_images,
406
+ "timeout": timeout,
411
407
  }
412
408
 
413
409
  if kwargs:
@@ -415,8 +411,6 @@ class AsyncTavilyClient:
415
411
 
416
412
  data = {k: v for k, v in data.items() if v is not None}
417
413
 
418
- timeout = min(timeout, 120)
419
-
420
414
  async with self._client_creator() as client:
421
415
  try:
422
416
  response = await client.post("/map", content=json.dumps(data), timeout=timeout)
@@ -455,14 +449,13 @@ class AsyncTavilyClient:
455
449
  exclude_domains: Sequence[str] = None,
456
450
  allow_external: bool = None,
457
451
  include_images: bool = None,
458
- timeout: int = 60,
452
+ timeout: float = 150,
459
453
  **kwargs
460
454
  ) -> dict:
461
455
  """
462
456
  Combined map method.
463
457
 
464
458
  """
465
- timeout = min(timeout, 120)
466
459
  response_dict = await self._map(url,
467
460
  max_depth=max_depth,
468
461
  max_breadth=max_breadth,
@@ -488,7 +481,7 @@ class AsyncTavilyClient:
488
481
  include_domains: Sequence[str] = None,
489
482
  exclude_domains: Sequence[str] = None,
490
483
  max_tokens: int = 4000,
491
- timeout: int = 60,
484
+ timeout: float = 60,
492
485
  country: str = None,
493
486
  include_favicon: bool = None,
494
487
  **kwargs, # Accept custom arguments
@@ -529,7 +522,7 @@ class AsyncTavilyClient:
529
522
  max_results: int = 5,
530
523
  include_domains: Sequence[str] = None,
531
524
  exclude_domains: Sequence[str] = None,
532
- timeout: int = 60,
525
+ timeout: float = 60,
533
526
  country: str = None,
534
527
  include_favicon: bool = None,
535
528
  **kwargs, # Accept custom arguments
@@ -559,7 +552,7 @@ class AsyncTavilyClient:
559
552
  query: str,
560
553
  search_depth: Literal["basic", "advanced"] = "advanced",
561
554
  max_results: int = 5,
562
- timeout: int = 60,
555
+ timeout: float = 60,
563
556
  country: str = None,
564
557
  ) -> Sequence[dict]:
565
558
  """ Company information search method. Search depth is advanced by default to get the best answer. """
@@ -17,7 +17,7 @@ class InvalidAPIKeyError(Exception):
17
17
  super().__init__(message)
18
18
 
19
19
  class TimeoutError(Exception):
20
- def __init__(self, timeout: int):
20
+ def __init__(self, timeout: float):
21
21
  super().__init__(f"Request timed out after {timeout} seconds.")
22
22
 
23
23
  class MissingAPIKeyError(Exception):
@@ -49,7 +49,7 @@ class TavilyClient:
49
49
  include_answer: Union[bool, Literal["basic", "advanced"]] = None,
50
50
  include_raw_content: Union[bool, Literal["markdown", "text"]] = None,
51
51
  include_images: bool = None,
52
- timeout: int = 60,
52
+ timeout: float = 60,
53
53
  country: str = None,
54
54
  auto_parameters: bool = None,
55
55
  include_favicon: bool = None,
@@ -126,7 +126,7 @@ class TavilyClient:
126
126
  include_answer: Union[bool, Literal["basic", "advanced"]] = None,
127
127
  include_raw_content: Union[bool, Literal["markdown", "text"]] = None,
128
128
  include_images: bool = None,
129
- timeout: int = 60,
129
+ timeout: float = 60,
130
130
  country: str = None,
131
131
  auto_parameters: bool = None,
132
132
  include_favicon: bool = None,
@@ -135,7 +135,7 @@ class TavilyClient:
135
135
  """
136
136
  Combined search method.
137
137
  """
138
- timeout = min(timeout, 120)
138
+
139
139
  response_dict = self._search(query,
140
140
  search_depth=search_depth,
141
141
  topic=topic,
@@ -167,7 +167,7 @@ class TavilyClient:
167
167
  include_images: bool = None,
168
168
  extract_depth: Literal["basic", "advanced"] = None,
169
169
  format: Literal["markdown", "text"] = None,
170
- timeout: int = 30,
170
+ timeout: float = 30,
171
171
  include_favicon: bool = None,
172
172
  **kwargs
173
173
  ) -> dict:
@@ -188,8 +188,6 @@ class TavilyClient:
188
188
  if kwargs:
189
189
  data.update(kwargs)
190
190
 
191
- timeout = min(timeout, 120)
192
-
193
191
  try:
194
192
  response = requests.post(self.base_url + "/extract", data=json.dumps(data), headers=self.headers, timeout=timeout, proxies=self.proxies)
195
193
  except requests.exceptions.Timeout:
@@ -220,14 +218,13 @@ class TavilyClient:
220
218
  include_images: bool = None,
221
219
  extract_depth: Literal["basic", "advanced"] = None,
222
220
  format: Literal["markdown", "text"] = None,
223
- timeout: int = 30,
221
+ timeout: float = 30,
224
222
  include_favicon: bool = None,
225
223
  **kwargs, # Accept custom arguments
226
224
  ) -> dict:
227
225
  """
228
226
  Combined extract method.
229
227
  """
230
- timeout = min(timeout, 120)
231
228
  response_dict = self._extract(urls,
232
229
  include_images,
233
230
  extract_depth,
@@ -258,7 +255,7 @@ class TavilyClient:
258
255
  include_images: bool = None,
259
256
  extract_depth: Literal["basic", "advanced"] = None,
260
257
  format: Literal["markdown", "text"] = None,
261
- timeout: int = 60,
258
+ timeout: float = 150,
262
259
  include_favicon: bool = None,
263
260
  **kwargs
264
261
  ) -> dict:
@@ -280,6 +277,7 @@ class TavilyClient:
280
277
  "include_images": include_images,
281
278
  "extract_depth": extract_depth,
282
279
  "format": format,
280
+ "timeout": timeout,
283
281
  "include_favicon": include_favicon,
284
282
  }
285
283
 
@@ -287,8 +285,6 @@ class TavilyClient:
287
285
  data.update(kwargs)
288
286
 
289
287
  data = {k: v for k, v in data.items() if v is not None}
290
-
291
- timeout = min(timeout, 120)
292
288
 
293
289
  try:
294
290
  response = requests.post(
@@ -330,7 +326,7 @@ class TavilyClient:
330
326
  include_images: bool = None,
331
327
  extract_depth: Literal["basic", "advanced"] = None,
332
328
  format: Literal["markdown", "text"] = None,
333
- timeout: int = 60,
329
+ timeout: float = 150,
334
330
  include_favicon: bool = None,
335
331
  **kwargs
336
332
  ) -> dict:
@@ -338,7 +334,6 @@ class TavilyClient:
338
334
  Combined crawl method.
339
335
  include_favicon: If True, include the favicon in the crawl results.
340
336
  """
341
- timeout = min(timeout, 120)
342
337
  response_dict = self._crawl(url,
343
338
  max_depth=max_depth,
344
339
  max_breadth=max_breadth,
@@ -370,7 +365,7 @@ class TavilyClient:
370
365
  exclude_domains: Sequence[str] = None,
371
366
  allow_external: bool = None,
372
367
  include_images: bool = None,
373
- timeout: int = 60,
368
+ timeout: float = 150,
374
369
  **kwargs
375
370
  ) -> dict:
376
371
  """
@@ -388,6 +383,7 @@ class TavilyClient:
388
383
  "exclude_domains": exclude_domains,
389
384
  "allow_external": allow_external,
390
385
  "include_images": include_images,
386
+ "timeout": timeout,
391
387
  }
392
388
 
393
389
  if kwargs:
@@ -395,8 +391,6 @@ class TavilyClient:
395
391
 
396
392
  data = {k: v for k, v in data.items() if v is not None}
397
393
 
398
- timeout = min(timeout, 120)
399
-
400
394
  try:
401
395
  response = requests.post(
402
396
  self.base_url + "/map", data=json.dumps(data), headers=self.headers, timeout=timeout, proxies=self.proxies)
@@ -435,14 +429,13 @@ class TavilyClient:
435
429
  exclude_domains: Sequence[str] = None,
436
430
  allow_external: bool = None,
437
431
  include_images: bool = None,
438
- timeout: int = 60,
432
+ timeout: float = 150,
439
433
  **kwargs
440
434
  ) -> dict:
441
435
  """
442
436
  Combined map method.
443
437
 
444
438
  """
445
- timeout = min(timeout, 120)
446
439
  response_dict = self._map(url,
447
440
  max_depth=max_depth,
448
441
  max_breadth=max_breadth,
@@ -468,7 +461,7 @@ class TavilyClient:
468
461
  include_domains: Sequence[str] = None,
469
462
  exclude_domains: Sequence[str] = None,
470
463
  max_tokens: int = 4000,
471
- timeout: int = 60,
464
+ timeout: float = 60,
472
465
  country: str = None,
473
466
  include_favicon: bool = None,
474
467
  **kwargs, # Accept custom arguments
@@ -481,7 +474,7 @@ class TavilyClient:
481
474
 
482
475
  Returns a string of JSON containing the search context up to context limit.
483
476
  """
484
- timeout = min(timeout, 120)
477
+
485
478
  response_dict = self._search(query,
486
479
  search_depth=search_depth,
487
480
  topic=topic,
@@ -510,7 +503,7 @@ class TavilyClient:
510
503
  max_results: int = 5,
511
504
  include_domains: Sequence[str] = None,
512
505
  exclude_domains: Sequence[str] = None,
513
- timeout: int = 60,
506
+ timeout: float = 60,
514
507
  country: str = None,
515
508
  include_favicon: bool = None,
516
509
  **kwargs, # Accept custom arguments
@@ -518,7 +511,6 @@ class TavilyClient:
518
511
  """
519
512
  Q&A search method. Search depth is advanced by default to get the best answer.
520
513
  """
521
- timeout = min(timeout, 120)
522
514
  response_dict = self._search(query,
523
515
  search_depth=search_depth,
524
516
  topic=topic,
@@ -541,11 +533,10 @@ class TavilyClient:
541
533
  search_depth: Literal["basic",
542
534
  "advanced"] = "advanced",
543
535
  max_results: int = 5,
544
- timeout: int = 60,
536
+ timeout: float = 60,
545
537
  country: str = None,
546
538
  ) -> Sequence[dict]:
547
539
  """ Company information search method. Search depth is advanced by default to get the best answer. """
548
- timeout = min(timeout, 120)
549
540
  def _perform_search(topic):
550
541
  return self._search(query,
551
542
  search_depth=search_depth,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tavily-python
3
- Version: 0.7.12
3
+ Version: 0.7.13
4
4
  Summary: Python wrapper for the Tavily API
5
5
  Home-page: https://github.com/tavily-ai/tavily-python
6
6
  Author: Tavily AI
@@ -8,7 +8,7 @@ Author-email: support@tavily.com
8
8
  Classifier: Programming Language :: Python :: 3
9
9
  Classifier: License :: OSI Approved :: MIT License
10
10
  Classifier: Operating System :: OS Independent
11
- Requires-Python: >=3.6
11
+ Requires-Python: >=3.8
12
12
  Description-Content-Type: text/markdown
13
13
  License-File: LICENSE
14
14
  Requires-Dist: requests
File without changes
File without changes
File without changes