tavily-python 0.7.17__tar.gz → 0.7.18__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 (23) hide show
  1. {tavily_python-0.7.17 → tavily_python-0.7.18}/PKG-INFO +1 -1
  2. {tavily_python-0.7.17 → tavily_python-0.7.18}/setup.py +1 -1
  3. {tavily_python-0.7.17 → tavily_python-0.7.18}/tavily/async_tavily.py +7 -2
  4. {tavily_python-0.7.17 → tavily_python-0.7.18}/tavily/tavily.py +6 -3
  5. {tavily_python-0.7.17 → tavily_python-0.7.18}/tavily_python.egg-info/PKG-INFO +1 -1
  6. {tavily_python-0.7.17 → tavily_python-0.7.18}/LICENSE +0 -0
  7. {tavily_python-0.7.17 → tavily_python-0.7.18}/README.md +0 -0
  8. {tavily_python-0.7.17 → tavily_python-0.7.18}/setup.cfg +0 -0
  9. {tavily_python-0.7.17 → tavily_python-0.7.18}/tavily/__init__.py +0 -0
  10. {tavily_python-0.7.17 → tavily_python-0.7.18}/tavily/config.py +0 -0
  11. {tavily_python-0.7.17 → tavily_python-0.7.18}/tavily/errors.py +0 -0
  12. {tavily_python-0.7.17 → tavily_python-0.7.18}/tavily/hybrid_rag/__init__.py +0 -0
  13. {tavily_python-0.7.17 → tavily_python-0.7.18}/tavily/hybrid_rag/hybrid_rag.py +0 -0
  14. {tavily_python-0.7.17 → tavily_python-0.7.18}/tavily/utils.py +0 -0
  15. {tavily_python-0.7.17 → tavily_python-0.7.18}/tavily_python.egg-info/SOURCES.txt +0 -0
  16. {tavily_python-0.7.17 → tavily_python-0.7.18}/tavily_python.egg-info/dependency_links.txt +0 -0
  17. {tavily_python-0.7.17 → tavily_python-0.7.18}/tavily_python.egg-info/requires.txt +0 -0
  18. {tavily_python-0.7.17 → tavily_python-0.7.18}/tavily_python.egg-info/top_level.txt +0 -0
  19. {tavily_python-0.7.17 → tavily_python-0.7.18}/tests/test_crawl.py +0 -0
  20. {tavily_python-0.7.17 → tavily_python-0.7.18}/tests/test_errors.py +0 -0
  21. {tavily_python-0.7.17 → tavily_python-0.7.18}/tests/test_map.py +0 -0
  22. {tavily_python-0.7.17 → tavily_python-0.7.18}/tests/test_research.py +0 -0
  23. {tavily_python-0.7.17 → tavily_python-0.7.18}/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.17
3
+ Version: 0.7.18
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
@@ -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.17',
8
+ version='0.7.18',
9
9
  url='https://github.com/tavily-ai/tavily-python',
10
10
  author='Tavily AI',
11
11
  author_email='support@tavily.com',
@@ -18,7 +18,8 @@ class AsyncTavilyClient:
18
18
  company_info_tags: Sequence[str] = ("news", "general", "finance"),
19
19
  proxies: Optional[dict[str, str]] = None,
20
20
  api_base_url: Optional[str] = None,
21
- client_source: Optional[str] = None):
21
+ client_source: Optional[str] = None,
22
+ project_id: Optional[str] = None):
22
23
  if api_key is None:
23
24
  api_key = os.getenv("TAVILY_API_KEY")
24
25
 
@@ -40,12 +41,16 @@ class AsyncTavilyClient:
40
41
  else None
41
42
  )
42
43
 
44
+ tavily_project = project_id or os.getenv("TAVILY_PROJECT")
45
+
43
46
  self._api_base_url = api_base_url or "https://api.tavily.com"
47
+
44
48
  self._client_creator = lambda: httpx.AsyncClient(
45
49
  headers={
46
50
  "Content-Type": "application/json",
47
51
  "Authorization": f"Bearer {api_key}",
48
- "X-Client-Source": client_source or "tavily-python"
52
+ "X-Client-Source": client_source or "tavily-python",
53
+ **({"X-Project-ID": tavily_project} if tavily_project else {})
49
54
  },
50
55
  base_url=self._api_base_url,
51
56
  mounts=proxy_mounts
@@ -12,7 +12,7 @@ class TavilyClient:
12
12
  Tavily API client class.
13
13
  """
14
14
 
15
- def __init__(self, api_key: Optional[str] = None, proxies: Optional[dict[str, str]] = None, api_base_url: Optional[str] = None, client_source: Optional[str] = None):
15
+ def __init__(self, api_key: Optional[str] = None, proxies: Optional[dict[str, str]] = None, api_base_url: Optional[str] = None, client_source: Optional[str] = None, project_id: Optional[str] = None):
16
16
  if api_key is None:
17
17
  api_key = os.getenv("TAVILY_API_KEY")
18
18
 
@@ -25,14 +25,17 @@ class TavilyClient:
25
25
  }
26
26
 
27
27
  resolved_proxies = {k: v for k, v in resolved_proxies.items() if v} or None
28
-
28
+ tavily_project = project_id or os.getenv("TAVILY_PROJECT")
29
+
29
30
  self.base_url = api_base_url or "https://api.tavily.com"
30
31
  self.api_key = api_key
31
32
  self.proxies = resolved_proxies
33
+
32
34
  self.headers = {
33
35
  "Content-Type": "application/json",
34
36
  "Authorization": f"Bearer {self.api_key}",
35
- "X-Client-Source": client_source or "tavily-python"
37
+ "X-Client-Source": client_source or "tavily-python",
38
+ **({"X-Project-ID": tavily_project} if tavily_project else {})
36
39
  }
37
40
 
38
41
  def _search(self,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tavily-python
3
- Version: 0.7.17
3
+ Version: 0.7.18
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
File without changes
File without changes
File without changes