maitai-python 1.0.43b0__tar.gz → 1.1.0b1__tar.gz
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.
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/PKG-INFO +1 -1
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/maitai/tools/__init__.py +4 -1
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/maitai_common/version.py +1 -1
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/maitai_gen/chat/__init__.py +12 -6
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/maitai_python.egg-info/PKG-INFO +1 -1
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/README.md +0 -0
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/maitai/__init__.py +0 -0
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/maitai/_azure.py +0 -0
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/maitai/_config.py +0 -0
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/maitai/_config_listener_thread.py +0 -0
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/maitai/_context.py +0 -0
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/maitai/_evaluator.py +0 -0
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/maitai/_inference.py +0 -0
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/maitai/_maitai.py +0 -0
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/maitai/_maitai_async.py +0 -0
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/maitai/_maitai_client.py +0 -0
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/maitai/_types.py +0 -0
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/maitai/_utils.py +0 -0
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/maitai_common/__init__.py +0 -0
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/maitai_common/config/__init__.py +0 -0
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/maitai_common/config/config_service.py +0 -0
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/maitai_common/processes/__init__.py +0 -0
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/maitai_common/processes/io_thread.py +0 -0
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/maitai_common/processes/websocket_listener_thread.py +0 -0
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/maitai_common/utils/__init__.py +0 -0
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/maitai_common/utils/proto_utils.py +0 -0
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/maitai_common/utils/types.py +0 -0
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/maitai_gen/__init__.py +0 -0
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/maitai_gen/application/__init__.py +0 -0
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/maitai_gen/company/__init__.py +0 -0
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/maitai_gen/config/__init__.py +0 -0
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/maitai_gen/embedding/__init__.py +0 -0
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/maitai_gen/event/__init__.py +0 -0
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/maitai_gen/inference/__init__.py +0 -0
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/maitai_gen/key/__init__.py +0 -0
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/maitai_gen/model/__init__.py +0 -0
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/maitai_gen/notification/__init__.py +0 -0
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/maitai_gen/sandbox/__init__.py +0 -0
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/maitai_gen/sentinel/__init__.py +0 -0
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/maitai_gen/session/__init__.py +0 -0
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/maitai_python.egg-info/SOURCES.txt +0 -0
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/maitai_python.egg-info/dependency_links.txt +0 -0
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/maitai_python.egg-info/requires.txt +0 -0
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/maitai_python.egg-info/top_level.txt +0 -0
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/setup.cfg +0 -0
- {maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/setup.py +0 -0
|
@@ -21,9 +21,12 @@ class Tools:
|
|
|
21
21
|
def get_tool_definitions(self):
|
|
22
22
|
return self.definitions
|
|
23
23
|
|
|
24
|
-
def invoke(self, tool_call: ToolCall):
|
|
24
|
+
def invoke(self, tool_call: ToolCall, **override_args):
|
|
25
|
+
if tool_call.function.name not in self.available_functions:
|
|
26
|
+
raise TypeError(f"Function {tool_call.function.name} is not defined")
|
|
25
27
|
function_to_call = self.available_functions[tool_call.function.name]
|
|
26
28
|
function_args = json.loads(tool_call.function.arguments)
|
|
29
|
+
function_args.update(override_args)
|
|
27
30
|
function_response = function_to_call(**function_args)
|
|
28
31
|
return function_response
|
|
29
32
|
|
|
@@ -359,6 +359,13 @@ class Turn(betterproto.Message):
|
|
|
359
359
|
eval_request: "EvaluateRequest" = betterproto.message_field(3)
|
|
360
360
|
|
|
361
361
|
|
|
362
|
+
@dataclass(eq=False, repr=False)
|
|
363
|
+
class PromptguardRequest(betterproto.Message):
|
|
364
|
+
company_id: int = betterproto.int64_field(1)
|
|
365
|
+
request_id: str = betterproto.string_field(2)
|
|
366
|
+
messages: List["ChatMessage"] = betterproto.message_field(3)
|
|
367
|
+
|
|
368
|
+
|
|
362
369
|
@dataclass(eq=False, repr=False)
|
|
363
370
|
class PromptguardResponse(betterproto.Message):
|
|
364
371
|
input_safety_score: float = betterproto.float_field(1)
|
|
@@ -433,7 +440,7 @@ class EvaluationServiceStub(betterproto.ServiceStub):
|
|
|
433
440
|
|
|
434
441
|
async def evaluate_input(
|
|
435
442
|
self,
|
|
436
|
-
|
|
443
|
+
promptguard_request: "PromptguardRequest",
|
|
437
444
|
*,
|
|
438
445
|
timeout: Optional[float] = None,
|
|
439
446
|
deadline: Optional["Deadline"] = None,
|
|
@@ -441,7 +448,7 @@ class EvaluationServiceStub(betterproto.ServiceStub):
|
|
|
441
448
|
) -> "PromptguardResponse":
|
|
442
449
|
return await self._unary_unary(
|
|
443
450
|
"/chat.EvaluationService/EvaluateInput",
|
|
444
|
-
|
|
451
|
+
promptguard_request,
|
|
445
452
|
PromptguardResponse,
|
|
446
453
|
timeout=timeout,
|
|
447
454
|
deadline=deadline,
|
|
@@ -466,7 +473,7 @@ class EvaluationServiceBase(ServiceBase):
|
|
|
466
473
|
raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)
|
|
467
474
|
|
|
468
475
|
async def evaluate_input(
|
|
469
|
-
self,
|
|
476
|
+
self, promptguard_request: "PromptguardRequest"
|
|
470
477
|
) -> "PromptguardResponse":
|
|
471
478
|
raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)
|
|
472
479
|
|
|
@@ -496,8 +503,7 @@ class EvaluationServiceBase(ServiceBase):
|
|
|
496
503
|
await stream.send_message(response)
|
|
497
504
|
|
|
498
505
|
async def __rpc_evaluate_input(
|
|
499
|
-
self,
|
|
500
|
-
stream: "grpclib.server.Stream[ChatCompletionRequest, PromptguardResponse]",
|
|
506
|
+
self, stream: "grpclib.server.Stream[PromptguardRequest, PromptguardResponse]"
|
|
501
507
|
) -> None:
|
|
502
508
|
request = await stream.recv_message()
|
|
503
509
|
response = await self.evaluate_input(request)
|
|
@@ -526,7 +532,7 @@ class EvaluationServiceBase(ServiceBase):
|
|
|
526
532
|
"/chat.EvaluationService/EvaluateInput": grpclib.const.Handler(
|
|
527
533
|
self.__rpc_evaluate_input,
|
|
528
534
|
grpclib.const.Cardinality.UNARY_UNARY,
|
|
529
|
-
|
|
535
|
+
PromptguardRequest,
|
|
530
536
|
PromptguardResponse,
|
|
531
537
|
),
|
|
532
538
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{maitai_python-1.0.43b0 → maitai_python-1.1.0b1}/maitai_python.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|