()
| 5 | from app.models.plugin_tool import PluginTool |
| 6 | |
| 7 | async def main(): |
| 8 | async with async_session() as db: |
| 9 | res = await db.execute(select(PluginTool).where(PluginTool.name == 'agentbay_computer_screenshot')) |
| 10 | tool = res.scalar_one_or_none() |
| 11 | if not tool: |
| 12 | print("Tool not found") |
| 13 | return |
| 14 | |
| 15 | print("Old schema:", tool.schema) |
| 16 | |
| 17 | new_schema = { |
| 18 | "type": "function", |
| 19 | "function": { |
| 20 | "name": "agentbay_computer_screenshot", |
| 21 | "description": "Take a screenshot of the CURRENT Windows desktop cloud computer screen. Use this to verify the result of a click, type, or to read information off the screen.", |
| 22 | "parameters": { |
| 23 | "type": "object", |
| 24 | "properties": { |
| 25 | "save_to_workspace": { |
| 26 | "type": "boolean", |
| 27 | "description": "CRITICAL: Set to True IF AND ONLY IF the user explicitly asked you to SHOW them a screenshot or save it (e.g. \"截图给我看\", \"发截图\", \"保存桌面截图\"). If True, the image is saved to their workspace and you get a Markdown link. Default is False (internal in-memory analysis only, completely invisible to the user).", |
| 28 | "default": False |
| 29 | } |
| 30 | } |
| 31 | } |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | tool.schema = new_schema |
| 36 | tool.description = new_schema["function"]["description"] |
| 37 | await db.commit() |
| 38 | print("Updated schema successfully.") |
| 39 | |
| 40 | if __name__ == "__main__": |
| 41 | asyncio.run(main()) |
no test coverage detected