lmnr 0.2.2__py3-none-any.whl → 0.2.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- from typing import Callable
1
+ from typing import Callable, Optional
2
2
  from websockets.sync.client import connect
3
3
  from lmnr.types import NodeInput, RegisterDebuggerRequest, SDKError, ToolCall
4
4
  import uuid
@@ -14,9 +14,11 @@ class RemoteDebugger:
14
14
  self.stop_flag = False
15
15
  self.session = None
16
16
 
17
- def start(self):
17
+ def start(self) -> Optional[str]:
18
18
  self.stop_flag = False
19
+ self.session = self._generate_session_id()
19
20
  self.thread.start()
21
+ return self.session
20
22
 
21
23
  def stop(self):
22
24
  self.stop_flag = True
@@ -26,8 +28,10 @@ class RemoteDebugger:
26
28
  # in case the user wants to start the debugger again
27
29
  self.thread = Thread(target=self._run)
28
30
 
31
+ def get_session_id(self) -> str:
32
+ return self.session
33
+
29
34
  def _run(self):
30
- self.session = self._generate_session_id()
31
35
  request = RegisterDebuggerRequest(debugger_session_id=self.session)
32
36
  with connect(
33
37
  self.url,
@@ -36,6 +40,7 @@ class RemoteDebugger:
36
40
  }
37
41
  ) as websocket:
38
42
  websocket.send(request.model_dump_json())
43
+ print(self._format_session_id())
39
44
  while not self.stop_flag:
40
45
  try:
41
46
  # blocks the thread until a message is received or a timeout (3 seconds) occurs
@@ -66,20 +71,16 @@ class RemoteDebugger:
66
71
  pass
67
72
  response = tool(**arguments)
68
73
  websocket.send(json.dumps(response))
69
-
70
-
71
- def get_session_id(self) -> str:
72
- return self._format_session_id(self.session)
73
74
 
74
75
  def _generate_session_id(self) -> str:
75
76
  return uuid.uuid4().urn[9:]
76
77
 
77
- def _format_session_id(self, session_id: str) -> str:
78
+ def _format_session_id(self) -> str:
78
79
  return \
79
80
  f"""
80
81
  ========================================
81
82
  Debugger Session ID:
82
- {session_id}
83
+ {self.session_id}
83
84
  ========================================
84
85
  """
85
86
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lmnr
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: Python SDK for Laminar AI
5
5
  License: Apache-2.0
6
6
  Author: lmnr.ai
@@ -19,10 +19,10 @@ lmnr/cli/{{cookiecutter.lmnr_pipelines_dir_name}}/pipelines/{{cookiecutter.pipel
19
19
  lmnr/cli/{{cookiecutter.lmnr_pipelines_dir_name}}/pipelines/{{cookiecutter.pipeline_dir_name}}/{{cookiecutter.pipeline_dir_name}}.py,sha256=WG-ZMofPpGXCx5jdWVry3_XBzcKjqn8ZycFSiWEOBPg,2858
20
20
  lmnr/cli/{{cookiecutter.lmnr_pipelines_dir_name}}/types.py,sha256=iWuflMV7TiaBPs6-B-BlrovvWpZgHGGHK0v8rSqER7A,997
21
21
  lmnr/sdk/endpoint.py,sha256=tT6-w-mwbh4BAwnj5G0pCVE_Sz8EUzZmpBtacm_T2pE,6359
22
- lmnr/sdk/remote_debugger.py,sha256=SsKVBnw1rKHsOp-kdSfi87QMUMjmAf3y4Xi3tFM0GOI,3094
22
+ lmnr/sdk/remote_debugger.py,sha256=eXbfnl0RoBcGCViajIFsY5W28HQIf791HTffbWBNJY4,3156
23
23
  lmnr/types.py,sha256=f_46qjFK_jJziNFEzN-ip8bgPHxkohib2xGesNOdyxs,1526
24
- lmnr-0.2.2.dist-info/LICENSE,sha256=67b_wJHVV1CBaWkrKFWU1wyqTPSdzH77Ls-59631COg,10411
25
- lmnr-0.2.2.dist-info/METADATA,sha256=atAJKnS9lga-I89PGbtuIOJGc3HuRPHY377Xa4RIldA,2258
26
- lmnr-0.2.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
27
- lmnr-0.2.2.dist-info/entry_points.txt,sha256=Qg7ZRax4k-rcQsZ26XRYQ8YFSBiyY2PNxYfq4a6PYXI,41
28
- lmnr-0.2.2.dist-info/RECORD,,
24
+ lmnr-0.2.3.dist-info/LICENSE,sha256=67b_wJHVV1CBaWkrKFWU1wyqTPSdzH77Ls-59631COg,10411
25
+ lmnr-0.2.3.dist-info/METADATA,sha256=GdJL6YTZ3VnbuQvkz9kPN5QYrC4wBFdkpwq_Er79P28,2258
26
+ lmnr-0.2.3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
27
+ lmnr-0.2.3.dist-info/entry_points.txt,sha256=Qg7ZRax4k-rcQsZ26XRYQ8YFSBiyY2PNxYfq4a6PYXI,41
28
+ lmnr-0.2.3.dist-info/RECORD,,
File without changes
File without changes