dlgforge.tools.web_search¶
Serper web-search integration helper.
SerperWebSearchClient(num_results=5, timeout=30, api_key=None)
¶
Serper web search client.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
num_results
|
int
|
int value used by this operation. |
5
|
timeout
|
int
|
int value used by this operation. |
30
|
api_key
|
str | None
|
str | None value used by this operation. |
None
|
Raises:
| Type | Description |
|---|---|
Exception
|
Construction may raise when required dependencies or inputs are invalid. |
Side Effects / I/O: - May perform network, model, or distributed runtime operations.
Preconditions / Invariants: - Instantiate and use through documented public methods.
Examples:
>>> from dlgforge.tools.web_search import SerperWebSearchClient
>>> SerperWebSearchClient(...)
search(query)
¶
Execute a web search query.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
Input text. |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
Dict[str, Any]: Value produced by this API. |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
Raised when validation or runtime requirements are not met. |
Side Effects / I/O: - May perform network, model, or distributed runtime operations.
Preconditions / Invariants: - Callers should provide arguments matching annotated types and expected data contracts.
Examples:
>>> from dlgforge.tools.web_search import SerperWebSearchClient
>>> instance = SerperWebSearchClient(...)
>>> instance.search(...)