Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -6,9 +6,25 @@ import yaml
|
|
6 |
from tools.final_answer import FinalAnswerTool
|
7 |
from jaqpot_python_sdk.jaqpot_api_client import JaqpotApiClient
|
8 |
import os
|
|
|
9 |
|
|
|
|
|
|
|
10 |
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
jaqpot = JaqpotApiClient()
|
14 |
|
|
|
6 |
from tools.final_answer import FinalAnswerTool
|
7 |
from jaqpot_python_sdk.jaqpot_api_client import JaqpotApiClient
|
8 |
import os
|
9 |
+
from Gradio_UI import GradioUI
|
10 |
|
11 |
+
LANGFUSE_PUBLIC_KEY=os.environ["LANGFUSE_PUBLIC_KEY"]
|
12 |
+
LANGFUSE_SECRET_KEY=os.environ["LANGFUSE_SECRET_KEY"]
|
13 |
+
LANGFUSE_AUTH=base64.b64encode(f"{LANGFUSE_PUBLIC_KEY}:{LANGFUSE_SECRET_KEY}".encode()).decode()
|
14 |
|
15 |
+
os.environ["OTEL_EXPORTER_OTLP_ENDPOINT"] = "https://cloud.langfuse.com/api/public/otel" # EU data region
|
16 |
+
os.environ["OTEL_EXPORTER_OTLP_HEADERS"] = f"Authorization=Basic {LANGFUSE_AUTH}"
|
17 |
+
|
18 |
+
from opentelemetry.sdk.trace import TracerProvider
|
19 |
+
|
20 |
+
from openinference.instrumentation.smolagents import SmolagentsInstrumentor
|
21 |
+
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
|
22 |
+
from opentelemetry.sdk.trace.export import SimpleSpanProcessor
|
23 |
+
|
24 |
+
trace_provider = TracerProvider()
|
25 |
+
trace_provider.add_span_processor(SimpleSpanProcessor(OTLPSpanExporter()))
|
26 |
+
|
27 |
+
SmolagentsInstrumentor().instrument(tracer_provider=trace_provider)
|
28 |
|
29 |
jaqpot = JaqpotApiClient()
|
30 |
|