-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
27 lines (20 loc) · 689 Bytes
/
Copy pathmain.py
File metadata and controls
27 lines (20 loc) · 689 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""
astrbot_plugin_python_toolkit - Python dev toolkit plugin
Provides: mypy type check, black format, isort, ruff format, pytest-cov, pre-commit
"""
import os
import json
import subprocess
from pathlib import Path
from astrbot.api import logger
from astrbot.api.star import Context, Star
from .tools._registry import ALL_TOOLS
class Main(Star):
def __init__(self, context: Context, config: dict = None):
super().__init__(context)
self.context = context
tools = []
for tool_cls in ALL_TOOLS.values():
tools.append(tool_cls())
context.add_llm_tools(*tools)
logger.info(f"Python Toolkit: registered {len(tools)} tools")