ibm-watsonx-orchestrate 1.4.2__py3-none-any.whl → 1.5.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.
- ibm_watsonx_orchestrate/__init__.py +2 -1
- ibm_watsonx_orchestrate/agent_builder/knowledge_bases/types.py +1 -0
- ibm_watsonx_orchestrate/cli/commands/models/models_command.py +7 -2
- ibm_watsonx_orchestrate/client/models/types.py +13 -1
- ibm_watsonx_orchestrate/client/toolkit/toolkit_client.py +13 -8
- ibm_watsonx_orchestrate/docker/default.env +9 -9
- ibm_watsonx_orchestrate/experimental/flow_builder/data_map.py +19 -0
- ibm_watsonx_orchestrate/experimental/flow_builder/flows/__init__.py +4 -3
- ibm_watsonx_orchestrate/experimental/flow_builder/flows/constants.py +3 -1
- ibm_watsonx_orchestrate/experimental/flow_builder/flows/decorators.py +3 -2
- ibm_watsonx_orchestrate/experimental/flow_builder/flows/flow.py +245 -223
- ibm_watsonx_orchestrate/experimental/flow_builder/node.py +34 -15
- ibm_watsonx_orchestrate/experimental/flow_builder/resources/flow_status.openapi.yml +7 -39
- ibm_watsonx_orchestrate/experimental/flow_builder/types.py +285 -12
- ibm_watsonx_orchestrate/experimental/flow_builder/utils.py +3 -1
- {ibm_watsonx_orchestrate-1.4.2.dist-info → ibm_watsonx_orchestrate-1.5.0.dist-info}/METADATA +1 -1
- {ibm_watsonx_orchestrate-1.4.2.dist-info → ibm_watsonx_orchestrate-1.5.0.dist-info}/RECORD +20 -20
- ibm_watsonx_orchestrate/experimental/flow_builder/flows/data_map.py +0 -91
- {ibm_watsonx_orchestrate-1.4.2.dist-info → ibm_watsonx_orchestrate-1.5.0.dist-info}/WHEEL +0 -0
- {ibm_watsonx_orchestrate-1.4.2.dist-info → ibm_watsonx_orchestrate-1.5.0.dist-info}/entry_points.txt +0 -0
- {ibm_watsonx_orchestrate-1.4.2.dist-info → ibm_watsonx_orchestrate-1.5.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,91 +0,0 @@
|
|
1
|
-
from typing import Any, List, cast
|
2
|
-
import uuid
|
3
|
-
import json
|
4
|
-
import yaml
|
5
|
-
from pydantic import BaseModel, Field, SerializeAsAny
|
6
|
-
|
7
|
-
from ibm_watsonx_orchestrate.agent_builder.tools.types import (
|
8
|
-
ToolRequestBody, ToolResponseBody, JsonSchemaObject
|
9
|
-
)
|
10
|
-
from ..types import (
|
11
|
-
_to_json_from_input_schema, _to_json_from_output_schema, SchemaRef, Assignment
|
12
|
-
)
|
13
|
-
|
14
|
-
class DataMapSpec(BaseModel):
|
15
|
-
|
16
|
-
name: str
|
17
|
-
|
18
|
-
def __init__(self, **data: Any) -> None:
|
19
|
-
if 'id' not in data:
|
20
|
-
data['id'] = str(uuid.uuid4())
|
21
|
-
super().__init__(**data)
|
22
|
-
|
23
|
-
def to_json(self) -> dict[Any, dict]:
|
24
|
-
'''Create a JSON object representing the data'''
|
25
|
-
model_spec = {}
|
26
|
-
model_spec["name"] = self.name
|
27
|
-
return model_spec
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
class AssignmentDataMapSpec(DataMapSpec):
|
32
|
-
|
33
|
-
maps: List[Assignment]
|
34
|
-
|
35
|
-
def to_json(self) -> dict[str, Any]:
|
36
|
-
'''Create a JSON object representing the data'''
|
37
|
-
model_spec = super().to_json()
|
38
|
-
|
39
|
-
if self.maps:
|
40
|
-
model_spec["maps"] = [assignment.model_dump() for assignment in self.maps]
|
41
|
-
|
42
|
-
return model_spec
|
43
|
-
|
44
|
-
|
45
|
-
class DataMap(BaseModel):
|
46
|
-
|
47
|
-
spec: SerializeAsAny[DataMapSpec]
|
48
|
-
|
49
|
-
def __call__(self, **kwargs):
|
50
|
-
pass
|
51
|
-
|
52
|
-
def dump_spec(self, file: str) -> None:
|
53
|
-
|
54
|
-
dumped = self.spec.model_dump(mode='json',
|
55
|
-
exclude_unset=True, exclude_none=True, by_alias=True)
|
56
|
-
with open(file, 'w', encoding="utf-8") as f:
|
57
|
-
if file.endswith('.yaml') or file.endswith('.yml'):
|
58
|
-
yaml.dump(dumped, f)
|
59
|
-
elif file.endswith('.json'):
|
60
|
-
json.dump(dumped, f, indent=2)
|
61
|
-
else:
|
62
|
-
raise ValueError('file must end in .json, .yaml, or .yml')
|
63
|
-
|
64
|
-
def dumps_spec(self) -> str:
|
65
|
-
|
66
|
-
dumped = self.spec.model_dump(mode='json',
|
67
|
-
exclude_unset=True, exclude_none=True, by_alias=True)
|
68
|
-
return json.dumps(dumped, indent=2)
|
69
|
-
|
70
|
-
def __repr__(self):
|
71
|
-
return f"DataMap(name='{self.spec.name}', description='{self.spec.description}')"
|
72
|
-
|
73
|
-
def to_json(self) -> dict[str, Any]:
|
74
|
-
|
75
|
-
obj = self.get_spec().to_json()
|
76
|
-
|
77
|
-
return { "spec": obj }
|
78
|
-
|
79
|
-
def get_spec(self) -> DataMapSpec:
|
80
|
-
|
81
|
-
return self.spec
|
82
|
-
|
83
|
-
class AssignmentDataMap(DataMap):
|
84
|
-
def get_spec(self) -> AssignmentDataMapSpec:
|
85
|
-
return cast(AssignmentDataMapSpec, self.spec)
|
86
|
-
|
87
|
-
def to_json(self) -> dict[str, Any]:
|
88
|
-
|
89
|
-
obj = super().to_json()
|
90
|
-
return obj
|
91
|
-
|
File without changes
|
{ibm_watsonx_orchestrate-1.4.2.dist-info → ibm_watsonx_orchestrate-1.5.0.dist-info}/entry_points.txt
RENAMED
File without changes
|
{ibm_watsonx_orchestrate-1.4.2.dist-info → ibm_watsonx_orchestrate-1.5.0.dist-info}/licenses/LICENSE
RENAMED
File without changes
|