Spaces:
Runtime error
Runtime error
Refactor static directory handling by introducing `STATIC_DIR` constant in `__init__.py` and updating references in `hf_submission_api.py`
Browse files
src/gaia_solving_agent/__init__.py
CHANGED
|
@@ -1,4 +1,6 @@
|
|
| 1 |
import os
|
|
|
|
|
|
|
| 2 |
from dotenv import load_dotenv
|
| 3 |
|
| 4 |
# Load the .env file
|
|
@@ -8,4 +10,6 @@ OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
|
|
| 8 |
NEBIUS_API_KEY = os.getenv("NEBIUS_API_TOKEN")
|
| 9 |
MISTRAL_API_KEY = os.getenv("MISTRAL_API_KEY")
|
| 10 |
PHOENIX_API_KEY = os.getenv("PHOENIX_API_KEY")
|
| 11 |
-
TAVILY_API_KEY = os.getenv("TAVILY_API_KEY")
|
|
|
|
|
|
|
|
|
| 1 |
import os
|
| 2 |
+
from pathlib import Path
|
| 3 |
+
|
| 4 |
from dotenv import load_dotenv
|
| 5 |
|
| 6 |
# Load the .env file
|
|
|
|
| 10 |
NEBIUS_API_KEY = os.getenv("NEBIUS_API_TOKEN")
|
| 11 |
MISTRAL_API_KEY = os.getenv("MISTRAL_API_KEY")
|
| 12 |
PHOENIX_API_KEY = os.getenv("PHOENIX_API_KEY")
|
| 13 |
+
TAVILY_API_KEY = os.getenv("TAVILY_API_KEY")
|
| 14 |
+
|
| 15 |
+
STATIC_DIR = Path(__file__).parent / "static"
|
src/gaia_solving_agent/hf_submission_api.py
CHANGED
|
@@ -8,11 +8,12 @@ from llama_index.core import SimpleDirectoryReader
|
|
| 8 |
from llama_index.core.agent.workflow import BaseWorkflowAgent
|
| 9 |
from workflows import Workflow
|
| 10 |
|
|
|
|
| 11 |
from gaia_solving_agent.agent import GaiaWorkflow
|
| 12 |
|
| 13 |
|
| 14 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
| 15 |
-
FILE_DIR =
|
| 16 |
|
| 17 |
def instantiate_agent(space_id: str, **agent_kwargs):
|
| 18 |
try:
|
|
|
|
| 8 |
from llama_index.core.agent.workflow import BaseWorkflowAgent
|
| 9 |
from workflows import Workflow
|
| 10 |
|
| 11 |
+
from gaia_solving_agent import STATIC_DIR
|
| 12 |
from gaia_solving_agent.agent import GaiaWorkflow
|
| 13 |
|
| 14 |
|
| 15 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
| 16 |
+
FILE_DIR = STATIC_DIR / "files"
|
| 17 |
|
| 18 |
def instantiate_agent(space_id: str, **agent_kwargs):
|
| 19 |
try:
|