Spaces:
Runtime error
Runtime error
Update agent.py
Browse files
agent.py
CHANGED
|
@@ -27,19 +27,15 @@ try:
|
|
| 27 |
except ImportError:
|
| 28 |
from langchain.tools.python.tool import PythonAstREPLTool
|
| 29 |
|
| 30 |
-
# Optional: LangSmith Tracing
|
| 31 |
-
try:
|
| 32 |
-
from langchain_community.tracing import configure_langsmith
|
| 33 |
-
except ImportError:
|
| 34 |
-
configure_langsmith = None
|
| 35 |
-
|
| 36 |
# ---------------------------------------------------------------------
|
| 37 |
# 0) Optionale LangSmith-Tracing (setze ENV: LANGCHAIN_API_KEY)
|
| 38 |
# ---------------------------------------------------------------------
|
|
|
|
| 39 |
if os.getenv("LANGCHAIN_API_KEY"):
|
| 40 |
-
os.environ
|
| 41 |
-
|
| 42 |
-
|
|
|
|
| 43 |
|
| 44 |
# ---------------------------------------------------------------------
|
| 45 |
# 1) Helfer: Fehler-Decorator + Backoff-Wrapper
|
|
|
|
| 27 |
except ImportError:
|
| 28 |
from langchain.tools.python.tool import PythonAstREPLTool
|
| 29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
# ---------------------------------------------------------------------
|
| 31 |
# 0) Optionale LangSmith-Tracing (setze ENV: LANGCHAIN_API_KEY)
|
| 32 |
# ---------------------------------------------------------------------
|
| 33 |
+
|
| 34 |
if os.getenv("LANGCHAIN_API_KEY"):
|
| 35 |
+
os.environ["LANGCHAIN_TRACING_V2"] = "true"
|
| 36 |
+
os.environ["LANGCHAIN_ENDPOINT"] = "https://api.smith.langchain.com"
|
| 37 |
+
os.environ.setdefault("LANGCHAIN_PROJECT", "gaia-agent")
|
| 38 |
+
print("📡 LangSmith tracing enabled.")
|
| 39 |
|
| 40 |
# ---------------------------------------------------------------------
|
| 41 |
# 1) Helfer: Fehler-Decorator + Backoff-Wrapper
|