ibm-watsonx-orchestrate 1.6.0b0__py3-none-any.whl → 1.7.0a0__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 +1 -1
- ibm_watsonx_orchestrate/agent_builder/agents/agent.py +1 -0
- ibm_watsonx_orchestrate/agent_builder/agents/types.py +5 -1
- ibm_watsonx_orchestrate/agent_builder/agents/webchat_customizations/__init__.py +2 -0
- ibm_watsonx_orchestrate/agent_builder/agents/webchat_customizations/prompts.py +33 -0
- ibm_watsonx_orchestrate/agent_builder/agents/webchat_customizations/welcome_content.py +20 -0
- ibm_watsonx_orchestrate/agent_builder/connections/__init__.py +2 -2
- ibm_watsonx_orchestrate/agent_builder/connections/types.py +38 -31
- ibm_watsonx_orchestrate/agent_builder/tools/flow_tool.py +83 -0
- ibm_watsonx_orchestrate/agent_builder/tools/types.py +7 -1
- ibm_watsonx_orchestrate/cli/commands/agents/agents_controller.py +25 -14
- ibm_watsonx_orchestrate/cli/commands/channels/webchat/channels_webchat_controller.py +104 -21
- ibm_watsonx_orchestrate/cli/commands/connections/connections_command.py +26 -18
- ibm_watsonx_orchestrate/cli/commands/connections/connections_controller.py +55 -57
- ibm_watsonx_orchestrate/cli/commands/knowledge_bases/knowledge_bases_controller.py +2 -2
- ibm_watsonx_orchestrate/cli/commands/server/server_command.py +137 -10
- ibm_watsonx_orchestrate/cli/commands/toolkit/toolkit_controller.py +9 -3
- ibm_watsonx_orchestrate/cli/commands/tools/tools_controller.py +25 -12
- ibm_watsonx_orchestrate/client/agents/agent_client.py +74 -6
- ibm_watsonx_orchestrate/client/base_api_client.py +2 -1
- ibm_watsonx_orchestrate/client/connections/connections_client.py +18 -9
- ibm_watsonx_orchestrate/client/connections/utils.py +4 -2
- ibm_watsonx_orchestrate/client/local_service_instance.py +1 -1
- ibm_watsonx_orchestrate/client/service_instance.py +3 -3
- ibm_watsonx_orchestrate/client/tools/tempus_client.py +8 -3
- ibm_watsonx_orchestrate/client/utils.py +10 -0
- ibm_watsonx_orchestrate/docker/compose-lite.yml +400 -66
- ibm_watsonx_orchestrate/docker/default.env +44 -12
- ibm_watsonx_orchestrate/docker/proxy-config-single.yaml +12 -0
- ibm_watsonx_orchestrate/flow_builder/flows/flow.py +15 -5
- ibm_watsonx_orchestrate/flow_builder/utils.py +78 -48
- ibm_watsonx_orchestrate/run/connections.py +4 -4
- {ibm_watsonx_orchestrate-1.6.0b0.dist-info → ibm_watsonx_orchestrate-1.7.0a0.dist-info}/METADATA +1 -1
- {ibm_watsonx_orchestrate-1.6.0b0.dist-info → ibm_watsonx_orchestrate-1.7.0a0.dist-info}/RECORD +37 -32
- {ibm_watsonx_orchestrate-1.6.0b0.dist-info → ibm_watsonx_orchestrate-1.7.0a0.dist-info}/WHEEL +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0.dist-info → ibm_watsonx_orchestrate-1.7.0a0.dist-info}/entry_points.txt +0 -0
- {ibm_watsonx_orchestrate-1.6.0b0.dist-info → ibm_watsonx_orchestrate-1.7.0a0.dist-info}/licenses/LICENSE +0 -0
@@ -14,6 +14,7 @@ class Agent(AgentSpec):
|
|
14
14
|
content = json.load(f)
|
15
15
|
else:
|
16
16
|
raise ValueError('file must end in .json, .yaml, or .yml')
|
17
|
+
|
17
18
|
if not content.get("spec_version"):
|
18
19
|
raise ValueError(f"Field 'spec_version' not provided. Please ensure provided spec conforms to a valid spec format")
|
19
20
|
agent = Agent.model_validate(content)
|
@@ -6,6 +6,7 @@ from pydantic import BaseModel, model_validator, ConfigDict
|
|
6
6
|
from ibm_watsonx_orchestrate.agent_builder.tools import BaseTool, PythonTool
|
7
7
|
from ibm_watsonx_orchestrate.agent_builder.knowledge_bases.types import KnowledgeBaseSpec, KnowledgeBaseBuiltInVectorIndexConfig, HAPFiltering, HAPFilteringConfig, CitationsConfig, ConfidenceThresholds, QueryRewriteConfig, GenerationConfiguration
|
8
8
|
from ibm_watsonx_orchestrate.agent_builder.knowledge_bases.knowledge_base import KnowledgeBase
|
9
|
+
from ibm_watsonx_orchestrate.agent_builder.agents.webchat_customizations import StarterPrompts, WelcomeContent
|
9
10
|
from pydantic import Field, AliasChoices
|
10
11
|
from typing import Annotated
|
11
12
|
|
@@ -32,7 +33,8 @@ class AgentProvider(str, Enum):
|
|
32
33
|
WXAI = "wx.ai"
|
33
34
|
EXT_CHAT = "external_chat"
|
34
35
|
SALESFORCE = "salesforce"
|
35
|
-
WATSONX = "watsonx"
|
36
|
+
WATSONX = "watsonx"
|
37
|
+
A2A = 'external_chat/A2A/0.2.1' #provider type returned from an assistant agent
|
36
38
|
|
37
39
|
|
38
40
|
class AssistantAgentAuthType(str, Enum):
|
@@ -114,6 +116,8 @@ class AgentSpec(BaseAgentSpec):
|
|
114
116
|
hidden: bool = False
|
115
117
|
knowledge_base: Optional[List[str]] | Optional[List['KnowledgeBaseSpec']] = []
|
116
118
|
chat_with_docs: Optional[ChatWithDocsConfig] = None
|
119
|
+
starter_prompts: Optional[StarterPrompts] = None
|
120
|
+
welcome_content: Optional[WelcomeContent] = None
|
117
121
|
|
118
122
|
|
119
123
|
def __init__(self, *args, **kwargs):
|
@@ -0,0 +1,33 @@
|
|
1
|
+
from enum import Enum
|
2
|
+
from typing import Optional, Dict, List, Annotated
|
3
|
+
from annotated_types import Len
|
4
|
+
from pydantic import BaseModel, model_validator
|
5
|
+
|
6
|
+
|
7
|
+
class PromptState(str,Enum):
|
8
|
+
ACTIVE = "active"
|
9
|
+
INACTIVE = "inactive"
|
10
|
+
|
11
|
+
|
12
|
+
class AgentPrompt(BaseModel):
|
13
|
+
id: str
|
14
|
+
title: str
|
15
|
+
subtitle: Optional[str] = None
|
16
|
+
prompt: str
|
17
|
+
state: PromptState = PromptState.ACTIVE
|
18
|
+
|
19
|
+
@model_validator(mode='before')
|
20
|
+
def validate_fields(cls,values):
|
21
|
+
return validate_agent_prompt_fields(values)
|
22
|
+
|
23
|
+
|
24
|
+
def validate_agent_prompt_fields(values: Dict):
|
25
|
+
for field in ['id','title','prompt','state']:
|
26
|
+
value = values.get(field)
|
27
|
+
if value and not str(value).strip():
|
28
|
+
raise ValueError(f"{field} cannot be empty or just whitespace")
|
29
|
+
return values
|
30
|
+
|
31
|
+
class StarterPrompts(BaseModel):
|
32
|
+
is_default_prompts: bool = False
|
33
|
+
prompts: Annotated[List[AgentPrompt], Len(min_length=1)]
|
@@ -0,0 +1,20 @@
|
|
1
|
+
|
2
|
+
from typing import Optional,Dict
|
3
|
+
from pydantic import BaseModel, model_validator
|
4
|
+
|
5
|
+
class WelcomeContent(BaseModel):
|
6
|
+
welcome_message: str
|
7
|
+
description: Optional[str] = None
|
8
|
+
is_default_message: bool = False
|
9
|
+
|
10
|
+
@model_validator(mode='before')
|
11
|
+
def validate_fields(cls,values):
|
12
|
+
return validate_welcome_content_fields(values)
|
13
|
+
|
14
|
+
|
15
|
+
def validate_welcome_content_fields(values: Dict):
|
16
|
+
for field in ['welcome_message']:
|
17
|
+
value = values.get(field)
|
18
|
+
if value and not str(value).strip():
|
19
|
+
raise ValueError(f"{field} cannot be empty or just whitespace")
|
20
|
+
return values
|
@@ -15,8 +15,8 @@ from .types import (
|
|
15
15
|
BearerTokenAuthCredentials,
|
16
16
|
APIKeyAuthCredentials,
|
17
17
|
OAuth2TokenCredentials,
|
18
|
-
|
19
|
-
|
18
|
+
OAuth2AuthCodeCredentials,
|
19
|
+
OAuth2ClientCredentials,
|
20
20
|
# OAuth2ImplicitCredentials,
|
21
21
|
# OAuth2PasswordCredentials,
|
22
22
|
OAuthOnBehalfOfCredentials,
|
@@ -6,10 +6,10 @@ class ConnectionKind(str, Enum):
|
|
6
6
|
basic = 'basic'
|
7
7
|
bearer = 'bearer'
|
8
8
|
api_key = 'api_key'
|
9
|
-
|
9
|
+
oauth_auth_code_flow = 'oauth_auth_code_flow'
|
10
10
|
# oauth_auth_implicit_flow = 'oauth_auth_implicit_flow'
|
11
11
|
# oauth_auth_password_flow = 'oauth_auth_password_flow'
|
12
|
-
|
12
|
+
oauth_auth_client_credentials_flow = 'oauth_auth_client_credentials_flow'
|
13
13
|
oauth_auth_on_behalf_of_flow = 'oauth_auth_on_behalf_of_flow'
|
14
14
|
key_value = 'key_value'
|
15
15
|
kv = 'kv'
|
@@ -32,10 +32,10 @@ class ConnectionPreference(str, Enum):
|
|
32
32
|
return self.value
|
33
33
|
|
34
34
|
class ConnectionAuthType(str, Enum):
|
35
|
-
|
35
|
+
OAUTH2_AUTH_CODE = 'oauth2_auth_code'
|
36
36
|
# OAUTH2_IMPLICIT = 'oauth2_implicit'
|
37
37
|
# OAUTH2_PASSWORD = 'oauth2_password'
|
38
|
-
|
38
|
+
OAUTH2_CLIENT_CREDS = 'oauth2_client_creds'
|
39
39
|
OAUTH_ON_BEHALF_OF_FLOW = 'oauth_on_behalf_of_flow'
|
40
40
|
|
41
41
|
def __str__(self):
|
@@ -63,10 +63,10 @@ class ConnectionType(str, Enum):
|
|
63
63
|
BASIC_AUTH = ConnectionSecurityScheme.BASIC_AUTH.value
|
64
64
|
BEARER_TOKEN = ConnectionSecurityScheme.BEARER_TOKEN.value
|
65
65
|
API_KEY_AUTH = ConnectionSecurityScheme.API_KEY_AUTH.value
|
66
|
-
|
66
|
+
OAUTH2_AUTH_CODE = ConnectionAuthType.OAUTH2_AUTH_CODE.value
|
67
67
|
# OAUTH2_IMPLICIT = ConnectionAuthType.OAUTH2_IMPLICIT.value
|
68
68
|
# OAUTH2_PASSWORD = ConnectionAuthType.OAUTH2_PASSWORD.value
|
69
|
-
|
69
|
+
OAUTH2_CLIENT_CREDS = ConnectionAuthType.OAUTH2_CLIENT_CREDS.value
|
70
70
|
OAUTH_ON_BEHALF_OF_FLOW = ConnectionAuthType.OAUTH_ON_BEHALF_OF_FLOW.value
|
71
71
|
KEY_VALUE = ConnectionSecurityScheme.KEY_VALUE.value
|
72
72
|
|
@@ -77,8 +77,8 @@ class ConnectionType(str, Enum):
|
|
77
77
|
return repr(self.value)
|
78
78
|
|
79
79
|
OAUTH_CONNECTION_TYPES = {
|
80
|
-
|
81
|
-
|
80
|
+
ConnectionType.OAUTH2_AUTH_CODE,
|
81
|
+
ConnectionType.OAUTH2_CLIENT_CREDS,
|
82
82
|
# ConnectionType.OAUTH2_IMPLICIT,
|
83
83
|
# ConnectionType.OAUTH2_PASSWORD,
|
84
84
|
ConnectionType.OAUTH_ON_BEHALF_OF_FLOW,
|
@@ -137,10 +137,15 @@ class ConnectionConfiguration(BaseModel):
|
|
137
137
|
|
138
138
|
@model_validator(mode="after")
|
139
139
|
def validate_config(self):
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
140
|
+
conn_type = None
|
141
|
+
if self.security_scheme == ConnectionSecurityScheme.OAUTH2:
|
142
|
+
conn_type = self.auth_type
|
143
|
+
else:
|
144
|
+
conn_type = self.security_scheme
|
145
|
+
if self.sso and conn_type != ConnectionAuthType.OAUTH_ON_BEHALF_OF_FLOW:
|
146
|
+
raise ValueError(f"SSO not supported for auth scheme '{conn_type}'. SSO can only be used with OAuth auth types")
|
147
|
+
if not self.sso and conn_type == ConnectionAuthType.OAUTH_ON_BEHALF_OF_FLOW:
|
148
|
+
raise ValueError(f"SSO required for '{conn_type}'. Please enable SSO.")
|
144
149
|
if self.sso:
|
145
150
|
if not self.idp_config_data:
|
146
151
|
raise ValueError("For SSO auth 'idp_config_data' is a required field")
|
@@ -167,11 +172,12 @@ class OAuth2TokenCredentials(BaseModel):
|
|
167
172
|
access_token: str
|
168
173
|
url: Optional[str] = None
|
169
174
|
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
+
class OAuth2AuthCodeCredentials(BaseModel):
|
176
|
+
client_id: str
|
177
|
+
client_secret: str
|
178
|
+
token_url: str
|
179
|
+
authorization_url: str
|
180
|
+
scopes : Optional[List[str]] = None
|
175
181
|
|
176
182
|
# class OAuth2ImplicitCredentials(BaseModel):
|
177
183
|
# client_id: str
|
@@ -183,10 +189,11 @@ class OAuth2TokenCredentials(BaseModel):
|
|
183
189
|
# token_url: str
|
184
190
|
# authorization_url: str
|
185
191
|
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
192
|
+
class OAuth2ClientCredentials(BaseModel):
|
193
|
+
client_id: str
|
194
|
+
client_secret: str
|
195
|
+
token_url: str
|
196
|
+
scopes : Optional[List[str]] = None
|
190
197
|
|
191
198
|
class OAuthOnBehalfOfCredentials(BaseModel):
|
192
199
|
client_id: str
|
@@ -205,10 +212,10 @@ CREDENTIALS_SET = Union[
|
|
205
212
|
BasicAuthCredentials,
|
206
213
|
BearerTokenAuthCredentials,
|
207
214
|
APIKeyAuthCredentials,
|
208
|
-
|
215
|
+
OAuth2AuthCodeCredentials,
|
209
216
|
# OAuth2ImplicitCredentials,
|
210
217
|
# OAuth2PasswordCredentials,
|
211
|
-
|
218
|
+
OAuth2ClientCredentials,
|
212
219
|
OAuthOnBehalfOfCredentials,
|
213
220
|
KeyValueConnectionCredentials
|
214
221
|
]
|
@@ -219,20 +226,20 @@ CONNECTION_KIND_SCHEME_MAPPING = {
|
|
219
226
|
ConnectionKind.basic: ConnectionSecurityScheme.BASIC_AUTH,
|
220
227
|
ConnectionKind.bearer: ConnectionSecurityScheme.BEARER_TOKEN,
|
221
228
|
ConnectionKind.api_key: ConnectionSecurityScheme.API_KEY_AUTH,
|
222
|
-
|
229
|
+
ConnectionKind.oauth_auth_code_flow: ConnectionSecurityScheme.OAUTH2,
|
223
230
|
# ConnectionKind.oauth_auth_implicit_flow: ConnectionSecurityScheme.OAUTH2,
|
224
231
|
# ConnectionKind.oauth_auth_password_flow: ConnectionSecurityScheme.OAUTH2,
|
225
|
-
|
232
|
+
ConnectionKind.oauth_auth_client_credentials_flow: ConnectionSecurityScheme.OAUTH2,
|
226
233
|
ConnectionKind.oauth_auth_on_behalf_of_flow: ConnectionSecurityScheme.OAUTH2,
|
227
234
|
ConnectionKind.key_value: ConnectionSecurityScheme.KEY_VALUE,
|
228
235
|
ConnectionKind.kv: ConnectionSecurityScheme.KEY_VALUE,
|
229
236
|
}
|
230
237
|
|
231
238
|
CONNECTION_KIND_OAUTH_TYPE_MAPPING = {
|
232
|
-
|
239
|
+
ConnectionKind.oauth_auth_code_flow: ConnectionAuthType.OAUTH2_AUTH_CODE,
|
233
240
|
# ConnectionKind.oauth_auth_implicit_flow: ConnectionAuthType.OAUTH2_IMPLICIT,
|
234
241
|
# ConnectionKind.oauth_auth_password_flow: ConnectionAuthType.OAUTH2_PASSWORD,
|
235
|
-
|
242
|
+
ConnectionKind.oauth_auth_client_credentials_flow: ConnectionAuthType.OAUTH2_CLIENT_CREDS,
|
236
243
|
ConnectionKind.oauth_auth_on_behalf_of_flow: ConnectionAuthType.OAUTH_ON_BEHALF_OF_FLOW,
|
237
244
|
}
|
238
245
|
|
@@ -240,10 +247,10 @@ CONNECTION_TYPE_CREDENTIAL_MAPPING = {
|
|
240
247
|
ConnectionType.BASIC_AUTH: BasicAuthCredentials,
|
241
248
|
ConnectionType.BEARER_TOKEN: BearerTokenAuthCredentials,
|
242
249
|
ConnectionType.API_KEY_AUTH: APIKeyAuthCredentials,
|
243
|
-
|
244
|
-
# ConnectionType.OAUTH2_IMPLICIT:
|
245
|
-
# ConnectionType.OAUTH2_PASSWORD:
|
246
|
-
|
250
|
+
ConnectionType.OAUTH2_AUTH_CODE: OAuth2TokenCredentials,
|
251
|
+
# ConnectionType.OAUTH2_IMPLICIT: OAuth2TokenCredentials,
|
252
|
+
# ConnectionType.OAUTH2_PASSWORD: OAuth2TokenCredentials,
|
253
|
+
ConnectionType.OAUTH2_CLIENT_CREDS: OAuth2TokenCredentials,
|
247
254
|
ConnectionType.OAUTH_ON_BEHALF_OF_FLOW: OAuth2TokenCredentials,
|
248
255
|
ConnectionType.KEY_VALUE: KeyValueConnectionCredentials,
|
249
256
|
}
|
@@ -0,0 +1,83 @@
|
|
1
|
+
|
2
|
+
import json
|
3
|
+
import logging
|
4
|
+
|
5
|
+
from ibm_watsonx_orchestrate.utils.utils import yaml_safe_load
|
6
|
+
from .types import FlowToolBinding, ToolBinding, ToolSpec
|
7
|
+
from .base_tool import BaseTool
|
8
|
+
from .types import ToolPermission
|
9
|
+
|
10
|
+
import json
|
11
|
+
|
12
|
+
logger = logging.getLogger(__name__)
|
13
|
+
|
14
|
+
|
15
|
+
class FlowTool(BaseTool):
|
16
|
+
def __init__(self, spec: ToolSpec):
|
17
|
+
BaseTool.__init__(self, spec=spec)
|
18
|
+
|
19
|
+
async def __call__(self, **kwargs):
|
20
|
+
raise RuntimeError('Flow Tools are only available when deployed onto watson orchestrate or the watson '
|
21
|
+
'orchestrate-light runtime')
|
22
|
+
|
23
|
+
@staticmethod
|
24
|
+
def from_spec(file: str) -> 'FlowTool':
|
25
|
+
with open(file, 'r') as f:
|
26
|
+
if file.endswith('.yaml') or file.endswith('.yml'):
|
27
|
+
spec = ToolSpec.model_validate(yaml_safe_load(f))
|
28
|
+
elif file.endswith('.json'):
|
29
|
+
spec = ToolSpec.model_validate(json.load(f))
|
30
|
+
else:
|
31
|
+
raise ValueError('file must end in .json, .yaml, or .yml')
|
32
|
+
|
33
|
+
if spec.binding.openapi is None or spec.binding.openapi is None:
|
34
|
+
raise ValueError('failed to load python tool as the tool had no openapi binding')
|
35
|
+
|
36
|
+
return FlowTool(spec=spec)
|
37
|
+
|
38
|
+
def __repr__(self):
|
39
|
+
return f"FlowTool(model={self.__tool_spec__.binding.flow.model}, name='{self.__tool_spec__.name}', description='{self.__tool_spec__.description}')"
|
40
|
+
|
41
|
+
def __str__(self):
|
42
|
+
return self.__repr__()
|
43
|
+
|
44
|
+
@property
|
45
|
+
def __doc__(self):
|
46
|
+
return self.__tool_spec__.description
|
47
|
+
|
48
|
+
|
49
|
+
def create_flow_json_tool(
|
50
|
+
flow_model: dict,
|
51
|
+
name: str = None,
|
52
|
+
description: str = None,
|
53
|
+
permission: ToolPermission = None,
|
54
|
+
) -> FlowTool:
|
55
|
+
"""
|
56
|
+
Creates a flow tool from a Flow JSON model
|
57
|
+
|
58
|
+
Here we create the basic tool spec. The remaining properties of the tool spec
|
59
|
+
are set by the server when the tool is registered. The server will publish the model to the
|
60
|
+
flow engine and generate the rest of the tool spec based on it's openAPI specification.
|
61
|
+
"""
|
62
|
+
|
63
|
+
spec_name = name
|
64
|
+
spec_permission = permission
|
65
|
+
if spec_name is None:
|
66
|
+
raise ValueError(
|
67
|
+
f"No name provided for tool.")
|
68
|
+
|
69
|
+
spec_description = description
|
70
|
+
if spec_description is None:
|
71
|
+
raise ValueError(
|
72
|
+
f"No description provided for tool.")
|
73
|
+
|
74
|
+
spec = ToolSpec(
|
75
|
+
name=spec_name,
|
76
|
+
description=spec_description,
|
77
|
+
permission=spec_permission
|
78
|
+
)
|
79
|
+
|
80
|
+
spec.binding = ToolBinding(flow=FlowToolBinding(flow_id=name, model=flow_model))
|
81
|
+
|
82
|
+
return FlowTool(spec=spec)
|
83
|
+
|
@@ -148,6 +148,10 @@ class McpToolBinding(BaseModel):
|
|
148
148
|
source: str
|
149
149
|
connections: Dict[str, str] | None
|
150
150
|
|
151
|
+
class FlowToolBinding(BaseModel):
|
152
|
+
flow_id: str
|
153
|
+
model: Optional[dict] = None
|
154
|
+
|
151
155
|
class ToolBinding(BaseModel):
|
152
156
|
openapi: OpenApiToolBinding = None
|
153
157
|
python: PythonToolBinding = None
|
@@ -155,6 +159,7 @@ class ToolBinding(BaseModel):
|
|
155
159
|
skill: SkillToolBinding = None
|
156
160
|
client_side: ClientSideToolBinding = None
|
157
161
|
mcp: McpToolBinding = None
|
162
|
+
flow: FlowToolBinding = None
|
158
163
|
|
159
164
|
@model_validator(mode='after')
|
160
165
|
def validate_binding_type(self) -> 'ToolBinding':
|
@@ -164,7 +169,8 @@ class ToolBinding(BaseModel):
|
|
164
169
|
self.wxflows is not None,
|
165
170
|
self.skill is not None,
|
166
171
|
self.client_side is not None,
|
167
|
-
self.mcp is not None
|
172
|
+
self.mcp is not None,
|
173
|
+
self.flow is not None
|
168
174
|
]
|
169
175
|
if sum(bindings) == 0:
|
170
176
|
raise ValueError("One binding must be set")
|
@@ -122,6 +122,18 @@ def parse_create_native_args(name: str, kind: AgentKind, description: str | None
|
|
122
122
|
context_variables = [x.strip() for x in context_variables if x.strip() != ""]
|
123
123
|
agent_details["context_variables"] = context_variables
|
124
124
|
|
125
|
+
# hidden = args.get("hidden")
|
126
|
+
# if hidden:
|
127
|
+
# agent_details["hidden"] = hidden
|
128
|
+
|
129
|
+
# starter_prompts = args.get("starter_prompts")
|
130
|
+
# if starter_prompts:
|
131
|
+
# agent_details["starter_prompts"] = starter_prompts
|
132
|
+
|
133
|
+
# welcome_content = args.get("welcome_content")
|
134
|
+
# if welcome_content:
|
135
|
+
# agent_details["welcome_content"] = welcome_content
|
136
|
+
|
125
137
|
return agent_details
|
126
138
|
|
127
139
|
def parse_create_external_args(name: str, kind: AgentKind, description: str | None, **args) -> dict:
|
@@ -553,7 +565,7 @@ class AgentsController:
|
|
553
565
|
|
554
566
|
return agent
|
555
567
|
|
556
|
-
def dereference_external_or_assistant_agent_dependencies(self, agent: ExternalAgent | AssistantAgent) -> ExternalAgent | AssistantAgent:
|
568
|
+
def dereference_external_or_assistant_agent_dependencies(self, agent: ExternalAgent | AssistantAgent) -> ExternalAgent | AssistantAgent:
|
557
569
|
agent_dict = agent.model_dump()
|
558
570
|
|
559
571
|
if agent_dict.get("app_id") or agent.config.model_dump().get("app_id"):
|
@@ -561,7 +573,7 @@ class AgentsController:
|
|
561
573
|
|
562
574
|
return agent
|
563
575
|
|
564
|
-
def reference_external_or_assistant_agent_dependencies(self, agent: ExternalAgent | AssistantAgent) -> ExternalAgent | AssistantAgent:
|
576
|
+
def reference_external_or_assistant_agent_dependencies(self, agent: ExternalAgent | AssistantAgent) -> ExternalAgent | AssistantAgent:
|
565
577
|
agent_dict = agent.model_dump()
|
566
578
|
|
567
579
|
if agent_dict.get("connection_id") or agent.config.model_dump().get("connection_id"):
|
@@ -754,14 +766,14 @@ class AgentsController:
|
|
754
766
|
show_lines=True
|
755
767
|
)
|
756
768
|
column_args = {
|
757
|
-
"Name": {},
|
769
|
+
"Name": {"overflow": "fold"},
|
758
770
|
"Description": {},
|
759
771
|
"LLM": {"overflow": "fold"},
|
760
772
|
"Style": {},
|
761
773
|
"Collaborators": {},
|
762
774
|
"Tools": {},
|
763
775
|
"Knowledge Base": {},
|
764
|
-
"ID": {},
|
776
|
+
"ID": {"overflow": "fold"},
|
765
777
|
}
|
766
778
|
for column in column_args:
|
767
779
|
native_table.add_column(column, **column_args[column])
|
@@ -811,7 +823,7 @@ class AgentsController:
|
|
811
823
|
show_lines=True
|
812
824
|
)
|
813
825
|
column_args = {
|
814
|
-
"Name": {},
|
826
|
+
"Name": {"overflow": "fold"},
|
815
827
|
"Title": {},
|
816
828
|
"Description": {},
|
817
829
|
"Tags": {},
|
@@ -819,9 +831,9 @@ class AgentsController:
|
|
819
831
|
"Chat Params": {},
|
820
832
|
"Config": {},
|
821
833
|
"Nickname": {},
|
822
|
-
"App ID": {},
|
823
|
-
"ID": {}
|
824
|
-
|
834
|
+
"App ID": {"overflow": "fold"},
|
835
|
+
"ID": {"overflow": "fold"}
|
836
|
+
}
|
825
837
|
|
826
838
|
for column in column_args:
|
827
839
|
external_table.add_column(column, **column_args[column])
|
@@ -872,17 +884,17 @@ class AgentsController:
|
|
872
884
|
title="Assistant Agents",
|
873
885
|
show_lines=True)
|
874
886
|
column_args = {
|
875
|
-
"Name": {},
|
887
|
+
"Name": {"overflow": "fold"},
|
876
888
|
"Title": {},
|
877
889
|
"Description": {},
|
878
890
|
"Tags": {},
|
879
891
|
"Nickname": {},
|
880
892
|
"CRN": {},
|
881
893
|
"Instance URL": {},
|
882
|
-
"Assistant ID": {},
|
883
|
-
"Environment ID": {},
|
884
|
-
"ID": {}
|
885
|
-
|
894
|
+
"Assistant ID": {"overflow": "fold"},
|
895
|
+
"Environment ID": {"overflow": "fold"},
|
896
|
+
"ID": {"overflow": "fold"}
|
897
|
+
}
|
886
898
|
|
887
899
|
for column in column_args:
|
888
900
|
assistants_table.add_column(column, **column_args[column])
|
@@ -969,7 +981,6 @@ class AgentsController:
|
|
969
981
|
|
970
982
|
|
971
983
|
def export_agent(self, name: str, kind: AgentKind, output_path: str, agent_only_flag: bool=False, zip_file_out: zipfile.ZipFile | None = None) -> None:
|
972
|
-
|
973
984
|
output_file = Path(output_path)
|
974
985
|
output_file_extension = output_file.suffix
|
975
986
|
output_file_name = output_file.stem
|