Spaces:
Paused
Paused
Download my_functions.py from VIDraft/Agentic-AI-CHAT: direct link, hf CLI and curl.
- Browser
- Download file 1.07 kB
-
https://huggingface.co/spaces/VIDraft/Agentic-AI-CHAT/resolve/main/my_functions.py
- Command line
-
hf download hf://spaces/VIDraft/Agentic-AI-CHAT/my_functions.py
-
curl -L -o my_functions.py https://huggingface.co/spaces/VIDraft/Agentic-AI-CHAT/resolve/main/my_functions.py
1.07 kB
| import yfinance as yf | |
| product_catalog = { | |
| "807ZPKBL9V": "SuperWidget", | |
| "1234567890": "MegaGadget" | |
| } | |
| def get_product_name_by_PID(PID: str) -> str: | |
| return product_catalog.get(PID, "Unknown product") | |
| def get_stock_price(ticker: str) -> float: | |
| stock = yf.Ticker(ticker) | |
| data = stock.history(period="1d") | |
| if not data.empty: | |
| return data["Close"].iloc[-1] | |
| return float("nan") | |
| def analyze_mco_architecture(framework_version: str, detail_level: int = 3) -> str: | |
| if detail_level < 1: | |
| detail_level = 1 | |
| elif detail_level > 5: | |
| detail_level = 5 | |
| return ( | |
| f"MCO ์ํคํ ์ฒ(๋ฒ์ {framework_version}) ๋ถ์ ๊ฒฐ๊ณผ:\n" | |
| f" - functions.json์ ์ ์๋ ํจ์ ๋ชฉ๋ก ํ์ธ\n" | |
| f" - Python ๋ชจ๋({__file__})์์ ๊ตฌํ ์ฐ๊ฒฐ ํ์ธ\n" | |
| f" - detail_level={detail_level} ๊ธฐ์ค ์์ฝ ๋ฆฌํฌํธ\n" | |
| ) | |
| # ๋ชจ๋ธ์ด functionName(ticker="AAPL")๋ฅผ ํธ์ถํด๋, ์ค์ ๋ด๋ถ ๋ก์ง์ ์ฃผ๊ฐ ์กฐํ | |
| def functionName(ticker: str) -> float: | |
| return get_stock_price(ticker=ticker) | |