mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-12-06 02:30:41 -08:00
Remove MCP usage guide and README files; update logging in API to use print for most wanted IPs; enhance WebSearchTool to support region parameter for search queries.
This commit is contained in:
parent
01d194ff4b
commit
5276e2d6d0
4 changed files with 11 additions and 759 deletions
|
|
@ -61,6 +61,10 @@ class WebSearchTool(MCPTool):
|
|||
"type": "integer",
|
||||
"description": "Maximum number of results to return (default: 5)",
|
||||
"default": 5
|
||||
},
|
||||
"region": {
|
||||
"type": "string",
|
||||
"description": "Search region (default: en-us)"
|
||||
}
|
||||
},
|
||||
"required": ["query"]
|
||||
|
|
@ -76,6 +80,7 @@ class WebSearchTool(MCPTool):
|
|||
|
||||
query = arguments.get("query", "")
|
||||
max_results = arguments.get("max_results", 5)
|
||||
region = arguments.get("region", "en-us")
|
||||
|
||||
if not query:
|
||||
return {
|
||||
|
|
@ -88,7 +93,9 @@ class WebSearchTool(MCPTool):
|
|||
search_results = await anext(CachedSearch.create_async_generator(
|
||||
"",
|
||||
[],
|
||||
prompt=query
|
||||
prompt=query,
|
||||
max_results=max_results,
|
||||
region=region
|
||||
))
|
||||
|
||||
return {
|
||||
|
|
@ -232,7 +239,8 @@ class ImageGenerationTool(MCPTool):
|
|||
model=model,
|
||||
prompt=prompt,
|
||||
width=width,
|
||||
height=height
|
||||
height=height,
|
||||
response_format="url"
|
||||
)
|
||||
|
||||
# Get the image data with proper validation
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue