e2b-dev / E2B

Secure open source cloud runtime for AI apps & AI agents
https://e2b.dev/docs
Apache License 2.0
7.02k stars 458 forks source link

websocket error in `run_code()` #362

Closed sudoskys closed 7 months ago

sudoskys commented 7 months ago
[DEBUG] | E2b:stdout: 
stderr:  | @2024-04-19T12:44:36.983435+0800
Exception ignored in: <async_generator object Connect.__aiter__ at 0x752245783a40>
Traceback (most recent call last):
  File "/home/<user>/Project/Project/LlmKira/Openaibot/.venv/lib/python3.11/site-packages/e2b/sandbox/websocket_client.py", line 107, in _connect
    break
RuntimeError: async generator ignored GeneratorExit

Code here: https://github.com/LlmKira/Openaibot/blob/236c843e67ae1302018d6c812b61f3d4eb0ca4a7/llmkira/extra/plugins/e2b_code_interpreter/__init__.py#L36

mlejva commented 7 months ago

Hi @sudoskys, thanks for reporting this! In the meantime, can you please provide minimal reproducible example?

mlejva commented 7 months ago

Also @sudoskys check out our new SDK for building code interpreter like features. It might be a better fit - https://github.com/e2b-dev/code-interpreter

sudoskys commented 7 months ago

Hi @sudoskys, thanks for reporting this! In the meantime, can you please provide minimal reproducible example

import e2b
api_key="your_key"
stdout, stderr = e2b.run_code("Node16", "const result = (1+2+3) * 100; result", api_key=api_key)
sudoskys commented 7 months ago

Also @sudoskys check out our new SDK for building code interpreter like features. It might be a better fit - https://github.com/e2b-dev/code-interpreter

OK, I'll check it out, thanks for your response

sudoskys commented 7 months ago

Solved by removing nest_asyncio