uncertainty-engine-types 0.15.0__py3-none-any.whl → 0.17.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.
@@ -50,6 +50,7 @@ from uncertainty_engine_types.run_workflow import (
50
50
  from uncertainty_engine_types.sensor_designer import SensorDesigner
51
51
  from uncertainty_engine_types.sql import SQLConfig, SQLKind
52
52
  from uncertainty_engine_types.token import Token
53
+ from uncertainty_engine_types.tool_metadata import ToolMetadata
53
54
  from uncertainty_engine_types.uncertainty_plot import UncertaintyPlot
54
55
  from uncertainty_engine_types.vector_store import VectorStoreConfig, VectorStoreProvider
55
56
  from uncertainty_engine_types.version import __version__
@@ -105,4 +106,5 @@ __all__ = [
105
106
  "OverrideWorkflowInput",
106
107
  "OverrideWorkflowOutput",
107
108
  "RunWorkflowRequest",
109
+ "ToolMetadata",
108
110
  ]
@@ -21,9 +21,9 @@ class NodeOutputInfo(BaseModel):
21
21
 
22
22
 
23
23
  class NodeRequirementsInfo(BaseModel):
24
- cpu: int
25
- gpu: bool
26
- memory: int
24
+ cpu: int | None = None
25
+ gpu: bool | None = None
26
+ memory: int | None = None
27
27
  timeout: int
28
28
 
29
29
 
@@ -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.15.0"
1
+ __version__ = "0.17.0"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: uncertainty-engine-types
3
- Version: 0.15.0
3
+ Version: 0.17.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=lUVOcy0DDYPJKaVz_iAqVCkywP372PZrQbhvBqoIfBk,2812
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
@@ -13,16 +13,17 @@ uncertainty_engine_types/llm.py,sha256=Ae7dw1R5RKLJHFjNwBzynLd-ddikKP0NsvHvoMdmn
13
13
  uncertainty_engine_types/message.py,sha256=sX1tq_BbZC9r9-Vf0A3WHiOFRE2hAAlY-7rD52kbsoU,381
14
14
  uncertainty_engine_types/model.py,sha256=O9E_7DE9AKEc1o2VnhpUyl3Quh4sGdV43gqDJwk-y68,196
15
15
  uncertainty_engine_types/model_config.py,sha256=pCawKIo2l0O3eRLE5Ese7jaxomIyPXGW3XIcAx6TckY,558
16
- uncertainty_engine_types/node_info.py,sha256=OEhn7vPjEgLtHMb8mqW40dP9ctFdWpXOSM9CTD9NiNk,2021
16
+ uncertainty_engine_types/node_info.py,sha256=LbNXMKmPCNQoDWVSUlC2mpu3KOsMeG6WUy8pBBWFtT8,2063
17
17
  uncertainty_engine_types/prompt.py,sha256=l__qXytAapKg1Hoaj3RSVYN3rhy638nuUZIS-se0eMc,74
18
18
  uncertainty_engine_types/run_workflow.py,sha256=bVKuP17uR8cToWkakoGSEpyYpa_0v7s4FFiL2xLZawg,564
19
19
  uncertainty_engine_types/sensor_designer.py,sha256=hr3ek4_dRjRK0-78uaT6h8-bGUCm7Mfs6mxJSWxE64c,80
20
20
  uncertainty_engine_types/sql.py,sha256=SBzmgMEZ-sa-OBRoZbmKiOqddop4zJixgxx-JCus9fY,298
21
21
  uncertainty_engine_types/token.py,sha256=4tQQkvl-zsYoVk8ZEx0cB2JiU0VDRJ6uUe76XBXEpBY,178
22
+ uncertainty_engine_types/tool_metadata.py,sha256=2pBTbMKhizcLMH7CtSCnAcS50MT61iwEcSRqMSTBAVw,1499
22
23
  uncertainty_engine_types/uncertainty_plot.py,sha256=kJr0SuJ6JeTxaf2adpDNWqx7vVLZRpKG8tFbdx90pas,547
23
24
  uncertainty_engine_types/utils.py,sha256=72QVig8Kb5uIR-e1nofm-3x9CouebdQJIruDbq-aIn0,271
24
25
  uncertainty_engine_types/vector_store.py,sha256=9fYPJ04jWcy2DruyUSjiKQAgmqq-wgeAi5dBIrAOm30,392
25
- uncertainty_engine_types/version.py,sha256=wGIgxINRfcIKyk0LjIbc9UF9UwuclyCQZv_axTUzwNw,23
26
- uncertainty_engine_types-0.15.0.dist-info/METADATA,sha256=jDJIIGuyIos_pJ19oEwITh7-_0ZaeDX8XYwE6nGmO7g,2816
27
- uncertainty_engine_types-0.15.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
28
- uncertainty_engine_types-0.15.0.dist-info/RECORD,,
26
+ uncertainty_engine_types/version.py,sha256=XpM3lncCzPBIwMSvDN7i10pke_c6KdJtVLZYbCiaTRw,23
27
+ uncertainty_engine_types-0.17.0.dist-info/METADATA,sha256=N3e3oxAmKB6-Y4ASkGuxsJIUCUr_jLuFD0O5CYWlqEY,2816
28
+ uncertainty_engine_types-0.17.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
29
+ uncertainty_engine_types-0.17.0.dist-info/RECORD,,