Skip to content

armgit / E2B

Public Imported from GitHub
0

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

fix: convert float timeout to int before string conversion (#1076)

Rayan Pala8e5201c17b4
diff --git a/.changeset/fix-timeout-float-conversion.md b/.changeset/fix-timeout-float-conversion.md
new file mode 100644
index 000000000..b773bda77
--- /dev/null
+++ b/.changeset/fix-timeout-float-conversion.md
@@ -0,0 +1,5 @@
+---
+'e2b': patch
+---
+
+fix float timeout to int conversion for Go backend compatibility
diff --git a/packages/python-sdk/e2b_connect/client.py b/packages/python-sdk/e2b_connect/client.py
index 55587fa64..61ebb6fb9 100644
--- a/packages/python-sdk/e2b_connect/client.py
+++ b/packages/python-sdk/e2b_connect/client.py
@@ -305,9 +305,9 @@ class Client:
res = self.pool.request(**req_data)
return self._process_unary_response(res)
- def _create_stream_timeout(self, timeout: Optional[int]):
+ def _create_stream_timeout(self, timeout: Optional[float]):
if timeout:
- return {"connect-timeout-ms": str(timeout * 1000)}
+ return {"connect-timeout-ms": str(int(timeout * 1000))}
return {}
def _prepare_server_stream_request(