ibm-watsonx-orchestrate 1.11.0b0__py3-none-any.whl → 1.12.0b0__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 (47) hide show
  1. ibm_watsonx_orchestrate/__init__.py +1 -1
  2. ibm_watsonx_orchestrate/agent_builder/agents/types.py +30 -0
  3. ibm_watsonx_orchestrate/agent_builder/connections/connections.py +8 -5
  4. ibm_watsonx_orchestrate/agent_builder/connections/types.py +14 -0
  5. ibm_watsonx_orchestrate/agent_builder/knowledge_bases/types.py +25 -10
  6. ibm_watsonx_orchestrate/agent_builder/tools/__init__.py +1 -0
  7. ibm_watsonx_orchestrate/agent_builder/tools/langflow_tool.py +124 -0
  8. ibm_watsonx_orchestrate/agent_builder/tools/openapi_tool.py +3 -3
  9. ibm_watsonx_orchestrate/agent_builder/tools/types.py +20 -2
  10. ibm_watsonx_orchestrate/cli/commands/agents/agents_command.py +10 -2
  11. ibm_watsonx_orchestrate/cli/commands/agents/agents_controller.py +421 -177
  12. ibm_watsonx_orchestrate/cli/commands/connections/connections_command.py +18 -0
  13. ibm_watsonx_orchestrate/cli/commands/connections/connections_controller.py +114 -0
  14. ibm_watsonx_orchestrate/cli/commands/copilot/copilot_server_controller.py +24 -91
  15. ibm_watsonx_orchestrate/cli/commands/environment/environment_command.py +1 -1
  16. ibm_watsonx_orchestrate/cli/commands/evaluations/evaluations_command.py +223 -2
  17. ibm_watsonx_orchestrate/cli/commands/evaluations/evaluations_controller.py +93 -9
  18. ibm_watsonx_orchestrate/cli/commands/models/models_controller.py +3 -3
  19. ibm_watsonx_orchestrate/cli/commands/partners/offering/partners_offering_command.py +56 -0
  20. ibm_watsonx_orchestrate/cli/commands/partners/offering/partners_offering_controller.py +458 -0
  21. ibm_watsonx_orchestrate/cli/commands/partners/offering/types.py +107 -0
  22. ibm_watsonx_orchestrate/cli/commands/partners/partners_command.py +12 -0
  23. ibm_watsonx_orchestrate/cli/commands/partners/partners_controller.py +0 -0
  24. ibm_watsonx_orchestrate/cli/commands/server/server_command.py +114 -635
  25. ibm_watsonx_orchestrate/cli/commands/server/types.py +1 -1
  26. ibm_watsonx_orchestrate/cli/commands/toolkit/toolkit_controller.py +2 -2
  27. ibm_watsonx_orchestrate/cli/commands/tools/tools_command.py +2 -3
  28. ibm_watsonx_orchestrate/cli/commands/tools/tools_controller.py +206 -43
  29. ibm_watsonx_orchestrate/cli/main.py +2 -0
  30. ibm_watsonx_orchestrate/client/base_api_client.py +31 -10
  31. ibm_watsonx_orchestrate/client/connections/connections_client.py +18 -1
  32. ibm_watsonx_orchestrate/client/service_instance.py +19 -34
  33. ibm_watsonx_orchestrate/client/tools/tempus_client.py +3 -0
  34. ibm_watsonx_orchestrate/client/tools/tool_client.py +5 -2
  35. ibm_watsonx_orchestrate/client/utils.py +34 -2
  36. ibm_watsonx_orchestrate/docker/compose-lite.yml +14 -12
  37. ibm_watsonx_orchestrate/docker/default.env +17 -17
  38. ibm_watsonx_orchestrate/flow_builder/flows/flow.py +3 -1
  39. ibm_watsonx_orchestrate/flow_builder/types.py +252 -1
  40. ibm_watsonx_orchestrate/utils/docker_utils.py +280 -0
  41. ibm_watsonx_orchestrate/utils/environment.py +369 -0
  42. ibm_watsonx_orchestrate/utils/utils.py +1 -1
  43. {ibm_watsonx_orchestrate-1.11.0b0.dist-info → ibm_watsonx_orchestrate-1.12.0b0.dist-info}/METADATA +2 -2
  44. {ibm_watsonx_orchestrate-1.11.0b0.dist-info → ibm_watsonx_orchestrate-1.12.0b0.dist-info}/RECORD +47 -39
  45. {ibm_watsonx_orchestrate-1.11.0b0.dist-info → ibm_watsonx_orchestrate-1.12.0b0.dist-info}/WHEEL +0 -0
  46. {ibm_watsonx_orchestrate-1.11.0b0.dist-info → ibm_watsonx_orchestrate-1.12.0b0.dist-info}/entry_points.txt +0 -0
  47. {ibm_watsonx_orchestrate-1.11.0b0.dist-info → ibm_watsonx_orchestrate-1.12.0b0.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,107 @@
1
+ from enum import Enum
2
+ from typing import Optional
3
+ import logging
4
+
5
+ from pydantic import BaseModel, model_validator
6
+
7
+ logger = logging.getLogger(__name__)
8
+
9
+ CATALOG_PLACEHOLDERS = {
10
+ 'domain' : 'HR',
11
+ 'version' : '1.0',
12
+ 'part_number': 'my-part-number',
13
+ 'form_factor': 'free',
14
+ 'tenant_type': {
15
+ 'trial': 'free'
16
+ }
17
+ }
18
+
19
+ CATALOG_ONLY_FIELDS = [
20
+ 'publisher',
21
+ 'language_support',
22
+ 'icon',
23
+ 'category',
24
+ 'supported_apps'
25
+ ]
26
+
27
+ class AgentKind(str, Enum):
28
+ NATIVE = "native"
29
+ EXTERNAL = "external"
30
+
31
+ def __str__(self):
32
+ return self.value
33
+
34
+ def __repr__(self):
35
+ return repr(self.value)
36
+
37
+ class OfferingFormFactor(BaseModel):
38
+ aws: Optional[str] = CATALOG_PLACEHOLDERS['form_factor']
39
+ ibm_cloud: Optional[str] = CATALOG_PLACEHOLDERS['form_factor']
40
+ cp4d: Optional[str] = CATALOG_PLACEHOLDERS['form_factor']
41
+
42
+ class OfferingPartNumber(BaseModel):
43
+ aws: Optional[str] = CATALOG_PLACEHOLDERS['part_number']
44
+ ibm_cloud: Optional[str] = CATALOG_PLACEHOLDERS['part_number']
45
+ cp4d: Optional[str] = None
46
+
47
+ class OfferingScope(BaseModel):
48
+ form_factor: Optional[OfferingFormFactor] = OfferingFormFactor()
49
+ tenant_type: Optional[dict] = CATALOG_PLACEHOLDERS['tenant_type']
50
+
51
+ class Offering(BaseModel):
52
+ name: str
53
+ display_name: str
54
+ domain: Optional[str] = CATALOG_PLACEHOLDERS['domain']
55
+ publisher: str
56
+ version: Optional[str] = CATALOG_PLACEHOLDERS['version']
57
+ description: str
58
+ assets: dict
59
+ part_number: Optional[OfferingPartNumber] = OfferingPartNumber()
60
+ scope: Optional[OfferingScope] = OfferingScope()
61
+
62
+ def __init__(self, *args, **kwargs):
63
+ # set asset details
64
+ if not kwargs.get('assets'):
65
+ kwargs['assets'] = {
66
+ kwargs.get('publisher','default_publisher'): {
67
+ "agents": kwargs.get('agents',[]),
68
+ "tools": kwargs.get('tools',[])
69
+ }
70
+ }
71
+ super().__init__(**kwargs)
72
+
73
+ @model_validator(mode="before")
74
+ def validate_values(cls,values):
75
+ publisher = values.get('publisher')
76
+ if not publisher:
77
+ raise ValueError(f"An offering cannot be packaged without a publisher")
78
+
79
+ assets = values.get('assets')
80
+ if not assets or not assets.get(publisher):
81
+ raise ValueError(f"An offering cannot be packaged without assets")
82
+
83
+ agents = assets.get(publisher).get('agents')
84
+ if not agents:
85
+ raise ValueError(f"An offering requires at least one agent to be provided")
86
+
87
+ return values
88
+
89
+ def validate_ready_for_packaging(self):
90
+ self.test_for_placeholder_values()
91
+
92
+ def test_for_placeholder_values(self):
93
+ placholders = False
94
+ # part numbers
95
+ if not self.part_number:
96
+ raise ValueError(f"Offering '{self.name}' does not have valid part numbers")
97
+
98
+ for (k,v) in self.part_number.model_dump().items():
99
+ if v == CATALOG_PLACEHOLDERS['part_number']:
100
+ logger.warning(f"Placeholder part number detected for platform '{k}', please ensure valid part numbers are entered before packaging.")
101
+ placholders = True
102
+
103
+ if placholders:
104
+ raise ValueError(f"Offering '{self.name}' cannot be packaged with placeholder values")
105
+
106
+
107
+
@@ -0,0 +1,12 @@
1
+ import typer
2
+
3
+ from ibm_watsonx_orchestrate.cli.commands.partners import partners_controller
4
+ from ibm_watsonx_orchestrate.cli.commands.partners.offering.partners_offering_command import partners_offering
5
+
6
+ partners_app = typer.Typer(no_args_is_help=True, hidden=True)
7
+
8
+ partners_app.add_typer(
9
+ partners_offering,
10
+ name="offering",
11
+ help="Tools for partners to create and package offerings"
12
+ )