langchain-serpex-python 0.1.0__tar.gz → 0.1.5__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: langchain-serpex-python
3
- Version: 0.1.0
3
+ Version: 0.1.5
4
4
  Summary: An integration package connecting SERPEX and LangChain (Python)
5
5
  Project-URL: Homepage, https://docs.langchain.com/oss/python/integrations/providers/serpex
6
6
  Project-URL: Documentation, https://serpex.dev/docs
@@ -8,9 +8,9 @@ Project-URL: Source, https://github.com/divyeshradadiya/langchain-serpex
8
8
  Project-URL: Repository, https://github.com/divyeshradadiya/langchain-serpex
9
9
  License: MIT
10
10
  License-File: LICENSE
11
- Requires-Python: <4.0.0,>=3.10.0
11
+ Requires-Python: <4.0.0,>=3.9.0
12
12
  Requires-Dist: httpx>=0.27.0
13
- Requires-Dist: langchain-core<2.0.0,>=1.0.0
13
+ Requires-Dist: langchain-core<1.0.0,>=0.3.0
14
14
  Description-Content-Type: text/markdown
15
15
 
16
16
  # langchain-serpex-python
@@ -53,8 +53,7 @@ from langchain_serpex_python import SerpexSearchResults
53
53
  # Initialize the tool
54
54
  tool = SerpexSearchResults(
55
55
  api_key="your-serpex-api-key",
56
- engine="google",
57
- num_results=10
56
+ engine="google"
58
57
  )
59
58
 
60
59
  # Perform a search
@@ -72,8 +71,7 @@ from langchain.agents import initialize_agent, AgentType
72
71
  # Initialize the search tool
73
72
  search_tool = SerpexSearchResults(
74
73
  api_key="your-serpex-api-key",
75
- engine="google",
76
- num_results=5
74
+ engine="google"
77
75
  )
78
76
 
79
77
  # Initialize the LLM
@@ -101,12 +99,7 @@ from langchain_serpex_python import SerpexSearchResults
101
99
  tool = SerpexSearchResults(
102
100
  api_key="your-serpex-api-key",
103
101
  engine="google",
104
- num_results=20,
105
- gl="us", # Country code
106
- hl="en", # Language code
107
- location="New York", # Specific location
108
- time_period="m", # Results from past month
109
- safe_search="moderate"
102
+ time_range="month"
110
103
  )
111
104
 
112
105
  # Search for location-specific results
@@ -153,13 +146,9 @@ tool = SerpexSearchResults() # Will use SERPEX_API_KEY from environment
153
146
  ### Parameters
154
147
 
155
148
  - `api_key` (str): Your SERPEX API key (required)
156
- - `engine` (str): Search engine to use - "google", "bing", "duckduckgo", "baidu", "yandex" (default: "google")
157
- - `num_results` (int): Number of results to return, 1-100 (default: 10)
158
- - `gl` (str): Country code for localized results (e.g., "us", "uk", "ca")
159
- - `hl` (str): Language code (e.g., "en", "es", "fr")
160
- - `location` (str): Specific location for localized results
161
- - `time_period` (str): Time filter - "d" (day), "w" (week), "m" (month), "y" (year)
162
- - `safe_search` (str): Safe search filter - "off", "moderate", "strict"
149
+ - `engine` (str): Search engine to use - "auto", "google", "bing", "duckduckgo", "brave", "yahoo", "yandex" (default: "auto")
150
+ - `category` (str): Search category - currently only "web" is supported (default: "web")
151
+ - `time_range` (str): Time filter - "all", "day", "week", "month", "year" (not supported by Brave)
163
152
 
164
153
  ## Documentation
165
154
 
@@ -38,8 +38,7 @@ from langchain_serpex_python import SerpexSearchResults
38
38
  # Initialize the tool
39
39
  tool = SerpexSearchResults(
40
40
  api_key="your-serpex-api-key",
41
- engine="google",
42
- num_results=10
41
+ engine="google"
43
42
  )
44
43
 
45
44
  # Perform a search
@@ -57,8 +56,7 @@ from langchain.agents import initialize_agent, AgentType
57
56
  # Initialize the search tool
58
57
  search_tool = SerpexSearchResults(
59
58
  api_key="your-serpex-api-key",
60
- engine="google",
61
- num_results=5
59
+ engine="google"
62
60
  )
63
61
 
64
62
  # Initialize the LLM
@@ -86,12 +84,7 @@ from langchain_serpex_python import SerpexSearchResults
86
84
  tool = SerpexSearchResults(
87
85
  api_key="your-serpex-api-key",
88
86
  engine="google",
89
- num_results=20,
90
- gl="us", # Country code
91
- hl="en", # Language code
92
- location="New York", # Specific location
93
- time_period="m", # Results from past month
94
- safe_search="moderate"
87
+ time_range="month"
95
88
  )
96
89
 
97
90
  # Search for location-specific results
@@ -138,13 +131,9 @@ tool = SerpexSearchResults() # Will use SERPEX_API_KEY from environment
138
131
  ### Parameters
139
132
 
140
133
  - `api_key` (str): Your SERPEX API key (required)
141
- - `engine` (str): Search engine to use - "google", "bing", "duckduckgo", "baidu", "yandex" (default: "google")
142
- - `num_results` (int): Number of results to return, 1-100 (default: 10)
143
- - `gl` (str): Country code for localized results (e.g., "us", "uk", "ca")
144
- - `hl` (str): Language code (e.g., "en", "es", "fr")
145
- - `location` (str): Specific location for localized results
146
- - `time_period` (str): Time filter - "d" (day), "w" (week), "m" (month), "y" (year)
147
- - `safe_search` (str): Safe search filter - "off", "moderate", "strict"
134
+ - `engine` (str): Search engine to use - "auto", "google", "bing", "duckduckgo", "brave", "yahoo", "yandex" (default: "auto")
135
+ - `category` (str): Search category - currently only "web" is supported (default: "web")
136
+ - `time_range` (str): Time filter - "all", "day", "week", "month", "year" (not supported by Brave)
148
137
 
149
138
  ## Documentation
150
139
 
@@ -1,9 +1,7 @@
1
1
  """SERPEX Search Tool for LangChain."""
2
2
 
3
- from __future__ import annotations
4
-
5
3
  import os
6
- from typing import Any
4
+ from typing import Any, Optional
7
5
 
8
6
  import httpx
9
7
  from langchain_core.callbacks import CallbackManagerForToolRun
@@ -94,7 +92,7 @@ class SerpexSearchResults(BaseTool):
94
92
  default="web",
95
93
  description="Search category (currently only 'web' supported)",
96
94
  )
97
- time_range: str | None = Field(
95
+ time_range: Optional[str] = Field(
98
96
  default=None,
99
97
  description=(
100
98
  "Time range: all, day, week, month, year (not supported by Brave)"
@@ -214,7 +212,7 @@ class SerpexSearchResults(BaseTool):
214
212
  def _run(
215
213
  self,
216
214
  query: str,
217
- run_manager: CallbackManagerForToolRun | None = None,
215
+ run_manager: Optional[CallbackManagerForToolRun] = None,
218
216
  **kwargs: Any,
219
217
  ) -> str:
220
218
  """Execute the search."""
@@ -248,7 +246,7 @@ class SerpexSearchResults(BaseTool):
248
246
  async def _arun(
249
247
  self,
250
248
  query: str,
251
- run_manager: CallbackManagerForToolRun | None = None,
249
+ run_manager: Optional[CallbackManagerForToolRun] = None,
252
250
  **kwargs: Any,
253
251
  ) -> str:
254
252
  """Execute the search asynchronously."""
@@ -4,15 +4,15 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "langchain-serpex-python"
7
- version = "0.1.0"
7
+ version = "0.1.5"
8
8
  description = "An integration package connecting SERPEX and LangChain (Python)"
9
9
  readme = "README.md"
10
10
  license = {text = "MIT"}
11
11
  authors = []
12
- requires-python = ">=3.10.0,<4.0.0"
12
+ requires-python = ">=3.9.0,<4.0.0"
13
13
  dependencies = [
14
- "langchain-core>=1.0.0,<2.0.0",
15
- "httpx>=0.27.0",
14
+ "langchain-core>=0.3.0,<1.0.0",
15
+ "httpx>=0.27.0",
16
16
  ]
17
17
 
18
18
  [project.urls]