uncertainty-engine-types 0.0.6__tar.gz → 0.0.8__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 (24) hide show
  1. {uncertainty_engine_types-0.0.6 → uncertainty_engine_types-0.0.8}/PKG-INFO +1 -1
  2. {uncertainty_engine_types-0.0.6 → uncertainty_engine_types-0.0.8}/pyproject.toml +1 -1
  3. {uncertainty_engine_types-0.0.6 → uncertainty_engine_types-0.0.8}/uncertainty_engine_types/__init__.py +26 -3
  4. uncertainty_engine_types-0.0.8/uncertainty_engine_types/file.py +48 -0
  5. uncertainty_engine_types-0.0.8/uncertainty_engine_types/handle.py +27 -0
  6. uncertainty_engine_types-0.0.8/uncertainty_engine_types/utils.py +9 -0
  7. uncertainty_engine_types-0.0.8/uncertainty_engine_types/version.py +1 -0
  8. uncertainty_engine_types-0.0.6/uncertainty_engine_types/handle.py +0 -15
  9. uncertainty_engine_types-0.0.6/uncertainty_engine_types/tabular_data.py +0 -5
  10. uncertainty_engine_types-0.0.6/uncertainty_engine_types/version.py +0 -1
  11. {uncertainty_engine_types-0.0.6 → uncertainty_engine_types-0.0.8}/README.md +0 -0
  12. {uncertainty_engine_types-0.0.6 → uncertainty_engine_types-0.0.8}/uncertainty_engine_types/context.py +0 -0
  13. {uncertainty_engine_types-0.0.6 → uncertainty_engine_types-0.0.8}/uncertainty_engine_types/conversation.py +0 -0
  14. {uncertainty_engine_types-0.0.6 → uncertainty_engine_types-0.0.8}/uncertainty_engine_types/execution_error.py +0 -0
  15. {uncertainty_engine_types-0.0.6 → uncertainty_engine_types-0.0.8}/uncertainty_engine_types/graph.py +0 -0
  16. {uncertainty_engine_types-0.0.6 → uncertainty_engine_types-0.0.8}/uncertainty_engine_types/job.py +0 -0
  17. {uncertainty_engine_types-0.0.6 → uncertainty_engine_types-0.0.8}/uncertainty_engine_types/llm.py +0 -0
  18. {uncertainty_engine_types-0.0.6 → uncertainty_engine_types-0.0.8}/uncertainty_engine_types/message.py +0 -0
  19. {uncertainty_engine_types-0.0.6 → uncertainty_engine_types-0.0.8}/uncertainty_engine_types/model.py +0 -0
  20. {uncertainty_engine_types-0.0.6 → uncertainty_engine_types-0.0.8}/uncertainty_engine_types/node_info.py +0 -0
  21. {uncertainty_engine_types-0.0.6 → uncertainty_engine_types-0.0.8}/uncertainty_engine_types/sensor_designer.py +0 -0
  22. {uncertainty_engine_types-0.0.6 → uncertainty_engine_types-0.0.8}/uncertainty_engine_types/sql.py +0 -0
  23. {uncertainty_engine_types-0.0.6 → uncertainty_engine_types-0.0.8}/uncertainty_engine_types/token.py +0 -0
  24. {uncertainty_engine_types-0.0.6 → uncertainty_engine_types-0.0.8}/uncertainty_engine_types/vector_store.py +0 -0
@@ -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,6 +1,6 @@
1
1
  [project]
2
2
  name = "uncertainty-engine-types"
3
- version = "0.0.6"
3
+ version = "0.0.8"
4
4
  description = "Common type definitions for the Uncertainty Engine"
5
5
  authors = [
6
6
  { name = "Freddy Wordingham", email = "freddy@digilab.ai" },
@@ -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
@@ -0,0 +1,27 @@
1
+ from pydantic import BaseModel, model_validator
2
+
3
+
4
+ class Handle(BaseModel):
5
+ node_name: str
6
+ node_handle: str
7
+
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
19
+
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)
@@ -0,0 +1 @@
1
+ __version__ = "0.0.8"
@@ -1,15 +0,0 @@
1
- from pydantic import BaseModel
2
-
3
-
4
- class Handle(BaseModel):
5
- node_name: str
6
- node_handle: str
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
- )
13
-
14
- node_name, node_handle = handle_str.split(".")
15
- super().__init__(node_name=node_name, node_handle=node_handle)
@@ -1,5 +0,0 @@
1
- from pydantic import BaseModel
2
-
3
-
4
- class TabularData(BaseModel):
5
- csv: str
@@ -1 +0,0 @@
1
- __version__ = "0.0.6"