Skip to content

Commit de53269

Browse files
committed
⬆️ update start/stop interface
1 parent abbbdd9 commit de53269

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

codeinterpreterapi/session.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,10 @@ def __init__(self, model=None, openai_api_key=None) -> None:
2626
self.agent_executor: AgentExecutor = self._agent_executor()
2727
self.input_files: list[File] = []
2828
self.output_files: list[File] = []
29-
30-
async def _init(self) -> None:
29+
30+
async def astart(self) -> None:
3131
await self.codebox.astart()
3232

33-
async def _close(self) -> None:
34-
await self.codebox.astop()
35-
3633
def _tools(self) -> list[StructuredTool]:
3734
return [
3835
StructuredTool(
@@ -185,9 +182,12 @@ async def generate_response(
185182
"Please try again or restart the session."
186183
)
187184

185+
async def astop(self) -> None:
186+
await self.codebox.astop()
187+
188188
async def __aenter__(self) -> "CodeInterpreterSession":
189-
await self._init()
189+
await self.astart()
190190
return self
191191

192192
async def __aexit__(self, exc_type, exc_value, traceback) -> None:
193-
await self._close()
193+
await self.astop()

0 commit comments

Comments
 (0)