Skip to content

Commit b49ff60

Browse files
CopilotOhYee
andauthored
fix: add config parameter to _build_ws_url in browser and aio data APIs
Agent-Logs-Url: https://github.com/Serverless-Devs/agentrun-sdk-python/sessions/ccb9d142-e4b4-4b89-8280-17e38737b52b Co-authored-by: OhYee <13498329+OhYee@users.noreply.github.com>
1 parent 51ead97 commit b49ff60

File tree

4 files changed

+24
-16
lines changed

4 files changed

+24
-16
lines changed

agentrun/sandbox/api/__aio_data_async_template.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,13 @@ def _assemble_ws_url(
5353
return u._replace(query=new_query).geturl()
5454

5555
def _build_ws_url(
56-
self, ws_path: str, record: Optional[bool] = False
56+
self,
57+
ws_path: str,
58+
record: Optional[bool] = False,
59+
config: Optional[Config] = None,
5760
) -> str:
58-
return self._assemble_ws_url(
59-
self.config.get_data_endpoint(), ws_path, record
60-
)
61+
cfg = Config.with_configs(self.config, config)
62+
return self._assemble_ws_url(cfg.get_data_endpoint(), ws_path, record)
6163

6264
def _build_ws_url_with_headers(
6365
self,

agentrun/sandbox/api/__browser_data_async_template.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,13 @@ def _assemble_ws_url(
4242
return u._replace(query=new_query).geturl()
4343

4444
def _build_ws_url(
45-
self, ws_path: str, record: Optional[bool] = False
45+
self,
46+
ws_path: str,
47+
record: Optional[bool] = False,
48+
config: Optional[Config] = None,
4649
) -> str:
47-
return self._assemble_ws_url(
48-
self.config.get_data_endpoint(), ws_path, record
49-
)
50+
cfg = Config.with_configs(self.config, config)
51+
return self._assemble_ws_url(cfg.get_data_endpoint(), ws_path, record)
5052

5153
def _build_ws_url_with_headers(
5254
self,

agentrun/sandbox/api/aio_data.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,13 @@ def _assemble_ws_url(
6363
return u._replace(query=new_query).geturl()
6464

6565
def _build_ws_url(
66-
self, ws_path: str, record: Optional[bool] = False
66+
self,
67+
ws_path: str,
68+
record: Optional[bool] = False,
69+
config: Optional[Config] = None,
6770
) -> str:
68-
return self._assemble_ws_url(
69-
self.config.get_data_endpoint(), ws_path, record
70-
)
71+
cfg = Config.with_configs(self.config, config)
72+
return self._assemble_ws_url(cfg.get_data_endpoint(), ws_path, record)
7173

7274
def _build_ws_url_with_headers(
7375
self,

agentrun/sandbox/api/browser_data.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,13 @@ def _assemble_ws_url(
5252
return u._replace(query=new_query).geturl()
5353

5454
def _build_ws_url(
55-
self, ws_path: str, record: Optional[bool] = False
55+
self,
56+
ws_path: str,
57+
record: Optional[bool] = False,
58+
config: Optional[Config] = None,
5659
) -> str:
57-
return self._assemble_ws_url(
58-
self.config.get_data_endpoint(), ws_path, record
59-
)
60+
cfg = Config.with_configs(self.config, config)
61+
return self._assemble_ws_url(cfg.get_data_endpoint(), ws_path, record)
6062

6163
def _build_ws_url_with_headers(
6264
self,

0 commit comments

Comments
 (0)