23 lines
772 B
Python
23 lines
772 B
Python
from __future__ import annotations
|
|
|
|
from pathlib import Path
|
|
|
|
from .general_tools import build_general_registry
|
|
from .meeting_tools import build_meeting_registry
|
|
from .registry import ToolRegistry
|
|
|
|
|
|
def build_default_registry(data_dir: str | Path = "data") -> ToolRegistry:
|
|
registry = ToolRegistry()
|
|
for source in (build_general_registry(), build_meeting_registry(data_dir=data_dir)):
|
|
for definition in source.definitions():
|
|
function = definition["function"]
|
|
name = function["name"]
|
|
registry.register(
|
|
name=name,
|
|
description=function["description"],
|
|
parameters=function["parameters"],
|
|
handler=source._tools[name].handler,
|
|
)
|
|
return registry
|