Return type standardization
This commit is contained in:
+3
-3
@@ -3,7 +3,7 @@ import urllib.parse
|
||||
import json
|
||||
import re
|
||||
import asyncio
|
||||
from typing import Any, Dict, Optional
|
||||
from typing import Any, Dict, List, Optional
|
||||
from .utils import ToolError
|
||||
import config
|
||||
|
||||
@@ -130,7 +130,7 @@ async def _fetch_toc(title: str) -> Optional[str]:
|
||||
|
||||
return "\n".join(lines)
|
||||
|
||||
async def handle(args: Dict[str, Any]) -> Dict[str, Any]:
|
||||
async def handle(args: Dict[str, Any]) -> List[Dict[str, Any]]:
|
||||
"""
|
||||
Main handler for the browse_wikipedia tool.
|
||||
Supports modes: summary, toc, section, and search.
|
||||
@@ -170,4 +170,4 @@ async def handle(args: Dict[str, Any]) -> Dict[str, Any]:
|
||||
else:
|
||||
raise ToolError(f"Invalid mode '{mode}'. Supported modes: summary, toc, section, search")
|
||||
|
||||
return {"text": result}
|
||||
return [{"type": "text", "text": result}]
|
||||
|
||||
Reference in New Issue
Block a user