arcade-mcp/examples/example_nate/arcade_example_nate/tools/arithmetic.py
Sam Partee 8964111023
Refactor into library approach (#7)
This PR makes a few sweeping changes to the actor, cli, and overall
structure of the project.

- CLI commands skeleton 
- ``arcade run``, ``arcade show``, and ``arcade new``
- Working package mangement solution (``arcade_`` packages)
- Actor approach for using frameworks other than FastAPI
- Client for calling Engine within ``arcade/core``
- beginning of the config interface.

---------

Co-authored-by: Nate Barbettini <nate@arcade-ai.com>
2024-07-23 16:26:54 -07:00

44 lines
931 B
Python

import math
from typing import Annotated
from arcade.sdk.tool import tool
@tool
def add(
a: Annotated[int, "The first number"], b: Annotated[int, "The second number"]
) -> Annotated[int, "The sum of the two numbers"]:
"""
Add two numbers together
"""
return a + b
@tool
def multiply(
a: Annotated[int, "The first number"], b: Annotated[int, "The second number"]
) -> Annotated[int, "The product of the two numbers"]:
"""
Multiply two numbers together
"""
return a * b
@tool
def divide(
a: Annotated[int, "The first number"], b: Annotated[int, "The second number"]
) -> Annotated[float, "The quotient of the two numbers"]:
"""
Divide two numbers
"""
return a / b
@tool
def sqrt(
a: Annotated[int, "The number to square root"],
) -> Annotated[float, "The square root of the number"]:
"""
Get the square root of a number
"""
return math.sqrt(a)