Spaces:
Sleeping
Sleeping
Tuyen Pham
commited on
Manual revert to original commit
Browse files
app.py
CHANGED
|
@@ -2,22 +2,6 @@ import yaml
|
|
| 2 |
import os
|
| 3 |
from smolagents import GradioUI, CodeAgent, InferenceClientModel
|
| 4 |
|
| 5 |
-
# Langfuse + OpenTelemetry setup
|
| 6 |
-
from langfuse import get_client
|
| 7 |
-
from openinference.instrumentation.smolagents import SmolagentsInstrumentor
|
| 8 |
-
|
| 9 |
-
# Initialize Langfuse client (reads from environment variables automatically)
|
| 10 |
-
langfuse = get_client()
|
| 11 |
-
|
| 12 |
-
# Verify connection
|
| 13 |
-
if langfuse.auth_check():
|
| 14 |
-
print("✅ Langfuse client authenticated!")
|
| 15 |
-
else:
|
| 16 |
-
print("❌ Langfuse authentication failed!")
|
| 17 |
-
|
| 18 |
-
# Initialize OpenTelemetry instrumentation
|
| 19 |
-
SmolagentsInstrumentor().instrument()
|
| 20 |
-
|
| 21 |
# Get current directory path
|
| 22 |
CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
|
| 23 |
|
|
@@ -28,9 +12,11 @@ from tools.catering_service_tool import SimpleTool as CateringServiceTool
|
|
| 28 |
from tools.superhero_party_theme_generator import SuperheroPartyThemeTool as SuperheroPartyThemeGenerator
|
| 29 |
from tools.final_answer import FinalAnswerTool as FinalAnswer
|
| 30 |
|
|
|
|
|
|
|
| 31 |
model = InferenceClientModel(
|
| 32 |
-
|
| 33 |
-
|
| 34 |
)
|
| 35 |
|
| 36 |
web_search = WebSearch()
|
|
@@ -40,6 +26,7 @@ catering_service_tool = CateringServiceTool()
|
|
| 40 |
superhero_party_theme_generator = SuperheroPartyThemeGenerator()
|
| 41 |
final_answer = FinalAnswer()
|
| 42 |
|
|
|
|
| 43 |
with open(os.path.join(CURRENT_DIR, "prompts.yaml"), 'r') as stream:
|
| 44 |
prompt_templates = yaml.safe_load(stream)
|
| 45 |
|
|
@@ -53,8 +40,6 @@ agent = CodeAgent(
|
|
| 53 |
name=None,
|
| 54 |
description=None,
|
| 55 |
prompt_templates=prompt_templates
|
| 56 |
-
# No callbacks parameter needed - instrumentation happens globally
|
| 57 |
)
|
| 58 |
-
|
| 59 |
if __name__ == "__main__":
|
| 60 |
GradioUI(agent).launch()
|
|
|
|
| 2 |
import os
|
| 3 |
from smolagents import GradioUI, CodeAgent, InferenceClientModel
|
| 4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
# Get current directory path
|
| 6 |
CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
|
| 7 |
|
|
|
|
| 12 |
from tools.superhero_party_theme_generator import SuperheroPartyThemeTool as SuperheroPartyThemeGenerator
|
| 13 |
from tools.final_answer import FinalAnswerTool as FinalAnswer
|
| 14 |
|
| 15 |
+
|
| 16 |
+
|
| 17 |
model = InferenceClientModel(
|
| 18 |
+
model_id='Qwen/Qwen2.5-Coder-32B-Instruct',
|
| 19 |
+
provider=None,
|
| 20 |
)
|
| 21 |
|
| 22 |
web_search = WebSearch()
|
|
|
|
| 26 |
superhero_party_theme_generator = SuperheroPartyThemeGenerator()
|
| 27 |
final_answer = FinalAnswer()
|
| 28 |
|
| 29 |
+
|
| 30 |
with open(os.path.join(CURRENT_DIR, "prompts.yaml"), 'r') as stream:
|
| 31 |
prompt_templates = yaml.safe_load(stream)
|
| 32 |
|
|
|
|
| 40 |
name=None,
|
| 41 |
description=None,
|
| 42 |
prompt_templates=prompt_templates
|
|
|
|
| 43 |
)
|
|
|
|
| 44 |
if __name__ == "__main__":
|
| 45 |
GradioUI(agent).launch()
|