Spaces:
Running
Running
File size: 742 Bytes
8b54db1 | 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 28 29 30 31 32 33 34 35 | """
Built-in tool functions for CodeAct agent.
Example tools that demonstrate the tool system.
"""
from typing import Any, List
__all__ = ["FUNCTION_REGISTRY", "get_all_tool_functions",
"add_numbers", "multiply_numbers"]
def add_numbers(a: int, b: int) -> int:
"""Add two numbers together."""
return a + b
def multiply_numbers(a: int, b: int) -> int:
"""Multiply two numbers together."""
return a * b
# ====================
# FUNCTION REGISTRY
# ====================
FUNCTION_REGISTRY = {
"add_numbers": add_numbers,
"multiply_numbers": multiply_numbers,
}
def get_all_tool_functions() -> List[Any]:
"""Get all functions from FUNCTION_REGISTRY."""
return list(FUNCTION_REGISTRY.values())
|