mirror of
https://github.com/camel-ai/owl.git
synced 2026-03-22 05:57:17 +08:00
Update run_mcp_qwen3.py
This commit is contained in:
@@ -267,13 +267,18 @@ async def main():
|
|||||||
|
|
||||||
# Set default task - a simple example query
|
# Set default task - a simple example query
|
||||||
default_task = (
|
default_task = (
|
||||||
"部署一个网页,显示你好。"
|
"Visit the Qwen3 GitHub repository, summarize the introduction of the repository."
|
||||||
|
"Write a comprehensive HTML documentation site with the following features:"
|
||||||
|
"A clear introduction to Qwen3"
|
||||||
|
"Well-organized sections of the technical documentation"
|
||||||
|
"Practical code examples"
|
||||||
|
"A visually appealing purple technology theme (e.g. modern, clean, purple-accented design)"
|
||||||
|
"Finally, deploy the HTML site and open it in the browser."
|
||||||
)
|
)
|
||||||
|
|
||||||
# Use command line argument if provided, otherwise use default task
|
# Use command line argument if provided, otherwise use default task
|
||||||
task = sys.argv[1] if len(sys.argv) > 1 else default_task
|
task = sys.argv[1] if len(sys.argv) > 1 else default_task
|
||||||
|
|
||||||
# 创建 MCP 工具包实例
|
|
||||||
mcp_toolkit = MCPToolkit(config_path=str(config_path))
|
mcp_toolkit = MCPToolkit(config_path=str(config_path))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -302,7 +307,6 @@ async def main():
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(Fore.RED + f"Error occurred: {e}")
|
print(Fore.RED + f"Error occurred: {e}")
|
||||||
finally:
|
finally:
|
||||||
# 使用单一的方法处理关闭连接
|
|
||||||
print(Fore.YELLOW + "Shutting down connections...")
|
print(Fore.YELLOW + "Shutting down connections...")
|
||||||
try:
|
try:
|
||||||
await asyncio.wait_for(
|
await asyncio.wait_for(
|
||||||
@@ -317,7 +321,6 @@ async def main():
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(Fore.RED + f"Error during disconnect: {e}")
|
print(Fore.RED + f"Error during disconnect: {e}")
|
||||||
|
|
||||||
# 确保有机会清理
|
|
||||||
try:
|
try:
|
||||||
await asyncio.sleep(0.5)
|
await asyncio.sleep(0.5)
|
||||||
except:
|
except:
|
||||||
|
|||||||
Reference in New Issue
Block a user