报告模型升级
This commit is contained in:
@@ -74,9 +74,16 @@ from typing import List, Set
|
||||
|
||||
from ddgs import DDGS
|
||||
from langchain.tools import tool
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
@tool
|
||||
class TopicResearchInput(BaseModel):
|
||||
"""Input for topic research tool."""
|
||||
topic: List[str] = Field(description="List of separate research keyword strings. Example: ['modern sofa design', 'sustainable wood furniture']")
|
||||
max_urls: int = Field(default=5, description="Maximum number of URLs to return")
|
||||
|
||||
|
||||
@tool(args_schema=TopicResearchInput)
|
||||
async def topic_research(topic: List[str], max_urls: int = 5) -> str:
|
||||
"""
|
||||
In-depth research tool (DuckDuckGo version).
|
||||
@@ -127,7 +134,6 @@ async def topic_research(topic: List[str], max_urls: int = 5) -> str:
|
||||
print(f" topic research !!!!!!!!!!!!!!!!!!!!! {selected_urls}")
|
||||
return json.dumps(selected_urls, ensure_ascii=False)
|
||||
|
||||
|
||||
# import asyncio
|
||||
#
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user