13 lines
399 B
Python
13 lines
399 B
Python
from .persona import build_system_prompt
|
|
|
|
def tools_mapping(schema, handler, name=None):
|
|
tool_name = name or schema["function"]["name"]
|
|
return {"name": tool_name, "schema": schema, "handler": handler}
|
|
|
|
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}
|
|
|