uncertainty-engine-types 0.0.6__py3-none-any.whl → 0.0.8__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,16 +1,29 @@
1
+ from . import utils
1
2
  from .context import Context
2
3
  from .conversation import Conversation
3
4
  from .execution_error import ExecutionError
5
+ from .file import (
6
+ Document,
7
+ File,
8
+ FileLocation,
9
+ Image,
10
+ LocalStorage,
11
+ Mesh,
12
+ PDF,
13
+ S3Storage,
14
+ SQLTable,
15
+ TabularData,
16
+ WebPage,
17
+ )
4
18
  from .graph import Graph, NodeElement, NodeId, SourceHandle, TargetHandle
5
19
  from .handle import Handle
6
20
  from .job import JobInfo, JobStatus
7
21
  from .llm import LLMConfig, LLMProvider
8
22
  from .message import Message
9
23
  from .model import MachineLearningModel
10
- from .node_info import NodeInfo, NodeInputInfo, NodeOutputInfo, Versions
24
+ from .node_info import NodeInfo, NodeInputInfo, NodeOutputInfo
11
25
  from .sensor_designer import SensorDesigner
12
26
  from .sql import SQLConfig, SQLKind
13
- from .tabular_data import TabularData
14
27
  from .token import Token
15
28
  from .vector_store import VectorStoreConfig, VectorStoreProvider
16
29
  from .version import __version__
@@ -20,28 +33,38 @@ __all__ = [
20
33
  "__version__",
21
34
  "Context",
22
35
  "Conversation",
36
+ "Document",
23
37
  "ExecutionError",
38
+ "File",
39
+ "FileLocation",
24
40
  "Graph",
25
41
  "Handle",
42
+ "Image",
26
43
  "JobInfo",
27
44
  "JobStatus",
28
45
  "LLMConfig",
29
46
  "LLMProvider",
47
+ "LocalStorage",
30
48
  "MachineLearningModel",
49
+ "Mesh",
31
50
  "Message",
32
51
  "NodeElement",
33
52
  "NodeId",
34
53
  "NodeInfo",
35
54
  "NodeInputInfo",
36
55
  "NodeOutputInfo",
56
+ "PDF",
57
+ "S3Storage",
37
58
  "SensorDesigner",
38
59
  "SourceHandle",
39
60
  "SQLConfig",
40
61
  "SQLKind",
62
+ "SQLTable",
41
63
  "TabularData",
42
64
  "TargetHandle",
43
65
  "Token",
66
+ "utils",
44
67
  "VectorStoreConfig",
45
68
  "VectorStoreProvider",
46
- "Versions",
69
+ "WebPage",
47
70
  ]
@@ -0,0 +1,48 @@
1
+ from typing import Union
2
+
3
+ from pydantic import BaseModel
4
+
5
+
6
+ class S3Storage(BaseModel):
7
+ bucket: str
8
+ key: str
9
+
10
+
11
+ class LocalStorage(BaseModel):
12
+ path: str
13
+
14
+
15
+ FileLocation = Union[S3Storage, LocalStorage]
16
+
17
+
18
+ class File(BaseModel):
19
+ pass
20
+
21
+
22
+ class Document(File):
23
+ location: FileLocation
24
+
25
+
26
+ class Image(File):
27
+ location: FileLocation
28
+
29
+
30
+ class Mesh(File):
31
+ location: FileLocation
32
+
33
+
34
+ class PDF(File):
35
+ location: FileLocation
36
+
37
+
38
+ class SQLTable(File):
39
+ url: str
40
+ query: str
41
+
42
+
43
+ class TabularData(File):
44
+ location: FileLocation
45
+
46
+
47
+ class WebPage(File):
48
+ url: str
@@ -1,15 +1,27 @@
1
- from pydantic import BaseModel
1
+ from pydantic import BaseModel, model_validator
2
2
 
3
3
 
4
4
  class Handle(BaseModel):
5
5
  node_name: str
6
6
  node_handle: str
7
7
 
8
- def __init__(self, handle_str: str):
9
- if handle_str.count(".") != 1:
10
- raise ValueError(
11
- "Handle string must contain exactly one dot ('.') separating node and handle"
12
- )
8
+ @model_validator(mode="before")
9
+ @classmethod
10
+ def split_handle(cls, values):
11
+ if isinstance(values, str):
12
+ parts = values.split(".")
13
+ if len(parts) != 2:
14
+ raise ValueError(
15
+ "Handle string must contain exactly one dot ('.') separating node and handle"
16
+ )
17
+ return {"node_name": parts[0], "node_handle": parts[1]}
18
+ return values
13
19
 
14
- node_name, node_handle = handle_str.split(".")
15
- super().__init__(node_name=node_name, node_handle=node_handle)
20
+ def __init__(self, *args, **kwargs):
21
+ if args:
22
+ if len(args) == 1 and isinstance(args[0], str):
23
+ # Convert the positional argument to a dict via model_validate
24
+ kwargs = self.__class__.model_validate(args[0]).model_dump()
25
+ else:
26
+ raise TypeError("Invalid positional arguments")
27
+ super().__init__(**kwargs)
@@ -0,0 +1,9 @@
1
+ from pydantic import ValidationError
2
+
3
+
4
+ def format_pydantic_errors(e: ValidationError) -> str:
5
+ msgs = []
6
+ for error in e.errors():
7
+ loc = " -> ".join(map(str, error["loc"]))
8
+ msgs.append(f"Error at '{loc}': {error['msg']}")
9
+ return "\n".join(msgs)
@@ -1 +1 @@
1
- __version__ = "0.0.6"
1
+ __version__ = "0.0.8"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: uncertainty-engine-types
3
- Version: 0.0.6
3
+ Version: 0.0.8
4
4
  Summary: Common type definitions for the Uncertainty Engine
5
5
  Author: Freddy Wordingham
6
6
  Author-email: freddy@digilab.ai
@@ -1,9 +1,10 @@
1
- uncertainty_engine_types/__init__.py,sha256=6pB7JPLiwVbNJJ65-SxaK_-Uj8Kc5kKlj_VTwYt6weM,1188
1
+ uncertainty_engine_types/__init__.py,sha256=D9bTgnPGoBMJqAod_s7kyzjRO00p5E90iC6TThLB8PI,1480
2
2
  uncertainty_engine_types/context.py,sha256=k9rlArn-L2x1P5vWy5khfuqJW5tJOqr3NlhubZCbyG4,209
3
3
  uncertainty_engine_types/conversation.py,sha256=uDHTr4uPzjkcflhyFAanfiQ1KbEIs4C9jogrwzOEt_s,122
4
4
  uncertainty_engine_types/execution_error.py,sha256=tvIBuZPM8UhFUERHCEqoW8blAYYuBq1ZqidO0i_BCGs,105
5
+ uncertainty_engine_types/file.py,sha256=J202bhOIVnvvvAG54sXyYF8fwjZGTUP3097ARnRnb3Q,579
5
6
  uncertainty_engine_types/graph.py,sha256=ii2YT2jxoRB7UhcceI2k_ArKmlUXEwBCRBpsEUjL2Qg,265
6
- uncertainty_engine_types/handle.py,sha256=DEu3aCwJsOuinQ2Gxdy6dZbwnCHAXkplIT4WNL6o7oQ,444
7
+ uncertainty_engine_types/handle.py,sha256=buX_xEdBwT7vZRs5uCEPB6VCbSWIFbCE-NYIL4fZSjg,942
7
8
  uncertainty_engine_types/job.py,sha256=eYDe-MW4s-kXGL1Ke1VxdwoduW66orJAa0L1XwGdYi0,347
8
9
  uncertainty_engine_types/llm.py,sha256=oivoY3aDv5Rsk8FWA-vOPEFfK9a6-SqSyu01AlEuO7o,406
9
10
  uncertainty_engine_types/message.py,sha256=KncFJQHL_ko8nfOuso_eh7i2gB0y4nXI6gBW9U8lAEY,971
@@ -11,10 +12,10 @@ uncertainty_engine_types/model.py,sha256=O9E_7DE9AKEc1o2VnhpUyl3Quh4sGdV43gqDJwk
11
12
  uncertainty_engine_types/node_info.py,sha256=2p87fCdX_CrdT2ZODtGJ-mR1Mvg46WhaE1GMddaEVak,800
12
13
  uncertainty_engine_types/sensor_designer.py,sha256=hr3ek4_dRjRK0-78uaT6h8-bGUCm7Mfs6mxJSWxE64c,80
13
14
  uncertainty_engine_types/sql.py,sha256=SBzmgMEZ-sa-OBRoZbmKiOqddop4zJixgxx-JCus9fY,298
14
- uncertainty_engine_types/tabular_data.py,sha256=i_1LfgQqxDanPRWuDkP3Hd8-9eVet6FbPIlPZlAi1n0,76
15
15
  uncertainty_engine_types/token.py,sha256=4tQQkvl-zsYoVk8ZEx0cB2JiU0VDRJ6uUe76XBXEpBY,178
16
+ uncertainty_engine_types/utils.py,sha256=72QVig8Kb5uIR-e1nofm-3x9CouebdQJIruDbq-aIn0,271
16
17
  uncertainty_engine_types/vector_store.py,sha256=9fYPJ04jWcy2DruyUSjiKQAgmqq-wgeAi5dBIrAOm30,392
17
- uncertainty_engine_types/version.py,sha256=QiiYsv0kcJaB8wCWyT-FnI2b6be87HA-CrrIUn8LQhg,22
18
- uncertainty_engine_types-0.0.6.dist-info/METADATA,sha256=PQkB_d60eZxSWxPEyxRBq6bPpPvYsAdb4iuxEySMia0,2815
19
- uncertainty_engine_types-0.0.6.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
20
- uncertainty_engine_types-0.0.6.dist-info/RECORD,,
18
+ uncertainty_engine_types/version.py,sha256=wOJN3HxAgnSon5vWYU3Txm2UZ_7tBHDKXUKZIH-mXX8,22
19
+ uncertainty_engine_types-0.0.8.dist-info/METADATA,sha256=XkrqvGnn2EGgHII5lf4oWhbswMBH2SWZdW6QaTNoJfM,2815
20
+ uncertainty_engine_types-0.0.8.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
21
+ uncertainty_engine_types-0.0.8.dist-info/RECORD,,
@@ -1,5 +0,0 @@
1
- from pydantic import BaseModel
2
-
3
-
4
- class TabularData(BaseModel):
5
- csv: str