Download tools/add_integers.py from dmfelder/DF_Final_Assignment_Template: direct link, hf CLI and curl.
- Browser
- Download file 496 Bytes
-
https://huggingface.co/spaces/dmfelder/DF_Final_Assignment_Template/resolve/main/tools/add_integers.py
- Command line
-
hf download hf://spaces/dmfelder/DF_Final_Assignment_Template/tools/add_integers.py
-
curl -L -o add_integers.py https://huggingface.co/spaces/dmfelder/DF_Final_Assignment_Template/resolve/main/tools/add_integers.py
496 Bytes
| from langchain_core.tools import tool | |
| from loguru import logger | |
| def add_integers(a: int, b: int) -> int: | |
| """ | |
| Adds two integers together. | |
| Args: | |
| a (int): The first integer. | |
| b (int): The second integer. | |
| Returns: | |
| int: The sum of the two integers. | |
| """ | |
| logger.info(f"add_integers called with a={a}, b={b}") | |
| return a + b | |
| if __name__ == "__main__": | |
| print(add_integers.invoke({"a": 2, "b": 3})) | |