lumera 0.6.0__tar.gz → 0.7.3__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lumera
3
- Version: 0.6.0
3
+ Version: 0.7.3
4
4
  Summary: SDK for building on Lumera platform
5
5
  Requires-Python: >=3.11
6
6
  Requires-Dist: requests
@@ -5,10 +5,10 @@ This SDK provides helpers for agents running within the Lumera Notebook environm
5
5
  to interact with the Lumera API and define dynamic user interfaces.
6
6
  """
7
7
 
8
- __version__ = "0.5.0"
8
+ __version__ = "0.7.0"
9
9
 
10
10
  # Import new modules (as modules, not individual functions)
11
- from . import exceptions, llm, locks, pb, storage
11
+ from . import automations, exceptions, llm, locks, pb, storage
12
12
  from ._utils import (
13
13
  LumeraAPIError,
14
14
  RecordNotUniqueError,
@@ -34,7 +34,7 @@ from .sdk import (
34
34
  create_record,
35
35
  delete_collection,
36
36
  delete_record,
37
- get_agent_run,
37
+ get_automation_run,
38
38
  get_collection,
39
39
  get_record,
40
40
  get_record_by_external_id,
@@ -42,8 +42,9 @@ from .sdk import (
42
42
  list_records,
43
43
  query_sql,
44
44
  replay_hook,
45
- run_agent,
45
+ run_automation,
46
46
  save_to_lumera,
47
+ update_automation_run,
47
48
  update_collection,
48
49
  update_record,
49
50
  upload_lumera_file,
@@ -73,8 +74,9 @@ __all__ = [
73
74
  # Other operations
74
75
  "replay_hook",
75
76
  "query_sql",
76
- "run_agent",
77
- "get_agent_run",
77
+ "run_automation",
78
+ "get_automation_run",
79
+ "update_automation_run",
78
80
  "upload_lumera_file",
79
81
  "save_to_lumera",
80
82
  # Type definitions
@@ -89,6 +91,7 @@ __all__ = [
89
91
  "RecordNotFoundError",
90
92
  "LockHeldError",
91
93
  # New modules (use as lumera.pb, lumera.storage, etc.)
94
+ "automations",
92
95
  "pb",
93
96
  "storage",
94
97
  "llm",
@@ -117,10 +117,10 @@ def _utcnow_iso() -> str:
117
117
  )
118
118
 
119
119
 
120
- def _default_provenance(agent_id: str, run_id: str | None) -> dict[str, Any]:
120
+ def _default_provenance(automation_id: str, run_id: str | None) -> dict[str, Any]:
121
121
  recorded_at = _utcnow_iso()
122
- env_agent_id = os.getenv("LUMERA_AGENT_ID", "").strip()
123
- agent_id = (agent_id or "").strip() or env_agent_id
122
+ env_automation_id = os.getenv("LUMERA_AUTOMATION_ID", "").strip()
123
+ automation_id = (automation_id or "").strip() or env_automation_id
124
124
 
125
125
  run_id = (run_id or "").strip() or os.getenv("LUMERA_RUN_ID", "").strip()
126
126
 
@@ -132,8 +132,8 @@ def _default_provenance(agent_id: str, run_id: str | None) -> dict[str, Any]:
132
132
  "recorded_at": recorded_at,
133
133
  }
134
134
 
135
- if agent_id:
136
- payload["agent"] = {"id": agent_id}
135
+ if automation_id:
136
+ payload["agent"] = {"id": automation_id} # Backend still expects "agent" key
137
137
 
138
138
  if run_id:
139
139
  payload["agent_run"] = {"id": run_id}
@@ -284,7 +284,7 @@ def _ensure_mapping(payload: Mapping[str, Any] | None, *, name: str) -> dict[str
284
284
  return dict(payload)
285
285
 
286
286
 
287
- def _prepare_agent_inputs(
287
+ def _prepare_automation_inputs(
288
288
  inputs: Mapping[str, Any] | str | None,
289
289
  ) -> dict[str, Any] | None:
290
290
  if inputs is None:
@@ -345,7 +345,7 @@ def _upload_file_to_presigned(upload_url: str, path: pathlib.Path, content_type:
345
345
  resp.raise_for_status()
346
346
 
347
347
 
348
- def _upload_agent_files(
348
+ def _upload_automation_files(
349
349
  run_id: str | None,
350
350
  files: Mapping[str, str | os.PathLike[str] | Sequence[str | os.PathLike[str]]],
351
351
  *,
@@ -370,7 +370,7 @@ def _upload_agent_files(
370
370
  size = file_path.stat().st_size
371
371
 
372
372
  body: dict[str, Any] = {
373
- "scope": "agent_run",
373
+ "scope": "automation_run",
374
374
  "filename": filename,
375
375
  "content_type": content_type,
376
376
  "size": size,
@@ -631,7 +631,7 @@ def _upload_session_file(file_path: str, session_id: str) -> dict:
631
631
  return {"name": filename, "notebook_path": notebook_path}
632
632
 
633
633
 
634
- def _upload_agent_run_file(file_path: str, run_id: str) -> dict:
634
+ def _upload_automation_run_file(file_path: str, run_id: str) -> dict:
635
635
  token = get_lumera_token()
636
636
  path = pathlib.Path(file_path).expanduser().resolve()
637
637
  if not path.is_file():
@@ -644,7 +644,7 @@ def _upload_agent_run_file(file_path: str, run_id: str) -> dict:
644
644
  headers = {"Authorization": f"token {token}", "Content-Type": "application/json"}
645
645
 
646
646
  resp = requests.post(
647
- f"{API_BASE}/agent-runs/{run_id}/files/upload-url",
647
+ f"{API_BASE}/automation-runs/{run_id}/files/upload-url",
648
648
  json={"filename": filename, "content_type": mimetype, "size": size},
649
649
  headers=headers,
650
650
  timeout=30,
@@ -742,10 +742,10 @@ __all__ = [
742
742
  "_is_sequence",
743
743
  "_normalize_mount_path",
744
744
  "_pretty_size",
745
- "_prepare_agent_inputs",
745
+ "_prepare_automation_inputs",
746
746
  "_record_mutation",
747
- "_upload_agent_files",
748
- "_upload_agent_run_file",
747
+ "_upload_automation_files",
748
+ "_upload_automation_run_file",
749
749
  "_upload_file_to_presigned",
750
750
  "_upload_document",
751
751
  "_upload_session_file",