lmnr 0.2.11__tar.gz → 0.2.12__tar.gz

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.
Files changed (27) hide show
  1. {lmnr-0.2.11 → lmnr-0.2.12}/PKG-INFO +1 -1
  2. {lmnr-0.2.11 → lmnr-0.2.12}/pyproject.toml +2 -2
  3. {lmnr-0.2.11 → lmnr-0.2.12}/src/lmnr/cli/cli.py +47 -0
  4. {lmnr-0.2.11 → lmnr-0.2.12}/LICENSE +0 -0
  5. {lmnr-0.2.11 → lmnr-0.2.12}/README.md +0 -0
  6. {lmnr-0.2.11 → lmnr-0.2.12}/src/lmnr/__init__.py +0 -0
  7. {lmnr-0.2.11 → lmnr-0.2.12}/src/lmnr/cli/__init__.py +0 -0
  8. {lmnr-0.2.11 → lmnr-0.2.12}/src/lmnr/cli/__main__.py +0 -0
  9. {lmnr-0.2.11 → lmnr-0.2.12}/src/lmnr/cli/parser/__init__.py +0 -0
  10. {lmnr-0.2.11 → lmnr-0.2.12}/src/lmnr/cli/parser/nodes/__init__.py +0 -0
  11. {lmnr-0.2.11 → lmnr-0.2.12}/src/lmnr/cli/parser/nodes/code.py +0 -0
  12. {lmnr-0.2.11 → lmnr-0.2.12}/src/lmnr/cli/parser/nodes/condition.py +0 -0
  13. {lmnr-0.2.11 → lmnr-0.2.12}/src/lmnr/cli/parser/nodes/input.py +0 -0
  14. {lmnr-0.2.11 → lmnr-0.2.12}/src/lmnr/cli/parser/nodes/json_extractor.py +0 -0
  15. {lmnr-0.2.11 → lmnr-0.2.12}/src/lmnr/cli/parser/nodes/llm.py +0 -0
  16. {lmnr-0.2.11 → lmnr-0.2.12}/src/lmnr/cli/parser/nodes/output.py +0 -0
  17. {lmnr-0.2.11 → lmnr-0.2.12}/src/lmnr/cli/parser/nodes/router.py +0 -0
  18. {lmnr-0.2.11 → lmnr-0.2.12}/src/lmnr/cli/parser/nodes/semantic_search.py +0 -0
  19. {lmnr-0.2.11 → lmnr-0.2.12}/src/lmnr/cli/parser/nodes/types.py +0 -0
  20. {lmnr-0.2.11 → lmnr-0.2.12}/src/lmnr/cli/parser/parser.py +0 -0
  21. {lmnr-0.2.11 → lmnr-0.2.12}/src/lmnr/cli/parser/utils.py +0 -0
  22. {lmnr-0.2.11 → lmnr-0.2.12}/src/lmnr/cli/zip.py +0 -0
  23. {lmnr-0.2.11 → lmnr-0.2.12}/src/lmnr/sdk/__init__.py +0 -0
  24. {lmnr-0.2.11 → lmnr-0.2.12}/src/lmnr/sdk/endpoint.py +0 -0
  25. {lmnr-0.2.11 → lmnr-0.2.12}/src/lmnr/sdk/registry.py +0 -0
  26. {lmnr-0.2.11 → lmnr-0.2.12}/src/lmnr/sdk/remote_debugger.py +0 -0
  27. {lmnr-0.2.11 → lmnr-0.2.12}/src/lmnr/types.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lmnr
3
- Version: 0.2.11
3
+ Version: 0.2.12
4
4
  Summary: Python SDK for Laminar AI
5
5
  License: Apache-2.0
6
6
  Author: lmnr.ai
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "lmnr"
3
- version = "0.2.11"
3
+ version = "0.2.12"
4
4
  description = "Python SDK for Laminar AI"
5
5
  authors = [
6
6
  { name = "lmnr.ai", email = "founders@lmnr.ai" }
@@ -11,7 +11,7 @@ license = "Apache-2.0"
11
11
 
12
12
  [tool.poetry]
13
13
  name = "lmnr"
14
- version = "0.2.11"
14
+ version = "0.2.12"
15
15
  description = "Python SDK for Laminar AI"
16
16
  authors = ["lmnr.ai"]
17
17
  readme = "README.md"
@@ -1,4 +1,5 @@
1
1
  from pathlib import Path
2
+ import sys
2
3
  import requests
3
4
  from dotenv import load_dotenv
4
5
  import os
@@ -8,6 +9,8 @@ from cookiecutter.main import cookiecutter
8
9
  from pydantic.alias_generators import to_pascal
9
10
 
10
11
  from lmnr.cli.zip import zip_directory
12
+ from lmnr.sdk.registry import Registry as Pipeline
13
+ from lmnr.sdk.remote_debugger import RemoteDebugger
11
14
 
12
15
  from .parser.parser import runnable_graph_to_template_vars
13
16
 
@@ -134,3 +137,47 @@ def deploy(endpoint_id, project_api_key):
134
137
  logging.exception("Error in deploying code")
135
138
  finally:
136
139
  Path.unlink(zip_file_path, missing_ok=True)
140
+
141
+
142
+ @cli.command(name="dev")
143
+ @click.option(
144
+ "-p",
145
+ "--project-api-key",
146
+ help="Project API key",
147
+ )
148
+ def dev(project_api_key):
149
+ project_api_key = project_api_key or os.environ.get("LMNR_PROJECT_API_KEY")
150
+ if not project_api_key:
151
+ load_dotenv()
152
+ project_api_key = os.environ.get("LMNR_PROJECT_API_KEY")
153
+ if not project_api_key:
154
+ raise ValueError("LMNR_PROJECT_API_KEY is not set")
155
+
156
+ print(f"Sys path: {sys.path}")
157
+
158
+ cur_dir = os.getcwd() # e.g. /Users/username/project_name
159
+ parent_dir, name = os.path.split(cur_dir) # e.g. /Users/username, project_name
160
+
161
+ # Needed to __import__ pipeline.py
162
+ if sys.path[0] != parent_dir:
163
+ sys.path.insert(0, parent_dir)
164
+ # Needed to import src in pipeline.py and other files
165
+ if cur_dir not in sys.path:
166
+ sys.path.insert(0, cur_dir)
167
+
168
+ print(f"Sys path: {sys.path}")
169
+
170
+ module_name = f"{name}.pipeline"
171
+ __import__(module_name)
172
+ module = sys.modules[module_name]
173
+
174
+ matches = [v for v in module.__dict__.values() if isinstance(v, Pipeline)]
175
+ if not matches:
176
+ raise ValueError("No Pipeline found in the module")
177
+ if len(matches) > 1:
178
+ raise ValueError("Multiple Pipelines found in the module")
179
+ pipeline = matches[0]
180
+
181
+ tools = pipeline.functions
182
+ debugger = RemoteDebugger(project_api_key, tools)
183
+ debugger.start()
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes