Spaces:
Sleeping
Sleeping
fix env
Browse files- agent.py +2 -1
- app.py +2 -2
- requirements.txt +4 -1
agent.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
import os
|
| 2 |
from typing import Annotated, Optional, TypedDict
|
|
|
|
| 3 |
from langgraph.graph.message import add_messages
|
| 4 |
from langchain_core.messages import AnyMessage, SystemMessage, HumanMessage
|
| 5 |
from tool.files import read_file
|
|
@@ -10,7 +11,7 @@ from langgraph.prebuilt import ToolNode
|
|
| 10 |
|
| 11 |
from tool.youtube import get_video_id, youtube_transcript
|
| 12 |
|
| 13 |
-
|
| 14 |
|
| 15 |
tools = [
|
| 16 |
get_video_id,
|
|
|
|
| 1 |
import os
|
| 2 |
from typing import Annotated, Optional, TypedDict
|
| 3 |
+
from dotenv import load_dotenv
|
| 4 |
from langgraph.graph.message import add_messages
|
| 5 |
from langchain_core.messages import AnyMessage, SystemMessage, HumanMessage
|
| 6 |
from tool.files import read_file
|
|
|
|
| 11 |
|
| 12 |
from tool.youtube import get_video_id, youtube_transcript
|
| 13 |
|
| 14 |
+
load_dotenv()
|
| 15 |
|
| 16 |
tools = [
|
| 17 |
get_video_id,
|
app.py
CHANGED
|
@@ -10,6 +10,7 @@ from agent import Agent
|
|
| 10 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
| 11 |
DEFAULT_SPACE_ID = "yplam/Final_Assignment_Template"
|
| 12 |
|
|
|
|
| 13 |
def download_file(filename: str) -> str:
|
| 14 |
"""
|
| 15 |
Downloads a file from the API and returns the path to the local file.
|
|
@@ -166,7 +167,7 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 166 |
|
| 167 |
|
| 168 |
def run_local_agent():
|
| 169 |
-
return run_all('yplam',
|
| 170 |
|
| 171 |
|
| 172 |
def build_gradio_interface():
|
|
@@ -214,7 +215,6 @@ def run_fixed_agent():
|
|
| 214 |
|
| 215 |
|
| 216 |
if __name__ == "__main__":
|
| 217 |
-
load_dotenv()
|
| 218 |
print("\n" + "-"*30 + " App Starting " + "-"*30)
|
| 219 |
# Check for SPACE_HOST and SPACE_ID at startup for information
|
| 220 |
space_host_startup = os.getenv("SPACE_HOST")
|
|
|
|
| 10 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
| 11 |
DEFAULT_SPACE_ID = "yplam/Final_Assignment_Template"
|
| 12 |
|
| 13 |
+
|
| 14 |
def download_file(filename: str) -> str:
|
| 15 |
"""
|
| 16 |
Downloads a file from the API and returns the path to the local file.
|
|
|
|
| 167 |
|
| 168 |
|
| 169 |
def run_local_agent():
|
| 170 |
+
return run_all('yplam', True)
|
| 171 |
|
| 172 |
|
| 173 |
def build_gradio_interface():
|
|
|
|
| 215 |
|
| 216 |
|
| 217 |
if __name__ == "__main__":
|
|
|
|
| 218 |
print("\n" + "-"*30 + " App Starting " + "-"*30)
|
| 219 |
# Check for SPACE_HOST and SPACE_ID at startup for information
|
| 220 |
space_host_startup = os.getenv("SPACE_HOST")
|
requirements.txt
CHANGED
|
@@ -2,4 +2,7 @@ gradio
|
|
| 2 |
requests
|
| 3 |
langgraph
|
| 4 |
langchain_openai
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
requests
|
| 3 |
langgraph
|
| 4 |
langchain_openai
|
| 5 |
+
langchain
|
| 6 |
+
python-dotenv
|
| 7 |
+
youtube_transcript_api
|
| 8 |
+
pandas
|