Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Output callback to file with relative path

Tomas Valentac1f8b4c6b0b5
diff --git a/api-service/.gitignore b/api-service/.gitignore
index f919ea3ef..727c50088 100644
--- a/api-service/.gitignore
+++ b/api-service/.gitignore
@@ -1,3 +1,4 @@
__pycache__
dist
-.venv
\ No newline at end of file
+.venv
+out.txt
diff --git a/api-service/codegen/callback_handler.py b/api-service/codegen/callback_handler.py
index 6320a8d1d..926b8282e 100644
--- a/api-service/codegen/callback_handler.py
+++ b/api-service/codegen/callback_handler.py
@@ -1,3 +1,4 @@
+import os
from typing import Dict, Any, List, Union, Optional
# import sys
@@ -24,13 +25,11 @@ from database import Database
class CustomCallbackHandler(BaseCallbackHandler):
- _file = open(
- "/Users/vasekmlejnsky/Developer/ai-api/api-service/codegen/out.txt", "a"
- )
_logs: List[Dict[str, str]] = []
_current_action_id: Optional[str] = None
_database: Database = PrivateAttr()
_run_id: str = PrivateAttr()
+ _file = open("out.txt", "w+")
def __init__(self, database: Database, run_id: str, **kwargs: Any):
super().__init__(**kwargs)