by qianfan · v0.0.1
Provided by Baidu Qianfan
This community listing does not yet include every recommended support, privacy, pricing, and permission disclosure. Review the available package permissions before installing.
Available inside your emploidai workspace after installation.
Available inside your emploidai workspace after installation.
Baidu AI Search Plugin provides powerful search capabilities for the Dify platform, supporting both basic search and intelligent search generation modes.
Function Overview
Searches real-time information across the web based on user queries and returns summaries, URLs, and other information.
Parameter Description
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | Yes | Search keywords or phrases used to specify the content to be searched. Supports natural language queries and can contain multiple keywords. Agents should construct appropriate query statements based on user intent to ensure the accuracy and relevance of search results |
resource_type_filter | array | No | Specifies the types of search resources and the number of results returned for each type. Default configuration is [{"type": "web","top_k": 10}], indicating that only web-based search results are returned, with a maximum of 10 results |
Example Code
# Basic search
result = tools.baidu_web_search(query="Tourist attractions in Beijing")
# Custom resource filtering
result = tools.baidu_web_search(
query="Tourist attractions in Beijing",
resource_type_filter=[{"type": "web", "top_k": 5}]
)
Function Overview
Searches real-time information across the web based on user queries and provides intelligent summarized responses.
Parameter Description
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | Yes | Search keywords or phrases used to specify the content to be searched. Supports natural language queries and can contain multiple keywords. Agents should construct appropriate query statements based on user intent to ensure the accuracy and relevance of search results |
model | string | No | Specifies the LLM model for search result summarization. When empty string, it uses Baidu basic search and returns raw results; when specified as "ERNIE-3.5-8K", it uses the corresponding large model for intelligent summarization. Model documentation: Baidu Qianfan Model List |
instruction | string | No | Instruction parameters used to control the style and format of search result output. Such as: result sorting method, content filtering conditions, output format, etc. When not specified, the default search result display method will be used |
temperature | float | No | Sampling parameter that controls the randomness of model output, range is (0, 1]. Default value is 1e-10. This parameter only takes effect when the model parameter specifies an LLM model |
top_p | float | No | Nucleus sampling parameter that controls the diversity of model output, default value is 1e-10. This parameter only takes effect when the model parameter specifies an LLM model |
resource_type_filter | array | No | Specifies the types of search resources and the number of results returned for each type. Default configuration is [{"type": "web","top_k": 10}], indicating that only web-based search results are returned, with a maximum of 10 results |
Model Support
Example Code
# Basic smart search
result = tools.smart_search(query="Tourist attractions in Beijing")
# Advanced smart search
result = tools.smart_search(
query="Tourist attractions in Beijing",
model="ERNIE-3.5-8K",
instruction="Summarize key points in list format, sorted by time in descending order",
temperature=0.7,
top_p=0.9,
resource_type_filter=[{"type": "web", "top_k": 10}]
)
For any questions or suggestions, please contact the developer or refer to Baidu Qianfan Documentation.