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

Merge remote-tracking branch 'refs/remotes/origin/main'

Talegorithm 11 часов назад
Родитель
Сommit
e8caf9ab49
1 измененных файлов с 7 добавлено и 2 удалено
  1. 7 2
      agent/tools/builtin/search.py

+ 7 - 2
agent/tools/builtin/search.py

@@ -58,7 +58,8 @@ class SuggestSearchChannel(str, Enum):
                 "keyword": "搜索关键词",
                 "keyword": "搜索关键词",
                 "channel": "搜索渠道",
                 "channel": "搜索渠道",
                 "cursor": "分页游标",
                 "cursor": "分页游标",
-                "max_count": "返回条数"
+                "max_count": "返回条数",
+                "content_type": "内容类型-视频/图文"
             }
             }
         },
         },
         "en": {
         "en": {
@@ -67,7 +68,8 @@ class SuggestSearchChannel(str, Enum):
                 "keyword": "Search keyword",
                 "keyword": "Search keyword",
                 "channel": "Search channel",
                 "channel": "Search channel",
                 "cursor": "Pagination cursor",
                 "cursor": "Pagination cursor",
-                "max_count": "Max results"
+                "max_count": "Max results",
+                "content_type": "content type-视频/图文"
             }
             }
         }
         }
     }
     }
@@ -77,6 +79,7 @@ async def search_posts(
     channel: str = "xhs",
     channel: str = "xhs",
     cursor: str = "0",
     cursor: str = "0",
     max_count: int = 5,
     max_count: int = 5,
+    content_type: str = ""
 ) -> ToolResult:
 ) -> ToolResult:
     """
     """
     帖子搜索
     帖子搜索
@@ -97,6 +100,7 @@ async def search_posts(
             - weibo: 微博
             - weibo: 微博
         cursor: 分页游标,默认为 "0"(第一页)
         cursor: 分页游标,默认为 "0"(第一页)
         max_count: 返回的最大条数,默认为 5
         max_count: 返回的最大条数,默认为 5
+        content_type:内容类型-视频/图文,默认不传为不限制类型
 
 
     Returns:
     Returns:
         ToolResult 包含搜索结果:
         ToolResult 包含搜索结果:
@@ -129,6 +133,7 @@ async def search_posts(
             "keyword": keyword,
             "keyword": keyword,
             "cursor": cursor,
             "cursor": cursor,
             "max_count": max_count,
             "max_count": max_count,
+            "content_type": content_type
         }
         }
 
 
         async with httpx.AsyncClient(timeout=DEFAULT_TIMEOUT) as client:
         async with httpx.AsyncClient(timeout=DEFAULT_TIMEOUT) as client: