Update app.py
Browse files
app.py
CHANGED
|
@@ -12,7 +12,6 @@ from langchain_core.agents import AgentExecutor, JsonOutputParser
|
|
| 12 |
from youtube_transcript_api import YouTubeTranscriptApi
|
| 13 |
import chess, chess.engine
|
| 14 |
from bs4 import BeautifulSoup
|
| 15 |
-
import statsapi
|
| 16 |
from SPARQLWrapper import SPARQLWrapper, JSON
|
| 17 |
|
| 18 |
# (Keep Constants as is)
|
|
@@ -101,26 +100,6 @@ def classify_vegetables(items: list) -> list:
|
|
| 101 |
VEGETABLE_SET = {"bell pepper","broccoli","celery","green beans","lettuce","zucchini","sweet potatoes"}
|
| 102 |
return sorted([i for i in items if i in VEGETABLE_SET])
|
| 103 |
|
| 104 |
-
@tool(
|
| 105 |
-
name="transcribe_audio",
|
| 106 |
-
description="Transcribe audio file or URL using AssemblyAI",
|
| 107 |
-
inputs={"audio_url": "string"},
|
| 108 |
-
output_type="string",
|
| 109 |
-
)
|
| 110 |
-
def transcribe_audio(audio_url: str) -> str:
|
| 111 |
-
transcriber = aai.Transcriber()
|
| 112 |
-
result = transcriber.transcribe(audio_url)
|
| 113 |
-
return result.text
|
| 114 |
-
|
| 115 |
-
@tool(
|
| 116 |
-
name="actor_role",
|
| 117 |
-
description="Lookup actor role via OMDb API (stub implementation)",
|
| 118 |
-
inputs={"title": "string", "role_name": "string", "target_series": "string"},
|
| 119 |
-
output_type="string",
|
| 120 |
-
)
|
| 121 |
-
def actor_role(title: str, role_name: str, target_series: str) -> str:
|
| 122 |
-
return "UNKNOWN"
|
| 123 |
-
|
| 124 |
@tool(
|
| 125 |
name="execute_code",
|
| 126 |
description="Execute Python code snippet and return 'output' variable",
|
|
@@ -182,8 +161,6 @@ TOOLS = [
|
|
| 182 |
find_non_commutative,
|
| 183 |
libretext_extract,
|
| 184 |
classify_vegetables,
|
| 185 |
-
transcribe_audio,
|
| 186 |
-
actor_role,
|
| 187 |
execute_code,
|
| 188 |
yankee_at_bats_most_walks,
|
| 189 |
least_athletes_olympics,
|
|
@@ -198,8 +175,6 @@ SYSTEM_MESSAGE = """You are a concise AI assistant with access to the following
|
|
| 198 |
- find_non_commutative(table: dict) β list[string]
|
| 199 |
- libretext_extract(url: string, selector: string) β string
|
| 200 |
- classify_vegetables(items: list[string]) β list[string]
|
| 201 |
-
- transcribe_audio(audio_url: string) β string
|
| 202 |
-
- actor_role(title: string, role_name: string, target_series: string) β string
|
| 203 |
- execute_code(code: string) β string
|
| 204 |
- yankee_at_bats_most_walks(year: int) β int
|
| 205 |
- least_athletes_olympics(year: int) β string
|
|
|
|
| 12 |
from youtube_transcript_api import YouTubeTranscriptApi
|
| 13 |
import chess, chess.engine
|
| 14 |
from bs4 import BeautifulSoup
|
|
|
|
| 15 |
from SPARQLWrapper import SPARQLWrapper, JSON
|
| 16 |
|
| 17 |
# (Keep Constants as is)
|
|
|
|
| 100 |
VEGETABLE_SET = {"bell pepper","broccoli","celery","green beans","lettuce","zucchini","sweet potatoes"}
|
| 101 |
return sorted([i for i in items if i in VEGETABLE_SET])
|
| 102 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
@tool(
|
| 104 |
name="execute_code",
|
| 105 |
description="Execute Python code snippet and return 'output' variable",
|
|
|
|
| 161 |
find_non_commutative,
|
| 162 |
libretext_extract,
|
| 163 |
classify_vegetables,
|
|
|
|
|
|
|
| 164 |
execute_code,
|
| 165 |
yankee_at_bats_most_walks,
|
| 166 |
least_athletes_olympics,
|
|
|
|
| 175 |
- find_non_commutative(table: dict) β list[string]
|
| 176 |
- libretext_extract(url: string, selector: string) β string
|
| 177 |
- classify_vegetables(items: list[string]) β list[string]
|
|
|
|
|
|
|
| 178 |
- execute_code(code: string) β string
|
| 179 |
- yankee_at_bats_most_walks(year: int) β int
|
| 180 |
- least_athletes_olympics(year: int) β string
|