2026-06-10 15:12:50 +07:00
|
|
|
from .persona import build_system_prompt
|
2026-05-08 18:05:53 +07:00
|
|
|
|
2026-05-02 21:08:42 +07:00
|
|
|
def tools_mapping(schema, handler, name=None):
|
|
|
|
|
tool_name = name or schema["function"]["name"]
|
|
|
|
|
return {"name": tool_name, "schema": schema, "handler": handler}
|
|
|
|
|
|
2026-05-08 18:05:53 +07:00
|
|
|
def tool_schemas(tools_definition):
|
|
|
|
|
return [t["schema"] for t in tools_definition]
|
|
|
|
|
|
|
|
|
|
def tool_handlers(tools_definition):
|
|
|
|
|
return {t["name"]: t["handler"] for t in tools_definition}
|
|
|
|
|
|