ginipick commited on
Commit
46a5be3
Β·
verified Β·
1 Parent(s): 5c3d614

Upload 2 files

Browse files
Files changed (2) hide show
  1. functions.json +59 -0
  2. my_functions.py +45 -0
functions.json ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "name": "get_product_name_by_PID",
4
+ "description": "Finds the name of a product by its Product ID.",
5
+ "module_path": "my_functions",
6
+ "func_name_in_module": "get_product_name_by_PID",
7
+ "parameters": {
8
+ "type": "object",
9
+ "properties": {
10
+ "PID": {
11
+ "type": "string"
12
+ }
13
+ },
14
+ "required": ["PID"]
15
+ },
16
+ "example_usage": "```tool_code\nget_product_name_by_PID(PID=\"807ZPKBL9V\")\n```"
17
+ },
18
+ {
19
+ "name": "get_stock_price",
20
+ "description": "Retrieves the latest stock price for a given ticker symbol using yfinance.",
21
+ "module_path": "my_functions",
22
+ "func_name_in_module": "get_stock_price",
23
+ "parameters": {
24
+ "type": "object",
25
+ "properties": {
26
+ "ticker": {
27
+ "type": "string"
28
+ }
29
+ },
30
+ "required": ["ticker"]
31
+ },
32
+ "example_usage": "```tool_code\nget_stock_price(ticker=\"AAPL\")\n```"
33
+ },
34
+
35
+ // -------------------------------------------------
36
+ // μƒˆλ‘œ μΆ”κ°€ν•œ MCO μ•„ν‚€ν…μ²˜ 뢄석 ν•¨μˆ˜ (μ˜ˆμ‹œ)
37
+ // -------------------------------------------------
38
+ {
39
+ "name": "analyze_mco_architecture",
40
+ "description": "MCO μ•„ν‚€ν…μ²˜(ν•¨μˆ˜ JSON + Python λͺ¨λ“ˆ) ꡬ쑰λ₯Ό 뢄석 및 μš”μ•½ν•΄μ£ΌλŠ” ν•¨μˆ˜μž…λ‹ˆλ‹€.",
41
+ "module_path": "my_functions",
42
+ "func_name_in_module": "analyze_mco_architecture",
43
+ "parameters": {
44
+ "type": "object",
45
+ "properties": {
46
+ "framework_version": {
47
+ "type": "string",
48
+ "description": "ν˜„μž¬ MCO ν”„λ ˆμž„μ›Œν¬ 버전 (예: 'v2.0')"
49
+ },
50
+ "detail_level": {
51
+ "type": "number",
52
+ "description": "뢄석 상세도 (1~5 사이 μ •μˆ˜)"
53
+ }
54
+ },
55
+ "required": ["framework_version"]
56
+ },
57
+ "example_usage": "```tool_code\nanalyze_mco_architecture(framework_version=\"v2.1\", detail_level=4)\n```"
58
+ }
59
+ ]
my_functions.py ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import yfinance as yf
2
+
3
+ product_catalog = {
4
+ "807ZPKBL9V": "SuperWidget",
5
+ "1234567890": "MegaGadget"
6
+ }
7
+
8
+ def get_product_name_by_PID(PID: str) -> str:
9
+ """
10
+ Finds the name of a product by its Product ID
11
+ """
12
+ return product_catalog.get(PID, "Unknown product")
13
+
14
+ def get_stock_price(ticker: str) -> float:
15
+ """
16
+ Retrieves the latest stock price for a given ticker using yfinance.
17
+ """
18
+ stock = yf.Ticker(ticker)
19
+ data = stock.history(period="1d")
20
+ if not data.empty:
21
+ return data['Close'].iloc[-1]
22
+ return float('nan')
23
+
24
+ # ----------------------------------------------------
25
+ # μƒˆλ‘­κ²Œ μΆ”κ°€λœ MCO μ•„ν‚€ν…μ²˜ λΆ„μ„μš© ν•¨μˆ˜ (μ˜ˆμ‹œ)
26
+ # ----------------------------------------------------
27
+ def analyze_mco_architecture(framework_version: str, detail_level: int = 3) -> str:
28
+ """
29
+ MCO μ•„ν‚€ν…μ²˜(ν•¨μˆ˜ JSON + Python λͺ¨λ“ˆ) ꡬ쑰λ₯Ό 뢄석 및 μš”μ•½ν•΄μ£ΌλŠ” ν•¨μˆ˜.
30
+ framework_version: (예: 'v2.1')
31
+ detail_level: 뢄석 상세도 (1~5)
32
+ """
33
+ if detail_level < 1:
34
+ detail_level = 1
35
+ elif detail_level > 5:
36
+ detail_level = 5
37
+
38
+ analysis = (
39
+ f"MCO μ•„ν‚€ν…μ²˜(버전 {framework_version}) 뢄석 κ²°κ³Ό:\n"
40
+ f" - functions.json에 μ •μ˜λœ ν•¨μˆ˜ λͺ©λ‘ 확인\n"
41
+ f" - Python λͺ¨λ“ˆ({__file__})μ—μ„œ ν•¨μˆ˜ κ΅¬ν˜„ 정상 μ—°κ²° 확인\n"
42
+ f" - detail_level={detail_level} κΈ°μ€€μœΌλ‘œ μš”μ•½ 리포트\n"
43
+ f"β€» μ‹€μ œλ‘œλŠ” ν•„μš”μ— 따라 더 λ³΅μž‘ν•œ 둜직/파일 뢄석 λ“± μˆ˜ν–‰ κ°€λŠ₯."
44
+ )
45
+ return analysis