sapiopycommons 2025.10.2a773__py3-none-any.whl → 2025.10.9a776__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.
Potentially problematic release.
This version of sapiopycommons might be problematic. Click here for more details.
- sapiopycommons/ai/{tool_service_base.py → agent_service_base.py} +127 -127
- sapiopycommons/ai/protoapi/externalcredentials/external_credentials_pb2.py +41 -0
- sapiopycommons/ai/protoapi/externalcredentials/external_credentials_pb2.pyi +35 -0
- sapiopycommons/ai/protoapi/externalcredentials/external_credentials_pb2_grpc.py +24 -0
- sapiopycommons/ai/protoapi/plan/script/script_pb2.py +17 -15
- sapiopycommons/ai/protoapi/plan/script/script_pb2.pyi +10 -4
- sapiopycommons/ai/protoapi/plan/tool/tool_pb2.py +29 -27
- sapiopycommons/ai/protoapi/plan/tool/tool_pb2.pyi +14 -6
- sapiopycommons/ai/request_validation.py +40 -21
- sapiopycommons/ai/server.py +11 -11
- sapiopycommons/ai/test_client.py +26 -23
- sapiopycommons/files/temp_files.py +1 -1
- {sapiopycommons-2025.10.2a773.dist-info → sapiopycommons-2025.10.9a776.dist-info}/METADATA +1 -1
- {sapiopycommons-2025.10.2a773.dist-info → sapiopycommons-2025.10.9a776.dist-info}/RECORD +16 -13
- {sapiopycommons-2025.10.2a773.dist-info → sapiopycommons-2025.10.9a776.dist-info}/WHEEL +0 -0
- {sapiopycommons-2025.10.2a773.dist-info → sapiopycommons-2025.10.9a776.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
|
+
# source: sapiopycommons/ai/protoapi/externalcredentials/external_credentials.proto
|
|
5
|
+
# Protobuf Python Version: 5.29.0
|
|
6
|
+
"""Generated protocol buffer code."""
|
|
7
|
+
from google.protobuf import descriptor as _descriptor
|
|
8
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
9
|
+
from google.protobuf import runtime_version as _runtime_version
|
|
10
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
11
|
+
from google.protobuf.internal import builder as _builder
|
|
12
|
+
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
|
+
_runtime_version.Domain.PUBLIC,
|
|
14
|
+
5,
|
|
15
|
+
29,
|
|
16
|
+
0,
|
|
17
|
+
'',
|
|
18
|
+
'sapiopycommons/ai/protoapi/externalcredentials/external_credentials.proto'
|
|
19
|
+
)
|
|
20
|
+
# @@protoc_insertion_point(imports)
|
|
21
|
+
|
|
22
|
+
_sym_db = _symbol_database.Default()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\nIsapiopycommons/ai/protoapi/externalcredentials/external_credentials.proto\"\x95\x02\n\x16\x45xternalCredentialsPbo\x12\n\n\x02id\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x10\n\x08\x63\x61tegory\x18\x04 \x01(\t\x12\x0b\n\x03url\x18\x05 \x01(\t\x12\x10\n\x08username\x18\x06 \x01(\t\x12\x10\n\x08password\x18\x07 \x01(\t\x12\r\n\x05token\x18\x08 \x01(\t\x12>\n\x0c\x63ustom_field\x18\t \x03(\x0b\x32(.ExternalCredentialsPbo.CustomFieldEntry\x1a\x32\n\x10\x43ustomFieldEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42*\n&com.velox.protoapi.externalcredentialsP\x01\x62\x06proto3')
|
|
28
|
+
|
|
29
|
+
_globals = globals()
|
|
30
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
31
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'sapiopycommons.ai.protoapi.externalcredentials.external_credentials_pb2', _globals)
|
|
32
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
33
|
+
_globals['DESCRIPTOR']._loaded_options = None
|
|
34
|
+
_globals['DESCRIPTOR']._serialized_options = b'\n&com.velox.protoapi.externalcredentialsP\001'
|
|
35
|
+
_globals['_EXTERNALCREDENTIALSPBO_CUSTOMFIELDENTRY']._loaded_options = None
|
|
36
|
+
_globals['_EXTERNALCREDENTIALSPBO_CUSTOMFIELDENTRY']._serialized_options = b'8\001'
|
|
37
|
+
_globals['_EXTERNALCREDENTIALSPBO']._serialized_start=78
|
|
38
|
+
_globals['_EXTERNALCREDENTIALSPBO']._serialized_end=355
|
|
39
|
+
_globals['_EXTERNALCREDENTIALSPBO_CUSTOMFIELDENTRY']._serialized_start=305
|
|
40
|
+
_globals['_EXTERNALCREDENTIALSPBO_CUSTOMFIELDENTRY']._serialized_end=355
|
|
41
|
+
# @@protoc_insertion_point(module_scope)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
from google.protobuf.internal import containers as _containers
|
|
2
|
+
from google.protobuf import descriptor as _descriptor
|
|
3
|
+
from google.protobuf import message as _message
|
|
4
|
+
from typing import ClassVar as _ClassVar, Mapping as _Mapping, Optional as _Optional
|
|
5
|
+
|
|
6
|
+
DESCRIPTOR: _descriptor.FileDescriptor
|
|
7
|
+
|
|
8
|
+
class ExternalCredentialsPbo(_message.Message):
|
|
9
|
+
__slots__ = ("id", "display_name", "description", "category", "url", "username", "password", "token", "custom_field")
|
|
10
|
+
class CustomFieldEntry(_message.Message):
|
|
11
|
+
__slots__ = ("key", "value")
|
|
12
|
+
KEY_FIELD_NUMBER: _ClassVar[int]
|
|
13
|
+
VALUE_FIELD_NUMBER: _ClassVar[int]
|
|
14
|
+
key: str
|
|
15
|
+
value: str
|
|
16
|
+
def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ...
|
|
17
|
+
ID_FIELD_NUMBER: _ClassVar[int]
|
|
18
|
+
DISPLAY_NAME_FIELD_NUMBER: _ClassVar[int]
|
|
19
|
+
DESCRIPTION_FIELD_NUMBER: _ClassVar[int]
|
|
20
|
+
CATEGORY_FIELD_NUMBER: _ClassVar[int]
|
|
21
|
+
URL_FIELD_NUMBER: _ClassVar[int]
|
|
22
|
+
USERNAME_FIELD_NUMBER: _ClassVar[int]
|
|
23
|
+
PASSWORD_FIELD_NUMBER: _ClassVar[int]
|
|
24
|
+
TOKEN_FIELD_NUMBER: _ClassVar[int]
|
|
25
|
+
CUSTOM_FIELD_FIELD_NUMBER: _ClassVar[int]
|
|
26
|
+
id: str
|
|
27
|
+
display_name: str
|
|
28
|
+
description: str
|
|
29
|
+
category: str
|
|
30
|
+
url: str
|
|
31
|
+
username: str
|
|
32
|
+
password: str
|
|
33
|
+
token: str
|
|
34
|
+
custom_field: _containers.ScalarMap[str, str]
|
|
35
|
+
def __init__(self, id: _Optional[str] = ..., display_name: _Optional[str] = ..., description: _Optional[str] = ..., category: _Optional[str] = ..., url: _Optional[str] = ..., username: _Optional[str] = ..., password: _Optional[str] = ..., token: _Optional[str] = ..., custom_field: _Optional[_Mapping[str, str]] = ...) -> None: ...
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
2
|
+
"""Client and server classes corresponding to protobuf-defined services."""
|
|
3
|
+
import grpc
|
|
4
|
+
import warnings
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
GRPC_GENERATED_VERSION = '1.70.0'
|
|
8
|
+
GRPC_VERSION = grpc.__version__
|
|
9
|
+
_version_not_supported = False
|
|
10
|
+
|
|
11
|
+
try:
|
|
12
|
+
from grpc._utilities import first_version_is_lower
|
|
13
|
+
_version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
|
|
14
|
+
except ImportError:
|
|
15
|
+
_version_not_supported = True
|
|
16
|
+
|
|
17
|
+
if _version_not_supported:
|
|
18
|
+
raise RuntimeError(
|
|
19
|
+
f'The grpc package installed is at version {GRPC_VERSION},'
|
|
20
|
+
+ f' but the generated code in sapiopycommons/ai/protoapi/externalcredentials/external_credentials_pb2_grpc.py depends on'
|
|
21
|
+
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
|
|
22
|
+
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
|
|
23
|
+
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
|
|
24
|
+
)
|
|
@@ -22,6 +22,7 @@ _runtime_version.ValidateProtobufRuntimeVersion(
|
|
|
22
22
|
_sym_db = _symbol_database.Default()
|
|
23
23
|
|
|
24
24
|
|
|
25
|
+
from sapiopycommons.ai.protoapi.externalcredentials import external_credentials_pb2 as sapiopycommons_dot_ai_dot_protoapi_dot_externalcredentials_dot_external__credentials__pb2
|
|
25
26
|
from sapiopycommons.ai.protoapi.plan.tool import entry_pb2 as sapiopycommons_dot_ai_dot_protoapi_dot_plan_dot_tool_dot_entry__pb2
|
|
26
27
|
try:
|
|
27
28
|
sapiopycommons_dot_ai_dot_protoapi_dot_plan_dot_item_dot_item__container__pb2 = sapiopycommons_dot_ai_dot_protoapi_dot_plan_dot_tool_dot_entry__pb2.sapiopycommons_dot_ai_dot_protoapi_dot_plan_dot_item_dot_item__container__pb2
|
|
@@ -30,11 +31,12 @@ except AttributeError:
|
|
|
30
31
|
from sapiopycommons.ai.protoapi.plan import step_pb2 as sapiopycommons_dot_ai_dot_protoapi_dot_plan_dot_step__pb2
|
|
31
32
|
from sapiopycommons.ai.protoapi.session import sapio_conn_info_pb2 as sapiopycommons_dot_ai_dot_protoapi_dot_session_dot_sapio__conn__info__pb2
|
|
32
33
|
|
|
34
|
+
from sapiopycommons.ai.protoapi.externalcredentials.external_credentials_pb2 import *
|
|
33
35
|
from sapiopycommons.ai.protoapi.plan.tool.entry_pb2 import *
|
|
34
36
|
from sapiopycommons.ai.protoapi.plan.step_pb2 import *
|
|
35
37
|
from sapiopycommons.ai.protoapi.session.sapio_conn_info_pb2 import *
|
|
36
38
|
|
|
37
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n3sapiopycommons/ai/protoapi/plan/script/script.proto\x1a\x30sapiopycommons/ai/protoapi/plan/tool/entry.proto\x1a*sapiopycommons/ai/protoapi/plan/step.proto\x1a\x38sapiopycommons/ai/protoapi/session/sapio_conn_info.proto\"A\n\x15ScriptFileContentsPbo\x12\x11\n\tfile_name\x18\x01 \x01(\t\x12\x15\n\rfile_contents\x18\x02 \x01(\x0c\"\
|
|
39
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n3sapiopycommons/ai/protoapi/plan/script/script.proto\x1aIsapiopycommons/ai/protoapi/externalcredentials/external_credentials.proto\x1a\x30sapiopycommons/ai/protoapi/plan/tool/entry.proto\x1a*sapiopycommons/ai/protoapi/plan/step.proto\x1a\x38sapiopycommons/ai/protoapi/session/sapio_conn_info.proto\"A\n\x15ScriptFileContentsPbo\x12\x11\n\tfile_name\x18\x01 \x01(\t\x12\x15\n\rfile_contents\x18\x02 \x01(\x0c\"\xf9\x03\n\x19\x43reateScriptJobRequestPbo\x12+\n\nsapio_user\x18\x01 \x01(\x0b\x32\x17.SapioConnectionInfoPbo\x12\x17\n\x0fscript_language\x18\x02 \x01(\t\x12\x18\n\x10plan_instance_id\x18\x03 \x01(\x03\x12\x18\n\x10step_instance_id\x18\x04 \x01(\x03\x12\x15\n\rinvocation_id\x18\x05 \x01(\x03\x12%\n\rinput_configs\x18\x06 \x03(\x0b\x32\x0e.StepIoInfoPbo\x12&\n\x0eoutput_configs\x18\x07 \x03(\x0b\x32\x0e.StepIoInfoPbo\x12\x0f\n\x06script\x18\x80\x08 \x01(\t\x12\x10\n\x07timeout\x18\x81\x08 \x01(\x05\x12\x16\n\rmax_memory_mb\x18\x82\x08 \x01(\x05\x12\x1a\n\x11working_directory\x18\x83\x08 \x01(\t\x12,\n\x0binput_files\x18\x84\x08 \x03(\x0b\x32\x16.ScriptFileContentsPbo\x12\x1c\n\x13\x64ownload_file_names\x18\x85\x08 \x03(\t\x12\x35\n\x13\x65xternal_credential\x18\xdc\x0b \x03(\x0b\x32\x17.ExternalCredentialsPbo\x12\"\n\x05input\x18\xff\x0f \x03(\x0b\x32\x12.StepInputBatchPbo\",\n\x1a\x43reateScriptJobResponsePbo\x12\x0e\n\x06job_id\x18\x01 \x01(\t\"N\n\x10GetJobRequestPbo\x12\x0e\n\x06job_id\x18\x01 \x01(\t\x12\x12\n\nlog_offset\x18\x02 \x01(\x05\x12\x16\n\x0e\x64ownload_files\x18\x03 \x01(\x08\"\xba\x01\n\x11GetJobResponsePbo\x12\x1a\n\x06status\x18\x01 \x01(\x0e\x32\n.JobStatus\x12\x0b\n\x03log\x18\x02 \x01(\t\x12\x11\n\texception\x18\x03 \x01(\t\x12\x14\n\x0cstep_summary\x18\x0f \x01(\t\x12-\n\x0coutput_files\x18\x84\x08 \x03(\x0b\x32\x16.ScriptFileContentsPbo\x12$\n\x06output\x18\xff\x0f \x03(\x0b\x32\x13.StepOutputBatchPbo*@\n\tJobStatus\x12\x0b\n\x07PENDING\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\r\n\tCOMPLETED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x32\x8c\x01\n\rScriptService\x12J\n\x0f\x43reateScriptJob\x12\x1a.CreateScriptJobRequestPbo\x1a\x1b.CreateScriptJobResponsePbo\x12/\n\x06GetJob\x12\x11.GetJobRequestPbo\x1a\x12.GetJobResponsePboB \n\x1e\x63om.velox.protoapi.plan.scriptP\x00P\x01P\x02P\x03\x62\x06proto3')
|
|
38
40
|
|
|
39
41
|
_globals = globals()
|
|
40
42
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
@@ -42,18 +44,18 @@ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'sapiopycommons.ai.protoapi.
|
|
|
42
44
|
if not _descriptor._USE_C_DESCRIPTORS:
|
|
43
45
|
_globals['DESCRIPTOR']._loaded_options = None
|
|
44
46
|
_globals['DESCRIPTOR']._serialized_options = b'\n\036com.velox.protoapi.plan.script'
|
|
45
|
-
_globals['_JOBSTATUS']._serialized_start=
|
|
46
|
-
_globals['_JOBSTATUS']._serialized_end=
|
|
47
|
-
_globals['_SCRIPTFILECONTENTSPBO']._serialized_start=
|
|
48
|
-
_globals['_SCRIPTFILECONTENTSPBO']._serialized_end=
|
|
49
|
-
_globals['_CREATESCRIPTJOBREQUESTPBO']._serialized_start=
|
|
50
|
-
_globals['_CREATESCRIPTJOBREQUESTPBO']._serialized_end=
|
|
51
|
-
_globals['_CREATESCRIPTJOBRESPONSEPBO']._serialized_start=
|
|
52
|
-
_globals['_CREATESCRIPTJOBRESPONSEPBO']._serialized_end=
|
|
53
|
-
_globals['_GETJOBREQUESTPBO']._serialized_start=
|
|
54
|
-
_globals['_GETJOBREQUESTPBO']._serialized_end=
|
|
55
|
-
_globals['_GETJOBRESPONSEPBO']._serialized_start=
|
|
56
|
-
_globals['_GETJOBRESPONSEPBO']._serialized_end=
|
|
57
|
-
_globals['_SCRIPTSERVICE']._serialized_start=
|
|
58
|
-
_globals['_SCRIPTSERVICE']._serialized_end=
|
|
47
|
+
_globals['_JOBSTATUS']._serialized_start=1172
|
|
48
|
+
_globals['_JOBSTATUS']._serialized_end=1236
|
|
49
|
+
_globals['_SCRIPTFILECONTENTSPBO']._serialized_start=282
|
|
50
|
+
_globals['_SCRIPTFILECONTENTSPBO']._serialized_end=347
|
|
51
|
+
_globals['_CREATESCRIPTJOBREQUESTPBO']._serialized_start=350
|
|
52
|
+
_globals['_CREATESCRIPTJOBREQUESTPBO']._serialized_end=855
|
|
53
|
+
_globals['_CREATESCRIPTJOBRESPONSEPBO']._serialized_start=857
|
|
54
|
+
_globals['_CREATESCRIPTJOBRESPONSEPBO']._serialized_end=901
|
|
55
|
+
_globals['_GETJOBREQUESTPBO']._serialized_start=903
|
|
56
|
+
_globals['_GETJOBREQUESTPBO']._serialized_end=981
|
|
57
|
+
_globals['_GETJOBRESPONSEPBO']._serialized_start=984
|
|
58
|
+
_globals['_GETJOBRESPONSEPBO']._serialized_end=1170
|
|
59
|
+
_globals['_SCRIPTSERVICE']._serialized_start=1239
|
|
60
|
+
_globals['_SCRIPTSERVICE']._serialized_end=1379
|
|
59
61
|
# @@protoc_insertion_point(module_scope)
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from sapiopycommons.ai.protoapi.externalcredentials import external_credentials_pb2 as _external_credentials_pb2
|
|
1
2
|
from sapiopycommons.ai.protoapi.plan.tool import entry_pb2 as _entry_pb2
|
|
2
3
|
from sapiopycommons.ai.protoapi.plan.item import item_container_pb2 as _item_container_pb2
|
|
3
4
|
from sapiopycommons.ai.protoapi.plan import step_pb2 as _step_pb2
|
|
@@ -7,6 +8,7 @@ from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper
|
|
|
7
8
|
from google.protobuf import descriptor as _descriptor
|
|
8
9
|
from google.protobuf import message as _message
|
|
9
10
|
from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union
|
|
11
|
+
from sapiopycommons.ai.protoapi.externalcredentials.external_credentials_pb2 import ExternalCredentialsPbo as ExternalCredentialsPbo
|
|
10
12
|
from sapiopycommons.ai.protoapi.plan.tool.entry_pb2 import StepInputBatchPbo as StepInputBatchPbo
|
|
11
13
|
from sapiopycommons.ai.protoapi.plan.tool.entry_pb2 import StepOutputBatchPbo as StepOutputBatchPbo
|
|
12
14
|
from sapiopycommons.ai.protoapi.plan.step_pb2 import StepIoInfoPbo as StepIoInfoPbo
|
|
@@ -40,7 +42,7 @@ class ScriptFileContentsPbo(_message.Message):
|
|
|
40
42
|
def __init__(self, file_name: _Optional[str] = ..., file_contents: _Optional[bytes] = ...) -> None: ...
|
|
41
43
|
|
|
42
44
|
class CreateScriptJobRequestPbo(_message.Message):
|
|
43
|
-
__slots__ = ("sapio_user", "script_language", "plan_instance_id", "step_instance_id", "invocation_id", "input_configs", "output_configs", "script", "timeout", "max_memory_mb", "working_directory", "input_files", "download_file_names", "input")
|
|
45
|
+
__slots__ = ("sapio_user", "script_language", "plan_instance_id", "step_instance_id", "invocation_id", "input_configs", "output_configs", "script", "timeout", "max_memory_mb", "working_directory", "input_files", "download_file_names", "external_credential", "input")
|
|
44
46
|
SAPIO_USER_FIELD_NUMBER: _ClassVar[int]
|
|
45
47
|
SCRIPT_LANGUAGE_FIELD_NUMBER: _ClassVar[int]
|
|
46
48
|
PLAN_INSTANCE_ID_FIELD_NUMBER: _ClassVar[int]
|
|
@@ -54,6 +56,7 @@ class CreateScriptJobRequestPbo(_message.Message):
|
|
|
54
56
|
WORKING_DIRECTORY_FIELD_NUMBER: _ClassVar[int]
|
|
55
57
|
INPUT_FILES_FIELD_NUMBER: _ClassVar[int]
|
|
56
58
|
DOWNLOAD_FILE_NAMES_FIELD_NUMBER: _ClassVar[int]
|
|
59
|
+
EXTERNAL_CREDENTIAL_FIELD_NUMBER: _ClassVar[int]
|
|
57
60
|
INPUT_FIELD_NUMBER: _ClassVar[int]
|
|
58
61
|
sapio_user: _sapio_conn_info_pb2.SapioConnectionInfoPbo
|
|
59
62
|
script_language: str
|
|
@@ -68,8 +71,9 @@ class CreateScriptJobRequestPbo(_message.Message):
|
|
|
68
71
|
working_directory: str
|
|
69
72
|
input_files: _containers.RepeatedCompositeFieldContainer[ScriptFileContentsPbo]
|
|
70
73
|
download_file_names: _containers.RepeatedScalarFieldContainer[str]
|
|
74
|
+
external_credential: _containers.RepeatedCompositeFieldContainer[_external_credentials_pb2.ExternalCredentialsPbo]
|
|
71
75
|
input: _containers.RepeatedCompositeFieldContainer[_entry_pb2.StepInputBatchPbo]
|
|
72
|
-
def __init__(self, sapio_user: _Optional[_Union[_sapio_conn_info_pb2.SapioConnectionInfoPbo, _Mapping]] = ..., script_language: _Optional[str] = ..., plan_instance_id: _Optional[int] = ..., step_instance_id: _Optional[int] = ..., invocation_id: _Optional[int] = ..., input_configs: _Optional[_Iterable[_Union[_step_pb2.StepIoInfoPbo, _Mapping]]] = ..., output_configs: _Optional[_Iterable[_Union[_step_pb2.StepIoInfoPbo, _Mapping]]] = ..., script: _Optional[str] = ..., timeout: _Optional[int] = ..., max_memory_mb: _Optional[int] = ..., working_directory: _Optional[str] = ..., input_files: _Optional[_Iterable[_Union[ScriptFileContentsPbo, _Mapping]]] = ..., download_file_names: _Optional[_Iterable[str]] = ..., input: _Optional[_Iterable[_Union[_entry_pb2.StepInputBatchPbo, _Mapping]]] = ...) -> None: ...
|
|
76
|
+
def __init__(self, sapio_user: _Optional[_Union[_sapio_conn_info_pb2.SapioConnectionInfoPbo, _Mapping]] = ..., script_language: _Optional[str] = ..., plan_instance_id: _Optional[int] = ..., step_instance_id: _Optional[int] = ..., invocation_id: _Optional[int] = ..., input_configs: _Optional[_Iterable[_Union[_step_pb2.StepIoInfoPbo, _Mapping]]] = ..., output_configs: _Optional[_Iterable[_Union[_step_pb2.StepIoInfoPbo, _Mapping]]] = ..., script: _Optional[str] = ..., timeout: _Optional[int] = ..., max_memory_mb: _Optional[int] = ..., working_directory: _Optional[str] = ..., input_files: _Optional[_Iterable[_Union[ScriptFileContentsPbo, _Mapping]]] = ..., download_file_names: _Optional[_Iterable[str]] = ..., external_credential: _Optional[_Iterable[_Union[_external_credentials_pb2.ExternalCredentialsPbo, _Mapping]]] = ..., input: _Optional[_Iterable[_Union[_entry_pb2.StepInputBatchPbo, _Mapping]]] = ...) -> None: ...
|
|
73
77
|
|
|
74
78
|
class CreateScriptJobResponsePbo(_message.Message):
|
|
75
79
|
__slots__ = ("job_id",)
|
|
@@ -88,15 +92,17 @@ class GetJobRequestPbo(_message.Message):
|
|
|
88
92
|
def __init__(self, job_id: _Optional[str] = ..., log_offset: _Optional[int] = ..., download_files: bool = ...) -> None: ...
|
|
89
93
|
|
|
90
94
|
class GetJobResponsePbo(_message.Message):
|
|
91
|
-
__slots__ = ("status", "log", "exception", "output_files", "output")
|
|
95
|
+
__slots__ = ("status", "log", "exception", "step_summary", "output_files", "output")
|
|
92
96
|
STATUS_FIELD_NUMBER: _ClassVar[int]
|
|
93
97
|
LOG_FIELD_NUMBER: _ClassVar[int]
|
|
94
98
|
EXCEPTION_FIELD_NUMBER: _ClassVar[int]
|
|
99
|
+
STEP_SUMMARY_FIELD_NUMBER: _ClassVar[int]
|
|
95
100
|
OUTPUT_FILES_FIELD_NUMBER: _ClassVar[int]
|
|
96
101
|
OUTPUT_FIELD_NUMBER: _ClassVar[int]
|
|
97
102
|
status: JobStatus
|
|
98
103
|
log: str
|
|
99
104
|
exception: str
|
|
105
|
+
step_summary: str
|
|
100
106
|
output_files: _containers.RepeatedCompositeFieldContainer[ScriptFileContentsPbo]
|
|
101
107
|
output: _containers.RepeatedCompositeFieldContainer[_entry_pb2.StepOutputBatchPbo]
|
|
102
|
-
def __init__(self, status: _Optional[_Union[JobStatus, str]] = ..., log: _Optional[str] = ..., exception: _Optional[str] = ..., output_files: _Optional[_Iterable[_Union[ScriptFileContentsPbo, _Mapping]]] = ..., output: _Optional[_Iterable[_Union[_entry_pb2.StepOutputBatchPbo, _Mapping]]] = ...) -> None: ...
|
|
108
|
+
def __init__(self, status: _Optional[_Union[JobStatus, str]] = ..., log: _Optional[str] = ..., exception: _Optional[str] = ..., step_summary: _Optional[str] = ..., output_files: _Optional[_Iterable[_Union[ScriptFileContentsPbo, _Mapping]]] = ..., output: _Optional[_Iterable[_Union[_entry_pb2.StepOutputBatchPbo, _Mapping]]] = ...) -> None: ...
|
|
@@ -22,6 +22,7 @@ _runtime_version.ValidateProtobufRuntimeVersion(
|
|
|
22
22
|
_sym_db = _symbol_database.Default()
|
|
23
23
|
|
|
24
24
|
|
|
25
|
+
from sapiopycommons.ai.protoapi.externalcredentials import external_credentials_pb2 as sapiopycommons_dot_ai_dot_protoapi_dot_externalcredentials_dot_external__credentials__pb2
|
|
25
26
|
from sapiopycommons.ai.protoapi.fielddefinitions import fields_pb2 as sapiopycommons_dot_ai_dot_protoapi_dot_fielddefinitions_dot_fields__pb2
|
|
26
27
|
from sapiopycommons.ai.protoapi.fielddefinitions import velox_field_def_pb2 as sapiopycommons_dot_ai_dot_protoapi_dot_fielddefinitions_dot_velox__field__def__pb2
|
|
27
28
|
from sapiopycommons.ai.protoapi.plan.tool import entry_pb2 as sapiopycommons_dot_ai_dot_protoapi_dot_plan_dot_tool_dot_entry__pb2
|
|
@@ -32,13 +33,14 @@ except AttributeError:
|
|
|
32
33
|
from sapiopycommons.ai.protoapi.plan import step_pb2 as sapiopycommons_dot_ai_dot_protoapi_dot_plan_dot_step__pb2
|
|
33
34
|
from sapiopycommons.ai.protoapi.session import sapio_conn_info_pb2 as sapiopycommons_dot_ai_dot_protoapi_dot_session_dot_sapio__conn__info__pb2
|
|
34
35
|
|
|
36
|
+
from sapiopycommons.ai.protoapi.externalcredentials.external_credentials_pb2 import *
|
|
35
37
|
from sapiopycommons.ai.protoapi.fielddefinitions.fields_pb2 import *
|
|
36
38
|
from sapiopycommons.ai.protoapi.fielddefinitions.velox_field_def_pb2 import *
|
|
37
39
|
from sapiopycommons.ai.protoapi.plan.tool.entry_pb2 import *
|
|
38
40
|
from sapiopycommons.ai.protoapi.plan.step_pb2 import *
|
|
39
41
|
from sapiopycommons.ai.protoapi.session.sapio_conn_info_pb2 import *
|
|
40
42
|
|
|
41
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n/sapiopycommons/ai/protoapi/plan/tool/tool.proto\x1a\x38sapiopycommons/ai/protoapi/fielddefinitions/fields.proto\x1a\x41sapiopycommons/ai/protoapi/fielddefinitions/velox_field_def.proto\x1a\x30sapiopycommons/ai/protoapi/plan/tool/entry.proto\x1a*sapiopycommons/ai/protoapi/plan/step.proto\x1a\x38sapiopycommons/ai/protoapi/session/sapio_conn_info.proto\"R\n\x13\x45xampleContainerPbo\x12\x16\n\x0ctext_example\x18\x01 \x01(\tH\x00\x12\x18\n\x0e\x62inary_example\x18\x02 \x01(\x0cH\x00\x42\t\n\x07\x65xample\"\xe9\x01\n\x13ToolIoConfigBasePbo\x12\x14\n\x0c\x63ontent_type\x18\x01 \x01(\t\x12\x11\n\tio_number\x18\x02 \x01(\x05\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t\x12\x1e\n\x16\x64\x65precated_old_example\x18\x05 \x01(\t\x12/\n\x11structure_example\x18\x06 \x01(\x0b\x32\x14.ExampleContainerPbo\x12-\n\x0ftesting_example\x18\x07 \x01(\x0b\x32\x14.ExampleContainerPbo\"\xd9\x02\n\x13ToolInputDetailsPbo\x12)\n\x0b\x62\x61se_config\x18\x01 \x01(\x0b\x32\x14.ToolIoConfigBasePbo\x12\x12\n\nvalidation\x18\x02 \x01(\t\x12\x1c\n\x0fmin_input_count\x18\x03 \x01(\x05H\x00\x88\x01\x01\x12\x1c\n\x0fmax_input_count\x18\x04 \x01(\x05H\x01\x88\x01\x01\x12\r\n\x05paged\x18\x05 \x01(\x08\x12\x1a\n\rmin_page_size\x18\x06 \x01(\x05H\x02\x88\x01\x01\x12\x1a\n\rmax_page_size\x18\x07 \x01(\x05H\x03\x88\x01\x01\x12\x1e\n\x11max_request_bytes\x18\x08 \x01(\x05H\x04\x88\x01\x01\x42\x12\n\x10_min_input_countB\x12\n\x10_max_input_countB\x10\n\x0e_min_page_sizeB\x10\n\x0e_max_page_sizeB\x14\n\x12_max_request_bytes\"A\n\x14ToolOutputDetailsPbo\x12)\n\x0b\x62\x61se_config\x18\x01 \x01(\x0b\x32\x14.ToolIoConfigBasePbo\"\
|
|
43
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n/sapiopycommons/ai/protoapi/plan/tool/tool.proto\x1aIsapiopycommons/ai/protoapi/externalcredentials/external_credentials.proto\x1a\x38sapiopycommons/ai/protoapi/fielddefinitions/fields.proto\x1a\x41sapiopycommons/ai/protoapi/fielddefinitions/velox_field_def.proto\x1a\x30sapiopycommons/ai/protoapi/plan/tool/entry.proto\x1a*sapiopycommons/ai/protoapi/plan/step.proto\x1a\x38sapiopycommons/ai/protoapi/session/sapio_conn_info.proto\"R\n\x13\x45xampleContainerPbo\x12\x16\n\x0ctext_example\x18\x01 \x01(\tH\x00\x12\x18\n\x0e\x62inary_example\x18\x02 \x01(\x0cH\x00\x42\t\n\x07\x65xample\"\xe9\x01\n\x13ToolIoConfigBasePbo\x12\x14\n\x0c\x63ontent_type\x18\x01 \x01(\t\x12\x11\n\tio_number\x18\x02 \x01(\x05\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t\x12\x1e\n\x16\x64\x65precated_old_example\x18\x05 \x01(\t\x12/\n\x11structure_example\x18\x06 \x01(\x0b\x32\x14.ExampleContainerPbo\x12-\n\x0ftesting_example\x18\x07 \x01(\x0b\x32\x14.ExampleContainerPbo\"\xd9\x02\n\x13ToolInputDetailsPbo\x12)\n\x0b\x62\x61se_config\x18\x01 \x01(\x0b\x32\x14.ToolIoConfigBasePbo\x12\x12\n\nvalidation\x18\x02 \x01(\t\x12\x1c\n\x0fmin_input_count\x18\x03 \x01(\x05H\x00\x88\x01\x01\x12\x1c\n\x0fmax_input_count\x18\x04 \x01(\x05H\x01\x88\x01\x01\x12\r\n\x05paged\x18\x05 \x01(\x08\x12\x1a\n\rmin_page_size\x18\x06 \x01(\x05H\x02\x88\x01\x01\x12\x1a\n\rmax_page_size\x18\x07 \x01(\x05H\x03\x88\x01\x01\x12\x1e\n\x11max_request_bytes\x18\x08 \x01(\x05H\x04\x88\x01\x01\x42\x12\n\x10_min_input_countB\x12\n\x10_max_input_countB\x10\n\x0e_min_page_sizeB\x10\n\x0e_max_page_sizeB\x14\n\x12_max_request_bytes\"A\n\x14ToolOutputDetailsPbo\x12)\n\x0b\x62\x61se_config\x18\x01 \x01(\x0b\x32\x14.ToolIoConfigBasePbo\"\x8b\x04\n\x15ProcessStepRequestPbo\x12+\n\nsapio_user\x18\x01 \x01(\x0b\x32\x17.SapioConnectionInfoPbo\x12\x11\n\ttool_name\x18\x02 \x01(\t\x12\x18\n\x10plan_instance_id\x18\x03 \x01(\x03\x12\x18\n\x10step_instance_id\x18\x04 \x01(\x03\x12\x15\n\rinvocation_id\x18\x05 \x01(\x03\x12%\n\rinput_configs\x18\x06 \x03(\x0b\x32\x0e.StepIoInfoPbo\x12&\n\x0eoutput_configs\x18\x07 \x03(\x0b\x32\x0e.StepIoInfoPbo\x12J\n\x13\x63onfig_field_values\x18\x08 \x03(\x0b\x32-.ProcessStepRequestPbo.ConfigFieldValuesEntry\x12\x0f\n\x07\x64ry_run\x18\t \x01(\x08\x12\x17\n\x0fverbose_logging\x18\n \x01(\x08\x12\x34\n\x13\x65xternal_credential\x18\x0b \x03(\x0b\x32\x17.ExternalCredentialsPbo\x12\"\n\x05input\x18\xff\x0f \x03(\x0b\x32\x12.StepInputBatchPbo\x1aH\n\x16\x43onfigFieldValuesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x1d\n\x05value\x18\x02 \x01(\x0b\x32\x0e.FieldValuePbo:\x02\x38\x01\"\xd2\x01\n\x16ProcessStepResponsePbo\x12-\n\x06status\x18\x01 \x01(\x0e\x32\x1d.ProcessStepResponseStatusPbo\x12\x16\n\x0estatus_message\x18\x02 \x01(\t\x12\x14\n\x0cstep_summary\x18\x03 \x01(\t\x12\'\n\x0bnew_records\x18\xfd\x0f \x03(\x0b\x32\x11.FieldValueMapPbo\x12\x0c\n\x03log\x18\xfe\x0f \x03(\t\x12$\n\x06output\x18\xff\x0f \x03(\x0b\x32\x13.StepOutputBatchPbo\"I\n\x15ToolDetailsRequestPbo\x12\x30\n\x0fsapio_conn_info\x18\x01 \x01(\x0b\x32\x17.SapioConnectionInfoPbo\"\xdf\x02\n\x0eToolDetailsPbo\x12\x11\n\timport_id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x1d\n\x15output_data_type_name\x18\x04 \x01(\t\x12+\n\rinput_configs\x18\x05 \x03(\x0b\x32\x14.ToolInputDetailsPbo\x12-\n\x0eoutput_configs\x18\x06 \x03(\x0b\x32\x15.ToolOutputDetailsPbo\x12(\n\rconfig_fields\x18\x07 \x03(\x0b\x32\x11.VeloxFieldDefPbo\x12\x14\n\x0clicense_info\x18\x08 \x01(\t\x12\x10\n\x08\x63\x61tegory\x18\t \x01(\t\x12\"\n\x08\x63itation\x18\x0b \x03(\x0b\x32\x10.ToolCitationPbo\x12&\n\x1ereview_on_instance_field_names\x18\x0c \x03(\t\"-\n\x0fToolCitationPbo\x12\r\n\x05title\x18\x01 \x01(\t\x12\x0b\n\x03url\x18\x02 \x01(\t\"_\n\x16ToolDetailsResponsePbo\x12\x1e\n\x16tool_framework_version\x18\x01 \x01(\x05\x12%\n\x0ctool_details\x18\x02 \x03(\x0b\x32\x0f.ToolDetailsPbo*E\n\x1cProcessStepResponseStatusPbo\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0b\n\x07SUCCESS\x10\x01\x12\x0b\n\x07\x46\x41ILURE\x10\x02\x32\x90\x01\n\x0bToolService\x12\x41\n\x0eGetToolDetails\x12\x16.ToolDetailsRequestPbo\x1a\x17.ToolDetailsResponsePbo\x12>\n\x0bProcessData\x12\x16.ProcessStepRequestPbo\x1a\x17.ProcessStepResponsePboB \n\x1c\x63om.velox.protoapi.plan.toolP\x01P\x00P\x01P\x02P\x03P\x04P\x05\x62\x06proto3')
|
|
42
44
|
|
|
43
45
|
_globals = globals()
|
|
44
46
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
@@ -48,30 +50,30 @@ if not _descriptor._USE_C_DESCRIPTORS:
|
|
|
48
50
|
_globals['DESCRIPTOR']._serialized_options = b'\n\034com.velox.protoapi.plan.toolP\001'
|
|
49
51
|
_globals['_PROCESSSTEPREQUESTPBO_CONFIGFIELDVALUESENTRY']._loaded_options = None
|
|
50
52
|
_globals['_PROCESSSTEPREQUESTPBO_CONFIGFIELDVALUESENTRY']._serialized_options = b'8\001'
|
|
51
|
-
_globals['_PROCESSSTEPRESPONSESTATUSPBO']._serialized_start=
|
|
52
|
-
_globals['_PROCESSSTEPRESPONSESTATUSPBO']._serialized_end=
|
|
53
|
-
_globals['_EXAMPLECONTAINERPBO']._serialized_start=
|
|
54
|
-
_globals['_EXAMPLECONTAINERPBO']._serialized_end=
|
|
55
|
-
_globals['_TOOLIOCONFIGBASEPBO']._serialized_start=
|
|
56
|
-
_globals['_TOOLIOCONFIGBASEPBO']._serialized_end=
|
|
57
|
-
_globals['_TOOLINPUTDETAILSPBO']._serialized_start=
|
|
58
|
-
_globals['_TOOLINPUTDETAILSPBO']._serialized_end=
|
|
59
|
-
_globals['_TOOLOUTPUTDETAILSPBO']._serialized_start=
|
|
60
|
-
_globals['_TOOLOUTPUTDETAILSPBO']._serialized_end=
|
|
61
|
-
_globals['_PROCESSSTEPREQUESTPBO']._serialized_start=
|
|
62
|
-
_globals['_PROCESSSTEPREQUESTPBO']._serialized_end=
|
|
63
|
-
_globals['_PROCESSSTEPREQUESTPBO_CONFIGFIELDVALUESENTRY']._serialized_start=
|
|
64
|
-
_globals['_PROCESSSTEPREQUESTPBO_CONFIGFIELDVALUESENTRY']._serialized_end=
|
|
65
|
-
_globals['_PROCESSSTEPRESPONSEPBO']._serialized_start=
|
|
66
|
-
_globals['_PROCESSSTEPRESPONSEPBO']._serialized_end=
|
|
67
|
-
_globals['_TOOLDETAILSREQUESTPBO']._serialized_start=
|
|
68
|
-
_globals['_TOOLDETAILSREQUESTPBO']._serialized_end=
|
|
69
|
-
_globals['_TOOLDETAILSPBO']._serialized_start=
|
|
70
|
-
_globals['_TOOLDETAILSPBO']._serialized_end=
|
|
71
|
-
_globals['_TOOLCITATIONPBO']._serialized_start=
|
|
72
|
-
_globals['_TOOLCITATIONPBO']._serialized_end=
|
|
73
|
-
_globals['_TOOLDETAILSRESPONSEPBO']._serialized_start=
|
|
74
|
-
_globals['_TOOLDETAILSRESPONSEPBO']._serialized_end=
|
|
75
|
-
_globals['_TOOLSERVICE']._serialized_start=
|
|
76
|
-
_globals['_TOOLSERVICE']._serialized_end=
|
|
53
|
+
_globals['_PROCESSSTEPRESPONSESTATUSPBO']._serialized_start=2450
|
|
54
|
+
_globals['_PROCESSSTEPRESPONSESTATUSPBO']._serialized_end=2519
|
|
55
|
+
_globals['_EXAMPLECONTAINERPBO']._serialized_start=403
|
|
56
|
+
_globals['_EXAMPLECONTAINERPBO']._serialized_end=485
|
|
57
|
+
_globals['_TOOLIOCONFIGBASEPBO']._serialized_start=488
|
|
58
|
+
_globals['_TOOLIOCONFIGBASEPBO']._serialized_end=721
|
|
59
|
+
_globals['_TOOLINPUTDETAILSPBO']._serialized_start=724
|
|
60
|
+
_globals['_TOOLINPUTDETAILSPBO']._serialized_end=1069
|
|
61
|
+
_globals['_TOOLOUTPUTDETAILSPBO']._serialized_start=1071
|
|
62
|
+
_globals['_TOOLOUTPUTDETAILSPBO']._serialized_end=1136
|
|
63
|
+
_globals['_PROCESSSTEPREQUESTPBO']._serialized_start=1139
|
|
64
|
+
_globals['_PROCESSSTEPREQUESTPBO']._serialized_end=1662
|
|
65
|
+
_globals['_PROCESSSTEPREQUESTPBO_CONFIGFIELDVALUESENTRY']._serialized_start=1590
|
|
66
|
+
_globals['_PROCESSSTEPREQUESTPBO_CONFIGFIELDVALUESENTRY']._serialized_end=1662
|
|
67
|
+
_globals['_PROCESSSTEPRESPONSEPBO']._serialized_start=1665
|
|
68
|
+
_globals['_PROCESSSTEPRESPONSEPBO']._serialized_end=1875
|
|
69
|
+
_globals['_TOOLDETAILSREQUESTPBO']._serialized_start=1877
|
|
70
|
+
_globals['_TOOLDETAILSREQUESTPBO']._serialized_end=1950
|
|
71
|
+
_globals['_TOOLDETAILSPBO']._serialized_start=1953
|
|
72
|
+
_globals['_TOOLDETAILSPBO']._serialized_end=2304
|
|
73
|
+
_globals['_TOOLCITATIONPBO']._serialized_start=2306
|
|
74
|
+
_globals['_TOOLCITATIONPBO']._serialized_end=2351
|
|
75
|
+
_globals['_TOOLDETAILSRESPONSEPBO']._serialized_start=2353
|
|
76
|
+
_globals['_TOOLDETAILSRESPONSEPBO']._serialized_end=2448
|
|
77
|
+
_globals['_TOOLSERVICE']._serialized_start=2522
|
|
78
|
+
_globals['_TOOLSERVICE']._serialized_end=2666
|
|
77
79
|
# @@protoc_insertion_point(module_scope)
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from sapiopycommons.ai.protoapi.externalcredentials import external_credentials_pb2 as _external_credentials_pb2
|
|
1
2
|
from sapiopycommons.ai.protoapi.fielddefinitions import fields_pb2 as _fields_pb2
|
|
2
3
|
from sapiopycommons.ai.protoapi.fielddefinitions import velox_field_def_pb2 as _velox_field_def_pb2
|
|
3
4
|
from sapiopycommons.ai.protoapi.plan.tool import entry_pb2 as _entry_pb2
|
|
@@ -9,6 +10,7 @@ from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper
|
|
|
9
10
|
from google.protobuf import descriptor as _descriptor
|
|
10
11
|
from google.protobuf import message as _message
|
|
11
12
|
from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union
|
|
13
|
+
from sapiopycommons.ai.protoapi.externalcredentials.external_credentials_pb2 import ExternalCredentialsPbo as ExternalCredentialsPbo
|
|
12
14
|
from sapiopycommons.ai.protoapi.fielddefinitions.fields_pb2 import FieldValuePbo as FieldValuePbo
|
|
13
15
|
from sapiopycommons.ai.protoapi.fielddefinitions.fields_pb2 import FieldValueMapPbo as FieldValueMapPbo
|
|
14
16
|
from sapiopycommons.ai.protoapi.fielddefinitions.velox_field_def_pb2 import FieldValidatorPbo as FieldValidatorPbo
|
|
@@ -160,7 +162,7 @@ class ToolOutputDetailsPbo(_message.Message):
|
|
|
160
162
|
def __init__(self, base_config: _Optional[_Union[ToolIoConfigBasePbo, _Mapping]] = ...) -> None: ...
|
|
161
163
|
|
|
162
164
|
class ProcessStepRequestPbo(_message.Message):
|
|
163
|
-
__slots__ = ("sapio_user", "tool_name", "plan_instance_id", "step_instance_id", "invocation_id", "input_configs", "output_configs", "config_field_values", "dry_run", "verbose_logging", "input")
|
|
165
|
+
__slots__ = ("sapio_user", "tool_name", "plan_instance_id", "step_instance_id", "invocation_id", "input_configs", "output_configs", "config_field_values", "dry_run", "verbose_logging", "external_credential", "input")
|
|
164
166
|
class ConfigFieldValuesEntry(_message.Message):
|
|
165
167
|
__slots__ = ("key", "value")
|
|
166
168
|
KEY_FIELD_NUMBER: _ClassVar[int]
|
|
@@ -178,6 +180,7 @@ class ProcessStepRequestPbo(_message.Message):
|
|
|
178
180
|
CONFIG_FIELD_VALUES_FIELD_NUMBER: _ClassVar[int]
|
|
179
181
|
DRY_RUN_FIELD_NUMBER: _ClassVar[int]
|
|
180
182
|
VERBOSE_LOGGING_FIELD_NUMBER: _ClassVar[int]
|
|
183
|
+
EXTERNAL_CREDENTIAL_FIELD_NUMBER: _ClassVar[int]
|
|
181
184
|
INPUT_FIELD_NUMBER: _ClassVar[int]
|
|
182
185
|
sapio_user: _sapio_conn_info_pb2.SapioConnectionInfoPbo
|
|
183
186
|
tool_name: str
|
|
@@ -189,22 +192,25 @@ class ProcessStepRequestPbo(_message.Message):
|
|
|
189
192
|
config_field_values: _containers.MessageMap[str, _fields_pb2.FieldValuePbo]
|
|
190
193
|
dry_run: bool
|
|
191
194
|
verbose_logging: bool
|
|
195
|
+
external_credential: _containers.RepeatedCompositeFieldContainer[_external_credentials_pb2.ExternalCredentialsPbo]
|
|
192
196
|
input: _containers.RepeatedCompositeFieldContainer[_entry_pb2.StepInputBatchPbo]
|
|
193
|
-
def __init__(self, sapio_user: _Optional[_Union[_sapio_conn_info_pb2.SapioConnectionInfoPbo, _Mapping]] = ..., tool_name: _Optional[str] = ..., plan_instance_id: _Optional[int] = ..., step_instance_id: _Optional[int] = ..., invocation_id: _Optional[int] = ..., input_configs: _Optional[_Iterable[_Union[_step_pb2.StepIoInfoPbo, _Mapping]]] = ..., output_configs: _Optional[_Iterable[_Union[_step_pb2.StepIoInfoPbo, _Mapping]]] = ..., config_field_values: _Optional[_Mapping[str, _fields_pb2.FieldValuePbo]] = ..., dry_run: bool = ..., verbose_logging: bool = ..., input: _Optional[_Iterable[_Union[_entry_pb2.StepInputBatchPbo, _Mapping]]] = ...) -> None: ...
|
|
197
|
+
def __init__(self, sapio_user: _Optional[_Union[_sapio_conn_info_pb2.SapioConnectionInfoPbo, _Mapping]] = ..., tool_name: _Optional[str] = ..., plan_instance_id: _Optional[int] = ..., step_instance_id: _Optional[int] = ..., invocation_id: _Optional[int] = ..., input_configs: _Optional[_Iterable[_Union[_step_pb2.StepIoInfoPbo, _Mapping]]] = ..., output_configs: _Optional[_Iterable[_Union[_step_pb2.StepIoInfoPbo, _Mapping]]] = ..., config_field_values: _Optional[_Mapping[str, _fields_pb2.FieldValuePbo]] = ..., dry_run: bool = ..., verbose_logging: bool = ..., external_credential: _Optional[_Iterable[_Union[_external_credentials_pb2.ExternalCredentialsPbo, _Mapping]]] = ..., input: _Optional[_Iterable[_Union[_entry_pb2.StepInputBatchPbo, _Mapping]]] = ...) -> None: ...
|
|
194
198
|
|
|
195
199
|
class ProcessStepResponsePbo(_message.Message):
|
|
196
|
-
__slots__ = ("status", "status_message", "new_records", "log", "output")
|
|
200
|
+
__slots__ = ("status", "status_message", "step_summary", "new_records", "log", "output")
|
|
197
201
|
STATUS_FIELD_NUMBER: _ClassVar[int]
|
|
198
202
|
STATUS_MESSAGE_FIELD_NUMBER: _ClassVar[int]
|
|
203
|
+
STEP_SUMMARY_FIELD_NUMBER: _ClassVar[int]
|
|
199
204
|
NEW_RECORDS_FIELD_NUMBER: _ClassVar[int]
|
|
200
205
|
LOG_FIELD_NUMBER: _ClassVar[int]
|
|
201
206
|
OUTPUT_FIELD_NUMBER: _ClassVar[int]
|
|
202
207
|
status: ProcessStepResponseStatusPbo
|
|
203
208
|
status_message: str
|
|
209
|
+
step_summary: str
|
|
204
210
|
new_records: _containers.RepeatedCompositeFieldContainer[_fields_pb2.FieldValueMapPbo]
|
|
205
211
|
log: _containers.RepeatedScalarFieldContainer[str]
|
|
206
212
|
output: _containers.RepeatedCompositeFieldContainer[_entry_pb2.StepOutputBatchPbo]
|
|
207
|
-
def __init__(self, status: _Optional[_Union[ProcessStepResponseStatusPbo, str]] = ..., status_message: _Optional[str] = ..., new_records: _Optional[_Iterable[_Union[_fields_pb2.FieldValueMapPbo, _Mapping]]] = ..., log: _Optional[_Iterable[str]] = ..., output: _Optional[_Iterable[_Union[_entry_pb2.StepOutputBatchPbo, _Mapping]]] = ...) -> None: ...
|
|
213
|
+
def __init__(self, status: _Optional[_Union[ProcessStepResponseStatusPbo, str]] = ..., status_message: _Optional[str] = ..., step_summary: _Optional[str] = ..., new_records: _Optional[_Iterable[_Union[_fields_pb2.FieldValueMapPbo, _Mapping]]] = ..., log: _Optional[_Iterable[str]] = ..., output: _Optional[_Iterable[_Union[_entry_pb2.StepOutputBatchPbo, _Mapping]]] = ...) -> None: ...
|
|
208
214
|
|
|
209
215
|
class ToolDetailsRequestPbo(_message.Message):
|
|
210
216
|
__slots__ = ("sapio_conn_info",)
|
|
@@ -213,7 +219,7 @@ class ToolDetailsRequestPbo(_message.Message):
|
|
|
213
219
|
def __init__(self, sapio_conn_info: _Optional[_Union[_sapio_conn_info_pb2.SapioConnectionInfoPbo, _Mapping]] = ...) -> None: ...
|
|
214
220
|
|
|
215
221
|
class ToolDetailsPbo(_message.Message):
|
|
216
|
-
__slots__ = ("import_id", "name", "description", "output_data_type_name", "input_configs", "output_configs", "config_fields", "license_info", "category", "citation")
|
|
222
|
+
__slots__ = ("import_id", "name", "description", "output_data_type_name", "input_configs", "output_configs", "config_fields", "license_info", "category", "citation", "review_on_instance_field_names")
|
|
217
223
|
IMPORT_ID_FIELD_NUMBER: _ClassVar[int]
|
|
218
224
|
NAME_FIELD_NUMBER: _ClassVar[int]
|
|
219
225
|
DESCRIPTION_FIELD_NUMBER: _ClassVar[int]
|
|
@@ -224,6 +230,7 @@ class ToolDetailsPbo(_message.Message):
|
|
|
224
230
|
LICENSE_INFO_FIELD_NUMBER: _ClassVar[int]
|
|
225
231
|
CATEGORY_FIELD_NUMBER: _ClassVar[int]
|
|
226
232
|
CITATION_FIELD_NUMBER: _ClassVar[int]
|
|
233
|
+
REVIEW_ON_INSTANCE_FIELD_NAMES_FIELD_NUMBER: _ClassVar[int]
|
|
227
234
|
import_id: str
|
|
228
235
|
name: str
|
|
229
236
|
description: str
|
|
@@ -234,7 +241,8 @@ class ToolDetailsPbo(_message.Message):
|
|
|
234
241
|
license_info: str
|
|
235
242
|
category: str
|
|
236
243
|
citation: _containers.RepeatedCompositeFieldContainer[ToolCitationPbo]
|
|
237
|
-
|
|
244
|
+
review_on_instance_field_names: _containers.RepeatedScalarFieldContainer[str]
|
|
245
|
+
def __init__(self, import_id: _Optional[str] = ..., name: _Optional[str] = ..., description: _Optional[str] = ..., output_data_type_name: _Optional[str] = ..., input_configs: _Optional[_Iterable[_Union[ToolInputDetailsPbo, _Mapping]]] = ..., output_configs: _Optional[_Iterable[_Union[ToolOutputDetailsPbo, _Mapping]]] = ..., config_fields: _Optional[_Iterable[_Union[_velox_field_def_pb2.VeloxFieldDefPbo, _Mapping]]] = ..., license_info: _Optional[str] = ..., category: _Optional[str] = ..., citation: _Optional[_Iterable[_Union[ToolCitationPbo, _Mapping]]] = ..., review_on_instance_field_names: _Optional[_Iterable[str]] = ...) -> None: ...
|
|
238
246
|
|
|
239
247
|
class ToolCitationPbo(_message.Message):
|
|
240
248
|
__slots__ = ("title", "url")
|
|
@@ -4,12 +4,12 @@ from abc import ABC
|
|
|
4
4
|
from typing import Any, Callable
|
|
5
5
|
|
|
6
6
|
from sapiopycommons.ai.test_client import ContainerType
|
|
7
|
-
from sapiopycommons.ai.
|
|
7
|
+
from sapiopycommons.ai.agent_service_base import AgentBase
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
class InputValidation(ABC):
|
|
11
11
|
"""
|
|
12
|
-
A base class for validating the input to
|
|
12
|
+
A base class for validating the input to an agent.
|
|
13
13
|
"""
|
|
14
14
|
index: int
|
|
15
15
|
max_entries: int | None
|
|
@@ -156,6 +156,7 @@ class JsonKeyValidation:
|
|
|
156
156
|
self.key = key
|
|
157
157
|
self.json_type = json_type
|
|
158
158
|
self.required = required
|
|
159
|
+
self.allow_empty = allow_empty
|
|
159
160
|
|
|
160
161
|
self.list_type = list_type
|
|
161
162
|
self.nested_requirements = {}
|
|
@@ -181,28 +182,35 @@ class TextValidation(InputValidation):
|
|
|
181
182
|
A class representing a validation requirement for a text input.
|
|
182
183
|
"""
|
|
183
184
|
flatten: bool
|
|
185
|
+
disallowed_characters: str | None = None
|
|
184
186
|
regex: str | None = None
|
|
185
187
|
|
|
186
188
|
func: Callable[[int, str], list[str]] | None = None
|
|
187
189
|
|
|
188
190
|
def __init__(self, index: int, max_entries: int | None = None,
|
|
189
191
|
allow_empty_input: bool = False, allow_empty_entries: bool = False, flatten: bool = False,
|
|
190
|
-
|
|
192
|
+
disallow_characters: str | None = None, regex: str | None = None,
|
|
193
|
+
func: Callable[[int, str], list[str]] | None = None):
|
|
191
194
|
"""
|
|
192
195
|
:param index: The index of the input to validate.
|
|
193
196
|
:param max_entries: The maximum number of entries allowed for this input. If None, then there is no limit.
|
|
194
197
|
:param allow_empty_input: If true, then the input can be completely empty.
|
|
195
198
|
:param allow_empty_entries: If true, then individual entries in the input can be empty.
|
|
196
199
|
:param flatten: If true, then the input will be flattened before validation
|
|
200
|
+
:param disallow_characters: A string of characters that are not allowed in any entry in the input. If None,
|
|
201
|
+
then no character validation will be performed. This parameter will not be used if the input or entry are
|
|
202
|
+
empty.
|
|
197
203
|
:param regex: An optional regular expression that each entry in the input must fully match. If None, then no
|
|
198
|
-
regex validation will be performed. This
|
|
204
|
+
regex validation will be performed. This parameter will not be used if the input or entry are empty.
|
|
199
205
|
:param func: An optional function to run on each entry in the input. The function should take the index of
|
|
200
206
|
the input and the entry as arguments, and return a list of error messages if the entry is not valid. If the
|
|
201
|
-
entry is valid, the function should return an empty list.
|
|
202
|
-
|
|
207
|
+
entry is valid, the function should return an empty list. The function will only be called if the entry
|
|
208
|
+
passes those previous checks (e.g. not empty, doesn't include disallowed characters,
|
|
209
|
+
passes the regex, etc.).
|
|
203
210
|
"""
|
|
204
211
|
super().__init__(index, max_entries, allow_empty_input, allow_empty_entries)
|
|
205
212
|
self.flatten = flatten
|
|
213
|
+
self.disallowed_characters = disallow_characters
|
|
206
214
|
self.regex = regex
|
|
207
215
|
self.func = func
|
|
208
216
|
|
|
@@ -210,26 +218,26 @@ class TextValidation(InputValidation):
|
|
|
210
218
|
|
|
211
219
|
class InputValidator:
|
|
212
220
|
"""
|
|
213
|
-
A class for validating the inputs to
|
|
221
|
+
A class for validating the inputs to an agent based on their container types and specified validation requirements.
|
|
214
222
|
"""
|
|
215
|
-
|
|
223
|
+
agent: AgentBase
|
|
216
224
|
requirements: dict[int, InputValidation]
|
|
217
225
|
|
|
218
|
-
def __init__(self,
|
|
226
|
+
def __init__(self, agent: AgentBase, requirements: list[InputValidation] | None = None):
|
|
219
227
|
"""
|
|
220
|
-
:param
|
|
228
|
+
:param agent: The agent to validate the request of.
|
|
221
229
|
:param requirements: A list of validation requirements to apply to the request. If a validation object is
|
|
222
230
|
not provided for a given input, then default validation will be applied. Default validation requires that
|
|
223
231
|
the input is not empty, and that the entries in the input are not empty.
|
|
224
232
|
"""
|
|
225
|
-
self.
|
|
233
|
+
self.agent = agent
|
|
226
234
|
self.requirements = {}
|
|
227
235
|
for req in requirements:
|
|
228
|
-
if req.index < 0 or req.index >= len(
|
|
229
|
-
raise ValueError(f"Validation requirement index {req.index} is out of range for
|
|
230
|
-
f"{
|
|
236
|
+
if req.index < 0 or req.index >= len(agent.input_configs):
|
|
237
|
+
raise ValueError(f"Validation requirement index {req.index} is out of range for agent "
|
|
238
|
+
f"{agent.name()} with {len(agent.input_configs)} inputs.")
|
|
231
239
|
if req.index in self.requirements:
|
|
232
|
-
raise ValueError(f"Duplicate validation requirement index {req.index} for
|
|
240
|
+
raise ValueError(f"Duplicate validation requirement index {req.index} for agent {agent.name()}.")
|
|
233
241
|
self.requirements[req.index] = req
|
|
234
242
|
|
|
235
243
|
def run(self) -> list[str]:
|
|
@@ -244,7 +252,7 @@ class InputValidator:
|
|
|
244
252
|
list.
|
|
245
253
|
"""
|
|
246
254
|
errors: list[str] = []
|
|
247
|
-
for i, input_type in enumerate(self.
|
|
255
|
+
for i, input_type in enumerate(self.agent.input_container_types):
|
|
248
256
|
match input_type:
|
|
249
257
|
case ContainerType.BINARY:
|
|
250
258
|
r: InputValidation = self.requirements.get(i, BinaryValidation(i))
|
|
@@ -280,7 +288,7 @@ class InputValidator:
|
|
|
280
288
|
:param r: The validation requirement to use for this input.
|
|
281
289
|
:return: A list of error messages if the input is not valid. If the input is valid, return an empty list.
|
|
282
290
|
"""
|
|
283
|
-
input_files: list[bytes] = self.
|
|
291
|
+
input_files: list[bytes] = self.agent.get_input_binary(index)
|
|
284
292
|
errors: list[str] = []
|
|
285
293
|
if not input_files:
|
|
286
294
|
if not r.allow_empty_input:
|
|
@@ -305,7 +313,7 @@ class InputValidator:
|
|
|
305
313
|
:param r: The validation requirement to use for this input.
|
|
306
314
|
:return: A list of error messages if the input is not valid. If the input is valid, return an empty list.
|
|
307
315
|
"""
|
|
308
|
-
headers, csv = self.
|
|
316
|
+
headers, csv = self.agent.get_input_csv(index)
|
|
309
317
|
headers: list[str]
|
|
310
318
|
csv: list[dict[str, Any]]
|
|
311
319
|
|
|
@@ -338,7 +346,7 @@ class InputValidator:
|
|
|
338
346
|
:param r: The validation requirement to use for this input.
|
|
339
347
|
:return: A list of error messages if the input is not valid. If the input is valid, return an empty list.
|
|
340
348
|
"""
|
|
341
|
-
input_json: list[dict[str, Any]] = self.
|
|
349
|
+
input_json: list[dict[str, Any]] = self.agent.get_input_json(index)
|
|
342
350
|
errors: list[str] = []
|
|
343
351
|
if not input_json:
|
|
344
352
|
if not r.allow_empty_input:
|
|
@@ -421,9 +429,9 @@ class InputValidator:
|
|
|
421
429
|
:param r: The validation requirement to use for this input.
|
|
422
430
|
:return: A list of error messages if the input is not valid. If the input is valid, return an empty list.
|
|
423
431
|
"""
|
|
424
|
-
input_text: list[str] = self.
|
|
432
|
+
input_text: list[str] = self.agent.get_input_text(index)
|
|
425
433
|
if r.flatten:
|
|
426
|
-
input_text = self.
|
|
434
|
+
input_text = self.agent.flatten_text(input_text)
|
|
427
435
|
|
|
428
436
|
errors: list[str] = []
|
|
429
437
|
if not input_text:
|
|
@@ -437,6 +445,17 @@ class InputValidator:
|
|
|
437
445
|
if not entry.strip():
|
|
438
446
|
if not r.allow_empty_entries:
|
|
439
447
|
errors.append(f"Entry {i} of input {index} is empty or contains only whitespace.")
|
|
448
|
+
elif r.disallowed_characters:
|
|
449
|
+
for c in r.disallowed_characters:
|
|
450
|
+
# Replace special characters with their escaped versions for better error messages.
|
|
451
|
+
if c == "\r":
|
|
452
|
+
c = r"\r"
|
|
453
|
+
elif c == '\n':
|
|
454
|
+
c = r"\n"
|
|
455
|
+
elif c == "\t":
|
|
456
|
+
c = r"\t"
|
|
457
|
+
if c in entry:
|
|
458
|
+
errors.append(f"Entry {i} of input {index} contains disallowed character '{c}'.")
|
|
440
459
|
elif r.regex:
|
|
441
460
|
import re
|
|
442
461
|
if not re.fullmatch(r.regex, entry):
|