arcade-mcp/toolkits/math/arcade_arithmetic/tools/arithmetic.py
Eric Gustin 43198a3a9b
Add New Gmail Tools To The Google Toolkit (#41)
# PR Description

## Summary

Changes include renaming the `arcade_gmail` toolkit to `arcade_google`,
adding unit tests for Google toolkit, add new tools to the Google
toolkit.
## Changes

### Makefile
- Added a new `make test-toolkits` target to iterate over all toolkits
and run pytest on each one.

### Added new tools for the google toolkit

1. `send_email`
This tool sends an email using the Gmail API.

2. `write_draft_email`
This tool creates a draft email using the Gmail API. 

3. `update_draft_email`
This tool updates an existing draft email using the Gmail API.

4. `send_draft_email`
This tool sends a draft email using the Gmail API.

5. `delete_draft_email`
This tool deletes a draft email using the Gmail API. 

6. `list_draft_emails`
This tool retrieves a list of draft emails using the Gmail API.

7. `list_emails_by_header`
This tool searches for emails by a specific header using the Gmail API.
- `sender`: The sender's email address to search for.
- `limit`: The maximum number of emails to retrieve.

8. `list_emails`
This tool retrieves a list of emails using the Gmail API.

9. `trash_email`
This tool moves an email to the trash using the Gmail API.
2024-09-19 10:18:49 -07:00

75 lines
1.6 KiB
Python

import math
from typing import Annotated
from arcade.sdk 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 subtract(
a: Annotated[int, "The first number"], b: Annotated[int, "The second number"]
) -> Annotated[int, "The difference of the two numbers"]:
"""
Subtract two numbers
"""
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)
@tool
def sum_list(
numbers: Annotated[list[float], "The list of numbers"],
) -> Annotated[float, "The sum of the numbers in the list"]:
"""
Sum all numbers in a list
"""
return sum(numbers)
@tool
def sum_range(
start: Annotated[int, "The start of the range to sum"],
end: Annotated[int, "The end of the range to sum"],
) -> Annotated[int, "The sum of the numbers in the list"]:
"""
Sum all numbers from start through end
"""
return sum([i for i in range(start, end + 1)])