ginipick commited on
Commit
cb99b4d
ยท
verified ยท
1 Parent(s): 7d42696

Update my_functions.py

Browse files
Files changed (1) hide show
  1. my_functions.py +25 -0
my_functions.py CHANGED
@@ -21,3 +21,28 @@ def get_stock_price(ticker: str) -> float:
21
  if not data.empty:
22
  return data['Close'].iloc[-1]
23
  return float('nan')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  if not data.empty:
22
  return data['Close'].iloc[-1]
23
  return float('nan')
24
+
25
+ # ==============================
26
+ # (New) YouTube ๋™์˜์ƒ ๊ฒ€์ƒ‰ ํ•จ์ˆ˜
27
+ # ==============================
28
+ def search_youtube(query: str) -> str:
29
+ """
30
+ Searches YouTube for the given query and returns a short list of video titles/links.
31
+ Actual implementation could use YouTube Data API or 'youtube-search-python'.
32
+ Here we mock the result for demonstration.
33
+ """
34
+ # ์‹ค์ „ ์˜ˆ์‹œ (youtube-search-python ์‚ฌ์šฉ ์‹œ):
35
+ # from youtubesearchpython import VideosSearch
36
+ # videosSearch = VideosSearch(query, limit=3)
37
+ # results = videosSearch.result()['result']
38
+ # formatted = []
39
+ # for item in results:
40
+ # title = item['title']
41
+ # link = item['link']
42
+ # formatted.append(f"{title} - {link}")
43
+ # return "\n".join(formatted)
44
+
45
+ # -- ๋ฐ๋ชจ์šฉ ๋”๋ฏธ ๊ฒฐ๊ณผ --
46
+ return (
47
+ "[Demo Video](https://www.youtube.com/watch?v=JzjR5LGOvqg)\n"
48
+ )