ibm-watsonx-orchestrate 1.6.1__py3-none-any.whl → 1.7.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/agents/agent.py +3 -3
- ibm_watsonx_orchestrate/agent_builder/agents/assistant_agent.py +3 -2
- ibm_watsonx_orchestrate/agent_builder/agents/external_agent.py +3 -2
- ibm_watsonx_orchestrate/agent_builder/agents/types.py +9 -8
- ibm_watsonx_orchestrate/agent_builder/connections/connections.py +4 -3
- ibm_watsonx_orchestrate/agent_builder/knowledge_bases/knowledge_base_requests.py +1 -22
- ibm_watsonx_orchestrate/agent_builder/knowledge_bases/types.py +1 -17
- ibm_watsonx_orchestrate/agent_builder/tools/base_tool.py +2 -1
- ibm_watsonx_orchestrate/agent_builder/tools/openapi_tool.py +14 -13
- ibm_watsonx_orchestrate/agent_builder/tools/python_tool.py +136 -92
- ibm_watsonx_orchestrate/agent_builder/tools/types.py +10 -9
- ibm_watsonx_orchestrate/cli/commands/agents/agents_command.py +7 -7
- ibm_watsonx_orchestrate/cli/commands/agents/agents_controller.py +4 -3
- ibm_watsonx_orchestrate/cli/commands/environment/environment_controller.py +5 -5
- ibm_watsonx_orchestrate/cli/commands/environment/types.py +2 -0
- ibm_watsonx_orchestrate/cli/commands/knowledge_bases/knowledge_bases_command.py +0 -18
- ibm_watsonx_orchestrate/cli/commands/knowledge_bases/knowledge_bases_controller.py +33 -19
- ibm_watsonx_orchestrate/cli/commands/models/models_command.py +1 -1
- ibm_watsonx_orchestrate/cli/commands/server/server_command.py +100 -36
- ibm_watsonx_orchestrate/cli/commands/toolkit/toolkit_command.py +1 -1
- ibm_watsonx_orchestrate/cli/commands/tools/tools_controller.py +11 -4
- ibm_watsonx_orchestrate/cli/config.py +3 -3
- ibm_watsonx_orchestrate/cli/init_helper.py +10 -1
- ibm_watsonx_orchestrate/cli/main.py +2 -0
- ibm_watsonx_orchestrate/client/knowledge_bases/knowledge_base_client.py +1 -1
- ibm_watsonx_orchestrate/client/local_service_instance.py +3 -1
- ibm_watsonx_orchestrate/client/service_instance.py +33 -7
- ibm_watsonx_orchestrate/docker/compose-lite.yml +177 -2
- ibm_watsonx_orchestrate/docker/default.env +22 -2
- ibm_watsonx_orchestrate/flow_builder/flows/__init__.py +3 -1
- ibm_watsonx_orchestrate/flow_builder/flows/decorators.py +4 -2
- ibm_watsonx_orchestrate/flow_builder/flows/events.py +10 -9
- ibm_watsonx_orchestrate/flow_builder/flows/flow.py +91 -20
- ibm_watsonx_orchestrate/flow_builder/node.py +12 -1
- ibm_watsonx_orchestrate/flow_builder/types.py +169 -16
- ibm_watsonx_orchestrate/flow_builder/utils.py +120 -5
- ibm_watsonx_orchestrate/utils/exceptions.py +23 -0
- {ibm_watsonx_orchestrate-1.6.1.dist-info → ibm_watsonx_orchestrate-1.7.0.dist-info}/METADATA +4 -4
- {ibm_watsonx_orchestrate-1.6.1.dist-info → ibm_watsonx_orchestrate-1.7.0.dist-info}/RECORD +43 -43
- ibm_watsonx_orchestrate/flow_builder/resources/flow_status.openapi.yml +0 -66
- {ibm_watsonx_orchestrate-1.6.1.dist-info → ibm_watsonx_orchestrate-1.7.0.dist-info}/WHEEL +0 -0
- {ibm_watsonx_orchestrate-1.6.1.dist-info → ibm_watsonx_orchestrate-1.7.0.dist-info}/entry_points.txt +0 -0
- {ibm_watsonx_orchestrate-1.6.1.dist-info → ibm_watsonx_orchestrate-1.7.0.dist-info}/licenses/LICENSE +0 -0
@@ -6,6 +6,7 @@ from copy import deepcopy
|
|
6
6
|
from ibm_watsonx_orchestrate.cli.commands.tools.types import RegistryType
|
7
7
|
from ibm_watsonx_orchestrate.utils.utils import yaml_safe_load
|
8
8
|
from enum import Enum
|
9
|
+
from ibm_watsonx_orchestrate.utils.exceptions import BadRequest
|
9
10
|
|
10
11
|
# Section Headers
|
11
12
|
AUTH_SECTION_HEADER = "auth"
|
@@ -82,7 +83,6 @@ def _check_if_default_config_file(folder, file):
|
|
82
83
|
def _check_if_auth_config_file(folder, file):
|
83
84
|
return folder == AUTH_CONFIG_FILE_FOLDER and file == AUTH_CONFIG_FILE
|
84
85
|
|
85
|
-
|
86
86
|
def clear_protected_env_credentials_token():
|
87
87
|
auth_cfg = Config(config_file_folder=AUTH_CONFIG_FILE_FOLDER, config_file=AUTH_CONFIG_FILE)
|
88
88
|
auth_cfg.delete(AUTH_SECTION_HEADER, PROTECTED_ENV_NAME, AUTH_MCSP_TOKEN_OPT)
|
@@ -91,7 +91,7 @@ def clear_protected_env_credentials_token():
|
|
91
91
|
class ConfigFileTypes(str, Enum):
|
92
92
|
AUTH = 'auth'
|
93
93
|
CONFIG = 'config'
|
94
|
-
|
94
|
+
DOCPROC_FEATURE_CONF= 'docproc_feature'
|
95
95
|
|
96
96
|
class Config:
|
97
97
|
|
@@ -209,7 +209,7 @@ class Config:
|
|
209
209
|
as keys to access deeper sections of the config and then deleting the last specified key.
|
210
210
|
"""
|
211
211
|
if len(args) < 1:
|
212
|
-
raise
|
212
|
+
raise BadRequest("Config.delete() requires at least one positional argument")
|
213
213
|
|
214
214
|
config_data = {}
|
215
215
|
try:
|
@@ -4,6 +4,7 @@ from typing import Optional
|
|
4
4
|
from rich import print as pprint
|
5
5
|
from dotenv import dotenv_values
|
6
6
|
import typer
|
7
|
+
import sys
|
7
8
|
|
8
9
|
from ibm_watsonx_orchestrate.cli.config import Config, PYTHON_REGISTRY_HEADER, \
|
9
10
|
PYTHON_REGISTRY_TEST_PACKAGE_VERSION_OVERRIDE_OPT
|
@@ -29,7 +30,6 @@ def version_callback(checkVersion: bool=True):
|
|
29
30
|
|
30
31
|
raise typer.Exit()
|
31
32
|
|
32
|
-
|
33
33
|
|
34
34
|
def init_callback(
|
35
35
|
ctx: typer.Context,
|
@@ -38,6 +38,15 @@ def init_callback(
|
|
38
38
|
"--version",
|
39
39
|
help="Show the installed version of the ADK and Developer Edition Tags",
|
40
40
|
callback=version_callback
|
41
|
+
),
|
42
|
+
debug: Optional[bool] = typer.Option(
|
43
|
+
False,
|
44
|
+
"--debug",
|
45
|
+
help="Enable debug mode"
|
41
46
|
)
|
42
47
|
):
|
48
|
+
if debug:
|
49
|
+
sys.tracebacklimit = 40
|
50
|
+
else:
|
51
|
+
sys.tracebacklimit = 0
|
43
52
|
pass
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import typer
|
2
|
+
import sys
|
2
3
|
|
3
4
|
from ibm_watsonx_orchestrate.cli.commands.connections.connections_command import connections_app
|
4
5
|
from ibm_watsonx_orchestrate.cli.commands.login.login_command import login_app
|
@@ -24,6 +25,7 @@ app = typer.Typer(
|
|
24
25
|
pretty_exceptions_enable=False,
|
25
26
|
callback=init_callback
|
26
27
|
)
|
28
|
+
|
27
29
|
app.add_typer(login_app)
|
28
30
|
app.add_typer(environment_app, name="env", help='Add, remove, or select the activate env other commands will interact with (either your local server or a production instance)')
|
29
31
|
app.add_typer(agents_app, name="agents", help='Interact with the agents in your active env')
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from ibm_watsonx_orchestrate.client.base_api_client import BaseAPIClient
|
1
|
+
from ibm_watsonx_orchestrate.client.base_api_client import BaseAPIClient, ClientAPIException
|
2
2
|
import json
|
3
3
|
from typing_extensions import List
|
4
4
|
from ibm_watsonx_orchestrate.client.utils import is_local_dev
|
@@ -2,6 +2,8 @@ from ibm_watsonx_orchestrate.client.base_service_instance import BaseServiceInst
|
|
2
2
|
import logging
|
3
3
|
import requests
|
4
4
|
from ibm_watsonx_orchestrate.client.credentials import Credentials
|
5
|
+
import json
|
6
|
+
import base64
|
5
7
|
|
6
8
|
logger = logging.getLogger(__name__)
|
7
9
|
|
@@ -11,7 +13,7 @@ DEFAULT_TENANT = {
|
|
11
13
|
"tags": ["test"]
|
12
14
|
}
|
13
15
|
|
14
|
-
DEFAULT_USER =
|
16
|
+
DEFAULT_USER = json.loads(base64.b64decode('eyJ1c2VybmFtZSI6ICJ3eG8uYXJjaGVyQGlibS5jb20iLCJwYXNzd29yZCI6ICJ3YXRzb254In0='))
|
15
17
|
DEFAULT_LOCAL_SERVICE_URL = "http://localhost:4321"
|
16
18
|
DEFAULT_LOCAL_AUTH_ENDPOINT = f"{DEFAULT_LOCAL_SERVICE_URL}/api/v1/auth/token"
|
17
19
|
DEFAULT_LOCAL_TENANT_URL = f"{DEFAULT_LOCAL_SERVICE_URL}/api/v1/tenants"
|
@@ -6,6 +6,7 @@
|
|
6
6
|
from __future__ import annotations
|
7
7
|
|
8
8
|
from ibm_cloud_sdk_core.authenticators import MCSPAuthenticator
|
9
|
+
from ibm_cloud_sdk_core.authenticators import MCSPV2Authenticator
|
9
10
|
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
|
10
11
|
from ibm_cloud_sdk_core.authenticators import CloudPakForDataAuthenticator
|
11
12
|
|
@@ -51,24 +52,47 @@ class ServiceInstance(BaseServiceInstance):
|
|
51
52
|
def _create_token(self) -> str:
|
52
53
|
if not self._credentials.auth_type:
|
53
54
|
if ".cloud.ibm.com" in self._credentials.url:
|
54
|
-
logger.warning("Using IBM IAM Auth Type. If this is incorrect please use the '--type' flag to explicitly choose one of '
|
55
|
+
logger.warning("Using IBM IAM Auth Type. If this is incorrect please use the '--type' flag to explicitly choose one of 'mcsp', 'mcsp_v1', 'mcsp_v2' or 'cpd' ")
|
55
56
|
return self._authenticate(EnvironmentAuthType.IBM_CLOUD_IAM)
|
56
57
|
elif is_cpd_env(self._credentials.url):
|
57
|
-
logger.warning("Using CPD Auth Type. If this is incorrect please use the '--type' flag to explicitly choose one of 'ibm_iam'
|
58
|
+
logger.warning("Using CPD Auth Type. If this is incorrect please use the '--type' flag to explicitly choose one of 'ibm_iam', 'mcsp', 'mcsp_v1' or 'mcsp_v2' ")
|
58
59
|
return self._authenticate(EnvironmentAuthType.CPD)
|
59
60
|
else:
|
60
|
-
logger.warning("Using MCSP Auth Type. If this is incorrect please use the '--type' flag to explicitly choose one of 'ibm_iam'
|
61
|
-
|
61
|
+
logger.warning("Using MCSP Auth Type. If this is incorrect please use the '--type' flag to explicitly choose one of 'ibm_iam', 'mcsp_v1', 'mcsp_v2' or 'cpd' ")
|
62
|
+
try:
|
63
|
+
return self._authenticate(EnvironmentAuthType.MCSP_V1)
|
64
|
+
except:
|
65
|
+
return self._authenticate(EnvironmentAuthType.MCSP_V2)
|
66
|
+
auth_type = self._credentials.auth_type.lower()
|
67
|
+
if auth_type == "mcsp":
|
68
|
+
try:
|
69
|
+
return self._authenticate(EnvironmentAuthType.MCSP_V1)
|
70
|
+
except:
|
71
|
+
return self._authenticate(EnvironmentAuthType.MCSP_V2)
|
72
|
+
elif auth_type == "mcsp_v1":
|
73
|
+
return self._authenticate(EnvironmentAuthType.MCSP_V1)
|
74
|
+
elif auth_type == "mcsp_v2":
|
75
|
+
return self._authenticate(EnvironmentAuthType.MCSP_V2)
|
62
76
|
else:
|
63
|
-
return self._authenticate(
|
77
|
+
return self._authenticate(auth_type)
|
64
78
|
|
65
79
|
def _authenticate(self, auth_type: str) -> str:
|
66
80
|
"""Handles authentication based on the auth_type."""
|
67
81
|
try:
|
68
82
|
match auth_type:
|
69
|
-
case EnvironmentAuthType.MCSP:
|
83
|
+
case EnvironmentAuthType.MCSP | EnvironmentAuthType.MCSP_V1:
|
70
84
|
url = self._credentials.iam_url if self._credentials.iam_url is not None else "https://iam.platform.saas.ibm.com"
|
71
85
|
authenticator = MCSPAuthenticator(apikey=self._credentials.api_key, url=url)
|
86
|
+
case EnvironmentAuthType.MCSP_V2:
|
87
|
+
url = self._credentials.iam_url if self._credentials.iam_url is not None else "https://account-iam.platform.saas.ibm.com"
|
88
|
+
wxo_url = self._credentials.url
|
89
|
+
instance_id = wxo_url.split("instances/")[1]
|
90
|
+
authenticator = MCSPV2Authenticator(
|
91
|
+
apikey=self._credentials.api_key,
|
92
|
+
url=url,
|
93
|
+
scope_collection_type="services",
|
94
|
+
scope_id=instance_id
|
95
|
+
)
|
72
96
|
case EnvironmentAuthType.IBM_CLOUD_IAM:
|
73
97
|
authenticator = IAMAuthenticator(apikey=self._credentials.api_key, url=self._credentials.iam_url)
|
74
98
|
case EnvironmentAuthType.CPD:
|
@@ -100,8 +124,10 @@ class ServiceInstance(BaseServiceInstance):
|
|
100
124
|
raise ClientError(f"Unsupported authentication type: {auth_type}")
|
101
125
|
|
102
126
|
return authenticator.token_manager.get_token()
|
127
|
+
|
103
128
|
except Exception as e:
|
104
|
-
raise ClientError(f"Error getting {auth_type.upper()} Token",
|
129
|
+
raise ClientError(f"Error getting {auth_type.upper()} Token", logg_messages=False)
|
130
|
+
|
105
131
|
|
106
132
|
|
107
133
|
def _is_token_refresh_possible(self) -> bool:
|
@@ -751,8 +751,8 @@ services:
|
|
751
751
|
SERVER_HTTP_PORT: "9044"
|
752
752
|
SERVER_CONTEXT_PATH:
|
753
753
|
SERVER_JWK_URL: https://wo-ibm-dev.verify.ibm.com/v1.0/endpoint/default/jwks
|
754
|
-
SERVER_STANDALONE_TASK_CALLBACK_URL: http://
|
755
|
-
SERVER_FLOW_CALLBACK_URL: http://
|
754
|
+
SERVER_STANDALONE_TASK_CALLBACK_URL: http://wxo-tempus-runtime:9044/task/callback/{thread_id}/{requestId}
|
755
|
+
SERVER_FLOW_CALLBACK_URL: http://wxo-tempus-runtime:9044/v1/flows/{flow_instance_id}/{task_instance_id}/resume/async
|
756
756
|
JWT_SECRET: ${JWT_SECRET}
|
757
757
|
SERVER_INTERNAL_PROTOCOL: http
|
758
758
|
SERVER_INTERNAL_HOSTNAME: wxo-tempus-runtime
|
@@ -780,6 +780,9 @@ services:
|
|
780
780
|
LANGFUSE_PUBLIC_KEY: ${LANGFUSE_PUBLIC_KEY:-pk-lf-7417757e-d6df-421b-957e-683b76acb5df}
|
781
781
|
LANGFUSE_SECRET_KEY: ${LANGFUSE_PRIVATE_KEY:-sk-lf-7bc4da63-7b2b-40c0-b5eb-1e0cf64f9af2}
|
782
782
|
LOG_LEVEL: info
|
783
|
+
DISABLE_FLOW_BINDING: true
|
784
|
+
DOCPROC_ENABLED: ${DOCPROC_ENABLED:-false}
|
785
|
+
DOCPROC_BASE_URL: http://wxo-doc-processing-infra-standalone:9080
|
783
786
|
WO_API_KEY: ${WO_API_KEY}
|
784
787
|
WO_INSTANCE: ${WO_INSTANCE}
|
785
788
|
AUTHORIZATION_URL: ${AUTHORIZATION_URL}
|
@@ -794,6 +797,170 @@ services:
|
|
794
797
|
depends_on:
|
795
798
|
- wxo-server-db
|
796
799
|
|
800
|
+
########################
|
801
|
+
# DOCPROC dependencies
|
802
|
+
# DPS - 18081
|
803
|
+
# DPI - 19080 / 19443
|
804
|
+
# WDU - 18082
|
805
|
+
# WDU (Prometheus) - 18086
|
806
|
+
# DPS Cache - 18083
|
807
|
+
# LLM Service - 18084
|
808
|
+
########################
|
809
|
+
|
810
|
+
wxo-doc-processing-service:
|
811
|
+
image: ${DOCPROC_REGISTRY:-us.icr.io/watson-orchestrate-private}/document-processing/wo_doc_processing_service:${DOCPROC_DPS_TAG:-20250606-172035-246-4191121}
|
812
|
+
platform: linux/amd64
|
813
|
+
restart: unless-stopped
|
814
|
+
environment:
|
815
|
+
SERVICE_NAME: wxo-doc-processing-service
|
816
|
+
LOG_LEVEL: info
|
817
|
+
VERIFY_CLIENT_CERT: 0
|
818
|
+
SERVICE_URL: ${SERVICE_URL:-https://wxo-doc-processing-cache:8080}
|
819
|
+
RATE_LIMITING_ENABLED: "false"
|
820
|
+
SHOULD_CACHE_IMAGES: "false"
|
821
|
+
HANDWRITING_ENABLED: "true"
|
822
|
+
WDU_RUNTIME_URL: wdu-runtime:8080
|
823
|
+
WDU_TIMEOUT_SECS: "180"
|
824
|
+
IBM_DPS_CACHE_SERVICE: https://wxo-doc-processing-cache:8080
|
825
|
+
profiles:
|
826
|
+
- docproc
|
827
|
+
# depends_on:
|
828
|
+
# wxo-doc-processing-cache:
|
829
|
+
# condition: service_healthy
|
830
|
+
ports:
|
831
|
+
- "18081:8080"
|
832
|
+
healthcheck:
|
833
|
+
test: ["CMD-SHELL", "curl -fk https://localhost:8080/ping"]
|
834
|
+
interval: 30s
|
835
|
+
timeout: 30s
|
836
|
+
retries: 10
|
837
|
+
|
838
|
+
wdu-runtime:
|
839
|
+
image: ${WDU_REGISTRY:-us.icr.io/watson-orchestrate-private}/document-processing/wdu-runtime:${WDU_TAG:-2.4.0}
|
840
|
+
platform: linux/amd64
|
841
|
+
restart: unless-stopped
|
842
|
+
environment:
|
843
|
+
MEMORY_MINIMAL: "true"
|
844
|
+
PREFLIGHT_MAX_SIZE: 10Mb
|
845
|
+
PREFLIGHT_MAX_PAGES: 600
|
846
|
+
RUNTIME_LIBRARY: "watson_doc_understanding"
|
847
|
+
profiles:
|
848
|
+
- docproc
|
849
|
+
ports:
|
850
|
+
- "18082:8080"
|
851
|
+
- "18086:8086"
|
852
|
+
volumes:
|
853
|
+
- "wdu-models:/models"
|
854
|
+
- "wdu-prometheus-files:/prometheus/"
|
855
|
+
tmpfs:
|
856
|
+
- "/dev/shm"
|
857
|
+
healthcheck:
|
858
|
+
test: ["CMD-SHELL", "/app/check_heartbeat.sh /tmp/heartbeat.txt 120"]
|
859
|
+
interval: 30s
|
860
|
+
timeout: 30s
|
861
|
+
retries: 10
|
862
|
+
depends_on:
|
863
|
+
wdu-model-copy:
|
864
|
+
condition: service_completed_successfully
|
865
|
+
|
866
|
+
wdu-model-copy:
|
867
|
+
image: ${WDU_REGISTRY:-us.icr.io/watson-orchestrate-private}/document-processing/wdu-models:${WDU_TAG:-2.4.0}
|
868
|
+
platform: linux/amd64
|
869
|
+
user: root
|
870
|
+
profiles:
|
871
|
+
- docproc
|
872
|
+
environment:
|
873
|
+
DEST_FOLDER: "/app/models"
|
874
|
+
volumes:
|
875
|
+
- "wdu-models:/app/models"
|
876
|
+
- "wdu-prometheus-files:/prometheus/"
|
877
|
+
tmpfs:
|
878
|
+
- "/dev/shm"
|
879
|
+
|
880
|
+
wxo-doc-processing-infra-standalone:
|
881
|
+
image: ${DOCPROC_REGISTRY:-us.icr.io/watson-orchestrate-private}/document-processing/wo-doc-processing-infra-standalone:${DOCPROC_DPI_TAG:-2025-06-13-dev-1}
|
882
|
+
platform: linux/amd64
|
883
|
+
profiles:
|
884
|
+
- docproc
|
885
|
+
environment:
|
886
|
+
PGHOST: wxo-server-db
|
887
|
+
PGPORT: "5432"
|
888
|
+
PGUSER: ${POSTGRES_USER:-postgres}
|
889
|
+
PGPASSWORD: ${POSTGRES_PASSWORD:-postgres}
|
890
|
+
PGDATABASE: wxo-document-processing-dpi
|
891
|
+
PGURL: "jdbc:postgresql://localhost:5432/wxo-document-processing-dpi?user=${POSTGRES_USER:-postgres}&password=${POSTGRES_PASSWORD:-postgres}"
|
892
|
+
USE_PGBOUNCER: "false"
|
893
|
+
S3_ACCESS_KEY: ${MINIO_ROOT_USER:-minioadmin}
|
894
|
+
S3_SECRET_KEY: ${MINIO_ROOT_PASSWORD:-watsonxorchestrate}
|
895
|
+
S3_ENDPOINT_URL: http://wxo-server-minio:9000
|
896
|
+
BUCKET_NAME_DEFAULT: wxo-document-processing-dpi-common
|
897
|
+
S3_FILERESOURCE_BUCKET: ${BUCKET_NAME_DEFAULT:-wxo-document-processing-dpi}
|
898
|
+
# S3_TLS_ENABLED: "true"
|
899
|
+
ENRICHMENT_BATCH_SIZE: "1000"
|
900
|
+
CIPHER_AES_REALM_KEY: "dGVzdHRlc3R0ZXN0dGVzdA=="
|
901
|
+
SIDECAR_METERED_ENABLED: "false"
|
902
|
+
DPI_DEBUG: true
|
903
|
+
DPI_WO_WDU_SERVER_ENDPOINT: https://wxo-doc-processing-service:8080
|
904
|
+
# DPI_RAG_SERVER_ENDPOINT: https://wxo-doc-processing-llm-service:8083
|
905
|
+
DISABLE_TLS: true
|
906
|
+
STANDALONE_DPI: "true"
|
907
|
+
depends_on:
|
908
|
+
wxo-doc-processing-dpi-minio-init:
|
909
|
+
condition: service_completed_successfully
|
910
|
+
wxo-doc-processing-infra-pg-init:
|
911
|
+
condition: service_completed_successfully
|
912
|
+
wxo-doc-processing-service:
|
913
|
+
condition: service_healthy
|
914
|
+
# wxo-doc-processing-llm-service:
|
915
|
+
# condition: service_healthy
|
916
|
+
ports:
|
917
|
+
- 19080:9080
|
918
|
+
- 19443:9443
|
919
|
+
healthcheck:
|
920
|
+
test: ["CMD-SHELL", "HEALTHCHECK_URL=http://localhost:9080/dps/v1/health /healthcheck-all.sh all"]
|
921
|
+
interval: 30s
|
922
|
+
timeout: 30s
|
923
|
+
retries: 10
|
924
|
+
|
925
|
+
wxo-doc-processing-infra-pg-init:
|
926
|
+
image: ${DOCPROC_REGISTRY:-us.icr.io/watson-orchestrate-private}/document-processing/wo-doc-processing-infra-pg-init:${DOCPROC_DPI_TAG:-2025-06-13-dev-1}
|
927
|
+
platform: linux/amd64
|
928
|
+
environment:
|
929
|
+
PGHOST: wxo-server-db
|
930
|
+
PGPORT: "5432"
|
931
|
+
PGUSER: ${POSTGRES_USER:-postgres}
|
932
|
+
PGPASSWORD: ${POSTGRES_PASSWORD:-postgres}
|
933
|
+
PGDATABASE: wxo-document-processing-dpi
|
934
|
+
PGURL: "jdbc:postgresql://localhost:5432/wxo-document-processing-dpi?user=${POSTGRES_USER:-postgres}&password=${POSTGRES_PASSWORD:-postgres}"
|
935
|
+
USE_PGBOUNCER: "false"
|
936
|
+
entrypoint: /liquibase-init.sh
|
937
|
+
- pgbouncer
|
938
|
+
profiles:
|
939
|
+
- docproc
|
940
|
+
depends_on:
|
941
|
+
wxo-server-db:
|
942
|
+
condition: service_started
|
943
|
+
healthcheck:
|
944
|
+
test: ["CMD-SHELL", "psql -h localhost -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_PASSWORD:-postgres}"]
|
945
|
+
interval: 1s
|
946
|
+
timeout: 5s
|
947
|
+
retries: 50
|
948
|
+
|
949
|
+
wxo-doc-processing-dpi-minio-init:
|
950
|
+
image: ${OPENSOURCE_REGISTRY_PROXY:-docker.io}/minio/mc:latest
|
951
|
+
platform: linux/amd64
|
952
|
+
profiles:
|
953
|
+
- docproc
|
954
|
+
depends_on:
|
955
|
+
wxo-server-minio:
|
956
|
+
condition: service_healthy
|
957
|
+
entrypoint: >
|
958
|
+
/bin/sh -c "
|
959
|
+
/usr/bin/mc alias set wxo-server-minio http://wxo-server-minio:9000 ${MINIO_ROOT_USER:-minioadmin} ${MINIO_ROOT_PASSWORD:-watsonxorchestrate};
|
960
|
+
/usr/bin/mc mb wxo-server-minio/wxo-document-processing-dpi;
|
961
|
+
exit 0;
|
962
|
+
"
|
963
|
+
|
797
964
|
volumes:
|
798
965
|
tools:
|
799
966
|
driver: local
|
@@ -817,6 +984,14 @@ volumes:
|
|
817
984
|
driver: local
|
818
985
|
langfuse_clickhouse_logs:
|
819
986
|
driver: local
|
987
|
+
wdu-prometheus-files:
|
988
|
+
driver: local
|
989
|
+
driver_opts:
|
990
|
+
type: tmpfs
|
991
|
+
device: tmpfs
|
992
|
+
o: "uid=1000,gid=1000,mode=1777"
|
993
|
+
wdu-models:
|
994
|
+
driver: local
|
820
995
|
es_data:
|
821
996
|
|
822
997
|
networks:
|
@@ -62,7 +62,7 @@ WORKER_REGISTRY=
|
|
62
62
|
AI_GATEWAY_TAG=01-07-2025
|
63
63
|
AI_GATEWAY_REGISTRY=
|
64
64
|
|
65
|
-
AGENT_GATEWAY_TAG=
|
65
|
+
AGENT_GATEWAY_TAG=07-07-2025
|
66
66
|
AGENT_GATEWAY_REGISTRY=
|
67
67
|
|
68
68
|
DB_REGISTRY=
|
@@ -87,7 +87,7 @@ TR_REGISTRY=
|
|
87
87
|
BUILDER_TAG=02-07-2025
|
88
88
|
BUILDER_REGISTRY=
|
89
89
|
|
90
|
-
FLOW_RUNTIME_TAG=
|
90
|
+
FLOW_RUNTIME_TAG=04-07-2025
|
91
91
|
FLOW_RUMTIME_REGISTRY=
|
92
92
|
|
93
93
|
|
@@ -100,6 +100,15 @@ JAEGER_PROXY_REGISTRY=
|
|
100
100
|
SOCKET_HANDLER_TAG=29-05-2025
|
101
101
|
SOCKET_HANDLER_REGISTRY=
|
102
102
|
|
103
|
+
# IBM Document Processing
|
104
|
+
WDU_TAG=2.5.0
|
105
|
+
WDU_REGISTRY=
|
106
|
+
|
107
|
+
DOCPROC_DPS_TAG=20250610-183301-248-865fbc1
|
108
|
+
DOCPROC_LLMSERVICE_TAG=20250604-192056-107-e1d4d66
|
109
|
+
DOCPROC_CACHE_TAG=20250610-214940-68-f3258f4
|
110
|
+
DOCPROC_DPI_TAG=20250702-000808-237-7b1e424d
|
111
|
+
DOCPROC_REGISTRY=
|
103
112
|
|
104
113
|
# END -- IMAGE REGISTRIES AND TAGS
|
105
114
|
|
@@ -152,6 +161,13 @@ DB_CONN_LIFE=
|
|
152
161
|
DB_MAX_IDLE_CONN=
|
153
162
|
DB_MAX_CONN=
|
154
163
|
SERVER_HOST=
|
164
|
+
WO_API_KEY=
|
165
|
+
WO_PASSWORD=
|
166
|
+
WO_USERNAME=
|
167
|
+
WO_INSTANCE=
|
168
|
+
AUTHORIZATION_URL=
|
169
|
+
WO_AUTH_TYPE=
|
170
|
+
PYTHONPATH=
|
155
171
|
|
156
172
|
# Use your machine's local IP address for external async tool communication.
|
157
173
|
CALLBACK_HOST_URL=
|
@@ -160,3 +176,7 @@ AGENTOPS_API_KEY_AUTH_ENABLED=true
|
|
160
176
|
AGENTOPS_API_KEY=qwertyuiop
|
161
177
|
|
162
178
|
RUNTIME_MANAGER_API_KEY=example
|
179
|
+
|
180
|
+
|
181
|
+
# IBM Document Processing
|
182
|
+
SERVICE_URL=https://wxo-doc-processing-cache:8080
|
@@ -1,5 +1,5 @@
|
|
1
1
|
from .constants import START, END, RESERVED
|
2
|
-
from ..types import FlowContext, TaskData, TaskEventType
|
2
|
+
from ..types import FlowContext, TaskData, TaskEventType, DocumentContent
|
3
3
|
from ..node import UserNode, AgentNode, StartNode, EndNode, PromptNode, ToolNode
|
4
4
|
from .flow import Flow, CompiledFlow, FlowRun, FlowEvent, FlowEventType, FlowFactory, MatchPolicy, WaitPolicy, ForeachPolicy, Branch, Foreach, Loop
|
5
5
|
from .decorators import flow
|
@@ -14,7 +14,9 @@ __all__ = [
|
|
14
14
|
"FlowContext",
|
15
15
|
"TaskData",
|
16
16
|
"TaskEventType",
|
17
|
+
"DocumentContent",
|
17
18
|
|
19
|
+
"DocProcNode",
|
18
20
|
"UserNode",
|
19
21
|
"AgentNode",
|
20
22
|
"StartNode",
|
@@ -33,7 +33,8 @@ def flow(*args,
|
|
33
33
|
description: str|None=None,
|
34
34
|
input_schema: type[BaseModel] | None = None,
|
35
35
|
output_schema: type[BaseModel] | None = None,
|
36
|
-
initiators: Sequence[str] = ()
|
36
|
+
initiators: Sequence[str] = (),
|
37
|
+
schedulable: bool = False):
|
37
38
|
"""Decorator to mark a function as a flow model builder."""
|
38
39
|
|
39
40
|
def decorator(func: Callable):
|
@@ -58,7 +59,8 @@ def flow(*args,
|
|
58
59
|
description = node_spec.description,
|
59
60
|
input_schema = input_schema,
|
60
61
|
output_schema = output_schema,
|
61
|
-
initiators = initiators
|
62
|
+
initiators = initiators,
|
63
|
+
schedulable = schedulable)
|
62
64
|
|
63
65
|
# logger.info("Creating flow model: %s", a_model.spec.name)
|
64
66
|
|
@@ -5,9 +5,11 @@ from dotenv import load_dotenv
|
|
5
5
|
import os
|
6
6
|
|
7
7
|
from typing import (
|
8
|
-
AsyncIterator, Union
|
8
|
+
AsyncIterator, TypeVar, Union
|
9
9
|
)
|
10
10
|
|
11
|
+
from enum import Enum
|
12
|
+
|
11
13
|
from ..types import (
|
12
14
|
FlowEventType, TaskEventType, FlowEvent, FlowContext
|
13
15
|
)
|
@@ -66,12 +68,11 @@ def deserialize_flow_event(byte_data: bytes) -> FlowEvent:
|
|
66
68
|
|
67
69
|
return flow_event
|
68
70
|
|
71
|
+
def is_valid_enum_value(value: str, enum_type: type[Enum]) -> bool:
|
72
|
+
return value in (item.value for item in enum_type)
|
73
|
+
|
69
74
|
def get_event_type(selected_event_type: str) -> Union[FlowEventType, TaskEventType]:
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
elif eventKind in TaskEventType.__members__:
|
75
|
-
return TaskEventType(selected_event_type)
|
76
|
-
else:
|
77
|
-
raise ValueError(f"Invalid event type: {eventKind}")
|
75
|
+
for enum_type in [FlowEventType, TaskEventType]:
|
76
|
+
if is_valid_enum_value(selected_event_type, enum_type):
|
77
|
+
return enum_type(selected_event_type)
|
78
|
+
raise ValueError(f"Invalid event type: {selected_event_type}")
|