uncertainty-engine-types 0.14.0__py3-none-any.whl → 0.16.0__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,10 +1,13 @@
1
- from . import utils
2
- from .chat_history import ChatHistory
3
- from .context import Context, UserContext
4
- from .dataset import CSVDataset
5
- from .embeddings import TextEmbeddingsConfig, TextEmbeddingsProvider
6
- from .execution_error import ExecutionError
7
- from .file import (
1
+ from uncertainty_engine_types import utils
2
+ from uncertainty_engine_types.chat_history import ChatHistory
3
+ from uncertainty_engine_types.context import Context, UserContext
4
+ from uncertainty_engine_types.dataset import CSVDataset
5
+ from uncertainty_engine_types.embeddings import (
6
+ TextEmbeddingsConfig,
7
+ TextEmbeddingsProvider,
8
+ )
9
+ from uncertainty_engine_types.execution_error import ExecutionError
10
+ from uncertainty_engine_types.file import (
8
11
  PDF,
9
12
  Document,
10
13
  File,
@@ -17,28 +20,40 @@ from .file import (
17
20
  TabularData,
18
21
  WebPage,
19
22
  )
20
- from .graph import Graph, NodeElement, NodeId, SourceHandle, TargetHandle
21
- from .handle import Handle
22
- from .id import ResourceID
23
- from .job import JobInfo, JobStatus
24
- from .llm import LLMConfig, LLMProvider
25
- from .message import Message
26
- from .model import MachineLearningModel
27
- from .model_config import ModelConfig
28
- from .node_info import (
23
+ from uncertainty_engine_types.graph import (
24
+ Graph,
25
+ NodeElement,
26
+ NodeId,
27
+ SourceHandle,
28
+ TargetHandle,
29
+ )
30
+ from uncertainty_engine_types.handle import Handle
31
+ from uncertainty_engine_types.id import ResourceID
32
+ from uncertainty_engine_types.job import JobInfo, JobStatus
33
+ from uncertainty_engine_types.llm import LLMConfig, LLMProvider
34
+ from uncertainty_engine_types.message import Message
35
+ from uncertainty_engine_types.model import MachineLearningModel
36
+ from uncertainty_engine_types.model_config import ModelConfig
37
+ from uncertainty_engine_types.node_info import (
29
38
  NodeInfo,
30
39
  NodeInputInfo,
31
40
  NodeOutputInfo,
32
41
  NodeRequirementsInfo,
33
42
  ScalingInfo,
34
43
  )
35
- from .prompt import Prompt
36
- from .sensor_designer import SensorDesigner
37
- from .sql import SQLConfig, SQLKind
38
- from .token import Token
39
- from .uncertainty_plot import UncertaintyPlot
40
- from .vector_store import VectorStoreConfig, VectorStoreProvider
41
- from .version import __version__
44
+ from uncertainty_engine_types.prompt import Prompt
45
+ from uncertainty_engine_types.run_workflow import (
46
+ OverrideWorkflowInput,
47
+ OverrideWorkflowOutput,
48
+ RunWorkflowRequest,
49
+ )
50
+ from uncertainty_engine_types.sensor_designer import SensorDesigner
51
+ from uncertainty_engine_types.sql import SQLConfig, SQLKind
52
+ from uncertainty_engine_types.token import Token
53
+ from uncertainty_engine_types.tool_metadata import ToolMetadata
54
+ from uncertainty_engine_types.uncertainty_plot import UncertaintyPlot
55
+ from uncertainty_engine_types.vector_store import VectorStoreConfig, VectorStoreProvider
56
+ from uncertainty_engine_types.version import __version__
42
57
 
43
58
  __all__ = [
44
59
  "__version__",
@@ -88,4 +103,8 @@ __all__ = [
88
103
  "VectorStoreConfig",
89
104
  "VectorStoreProvider",
90
105
  "WebPage",
106
+ "OverrideWorkflowInput",
107
+ "OverrideWorkflowOutput",
108
+ "RunWorkflowRequest",
109
+ "ToolMetadata",
91
110
  ]
@@ -0,0 +1,21 @@
1
+ # Types for running a workflow via `run_workflow` or `queue_workflow` endpoints
2
+ from typing import Any, List, Optional
3
+
4
+ from pydantic import BaseModel
5
+
6
+
7
+ class OverrideWorkflowInput(BaseModel):
8
+ node_label: str
9
+ input_handle: str
10
+ value: Any # Required as any to allow for input to all nodes
11
+
12
+
13
+ class OverrideWorkflowOutput(BaseModel):
14
+ node_label: str
15
+ output_handle: str
16
+ output_label: str
17
+
18
+
19
+ class RunWorkflowRequest(BaseModel):
20
+ inputs: Optional[List[OverrideWorkflowInput]] = None
21
+ outputs: Optional[List[OverrideWorkflowOutput]] = None
@@ -0,0 +1,41 @@
1
+ from pydantic import BaseModel, Field
2
+
3
+ from uncertainty_engine_types import NodeInputInfo, NodeOutputInfo
4
+
5
+ NodeId = str
6
+ """Unique ID of a Uncertainty Engine node. Eg `label` field in the SDK"""
7
+ HandleLabel = str
8
+ """Unique ID of a handle to a given node. Eg `input_variance`"""
9
+
10
+
11
+ class ToolMetadata(BaseModel):
12
+ """Tool metadata."""
13
+
14
+ inputs: dict[NodeId, dict[HandleLabel, NodeInputInfo]] = Field(default_factory=dict)
15
+ """Defines which inputs on a workflow can be used as Tool Inputs"""
16
+ outputs: dict[NodeId, dict[HandleLabel, NodeOutputInfo]] = Field(
17
+ default_factory=dict
18
+ )
19
+ """Defines which outputs on a workflow can be used as Tool outputs"""
20
+
21
+ def is_empty(self) -> bool:
22
+ """Check if the metadata is completely empty"""
23
+ return not self.inputs and not self.outputs
24
+
25
+ def has_partial_data(self) -> bool:
26
+ """Check if only inputs or only outputs are defined"""
27
+ return bool(self.inputs) != bool(self.outputs)
28
+
29
+ def validate_complete(self) -> None:
30
+ """
31
+ Validate that tool metadata is complete (has both inputs and outputs).
32
+
33
+ Raises:
34
+ ValueError: If metadata has only inputs or only outputs
35
+ """
36
+ if self.has_partial_data():
37
+ raise ValueError(
38
+ "Tool metadata must have both inputs AND outputs defined. "
39
+ f"Currently has: inputs={'yes' if self.inputs else 'no'}, "
40
+ f"outputs={'yes' if self.outputs else 'no'}"
41
+ )
@@ -1 +1 @@
1
- __version__ = "0.14.0"
1
+ __version__ = "0.16.0"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: uncertainty-engine-types
3
- Version: 0.14.0
3
+ Version: 0.16.0
4
4
  Summary: Common type definitions for the Uncertainty Engine
5
5
  Author: Freddy Wordingham
6
6
  Author-email: freddy@digilab.ai
@@ -1,4 +1,4 @@
1
- uncertainty_engine_types/__init__.py,sha256=0FAX_KGWHoFlMgPmIUEqR5YfTSr7ffvdIt3I_O-1ETk,2005
1
+ uncertainty_engine_types/__init__.py,sha256=BFXURIPv_EoF-NMxVB_Pr0smVr4Z0U4_bYttp7owfLQ,2896
2
2
  uncertainty_engine_types/chat_history.py,sha256=OY1fZXP7_AtPKEmgjxh60PlbEGtQWJWafZMgs2Ec0BU,121
3
3
  uncertainty_engine_types/context.py,sha256=gi1izptPe05ksem5TGZNIzgzO_QmomzXwTGqvB5I9Sc,914
4
4
  uncertainty_engine_types/dataset.py,sha256=sDpQu5X3KxJ1lNkZOwhppJ2SY0Cv19cbcYfGpp_hyUQ,75
@@ -15,13 +15,15 @@ uncertainty_engine_types/model.py,sha256=O9E_7DE9AKEc1o2VnhpUyl3Quh4sGdV43gqDJwk
15
15
  uncertainty_engine_types/model_config.py,sha256=pCawKIo2l0O3eRLE5Ese7jaxomIyPXGW3XIcAx6TckY,558
16
16
  uncertainty_engine_types/node_info.py,sha256=OEhn7vPjEgLtHMb8mqW40dP9ctFdWpXOSM9CTD9NiNk,2021
17
17
  uncertainty_engine_types/prompt.py,sha256=l__qXytAapKg1Hoaj3RSVYN3rhy638nuUZIS-se0eMc,74
18
+ uncertainty_engine_types/run_workflow.py,sha256=bVKuP17uR8cToWkakoGSEpyYpa_0v7s4FFiL2xLZawg,564
18
19
  uncertainty_engine_types/sensor_designer.py,sha256=hr3ek4_dRjRK0-78uaT6h8-bGUCm7Mfs6mxJSWxE64c,80
19
20
  uncertainty_engine_types/sql.py,sha256=SBzmgMEZ-sa-OBRoZbmKiOqddop4zJixgxx-JCus9fY,298
20
21
  uncertainty_engine_types/token.py,sha256=4tQQkvl-zsYoVk8ZEx0cB2JiU0VDRJ6uUe76XBXEpBY,178
22
+ uncertainty_engine_types/tool_metadata.py,sha256=2pBTbMKhizcLMH7CtSCnAcS50MT61iwEcSRqMSTBAVw,1499
21
23
  uncertainty_engine_types/uncertainty_plot.py,sha256=kJr0SuJ6JeTxaf2adpDNWqx7vVLZRpKG8tFbdx90pas,547
22
24
  uncertainty_engine_types/utils.py,sha256=72QVig8Kb5uIR-e1nofm-3x9CouebdQJIruDbq-aIn0,271
23
25
  uncertainty_engine_types/vector_store.py,sha256=9fYPJ04jWcy2DruyUSjiKQAgmqq-wgeAi5dBIrAOm30,392
24
- uncertainty_engine_types/version.py,sha256=EVkhkQ4Bbkx92jXuCmt2_JDjQExgnrq2d3eBQIP9UAo,23
25
- uncertainty_engine_types-0.14.0.dist-info/METADATA,sha256=m6eRQCLVYmasBRAX_iXdUxrFCXjxPZvupKyTCqsZv7U,2816
26
- uncertainty_engine_types-0.14.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
27
- uncertainty_engine_types-0.14.0.dist-info/RECORD,,
26
+ uncertainty_engine_types/version.py,sha256=3Msc5baw88UJubVj5AVFB8tExkT2OFIsNWe2leaoHhc,23
27
+ uncertainty_engine_types-0.16.0.dist-info/METADATA,sha256=2Aglv8t0UPYKin33Bly5Z-4DRqQihPtCj9qwKm4v4Go,2816
28
+ uncertainty_engine_types-0.16.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
29
+ uncertainty_engine_types-0.16.0.dist-info/RECORD,,