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.
Files changed (21) hide show
  1. ibm_watsonx_orchestrate/__init__.py +2 -1
  2. ibm_watsonx_orchestrate/agent_builder/knowledge_bases/types.py +1 -0
  3. ibm_watsonx_orchestrate/cli/commands/models/models_command.py +7 -2
  4. ibm_watsonx_orchestrate/client/models/types.py +13 -1
  5. ibm_watsonx_orchestrate/client/toolkit/toolkit_client.py +13 -8
  6. ibm_watsonx_orchestrate/docker/default.env +9 -9
  7. ibm_watsonx_orchestrate/experimental/flow_builder/data_map.py +19 -0
  8. ibm_watsonx_orchestrate/experimental/flow_builder/flows/__init__.py +4 -3
  9. ibm_watsonx_orchestrate/experimental/flow_builder/flows/constants.py +3 -1
  10. ibm_watsonx_orchestrate/experimental/flow_builder/flows/decorators.py +3 -2
  11. ibm_watsonx_orchestrate/experimental/flow_builder/flows/flow.py +245 -223
  12. ibm_watsonx_orchestrate/experimental/flow_builder/node.py +34 -15
  13. ibm_watsonx_orchestrate/experimental/flow_builder/resources/flow_status.openapi.yml +7 -39
  14. ibm_watsonx_orchestrate/experimental/flow_builder/types.py +285 -12
  15. ibm_watsonx_orchestrate/experimental/flow_builder/utils.py +3 -1
  16. {ibm_watsonx_orchestrate-1.4.2.dist-info → ibm_watsonx_orchestrate-1.5.0.dist-info}/METADATA +1 -1
  17. {ibm_watsonx_orchestrate-1.4.2.dist-info → ibm_watsonx_orchestrate-1.5.0.dist-info}/RECORD +20 -20
  18. ibm_watsonx_orchestrate/experimental/flow_builder/flows/data_map.py +0 -91
  19. {ibm_watsonx_orchestrate-1.4.2.dist-info → ibm_watsonx_orchestrate-1.5.0.dist-info}/WHEEL +0 -0
  20. {ibm_watsonx_orchestrate-1.4.2.dist-info → ibm_watsonx_orchestrate-1.5.0.dist-info}/entry_points.txt +0 -0
  21. {ibm_watsonx_orchestrate-1.4.2.dist-info → ibm_watsonx_orchestrate-1.5.0.dist-info}/licenses/LICENSE +0 -0
@@ -5,7 +5,8 @@
5
5
 
6
6
  pkg_name = "ibm-watsonx-orchestrate"
7
7
 
8
- __version__ = "1.4.2"
8
+ __version__ = "1.5.0"
9
+
9
10
 
10
11
 
11
12
 
@@ -201,6 +201,7 @@ class ConversationalSearchConfig(BaseModel):
201
201
  confidence_thresholds: Optional[ConfidenceThresholds] = None
202
202
 
203
203
  class KnowledgeBaseBuiltInVectorIndexConfig(BaseModel):
204
+ embeddings_model_name: Optional[str] = None
204
205
  chunk_size: Optional[int] = None
205
206
  chunk_overlap: Optional[int] = None
206
207
  limit: Optional[int] = None
@@ -14,7 +14,7 @@ from ibm_watsonx_orchestrate.client.model_policies.model_policies_client import
14
14
  from ibm_watsonx_orchestrate.client.model_policies.types import ModelPolicy, ModelPolicyInner, \
15
15
  ModelPolicyRetry, ModelPolicyStrategy, ModelPolicyStrategyMode, ModelPolicyTarget
16
16
  from ibm_watsonx_orchestrate.client.models.models_client import ModelsClient
17
- from ibm_watsonx_orchestrate.client.models.types import CreateVirtualModel, ANTHROPIC_DEFAULT_MAX_TOKENS
17
+ from ibm_watsonx_orchestrate.client.models.types import CreateVirtualModel, ModelType, ANTHROPIC_DEFAULT_MAX_TOKENS
18
18
  from ibm_watsonx_orchestrate.client.utils import instantiate_client
19
19
 
20
20
  logger = logging.getLogger(__name__)
@@ -156,6 +156,10 @@ def models_add(
156
156
  str,
157
157
  typer.Option('--display-name', help='What name should this llm appear as within the ui'),
158
158
  ] = None,
159
+ type: Annotated[
160
+ ModelType,
161
+ typer.Option('--type', help='What type of model is it'),
162
+ ] = ModelType.CHAT,
159
163
 
160
164
  ):
161
165
  from ibm_watsonx_orchestrate.cli.commands.models.env_file_model_provider_mapper import env_file_to_model_ProviderConfig # lazily import this because the lut building is expensive
@@ -178,7 +182,8 @@ def models_add(
178
182
  description=description,
179
183
  tags=[],
180
184
  provider_config=provider_config,
181
- config=config
185
+ config=config,
186
+ model_type=type
182
187
  )
183
188
 
184
189
  models_client.create(model)
@@ -29,6 +29,18 @@ class ModelProvider(str, Enum):
29
29
 
30
30
  def __repr__(self):
31
31
  return self.value
32
+
33
+ class ModelType(str, Enum):
34
+ CHAT = 'chat'
35
+ CHAT_VISION = 'chat_vision'
36
+ COMPLETION = 'completion'
37
+ EMBEDDING = 'embedding'
38
+
39
+ def __str__(self):
40
+ return self.value
41
+
42
+ def __repr__(self):
43
+ return self.value
32
44
 
33
45
 
34
46
  class ProviderConfig(BaseModel):
@@ -158,7 +170,7 @@ class CreateVirtualModel(BaseModel):
158
170
  config: Optional[dict] = None
159
171
  provider_config: ProviderConfig
160
172
  tags: List[str]
161
- model_type: str = 'chat'
173
+ model_type: str = ModelType.CHAT
162
174
 
163
175
 
164
176
  class ListVirtualModel(BaseModel):
@@ -8,10 +8,10 @@ class ToolKitClient(BaseAPIClient):
8
8
 
9
9
  def __init__(self, *args, **kwargs):
10
10
  super().__init__(*args, **kwargs)
11
- self.base_endpoint = "/orchestrate/toolkits" if is_local_dev(self.base_url) else "/toolkits"
12
11
 
13
12
  def get(self) -> dict:
14
- return self._get(self.base_endpoint)
13
+ return self._get("/toolkits")
14
+
15
15
 
16
16
  # POST /toolkits/prepare/list-tools
17
17
  def list_tools(self, zip_file_path: str, command: str, args: List[str]) -> List[str]:
@@ -33,7 +33,8 @@ class ToolKitClient(BaseAPIClient):
33
33
  "file": (filename, f, "application/zip"),
34
34
  }
35
35
 
36
- response = self._post(f"{self.base_endpoint}/prepare/list-tools", files=files)
36
+ response = self._post("/toolkits/prepare/list-tools", files=files)
37
+
37
38
 
38
39
  return response.get("tools", [])
39
40
 
@@ -44,7 +45,8 @@ class ToolKitClient(BaseAPIClient):
44
45
  Creates new toolkit metadata
45
46
  """
46
47
  try:
47
- return self._post(self.base_endpoint, data=payload)
48
+ return self._post("/toolkits", data=payload)
49
+
48
50
  except ClientAPIException as e:
49
51
  if e.response.status_code == 400 and "already exists" in e.response.text:
50
52
  raise ClientAPIException(
@@ -63,25 +65,28 @@ class ToolKitClient(BaseAPIClient):
63
65
  files = {
64
66
  "file": (filename, f, "application/zip", {"Expires": "0"})
65
67
  }
66
- return self._post(f"{self.base_endpoint}/{toolkit_id}/upload", files=files)
68
+ return self._post(f"/toolkits/{toolkit_id}/upload", files=files)
67
69
 
68
70
  # DELETE /toolkits/{toolkit-id}
69
71
  def delete(self, toolkit_id: str) -> dict:
70
- return self._delete(f"{self.base_endpoint}/{toolkit_id}")
72
+ return self._delete(f"/toolkits/{toolkit_id}")
73
+
71
74
 
72
75
  def get_draft_by_name(self, toolkit_name: str) -> List[dict]:
73
76
  return self.get_drafts_by_names([toolkit_name])
74
77
 
75
78
  def get_drafts_by_names(self, toolkit_names: List[str]) -> List[dict]:
76
79
  formatted_toolkit_names = [f"names={x}" for x in toolkit_names]
77
- return self._get(f"{self.base_endpoint}?{'&'.join(formatted_toolkit_names)}")
80
+
81
+ return self._get(f"/toolkits?{'&'.join(formatted_toolkit_names)}")
82
+
78
83
 
79
84
  def get_draft_by_id(self, toolkit_id: str) -> dict:
80
85
  if toolkit_id is None:
81
86
  return ""
82
87
  else:
83
88
  try:
84
- toolkit = self._get(f"{self.base_endpoint}/{toolkit_id}")
89
+ toolkit = self._get(f"/toolkits/{toolkit_id}")
85
90
  return toolkit
86
91
  except ClientAPIException as e:
87
92
  if e.response.status_code == 404 and "not found with the given name" in e.response.text:
@@ -53,21 +53,21 @@ EVENT_BROKER_TTL="-1"
53
53
  # See get_default_registry_env_vars_by_dev_edition_source() in src/ibm_watsonx_orchestrate/cli/commands/server/server_command.py for more details.
54
54
  REGISTRY_URL=
55
55
 
56
- SERVER_TAG=22-05-2025
56
+ SERVER_TAG=30-05-2025
57
57
  SERVER_REGISTRY=
58
58
 
59
- WORKER_TAG=22-05-2025
59
+ WORKER_TAG=30-05-2025
60
60
  WORKER_REGISTRY=
61
61
 
62
- AI_GATEWAY_TAG=20-05-2025
62
+ AI_GATEWAY_TAG=30-05-2025
63
63
  AI_GATEWAY_REGISTRY=
64
64
 
65
65
  DB_REGISTRY=
66
66
  # If you build multiarch set all three of these to the same, we have a pr against main
67
67
  # to not have this separation, but we can merge it later
68
- DBTAG=21-05-2025
69
- AMDDBTAG=21-05-2025
70
- ARM64DBTAG=21-05-2025
68
+ DBTAG=30-05-2025
69
+ AMDDBTAG=30-05-2025
70
+ ARM64DBTAG=30-05-2025
71
71
 
72
72
  UI_REGISTRY=
73
73
  UITAG=23-05-2025
@@ -75,13 +75,13 @@ UITAG=23-05-2025
75
75
  CM_REGISTRY=
76
76
  CM_TAG=13-05-2025
77
77
 
78
- TRM_TAG=23-05-2025
78
+ TRM_TAG=25-05-2025
79
79
  TRM_REGISTRY=
80
80
 
81
- TR_TAG=23-05-2025
81
+ TR_TAG=25-05-2025
82
82
  TR_REGISTRY=
83
83
 
84
- BUILDER_TAG=21-05-2025
84
+ BUILDER_TAG=27-05-2025
85
85
  BUILDER_REGISTRY=
86
86
 
87
87
 
@@ -0,0 +1,19 @@
1
+ from typing import Any, Optional, Self
2
+ from pydantic import BaseModel, Field, SerializeAsAny
3
+
4
+ from .types import (
5
+ Assignment
6
+ )
7
+
8
+
9
+ class DataMap(BaseModel):
10
+ maps: Optional[list[Assignment]] = Field(default_factory=list)
11
+
12
+ def to_json(self) -> dict[str, Any]:
13
+ model_spec = {}
14
+ if self.maps and len(self.maps) > 0:
15
+ model_spec["maps"] = [assignment.model_dump() for assignment in self.maps]
16
+
17
+ def add(self, line: Assignment) -> Self:
18
+ self.maps.append(line)
19
+
@@ -1,9 +1,9 @@
1
1
  from .constants import START, END, RESERVED
2
2
  from ..types import FlowContext, TaskData, TaskEventType
3
- from ..node import UserNode, AgentNode, StartNode, EndNode
3
+ from ..node import UserNode, AgentNode, StartNode, EndNode, PromptNode
4
4
  from .flow import Flow, CompiledFlow, FlowRun, FlowEvent, FlowEventType, FlowFactory, MatchPolicy, WaitPolicy, ForeachPolicy, Branch, Foreach, Loop
5
5
  from .decorators import user, flow_spec, flow
6
- from .data_map import Assignment, DataMapSpec
6
+ from ..data_map import Assignment, DataMap
7
7
 
8
8
 
9
9
  __all__ = [
@@ -19,8 +19,9 @@ __all__ = [
19
19
  "AgentNode",
20
20
  "StartNode",
21
21
  "EndNode",
22
+ "PromptNode",
22
23
  "Assignment",
23
- "DataMapSpec",
24
+ "DataMap",
24
25
 
25
26
  "Flow",
26
27
  "CompiledFlow",
@@ -7,11 +7,13 @@ START = sys.intern("__start__")
7
7
  END = sys.intern("__end__")
8
8
 
9
9
  ANY_USER = sys.intern("__any_user__")
10
+ CURRENT_USER = sys.intern("__current_user__")
10
11
  FLOW_CONTEXT = sys.intern("FlowContext")
11
12
 
12
13
  RESERVED = {
13
14
  START,
14
15
  END,
15
16
  FLOW_CONTEXT,
16
- ANY_USER
17
+ ANY_USER,
18
+ CURRENT_USER
17
19
  }
@@ -27,8 +27,8 @@ class FlowWrapper:
27
27
  raise ValueError("Return value must be of type Flow")
28
28
  return result
29
29
 
30
- def user(*args, name: str|None=None, description: str|None=None, owners: Sequence[str] = ()):
31
- """Decorator to mark a function as a task specification."""
30
+ def user(*args, name: str|None=None, description: str|None=None, owners: Sequence[str]|None = None, message: str | None = None):
31
+ """Decorator to mark a function as a user node specification."""
32
32
 
33
33
  def decorator(func: Callable):
34
34
  node_spec = extract_node_spec(func, name, description)
@@ -39,6 +39,7 @@ def user(*args, name: str|None=None, description: str|None=None, owners: Sequenc
39
39
  input_schema = node_spec.input_schema,
40
40
  output_schema = node_spec.output_schema,
41
41
  output_schema_object = node_spec.output_schema_object,
42
+ text=message,
42
43
  owners=owners)
43
44
 
44
45
  @wraps(func)