Просмотр исходного кода

feat(search.py): 支持输入内容类型-视频/图文

tanjingyu 12 часов назад
Родитель
Сommit
601678b9e6
1 измененных файлов с 3 добавлено и 0 удалено
  1. 3 0
      agent/tools/builtin/search.py

+ 3 - 0
agent/tools/builtin/search.py

@@ -77,6 +77,7 @@ async def search_posts(
     channel: str = "xhs",
     cursor: str = "0",
     max_count: int = 5,
+    content_type: str = ""
 ) -> ToolResult:
     """
     帖子搜索
@@ -97,6 +98,7 @@ async def search_posts(
             - weibo: 微博
         cursor: 分页游标,默认为 "0"(第一页)
         max_count: 返回的最大条数,默认为 5
+        content_type:内容类型-视频/图文,默认不传为不限制类型
 
     Returns:
         ToolResult 包含搜索结果:
@@ -129,6 +131,7 @@ async def search_posts(
             "keyword": keyword,
             "cursor": cursor,
             "max_count": max_count,
+            "content_type": content_type
         }
 
         async with httpx.AsyncClient(timeout=DEFAULT_TIMEOUT) as client: