Nitien commited on
Commit
1405970
·
verified ·
1 Parent(s): 186392f

Update customtools.py

Browse files
Files changed (1) hide show
  1. customtools.py +5 -3
customtools.py CHANGED
@@ -72,7 +72,7 @@ def youtube_transcript(url: str) -> str:
72
  print(video_id)
73
  try:
74
  transcript = YouTubeTranscriptApi().fetch(video_id)
75
- text = "\n".join(piece.text for piece in transcript)
76
  return text[:chars]
77
  except Exception as exc:
78
  print(f"Error fetching YouTube transcript: {exc}")
@@ -171,7 +171,8 @@ def modulus_tool(a: int, b: int) -> int:
171
  a: first int
172
  b: second int
173
  """
174
- return a % b
 
175
 
176
 
177
  @tool
@@ -181,7 +182,8 @@ def power_tool(a: float, b: float) -> float:
181
  a (float): the first number
182
  b (float): the second number
183
  """
184
- return a**b
 
185
 
186
 
187
 
 
72
  print(video_id)
73
  try:
74
  transcript = YouTubeTranscriptApi().fetch(video_id)
75
+ text = "\n".join(piece.text for piece in transcript.snippets)
76
  return text[:chars]
77
  except Exception as exc:
78
  print(f"Error fetching YouTube transcript: {exc}")
 
171
  a: first int
172
  b: second int
173
  """
174
+ result = a % b
175
+ return str(result)
176
 
177
 
178
  @tool
 
182
  a (float): the first number
183
  b (float): the second number
184
  """
185
+ result = a**b
186
+ return str(result)
187
 
188
 
189