aidputils.agents.tools.experimental.web_search¶
- class aidputils.agents.tools.experimental.web_search.WebSearchTool[source]¶
Bases:
BaseToolWEB_SEARCH tool (runtime in aidp-utils).
Dynamic tool that delegates to a configured HTTP endpoint (proxy) which performs the actual web search using the specified provider.
This implementation uses GenericRestClient (requests-based) to ensure consistent signing/auth, retries, and response handling across tools.
- Required conf:
search_engine: provider identifier (e.g., BRAVE, TAVILY, AZURE, CUSTOM_HTTP)
endpoint: full URL for the proxy/provider endpoint to call
- Optional conf:
auth: {“authType”: “BEARER_TOKEN”, “token”: “<token or resolver expression>”}
customHeaders: { … }
defaultTopK, defaultLanguage
- Runtime params:
query (required) OR runtime_params.values.query OR runtime_params.paramValues.values.query
topK/top_k optional
- Request payload sent to endpoint:
- {
“search_engine”: “<SEARCH_ENGINE>”, “query”: “<query>”, “top_k”: <int>, “params”: <runtime_params>
}
- Expected response:
JSON object with “results”: [ {title,url,snippet,source,publishedTime|…}, … ] (other shapes are tolerated and normalized)
- metricsUtil = <aidputils.agents.toolkit.metrics_util.MetricUtility object>¶
- success_counter = 'WEB_SEARCH_TOOL_SUCCESS_COUNTER'¶
- failure_counter = 'WEB_SEARCH_TOOL_FAILURE_COUNTER'¶