diff --git a/README.md b/README.md index 05813f8..790daef 100644 --- a/README.md +++ b/README.md @@ -86,4 +86,3 @@ pip install --upgrade rapida-python ## Conclusion The Rapida Python SDK provides everything necessary to integrate seamlessly with Rapida AI services, offering flexible configuration and authentication options. With the examples provided, you should be able to get started quickly and make advanced API calls as needed. - diff --git a/pyproject.toml b/pyproject.toml index a28c1f5..b4649eb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "rapida-python" -version = "0.1.25" +version = "0.1.26" description = "RapidaAI SDK to integrate rapida.ai APIs" readme = "README.md" authors = [{name = "RapidaAI", email = "code@rapida.ai"}] @@ -58,4 +58,4 @@ packages = [ "rapida.clients.protos" = ["*.py"] [tool.setuptools.exclude-package-data] -"*" = ["tests", "examples"] \ No newline at end of file +"*" = ["tests", "examples"] diff --git a/rapida/__init__.py b/rapida/__init__.py index e8a469f..34b4b92 100644 --- a/rapida/__init__.py +++ b/rapida/__init__.py @@ -162,10 +162,8 @@ CreateBulkPhoneCallResponse, CreatePhoneCallRequest, CreatePhoneCallResponse, - AssistantTalkInput, - AssistantTalkOutput, - TalkInput, - TalkOutput, + AssistantTalkRequest, + AssistantTalkResponse, ConversationAssistantMessage, ConversationConfiguration, ConversationDirective, @@ -174,6 +172,10 @@ ConversationToolCall, ConversationToolResult ) +from rapida.clients.protos.agentkit_pb2 import ( + TalkInput, + TalkOutput, +) from rapida.clients.protos.assistant_analysis_pb2 import ( AssistantAnalysis, CreateAssistantAnalysisRequest, @@ -377,12 +379,14 @@ ) from rapida.clients.protos.talk_api_pb2_grpc import ( - TalkServiceServicer, + TalkServiceServicer, +) +from rapida.clients.protos.agentkit_pb2_grpc import ( AgentKitStub, AgentKit, AgentKitServicer, add_AgentKitServicer_to_server, - ) +) # Agent Kit classes from rapida.agentkit import ( @@ -703,8 +707,8 @@ "SSLConfig", "AuthConfig", "AuthorizationInterceptor", - "AssistantTalkInput", - "AssistantTalkOutput", + "AssistantTalkRequest", + "AssistantTalkResponse", "TalkInput", "TalkOutput", "ConversationAssistantMessage", diff --git a/rapida/agentkit/__init__.py b/rapida/agentkit/__init__.py index 6b02d69..ee15e08 100644 --- a/rapida/agentkit/__init__.py +++ b/rapida/agentkit/__init__.py @@ -33,20 +33,31 @@ - Tool execution - Conversation logic +Flow (mirrors the WebTalk/WebRTC flow): + 1. Rapida sends ConversationInitialization — always the first message. + Acknowledge it with initialization_response(). + 2. Rapida may send ConversationConfiguration to change stream mode. + Acknowledge it with configuration_response(). + 3. Rapida sends ConversationUserMessage for each user turn. + Reply with assistant_response() chunks. + Usage: from rapida import AgentKitServer, AgentKitAgent - + class MyAgent(AgentKitAgent): def Talk(self, request_iterator, context): for request in request_iterator: - if request.HasField("configuration"): + if request.HasField("initialization"): + # Always first — acknowledge and set up your session + yield self.initialization_response(request.initialization) + elif request.HasField("configuration"): yield self.configuration_response(request.configuration) elif request.HasField("message"): msg = request.message # Your LLM logic here yield self.assistant_response(msg.id, "Hello!", completed=False) yield self.assistant_response(msg.id, "Hello!", completed=True) - + server = AgentKitServer( agent=MyAgent(), port=50051, @@ -61,26 +72,27 @@ def Talk(self, request_iterator, context): import os from concurrent import futures from dataclasses import dataclass -from typing import Any, Callable, Dict, Iterator, Optional +from typing import Any, Callable, Dict, Optional import grpc from grpc import ServerInterceptor from rapida.clients.protos.talk_api_pb2 import ( + ConversationInitialization, ConversationConfiguration, ConversationAssistantMessage, ConversationDirective, ConversationToolCall, ConversationToolResult, ) -from rapida.clients.protos.talk_api_pb2 import ( +from rapida.clients.protos.agentkit_pb2 import ( TalkInput, TalkOutput, ) from rapida.clients.protos.common_pb2 import ( Error, ) -from rapida.clients.protos.talk_api_pb2_grpc import ( +from rapida.clients.protos.agentkit_pb2_grpc import ( AgentKitServicer, add_AgentKitServicer_to_server, ) @@ -164,6 +176,7 @@ def abort(ignored_request, context): context.abort( grpc.StatusCode.UNAUTHENTICATED, "Invalid authorization token" ) + return grpc.unary_unary_rpc_method_handler(abort) @@ -184,11 +197,20 @@ class AgentKitAgent(AgentKitServicer): Subclass this and implement Talk() with your LLM logic. + The message flow mirrors WebTalk/WebRTC: + 1. ConversationInitialization — always the first message. Acknowledge it. + 2. ConversationConfiguration — optional mode change. Acknowledge it. + 3. ConversationUserMessage — user turns. Reply with assistant_response(). + Example: class MyAgent(AgentKitAgent): def Talk(self, request_iterator, context): for request in request_iterator: - if request.HasField("configuration"): + if request.HasField("initialization"): + # Always first — set up your session here + conv_id = self.get_conversation_id(request) + yield self.initialization_response(request.initialization) + elif request.HasField("configuration"): yield self.configuration_response(request.configuration) elif request.HasField("message"): msg = request.message @@ -202,9 +224,7 @@ def Talk(self, request_iterator, context): # RESPONSE BUILDERS - Send data back to Rapida # ======================================================================== - def response( - self, code: int = 200, success: bool = True, **kwargs - ) -> TalkOutput: + def response(self, code: int = 200, success: bool = True, **kwargs) -> TalkOutput: """ Build a generic response to send back to Rapida. @@ -218,19 +238,41 @@ def response( """ return TalkOutput(code=code, success=success, **kwargs) + def initialization_response( + self, initialization: ConversationInitialization + ) -> TalkOutput: + """ + Acknowledge a ConversationInitialization from Rapida. + + This should always be the first response yielded in Talk(). + Rapida always sends initialization as the first message on the stream, + mirroring the WebTalk/WebRTC flow. + + Args: + initialization: The ConversationInitialization received from Rapida + + Returns: + TalkOutput acknowledging the initialization + """ + return self.response(initialization=initialization) + def configuration_response( - self, configuration: ConversationConfiguration + self, configuration: ConversationConfiguration = None ) -> TalkOutput: """ Acknowledge a configuration request from Rapida. + Note: TalkOutput has no configuration field in its data oneof, so this + sends a plain code-200 acknowledgement with no data payload. + Configuration changes do not carry a data ack in the AgentKit protocol. + Args: - configuration: The configuration received from the request + configuration: Unused; kept for API compatibility. Returns: - TalkOutput acknowledging the configuration + TalkOutput with code=200 and no data payload """ - return self.response(configuration=configuration) + return self.response() def assistant_response( self, msg_id: str, content: str, completed: bool = False @@ -295,13 +337,12 @@ def tool_call( for k, v in (args or {}).items(): _args[str(k)] = string_to_any(str(v)) - return self.response(tool=ConversationToolCall( - id=str(msg_id), - toolId=str(tool_id), - name=str(name), - args=_args - )) - + return self.response( + tool=ConversationToolCall( + id=str(msg_id), toolId=str(tool_id), name=str(name), args=_args + ) + ) + def tool_call_result( self, msg_id: str, tool_id: str, name: str, result: Any, success: bool = True ) -> TalkOutput: @@ -330,17 +371,17 @@ def tool_call_result( # For non-dict results, store under "result" key _args["result"] = string_to_any(str(result)) - return self.response(toolResult=ConversationToolResult( - id=str(msg_id), - toolId=str(tool_id), - name=str(name), - success=bool(success), - args=_args - )) + return self.response( + toolResult=ConversationToolResult( + id=str(msg_id), + toolId=str(tool_id), + name=str(name), + success=bool(success), + args=_args, + ) + ) - def transfer_call( - self, msg_id: str, args: Dict[str, Any] - ) -> TalkOutput: + def transfer_call(self, msg_id: str, args: Dict[str, Any]) -> TalkOutput: """ Send a transfer call directive back to Rapida. @@ -356,15 +397,15 @@ def transfer_call( for k, v in (args or {}).items(): _args[str(k)] = string_to_any(str(v)) - return self.response(directive=ConversationDirective( - id=str(msg_id), - type=ConversationDirective.TRANSFER_CONVERSATION, - args=_args - )) + return self.response( + directive=ConversationDirective( + id=str(msg_id), + type=ConversationDirective.TRANSFER_CONVERSATION, + args=_args, + ) + ) - def terminate_call( - self, msg_id: str, args: Dict[str, Any] - ) -> TalkOutput: + def terminate_call(self, msg_id: str, args: Dict[str, Any]) -> TalkOutput: """ Send a tool call that ends the conversation back to Rapida. @@ -381,11 +422,12 @@ def terminate_call( # Set map fields with Any values after construction for k, v in (args or {}).items(): _arg[str(k)] = string_to_any(str(v)) - - return self.response(directive=ConversationDirective( - id=str(msg_id), - type=ConversationDirective.END_CONVERSATION, - args=_arg)) + + return self.response( + directive=ConversationDirective( + id=str(msg_id), type=ConversationDirective.END_CONVERSATION, args=_arg + ) + ) # ======================================================================== # REQUEST HELPERS - Receive data from Rapida @@ -419,6 +461,40 @@ def get_message_id(self, request: TalkInput) -> Optional[str]: return request.message.id return None + def get_conversation_id(self, request: TalkInput) -> Optional[int]: + """ + Extract the conversation ID from an initialization request. + + Args: + request: The incoming initialization request from Rapida + + Returns: + Conversation ID, or None if not an initialization request + """ + if request.HasField("initialization"): + return request.initialization.assistantConversationId + return None + + def get_assistant_id(self, request: TalkInput) -> Optional[int]: + """ + Extract the assistant ID from an initialization request. + + Args: + request: The incoming initialization request from Rapida + + Returns: + Assistant ID, or None if not an initialization request or assistant is unset + """ + if request.HasField("initialization") and request.initialization.HasField( + "assistant" + ): + return request.initialization.assistant.assistantId + return None + + def is_initialization_request(self, request: TalkInput) -> bool: + """Check if request is the initial ConversationInitialization message.""" + return request.HasField("initialization") + def is_configuration_request(self, request: TalkInput) -> bool: """Check if request is a configuration request.""" return request.HasField("configuration") @@ -429,17 +505,11 @@ def is_message_request(self, request: TalkInput) -> bool: def is_text_message(self, request: TalkInput) -> bool: """Check if request is a text message.""" - return ( - request.HasField("message") - and request.message.HasField("text") - ) + return request.HasField("message") and request.message.HasField("text") def is_audio_message(self, request: TalkInput) -> bool: """Check if request is an audio message.""" - return ( - request.HasField("message") - and request.message.HasField("audio") - ) + return request.HasField("message") and request.message.HasField("audio") # ============================================================================ @@ -464,14 +534,17 @@ class AgentKitServer: class MyAgent(AgentKitAgent): def Talk(self, request_iterator, context): for request in request_iterator: - if self.is_configuration_request(request): + if self.is_initialization_request(request): + # Always first — set up your session here + yield self.initialization_response(request.initialization) + elif self.is_configuration_request(request): yield self.configuration_response(request.configuration) elif self.is_text_message(request): msg_id = self.get_message_id(request) text = self.get_user_text(request) # Your LLM logic here yield self.assistant_response(msg_id, "Hello!", completed=True) - + server = AgentKitServer(agent=MyAgent(), port=50051) server.start() server.wait_for_termination() diff --git a/rapida/clients/__init__.py b/rapida/clients/__init__.py index 71d7b0e..aebe1a0 100644 --- a/rapida/clients/__init__.py +++ b/rapida/clients/__init__.py @@ -18,4 +18,4 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. # -# Author: Prashant \ No newline at end of file +# Author: Prashant diff --git a/rapida/clients/protos/agentkit_pb2.py b/rapida/clients/protos/agentkit_pb2.py new file mode 100644 index 0000000..939ec28 --- /dev/null +++ b/rapida/clients/protos/agentkit_pb2.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: agentkit.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'agentkit.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +import rapida.clients.protos.common_pb2 as common__pb2 +import rapida.clients.protos.talk_api_pb2 as talk__api__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0e\x61gentkit.proto\x12\x08talk_api\x1a\x0c\x63ommon.proto\x1a\x0etalk-api.proto\"\xea\x02\n\tTalkInput\x12>\n\x0einitialization\x18\x01 \x01(\x0b\x32$.talk_api.ConversationInitializationH\x00\x12<\n\rconfiguration\x18\x02 \x01(\x0b\x32#.talk_api.ConversationConfigurationH\x00\x12\x34\n\x07message\x18\x03 \x01(\x0b\x32!.talk_api.ConversationUserMessageH\x00\x12:\n\x0cinterruption\x18\x04 \x01(\x0b\x32\".talk_api.ConversationInterruptionH\x00\x12\x32\n\x08metadata\x18\x05 \x01(\x0b\x32\x1e.talk_api.ConversationMetadataH\x00\x12.\n\x06metric\x18\x06 \x01(\x0b\x32\x1c.talk_api.ConversationMetricH\x00\x42\t\n\x07request\"\xa3\x03\n\nTalkOutput\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12>\n\x0einitialization\x18\t \x01(\x0b\x32$.talk_api.ConversationInitializationH\x00\x12:\n\x0cinterruption\x18\n \x01(\x0b\x32\".talk_api.ConversationInterruptionH\x00\x12;\n\tassistant\x18\x0c \x01(\x0b\x32&.talk_api.ConversationAssistantMessageH\x00\x12.\n\x04tool\x18\r \x01(\x0b\x32\x1e.talk_api.ConversationToolCallH\x00\x12\x36\n\ntoolResult\x18\x0e \x01(\x0b\x32 .talk_api.ConversationToolResultH\x00\x12\x34\n\tdirective\x18\x10 \x01(\x0b\x32\x1f.talk_api.ConversationDirectiveH\x00\x12\x17\n\x05\x65rror\x18\x0f \x01(\x0b\x32\x06.ErrorH\x00\x42\x06\n\x04\x64\x61ta2A\n\x08\x41gentKit\x12\x35\n\x04Talk\x12\x13.talk_api.TalkInput\x1a\x14.talk_api.TalkOutput(\x01\x30\x01\x42\x35\n\x17\x61i.rapida.sdk.artifactsZ\x1agithub.com/rapidaai/protosb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'agentkit_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\027ai.rapida.sdk.artifactsZ\032github.com/rapidaai/protos' + _globals['_TALKINPUT']._serialized_start=59 + _globals['_TALKINPUT']._serialized_end=421 + _globals['_TALKOUTPUT']._serialized_start=424 + _globals['_TALKOUTPUT']._serialized_end=843 + _globals['_AGENTKIT']._serialized_start=845 + _globals['_AGENTKIT']._serialized_end=910 +# @@protoc_insertion_point(module_scope) diff --git a/rapida/clients/protos/agentkit_pb2.pyi b/rapida/clients/protos/agentkit_pb2.pyi new file mode 100644 index 0000000..900a386 --- /dev/null +++ b/rapida/clients/protos/agentkit_pb2.pyi @@ -0,0 +1,46 @@ +import rapida.clients.protos.common_pb2 as _common_pb2 +import rapida.clients.protos.talk_api_pb2 as _talk_api_pb2 +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class TalkInput(_message.Message): + __slots__ = ("initialization", "configuration", "message", "interruption", "metadata", "metric") + INITIALIZATION_FIELD_NUMBER: _ClassVar[int] + CONFIGURATION_FIELD_NUMBER: _ClassVar[int] + MESSAGE_FIELD_NUMBER: _ClassVar[int] + INTERRUPTION_FIELD_NUMBER: _ClassVar[int] + METADATA_FIELD_NUMBER: _ClassVar[int] + METRIC_FIELD_NUMBER: _ClassVar[int] + initialization: _talk_api_pb2.ConversationInitialization + configuration: _talk_api_pb2.ConversationConfiguration + message: _talk_api_pb2.ConversationUserMessage + interruption: _talk_api_pb2.ConversationInterruption + metadata: _talk_api_pb2.ConversationMetadata + metric: _talk_api_pb2.ConversationMetric + def __init__(self, initialization: _Optional[_Union[_talk_api_pb2.ConversationInitialization, _Mapping]] = ..., configuration: _Optional[_Union[_talk_api_pb2.ConversationConfiguration, _Mapping]] = ..., message: _Optional[_Union[_talk_api_pb2.ConversationUserMessage, _Mapping]] = ..., interruption: _Optional[_Union[_talk_api_pb2.ConversationInterruption, _Mapping]] = ..., metadata: _Optional[_Union[_talk_api_pb2.ConversationMetadata, _Mapping]] = ..., metric: _Optional[_Union[_talk_api_pb2.ConversationMetric, _Mapping]] = ...) -> None: ... + +class TalkOutput(_message.Message): + __slots__ = ("code", "success", "initialization", "interruption", "assistant", "tool", "toolResult", "directive", "error") + CODE_FIELD_NUMBER: _ClassVar[int] + SUCCESS_FIELD_NUMBER: _ClassVar[int] + INITIALIZATION_FIELD_NUMBER: _ClassVar[int] + INTERRUPTION_FIELD_NUMBER: _ClassVar[int] + ASSISTANT_FIELD_NUMBER: _ClassVar[int] + TOOL_FIELD_NUMBER: _ClassVar[int] + TOOLRESULT_FIELD_NUMBER: _ClassVar[int] + DIRECTIVE_FIELD_NUMBER: _ClassVar[int] + ERROR_FIELD_NUMBER: _ClassVar[int] + code: int + success: bool + initialization: _talk_api_pb2.ConversationInitialization + interruption: _talk_api_pb2.ConversationInterruption + assistant: _talk_api_pb2.ConversationAssistantMessage + tool: _talk_api_pb2.ConversationToolCall + toolResult: _talk_api_pb2.ConversationToolResult + directive: _talk_api_pb2.ConversationDirective + error: _common_pb2.Error + def __init__(self, code: _Optional[int] = ..., success: bool = ..., initialization: _Optional[_Union[_talk_api_pb2.ConversationInitialization, _Mapping]] = ..., interruption: _Optional[_Union[_talk_api_pb2.ConversationInterruption, _Mapping]] = ..., assistant: _Optional[_Union[_talk_api_pb2.ConversationAssistantMessage, _Mapping]] = ..., tool: _Optional[_Union[_talk_api_pb2.ConversationToolCall, _Mapping]] = ..., toolResult: _Optional[_Union[_talk_api_pb2.ConversationToolResult, _Mapping]] = ..., directive: _Optional[_Union[_talk_api_pb2.ConversationDirective, _Mapping]] = ..., error: _Optional[_Union[_common_pb2.Error, _Mapping]] = ...) -> None: ... diff --git a/rapida/clients/protos/agentkit_pb2_grpc.py b/rapida/clients/protos/agentkit_pb2_grpc.py new file mode 100644 index 0000000..6f8f8ea --- /dev/null +++ b/rapida/clients/protos/agentkit_pb2_grpc.py @@ -0,0 +1,101 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + +import rapida.clients.protos.agentkit_pb2 as agentkit__pb2 + +GRPC_GENERATED_VERSION = '1.78.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in agentkit_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) + + +class AgentKitStub(object): + """AgentKit Service for internal agent messaging and orchestration. + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.Talk = channel.stream_stream( + '/talk_api.AgentKit/Talk', + request_serializer=agentkit__pb2.TalkInput.SerializeToString, + response_deserializer=agentkit__pb2.TalkOutput.FromString, + _registered_method=True) + + +class AgentKitServicer(object): + """AgentKit Service for internal agent messaging and orchestration. + """ + + def Talk(self, request_iterator, context): + """Bi-directional streaming RPC for agent communication + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_AgentKitServicer_to_server(servicer, server): + rpc_method_handlers = { + 'Talk': grpc.stream_stream_rpc_method_handler( + servicer.Talk, + request_deserializer=agentkit__pb2.TalkInput.FromString, + response_serializer=agentkit__pb2.TalkOutput.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'talk_api.AgentKit', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('talk_api.AgentKit', rpc_method_handlers) + + + # This class is part of an EXPERIMENTAL API. +class AgentKit(object): + """AgentKit Service for internal agent messaging and orchestration. + """ + + @staticmethod + def Talk(request_iterator, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.stream_stream( + request_iterator, + target, + '/talk_api.AgentKit/Talk', + agentkit__pb2.TalkInput.SerializeToString, + agentkit__pb2.TalkOutput.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/rapida/clients/protos/artifacts b/rapida/clients/protos/artifacts index 6472385..a08d746 160000 --- a/rapida/clients/protos/artifacts +++ b/rapida/clients/protos/artifacts @@ -1 +1 @@ -Subproject commit 64723856f2616fd78a6b7ca3ee1ae23b61273ed2 +Subproject commit a08d7469ccfc264d4da090f368e1e86a33822fbd diff --git a/rapida/clients/protos/assistant_analysis_pb2_grpc.py b/rapida/clients/protos/assistant_analysis_pb2_grpc.py index ca8428b..48d2085 100644 --- a/rapida/clients/protos/assistant_analysis_pb2_grpc.py +++ b/rapida/clients/protos/assistant_analysis_pb2_grpc.py @@ -4,7 +4,7 @@ import warnings -GRPC_GENERATED_VERSION = '1.74.0' +GRPC_GENERATED_VERSION = '1.78.0' GRPC_VERSION = grpc.__version__ _version_not_supported = False @@ -17,7 +17,7 @@ if _version_not_supported: raise RuntimeError( f'The grpc package installed is at version {GRPC_VERSION},' - + f' but the generated code in assistant_analysis_pb2_grpc.py depends on' + + ' but the generated code in assistant_analysis_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' diff --git a/rapida/clients/protos/assistant_api_pb2.py b/rapida/clients/protos/assistant_api_pb2.py index b692591..c62125a 100644 --- a/rapida/clients/protos/assistant_api_pb2.py +++ b/rapida/clients/protos/assistant_api_pb2.py @@ -32,7 +32,7 @@ import rapida.clients.protos.assistant_provider_pb2 as assistant__provider__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x13\x61ssistant-api.proto\x12\rassistant_api\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x0c\x63ommon.proto\x1a\x1a\x61ssistant-deployment.proto\x1a\x14\x61ssistant-tool.proto\x1a\x18\x61ssistant-analysis.proto\x1a\x17\x61ssistant-webhook.proto\x1a\x19\x61ssistant-knowledge.proto\x1a\x18\x61ssistant-provider.proto\"\xca\t\n\tAssistant\x12\x0e\n\x02id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x0e\n\x06status\x18\x02 \x01(\t\x12\x12\n\nvisibility\x18\x03 \x01(\t\x12\x0e\n\x06source\x18\x04 \x01(\t\x12\x1c\n\x10sourceIdentifier\x18\x05 \x01(\x04\x42\x02\x30\x01\x12\x15\n\tprojectId\x18\x07 \x01(\x04\x42\x02\x30\x01\x12\x1a\n\x0eorganizationId\x18\x08 \x01(\x04\x42\x02\x30\x01\x12\x19\n\x11\x61ssistantProvider\x18\t \x01(\t\x12\x1f\n\x13\x61ssistantProviderId\x18\n \x01(\x04\x42\x02\x30\x01\x12\x0c\n\x04name\x18\x0b \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x0c \x01(\t\x12\x45\n\x16\x61ssistantProviderModel\x18\x32 \x01(\x0b\x32%.assistant_api.AssistantProviderModel\x12K\n\x19\x61ssistantProviderAgentkit\x18\x33 \x01(\x0b\x32(.assistant_api.AssistantProviderAgentkit\x12M\n\x1a\x61ssistantProviderWebsocket\x18\x34 \x01(\x0b\x32).assistant_api.AssistantProviderWebsocket\x12\x1a\n\x0c\x61ssistantTag\x18\x0e \x01(\x0b\x32\x04.Tag\x12\x15\n\tcreatedBy\x18\x16 \x01(\x04\x42\x02\x30\x01\x12\x1a\n\x0b\x63reatedUser\x18\x17 \x01(\x0b\x32\x05.User\x12\x15\n\tupdatedBy\x18\x18 \x01(\x04\x42\x02\x30\x01\x12\x1a\n\x0bupdatedUser\x18\x19 \x01(\x0b\x32\x05.User\x12/\n\x0b\x63reatedDate\x18\x1a \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdatedDate\x18\x1b \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x46\n\x12\x64\x65\x62uggerDeployment\x18\x1e \x01(\x0b\x32*.assistant_api.AssistantDebuggerDeployment\x12@\n\x0fphoneDeployment\x18\x1f \x01(\x0b\x32\'.assistant_api.AssistantPhoneDeployment\x12\x46\n\x12whatsappDeployment\x18 \x01(\x0b\x32*.assistant_api.AssistantWhatsappDeployment\x12H\n\x13webPluginDeployment\x18! \x01(\x0b\x32+.assistant_api.AssistantWebpluginDeployment\x12<\n\rapiDeployment\x18\" \x01(\x0b\x32%.assistant_api.AssistantApiDeployment\x12\x36\n\x16\x61ssistantConversations\x18# \x03(\x0b\x32\x16.AssistantConversation\x12:\n\x11\x61ssistantWebhooks\x18$ \x03(\x0b\x32\x1f.assistant_api.AssistantWebhook\x12\x34\n\x0e\x61ssistantTools\x18% \x03(\x0b\x32\x1c.assistant_api.AssistantTool\"\xf7\x02\n\x16\x43reateAssistantRequest\x12H\n\x11\x61ssistantProvider\x18\x01 \x01(\x0b\x32-.assistant_api.CreateAssistantProviderRequest\x12K\n\x13\x61ssistantKnowledges\x18\x02 \x03(\x0b\x32..assistant_api.CreateAssistantKnowledgeRequest\x12\x41\n\x0e\x61ssistantTools\x18\x03 \x03(\x0b\x32).assistant_api.CreateAssistantToolRequest\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t\x12\x12\n\nvisibility\x18\x05 \x01(\t\x12\x10\n\x08language\x18\x06 \x01(\t\x12\x0e\n\x06source\x18\x07 \x01(\t\x12\x1c\n\x10sourceIdentifier\x18\x08 \x01(\x04\x42\x02\x30\x01\x12\x0c\n\x04tags\x18\t \x03(\t\x12\x0c\n\x04name\x18\n \x01(\t\"B\n\x19\x43reateAssistantTagRequest\x12\x17\n\x0b\x61ssistantId\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x0c\n\x04tags\x18\x02 \x03(\t\"H\n\x13GetAssistantRequest\x12\x31\n\x13\x61ssistantDefinition\x18\x01 \x01(\x0b\x32\x14.AssistantDefinition\"(\n\x16\x44\x65leteAssistantRequest\x12\x0e\n\x02id\x18\x01 \x01(\x04\x42\x02\x30\x01\"t\n\x14GetAssistantResponse\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12&\n\x04\x64\x61ta\x18\x03 \x01(\x0b\x32\x18.assistant_api.Assistant\x12\x15\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x06.Error\"S\n\x16GetAllAssistantRequest\x12\x1b\n\x08paginate\x18\x01 \x01(\x0b\x32\t.Paginate\x12\x1c\n\tcriterias\x18\x02 \x03(\x0b\x32\t.Criteria\"\x85\x01\n\x1fGetAllAssistantTelemetryRequest\x12\x1b\n\x08paginate\x18\x01 \x01(\x0b\x32\t.Paginate\x12\x1c\n\tcriterias\x18\x02 \x03(\x0b\x32\t.Criteria\x12\'\n\tassistant\x18\x03 \x01(\x0b\x32\x14.AssistantDefinition\"\x91\x01\n GetAllAssistantTelemetryResponse\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12\x18\n\x04\x64\x61ta\x18\x03 \x03(\x0b\x32\n.Telemetry\x12\x15\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x06.Error\x12\x1d\n\tpaginated\x18\x05 \x01(\x0b\x32\n.Paginated\"\x96\x01\n\x17GetAllAssistantResponse\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12&\n\x04\x64\x61ta\x18\x03 \x03(\x0b\x32\x18.assistant_api.Assistant\x12\x15\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x06.Error\x12\x1d\n\tpaginated\x18\x05 \x01(\x0b\x32\n.Paginated\"\xb0\x01\n\x1dGetAllAssistantMessageRequest\x12\x1b\n\x08paginate\x18\x01 \x01(\x0b\x32\t.Paginate\x12\x1c\n\tcriterias\x18\x02 \x03(\x0b\x32\t.Criteria\x12\x17\n\x0b\x61ssistantId\x18\x03 \x01(\x04\x42\x02\x30\x01\x12\x18\n\x05order\x18\x05 \x01(\x0b\x32\t.Ordering\x12!\n\tselectors\x18\x06 \x03(\x0b\x32\x0e.FieldSelector\"\xa2\x01\n\x1eGetAllAssistantMessageResponse\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12+\n\x04\x64\x61ta\x18\x03 \x03(\x0b\x32\x1d.AssistantConversationMessage\x12\x15\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x06.Error\x12\x1d\n\tpaginated\x18\x05 \x01(\x0b\x32\n.Paginated\"\x8e\x01\n\x14GetAllMessageRequest\x12\x1b\n\x08paginate\x18\x01 \x01(\x0b\x32\t.Paginate\x12\x1c\n\tcriterias\x18\x02 \x03(\x0b\x32\t.Criteria\x12\x18\n\x05order\x18\x05 \x01(\x0b\x32\t.Ordering\x12!\n\tselectors\x18\x06 \x03(\x0b\x32\x0e.FieldSelector\"\x99\x01\n\x15GetAllMessageResponse\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12+\n\x04\x64\x61ta\x18\x03 \x03(\x0b\x32\x1d.AssistantConversationMessage\x12\x15\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x06.Error\x12\x1d\n\tpaginated\x18\x05 \x01(\x0b\x32\n.Paginated\"Z\n\x1cUpdateAssistantDetailRequest\x12\x17\n\x0b\x61ssistantId\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\"m\n\x1fGetAssistantConversationRequest\x12\x17\n\x0b\x61ssistantId\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x0e\n\x02id\x18\x02 \x01(\x04\x42\x02\x30\x01\x12!\n\tselectors\x18\x05 \x03(\x0b\x32\x0e.FieldSelector\"~\n GetAssistantConversationResponse\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12$\n\x04\x64\x61ta\x18\x03 \x01(\x0b\x32\x16.AssistantConversation\x12\x15\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x06.Error2\xb4\"\n\x10\x41ssistantService\x12W\n\x0cGetAssistant\x12\".assistant_api.GetAssistantRequest\x1a#.assistant_api.GetAssistantResponse\x12`\n\x0fGetAllAssistant\x12%.assistant_api.GetAllAssistantRequest\x1a&.assistant_api.GetAllAssistantResponse\x12]\n\x0f\x43reateAssistant\x12%.assistant_api.CreateAssistantRequest\x1a#.assistant_api.GetAssistantResponse\x12]\n\x0f\x44\x65leteAssistant\x12%.assistant_api.DeleteAssistantRequest\x1a#.assistant_api.GetAssistantResponse\x12x\n\x17GetAllAssistantProvider\x12-.assistant_api.GetAllAssistantProviderRequest\x1a..assistant_api.GetAllAssistantProviderResponse\x12u\n\x17\x43reateAssistantProvider\x12-.assistant_api.CreateAssistantProviderRequest\x1a+.assistant_api.GetAssistantProviderResponse\x12\x63\n\x12\x43reateAssistantTag\x12(.assistant_api.CreateAssistantTagRequest\x1a#.assistant_api.GetAssistantResponse\x12k\n\x16UpdateAssistantVersion\x12,.assistant_api.UpdateAssistantVersionRequest\x1a#.assistant_api.GetAssistantResponse\x12i\n\x15UpdateAssistantDetail\x12+.assistant_api.UpdateAssistantDetailRequest\x1a#.assistant_api.GetAssistantResponse\x12u\n\x16GetAllAssistantMessage\x12,.assistant_api.GetAllAssistantMessageRequest\x1a-.assistant_api.GetAllAssistantMessageResponse\x12\x62\n\x19GetAllConversationMessage\x12!.GetAllConversationMessageRequest\x1a\".GetAllConversationMessageResponse\x12Z\n\rGetAllMessage\x12#.assistant_api.GetAllMessageRequest\x1a$.assistant_api.GetAllMessageResponse\x12{\n\x18GetAllAssistantTelemetry\x12..assistant_api.GetAllAssistantTelemetryRequest\x1a/.assistant_api.GetAllAssistantTelemetryResponse\x12h\n\x1bGetAllAssistantConversation\x12#.GetAllAssistantConversationRequest\x1a$.GetAllAssistantConversationResponse\x12{\n\x18GetAssistantConversation\x12..assistant_api.GetAssistantConversationRequest\x1a/.assistant_api.GetAssistantConversationResponse\x12u\n\x16GetAssistantWebhookLog\x12,.assistant_api.GetAssistantWebhookLogRequest\x1a-.assistant_api.GetAssistantWebhookLogResponse\x12~\n\x19GetAllAssistantWebhookLog\x12/.assistant_api.GetAllAssistantWebhookLogRequest\x1a\x30.assistant_api.GetAllAssistantWebhookLogResponse\x12u\n\x16GetAllAssistantWebhook\x12,.assistant_api.GetAllAssistantWebhookRequest\x1a-.assistant_api.GetAllAssistantWebhookResponse\x12l\n\x13GetAssistantWebhook\x12).assistant_api.GetAssistantWebhookRequest\x1a*.assistant_api.GetAssistantWebhookResponse\x12r\n\x16\x43reateAssistantWebhook\x12,.assistant_api.CreateAssistantWebhookRequest\x1a*.assistant_api.GetAssistantWebhookResponse\x12r\n\x16UpdateAssistantWebhook\x12,.assistant_api.UpdateAssistantWebhookRequest\x1a*.assistant_api.GetAssistantWebhookResponse\x12r\n\x16\x44\x65leteAssistantWebhook\x12,.assistant_api.DeleteAssistantWebhookRequest\x1a*.assistant_api.GetAssistantWebhookResponse\x12l\n\x13GetAssistantToolLog\x12).assistant_api.GetAssistantToolLogRequest\x1a*.assistant_api.GetAssistantToolLogResponse\x12u\n\x16GetAllAssistantToolLog\x12,.assistant_api.GetAllAssistantToolLogRequest\x1a-.assistant_api.GetAllAssistantToolLogResponse\x12o\n\x14GetAssistantAnalysis\x12*.assistant_api.GetAssistantAnalysisRequest\x1a+.assistant_api.GetAssistantAnalysisResponse\x12u\n\x17UpdateAssistantAnalysis\x12-.assistant_api.UpdateAssistantAnalysisRequest\x1a+.assistant_api.GetAssistantAnalysisResponse\x12u\n\x17\x43reateAssistantAnalysis\x12-.assistant_api.CreateAssistantAnalysisRequest\x1a+.assistant_api.GetAssistantAnalysisResponse\x12u\n\x17\x44\x65leteAssistantAnalysis\x12-.assistant_api.DeleteAssistantAnalysisRequest\x1a+.assistant_api.GetAssistantAnalysisResponse\x12x\n\x17GetAllAssistantAnalysis\x12-.assistant_api.GetAllAssistantAnalysisRequest\x1a..assistant_api.GetAllAssistantAnalysisResponse\x12i\n\x13\x43reateAssistantTool\x12).assistant_api.CreateAssistantToolRequest\x1a\'.assistant_api.GetAssistantToolResponse\x12\x63\n\x10GetAssistantTool\x12&.assistant_api.GetAssistantToolRequest\x1a\'.assistant_api.GetAssistantToolResponse\x12l\n\x13GetAllAssistantTool\x12).assistant_api.GetAllAssistantToolRequest\x1a*.assistant_api.GetAllAssistantToolResponse\x12i\n\x13\x44\x65leteAssistantTool\x12).assistant_api.DeleteAssistantToolRequest\x1a\'.assistant_api.GetAssistantToolResponse\x12i\n\x13UpdateAssistantTool\x12).assistant_api.UpdateAssistantToolRequest\x1a\'.assistant_api.GetAssistantToolResponse\x12x\n\x18\x43reateAssistantKnowledge\x12..assistant_api.CreateAssistantKnowledgeRequest\x1a,.assistant_api.GetAssistantKnowledgeResponse\x12r\n\x15GetAssistantKnowledge\x12+.assistant_api.GetAssistantKnowledgeRequest\x1a,.assistant_api.GetAssistantKnowledgeResponse\x12{\n\x18GetAllAssistantKnowledge\x12..assistant_api.GetAllAssistantKnowledgeRequest\x1a/.assistant_api.GetAllAssistantKnowledgeResponse\x12x\n\x18\x44\x65leteAssistantKnowledge\x12..assistant_api.DeleteAssistantKnowledgeRequest\x1a,.assistant_api.GetAssistantKnowledgeResponse\x12x\n\x18UpdateAssistantKnowledge\x12..assistant_api.UpdateAssistantKnowledgeRequest\x1a,.assistant_api.GetAssistantKnowledgeResponseB\x1cZ\x1agithub.com/rapidaai/protosb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x13\x61ssistant-api.proto\x12\rassistant_api\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x0c\x63ommon.proto\x1a\x1a\x61ssistant-deployment.proto\x1a\x14\x61ssistant-tool.proto\x1a\x18\x61ssistant-analysis.proto\x1a\x17\x61ssistant-webhook.proto\x1a\x19\x61ssistant-knowledge.proto\x1a\x18\x61ssistant-provider.proto\"\xca\t\n\tAssistant\x12\x0e\n\x02id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x0e\n\x06status\x18\x02 \x01(\t\x12\x12\n\nvisibility\x18\x03 \x01(\t\x12\x0e\n\x06source\x18\x04 \x01(\t\x12\x1c\n\x10sourceIdentifier\x18\x05 \x01(\x04\x42\x02\x30\x01\x12\x15\n\tprojectId\x18\x07 \x01(\x04\x42\x02\x30\x01\x12\x1a\n\x0eorganizationId\x18\x08 \x01(\x04\x42\x02\x30\x01\x12\x19\n\x11\x61ssistantProvider\x18\t \x01(\t\x12\x1f\n\x13\x61ssistantProviderId\x18\n \x01(\x04\x42\x02\x30\x01\x12\x0c\n\x04name\x18\x0b \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x0c \x01(\t\x12\x45\n\x16\x61ssistantProviderModel\x18\x32 \x01(\x0b\x32%.assistant_api.AssistantProviderModel\x12K\n\x19\x61ssistantProviderAgentkit\x18\x33 \x01(\x0b\x32(.assistant_api.AssistantProviderAgentkit\x12M\n\x1a\x61ssistantProviderWebsocket\x18\x34 \x01(\x0b\x32).assistant_api.AssistantProviderWebsocket\x12\x1a\n\x0c\x61ssistantTag\x18\x0e \x01(\x0b\x32\x04.Tag\x12\x15\n\tcreatedBy\x18\x16 \x01(\x04\x42\x02\x30\x01\x12\x1a\n\x0b\x63reatedUser\x18\x17 \x01(\x0b\x32\x05.User\x12\x15\n\tupdatedBy\x18\x18 \x01(\x04\x42\x02\x30\x01\x12\x1a\n\x0bupdatedUser\x18\x19 \x01(\x0b\x32\x05.User\x12/\n\x0b\x63reatedDate\x18\x1a \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdatedDate\x18\x1b \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x46\n\x12\x64\x65\x62uggerDeployment\x18\x1e \x01(\x0b\x32*.assistant_api.AssistantDebuggerDeployment\x12@\n\x0fphoneDeployment\x18\x1f \x01(\x0b\x32\'.assistant_api.AssistantPhoneDeployment\x12\x46\n\x12whatsappDeployment\x18 \x01(\x0b\x32*.assistant_api.AssistantWhatsappDeployment\x12H\n\x13webPluginDeployment\x18! \x01(\x0b\x32+.assistant_api.AssistantWebpluginDeployment\x12<\n\rapiDeployment\x18\" \x01(\x0b\x32%.assistant_api.AssistantApiDeployment\x12\x36\n\x16\x61ssistantConversations\x18# \x03(\x0b\x32\x16.AssistantConversation\x12:\n\x11\x61ssistantWebhooks\x18$ \x03(\x0b\x32\x1f.assistant_api.AssistantWebhook\x12\x34\n\x0e\x61ssistantTools\x18% \x03(\x0b\x32\x1c.assistant_api.AssistantTool\"\xf7\x02\n\x16\x43reateAssistantRequest\x12H\n\x11\x61ssistantProvider\x18\x01 \x01(\x0b\x32-.assistant_api.CreateAssistantProviderRequest\x12K\n\x13\x61ssistantKnowledges\x18\x02 \x03(\x0b\x32..assistant_api.CreateAssistantKnowledgeRequest\x12\x41\n\x0e\x61ssistantTools\x18\x03 \x03(\x0b\x32).assistant_api.CreateAssistantToolRequest\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t\x12\x12\n\nvisibility\x18\x05 \x01(\t\x12\x10\n\x08language\x18\x06 \x01(\t\x12\x0e\n\x06source\x18\x07 \x01(\t\x12\x1c\n\x10sourceIdentifier\x18\x08 \x01(\x04\x42\x02\x30\x01\x12\x0c\n\x04tags\x18\t \x03(\t\x12\x0c\n\x04name\x18\n \x01(\t\"B\n\x19\x43reateAssistantTagRequest\x12\x17\n\x0b\x61ssistantId\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x0c\n\x04tags\x18\x02 \x03(\t\"H\n\x13GetAssistantRequest\x12\x31\n\x13\x61ssistantDefinition\x18\x01 \x01(\x0b\x32\x14.AssistantDefinition\"(\n\x16\x44\x65leteAssistantRequest\x12\x0e\n\x02id\x18\x01 \x01(\x04\x42\x02\x30\x01\"t\n\x14GetAssistantResponse\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12&\n\x04\x64\x61ta\x18\x03 \x01(\x0b\x32\x18.assistant_api.Assistant\x12\x15\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x06.Error\"S\n\x16GetAllAssistantRequest\x12\x1b\n\x08paginate\x18\x01 \x01(\x0b\x32\t.Paginate\x12\x1c\n\tcriterias\x18\x02 \x03(\x0b\x32\t.Criteria\"\x85\x01\n\x1fGetAllAssistantTelemetryRequest\x12\x1b\n\x08paginate\x18\x01 \x01(\x0b\x32\t.Paginate\x12\x1c\n\tcriterias\x18\x02 \x03(\x0b\x32\t.Criteria\x12\'\n\tassistant\x18\x03 \x01(\x0b\x32\x14.AssistantDefinition\"\xb0\x02\n\x0eTelemetryEvent\x12\x11\n\tmessageId\x18\x01 \x01(\t\x12\x17\n\x0b\x61ssistantId\x18\x02 \x01(\x04\x42\x02\x30\x01\x12#\n\x17\x61ssistantConversationId\x18\x03 \x01(\x04\x42\x02\x30\x01\x12\x15\n\tprojectId\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\x1a\n\x0eorganizationId\x18\x05 \x01(\x04\x42\x02\x30\x01\x12\x0c\n\x04name\x18\x06 \x01(\t\x12\x35\n\x04\x64\x61ta\x18\x07 \x03(\x0b\x32\'.assistant_api.TelemetryEvent.DataEntry\x12(\n\x04time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a+\n\tDataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xe8\x01\n\x0fTelemetryMetric\x12\x11\n\tcontextId\x18\x01 \x01(\t\x12\x17\n\x0b\x61ssistantId\x18\x02 \x01(\x04\x42\x02\x30\x01\x12#\n\x17\x61ssistantConversationId\x18\x03 \x01(\x04\x42\x02\x30\x01\x12\x15\n\tprojectId\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\x1a\n\x0eorganizationId\x18\x05 \x01(\x04\x42\x02\x30\x01\x12\r\n\x05scope\x18\x06 \x01(\t\x12\x18\n\x07metrics\x18\x07 \x03(\x0b\x32\x07.Metric\x12(\n\x04time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"}\n\x0fTelemetryRecord\x12.\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x1d.assistant_api.TelemetryEventH\x00\x12\x30\n\x06metric\x18\x02 \x01(\x0b\x32\x1e.assistant_api.TelemetryMetricH\x00\x42\x08\n\x06record\"\xa5\x01\n GetAllAssistantTelemetryResponse\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12,\n\x04\x64\x61ta\x18\x03 \x03(\x0b\x32\x1e.assistant_api.TelemetryRecord\x12\x15\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x06.Error\x12\x1d\n\tpaginated\x18\x05 \x01(\x0b\x32\n.Paginated\"\x96\x01\n\x17GetAllAssistantResponse\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12&\n\x04\x64\x61ta\x18\x03 \x03(\x0b\x32\x18.assistant_api.Assistant\x12\x15\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x06.Error\x12\x1d\n\tpaginated\x18\x05 \x01(\x0b\x32\n.Paginated\"\xb0\x01\n\x1dGetAllAssistantMessageRequest\x12\x1b\n\x08paginate\x18\x01 \x01(\x0b\x32\t.Paginate\x12\x1c\n\tcriterias\x18\x02 \x03(\x0b\x32\t.Criteria\x12\x17\n\x0b\x61ssistantId\x18\x03 \x01(\x04\x42\x02\x30\x01\x12\x18\n\x05order\x18\x05 \x01(\x0b\x32\t.Ordering\x12!\n\tselectors\x18\x06 \x03(\x0b\x32\x0e.FieldSelector\"\xa2\x01\n\x1eGetAllAssistantMessageResponse\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12+\n\x04\x64\x61ta\x18\x03 \x03(\x0b\x32\x1d.AssistantConversationMessage\x12\x15\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x06.Error\x12\x1d\n\tpaginated\x18\x05 \x01(\x0b\x32\n.Paginated\"\x8e\x01\n\x14GetAllMessageRequest\x12\x1b\n\x08paginate\x18\x01 \x01(\x0b\x32\t.Paginate\x12\x1c\n\tcriterias\x18\x02 \x03(\x0b\x32\t.Criteria\x12\x18\n\x05order\x18\x05 \x01(\x0b\x32\t.Ordering\x12!\n\tselectors\x18\x06 \x03(\x0b\x32\x0e.FieldSelector\"\x99\x01\n\x15GetAllMessageResponse\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12+\n\x04\x64\x61ta\x18\x03 \x03(\x0b\x32\x1d.AssistantConversationMessage\x12\x15\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x06.Error\x12\x1d\n\tpaginated\x18\x05 \x01(\x0b\x32\n.Paginated\"Z\n\x1cUpdateAssistantDetailRequest\x12\x17\n\x0b\x61ssistantId\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\"m\n\x1fGetAssistantConversationRequest\x12\x17\n\x0b\x61ssistantId\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x0e\n\x02id\x18\x02 \x01(\x04\x42\x02\x30\x01\x12!\n\tselectors\x18\x05 \x03(\x0b\x32\x0e.FieldSelector\"~\n GetAssistantConversationResponse\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12$\n\x04\x64\x61ta\x18\x03 \x01(\x0b\x32\x16.AssistantConversation\x12\x15\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x06.Error2\xb4\"\n\x10\x41ssistantService\x12W\n\x0cGetAssistant\x12\".assistant_api.GetAssistantRequest\x1a#.assistant_api.GetAssistantResponse\x12`\n\x0fGetAllAssistant\x12%.assistant_api.GetAllAssistantRequest\x1a&.assistant_api.GetAllAssistantResponse\x12]\n\x0f\x43reateAssistant\x12%.assistant_api.CreateAssistantRequest\x1a#.assistant_api.GetAssistantResponse\x12]\n\x0f\x44\x65leteAssistant\x12%.assistant_api.DeleteAssistantRequest\x1a#.assistant_api.GetAssistantResponse\x12x\n\x17GetAllAssistantProvider\x12-.assistant_api.GetAllAssistantProviderRequest\x1a..assistant_api.GetAllAssistantProviderResponse\x12u\n\x17\x43reateAssistantProvider\x12-.assistant_api.CreateAssistantProviderRequest\x1a+.assistant_api.GetAssistantProviderResponse\x12\x63\n\x12\x43reateAssistantTag\x12(.assistant_api.CreateAssistantTagRequest\x1a#.assistant_api.GetAssistantResponse\x12k\n\x16UpdateAssistantVersion\x12,.assistant_api.UpdateAssistantVersionRequest\x1a#.assistant_api.GetAssistantResponse\x12i\n\x15UpdateAssistantDetail\x12+.assistant_api.UpdateAssistantDetailRequest\x1a#.assistant_api.GetAssistantResponse\x12u\n\x16GetAllAssistantMessage\x12,.assistant_api.GetAllAssistantMessageRequest\x1a-.assistant_api.GetAllAssistantMessageResponse\x12\x62\n\x19GetAllConversationMessage\x12!.GetAllConversationMessageRequest\x1a\".GetAllConversationMessageResponse\x12Z\n\rGetAllMessage\x12#.assistant_api.GetAllMessageRequest\x1a$.assistant_api.GetAllMessageResponse\x12{\n\x18GetAllAssistantTelemetry\x12..assistant_api.GetAllAssistantTelemetryRequest\x1a/.assistant_api.GetAllAssistantTelemetryResponse\x12h\n\x1bGetAllAssistantConversation\x12#.GetAllAssistantConversationRequest\x1a$.GetAllAssistantConversationResponse\x12{\n\x18GetAssistantConversation\x12..assistant_api.GetAssistantConversationRequest\x1a/.assistant_api.GetAssistantConversationResponse\x12u\n\x16GetAssistantWebhookLog\x12,.assistant_api.GetAssistantWebhookLogRequest\x1a-.assistant_api.GetAssistantWebhookLogResponse\x12~\n\x19GetAllAssistantWebhookLog\x12/.assistant_api.GetAllAssistantWebhookLogRequest\x1a\x30.assistant_api.GetAllAssistantWebhookLogResponse\x12u\n\x16GetAllAssistantWebhook\x12,.assistant_api.GetAllAssistantWebhookRequest\x1a-.assistant_api.GetAllAssistantWebhookResponse\x12l\n\x13GetAssistantWebhook\x12).assistant_api.GetAssistantWebhookRequest\x1a*.assistant_api.GetAssistantWebhookResponse\x12r\n\x16\x43reateAssistantWebhook\x12,.assistant_api.CreateAssistantWebhookRequest\x1a*.assistant_api.GetAssistantWebhookResponse\x12r\n\x16UpdateAssistantWebhook\x12,.assistant_api.UpdateAssistantWebhookRequest\x1a*.assistant_api.GetAssistantWebhookResponse\x12r\n\x16\x44\x65leteAssistantWebhook\x12,.assistant_api.DeleteAssistantWebhookRequest\x1a*.assistant_api.GetAssistantWebhookResponse\x12l\n\x13GetAssistantToolLog\x12).assistant_api.GetAssistantToolLogRequest\x1a*.assistant_api.GetAssistantToolLogResponse\x12u\n\x16GetAllAssistantToolLog\x12,.assistant_api.GetAllAssistantToolLogRequest\x1a-.assistant_api.GetAllAssistantToolLogResponse\x12o\n\x14GetAssistantAnalysis\x12*.assistant_api.GetAssistantAnalysisRequest\x1a+.assistant_api.GetAssistantAnalysisResponse\x12u\n\x17UpdateAssistantAnalysis\x12-.assistant_api.UpdateAssistantAnalysisRequest\x1a+.assistant_api.GetAssistantAnalysisResponse\x12u\n\x17\x43reateAssistantAnalysis\x12-.assistant_api.CreateAssistantAnalysisRequest\x1a+.assistant_api.GetAssistantAnalysisResponse\x12u\n\x17\x44\x65leteAssistantAnalysis\x12-.assistant_api.DeleteAssistantAnalysisRequest\x1a+.assistant_api.GetAssistantAnalysisResponse\x12x\n\x17GetAllAssistantAnalysis\x12-.assistant_api.GetAllAssistantAnalysisRequest\x1a..assistant_api.GetAllAssistantAnalysisResponse\x12i\n\x13\x43reateAssistantTool\x12).assistant_api.CreateAssistantToolRequest\x1a\'.assistant_api.GetAssistantToolResponse\x12\x63\n\x10GetAssistantTool\x12&.assistant_api.GetAssistantToolRequest\x1a\'.assistant_api.GetAssistantToolResponse\x12l\n\x13GetAllAssistantTool\x12).assistant_api.GetAllAssistantToolRequest\x1a*.assistant_api.GetAllAssistantToolResponse\x12i\n\x13\x44\x65leteAssistantTool\x12).assistant_api.DeleteAssistantToolRequest\x1a\'.assistant_api.GetAssistantToolResponse\x12i\n\x13UpdateAssistantTool\x12).assistant_api.UpdateAssistantToolRequest\x1a\'.assistant_api.GetAssistantToolResponse\x12x\n\x18\x43reateAssistantKnowledge\x12..assistant_api.CreateAssistantKnowledgeRequest\x1a,.assistant_api.GetAssistantKnowledgeResponse\x12r\n\x15GetAssistantKnowledge\x12+.assistant_api.GetAssistantKnowledgeRequest\x1a,.assistant_api.GetAssistantKnowledgeResponse\x12{\n\x18GetAllAssistantKnowledge\x12..assistant_api.GetAllAssistantKnowledgeRequest\x1a/.assistant_api.GetAllAssistantKnowledgeResponse\x12x\n\x18\x44\x65leteAssistantKnowledge\x12..assistant_api.DeleteAssistantKnowledgeRequest\x1a,.assistant_api.GetAssistantKnowledgeResponse\x12x\n\x18UpdateAssistantKnowledge\x12..assistant_api.UpdateAssistantKnowledgeRequest\x1a,.assistant_api.GetAssistantKnowledgeResponseB\x1cZ\x1agithub.com/rapidaai/protosb\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -60,6 +60,24 @@ _globals['_CREATEASSISTANTTAGREQUEST'].fields_by_name['assistantId']._serialized_options = b'0\001' _globals['_DELETEASSISTANTREQUEST'].fields_by_name['id']._loaded_options = None _globals['_DELETEASSISTANTREQUEST'].fields_by_name['id']._serialized_options = b'0\001' + _globals['_TELEMETRYEVENT_DATAENTRY']._loaded_options = None + _globals['_TELEMETRYEVENT_DATAENTRY']._serialized_options = b'8\001' + _globals['_TELEMETRYEVENT'].fields_by_name['assistantId']._loaded_options = None + _globals['_TELEMETRYEVENT'].fields_by_name['assistantId']._serialized_options = b'0\001' + _globals['_TELEMETRYEVENT'].fields_by_name['assistantConversationId']._loaded_options = None + _globals['_TELEMETRYEVENT'].fields_by_name['assistantConversationId']._serialized_options = b'0\001' + _globals['_TELEMETRYEVENT'].fields_by_name['projectId']._loaded_options = None + _globals['_TELEMETRYEVENT'].fields_by_name['projectId']._serialized_options = b'0\001' + _globals['_TELEMETRYEVENT'].fields_by_name['organizationId']._loaded_options = None + _globals['_TELEMETRYEVENT'].fields_by_name['organizationId']._serialized_options = b'0\001' + _globals['_TELEMETRYMETRIC'].fields_by_name['assistantId']._loaded_options = None + _globals['_TELEMETRYMETRIC'].fields_by_name['assistantId']._serialized_options = b'0\001' + _globals['_TELEMETRYMETRIC'].fields_by_name['assistantConversationId']._loaded_options = None + _globals['_TELEMETRYMETRIC'].fields_by_name['assistantConversationId']._serialized_options = b'0\001' + _globals['_TELEMETRYMETRIC'].fields_by_name['projectId']._loaded_options = None + _globals['_TELEMETRYMETRIC'].fields_by_name['projectId']._serialized_options = b'0\001' + _globals['_TELEMETRYMETRIC'].fields_by_name['organizationId']._loaded_options = None + _globals['_TELEMETRYMETRIC'].fields_by_name['organizationId']._serialized_options = b'0\001' _globals['_GETALLASSISTANTMESSAGEREQUEST'].fields_by_name['assistantId']._loaded_options = None _globals['_GETALLASSISTANTMESSAGEREQUEST'].fields_by_name['assistantId']._serialized_options = b'0\001' _globals['_UPDATEASSISTANTDETAILREQUEST'].fields_by_name['assistantId']._loaded_options = None @@ -84,24 +102,32 @@ _globals['_GETALLASSISTANTREQUEST']._serialized_end=2231 _globals['_GETALLASSISTANTTELEMETRYREQUEST']._serialized_start=2234 _globals['_GETALLASSISTANTTELEMETRYREQUEST']._serialized_end=2367 - _globals['_GETALLASSISTANTTELEMETRYRESPONSE']._serialized_start=2370 - _globals['_GETALLASSISTANTTELEMETRYRESPONSE']._serialized_end=2515 - _globals['_GETALLASSISTANTRESPONSE']._serialized_start=2518 - _globals['_GETALLASSISTANTRESPONSE']._serialized_end=2668 - _globals['_GETALLASSISTANTMESSAGEREQUEST']._serialized_start=2671 - _globals['_GETALLASSISTANTMESSAGEREQUEST']._serialized_end=2847 - _globals['_GETALLASSISTANTMESSAGERESPONSE']._serialized_start=2850 - _globals['_GETALLASSISTANTMESSAGERESPONSE']._serialized_end=3012 - _globals['_GETALLMESSAGEREQUEST']._serialized_start=3015 - _globals['_GETALLMESSAGEREQUEST']._serialized_end=3157 - _globals['_GETALLMESSAGERESPONSE']._serialized_start=3160 - _globals['_GETALLMESSAGERESPONSE']._serialized_end=3313 - _globals['_UPDATEASSISTANTDETAILREQUEST']._serialized_start=3315 - _globals['_UPDATEASSISTANTDETAILREQUEST']._serialized_end=3405 - _globals['_GETASSISTANTCONVERSATIONREQUEST']._serialized_start=3407 - _globals['_GETASSISTANTCONVERSATIONREQUEST']._serialized_end=3516 - _globals['_GETASSISTANTCONVERSATIONRESPONSE']._serialized_start=3518 - _globals['_GETASSISTANTCONVERSATIONRESPONSE']._serialized_end=3644 - _globals['_ASSISTANTSERVICE']._serialized_start=3647 - _globals['_ASSISTANTSERVICE']._serialized_end=8051 + _globals['_TELEMETRYEVENT']._serialized_start=2370 + _globals['_TELEMETRYEVENT']._serialized_end=2674 + _globals['_TELEMETRYEVENT_DATAENTRY']._serialized_start=2631 + _globals['_TELEMETRYEVENT_DATAENTRY']._serialized_end=2674 + _globals['_TELEMETRYMETRIC']._serialized_start=2677 + _globals['_TELEMETRYMETRIC']._serialized_end=2909 + _globals['_TELEMETRYRECORD']._serialized_start=2911 + _globals['_TELEMETRYRECORD']._serialized_end=3036 + _globals['_GETALLASSISTANTTELEMETRYRESPONSE']._serialized_start=3039 + _globals['_GETALLASSISTANTTELEMETRYRESPONSE']._serialized_end=3204 + _globals['_GETALLASSISTANTRESPONSE']._serialized_start=3207 + _globals['_GETALLASSISTANTRESPONSE']._serialized_end=3357 + _globals['_GETALLASSISTANTMESSAGEREQUEST']._serialized_start=3360 + _globals['_GETALLASSISTANTMESSAGEREQUEST']._serialized_end=3536 + _globals['_GETALLASSISTANTMESSAGERESPONSE']._serialized_start=3539 + _globals['_GETALLASSISTANTMESSAGERESPONSE']._serialized_end=3701 + _globals['_GETALLMESSAGEREQUEST']._serialized_start=3704 + _globals['_GETALLMESSAGEREQUEST']._serialized_end=3846 + _globals['_GETALLMESSAGERESPONSE']._serialized_start=3849 + _globals['_GETALLMESSAGERESPONSE']._serialized_end=4002 + _globals['_UPDATEASSISTANTDETAILREQUEST']._serialized_start=4004 + _globals['_UPDATEASSISTANTDETAILREQUEST']._serialized_end=4094 + _globals['_GETASSISTANTCONVERSATIONREQUEST']._serialized_start=4096 + _globals['_GETASSISTANTCONVERSATIONREQUEST']._serialized_end=4205 + _globals['_GETASSISTANTCONVERSATIONRESPONSE']._serialized_start=4207 + _globals['_GETASSISTANTCONVERSATIONRESPONSE']._serialized_end=4333 + _globals['_ASSISTANTSERVICE']._serialized_start=4336 + _globals['_ASSISTANTSERVICE']._serialized_end=8740 # @@protoc_insertion_point(module_scope) diff --git a/rapida/clients/protos/assistant_api_pb2.pyi b/rapida/clients/protos/assistant_api_pb2.pyi index 95f395f..a4071f0 100644 --- a/rapida/clients/protos/assistant_api_pb2.pyi +++ b/rapida/clients/protos/assistant_api_pb2.pyi @@ -152,6 +152,61 @@ class GetAllAssistantTelemetryRequest(_message.Message): assistant: _common_pb2.AssistantDefinition def __init__(self, paginate: _Optional[_Union[_common_pb2.Paginate, _Mapping]] = ..., criterias: _Optional[_Iterable[_Union[_common_pb2.Criteria, _Mapping]]] = ..., assistant: _Optional[_Union[_common_pb2.AssistantDefinition, _Mapping]] = ...) -> None: ... +class TelemetryEvent(_message.Message): + __slots__ = ("messageId", "assistantId", "assistantConversationId", "projectId", "organizationId", "name", "data", "time") + class DataEntry(_message.Message): + __slots__ = ("key", "value") + KEY_FIELD_NUMBER: _ClassVar[int] + VALUE_FIELD_NUMBER: _ClassVar[int] + key: str + value: str + def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ... + MESSAGEID_FIELD_NUMBER: _ClassVar[int] + ASSISTANTID_FIELD_NUMBER: _ClassVar[int] + ASSISTANTCONVERSATIONID_FIELD_NUMBER: _ClassVar[int] + PROJECTID_FIELD_NUMBER: _ClassVar[int] + ORGANIZATIONID_FIELD_NUMBER: _ClassVar[int] + NAME_FIELD_NUMBER: _ClassVar[int] + DATA_FIELD_NUMBER: _ClassVar[int] + TIME_FIELD_NUMBER: _ClassVar[int] + messageId: str + assistantId: int + assistantConversationId: int + projectId: int + organizationId: int + name: str + data: _containers.ScalarMap[str, str] + time: _timestamp_pb2.Timestamp + def __init__(self, messageId: _Optional[str] = ..., assistantId: _Optional[int] = ..., assistantConversationId: _Optional[int] = ..., projectId: _Optional[int] = ..., organizationId: _Optional[int] = ..., name: _Optional[str] = ..., data: _Optional[_Mapping[str, str]] = ..., time: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ...) -> None: ... + +class TelemetryMetric(_message.Message): + __slots__ = ("contextId", "assistantId", "assistantConversationId", "projectId", "organizationId", "scope", "metrics", "time") + CONTEXTID_FIELD_NUMBER: _ClassVar[int] + ASSISTANTID_FIELD_NUMBER: _ClassVar[int] + ASSISTANTCONVERSATIONID_FIELD_NUMBER: _ClassVar[int] + PROJECTID_FIELD_NUMBER: _ClassVar[int] + ORGANIZATIONID_FIELD_NUMBER: _ClassVar[int] + SCOPE_FIELD_NUMBER: _ClassVar[int] + METRICS_FIELD_NUMBER: _ClassVar[int] + TIME_FIELD_NUMBER: _ClassVar[int] + contextId: str + assistantId: int + assistantConversationId: int + projectId: int + organizationId: int + scope: str + metrics: _containers.RepeatedCompositeFieldContainer[_common_pb2.Metric] + time: _timestamp_pb2.Timestamp + def __init__(self, contextId: _Optional[str] = ..., assistantId: _Optional[int] = ..., assistantConversationId: _Optional[int] = ..., projectId: _Optional[int] = ..., organizationId: _Optional[int] = ..., scope: _Optional[str] = ..., metrics: _Optional[_Iterable[_Union[_common_pb2.Metric, _Mapping]]] = ..., time: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ...) -> None: ... + +class TelemetryRecord(_message.Message): + __slots__ = ("event", "metric") + EVENT_FIELD_NUMBER: _ClassVar[int] + METRIC_FIELD_NUMBER: _ClassVar[int] + event: TelemetryEvent + metric: TelemetryMetric + def __init__(self, event: _Optional[_Union[TelemetryEvent, _Mapping]] = ..., metric: _Optional[_Union[TelemetryMetric, _Mapping]] = ...) -> None: ... + class GetAllAssistantTelemetryResponse(_message.Message): __slots__ = ("code", "success", "data", "error", "paginated") CODE_FIELD_NUMBER: _ClassVar[int] @@ -161,10 +216,10 @@ class GetAllAssistantTelemetryResponse(_message.Message): PAGINATED_FIELD_NUMBER: _ClassVar[int] code: int success: bool - data: _containers.RepeatedCompositeFieldContainer[_common_pb2.Telemetry] + data: _containers.RepeatedCompositeFieldContainer[TelemetryRecord] error: _common_pb2.Error paginated: _common_pb2.Paginated - def __init__(self, code: _Optional[int] = ..., success: bool = ..., data: _Optional[_Iterable[_Union[_common_pb2.Telemetry, _Mapping]]] = ..., error: _Optional[_Union[_common_pb2.Error, _Mapping]] = ..., paginated: _Optional[_Union[_common_pb2.Paginated, _Mapping]] = ...) -> None: ... + def __init__(self, code: _Optional[int] = ..., success: bool = ..., data: _Optional[_Iterable[_Union[TelemetryRecord, _Mapping]]] = ..., error: _Optional[_Union[_common_pb2.Error, _Mapping]] = ..., paginated: _Optional[_Union[_common_pb2.Paginated, _Mapping]] = ...) -> None: ... class GetAllAssistantResponse(_message.Message): __slots__ = ("code", "success", "data", "error", "paginated") diff --git a/rapida/clients/protos/assistant_api_pb2_grpc.py b/rapida/clients/protos/assistant_api_pb2_grpc.py index f9c3bf7..9865681 100644 --- a/rapida/clients/protos/assistant_api_pb2_grpc.py +++ b/rapida/clients/protos/assistant_api_pb2_grpc.py @@ -11,7 +11,7 @@ import rapida.clients.protos.assistant_webhook_pb2 as assistant__webhook__pb2 import rapida.clients.protos.common_pb2 as common__pb2 -GRPC_GENERATED_VERSION = '1.74.0' +GRPC_GENERATED_VERSION = '1.78.0' GRPC_VERSION = grpc.__version__ _version_not_supported = False @@ -24,7 +24,7 @@ if _version_not_supported: raise RuntimeError( f'The grpc package installed is at version {GRPC_VERSION},' - + f' but the generated code in assistant_api_pb2_grpc.py depends on' + + ' but the generated code in assistant_api_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' diff --git a/rapida/clients/protos/assistant_deployment_pb2_grpc.py b/rapida/clients/protos/assistant_deployment_pb2_grpc.py index 2b7697e..312584b 100644 --- a/rapida/clients/protos/assistant_deployment_pb2_grpc.py +++ b/rapida/clients/protos/assistant_deployment_pb2_grpc.py @@ -5,7 +5,7 @@ import rapida.clients.protos.assistant_deployment_pb2 as assistant__deployment__pb2 -GRPC_GENERATED_VERSION = '1.74.0' +GRPC_GENERATED_VERSION = '1.78.0' GRPC_VERSION = grpc.__version__ _version_not_supported = False @@ -18,7 +18,7 @@ if _version_not_supported: raise RuntimeError( f'The grpc package installed is at version {GRPC_VERSION},' - + f' but the generated code in assistant_deployment_pb2_grpc.py depends on' + + ' but the generated code in assistant_deployment_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' diff --git a/rapida/clients/protos/assistant_knowledge_pb2_grpc.py b/rapida/clients/protos/assistant_knowledge_pb2_grpc.py index 224f933..42d0ab1 100644 --- a/rapida/clients/protos/assistant_knowledge_pb2_grpc.py +++ b/rapida/clients/protos/assistant_knowledge_pb2_grpc.py @@ -4,7 +4,7 @@ import warnings -GRPC_GENERATED_VERSION = '1.74.0' +GRPC_GENERATED_VERSION = '1.78.0' GRPC_VERSION = grpc.__version__ _version_not_supported = False @@ -17,7 +17,7 @@ if _version_not_supported: raise RuntimeError( f'The grpc package installed is at version {GRPC_VERSION},' - + f' but the generated code in assistant_knowledge_pb2_grpc.py depends on' + + ' but the generated code in assistant_knowledge_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' diff --git a/rapida/clients/protos/assistant_provider_pb2_grpc.py b/rapida/clients/protos/assistant_provider_pb2_grpc.py index c5467a0..f46889d 100644 --- a/rapida/clients/protos/assistant_provider_pb2_grpc.py +++ b/rapida/clients/protos/assistant_provider_pb2_grpc.py @@ -4,7 +4,7 @@ import warnings -GRPC_GENERATED_VERSION = '1.74.0' +GRPC_GENERATED_VERSION = '1.78.0' GRPC_VERSION = grpc.__version__ _version_not_supported = False @@ -17,7 +17,7 @@ if _version_not_supported: raise RuntimeError( f'The grpc package installed is at version {GRPC_VERSION},' - + f' but the generated code in assistant_provider_pb2_grpc.py depends on' + + ' but the generated code in assistant_provider_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' diff --git a/rapida/clients/protos/assistant_tool_pb2.py b/rapida/clients/protos/assistant_tool_pb2.py index e77ba9b..2832331 100644 --- a/rapida/clients/protos/assistant_tool_pb2.py +++ b/rapida/clients/protos/assistant_tool_pb2.py @@ -27,7 +27,7 @@ from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x14\x61ssistant-tool.proto\x12\rassistant_api\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x0c\x63ommon.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xb4\x02\n\rAssistantTool\x12\x0e\n\x02id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x17\n\x0b\x61ssistantId\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t\x12\'\n\x06\x66ields\x18\x05 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x17\n\x0f\x65xecutionMethod\x18\x06 \x01(\t\x12#\n\x10\x65xecutionOptions\x18\x07 \x03(\x0b\x32\t.Metadata\x12\x0e\n\x06status\x18\x19 \x01(\t\x12/\n\x0b\x63reatedDate\x18\x1a \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdatedDate\x18\x1b \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xbf\x01\n\x1a\x43reateAssistantToolRequest\x12\x17\n\x0b\x61ssistantId\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t\x12\'\n\x06\x66ields\x18\x05 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x17\n\x0f\x65xecutionMethod\x18\x06 \x01(\t\x12#\n\x10\x65xecutionOptions\x18\x07 \x03(\x0b\x32\t.Metadata\"\xcf\x01\n\x1aUpdateAssistantToolRequest\x12\x0e\n\x02id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x17\n\x0b\x61ssistantId\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t\x12\'\n\x06\x66ields\x18\x05 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x17\n\x0f\x65xecutionMethod\x18\x06 \x01(\t\x12#\n\x10\x65xecutionOptions\x18\x07 \x03(\x0b\x32\t.Metadata\"B\n\x17GetAssistantToolRequest\x12\x0e\n\x02id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x17\n\x0b\x61ssistantId\x18\x02 \x01(\x04\x42\x02\x30\x01\"E\n\x1a\x44\x65leteAssistantToolRequest\x12\x0e\n\x02id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x17\n\x0b\x61ssistantId\x18\x02 \x01(\x04\x42\x02\x30\x01\"|\n\x18GetAssistantToolResponse\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12*\n\x04\x64\x61ta\x18\x03 \x01(\x0b\x32\x1c.assistant_api.AssistantTool\x12\x15\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x06.Error\"p\n\x1aGetAllAssistantToolRequest\x12\x17\n\x0b\x61ssistantId\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x1b\n\x08paginate\x18\x02 \x01(\x0b\x32\t.Paginate\x12\x1c\n\tcriterias\x18\x03 \x03(\x0b\x32\t.Criteria\"\x9e\x01\n\x1bGetAllAssistantToolResponse\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12*\n\x04\x64\x61ta\x18\x03 \x03(\x0b\x32\x1c.assistant_api.AssistantTool\x12\x15\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x06.Error\x12\x1d\n\tpaginated\x18\x05 \x01(\x0b\x32\n.Paginated\"\x8b\x01\n\x1dGetAllAssistantToolLogRequest\x12\x15\n\tprojectId\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x1b\n\x08paginate\x18\x03 \x01(\x0b\x32\t.Paginate\x12\x1c\n\tcriterias\x18\x04 \x03(\x0b\x32\t.Criteria\x12\x18\n\x05order\x18\x05 \x01(\x0b\x32\t.Ordering\"C\n\x1aGetAssistantToolLogRequest\x12\x15\n\tprojectId\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x0e\n\x02id\x18\x03 \x01(\x04\x42\x02\x30\x01\"\x82\x01\n\x1bGetAssistantToolLogResponse\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12-\n\x04\x64\x61ta\x18\x03 \x01(\x0b\x32\x1f.assistant_api.AssistantToolLog\x12\x15\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x06.Error\"\xa4\x01\n\x1eGetAllAssistantToolLogResponse\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12-\n\x04\x64\x61ta\x18\x03 \x03(\x0b\x32\x1f.assistant_api.AssistantToolLog\x12\x15\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x06.Error\x12\x1d\n\tpaginated\x18\x05 \x01(\x0b\x32\n.Paginated\"\xdd\x04\n\x10\x41ssistantToolLog\x12\x0e\n\x02id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\'\n\x06\x61\x63tion\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12(\n\x07request\x18\x03 \x01(\x0b\x32\x17.google.protobuf.Struct\x12)\n\x08response\x18\x04 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x0e\n\x06status\x18\x05 \x01(\t\x12/\n\x0b\x63reatedDate\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdatedDate\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0b\x61ssistantId\x18\x08 \x01(\x04\x42\x02\x30\x01\x12\x15\n\tprojectId\x18\t \x01(\x04\x42\x02\x30\x01\x12\x1a\n\x0eorganizationId\x18\n \x01(\x04\x42\x02\x30\x01\x12#\n\x17\x61ssistantConversationId\x18\x0b \x01(\x04\x42\x02\x30\x01\x12&\n\x1e\x61ssistantConversationMessageId\x18\x0c \x01(\t\x12\x13\n\x0b\x61ssetPrefix\x18\x0e \x01(\t\x12\x17\n\x0f\x65xecutionMethod\x18\x0f \x01(\t\x12\x15\n\ttimeTaken\x18\x10 \x01(\x04\x42\x02\x30\x01\x12\x1b\n\x0f\x61ssistantToolId\x18\r \x01(\x04\x42\x02\x30\x01\x12\x19\n\x11\x61ssistantToolName\x18\x11 \x01(\t\x12\x33\n\rassistantTool\x18\x12 \x01(\x0b\x32\x1c.assistant_api.AssistantToolB\x1cZ\x1agithub.com/rapidaai/protosb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x14\x61ssistant-tool.proto\x12\rassistant_api\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x0c\x63ommon.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xb4\x02\n\rAssistantTool\x12\x0e\n\x02id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x17\n\x0b\x61ssistantId\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t\x12\'\n\x06\x66ields\x18\x05 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x17\n\x0f\x65xecutionMethod\x18\x06 \x01(\t\x12#\n\x10\x65xecutionOptions\x18\x07 \x03(\x0b\x32\t.Metadata\x12\x0e\n\x06status\x18\x19 \x01(\t\x12/\n\x0b\x63reatedDate\x18\x1a \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdatedDate\x18\x1b \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xbf\x01\n\x1a\x43reateAssistantToolRequest\x12\x17\n\x0b\x61ssistantId\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t\x12\'\n\x06\x66ields\x18\x05 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x17\n\x0f\x65xecutionMethod\x18\x06 \x01(\t\x12#\n\x10\x65xecutionOptions\x18\x07 \x03(\x0b\x32\t.Metadata\"\xcf\x01\n\x1aUpdateAssistantToolRequest\x12\x0e\n\x02id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x17\n\x0b\x61ssistantId\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t\x12\'\n\x06\x66ields\x18\x05 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x17\n\x0f\x65xecutionMethod\x18\x06 \x01(\t\x12#\n\x10\x65xecutionOptions\x18\x07 \x03(\x0b\x32\t.Metadata\"B\n\x17GetAssistantToolRequest\x12\x0e\n\x02id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x17\n\x0b\x61ssistantId\x18\x02 \x01(\x04\x42\x02\x30\x01\"E\n\x1a\x44\x65leteAssistantToolRequest\x12\x0e\n\x02id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x17\n\x0b\x61ssistantId\x18\x02 \x01(\x04\x42\x02\x30\x01\"|\n\x18GetAssistantToolResponse\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12*\n\x04\x64\x61ta\x18\x03 \x01(\x0b\x32\x1c.assistant_api.AssistantTool\x12\x15\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x06.Error\"p\n\x1aGetAllAssistantToolRequest\x12\x17\n\x0b\x61ssistantId\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x1b\n\x08paginate\x18\x02 \x01(\x0b\x32\t.Paginate\x12\x1c\n\tcriterias\x18\x03 \x03(\x0b\x32\t.Criteria\"\x9e\x01\n\x1bGetAllAssistantToolResponse\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12*\n\x04\x64\x61ta\x18\x03 \x03(\x0b\x32\x1c.assistant_api.AssistantTool\x12\x15\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x06.Error\x12\x1d\n\tpaginated\x18\x05 \x01(\x0b\x32\n.Paginated\"\x8b\x01\n\x1dGetAllAssistantToolLogRequest\x12\x15\n\tprojectId\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x1b\n\x08paginate\x18\x03 \x01(\x0b\x32\t.Paginate\x12\x1c\n\tcriterias\x18\x04 \x03(\x0b\x32\t.Criteria\x12\x18\n\x05order\x18\x05 \x01(\x0b\x32\t.Ordering\"C\n\x1aGetAssistantToolLogRequest\x12\x15\n\tprojectId\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x0e\n\x02id\x18\x03 \x01(\x04\x42\x02\x30\x01\"\x82\x01\n\x1bGetAssistantToolLogResponse\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12-\n\x04\x64\x61ta\x18\x03 \x01(\x0b\x32\x1f.assistant_api.AssistantToolLog\x12\x15\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x06.Error\"\xa4\x01\n\x1eGetAllAssistantToolLogResponse\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12-\n\x04\x64\x61ta\x18\x03 \x03(\x0b\x32\x1f.assistant_api.AssistantToolLog\x12\x15\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x06.Error\x12\x1d\n\tpaginated\x18\x05 \x01(\x0b\x32\n.Paginated\"\x86\x04\n\x10\x41ssistantToolLog\x12\x0e\n\x02id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\'\n\x06\x61\x63tion\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12(\n\x07request\x18\x03 \x01(\x0b\x32\x17.google.protobuf.Struct\x12)\n\x08response\x18\x04 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x0e\n\x06status\x18\x05 \x01(\t\x12/\n\x0b\x63reatedDate\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdatedDate\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0b\x61ssistantId\x18\x08 \x01(\x04\x42\x02\x30\x01\x12\x15\n\tprojectId\x18\t \x01(\x04\x42\x02\x30\x01\x12\x1a\n\x0eorganizationId\x18\n \x01(\x04\x42\x02\x30\x01\x12#\n\x17\x61ssistantConversationId\x18\x0b \x01(\x04\x42\x02\x30\x01\x12&\n\x1e\x61ssistantConversationMessageId\x18\x0c \x01(\t\x12\x13\n\x0b\x61ssetPrefix\x18\x0e \x01(\t\x12\x15\n\ttimeTaken\x18\x10 \x01(\x04\x42\x02\x30\x01\x12\x19\n\x11\x61ssistantToolName\x18\x11 \x01(\t\x12\x12\n\ntoolCallId\x18\x13 \x01(\tB\x1cZ\x1agithub.com/rapidaai/protosb\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -73,8 +73,6 @@ _globals['_ASSISTANTTOOLLOG'].fields_by_name['assistantConversationId']._serialized_options = b'0\001' _globals['_ASSISTANTTOOLLOG'].fields_by_name['timeTaken']._loaded_options = None _globals['_ASSISTANTTOOLLOG'].fields_by_name['timeTaken']._serialized_options = b'0\001' - _globals['_ASSISTANTTOOLLOG'].fields_by_name['assistantToolId']._loaded_options = None - _globals['_ASSISTANTTOOLLOG'].fields_by_name['assistantToolId']._serialized_options = b'0\001' _globals['_ASSISTANTTOOL']._serialized_start=117 _globals['_ASSISTANTTOOL']._serialized_end=425 _globals['_CREATEASSISTANTTOOLREQUEST']._serialized_start=428 @@ -100,5 +98,5 @@ _globals['_GETALLASSISTANTTOOLLOGRESPONSE']._serialized_start=1716 _globals['_GETALLASSISTANTTOOLLOGRESPONSE']._serialized_end=1880 _globals['_ASSISTANTTOOLLOG']._serialized_start=1883 - _globals['_ASSISTANTTOOLLOG']._serialized_end=2488 + _globals['_ASSISTANTTOOLLOG']._serialized_end=2401 # @@protoc_insertion_point(module_scope) diff --git a/rapida/clients/protos/assistant_tool_pb2.pyi b/rapida/clients/protos/assistant_tool_pb2.pyi index d76cdb2..195753d 100644 --- a/rapida/clients/protos/assistant_tool_pb2.pyi +++ b/rapida/clients/protos/assistant_tool_pb2.pyi @@ -168,7 +168,7 @@ class GetAllAssistantToolLogResponse(_message.Message): def __init__(self, code: _Optional[int] = ..., success: bool = ..., data: _Optional[_Iterable[_Union[AssistantToolLog, _Mapping]]] = ..., error: _Optional[_Union[_common_pb2.Error, _Mapping]] = ..., paginated: _Optional[_Union[_common_pb2.Paginated, _Mapping]] = ...) -> None: ... class AssistantToolLog(_message.Message): - __slots__ = ("id", "action", "request", "response", "status", "createdDate", "updatedDate", "assistantId", "projectId", "organizationId", "assistantConversationId", "assistantConversationMessageId", "assetPrefix", "executionMethod", "timeTaken", "assistantToolId", "assistantToolName", "assistantTool") + __slots__ = ("id", "action", "request", "response", "status", "createdDate", "updatedDate", "assistantId", "projectId", "organizationId", "assistantConversationId", "assistantConversationMessageId", "assetPrefix", "timeTaken", "assistantToolName", "toolCallId") ID_FIELD_NUMBER: _ClassVar[int] ACTION_FIELD_NUMBER: _ClassVar[int] REQUEST_FIELD_NUMBER: _ClassVar[int] @@ -182,11 +182,9 @@ class AssistantToolLog(_message.Message): ASSISTANTCONVERSATIONID_FIELD_NUMBER: _ClassVar[int] ASSISTANTCONVERSATIONMESSAGEID_FIELD_NUMBER: _ClassVar[int] ASSETPREFIX_FIELD_NUMBER: _ClassVar[int] - EXECUTIONMETHOD_FIELD_NUMBER: _ClassVar[int] TIMETAKEN_FIELD_NUMBER: _ClassVar[int] - ASSISTANTTOOLID_FIELD_NUMBER: _ClassVar[int] ASSISTANTTOOLNAME_FIELD_NUMBER: _ClassVar[int] - ASSISTANTTOOL_FIELD_NUMBER: _ClassVar[int] + TOOLCALLID_FIELD_NUMBER: _ClassVar[int] id: int action: _struct_pb2.Struct request: _struct_pb2.Struct @@ -200,9 +198,7 @@ class AssistantToolLog(_message.Message): assistantConversationId: int assistantConversationMessageId: str assetPrefix: str - executionMethod: str timeTaken: int - assistantToolId: int assistantToolName: str - assistantTool: AssistantTool - def __init__(self, id: _Optional[int] = ..., action: _Optional[_Union[_struct_pb2.Struct, _Mapping]] = ..., request: _Optional[_Union[_struct_pb2.Struct, _Mapping]] = ..., response: _Optional[_Union[_struct_pb2.Struct, _Mapping]] = ..., status: _Optional[str] = ..., createdDate: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., updatedDate: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., assistantId: _Optional[int] = ..., projectId: _Optional[int] = ..., organizationId: _Optional[int] = ..., assistantConversationId: _Optional[int] = ..., assistantConversationMessageId: _Optional[str] = ..., assetPrefix: _Optional[str] = ..., executionMethod: _Optional[str] = ..., timeTaken: _Optional[int] = ..., assistantToolId: _Optional[int] = ..., assistantToolName: _Optional[str] = ..., assistantTool: _Optional[_Union[AssistantTool, _Mapping]] = ...) -> None: ... + toolCallId: str + def __init__(self, id: _Optional[int] = ..., action: _Optional[_Union[_struct_pb2.Struct, _Mapping]] = ..., request: _Optional[_Union[_struct_pb2.Struct, _Mapping]] = ..., response: _Optional[_Union[_struct_pb2.Struct, _Mapping]] = ..., status: _Optional[str] = ..., createdDate: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., updatedDate: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., assistantId: _Optional[int] = ..., projectId: _Optional[int] = ..., organizationId: _Optional[int] = ..., assistantConversationId: _Optional[int] = ..., assistantConversationMessageId: _Optional[str] = ..., assetPrefix: _Optional[str] = ..., timeTaken: _Optional[int] = ..., assistantToolName: _Optional[str] = ..., toolCallId: _Optional[str] = ...) -> None: ... diff --git a/rapida/clients/protos/assistant_tool_pb2_grpc.py b/rapida/clients/protos/assistant_tool_pb2_grpc.py index 7356d61..a96c33d 100644 --- a/rapida/clients/protos/assistant_tool_pb2_grpc.py +++ b/rapida/clients/protos/assistant_tool_pb2_grpc.py @@ -4,7 +4,7 @@ import warnings -GRPC_GENERATED_VERSION = '1.74.0' +GRPC_GENERATED_VERSION = '1.78.0' GRPC_VERSION = grpc.__version__ _version_not_supported = False @@ -17,7 +17,7 @@ if _version_not_supported: raise RuntimeError( f'The grpc package installed is at version {GRPC_VERSION},' - + f' but the generated code in assistant_tool_pb2_grpc.py depends on' + + ' but the generated code in assistant_tool_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' diff --git a/rapida/clients/protos/assistant_webhook_pb2_grpc.py b/rapida/clients/protos/assistant_webhook_pb2_grpc.py index ea667b6..1161839 100644 --- a/rapida/clients/protos/assistant_webhook_pb2_grpc.py +++ b/rapida/clients/protos/assistant_webhook_pb2_grpc.py @@ -4,7 +4,7 @@ import warnings -GRPC_GENERATED_VERSION = '1.74.0' +GRPC_GENERATED_VERSION = '1.78.0' GRPC_VERSION = grpc.__version__ _version_not_supported = False @@ -17,7 +17,7 @@ if _version_not_supported: raise RuntimeError( f'The grpc package installed is at version {GRPC_VERSION},' - + f' but the generated code in assistant_webhook_pb2_grpc.py depends on' + + ' but the generated code in assistant_webhook_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' diff --git a/rapida/clients/protos/audit_logging_api_pb2_grpc.py b/rapida/clients/protos/audit_logging_api_pb2_grpc.py index 30ca463..d60aa09 100644 --- a/rapida/clients/protos/audit_logging_api_pb2_grpc.py +++ b/rapida/clients/protos/audit_logging_api_pb2_grpc.py @@ -5,7 +5,7 @@ import rapida.clients.protos.audit_logging_api_pb2 as audit__logging__api__pb2 -GRPC_GENERATED_VERSION = '1.74.0' +GRPC_GENERATED_VERSION = '1.78.0' GRPC_VERSION = grpc.__version__ _version_not_supported = False @@ -18,7 +18,7 @@ if _version_not_supported: raise RuntimeError( f'The grpc package installed is at version {GRPC_VERSION},' - + f' but the generated code in audit_logging_api_pb2_grpc.py depends on' + + ' but the generated code in audit_logging_api_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' diff --git a/rapida/clients/protos/common_pb2.py b/rapida/clients/protos/common_pb2.py index 46a5f54..691f1c4 100644 --- a/rapida/clients/protos/common_pb2.py +++ b/rapida/clients/protos/common_pb2.py @@ -26,7 +26,7 @@ from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0c\x63ommon.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1cgoogle/protobuf/struct.proto\"\x1e\n\rFieldSelector\x12\r\n\x05\x66ield\x18\x01 \x01(\t\"?\n\x13\x41ssistantDefinition\x12\x17\n\x0b\x61ssistantId\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x0f\n\x07version\x18\x02 \x01(\t\"5\n\x08\x43riteria\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\x12\r\n\x05logic\x18\x03 \x01(\t\"J\n\x05\x45rror\x12\x15\n\terrorCode\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x14\n\x0c\x65rrorMessage\x18\x02 \x01(\t\x12\x14\n\x0chumanMessage\x18\x03 \x01(\t\"*\n\x08Paginate\x12\x0c\n\x04page\x18\x01 \x01(\r\x12\x10\n\x08pageSize\x18\x02 \x01(\r\"3\n\tPaginated\x12\x13\n\x0b\x63urrentPage\x18\x01 \x01(\r\x12\x11\n\ttotalItem\x18\x02 \x01(\r\")\n\x08Ordering\x12\x0e\n\x06\x63olumn\x18\x01 \x01(\t\x12\r\n\x05order\x18\x02 \x01(\t\"\x82\x01\n\x04User\x12\x0e\n\x02id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\r\n\x05\x65mail\x18\x03 \x01(\t\x12\x0c\n\x04role\x18\x04 \x01(\t\x12/\n\x0b\x63reatedDate\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0e\n\x06status\x18\x05 \x01(\t\"\x98\x01\n\x0c\x42\x61seResponse\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12%\n\x04\x64\x61ta\x18\x03 \x03(\x0b\x32\x17.BaseResponse.DataEntry\x12\x15\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x06.Error\x1a+\n\tDataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"6\n\x08Metadata\x12\x0e\n\x02id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x0b\n\x03key\x18\x02 \x01(\t\x12\r\n\x05value\x18\x03 \x01(\t\"7\n\x08\x41rgument\x12\x0e\n\x02id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\r\n\x05value\x18\x03 \x01(\t\"b\n\x08Variable\x12\x0e\n\x02id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x0c\n\x04type\x18\x03 \x01(\t\x12\x19\n\x0c\x64\x65\x66\x61ultValue\x18\x04 \x01(\tH\x00\x88\x01\x01\x42\x0f\n\r_defaultValue\"\"\n\x03Tag\x12\x0e\n\x02id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x0b\n\x03tag\x18\x02 \x03(\t\"r\n\x0cOrganization\x12\x0e\n\x02id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x10\n\x08industry\x18\x04 \x01(\t\x12\x0f\n\x07\x63ontact\x18\x05 \x01(\t\x12\x0c\n\x04size\x18\x06 \x01(\t\":\n\x06Metric\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\"B\n\x10\x41ssistantMessage\x12\x10\n\x08\x63ontents\x18\x02 \x03(\t\x12\x1c\n\ttoolCalls\x18\x03 \x03(\x0b\x32\t.ToolCall\" \n\rSystemMessage\x12\x0f\n\x07\x63ontent\x18\x02 \x01(\t\"\x1e\n\x0bUserMessage\x12\x0f\n\x07\x63ontent\x18\x02 \x01(\t\"b\n\x0bToolMessage\x12 \n\x05tools\x18\x01 \x03(\x0b\x32\x11.ToolMessage.Tool\x1a\x31\n\x04Tool\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x03 \x01(\t\"\xa8\x01\n\x07Message\x12\x0c\n\x04role\x18\x01 \x01(\t\x12&\n\tassistant\x18\n \x01(\x0b\x32\x11.AssistantMessageH\x00\x12\x1c\n\x04user\x18\x0b \x01(\x0b\x32\x0c.UserMessageH\x00\x12\x1c\n\x04tool\x18\x0c \x01(\x0b\x32\x0c.ToolMessageH\x00\x12 \n\x06system\x18\r \x01(\x0b\x32\x0e.SystemMessageH\x00\x42\t\n\x07message\"W\n\x08ToolCall\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04type\x18\x02 \x01(\t\x12$\n\x08\x66unction\x18\x03 \x01(\x0b\x32\r.FunctionCallH\x00\x88\x01\x01\x42\x0b\n\t_function\"/\n\x0c\x46unctionCall\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\targuments\x18\x02 \x01(\t\"\x91\x02\n\tTelemetry\x12\x11\n\tstageName\x18\x01 \x01(\t\x12-\n\tstartTime\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12+\n\x07\x65ndTime\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x10\n\x08\x64uration\x18\x04 \x01(\x04\x12.\n\nattributes\x18\x05 \x03(\x0b\x32\x1a.Telemetry.AttributesEntry\x12\x0e\n\x06spanID\x18\x06 \x01(\t\x12\x10\n\x08parentID\x18\x07 \x01(\t\x1a\x31\n\x0f\x41ttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xeb\x04\n\tKnowledge\x12\x0e\n\x02id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x12\n\nvisibility\x18\x04 \x01(\t\x12\x10\n\x08language\x18\x05 \x01(\t\x12$\n\x18\x65mbeddingModelProviderId\x18\x06 \x01(\x04\x42\x02\x30\x01\x12\"\n\x1a\x65mbeddingModelProviderName\x18\x07 \x01(\t\x12\x31\n\x1eknowledgeEmbeddingModelOptions\x18\x08 \x03(\x0b\x32\t.Metadata\x12\x0e\n\x06status\x18\x0c \x01(\t\x12\x15\n\tcreatedBy\x18\r \x01(\x04\x42\x02\x30\x01\x12\x1a\n\x0b\x63reatedUser\x18\x0e \x01(\x0b\x32\x05.User\x12\x15\n\tupdatedBy\x18\x0f \x01(\x04\x42\x02\x30\x01\x12\x1a\n\x0bupdatedUser\x18\x10 \x01(\x0b\x32\x05.User\x12/\n\x0b\x63reatedDate\x18\x11 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdatedDate\x18\x12 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1a\n\x0eorganizationId\x18\x13 \x01(\x04\x42\x02\x30\x01\x12\x15\n\tprojectId\x18\x14 \x01(\x04\x42\x02\x30\x01\x12#\n\x0corganization\x18\x15 \x01(\x0b\x32\r.Organization\x12\x1a\n\x0cknowledgeTag\x18\x16 \x01(\x0b\x32\x04.Tag\x12\x15\n\rdocumentCount\x18\x17 \x01(\r\x12\x12\n\ntokenCount\x18\x18 \x01(\r\x12\x11\n\twordCount\x18\x19 \x01(\r\"+\n\nTextPrompt\x12\x0c\n\x04role\x18\x01 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x02 \x01(\t\"Y\n\x16TextChatCompletePrompt\x12\x1b\n\x06prompt\x18\x01 \x03(\x0b\x32\x0b.TextPrompt\x12\"\n\x0fpromptVariables\x18\x02 \x03(\x0b\x32\t.Variable\"\xa8\x03\n\x1c\x41ssistantConversationMessage\x12\x0e\n\x02id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x11\n\tmessageId\x18\x03 \x01(\t\x12#\n\x17\x61ssistantConversationId\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x0c\n\x04role\x18\x04 \x01(\t\x12\x0c\n\x04\x62ody\x18\x05 \x01(\t\x12\x0e\n\x06source\x18\t \x01(\t\x12\x18\n\x07metrics\x18\n \x03(\x0b\x32\x07.Metric\x12\x0e\n\x06status\x18\x0b \x01(\t\x12\x15\n\tcreatedBy\x18\x0c \x01(\x04\x42\x02\x30\x01\x12\x15\n\tupdatedBy\x18\r \x01(\x04\x42\x02\x30\x01\x12/\n\x0b\x63reatedDate\x18\x1a \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdatedDate\x18\x1b \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0b\x61ssistantId\x18\x1c \x01(\x04\x42\x02\x30\x01\x12$\n\x18\x61ssistantProviderModelId\x18\x1d \x01(\x04\x42\x02\x30\x01\x12\x1b\n\x08metadata\x18\x1f \x03(\x0b\x32\t.Metadata\"\xaa\x01\n\x1c\x41ssistantConversationContext\x12\x0e\n\x02id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12)\n\x08metadata\x18\x03 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\'\n\x06result\x18\x04 \x01(\x0b\x32\x17.google.protobuf.Struct\x12&\n\x05query\x18\x05 \x01(\x0b\x32\x17.google.protobuf.Struct\"6\n\x1e\x41ssistantConversationRecording\x12\x14\n\x0crecordingUrl\x18\x01 \x01(\t\"\x8b\x02\n#AssistantConversationTelephonyEvent\x12\x0e\n\x02id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12#\n\x17\x61ssistantConversationId\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x10\n\x08provider\x18\x03 \x01(\t\x12\x11\n\teventType\x18\x04 \x01(\t\x12(\n\x07payload\x18\x05 \x01(\x0b\x32\x17.google.protobuf.Struct\x12/\n\x0b\x63reatedDate\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdatedDate\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x82\x06\n\x15\x41ssistantConversation\x12\x0e\n\x02id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x12\n\x06userId\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x17\n\x0b\x61ssistantId\x18\x03 \x01(\x04\x42\x02\x30\x01\x12\x0c\n\x04name\x18\x04 \x01(\t\x12\x15\n\tprojectId\x18\x05 \x01(\x04\x42\x02\x30\x01\x12\x1a\n\x0eorganizationId\x18\x06 \x01(\x04\x42\x02\x30\x01\x12\x0e\n\x06source\x18\x07 \x01(\t\x12\x15\n\tcreatedBy\x18\x08 \x01(\x04\x42\x02\x30\x01\x12\x15\n\tupdatedBy\x18\t \x01(\x04\x42\x02\x30\x01\x12\x13\n\x04user\x18\n \x01(\x0b\x32\x05.User\x12$\n\x18\x61ssistantProviderModelId\x18\x0c \x01(\x04\x42\x02\x30\x01\x12\x43\n\x1c\x61ssistantConversationMessage\x18\r \x03(\x0b\x32\x1d.AssistantConversationMessage\x12\x12\n\nidentifier\x18\x0e \x01(\t\x12\x0e\n\x06status\x18\x0f \x01(\t\x12/\n\x0b\x63reatedDate\x18\x1a \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdatedDate\x18\x1b \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x08\x63ontexts\x18\x1c \x03(\x0b\x32\x1d.AssistantConversationContext\x12\x18\n\x07metrics\x18\x1e \x03(\x0b\x32\x07.Metric\x12\x1b\n\x08metadata\x18 \x03(\x0b\x32\t.Metadata\x12\x1c\n\targuments\x18\x1f \x03(\x0b\x32\t.Argument\x12\x1a\n\x07options\x18! \x03(\x0b\x32\t.Metadata\x12\x11\n\tdirection\x18\" \x01(\t\x12\x33\n\nrecordings\x18# \x03(\x0b\x32\x1f.AssistantConversationRecording\x12=\n\x0ftelephonyEvents\x18$ \x03(\x0b\x32$.AssistantConversationTelephonyEvent\"\x91\x01\n\"GetAllAssistantConversationRequest\x12\x17\n\x0b\x61ssistantId\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x1b\n\x08paginate\x18\x02 \x01(\x0b\x32\t.Paginate\x12\x1c\n\tcriterias\x18\x03 \x03(\x0b\x32\t.Criteria\x12\x17\n\x06source\x18\x07 \x01(\x0e\x32\x07.Source\"\xa0\x01\n#GetAllAssistantConversationResponse\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12$\n\x04\x64\x61ta\x18\x03 \x03(\x0b\x32\x16.AssistantConversation\x12\x15\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x06.Error\x12\x1d\n\tpaginated\x18\x05 \x01(\x0b\x32\n.Paginated\"\xce\x01\n GetAllConversationMessageRequest\x12\x17\n\x0b\x61ssistantId\x18\x01 \x01(\x04\x42\x02\x30\x01\x12#\n\x17\x61ssistantConversationId\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x1b\n\x08paginate\x18\x03 \x01(\x0b\x32\t.Paginate\x12\x1c\n\tcriterias\x18\x04 \x03(\x0b\x32\t.Criteria\x12\x18\n\x05order\x18\x05 \x01(\x0b\x32\t.Ordering\x12\x17\n\x06source\x18\x07 \x01(\x0e\x32\x07.Source\"\xa5\x01\n!GetAllConversationMessageResponse\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12+\n\x04\x64\x61ta\x18\x03 \x03(\x0b\x32\x1d.AssistantConversationMessage\x12\x15\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x06.Error\x12\x1d\n\tpaginated\x18\x05 \x01(\x0b\x32\n.Paginated*M\n\x06Source\x12\x0e\n\nWEB_PLUGIN\x10\x00\x12\x0c\n\x08\x44\x45\x42UGGER\x10\x01\x12\x07\n\x03SDK\x10\x02\x12\x0e\n\nPHONE_CALL\x10\x03\x12\x0c\n\x08WHATSAPP\x10\x04\x42\x35\n\x17\x61i.rapida.sdk.artifactsZ\x1agithub.com/rapidaai/protosb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0c\x63ommon.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1cgoogle/protobuf/struct.proto\"\x1e\n\rFieldSelector\x12\r\n\x05\x66ield\x18\x01 \x01(\t\"?\n\x13\x41ssistantDefinition\x12\x17\n\x0b\x61ssistantId\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x0f\n\x07version\x18\x02 \x01(\t\"5\n\x08\x43riteria\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\x12\r\n\x05logic\x18\x03 \x01(\t\"J\n\x05\x45rror\x12\x15\n\terrorCode\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x14\n\x0c\x65rrorMessage\x18\x02 \x01(\t\x12\x14\n\x0chumanMessage\x18\x03 \x01(\t\"*\n\x08Paginate\x12\x0c\n\x04page\x18\x01 \x01(\r\x12\x10\n\x08pageSize\x18\x02 \x01(\r\"3\n\tPaginated\x12\x13\n\x0b\x63urrentPage\x18\x01 \x01(\r\x12\x11\n\ttotalItem\x18\x02 \x01(\r\")\n\x08Ordering\x12\x0e\n\x06\x63olumn\x18\x01 \x01(\t\x12\r\n\x05order\x18\x02 \x01(\t\"\x82\x01\n\x04User\x12\x0e\n\x02id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\r\n\x05\x65mail\x18\x03 \x01(\t\x12\x0c\n\x04role\x18\x04 \x01(\t\x12/\n\x0b\x63reatedDate\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0e\n\x06status\x18\x05 \x01(\t\"\x98\x01\n\x0c\x42\x61seResponse\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12%\n\x04\x64\x61ta\x18\x03 \x03(\x0b\x32\x17.BaseResponse.DataEntry\x12\x15\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x06.Error\x1a+\n\tDataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"6\n\x08Metadata\x12\x0e\n\x02id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x0b\n\x03key\x18\x02 \x01(\t\x12\r\n\x05value\x18\x03 \x01(\t\"7\n\x08\x41rgument\x12\x0e\n\x02id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\r\n\x05value\x18\x03 \x01(\t\"b\n\x08Variable\x12\x0e\n\x02id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x0c\n\x04type\x18\x03 \x01(\t\x12\x19\n\x0c\x64\x65\x66\x61ultValue\x18\x04 \x01(\tH\x00\x88\x01\x01\x42\x0f\n\r_defaultValue\"\"\n\x03Tag\x12\x0e\n\x02id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x0b\n\x03tag\x18\x02 \x03(\t\"r\n\x0cOrganization\x12\x0e\n\x02id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x10\n\x08industry\x18\x04 \x01(\t\x12\x0f\n\x07\x63ontact\x18\x05 \x01(\t\x12\x0c\n\x04size\x18\x06 \x01(\t\":\n\x06Metric\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\"B\n\x10\x41ssistantMessage\x12\x10\n\x08\x63ontents\x18\x02 \x03(\t\x12\x1c\n\ttoolCalls\x18\x03 \x03(\x0b\x32\t.ToolCall\" \n\rSystemMessage\x12\x0f\n\x07\x63ontent\x18\x02 \x01(\t\"\x1e\n\x0bUserMessage\x12\x0f\n\x07\x63ontent\x18\x02 \x01(\t\"b\n\x0bToolMessage\x12 \n\x05tools\x18\x01 \x03(\x0b\x32\x11.ToolMessage.Tool\x1a\x31\n\x04Tool\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x03 \x01(\t\"\xa8\x01\n\x07Message\x12\x0c\n\x04role\x18\x01 \x01(\t\x12&\n\tassistant\x18\n \x01(\x0b\x32\x11.AssistantMessageH\x00\x12\x1c\n\x04user\x18\x0b \x01(\x0b\x32\x0c.UserMessageH\x00\x12\x1c\n\x04tool\x18\x0c \x01(\x0b\x32\x0c.ToolMessageH\x00\x12 \n\x06system\x18\r \x01(\x0b\x32\x0e.SystemMessageH\x00\x42\t\n\x07message\"W\n\x08ToolCall\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04type\x18\x02 \x01(\t\x12$\n\x08\x66unction\x18\x03 \x01(\x0b\x32\r.FunctionCallH\x00\x88\x01\x01\x42\x0b\n\t_function\"/\n\x0c\x46unctionCall\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\targuments\x18\x02 \x01(\t\"\xeb\x04\n\tKnowledge\x12\x0e\n\x02id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x12\n\nvisibility\x18\x04 \x01(\t\x12\x10\n\x08language\x18\x05 \x01(\t\x12$\n\x18\x65mbeddingModelProviderId\x18\x06 \x01(\x04\x42\x02\x30\x01\x12\"\n\x1a\x65mbeddingModelProviderName\x18\x07 \x01(\t\x12\x31\n\x1eknowledgeEmbeddingModelOptions\x18\x08 \x03(\x0b\x32\t.Metadata\x12\x0e\n\x06status\x18\x0c \x01(\t\x12\x15\n\tcreatedBy\x18\r \x01(\x04\x42\x02\x30\x01\x12\x1a\n\x0b\x63reatedUser\x18\x0e \x01(\x0b\x32\x05.User\x12\x15\n\tupdatedBy\x18\x0f \x01(\x04\x42\x02\x30\x01\x12\x1a\n\x0bupdatedUser\x18\x10 \x01(\x0b\x32\x05.User\x12/\n\x0b\x63reatedDate\x18\x11 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdatedDate\x18\x12 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1a\n\x0eorganizationId\x18\x13 \x01(\x04\x42\x02\x30\x01\x12\x15\n\tprojectId\x18\x14 \x01(\x04\x42\x02\x30\x01\x12#\n\x0corganization\x18\x15 \x01(\x0b\x32\r.Organization\x12\x1a\n\x0cknowledgeTag\x18\x16 \x01(\x0b\x32\x04.Tag\x12\x15\n\rdocumentCount\x18\x17 \x01(\r\x12\x12\n\ntokenCount\x18\x18 \x01(\r\x12\x11\n\twordCount\x18\x19 \x01(\r\"+\n\nTextPrompt\x12\x0c\n\x04role\x18\x01 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x02 \x01(\t\"Y\n\x16TextChatCompletePrompt\x12\x1b\n\x06prompt\x18\x01 \x03(\x0b\x32\x0b.TextPrompt\x12\"\n\x0fpromptVariables\x18\x02 \x03(\x0b\x32\t.Variable\"\xa8\x03\n\x1c\x41ssistantConversationMessage\x12\x0e\n\x02id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x11\n\tmessageId\x18\x03 \x01(\t\x12#\n\x17\x61ssistantConversationId\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x0c\n\x04role\x18\x04 \x01(\t\x12\x0c\n\x04\x62ody\x18\x05 \x01(\t\x12\x0e\n\x06source\x18\t \x01(\t\x12\x18\n\x07metrics\x18\n \x03(\x0b\x32\x07.Metric\x12\x0e\n\x06status\x18\x0b \x01(\t\x12\x15\n\tcreatedBy\x18\x0c \x01(\x04\x42\x02\x30\x01\x12\x15\n\tupdatedBy\x18\r \x01(\x04\x42\x02\x30\x01\x12/\n\x0b\x63reatedDate\x18\x1a \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdatedDate\x18\x1b \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0b\x61ssistantId\x18\x1c \x01(\x04\x42\x02\x30\x01\x12$\n\x18\x61ssistantProviderModelId\x18\x1d \x01(\x04\x42\x02\x30\x01\x12\x1b\n\x08metadata\x18\x1f \x03(\x0b\x32\t.Metadata\"\xaa\x01\n\x1c\x41ssistantConversationContext\x12\x0e\n\x02id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12)\n\x08metadata\x18\x03 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\'\n\x06result\x18\x04 \x01(\x0b\x32\x17.google.protobuf.Struct\x12&\n\x05query\x18\x05 \x01(\x0b\x32\x17.google.protobuf.Struct\"i\n\x1e\x41ssistantConversationRecording\x12\x0e\n\x02id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x1d\n\x15\x61ssistantRecordingUrl\x18\x02 \x01(\t\x12\x18\n\x10userRecordingUrl\x18\x03 \x01(\t\"\x8b\x02\n#AssistantConversationTelephonyEvent\x12\x0e\n\x02id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12#\n\x17\x61ssistantConversationId\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x10\n\x08provider\x18\x03 \x01(\t\x12\x11\n\teventType\x18\x04 \x01(\t\x12(\n\x07payload\x18\x05 \x01(\x0b\x32\x17.google.protobuf.Struct\x12/\n\x0b\x63reatedDate\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdatedDate\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x82\x06\n\x15\x41ssistantConversation\x12\x0e\n\x02id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x12\n\x06userId\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x17\n\x0b\x61ssistantId\x18\x03 \x01(\x04\x42\x02\x30\x01\x12\x0c\n\x04name\x18\x04 \x01(\t\x12\x15\n\tprojectId\x18\x05 \x01(\x04\x42\x02\x30\x01\x12\x1a\n\x0eorganizationId\x18\x06 \x01(\x04\x42\x02\x30\x01\x12\x0e\n\x06source\x18\x07 \x01(\t\x12\x15\n\tcreatedBy\x18\x08 \x01(\x04\x42\x02\x30\x01\x12\x15\n\tupdatedBy\x18\t \x01(\x04\x42\x02\x30\x01\x12\x13\n\x04user\x18\n \x01(\x0b\x32\x05.User\x12$\n\x18\x61ssistantProviderModelId\x18\x0c \x01(\x04\x42\x02\x30\x01\x12\x43\n\x1c\x61ssistantConversationMessage\x18\r \x03(\x0b\x32\x1d.AssistantConversationMessage\x12\x12\n\nidentifier\x18\x0e \x01(\t\x12\x0e\n\x06status\x18\x0f \x01(\t\x12/\n\x0b\x63reatedDate\x18\x1a \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdatedDate\x18\x1b \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x08\x63ontexts\x18\x1c \x03(\x0b\x32\x1d.AssistantConversationContext\x12\x18\n\x07metrics\x18\x1e \x03(\x0b\x32\x07.Metric\x12\x1b\n\x08metadata\x18 \x03(\x0b\x32\t.Metadata\x12\x1c\n\targuments\x18\x1f \x03(\x0b\x32\t.Argument\x12\x1a\n\x07options\x18! \x03(\x0b\x32\t.Metadata\x12\x11\n\tdirection\x18\" \x01(\t\x12\x33\n\nrecordings\x18# \x03(\x0b\x32\x1f.AssistantConversationRecording\x12=\n\x0ftelephonyEvents\x18$ \x03(\x0b\x32$.AssistantConversationTelephonyEvent\"\x91\x01\n\"GetAllAssistantConversationRequest\x12\x17\n\x0b\x61ssistantId\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x1b\n\x08paginate\x18\x02 \x01(\x0b\x32\t.Paginate\x12\x1c\n\tcriterias\x18\x03 \x03(\x0b\x32\t.Criteria\x12\x17\n\x06source\x18\x07 \x01(\x0e\x32\x07.Source\"\xa0\x01\n#GetAllAssistantConversationResponse\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12$\n\x04\x64\x61ta\x18\x03 \x03(\x0b\x32\x16.AssistantConversation\x12\x15\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x06.Error\x12\x1d\n\tpaginated\x18\x05 \x01(\x0b\x32\n.Paginated\"\xce\x01\n GetAllConversationMessageRequest\x12\x17\n\x0b\x61ssistantId\x18\x01 \x01(\x04\x42\x02\x30\x01\x12#\n\x17\x61ssistantConversationId\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x1b\n\x08paginate\x18\x03 \x01(\x0b\x32\t.Paginate\x12\x1c\n\tcriterias\x18\x04 \x03(\x0b\x32\t.Criteria\x12\x18\n\x05order\x18\x05 \x01(\x0b\x32\t.Ordering\x12\x17\n\x06source\x18\x07 \x01(\x0e\x32\x07.Source\"\xa5\x01\n!GetAllConversationMessageResponse\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12+\n\x04\x64\x61ta\x18\x03 \x03(\x0b\x32\x1d.AssistantConversationMessage\x12\x15\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x06.Error\x12\x1d\n\tpaginated\x18\x05 \x01(\x0b\x32\n.Paginated*M\n\x06Source\x12\x0e\n\nWEB_PLUGIN\x10\x00\x12\x0c\n\x08\x44\x45\x42UGGER\x10\x01\x12\x07\n\x03SDK\x10\x02\x12\x0e\n\nPHONE_CALL\x10\x03\x12\x0c\n\x08WHATSAPP\x10\x04\x42\x35\n\x17\x61i.rapida.sdk.artifactsZ\x1agithub.com/rapidaai/protosb\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -52,8 +52,6 @@ _globals['_TAG'].fields_by_name['id']._serialized_options = b'0\001' _globals['_ORGANIZATION'].fields_by_name['id']._loaded_options = None _globals['_ORGANIZATION'].fields_by_name['id']._serialized_options = b'0\001' - _globals['_TELEMETRY_ATTRIBUTESENTRY']._loaded_options = None - _globals['_TELEMETRY_ATTRIBUTESENTRY']._serialized_options = b'8\001' _globals['_KNOWLEDGE'].fields_by_name['id']._loaded_options = None _globals['_KNOWLEDGE'].fields_by_name['id']._serialized_options = b'0\001' _globals['_KNOWLEDGE'].fields_by_name['embeddingModelProviderId']._loaded_options = None @@ -80,6 +78,8 @@ _globals['_ASSISTANTCONVERSATIONMESSAGE'].fields_by_name['assistantProviderModelId']._serialized_options = b'0\001' _globals['_ASSISTANTCONVERSATIONCONTEXT'].fields_by_name['id']._loaded_options = None _globals['_ASSISTANTCONVERSATIONCONTEXT'].fields_by_name['id']._serialized_options = b'0\001' + _globals['_ASSISTANTCONVERSATIONRECORDING'].fields_by_name['id']._loaded_options = None + _globals['_ASSISTANTCONVERSATIONRECORDING'].fields_by_name['id']._serialized_options = b'0\001' _globals['_ASSISTANTCONVERSATIONTELEPHONYEVENT'].fields_by_name['id']._loaded_options = None _globals['_ASSISTANTCONVERSATIONTELEPHONYEVENT'].fields_by_name['id']._serialized_options = b'0\001' _globals['_ASSISTANTCONVERSATIONTELEPHONYEVENT'].fields_by_name['assistantConversationId']._loaded_options = None @@ -106,8 +106,8 @@ _globals['_GETALLCONVERSATIONMESSAGEREQUEST'].fields_by_name['assistantId']._serialized_options = b'0\001' _globals['_GETALLCONVERSATIONMESSAGEREQUEST'].fields_by_name['assistantConversationId']._loaded_options = None _globals['_GETALLCONVERSATIONMESSAGEREQUEST'].fields_by_name['assistantConversationId']._serialized_options = b'0\001' - _globals['_SOURCE']._serialized_start=5124 - _globals['_SOURCE']._serialized_end=5201 + _globals['_SOURCE']._serialized_start=4899 + _globals['_SOURCE']._serialized_end=4976 _globals['_FIELDSELECTOR']._serialized_start=79 _globals['_FIELDSELECTOR']._serialized_end=109 _globals['_ASSISTANTDEFINITION']._serialized_start=111 @@ -156,32 +156,28 @@ _globals['_TOOLCALL']._serialized_end=1652 _globals['_FUNCTIONCALL']._serialized_start=1654 _globals['_FUNCTIONCALL']._serialized_end=1701 - _globals['_TELEMETRY']._serialized_start=1704 - _globals['_TELEMETRY']._serialized_end=1977 - _globals['_TELEMETRY_ATTRIBUTESENTRY']._serialized_start=1928 - _globals['_TELEMETRY_ATTRIBUTESENTRY']._serialized_end=1977 - _globals['_KNOWLEDGE']._serialized_start=1980 - _globals['_KNOWLEDGE']._serialized_end=2599 - _globals['_TEXTPROMPT']._serialized_start=2601 - _globals['_TEXTPROMPT']._serialized_end=2644 - _globals['_TEXTCHATCOMPLETEPROMPT']._serialized_start=2646 - _globals['_TEXTCHATCOMPLETEPROMPT']._serialized_end=2735 - _globals['_ASSISTANTCONVERSATIONMESSAGE']._serialized_start=2738 - _globals['_ASSISTANTCONVERSATIONMESSAGE']._serialized_end=3162 - _globals['_ASSISTANTCONVERSATIONCONTEXT']._serialized_start=3165 - _globals['_ASSISTANTCONVERSATIONCONTEXT']._serialized_end=3335 - _globals['_ASSISTANTCONVERSATIONRECORDING']._serialized_start=3337 - _globals['_ASSISTANTCONVERSATIONRECORDING']._serialized_end=3391 - _globals['_ASSISTANTCONVERSATIONTELEPHONYEVENT']._serialized_start=3394 - _globals['_ASSISTANTCONVERSATIONTELEPHONYEVENT']._serialized_end=3661 - _globals['_ASSISTANTCONVERSATION']._serialized_start=3664 - _globals['_ASSISTANTCONVERSATION']._serialized_end=4434 - _globals['_GETALLASSISTANTCONVERSATIONREQUEST']._serialized_start=4437 - _globals['_GETALLASSISTANTCONVERSATIONREQUEST']._serialized_end=4582 - _globals['_GETALLASSISTANTCONVERSATIONRESPONSE']._serialized_start=4585 - _globals['_GETALLASSISTANTCONVERSATIONRESPONSE']._serialized_end=4745 - _globals['_GETALLCONVERSATIONMESSAGEREQUEST']._serialized_start=4748 - _globals['_GETALLCONVERSATIONMESSAGEREQUEST']._serialized_end=4954 - _globals['_GETALLCONVERSATIONMESSAGERESPONSE']._serialized_start=4957 - _globals['_GETALLCONVERSATIONMESSAGERESPONSE']._serialized_end=5122 + _globals['_KNOWLEDGE']._serialized_start=1704 + _globals['_KNOWLEDGE']._serialized_end=2323 + _globals['_TEXTPROMPT']._serialized_start=2325 + _globals['_TEXTPROMPT']._serialized_end=2368 + _globals['_TEXTCHATCOMPLETEPROMPT']._serialized_start=2370 + _globals['_TEXTCHATCOMPLETEPROMPT']._serialized_end=2459 + _globals['_ASSISTANTCONVERSATIONMESSAGE']._serialized_start=2462 + _globals['_ASSISTANTCONVERSATIONMESSAGE']._serialized_end=2886 + _globals['_ASSISTANTCONVERSATIONCONTEXT']._serialized_start=2889 + _globals['_ASSISTANTCONVERSATIONCONTEXT']._serialized_end=3059 + _globals['_ASSISTANTCONVERSATIONRECORDING']._serialized_start=3061 + _globals['_ASSISTANTCONVERSATIONRECORDING']._serialized_end=3166 + _globals['_ASSISTANTCONVERSATIONTELEPHONYEVENT']._serialized_start=3169 + _globals['_ASSISTANTCONVERSATIONTELEPHONYEVENT']._serialized_end=3436 + _globals['_ASSISTANTCONVERSATION']._serialized_start=3439 + _globals['_ASSISTANTCONVERSATION']._serialized_end=4209 + _globals['_GETALLASSISTANTCONVERSATIONREQUEST']._serialized_start=4212 + _globals['_GETALLASSISTANTCONVERSATIONREQUEST']._serialized_end=4357 + _globals['_GETALLASSISTANTCONVERSATIONRESPONSE']._serialized_start=4360 + _globals['_GETALLASSISTANTCONVERSATIONRESPONSE']._serialized_end=4520 + _globals['_GETALLCONVERSATIONMESSAGEREQUEST']._serialized_start=4523 + _globals['_GETALLCONVERSATIONMESSAGEREQUEST']._serialized_end=4729 + _globals['_GETALLCONVERSATIONMESSAGERESPONSE']._serialized_start=4732 + _globals['_GETALLCONVERSATIONMESSAGERESPONSE']._serialized_end=4897 # @@protoc_insertion_point(module_scope) diff --git a/rapida/clients/protos/common_pb2.pyi b/rapida/clients/protos/common_pb2.pyi index 41fe577..3d5d50a 100644 --- a/rapida/clients/protos/common_pb2.pyi +++ b/rapida/clients/protos/common_pb2.pyi @@ -250,31 +250,6 @@ class FunctionCall(_message.Message): arguments: str def __init__(self, name: _Optional[str] = ..., arguments: _Optional[str] = ...) -> None: ... -class Telemetry(_message.Message): - __slots__ = ("stageName", "startTime", "endTime", "duration", "attributes", "spanID", "parentID") - class AttributesEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: str - def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ... - STAGENAME_FIELD_NUMBER: _ClassVar[int] - STARTTIME_FIELD_NUMBER: _ClassVar[int] - ENDTIME_FIELD_NUMBER: _ClassVar[int] - DURATION_FIELD_NUMBER: _ClassVar[int] - ATTRIBUTES_FIELD_NUMBER: _ClassVar[int] - SPANID_FIELD_NUMBER: _ClassVar[int] - PARENTID_FIELD_NUMBER: _ClassVar[int] - stageName: str - startTime: _timestamp_pb2.Timestamp - endTime: _timestamp_pb2.Timestamp - duration: int - attributes: _containers.ScalarMap[str, str] - spanID: str - parentID: str - def __init__(self, stageName: _Optional[str] = ..., startTime: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., endTime: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., duration: _Optional[int] = ..., attributes: _Optional[_Mapping[str, str]] = ..., spanID: _Optional[str] = ..., parentID: _Optional[str] = ...) -> None: ... - class Knowledge(_message.Message): __slots__ = ("id", "name", "description", "visibility", "language", "embeddingModelProviderId", "embeddingModelProviderName", "knowledgeEmbeddingModelOptions", "status", "createdBy", "createdUser", "updatedBy", "updatedUser", "createdDate", "updatedDate", "organizationId", "projectId", "organization", "knowledgeTag", "documentCount", "tokenCount", "wordCount") ID_FIELD_NUMBER: _ClassVar[int] @@ -386,10 +361,14 @@ class AssistantConversationContext(_message.Message): def __init__(self, id: _Optional[int] = ..., metadata: _Optional[_Union[_struct_pb2.Struct, _Mapping]] = ..., result: _Optional[_Union[_struct_pb2.Struct, _Mapping]] = ..., query: _Optional[_Union[_struct_pb2.Struct, _Mapping]] = ...) -> None: ... class AssistantConversationRecording(_message.Message): - __slots__ = ("recordingUrl",) - RECORDINGURL_FIELD_NUMBER: _ClassVar[int] - recordingUrl: str - def __init__(self, recordingUrl: _Optional[str] = ...) -> None: ... + __slots__ = ("id", "assistantRecordingUrl", "userRecordingUrl") + ID_FIELD_NUMBER: _ClassVar[int] + ASSISTANTRECORDINGURL_FIELD_NUMBER: _ClassVar[int] + USERRECORDINGURL_FIELD_NUMBER: _ClassVar[int] + id: int + assistantRecordingUrl: str + userRecordingUrl: str + def __init__(self, id: _Optional[int] = ..., assistantRecordingUrl: _Optional[str] = ..., userRecordingUrl: _Optional[str] = ...) -> None: ... class AssistantConversationTelephonyEvent(_message.Message): __slots__ = ("id", "assistantConversationId", "provider", "eventType", "payload", "createdDate", "updatedDate") diff --git a/rapida/clients/protos/common_pb2_grpc.py b/rapida/clients/protos/common_pb2_grpc.py index b4464be..a29eaa2 100644 --- a/rapida/clients/protos/common_pb2_grpc.py +++ b/rapida/clients/protos/common_pb2_grpc.py @@ -4,7 +4,7 @@ import warnings -GRPC_GENERATED_VERSION = '1.74.0' +GRPC_GENERATED_VERSION = '1.78.0' GRPC_VERSION = grpc.__version__ _version_not_supported = False @@ -17,7 +17,7 @@ if _version_not_supported: raise RuntimeError( f'The grpc package installed is at version {GRPC_VERSION},' - + f' but the generated code in common_pb2_grpc.py depends on' + + ' but the generated code in common_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' diff --git a/rapida/clients/protos/connect_api_pb2_grpc.py b/rapida/clients/protos/connect_api_pb2_grpc.py index 00651bf..9411a0c 100644 --- a/rapida/clients/protos/connect_api_pb2_grpc.py +++ b/rapida/clients/protos/connect_api_pb2_grpc.py @@ -5,7 +5,7 @@ import rapida.clients.protos.connect_api_pb2 as connect__api__pb2 -GRPC_GENERATED_VERSION = '1.74.0' +GRPC_GENERATED_VERSION = '1.78.0' GRPC_VERSION = grpc.__version__ _version_not_supported = False @@ -18,7 +18,7 @@ if _version_not_supported: raise RuntimeError( f'The grpc package installed is at version {GRPC_VERSION},' - + f' but the generated code in connect_api_pb2_grpc.py depends on' + + ' but the generated code in connect_api_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' diff --git a/rapida/clients/protos/document_api_pb2_grpc.py b/rapida/clients/protos/document_api_pb2_grpc.py index deae6f9..1a36aeb 100644 --- a/rapida/clients/protos/document_api_pb2_grpc.py +++ b/rapida/clients/protos/document_api_pb2_grpc.py @@ -5,7 +5,7 @@ import rapida.clients.protos.document_api_pb2 as document__api__pb2 -GRPC_GENERATED_VERSION = '1.74.0' +GRPC_GENERATED_VERSION = '1.78.0' GRPC_VERSION = grpc.__version__ _version_not_supported = False @@ -18,7 +18,7 @@ if _version_not_supported: raise RuntimeError( f'The grpc package installed is at version {GRPC_VERSION},' - + f' but the generated code in document_api_pb2_grpc.py depends on' + + ' but the generated code in document_api_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' diff --git a/rapida/clients/protos/endpoint_api_pb2_grpc.py b/rapida/clients/protos/endpoint_api_pb2_grpc.py index 91c29af..e50de49 100644 --- a/rapida/clients/protos/endpoint_api_pb2_grpc.py +++ b/rapida/clients/protos/endpoint_api_pb2_grpc.py @@ -6,7 +6,7 @@ import rapida.clients.protos.common_pb2 as common__pb2 import rapida.clients.protos.endpoint_api_pb2 as endpoint__api__pb2 -GRPC_GENERATED_VERSION = '1.74.0' +GRPC_GENERATED_VERSION = '1.78.0' GRPC_VERSION = grpc.__version__ _version_not_supported = False @@ -19,7 +19,7 @@ if _version_not_supported: raise RuntimeError( f'The grpc package installed is at version {GRPC_VERSION},' - + f' but the generated code in endpoint_api_pb2_grpc.py depends on' + + ' but the generated code in endpoint_api_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' diff --git a/rapida/clients/protos/integration_api_pb2_grpc.py b/rapida/clients/protos/integration_api_pb2_grpc.py index b47ba70..c4cb7c4 100644 --- a/rapida/clients/protos/integration_api_pb2_grpc.py +++ b/rapida/clients/protos/integration_api_pb2_grpc.py @@ -5,7 +5,7 @@ import rapida.clients.protos.integration_api_pb2 as integration__api__pb2 -GRPC_GENERATED_VERSION = '1.74.0' +GRPC_GENERATED_VERSION = '1.78.0' GRPC_VERSION = grpc.__version__ _version_not_supported = False @@ -18,7 +18,7 @@ if _version_not_supported: raise RuntimeError( f'The grpc package installed is at version {GRPC_VERSION},' - + f' but the generated code in integration_api_pb2_grpc.py depends on' + + ' but the generated code in integration_api_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' diff --git a/rapida/clients/protos/invoker_api_pb2_grpc.py b/rapida/clients/protos/invoker_api_pb2_grpc.py index f63af4d..846b7cc 100644 --- a/rapida/clients/protos/invoker_api_pb2_grpc.py +++ b/rapida/clients/protos/invoker_api_pb2_grpc.py @@ -5,7 +5,7 @@ import rapida.clients.protos.invoker_api_pb2 as invoker__api__pb2 -GRPC_GENERATED_VERSION = '1.74.0' +GRPC_GENERATED_VERSION = '1.78.0' GRPC_VERSION = grpc.__version__ _version_not_supported = False @@ -18,7 +18,7 @@ if _version_not_supported: raise RuntimeError( f'The grpc package installed is at version {GRPC_VERSION},' - + f' but the generated code in invoker_api_pb2_grpc.py depends on' + + ' but the generated code in invoker_api_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' diff --git a/rapida/clients/protos/knowledge_api_pb2_grpc.py b/rapida/clients/protos/knowledge_api_pb2_grpc.py index dd959d7..8547584 100644 --- a/rapida/clients/protos/knowledge_api_pb2_grpc.py +++ b/rapida/clients/protos/knowledge_api_pb2_grpc.py @@ -6,7 +6,7 @@ import rapida.clients.protos.common_pb2 as common__pb2 import rapida.clients.protos.knowledge_api_pb2 as knowledge__api__pb2 -GRPC_GENERATED_VERSION = '1.74.0' +GRPC_GENERATED_VERSION = '1.78.0' GRPC_VERSION = grpc.__version__ _version_not_supported = False @@ -19,7 +19,7 @@ if _version_not_supported: raise RuntimeError( f'The grpc package installed is at version {GRPC_VERSION},' - + f' but the generated code in knowledge_api_pb2_grpc.py depends on' + + ' but the generated code in knowledge_api_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' diff --git a/rapida/clients/protos/notification_api_pb2_grpc.py b/rapida/clients/protos/notification_api_pb2_grpc.py index 095f222..2249328 100644 --- a/rapida/clients/protos/notification_api_pb2_grpc.py +++ b/rapida/clients/protos/notification_api_pb2_grpc.py @@ -5,7 +5,7 @@ import rapida.clients.protos.notification_api_pb2 as notification__api__pb2 -GRPC_GENERATED_VERSION = '1.74.0' +GRPC_GENERATED_VERSION = '1.78.0' GRPC_VERSION = grpc.__version__ _version_not_supported = False @@ -18,7 +18,7 @@ if _version_not_supported: raise RuntimeError( f'The grpc package installed is at version {GRPC_VERSION},' - + f' but the generated code in notification_api_pb2_grpc.py depends on' + + ' but the generated code in notification_api_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' diff --git a/rapida/clients/protos/talk_api_pb2.py b/rapida/clients/protos/talk_api_pb2.py index 999e997..29a839a 100644 --- a/rapida/clients/protos/talk_api_pb2.py +++ b/rapida/clients/protos/talk_api_pb2.py @@ -27,7 +27,7 @@ from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0etalk-api.proto\x12\x08talk_api\x1a\x19google/protobuf/any.proto\x1a\x0c\x63ommon.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xe5\x01\n\x14\x43onversationToolCall\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0e\n\x06toolId\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x36\n\x04\x61rgs\x18\x04 \x03(\x0b\x32(.talk_api.ConversationToolCall.ArgsEntry\x12(\n\x04time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a\x41\n\tArgsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12#\n\x05value\x18\x02 \x01(\x0b\x32\x14.google.protobuf.Any:\x02\x38\x01\"\xfa\x01\n\x16\x43onversationToolResult\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0e\n\x06toolId\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x38\n\x04\x61rgs\x18\x04 \x03(\x0b\x32*.talk_api.ConversationToolResult.ArgsEntry\x12\x0f\n\x07success\x18\x05 \x01(\x08\x12(\n\x04time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a\x41\n\tArgsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12#\n\x05value\x18\x02 \x01(\x0b\x32\x14.google.protobuf.Any:\x02\x38\x01\"\xa5\x03\n\x15\x43onversationDirective\x12\n\n\x02id\x18\x01 \x01(\t\x12;\n\x04type\x18\x02 \x01(\x0e\x32-.talk_api.ConversationDirective.DirectiveType\x12\x37\n\x04\x61rgs\x18\x04 \x03(\x0b\x32).talk_api.ConversationDirective.ArgsEntry\x12(\n\x04time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a\x41\n\tArgsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12#\n\x05value\x18\x02 \x01(\x0b\x32\x14.google.protobuf.Any:\x02\x38\x01\"\x9c\x01\n\rDirectiveType\x12\x1e\n\x1a\x44IRECTIVE_TYPE_UNSPECIFIED\x10\x00\x12\x14\n\x10\x45ND_CONVERSATION\x10\x01\x12\x19\n\x15TRANSFER_CONVERSATION\x10\x02\x12\x16\n\x12PAUSE_CONVERSATION\x10\x03\x12\x0f\n\x0bMUTE_CALLER\x10\n\x12\x11\n\rUNMUTE_CALLER\x10\x0b\"\x83\x05\n\x19\x43onversationConfiguration\x12#\n\x17\x61ssistantConversationId\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\'\n\tassistant\x18\x02 \x01(\x0b\x32\x14.AssistantDefinition\x12(\n\x04time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x43\n\x08metadata\x18\x04 \x03(\x0b\x32\x31.talk_api.ConversationConfiguration.MetadataEntry\x12;\n\x04\x61rgs\x18\x05 \x03(\x0b\x32-.talk_api.ConversationConfiguration.ArgsEntry\x12\x41\n\x07options\x18\x06 \x03(\x0b\x32\x30.talk_api.ConversationConfiguration.OptionsEntry\x12+\n\x0binputConfig\x18\x07 \x01(\x0b\x32\x16.talk_api.StreamConfig\x12,\n\x0coutputConfig\x18\x08 \x01(\x0b\x32\x16.talk_api.StreamConfig\x1a\x45\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12#\n\x05value\x18\x02 \x01(\x0b\x32\x14.google.protobuf.Any:\x02\x38\x01\x1a\x41\n\tArgsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12#\n\x05value\x18\x02 \x01(\x0b\x32\x14.google.protobuf.Any:\x02\x38\x01\x1a\x44\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12#\n\x05value\x18\x02 \x01(\x0b\x32\x14.google.protobuf.Any:\x02\x38\x01\"X\n\x0cStreamConfig\x12$\n\x05\x61udio\x18\x01 \x01(\x0b\x32\x15.talk_api.AudioConfig\x12\"\n\x04text\x18\x02 \x01(\x0b\x32\x14.talk_api.TextConfig\"\x94\x01\n\x0b\x41udioConfig\x12\x12\n\nsampleRate\x18\x01 \x01(\r\x12\x36\n\x0b\x61udioFormat\x18\x02 \x01(\x0e\x32!.talk_api.AudioConfig.AudioFormat\x12\x10\n\x08\x63hannels\x18\x03 \x01(\r\"\'\n\x0b\x41udioFormat\x12\x0c\n\x08LINEAR16\x10\x00\x12\n\n\x06MuLaw8\x10\x01\"\x1d\n\nTextConfig\x12\x0f\n\x07\x63harset\x18\x01 \x01(\t\"\x81\x02\n\x18\x43onversationInterruption\x12\n\n\x02id\x18\x01 \x01(\t\x12\x41\n\x04type\x18\x02 \x01(\x0e\x32\x33.talk_api.ConversationInterruption.InterruptionType\x12(\n\x04time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"l\n\x10InterruptionType\x12!\n\x1dINTERRUPTION_TYPE_UNSPECIFIED\x10\x00\x12\x19\n\x15INTERRUPTION_TYPE_VAD\x10\x01\x12\x1a\n\x16INTERRUPTION_TYPE_WORD\x10\x02\"\x93\x01\n\x1c\x43onversationAssistantMessage\x12\x0f\n\x05\x61udio\x18\n \x01(\x0cH\x00\x12\x0e\n\x04text\x18\x0b \x01(\tH\x00\x12\n\n\x02id\x18\x02 \x01(\t\x12\x11\n\tcompleted\x18\x03 \x01(\x08\x12(\n\x04time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\t\n\x07message\"\x8e\x01\n\x17\x43onversationUserMessage\x12\x0f\n\x05\x61udio\x18\n \x01(\x0cH\x00\x12\x0e\n\x04text\x18\x0b \x01(\tH\x00\x12\n\n\x02id\x18\x02 \x01(\t\x12\x11\n\tcompleted\x18\x03 \x01(\x08\x12(\n\x04time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\t\n\x07message\"\x93\x01\n\x12\x41ssistantTalkInput\x12<\n\rconfiguration\x18\x02 \x01(\x0b\x32#.talk_api.ConversationConfigurationH\x00\x12\x34\n\x07message\x18\x03 \x01(\x0b\x32!.talk_api.ConversationUserMessageH\x00\x42\t\n\x07request\"\xdd\x03\n\x13\x41ssistantTalkOutput\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12<\n\rconfiguration\x18\t \x01(\x0b\x32#.talk_api.ConversationConfigurationH\x00\x12:\n\x0cinterruption\x18\n \x01(\x0b\x32\".talk_api.ConversationInterruptionH\x00\x12\x31\n\x04user\x18\x0b \x01(\x0b\x32!.talk_api.ConversationUserMessageH\x00\x12;\n\tassistant\x18\x0c \x01(\x0b\x32&.talk_api.ConversationAssistantMessageH\x00\x12.\n\x04tool\x18\r \x01(\x0b\x32\x1e.talk_api.ConversationToolCallH\x00\x12\x36\n\ntoolResult\x18\x0e \x01(\x0b\x32 .talk_api.ConversationToolResultH\x00\x12\x34\n\tdirective\x18\x10 \x01(\x0b\x32\x1f.talk_api.ConversationDirectiveH\x00\x12\x17\n\x05\x65rror\x18\x0f \x01(\x0b\x32\x06.ErrorH\x00\x42\x06\n\x04\x64\x61ta\"\x87\x01\n\x1a\x43reateMessageMetricRequest\x12\x17\n\x0b\x61ssistantId\x18\x01 \x01(\x04\x42\x02\x30\x01\x12#\n\x17\x61ssistantConversationId\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x11\n\tmessageId\x18\x03 \x01(\t\x12\x18\n\x07metrics\x18\x04 \x03(\x0b\x32\x07.Metric\"j\n\x1b\x43reateMessageMetricResponse\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12\x15\n\x04\x64\x61ta\x18\x03 \x03(\x0b\x32\x07.Metric\x12\x15\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x06.Error\"y\n\x1f\x43reateConversationMetricRequest\x12\x17\n\x0b\x61ssistantId\x18\x01 \x01(\x04\x42\x02\x30\x01\x12#\n\x17\x61ssistantConversationId\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x18\n\x07metrics\x18\x03 \x03(\x0b\x32\x07.Metric\"o\n CreateConversationMetricResponse\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12\x15\n\x04\x64\x61ta\x18\x03 \x03(\x0b\x32\x07.Metric\x12\x15\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x06.Error\"\xf3\x03\n\x16\x43reatePhoneCallRequest\x12\'\n\tassistant\x18\x01 \x01(\x0b\x32\x14.AssistantDefinition\x12@\n\x08metadata\x18\x03 \x03(\x0b\x32..talk_api.CreatePhoneCallRequest.MetadataEntry\x12\x38\n\x04\x61rgs\x18\x04 \x03(\x0b\x32*.talk_api.CreatePhoneCallRequest.ArgsEntry\x12>\n\x07options\x18\x05 \x03(\x0b\x32-.talk_api.CreatePhoneCallRequest.OptionsEntry\x12\x12\n\nfromNumber\x18\x06 \x01(\t\x12\x10\n\x08toNumber\x18\x07 \x01(\t\x1a\x45\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12#\n\x05value\x18\x02 \x01(\x0b\x32\x14.google.protobuf.Any:\x02\x38\x01\x1a\x41\n\tArgsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12#\n\x05value\x18\x02 \x01(\x0b\x32\x14.google.protobuf.Any:\x02\x38\x01\x1a\x44\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12#\n\x05value\x18\x02 \x01(\x0b\x32\x14.google.protobuf.Any:\x02\x38\x01\"u\n\x17\x43reatePhoneCallResponse\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12$\n\x04\x64\x61ta\x18\x03 \x01(\x0b\x32\x16.AssistantConversation\x12\x15\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x06.Error\"R\n\x1a\x43reateBulkPhoneCallRequest\x12\x34\n\nphoneCalls\x18\x06 \x03(\x0b\x32 .talk_api.CreatePhoneCallRequest\"y\n\x1b\x43reateBulkPhoneCallResponse\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12$\n\x04\x64\x61ta\x18\x03 \x03(\x0b\x32\x16.AssistantConversation\x12\x15\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x06.Error\"\xc6\x01\n\tTalkInput\x12<\n\rconfiguration\x18\x02 \x01(\x0b\x32#.talk_api.ConversationConfigurationH\x00\x12\x34\n\x07message\x18\x03 \x01(\x0b\x32!.talk_api.ConversationUserMessageH\x00\x12:\n\x0cinterruption\x18\x04 \x01(\x0b\x32\".talk_api.ConversationInterruptionH\x00\x42\t\n\x07request\"\xe3\x02\n\nTalkOutput\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12:\n\x0cinterruption\x18\n \x01(\x0b\x32\".talk_api.ConversationInterruptionH\x00\x12;\n\tassistant\x18\x0c \x01(\x0b\x32&.talk_api.ConversationAssistantMessageH\x00\x12.\n\x04tool\x18\r \x01(\x0b\x32\x1e.talk_api.ConversationToolCallH\x00\x12\x36\n\ntoolResult\x18\x0e \x01(\x0b\x32 .talk_api.ConversationToolResultH\x00\x12\x34\n\tdirective\x18\x10 \x01(\x0b\x32\x1f.talk_api.ConversationDirectiveH\x00\x12\x17\n\x05\x65rror\x18\x0f \x01(\x0b\x32\x06.ErrorH\x00\x42\x06\n\x04\x64\x61ta2\xc0\x05\n\x0bTalkService\x12P\n\rAssistantTalk\x12\x1c.talk_api.AssistantTalkInput\x1a\x1d.talk_api.AssistantTalkOutput(\x01\x30\x01\x12h\n\x1bGetAllAssistantConversation\x12#.GetAllAssistantConversationRequest\x1a$.GetAllAssistantConversationResponse\x12\x62\n\x19GetAllConversationMessage\x12!.GetAllConversationMessageRequest\x1a\".GetAllConversationMessageResponse\x12\x62\n\x13\x43reateMessageMetric\x12$.talk_api.CreateMessageMetricRequest\x1a%.talk_api.CreateMessageMetricResponse\x12q\n\x18\x43reateConversationMetric\x12).talk_api.CreateConversationMetricRequest\x1a*.talk_api.CreateConversationMetricResponse\x12V\n\x0f\x43reatePhoneCall\x12 .talk_api.CreatePhoneCallRequest\x1a!.talk_api.CreatePhoneCallResponse\x12\x62\n\x13\x43reateBulkPhoneCall\x12$.talk_api.CreateBulkPhoneCallRequest\x1a%.talk_api.CreateBulkPhoneCallResponse2A\n\x08\x41gentKit\x12\x35\n\x04Talk\x12\x13.talk_api.TalkInput\x1a\x14.talk_api.TalkOutput(\x01\x30\x01\x42\x35\n\x17\x61i.rapida.sdk.artifactsZ\x1agithub.com/rapidaai/protosb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0etalk-api.proto\x12\x08talk_api\x1a\x19google/protobuf/any.proto\x1a\x0c\x63ommon.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xe5\x01\n\x14\x43onversationToolCall\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0e\n\x06toolId\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x36\n\x04\x61rgs\x18\x04 \x03(\x0b\x32(.talk_api.ConversationToolCall.ArgsEntry\x12(\n\x04time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a\x41\n\tArgsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12#\n\x05value\x18\x02 \x01(\x0b\x32\x14.google.protobuf.Any:\x02\x38\x01\"\xfa\x01\n\x16\x43onversationToolResult\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0e\n\x06toolId\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x38\n\x04\x61rgs\x18\x04 \x03(\x0b\x32*.talk_api.ConversationToolResult.ArgsEntry\x12\x0f\n\x07success\x18\x05 \x01(\x08\x12(\n\x04time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a\x41\n\tArgsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12#\n\x05value\x18\x02 \x01(\x0b\x32\x14.google.protobuf.Any:\x02\x38\x01\"S\n\x12\x43onversationMetric\x12#\n\x17\x61ssistantConversationId\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x18\n\x07metrics\x18\x02 \x03(\x0b\x32\x07.Metric\"X\n\x14\x43onversationMetadata\x12#\n\x17\x61ssistantConversationId\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x1b\n\x08metadata\x18\x02 \x03(\x0b\x32\t.Metadata\"\xe8\x02\n\x15\x43onversationDirective\x12\n\n\x02id\x18\x01 \x01(\t\x12;\n\x04type\x18\x02 \x01(\x0e\x32-.talk_api.ConversationDirective.DirectiveType\x12\x37\n\x04\x61rgs\x18\x04 \x03(\x0b\x32).talk_api.ConversationDirective.ArgsEntry\x12(\n\x04time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a\x41\n\tArgsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12#\n\x05value\x18\x02 \x01(\x0b\x32\x14.google.protobuf.Any:\x02\x38\x01\"`\n\rDirectiveType\x12\x1e\n\x1a\x44IRECTIVE_TYPE_UNSPECIFIED\x10\x00\x12\x14\n\x10\x45ND_CONVERSATION\x10\x01\x12\x19\n\x15TRANSFER_CONVERSATION\x10\x02\"\xca\x01\n\x11\x43onversationError\x12#\n\x17\x61ssistantConversationId\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x0f\n\x07message\x18\x02 \x01(\t\x12\x39\n\x07\x64\x65tails\x18\x03 \x03(\x0b\x32(.talk_api.ConversationError.DetailsEntry\x1a\x44\n\x0c\x44\x65tailsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12#\n\x05value\x18\x02 \x01(\x0b\x32\x14.google.protobuf.Any:\x02\x38\x01\"\xb9\x01\n\x11\x43onversationEvent\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x33\n\x04\x64\x61ta\x18\x03 \x03(\x0b\x32%.talk_api.ConversationEvent.DataEntry\x12(\n\x04time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a+\n\tDataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x94\x01\n\x0b\x41udioConfig\x12\x12\n\nsampleRate\x18\x01 \x01(\r\x12\x36\n\x0b\x61udioFormat\x18\x02 \x01(\x0e\x32!.talk_api.AudioConfig.AudioFormat\x12\x10\n\x08\x63hannels\x18\x03 \x01(\r\"\'\n\x0b\x41udioFormat\x12\x0c\n\x08LINEAR16\x10\x00\x12\n\n\x06MuLaw8\x10\x01\"\x1d\n\nTextConfig\x12\x0f\n\x07\x63harset\x18\x01 \x01(\t\"X\n\x0cStreamConfig\x12$\n\x05\x61udio\x18\x01 \x01(\x0b\x32\x15.talk_api.AudioConfig\x12\"\n\x04text\x18\x02 \x01(\x0b\x32\x14.talk_api.TextConfig\"\x1d\n\x0bWebIdentity\x12\x0e\n\x06userId\x18\x01 \x01(\t\"$\n\rPhoneIdentity\x12\x13\n\x0bphoneNumber\x18\x01 \x01(\t\"\xb6\x05\n\x1a\x43onversationInitialization\x12#\n\x17\x61ssistantConversationId\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\'\n\tassistant\x18\x02 \x01(\x0b\x32\x14.AssistantDefinition\x12(\n\x04time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x44\n\x08metadata\x18\x04 \x03(\x0b\x32\x32.talk_api.ConversationInitialization.MetadataEntry\x12<\n\x04\x61rgs\x18\x05 \x03(\x0b\x32..talk_api.ConversationInitialization.ArgsEntry\x12\x42\n\x07options\x18\x06 \x03(\x0b\x32\x31.talk_api.ConversationInitialization.OptionsEntry\x12(\n\nstreamMode\x18\x07 \x01(\x0e\x32\x14.talk_api.StreamMode\x12(\n\x05phone\x18\n \x01(\x0b\x32\x17.talk_api.PhoneIdentityH\x00\x12$\n\x03web\x18\x0b \x01(\x0b\x32\x15.talk_api.WebIdentityH\x00\x1a\x45\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12#\n\x05value\x18\x02 \x01(\x0b\x32\x14.google.protobuf.Any:\x02\x38\x01\x1a\x41\n\tArgsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12#\n\x05value\x18\x02 \x01(\x0b\x32\x14.google.protobuf.Any:\x02\x38\x01\x1a\x44\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12#\n\x05value\x18\x02 \x01(\x0b\x32\x14.google.protobuf.Any:\x02\x38\x01\x42\x0e\n\x0cuserIdentity\"E\n\x19\x43onversationConfiguration\x12(\n\nstreamMode\x18\x02 \x01(\x0e\x32\x14.talk_api.StreamMode\"\x81\x02\n\x18\x43onversationInterruption\x12\n\n\x02id\x18\x01 \x01(\t\x12\x41\n\x04type\x18\x02 \x01(\x0e\x32\x33.talk_api.ConversationInterruption.InterruptionType\x12(\n\x04time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"l\n\x10InterruptionType\x12!\n\x1dINTERRUPTION_TYPE_UNSPECIFIED\x10\x00\x12\x19\n\x15INTERRUPTION_TYPE_VAD\x10\x01\x12\x1a\n\x16INTERRUPTION_TYPE_WORD\x10\x02\"\xfd\x01\n\x19\x43onversationDisconnection\x12\x43\n\x04type\x18\x02 \x01(\x0e\x32\x35.talk_api.ConversationDisconnection.DisconnectionType\x12(\n\x04time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"q\n\x11\x44isconnectionType\x12\"\n\x1e\x44ISCONNECTION_TYPE_UNSPECIFIED\x10\x00\x12\x1b\n\x17\x44ISCONNECTION_TYPE_TOOL\x10\x01\x12\x1b\n\x17\x44ISCONNECTION_TYPE_USER\x10\x02\"\x93\x01\n\x1c\x43onversationAssistantMessage\x12\x0f\n\x05\x61udio\x18\n \x01(\x0cH\x00\x12\x0e\n\x04text\x18\x0b \x01(\tH\x00\x12\n\n\x02id\x18\x02 \x01(\t\x12\x11\n\tcompleted\x18\x03 \x01(\x08\x12(\n\x04time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\t\n\x07message\"\x8e\x01\n\x17\x43onversationUserMessage\x12\x0f\n\x05\x61udio\x18\n \x01(\x0cH\x00\x12\x0e\n\x04text\x18\x0b \x01(\tH\x00\x12\n\n\x02id\x18\x02 \x01(\t\x12\x11\n\tcompleted\x18\x03 \x01(\x08\x12(\n\x04time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\t\n\x07message\"\xcb\x01\n\x16\x43onversationModeChange\x12\x37\n\x04mode\x18\x01 \x01(\x0e\x32).talk_api.ConversationModeChange.ModeType\x12(\n\x04time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"N\n\x08ModeType\x12\x19\n\x15MODE_TYPE_UNSPECIFIED\x10\x00\x12\x13\n\x0fMODE_TYPE_AUDIO\x10\x01\x12\x12\n\x0eMODE_TYPE_TEXT\x10\x02\"\xf7\x02\n\x14\x41ssistantTalkRequest\x12>\n\x0einitialization\x18\x01 \x01(\x0b\x32$.talk_api.ConversationInitializationH\x00\x12<\n\rconfiguration\x18\x02 \x01(\x0b\x32#.talk_api.ConversationConfigurationH\x00\x12\x34\n\x07message\x18\x03 \x01(\x0b\x32!.talk_api.ConversationUserMessageH\x00\x12\x32\n\x08metadata\x18\x04 \x01(\x0b\x32\x1e.talk_api.ConversationMetadataH\x00\x12.\n\x06metric\x18\x05 \x01(\x0b\x32\x1c.talk_api.ConversationMetricH\x00\x12<\n\rdisconnection\x18\x06 \x01(\x0b\x32#.talk_api.ConversationDisconnectionH\x00\x42\t\n\x07request\"\x88\x06\n\x15\x41ssistantTalkResponse\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12>\n\x0einitialization\x18\x08 \x01(\x0b\x32$.talk_api.ConversationInitializationH\x00\x12<\n\rconfiguration\x18\t \x01(\x0b\x32#.talk_api.ConversationConfigurationH\x00\x12:\n\x0cinterruption\x18\n \x01(\x0b\x32\".talk_api.ConversationInterruptionH\x00\x12\x31\n\x04user\x18\x0b \x01(\x0b\x32!.talk_api.ConversationUserMessageH\x00\x12;\n\tassistant\x18\x0c \x01(\x0b\x32&.talk_api.ConversationAssistantMessageH\x00\x12\x32\n\x08toolCall\x18\r \x01(\x0b\x32\x1e.talk_api.ConversationToolCallH\x00\x12\x36\n\ntoolResult\x18\x0e \x01(\x0b\x32 .talk_api.ConversationToolResultH\x00\x12\x34\n\tdirective\x18\x10 \x01(\x0b\x32\x1f.talk_api.ConversationDirectiveH\x00\x12\x32\n\x08metadata\x18\x11 \x01(\x0b\x32\x1e.talk_api.ConversationMetadataH\x00\x12.\n\x06metric\x18\x12 \x01(\x0b\x32\x1c.talk_api.ConversationMetricH\x00\x12<\n\rdisconnection\x18\x13 \x01(\x0b\x32#.talk_api.ConversationDisconnectionH\x00\x12,\n\x05\x65vent\x18\x14 \x01(\x0b\x32\x1b.talk_api.ConversationEventH\x00\x12,\n\x05\x65rror\x18\x0f \x01(\x0b\x32\x1b.talk_api.ConversationErrorH\x00\x42\x06\n\x04\x64\x61ta\"\x87\x01\n\x1a\x43reateMessageMetricRequest\x12\x17\n\x0b\x61ssistantId\x18\x01 \x01(\x04\x42\x02\x30\x01\x12#\n\x17\x61ssistantConversationId\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x11\n\tmessageId\x18\x03 \x01(\t\x12\x18\n\x07metrics\x18\x04 \x03(\x0b\x32\x07.Metric\"j\n\x1b\x43reateMessageMetricResponse\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12\x15\n\x04\x64\x61ta\x18\x03 \x03(\x0b\x32\x07.Metric\x12\x15\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x06.Error\"y\n\x1f\x43reateConversationMetricRequest\x12\x17\n\x0b\x61ssistantId\x18\x01 \x01(\x04\x42\x02\x30\x01\x12#\n\x17\x61ssistantConversationId\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x18\n\x07metrics\x18\x03 \x03(\x0b\x32\x07.Metric\"o\n CreateConversationMetricResponse\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12\x15\n\x04\x64\x61ta\x18\x03 \x03(\x0b\x32\x07.Metric\x12\x15\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x06.Error\"\xf3\x03\n\x16\x43reatePhoneCallRequest\x12\'\n\tassistant\x18\x01 \x01(\x0b\x32\x14.AssistantDefinition\x12@\n\x08metadata\x18\x03 \x03(\x0b\x32..talk_api.CreatePhoneCallRequest.MetadataEntry\x12\x38\n\x04\x61rgs\x18\x04 \x03(\x0b\x32*.talk_api.CreatePhoneCallRequest.ArgsEntry\x12>\n\x07options\x18\x05 \x03(\x0b\x32-.talk_api.CreatePhoneCallRequest.OptionsEntry\x12\x12\n\nfromNumber\x18\x06 \x01(\t\x12\x10\n\x08toNumber\x18\x07 \x01(\t\x1a\x45\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12#\n\x05value\x18\x02 \x01(\x0b\x32\x14.google.protobuf.Any:\x02\x38\x01\x1a\x41\n\tArgsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12#\n\x05value\x18\x02 \x01(\x0b\x32\x14.google.protobuf.Any:\x02\x38\x01\x1a\x44\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12#\n\x05value\x18\x02 \x01(\x0b\x32\x14.google.protobuf.Any:\x02\x38\x01\"u\n\x17\x43reatePhoneCallResponse\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12$\n\x04\x64\x61ta\x18\x03 \x01(\x0b\x32\x16.AssistantConversation\x12\x15\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x06.Error\"R\n\x1a\x43reateBulkPhoneCallRequest\x12\x34\n\nphoneCalls\x18\x06 \x03(\x0b\x32 .talk_api.CreatePhoneCallRequest\"y\n\x1b\x43reateBulkPhoneCallResponse\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12$\n\x04\x64\x61ta\x18\x03 \x03(\x0b\x32\x16.AssistantConversation\x12\x15\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x06.Error*l\n\nStreamMode\x12\x1b\n\x17STREAM_MODE_UNSPECIFIED\x10\x00\x12\x14\n\x10STREAM_MODE_TEXT\x10\x01\x12\x15\n\x11STREAM_MODE_AUDIO\x10\x02\x12\x14\n\x10STREAM_MODE_BOTH\x10\x03\x32\xc4\x05\n\x0bTalkService\x12T\n\rAssistantTalk\x12\x1e.talk_api.AssistantTalkRequest\x1a\x1f.talk_api.AssistantTalkResponse(\x01\x30\x01\x12h\n\x1bGetAllAssistantConversation\x12#.GetAllAssistantConversationRequest\x1a$.GetAllAssistantConversationResponse\x12\x62\n\x19GetAllConversationMessage\x12!.GetAllConversationMessageRequest\x1a\".GetAllConversationMessageResponse\x12\x62\n\x13\x43reateMessageMetric\x12$.talk_api.CreateMessageMetricRequest\x1a%.talk_api.CreateMessageMetricResponse\x12q\n\x18\x43reateConversationMetric\x12).talk_api.CreateConversationMetricRequest\x1a*.talk_api.CreateConversationMetricResponse\x12V\n\x0f\x43reatePhoneCall\x12 .talk_api.CreatePhoneCallRequest\x1a!.talk_api.CreatePhoneCallResponse\x12\x62\n\x13\x43reateBulkPhoneCall\x12$.talk_api.CreateBulkPhoneCallRequest\x1a%.talk_api.CreateBulkPhoneCallResponseB5\n\x17\x61i.rapida.sdk.artifactsZ\x1agithub.com/rapidaai/protosb\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -39,16 +39,26 @@ _globals['_CONVERSATIONTOOLCALL_ARGSENTRY']._serialized_options = b'8\001' _globals['_CONVERSATIONTOOLRESULT_ARGSENTRY']._loaded_options = None _globals['_CONVERSATIONTOOLRESULT_ARGSENTRY']._serialized_options = b'8\001' + _globals['_CONVERSATIONMETRIC'].fields_by_name['assistantConversationId']._loaded_options = None + _globals['_CONVERSATIONMETRIC'].fields_by_name['assistantConversationId']._serialized_options = b'0\001' + _globals['_CONVERSATIONMETADATA'].fields_by_name['assistantConversationId']._loaded_options = None + _globals['_CONVERSATIONMETADATA'].fields_by_name['assistantConversationId']._serialized_options = b'0\001' _globals['_CONVERSATIONDIRECTIVE_ARGSENTRY']._loaded_options = None _globals['_CONVERSATIONDIRECTIVE_ARGSENTRY']._serialized_options = b'8\001' - _globals['_CONVERSATIONCONFIGURATION_METADATAENTRY']._loaded_options = None - _globals['_CONVERSATIONCONFIGURATION_METADATAENTRY']._serialized_options = b'8\001' - _globals['_CONVERSATIONCONFIGURATION_ARGSENTRY']._loaded_options = None - _globals['_CONVERSATIONCONFIGURATION_ARGSENTRY']._serialized_options = b'8\001' - _globals['_CONVERSATIONCONFIGURATION_OPTIONSENTRY']._loaded_options = None - _globals['_CONVERSATIONCONFIGURATION_OPTIONSENTRY']._serialized_options = b'8\001' - _globals['_CONVERSATIONCONFIGURATION'].fields_by_name['assistantConversationId']._loaded_options = None - _globals['_CONVERSATIONCONFIGURATION'].fields_by_name['assistantConversationId']._serialized_options = b'0\001' + _globals['_CONVERSATIONERROR_DETAILSENTRY']._loaded_options = None + _globals['_CONVERSATIONERROR_DETAILSENTRY']._serialized_options = b'8\001' + _globals['_CONVERSATIONERROR'].fields_by_name['assistantConversationId']._loaded_options = None + _globals['_CONVERSATIONERROR'].fields_by_name['assistantConversationId']._serialized_options = b'0\001' + _globals['_CONVERSATIONEVENT_DATAENTRY']._loaded_options = None + _globals['_CONVERSATIONEVENT_DATAENTRY']._serialized_options = b'8\001' + _globals['_CONVERSATIONINITIALIZATION_METADATAENTRY']._loaded_options = None + _globals['_CONVERSATIONINITIALIZATION_METADATAENTRY']._serialized_options = b'8\001' + _globals['_CONVERSATIONINITIALIZATION_ARGSENTRY']._loaded_options = None + _globals['_CONVERSATIONINITIALIZATION_ARGSENTRY']._serialized_options = b'8\001' + _globals['_CONVERSATIONINITIALIZATION_OPTIONSENTRY']._loaded_options = None + _globals['_CONVERSATIONINITIALIZATION_OPTIONSENTRY']._serialized_options = b'8\001' + _globals['_CONVERSATIONINITIALIZATION'].fields_by_name['assistantConversationId']._loaded_options = None + _globals['_CONVERSATIONINITIALIZATION'].fields_by_name['assistantConversationId']._serialized_options = b'0\001' _globals['_CREATEMESSAGEMETRICREQUEST'].fields_by_name['assistantId']._loaded_options = None _globals['_CREATEMESSAGEMETRICREQUEST'].fields_by_name['assistantId']._serialized_options = b'0\001' _globals['_CREATEMESSAGEMETRICREQUEST'].fields_by_name['assistantConversationId']._loaded_options = None @@ -63,6 +73,8 @@ _globals['_CREATEPHONECALLREQUEST_ARGSENTRY']._serialized_options = b'8\001' _globals['_CREATEPHONECALLREQUEST_OPTIONSENTRY']._loaded_options = None _globals['_CREATEPHONECALLREQUEST_OPTIONSENTRY']._serialized_options = b'8\001' + _globals['_STREAMMODE']._serialized_start=6111 + _globals['_STREAMMODE']._serialized_end=6219 _globals['_CONVERSATIONTOOLCALL']._serialized_start=103 _globals['_CONVERSATIONTOOLCALL']._serialized_end=332 _globals['_CONVERSATIONTOOLCALL_ARGSENTRY']._serialized_start=267 @@ -71,68 +83,88 @@ _globals['_CONVERSATIONTOOLRESULT']._serialized_end=585 _globals['_CONVERSATIONTOOLRESULT_ARGSENTRY']._serialized_start=267 _globals['_CONVERSATIONTOOLRESULT_ARGSENTRY']._serialized_end=332 - _globals['_CONVERSATIONDIRECTIVE']._serialized_start=588 - _globals['_CONVERSATIONDIRECTIVE']._serialized_end=1009 + _globals['_CONVERSATIONMETRIC']._serialized_start=587 + _globals['_CONVERSATIONMETRIC']._serialized_end=670 + _globals['_CONVERSATIONMETADATA']._serialized_start=672 + _globals['_CONVERSATIONMETADATA']._serialized_end=760 + _globals['_CONVERSATIONDIRECTIVE']._serialized_start=763 + _globals['_CONVERSATIONDIRECTIVE']._serialized_end=1123 _globals['_CONVERSATIONDIRECTIVE_ARGSENTRY']._serialized_start=267 _globals['_CONVERSATIONDIRECTIVE_ARGSENTRY']._serialized_end=332 - _globals['_CONVERSATIONDIRECTIVE_DIRECTIVETYPE']._serialized_start=853 - _globals['_CONVERSATIONDIRECTIVE_DIRECTIVETYPE']._serialized_end=1009 - _globals['_CONVERSATIONCONFIGURATION']._serialized_start=1012 - _globals['_CONVERSATIONCONFIGURATION']._serialized_end=1655 - _globals['_CONVERSATIONCONFIGURATION_METADATAENTRY']._serialized_start=1449 - _globals['_CONVERSATIONCONFIGURATION_METADATAENTRY']._serialized_end=1518 - _globals['_CONVERSATIONCONFIGURATION_ARGSENTRY']._serialized_start=267 - _globals['_CONVERSATIONCONFIGURATION_ARGSENTRY']._serialized_end=332 - _globals['_CONVERSATIONCONFIGURATION_OPTIONSENTRY']._serialized_start=1587 - _globals['_CONVERSATIONCONFIGURATION_OPTIONSENTRY']._serialized_end=1655 - _globals['_STREAMCONFIG']._serialized_start=1657 - _globals['_STREAMCONFIG']._serialized_end=1745 - _globals['_AUDIOCONFIG']._serialized_start=1748 - _globals['_AUDIOCONFIG']._serialized_end=1896 - _globals['_AUDIOCONFIG_AUDIOFORMAT']._serialized_start=1857 - _globals['_AUDIOCONFIG_AUDIOFORMAT']._serialized_end=1896 - _globals['_TEXTCONFIG']._serialized_start=1898 - _globals['_TEXTCONFIG']._serialized_end=1927 - _globals['_CONVERSATIONINTERRUPTION']._serialized_start=1930 - _globals['_CONVERSATIONINTERRUPTION']._serialized_end=2187 - _globals['_CONVERSATIONINTERRUPTION_INTERRUPTIONTYPE']._serialized_start=2079 - _globals['_CONVERSATIONINTERRUPTION_INTERRUPTIONTYPE']._serialized_end=2187 - _globals['_CONVERSATIONASSISTANTMESSAGE']._serialized_start=2190 - _globals['_CONVERSATIONASSISTANTMESSAGE']._serialized_end=2337 - _globals['_CONVERSATIONUSERMESSAGE']._serialized_start=2340 - _globals['_CONVERSATIONUSERMESSAGE']._serialized_end=2482 - _globals['_ASSISTANTTALKINPUT']._serialized_start=2485 - _globals['_ASSISTANTTALKINPUT']._serialized_end=2632 - _globals['_ASSISTANTTALKOUTPUT']._serialized_start=2635 - _globals['_ASSISTANTTALKOUTPUT']._serialized_end=3112 - _globals['_CREATEMESSAGEMETRICREQUEST']._serialized_start=3115 - _globals['_CREATEMESSAGEMETRICREQUEST']._serialized_end=3250 - _globals['_CREATEMESSAGEMETRICRESPONSE']._serialized_start=3252 - _globals['_CREATEMESSAGEMETRICRESPONSE']._serialized_end=3358 - _globals['_CREATECONVERSATIONMETRICREQUEST']._serialized_start=3360 - _globals['_CREATECONVERSATIONMETRICREQUEST']._serialized_end=3481 - _globals['_CREATECONVERSATIONMETRICRESPONSE']._serialized_start=3483 - _globals['_CREATECONVERSATIONMETRICRESPONSE']._serialized_end=3594 - _globals['_CREATEPHONECALLREQUEST']._serialized_start=3597 - _globals['_CREATEPHONECALLREQUEST']._serialized_end=4096 - _globals['_CREATEPHONECALLREQUEST_METADATAENTRY']._serialized_start=1449 - _globals['_CREATEPHONECALLREQUEST_METADATAENTRY']._serialized_end=1518 + _globals['_CONVERSATIONDIRECTIVE_DIRECTIVETYPE']._serialized_start=1027 + _globals['_CONVERSATIONDIRECTIVE_DIRECTIVETYPE']._serialized_end=1123 + _globals['_CONVERSATIONERROR']._serialized_start=1126 + _globals['_CONVERSATIONERROR']._serialized_end=1328 + _globals['_CONVERSATIONERROR_DETAILSENTRY']._serialized_start=1260 + _globals['_CONVERSATIONERROR_DETAILSENTRY']._serialized_end=1328 + _globals['_CONVERSATIONEVENT']._serialized_start=1331 + _globals['_CONVERSATIONEVENT']._serialized_end=1516 + _globals['_CONVERSATIONEVENT_DATAENTRY']._serialized_start=1473 + _globals['_CONVERSATIONEVENT_DATAENTRY']._serialized_end=1516 + _globals['_AUDIOCONFIG']._serialized_start=1519 + _globals['_AUDIOCONFIG']._serialized_end=1667 + _globals['_AUDIOCONFIG_AUDIOFORMAT']._serialized_start=1628 + _globals['_AUDIOCONFIG_AUDIOFORMAT']._serialized_end=1667 + _globals['_TEXTCONFIG']._serialized_start=1669 + _globals['_TEXTCONFIG']._serialized_end=1698 + _globals['_STREAMCONFIG']._serialized_start=1700 + _globals['_STREAMCONFIG']._serialized_end=1788 + _globals['_WEBIDENTITY']._serialized_start=1790 + _globals['_WEBIDENTITY']._serialized_end=1819 + _globals['_PHONEIDENTITY']._serialized_start=1821 + _globals['_PHONEIDENTITY']._serialized_end=1857 + _globals['_CONVERSATIONINITIALIZATION']._serialized_start=1860 + _globals['_CONVERSATIONINITIALIZATION']._serialized_end=2554 + _globals['_CONVERSATIONINITIALIZATION_METADATAENTRY']._serialized_start=2332 + _globals['_CONVERSATIONINITIALIZATION_METADATAENTRY']._serialized_end=2401 + _globals['_CONVERSATIONINITIALIZATION_ARGSENTRY']._serialized_start=267 + _globals['_CONVERSATIONINITIALIZATION_ARGSENTRY']._serialized_end=332 + _globals['_CONVERSATIONINITIALIZATION_OPTIONSENTRY']._serialized_start=2470 + _globals['_CONVERSATIONINITIALIZATION_OPTIONSENTRY']._serialized_end=2538 + _globals['_CONVERSATIONCONFIGURATION']._serialized_start=2556 + _globals['_CONVERSATIONCONFIGURATION']._serialized_end=2625 + _globals['_CONVERSATIONINTERRUPTION']._serialized_start=2628 + _globals['_CONVERSATIONINTERRUPTION']._serialized_end=2885 + _globals['_CONVERSATIONINTERRUPTION_INTERRUPTIONTYPE']._serialized_start=2777 + _globals['_CONVERSATIONINTERRUPTION_INTERRUPTIONTYPE']._serialized_end=2885 + _globals['_CONVERSATIONDISCONNECTION']._serialized_start=2888 + _globals['_CONVERSATIONDISCONNECTION']._serialized_end=3141 + _globals['_CONVERSATIONDISCONNECTION_DISCONNECTIONTYPE']._serialized_start=3028 + _globals['_CONVERSATIONDISCONNECTION_DISCONNECTIONTYPE']._serialized_end=3141 + _globals['_CONVERSATIONASSISTANTMESSAGE']._serialized_start=3144 + _globals['_CONVERSATIONASSISTANTMESSAGE']._serialized_end=3291 + _globals['_CONVERSATIONUSERMESSAGE']._serialized_start=3294 + _globals['_CONVERSATIONUSERMESSAGE']._serialized_end=3436 + _globals['_CONVERSATIONMODECHANGE']._serialized_start=3439 + _globals['_CONVERSATIONMODECHANGE']._serialized_end=3642 + _globals['_CONVERSATIONMODECHANGE_MODETYPE']._serialized_start=3564 + _globals['_CONVERSATIONMODECHANGE_MODETYPE']._serialized_end=3642 + _globals['_ASSISTANTTALKREQUEST']._serialized_start=3645 + _globals['_ASSISTANTTALKREQUEST']._serialized_end=4020 + _globals['_ASSISTANTTALKRESPONSE']._serialized_start=4023 + _globals['_ASSISTANTTALKRESPONSE']._serialized_end=4799 + _globals['_CREATEMESSAGEMETRICREQUEST']._serialized_start=4802 + _globals['_CREATEMESSAGEMETRICREQUEST']._serialized_end=4937 + _globals['_CREATEMESSAGEMETRICRESPONSE']._serialized_start=4939 + _globals['_CREATEMESSAGEMETRICRESPONSE']._serialized_end=5045 + _globals['_CREATECONVERSATIONMETRICREQUEST']._serialized_start=5047 + _globals['_CREATECONVERSATIONMETRICREQUEST']._serialized_end=5168 + _globals['_CREATECONVERSATIONMETRICRESPONSE']._serialized_start=5170 + _globals['_CREATECONVERSATIONMETRICRESPONSE']._serialized_end=5281 + _globals['_CREATEPHONECALLREQUEST']._serialized_start=5284 + _globals['_CREATEPHONECALLREQUEST']._serialized_end=5783 + _globals['_CREATEPHONECALLREQUEST_METADATAENTRY']._serialized_start=2332 + _globals['_CREATEPHONECALLREQUEST_METADATAENTRY']._serialized_end=2401 _globals['_CREATEPHONECALLREQUEST_ARGSENTRY']._serialized_start=267 _globals['_CREATEPHONECALLREQUEST_ARGSENTRY']._serialized_end=332 - _globals['_CREATEPHONECALLREQUEST_OPTIONSENTRY']._serialized_start=1587 - _globals['_CREATEPHONECALLREQUEST_OPTIONSENTRY']._serialized_end=1655 - _globals['_CREATEPHONECALLRESPONSE']._serialized_start=4098 - _globals['_CREATEPHONECALLRESPONSE']._serialized_end=4215 - _globals['_CREATEBULKPHONECALLREQUEST']._serialized_start=4217 - _globals['_CREATEBULKPHONECALLREQUEST']._serialized_end=4299 - _globals['_CREATEBULKPHONECALLRESPONSE']._serialized_start=4301 - _globals['_CREATEBULKPHONECALLRESPONSE']._serialized_end=4422 - _globals['_TALKINPUT']._serialized_start=4425 - _globals['_TALKINPUT']._serialized_end=4623 - _globals['_TALKOUTPUT']._serialized_start=4626 - _globals['_TALKOUTPUT']._serialized_end=4981 - _globals['_TALKSERVICE']._serialized_start=4984 - _globals['_TALKSERVICE']._serialized_end=5688 - _globals['_AGENTKIT']._serialized_start=5690 - _globals['_AGENTKIT']._serialized_end=5755 + _globals['_CREATEPHONECALLREQUEST_OPTIONSENTRY']._serialized_start=2470 + _globals['_CREATEPHONECALLREQUEST_OPTIONSENTRY']._serialized_end=2538 + _globals['_CREATEPHONECALLRESPONSE']._serialized_start=5785 + _globals['_CREATEPHONECALLRESPONSE']._serialized_end=5902 + _globals['_CREATEBULKPHONECALLREQUEST']._serialized_start=5904 + _globals['_CREATEBULKPHONECALLREQUEST']._serialized_end=5986 + _globals['_CREATEBULKPHONECALLRESPONSE']._serialized_start=5988 + _globals['_CREATEBULKPHONECALLRESPONSE']._serialized_end=6109 + _globals['_TALKSERVICE']._serialized_start=6222 + _globals['_TALKSERVICE']._serialized_end=6930 # @@protoc_insertion_point(module_scope) diff --git a/rapida/clients/protos/talk_api_pb2.pyi b/rapida/clients/protos/talk_api_pb2.pyi index f3f47e4..dd828e2 100644 --- a/rapida/clients/protos/talk_api_pb2.pyi +++ b/rapida/clients/protos/talk_api_pb2.pyi @@ -12,6 +12,17 @@ from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union DESCRIPTOR: _descriptor.FileDescriptor +class StreamMode(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + STREAM_MODE_UNSPECIFIED: _ClassVar[StreamMode] + STREAM_MODE_TEXT: _ClassVar[StreamMode] + STREAM_MODE_AUDIO: _ClassVar[StreamMode] + STREAM_MODE_BOTH: _ClassVar[StreamMode] +STREAM_MODE_UNSPECIFIED: StreamMode +STREAM_MODE_TEXT: StreamMode +STREAM_MODE_AUDIO: StreamMode +STREAM_MODE_BOTH: StreamMode + class ConversationToolCall(_message.Message): __slots__ = ("id", "toolId", "name", "args", "time") class ArgsEntry(_message.Message): @@ -56,6 +67,22 @@ class ConversationToolResult(_message.Message): time: _timestamp_pb2.Timestamp def __init__(self, id: _Optional[str] = ..., toolId: _Optional[str] = ..., name: _Optional[str] = ..., args: _Optional[_Mapping[str, _any_pb2.Any]] = ..., success: bool = ..., time: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ...) -> None: ... +class ConversationMetric(_message.Message): + __slots__ = ("assistantConversationId", "metrics") + ASSISTANTCONVERSATIONID_FIELD_NUMBER: _ClassVar[int] + METRICS_FIELD_NUMBER: _ClassVar[int] + assistantConversationId: int + metrics: _containers.RepeatedCompositeFieldContainer[_common_pb2.Metric] + def __init__(self, assistantConversationId: _Optional[int] = ..., metrics: _Optional[_Iterable[_Union[_common_pb2.Metric, _Mapping]]] = ...) -> None: ... + +class ConversationMetadata(_message.Message): + __slots__ = ("assistantConversationId", "metadata") + ASSISTANTCONVERSATIONID_FIELD_NUMBER: _ClassVar[int] + METADATA_FIELD_NUMBER: _ClassVar[int] + assistantConversationId: int + metadata: _containers.RepeatedCompositeFieldContainer[_common_pb2.Metadata] + def __init__(self, assistantConversationId: _Optional[int] = ..., metadata: _Optional[_Iterable[_Union[_common_pb2.Metadata, _Mapping]]] = ...) -> None: ... + class ConversationDirective(_message.Message): __slots__ = ("id", "type", "args", "time") class DirectiveType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): @@ -63,15 +90,9 @@ class ConversationDirective(_message.Message): DIRECTIVE_TYPE_UNSPECIFIED: _ClassVar[ConversationDirective.DirectiveType] END_CONVERSATION: _ClassVar[ConversationDirective.DirectiveType] TRANSFER_CONVERSATION: _ClassVar[ConversationDirective.DirectiveType] - PAUSE_CONVERSATION: _ClassVar[ConversationDirective.DirectiveType] - MUTE_CALLER: _ClassVar[ConversationDirective.DirectiveType] - UNMUTE_CALLER: _ClassVar[ConversationDirective.DirectiveType] DIRECTIVE_TYPE_UNSPECIFIED: ConversationDirective.DirectiveType END_CONVERSATION: ConversationDirective.DirectiveType TRANSFER_CONVERSATION: ConversationDirective.DirectiveType - PAUSE_CONVERSATION: ConversationDirective.DirectiveType - MUTE_CALLER: ConversationDirective.DirectiveType - UNMUTE_CALLER: ConversationDirective.DirectiveType class ArgsEntry(_message.Message): __slots__ = ("key", "value") KEY_FIELD_NUMBER: _ClassVar[int] @@ -89,54 +110,41 @@ class ConversationDirective(_message.Message): time: _timestamp_pb2.Timestamp def __init__(self, id: _Optional[str] = ..., type: _Optional[_Union[ConversationDirective.DirectiveType, str]] = ..., args: _Optional[_Mapping[str, _any_pb2.Any]] = ..., time: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ...) -> None: ... -class ConversationConfiguration(_message.Message): - __slots__ = ("assistantConversationId", "assistant", "time", "metadata", "args", "options", "inputConfig", "outputConfig") - class MetadataEntry(_message.Message): +class ConversationError(_message.Message): + __slots__ = ("assistantConversationId", "message", "details") + class DetailsEntry(_message.Message): __slots__ = ("key", "value") KEY_FIELD_NUMBER: _ClassVar[int] VALUE_FIELD_NUMBER: _ClassVar[int] key: str value: _any_pb2.Any def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[_any_pb2.Any, _Mapping]] = ...) -> None: ... - class ArgsEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: _any_pb2.Any - def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[_any_pb2.Any, _Mapping]] = ...) -> None: ... - class OptionsEntry(_message.Message): + ASSISTANTCONVERSATIONID_FIELD_NUMBER: _ClassVar[int] + MESSAGE_FIELD_NUMBER: _ClassVar[int] + DETAILS_FIELD_NUMBER: _ClassVar[int] + assistantConversationId: int + message: str + details: _containers.MessageMap[str, _any_pb2.Any] + def __init__(self, assistantConversationId: _Optional[int] = ..., message: _Optional[str] = ..., details: _Optional[_Mapping[str, _any_pb2.Any]] = ...) -> None: ... + +class ConversationEvent(_message.Message): + __slots__ = ("id", "name", "data", "time") + class DataEntry(_message.Message): __slots__ = ("key", "value") KEY_FIELD_NUMBER: _ClassVar[int] VALUE_FIELD_NUMBER: _ClassVar[int] key: str - value: _any_pb2.Any - def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[_any_pb2.Any, _Mapping]] = ...) -> None: ... - ASSISTANTCONVERSATIONID_FIELD_NUMBER: _ClassVar[int] - ASSISTANT_FIELD_NUMBER: _ClassVar[int] + value: str + def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ... + ID_FIELD_NUMBER: _ClassVar[int] + NAME_FIELD_NUMBER: _ClassVar[int] + DATA_FIELD_NUMBER: _ClassVar[int] TIME_FIELD_NUMBER: _ClassVar[int] - METADATA_FIELD_NUMBER: _ClassVar[int] - ARGS_FIELD_NUMBER: _ClassVar[int] - OPTIONS_FIELD_NUMBER: _ClassVar[int] - INPUTCONFIG_FIELD_NUMBER: _ClassVar[int] - OUTPUTCONFIG_FIELD_NUMBER: _ClassVar[int] - assistantConversationId: int - assistant: _common_pb2.AssistantDefinition + id: str + name: str + data: _containers.ScalarMap[str, str] time: _timestamp_pb2.Timestamp - metadata: _containers.MessageMap[str, _any_pb2.Any] - args: _containers.MessageMap[str, _any_pb2.Any] - options: _containers.MessageMap[str, _any_pb2.Any] - inputConfig: StreamConfig - outputConfig: StreamConfig - def __init__(self, assistantConversationId: _Optional[int] = ..., assistant: _Optional[_Union[_common_pb2.AssistantDefinition, _Mapping]] = ..., time: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., metadata: _Optional[_Mapping[str, _any_pb2.Any]] = ..., args: _Optional[_Mapping[str, _any_pb2.Any]] = ..., options: _Optional[_Mapping[str, _any_pb2.Any]] = ..., inputConfig: _Optional[_Union[StreamConfig, _Mapping]] = ..., outputConfig: _Optional[_Union[StreamConfig, _Mapping]] = ...) -> None: ... - -class StreamConfig(_message.Message): - __slots__ = ("audio", "text") - AUDIO_FIELD_NUMBER: _ClassVar[int] - TEXT_FIELD_NUMBER: _ClassVar[int] - audio: AudioConfig - text: TextConfig - def __init__(self, audio: _Optional[_Union[AudioConfig, _Mapping]] = ..., text: _Optional[_Union[TextConfig, _Mapping]] = ...) -> None: ... + def __init__(self, id: _Optional[str] = ..., name: _Optional[str] = ..., data: _Optional[_Mapping[str, str]] = ..., time: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ...) -> None: ... class AudioConfig(_message.Message): __slots__ = ("sampleRate", "audioFormat", "channels") @@ -160,6 +168,75 @@ class TextConfig(_message.Message): charset: str def __init__(self, charset: _Optional[str] = ...) -> None: ... +class StreamConfig(_message.Message): + __slots__ = ("audio", "text") + AUDIO_FIELD_NUMBER: _ClassVar[int] + TEXT_FIELD_NUMBER: _ClassVar[int] + audio: AudioConfig + text: TextConfig + def __init__(self, audio: _Optional[_Union[AudioConfig, _Mapping]] = ..., text: _Optional[_Union[TextConfig, _Mapping]] = ...) -> None: ... + +class WebIdentity(_message.Message): + __slots__ = ("userId",) + USERID_FIELD_NUMBER: _ClassVar[int] + userId: str + def __init__(self, userId: _Optional[str] = ...) -> None: ... + +class PhoneIdentity(_message.Message): + __slots__ = ("phoneNumber",) + PHONENUMBER_FIELD_NUMBER: _ClassVar[int] + phoneNumber: str + def __init__(self, phoneNumber: _Optional[str] = ...) -> None: ... + +class ConversationInitialization(_message.Message): + __slots__ = ("assistantConversationId", "assistant", "time", "metadata", "args", "options", "streamMode", "phone", "web") + class MetadataEntry(_message.Message): + __slots__ = ("key", "value") + KEY_FIELD_NUMBER: _ClassVar[int] + VALUE_FIELD_NUMBER: _ClassVar[int] + key: str + value: _any_pb2.Any + def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[_any_pb2.Any, _Mapping]] = ...) -> None: ... + class ArgsEntry(_message.Message): + __slots__ = ("key", "value") + KEY_FIELD_NUMBER: _ClassVar[int] + VALUE_FIELD_NUMBER: _ClassVar[int] + key: str + value: _any_pb2.Any + def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[_any_pb2.Any, _Mapping]] = ...) -> None: ... + class OptionsEntry(_message.Message): + __slots__ = ("key", "value") + KEY_FIELD_NUMBER: _ClassVar[int] + VALUE_FIELD_NUMBER: _ClassVar[int] + key: str + value: _any_pb2.Any + def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[_any_pb2.Any, _Mapping]] = ...) -> None: ... + ASSISTANTCONVERSATIONID_FIELD_NUMBER: _ClassVar[int] + ASSISTANT_FIELD_NUMBER: _ClassVar[int] + TIME_FIELD_NUMBER: _ClassVar[int] + METADATA_FIELD_NUMBER: _ClassVar[int] + ARGS_FIELD_NUMBER: _ClassVar[int] + OPTIONS_FIELD_NUMBER: _ClassVar[int] + STREAMMODE_FIELD_NUMBER: _ClassVar[int] + PHONE_FIELD_NUMBER: _ClassVar[int] + WEB_FIELD_NUMBER: _ClassVar[int] + assistantConversationId: int + assistant: _common_pb2.AssistantDefinition + time: _timestamp_pb2.Timestamp + metadata: _containers.MessageMap[str, _any_pb2.Any] + args: _containers.MessageMap[str, _any_pb2.Any] + options: _containers.MessageMap[str, _any_pb2.Any] + streamMode: StreamMode + phone: PhoneIdentity + web: WebIdentity + def __init__(self, assistantConversationId: _Optional[int] = ..., assistant: _Optional[_Union[_common_pb2.AssistantDefinition, _Mapping]] = ..., time: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., metadata: _Optional[_Mapping[str, _any_pb2.Any]] = ..., args: _Optional[_Mapping[str, _any_pb2.Any]] = ..., options: _Optional[_Mapping[str, _any_pb2.Any]] = ..., streamMode: _Optional[_Union[StreamMode, str]] = ..., phone: _Optional[_Union[PhoneIdentity, _Mapping]] = ..., web: _Optional[_Union[WebIdentity, _Mapping]] = ...) -> None: ... + +class ConversationConfiguration(_message.Message): + __slots__ = ("streamMode",) + STREAMMODE_FIELD_NUMBER: _ClassVar[int] + streamMode: StreamMode + def __init__(self, streamMode: _Optional[_Union[StreamMode, str]] = ...) -> None: ... + class ConversationInterruption(_message.Message): __slots__ = ("id", "type", "time") class InterruptionType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): @@ -178,6 +255,22 @@ class ConversationInterruption(_message.Message): time: _timestamp_pb2.Timestamp def __init__(self, id: _Optional[str] = ..., type: _Optional[_Union[ConversationInterruption.InterruptionType, str]] = ..., time: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ...) -> None: ... +class ConversationDisconnection(_message.Message): + __slots__ = ("type", "time") + class DisconnectionType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + DISCONNECTION_TYPE_UNSPECIFIED: _ClassVar[ConversationDisconnection.DisconnectionType] + DISCONNECTION_TYPE_TOOL: _ClassVar[ConversationDisconnection.DisconnectionType] + DISCONNECTION_TYPE_USER: _ClassVar[ConversationDisconnection.DisconnectionType] + DISCONNECTION_TYPE_UNSPECIFIED: ConversationDisconnection.DisconnectionType + DISCONNECTION_TYPE_TOOL: ConversationDisconnection.DisconnectionType + DISCONNECTION_TYPE_USER: ConversationDisconnection.DisconnectionType + TYPE_FIELD_NUMBER: _ClassVar[int] + TIME_FIELD_NUMBER: _ClassVar[int] + type: ConversationDisconnection.DisconnectionType + time: _timestamp_pb2.Timestamp + def __init__(self, type: _Optional[_Union[ConversationDisconnection.DisconnectionType, str]] = ..., time: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ...) -> None: ... + class ConversationAssistantMessage(_message.Message): __slots__ = ("audio", "text", "id", "completed", "time") AUDIO_FIELD_NUMBER: _ClassVar[int] @@ -206,37 +299,71 @@ class ConversationUserMessage(_message.Message): time: _timestamp_pb2.Timestamp def __init__(self, audio: _Optional[bytes] = ..., text: _Optional[str] = ..., id: _Optional[str] = ..., completed: bool = ..., time: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ...) -> None: ... -class AssistantTalkInput(_message.Message): - __slots__ = ("configuration", "message") +class ConversationModeChange(_message.Message): + __slots__ = ("mode", "time") + class ModeType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + MODE_TYPE_UNSPECIFIED: _ClassVar[ConversationModeChange.ModeType] + MODE_TYPE_AUDIO: _ClassVar[ConversationModeChange.ModeType] + MODE_TYPE_TEXT: _ClassVar[ConversationModeChange.ModeType] + MODE_TYPE_UNSPECIFIED: ConversationModeChange.ModeType + MODE_TYPE_AUDIO: ConversationModeChange.ModeType + MODE_TYPE_TEXT: ConversationModeChange.ModeType + MODE_FIELD_NUMBER: _ClassVar[int] + TIME_FIELD_NUMBER: _ClassVar[int] + mode: ConversationModeChange.ModeType + time: _timestamp_pb2.Timestamp + def __init__(self, mode: _Optional[_Union[ConversationModeChange.ModeType, str]] = ..., time: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ...) -> None: ... + +class AssistantTalkRequest(_message.Message): + __slots__ = ("initialization", "configuration", "message", "metadata", "metric", "disconnection") + INITIALIZATION_FIELD_NUMBER: _ClassVar[int] CONFIGURATION_FIELD_NUMBER: _ClassVar[int] MESSAGE_FIELD_NUMBER: _ClassVar[int] + METADATA_FIELD_NUMBER: _ClassVar[int] + METRIC_FIELD_NUMBER: _ClassVar[int] + DISCONNECTION_FIELD_NUMBER: _ClassVar[int] + initialization: ConversationInitialization configuration: ConversationConfiguration message: ConversationUserMessage - def __init__(self, configuration: _Optional[_Union[ConversationConfiguration, _Mapping]] = ..., message: _Optional[_Union[ConversationUserMessage, _Mapping]] = ...) -> None: ... + metadata: ConversationMetadata + metric: ConversationMetric + disconnection: ConversationDisconnection + def __init__(self, initialization: _Optional[_Union[ConversationInitialization, _Mapping]] = ..., configuration: _Optional[_Union[ConversationConfiguration, _Mapping]] = ..., message: _Optional[_Union[ConversationUserMessage, _Mapping]] = ..., metadata: _Optional[_Union[ConversationMetadata, _Mapping]] = ..., metric: _Optional[_Union[ConversationMetric, _Mapping]] = ..., disconnection: _Optional[_Union[ConversationDisconnection, _Mapping]] = ...) -> None: ... -class AssistantTalkOutput(_message.Message): - __slots__ = ("code", "success", "configuration", "interruption", "user", "assistant", "tool", "toolResult", "directive", "error") +class AssistantTalkResponse(_message.Message): + __slots__ = ("code", "success", "initialization", "configuration", "interruption", "user", "assistant", "toolCall", "toolResult", "directive", "metadata", "metric", "disconnection", "event", "error") CODE_FIELD_NUMBER: _ClassVar[int] SUCCESS_FIELD_NUMBER: _ClassVar[int] + INITIALIZATION_FIELD_NUMBER: _ClassVar[int] CONFIGURATION_FIELD_NUMBER: _ClassVar[int] INTERRUPTION_FIELD_NUMBER: _ClassVar[int] USER_FIELD_NUMBER: _ClassVar[int] ASSISTANT_FIELD_NUMBER: _ClassVar[int] - TOOL_FIELD_NUMBER: _ClassVar[int] + TOOLCALL_FIELD_NUMBER: _ClassVar[int] TOOLRESULT_FIELD_NUMBER: _ClassVar[int] DIRECTIVE_FIELD_NUMBER: _ClassVar[int] + METADATA_FIELD_NUMBER: _ClassVar[int] + METRIC_FIELD_NUMBER: _ClassVar[int] + DISCONNECTION_FIELD_NUMBER: _ClassVar[int] + EVENT_FIELD_NUMBER: _ClassVar[int] ERROR_FIELD_NUMBER: _ClassVar[int] code: int success: bool + initialization: ConversationInitialization configuration: ConversationConfiguration interruption: ConversationInterruption user: ConversationUserMessage assistant: ConversationAssistantMessage - tool: ConversationToolCall + toolCall: ConversationToolCall toolResult: ConversationToolResult directive: ConversationDirective - error: _common_pb2.Error - def __init__(self, code: _Optional[int] = ..., success: bool = ..., configuration: _Optional[_Union[ConversationConfiguration, _Mapping]] = ..., interruption: _Optional[_Union[ConversationInterruption, _Mapping]] = ..., user: _Optional[_Union[ConversationUserMessage, _Mapping]] = ..., assistant: _Optional[_Union[ConversationAssistantMessage, _Mapping]] = ..., tool: _Optional[_Union[ConversationToolCall, _Mapping]] = ..., toolResult: _Optional[_Union[ConversationToolResult, _Mapping]] = ..., directive: _Optional[_Union[ConversationDirective, _Mapping]] = ..., error: _Optional[_Union[_common_pb2.Error, _Mapping]] = ...) -> None: ... + metadata: ConversationMetadata + metric: ConversationMetric + disconnection: ConversationDisconnection + event: ConversationEvent + error: ConversationError + def __init__(self, code: _Optional[int] = ..., success: bool = ..., initialization: _Optional[_Union[ConversationInitialization, _Mapping]] = ..., configuration: _Optional[_Union[ConversationConfiguration, _Mapping]] = ..., interruption: _Optional[_Union[ConversationInterruption, _Mapping]] = ..., user: _Optional[_Union[ConversationUserMessage, _Mapping]] = ..., assistant: _Optional[_Union[ConversationAssistantMessage, _Mapping]] = ..., toolCall: _Optional[_Union[ConversationToolCall, _Mapping]] = ..., toolResult: _Optional[_Union[ConversationToolResult, _Mapping]] = ..., directive: _Optional[_Union[ConversationDirective, _Mapping]] = ..., metadata: _Optional[_Union[ConversationMetadata, _Mapping]] = ..., metric: _Optional[_Union[ConversationMetric, _Mapping]] = ..., disconnection: _Optional[_Union[ConversationDisconnection, _Mapping]] = ..., event: _Optional[_Union[ConversationEvent, _Mapping]] = ..., error: _Optional[_Union[ConversationError, _Mapping]] = ...) -> None: ... class CreateMessageMetricRequest(_message.Message): __slots__ = ("assistantId", "assistantConversationId", "messageId", "metrics") @@ -350,33 +477,3 @@ class CreateBulkPhoneCallResponse(_message.Message): data: _containers.RepeatedCompositeFieldContainer[_common_pb2.AssistantConversation] error: _common_pb2.Error def __init__(self, code: _Optional[int] = ..., success: bool = ..., data: _Optional[_Iterable[_Union[_common_pb2.AssistantConversation, _Mapping]]] = ..., error: _Optional[_Union[_common_pb2.Error, _Mapping]] = ...) -> None: ... - -class TalkInput(_message.Message): - __slots__ = ("configuration", "message", "interruption") - CONFIGURATION_FIELD_NUMBER: _ClassVar[int] - MESSAGE_FIELD_NUMBER: _ClassVar[int] - INTERRUPTION_FIELD_NUMBER: _ClassVar[int] - configuration: ConversationConfiguration - message: ConversationUserMessage - interruption: ConversationInterruption - def __init__(self, configuration: _Optional[_Union[ConversationConfiguration, _Mapping]] = ..., message: _Optional[_Union[ConversationUserMessage, _Mapping]] = ..., interruption: _Optional[_Union[ConversationInterruption, _Mapping]] = ...) -> None: ... - -class TalkOutput(_message.Message): - __slots__ = ("code", "success", "interruption", "assistant", "tool", "toolResult", "directive", "error") - CODE_FIELD_NUMBER: _ClassVar[int] - SUCCESS_FIELD_NUMBER: _ClassVar[int] - INTERRUPTION_FIELD_NUMBER: _ClassVar[int] - ASSISTANT_FIELD_NUMBER: _ClassVar[int] - TOOL_FIELD_NUMBER: _ClassVar[int] - TOOLRESULT_FIELD_NUMBER: _ClassVar[int] - DIRECTIVE_FIELD_NUMBER: _ClassVar[int] - ERROR_FIELD_NUMBER: _ClassVar[int] - code: int - success: bool - interruption: ConversationInterruption - assistant: ConversationAssistantMessage - tool: ConversationToolCall - toolResult: ConversationToolResult - directive: ConversationDirective - error: _common_pb2.Error - def __init__(self, code: _Optional[int] = ..., success: bool = ..., interruption: _Optional[_Union[ConversationInterruption, _Mapping]] = ..., assistant: _Optional[_Union[ConversationAssistantMessage, _Mapping]] = ..., tool: _Optional[_Union[ConversationToolCall, _Mapping]] = ..., toolResult: _Optional[_Union[ConversationToolResult, _Mapping]] = ..., directive: _Optional[_Union[ConversationDirective, _Mapping]] = ..., error: _Optional[_Union[_common_pb2.Error, _Mapping]] = ...) -> None: ... diff --git a/rapida/clients/protos/talk_api_pb2_grpc.py b/rapida/clients/protos/talk_api_pb2_grpc.py index 1296375..b0b8c25 100644 --- a/rapida/clients/protos/talk_api_pb2_grpc.py +++ b/rapida/clients/protos/talk_api_pb2_grpc.py @@ -6,7 +6,7 @@ import rapida.clients.protos.common_pb2 as common__pb2 import rapida.clients.protos.talk_api_pb2 as talk__api__pb2 -GRPC_GENERATED_VERSION = '1.74.0' +GRPC_GENERATED_VERSION = '1.78.0' GRPC_VERSION = grpc.__version__ _version_not_supported = False @@ -19,7 +19,7 @@ if _version_not_supported: raise RuntimeError( f'The grpc package installed is at version {GRPC_VERSION},' - + f' but the generated code in talk_api_pb2_grpc.py depends on' + + ' but the generated code in talk_api_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' @@ -27,7 +27,11 @@ class TalkServiceStub(object): - """Talk Service for assistant messaging + """============================================================================ + Talk Service - Primary Assistant Communication + ============================================================================ + + TalkService provides the main API for assistant conversations. """ def __init__(self, channel): @@ -38,8 +42,8 @@ def __init__(self, channel): """ self.AssistantTalk = channel.stream_stream( '/talk_api.TalkService/AssistantTalk', - request_serializer=talk__api__pb2.AssistantTalkInput.SerializeToString, - response_deserializer=talk__api__pb2.AssistantTalkOutput.FromString, + request_serializer=talk__api__pb2.AssistantTalkRequest.SerializeToString, + response_deserializer=talk__api__pb2.AssistantTalkResponse.FromString, _registered_method=True) self.GetAllAssistantConversation = channel.unary_unary( '/talk_api.TalkService/GetAllAssistantConversation', @@ -74,7 +78,11 @@ def __init__(self, channel): class TalkServiceServicer(object): - """Talk Service for assistant messaging + """============================================================================ + Talk Service - Primary Assistant Communication + ============================================================================ + + TalkService provides the main API for assistant conversations. """ def AssistantTalk(self, request_iterator, context): @@ -131,8 +139,8 @@ def add_TalkServiceServicer_to_server(servicer, server): rpc_method_handlers = { 'AssistantTalk': grpc.stream_stream_rpc_method_handler( servicer.AssistantTalk, - request_deserializer=talk__api__pb2.AssistantTalkInput.FromString, - response_serializer=talk__api__pb2.AssistantTalkOutput.SerializeToString, + request_deserializer=talk__api__pb2.AssistantTalkRequest.FromString, + response_serializer=talk__api__pb2.AssistantTalkResponse.SerializeToString, ), 'GetAllAssistantConversation': grpc.unary_unary_rpc_method_handler( servicer.GetAllAssistantConversation, @@ -173,7 +181,11 @@ def add_TalkServiceServicer_to_server(servicer, server): # This class is part of an EXPERIMENTAL API. class TalkService(object): - """Talk Service for assistant messaging + """============================================================================ + Talk Service - Primary Assistant Communication + ============================================================================ + + TalkService provides the main API for assistant conversations. """ @staticmethod @@ -191,8 +203,8 @@ def AssistantTalk(request_iterator, request_iterator, target, '/talk_api.TalkService/AssistantTalk', - talk__api__pb2.AssistantTalkInput.SerializeToString, - talk__api__pb2.AssistantTalkOutput.FromString, + talk__api__pb2.AssistantTalkRequest.SerializeToString, + talk__api__pb2.AssistantTalkResponse.FromString, options, channel_credentials, insecure, @@ -364,79 +376,3 @@ def CreateBulkPhoneCall(request, timeout, metadata, _registered_method=True) - - -class AgentKitStub(object): - """AgentKit Service for assistant messaging - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.Talk = channel.stream_stream( - '/talk_api.AgentKit/Talk', - request_serializer=talk__api__pb2.TalkInput.SerializeToString, - response_deserializer=talk__api__pb2.TalkOutput.FromString, - _registered_method=True) - - -class AgentKitServicer(object): - """AgentKit Service for assistant messaging - """ - - def Talk(self, request_iterator, context): - """Bi-directional streaming RPC for assistant messaging - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_AgentKitServicer_to_server(servicer, server): - rpc_method_handlers = { - 'Talk': grpc.stream_stream_rpc_method_handler( - servicer.Talk, - request_deserializer=talk__api__pb2.TalkInput.FromString, - response_serializer=talk__api__pb2.TalkOutput.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'talk_api.AgentKit', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - server.add_registered_method_handlers('talk_api.AgentKit', rpc_method_handlers) - - - # This class is part of an EXPERIMENTAL API. -class AgentKit(object): - """AgentKit Service for assistant messaging - """ - - @staticmethod - def Talk(request_iterator, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.stream_stream( - request_iterator, - target, - '/talk_api.AgentKit/Talk', - talk__api__pb2.TalkInput.SerializeToString, - talk__api__pb2.TalkOutput.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) diff --git a/rapida/clients/protos/vault_api_pb2_grpc.py b/rapida/clients/protos/vault_api_pb2_grpc.py index f9aca5f..d98ef12 100644 --- a/rapida/clients/protos/vault_api_pb2_grpc.py +++ b/rapida/clients/protos/vault_api_pb2_grpc.py @@ -5,7 +5,7 @@ import rapida.clients.protos.vault_api_pb2 as vault__api__pb2 -GRPC_GENERATED_VERSION = '1.74.0' +GRPC_GENERATED_VERSION = '1.78.0' GRPC_VERSION = grpc.__version__ _version_not_supported = False @@ -18,7 +18,7 @@ if _version_not_supported: raise RuntimeError( f'The grpc package installed is at version {GRPC_VERSION},' - + f' but the generated code in vault_api_pb2_grpc.py depends on' + + ' but the generated code in vault_api_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' diff --git a/rapida/clients/protos/web_api_pb2_grpc.py b/rapida/clients/protos/web_api_pb2_grpc.py index c2d135f..d7ca4bb 100644 --- a/rapida/clients/protos/web_api_pb2_grpc.py +++ b/rapida/clients/protos/web_api_pb2_grpc.py @@ -6,7 +6,7 @@ import rapida.clients.protos.common_pb2 as common__pb2 import rapida.clients.protos.web_api_pb2 as web__api__pb2 -GRPC_GENERATED_VERSION = '1.74.0' +GRPC_GENERATED_VERSION = '1.78.0' GRPC_VERSION = grpc.__version__ _version_not_supported = False @@ -19,7 +19,7 @@ if _version_not_supported: raise RuntimeError( f'The grpc package installed is at version {GRPC_VERSION},' - + f' but the generated code in web_api_pb2_grpc.py depends on' + + ' but the generated code in web_api_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' diff --git a/rapida/clients/protos/webrtc_pb2.py b/rapida/clients/protos/webrtc_pb2.py new file mode 100644 index 0000000..0853617 --- /dev/null +++ b/rapida/clients/protos/webrtc_pb2.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: webrtc.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'webrtc.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +import rapida.clients.protos.talk_api_pb2 as talk__api__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0cwebrtc.proto\x12\x08talk_api\x1a\x0etalk-api.proto\"?\n\tICEServer\x12\x0c\n\x04urls\x18\x01 \x03(\t\x12\x10\n\x08username\x18\x02 \x01(\t\x12\x12\n\ncredential\x18\x03 \x01(\t\"b\n\x0cICECandidate\x12\x11\n\tcandidate\x18\x01 \x01(\t\x12\x0e\n\x06sdpMid\x18\x02 \x01(\t\x12\x15\n\rsdpMLineIndex\x18\x03 \x01(\x05\x12\x18\n\x10usernameFragment\x18\x04 \x01(\t\"\x7f\n\tWebRTCSDP\x12)\n\x04type\x18\x01 \x01(\x0e\x32\x1b.talk_api.WebRTCSDP.SDPType\x12\x0b\n\x03sdp\x18\x02 \x01(\t\":\n\x07SDPType\x12\x18\n\x14SDP_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05OFFER\x10\x01\x12\n\n\x06\x41NSWER\x10\x02\"\x99\x01\n\x0f\x43lientSignaling\x12\x11\n\tsessionId\x18\x01 \x01(\t\x12\"\n\x03sdp\x18\x02 \x01(\x0b\x32\x13.talk_api.WebRTCSDPH\x00\x12.\n\x0ciceCandidate\x18\x03 \x01(\x0b\x32\x16.talk_api.ICECandidateH\x00\x12\x14\n\ndisconnect\x18\x04 \x01(\x08H\x00\x42\t\n\x07message\"\xe0\x01\n\x0fServerSignaling\x12\x11\n\tsessionId\x18\x01 \x01(\t\x12(\n\x06\x63onfig\x18\x02 \x01(\x0b\x32\x16.talk_api.WebRTCConfigH\x00\x12\"\n\x03sdp\x18\x03 \x01(\x0b\x32\x13.talk_api.WebRTCSDPH\x00\x12.\n\x0ciceCandidate\x18\x04 \x01(\x0b\x32\x16.talk_api.ICECandidateH\x00\x12\x0f\n\x05ready\x18\x05 \x01(\x08H\x00\x12\x0f\n\x05\x63lear\x18\x06 \x01(\x08H\x00\x12\x0f\n\x05\x65rror\x18\x07 \x01(\tH\x00\x42\t\n\x07message\"_\n\x0cWebRTCConfig\x12\'\n\niceServers\x18\x01 \x03(\x0b\x32\x13.talk_api.ICEServer\x12\x12\n\naudioCodec\x18\x02 \x01(\t\x12\x12\n\nsampleRate\x18\x03 \x01(\x05\"\xa1\x03\n\x0eWebTalkRequest\x12>\n\x0einitialization\x18\x01 \x01(\x0b\x32$.talk_api.ConversationInitializationH\x00\x12<\n\rconfiguration\x18\x02 \x01(\x0b\x32#.talk_api.ConversationConfigurationH\x00\x12\x34\n\x07message\x18\x03 \x01(\x0b\x32!.talk_api.ConversationUserMessageH\x00\x12.\n\tsignaling\x18\x04 \x01(\x0b\x32\x19.talk_api.ClientSignalingH\x00\x12\x32\n\x08metadata\x18\x05 \x01(\x0b\x32\x1e.talk_api.ConversationMetadataH\x00\x12.\n\x06metric\x18\x06 \x01(\x0b\x32\x1c.talk_api.ConversationMetricH\x00\x12<\n\rdisconnection\x18\x07 \x01(\x0b\x32#.talk_api.ConversationDisconnectionH\x00\x42\t\n\x07request\"\xae\x06\n\x0fWebTalkResponse\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12>\n\x0einitialization\x18\x08 \x01(\x0b\x32$.talk_api.ConversationInitializationH\x00\x12<\n\rconfiguration\x18\t \x01(\x0b\x32#.talk_api.ConversationConfigurationH\x00\x12:\n\x0cinterruption\x18\n \x01(\x0b\x32\".talk_api.ConversationInterruptionH\x00\x12\x31\n\x04user\x18\x0b \x01(\x0b\x32!.talk_api.ConversationUserMessageH\x00\x12;\n\tassistant\x18\x0c \x01(\x0b\x32&.talk_api.ConversationAssistantMessageH\x00\x12.\n\x04tool\x18\r \x01(\x0b\x32\x1e.talk_api.ConversationToolCallH\x00\x12\x36\n\ntoolResult\x18\x0e \x01(\x0b\x32 .talk_api.ConversationToolResultH\x00\x12\x34\n\tdirective\x18\x10 \x01(\x0b\x32\x1f.talk_api.ConversationDirectiveH\x00\x12,\n\x05\x65rror\x18\x0f \x01(\x0b\x32\x1b.talk_api.ConversationErrorH\x00\x12.\n\tsignaling\x18\x11 \x01(\x0b\x32\x19.talk_api.ServerSignalingH\x00\x12\x32\n\x08metadata\x18\x13 \x01(\x0b\x32\x1e.talk_api.ConversationMetadataH\x00\x12.\n\x06metric\x18\x14 \x01(\x0b\x32\x1c.talk_api.ConversationMetricH\x00\x12<\n\rdisconnection\x18\x15 \x01(\x0b\x32#.talk_api.ConversationDisconnectionH\x00\x12,\n\x05\x65vent\x18\x16 \x01(\x0b\x32\x1b.talk_api.ConversationEventH\x00\x42\x06\n\x04\x64\x61ta2L\n\x06WebRTC\x12\x42\n\x07WebTalk\x12\x18.talk_api.WebTalkRequest\x1a\x19.talk_api.WebTalkResponse(\x01\x30\x01\x42\x35\n\x17\x61i.rapida.sdk.artifactsZ\x1agithub.com/rapidaai/protosb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'webrtc_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\027ai.rapida.sdk.artifactsZ\032github.com/rapidaai/protos' + _globals['_ICESERVER']._serialized_start=42 + _globals['_ICESERVER']._serialized_end=105 + _globals['_ICECANDIDATE']._serialized_start=107 + _globals['_ICECANDIDATE']._serialized_end=205 + _globals['_WEBRTCSDP']._serialized_start=207 + _globals['_WEBRTCSDP']._serialized_end=334 + _globals['_WEBRTCSDP_SDPTYPE']._serialized_start=276 + _globals['_WEBRTCSDP_SDPTYPE']._serialized_end=334 + _globals['_CLIENTSIGNALING']._serialized_start=337 + _globals['_CLIENTSIGNALING']._serialized_end=490 + _globals['_SERVERSIGNALING']._serialized_start=493 + _globals['_SERVERSIGNALING']._serialized_end=717 + _globals['_WEBRTCCONFIG']._serialized_start=719 + _globals['_WEBRTCCONFIG']._serialized_end=814 + _globals['_WEBTALKREQUEST']._serialized_start=817 + _globals['_WEBTALKREQUEST']._serialized_end=1234 + _globals['_WEBTALKRESPONSE']._serialized_start=1237 + _globals['_WEBTALKRESPONSE']._serialized_end=2051 + _globals['_WEBRTC']._serialized_start=2053 + _globals['_WEBRTC']._serialized_end=2129 +# @@protoc_insertion_point(module_scope) diff --git a/rapida/clients/protos/webrtc_pb2.pyi b/rapida/clients/protos/webrtc_pb2.pyi new file mode 100644 index 0000000..4b5d016 --- /dev/null +++ b/rapida/clients/protos/webrtc_pb2.pyi @@ -0,0 +1,141 @@ +import rapida.clients.protos.talk_api_pb2 as _talk_api_pb2 +from google.protobuf.internal import containers as _containers +from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Iterable as _Iterable, Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class ICEServer(_message.Message): + __slots__ = ("urls", "username", "credential") + URLS_FIELD_NUMBER: _ClassVar[int] + USERNAME_FIELD_NUMBER: _ClassVar[int] + CREDENTIAL_FIELD_NUMBER: _ClassVar[int] + urls: _containers.RepeatedScalarFieldContainer[str] + username: str + credential: str + def __init__(self, urls: _Optional[_Iterable[str]] = ..., username: _Optional[str] = ..., credential: _Optional[str] = ...) -> None: ... + +class ICECandidate(_message.Message): + __slots__ = ("candidate", "sdpMid", "sdpMLineIndex", "usernameFragment") + CANDIDATE_FIELD_NUMBER: _ClassVar[int] + SDPMID_FIELD_NUMBER: _ClassVar[int] + SDPMLINEINDEX_FIELD_NUMBER: _ClassVar[int] + USERNAMEFRAGMENT_FIELD_NUMBER: _ClassVar[int] + candidate: str + sdpMid: str + sdpMLineIndex: int + usernameFragment: str + def __init__(self, candidate: _Optional[str] = ..., sdpMid: _Optional[str] = ..., sdpMLineIndex: _Optional[int] = ..., usernameFragment: _Optional[str] = ...) -> None: ... + +class WebRTCSDP(_message.Message): + __slots__ = ("type", "sdp") + class SDPType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + SDP_TYPE_UNSPECIFIED: _ClassVar[WebRTCSDP.SDPType] + OFFER: _ClassVar[WebRTCSDP.SDPType] + ANSWER: _ClassVar[WebRTCSDP.SDPType] + SDP_TYPE_UNSPECIFIED: WebRTCSDP.SDPType + OFFER: WebRTCSDP.SDPType + ANSWER: WebRTCSDP.SDPType + TYPE_FIELD_NUMBER: _ClassVar[int] + SDP_FIELD_NUMBER: _ClassVar[int] + type: WebRTCSDP.SDPType + sdp: str + def __init__(self, type: _Optional[_Union[WebRTCSDP.SDPType, str]] = ..., sdp: _Optional[str] = ...) -> None: ... + +class ClientSignaling(_message.Message): + __slots__ = ("sessionId", "sdp", "iceCandidate", "disconnect") + SESSIONID_FIELD_NUMBER: _ClassVar[int] + SDP_FIELD_NUMBER: _ClassVar[int] + ICECANDIDATE_FIELD_NUMBER: _ClassVar[int] + DISCONNECT_FIELD_NUMBER: _ClassVar[int] + sessionId: str + sdp: WebRTCSDP + iceCandidate: ICECandidate + disconnect: bool + def __init__(self, sessionId: _Optional[str] = ..., sdp: _Optional[_Union[WebRTCSDP, _Mapping]] = ..., iceCandidate: _Optional[_Union[ICECandidate, _Mapping]] = ..., disconnect: bool = ...) -> None: ... + +class ServerSignaling(_message.Message): + __slots__ = ("sessionId", "config", "sdp", "iceCandidate", "ready", "clear", "error") + SESSIONID_FIELD_NUMBER: _ClassVar[int] + CONFIG_FIELD_NUMBER: _ClassVar[int] + SDP_FIELD_NUMBER: _ClassVar[int] + ICECANDIDATE_FIELD_NUMBER: _ClassVar[int] + READY_FIELD_NUMBER: _ClassVar[int] + CLEAR_FIELD_NUMBER: _ClassVar[int] + ERROR_FIELD_NUMBER: _ClassVar[int] + sessionId: str + config: WebRTCConfig + sdp: WebRTCSDP + iceCandidate: ICECandidate + ready: bool + clear: bool + error: str + def __init__(self, sessionId: _Optional[str] = ..., config: _Optional[_Union[WebRTCConfig, _Mapping]] = ..., sdp: _Optional[_Union[WebRTCSDP, _Mapping]] = ..., iceCandidate: _Optional[_Union[ICECandidate, _Mapping]] = ..., ready: bool = ..., clear: bool = ..., error: _Optional[str] = ...) -> None: ... + +class WebRTCConfig(_message.Message): + __slots__ = ("iceServers", "audioCodec", "sampleRate") + ICESERVERS_FIELD_NUMBER: _ClassVar[int] + AUDIOCODEC_FIELD_NUMBER: _ClassVar[int] + SAMPLERATE_FIELD_NUMBER: _ClassVar[int] + iceServers: _containers.RepeatedCompositeFieldContainer[ICEServer] + audioCodec: str + sampleRate: int + def __init__(self, iceServers: _Optional[_Iterable[_Union[ICEServer, _Mapping]]] = ..., audioCodec: _Optional[str] = ..., sampleRate: _Optional[int] = ...) -> None: ... + +class WebTalkRequest(_message.Message): + __slots__ = ("initialization", "configuration", "message", "signaling", "metadata", "metric", "disconnection") + INITIALIZATION_FIELD_NUMBER: _ClassVar[int] + CONFIGURATION_FIELD_NUMBER: _ClassVar[int] + MESSAGE_FIELD_NUMBER: _ClassVar[int] + SIGNALING_FIELD_NUMBER: _ClassVar[int] + METADATA_FIELD_NUMBER: _ClassVar[int] + METRIC_FIELD_NUMBER: _ClassVar[int] + DISCONNECTION_FIELD_NUMBER: _ClassVar[int] + initialization: _talk_api_pb2.ConversationInitialization + configuration: _talk_api_pb2.ConversationConfiguration + message: _talk_api_pb2.ConversationUserMessage + signaling: ClientSignaling + metadata: _talk_api_pb2.ConversationMetadata + metric: _talk_api_pb2.ConversationMetric + disconnection: _talk_api_pb2.ConversationDisconnection + def __init__(self, initialization: _Optional[_Union[_talk_api_pb2.ConversationInitialization, _Mapping]] = ..., configuration: _Optional[_Union[_talk_api_pb2.ConversationConfiguration, _Mapping]] = ..., message: _Optional[_Union[_talk_api_pb2.ConversationUserMessage, _Mapping]] = ..., signaling: _Optional[_Union[ClientSignaling, _Mapping]] = ..., metadata: _Optional[_Union[_talk_api_pb2.ConversationMetadata, _Mapping]] = ..., metric: _Optional[_Union[_talk_api_pb2.ConversationMetric, _Mapping]] = ..., disconnection: _Optional[_Union[_talk_api_pb2.ConversationDisconnection, _Mapping]] = ...) -> None: ... + +class WebTalkResponse(_message.Message): + __slots__ = ("code", "success", "initialization", "configuration", "interruption", "user", "assistant", "tool", "toolResult", "directive", "error", "signaling", "metadata", "metric", "disconnection", "event") + CODE_FIELD_NUMBER: _ClassVar[int] + SUCCESS_FIELD_NUMBER: _ClassVar[int] + INITIALIZATION_FIELD_NUMBER: _ClassVar[int] + CONFIGURATION_FIELD_NUMBER: _ClassVar[int] + INTERRUPTION_FIELD_NUMBER: _ClassVar[int] + USER_FIELD_NUMBER: _ClassVar[int] + ASSISTANT_FIELD_NUMBER: _ClassVar[int] + TOOL_FIELD_NUMBER: _ClassVar[int] + TOOLRESULT_FIELD_NUMBER: _ClassVar[int] + DIRECTIVE_FIELD_NUMBER: _ClassVar[int] + ERROR_FIELD_NUMBER: _ClassVar[int] + SIGNALING_FIELD_NUMBER: _ClassVar[int] + METADATA_FIELD_NUMBER: _ClassVar[int] + METRIC_FIELD_NUMBER: _ClassVar[int] + DISCONNECTION_FIELD_NUMBER: _ClassVar[int] + EVENT_FIELD_NUMBER: _ClassVar[int] + code: int + success: bool + initialization: _talk_api_pb2.ConversationInitialization + configuration: _talk_api_pb2.ConversationConfiguration + interruption: _talk_api_pb2.ConversationInterruption + user: _talk_api_pb2.ConversationUserMessage + assistant: _talk_api_pb2.ConversationAssistantMessage + tool: _talk_api_pb2.ConversationToolCall + toolResult: _talk_api_pb2.ConversationToolResult + directive: _talk_api_pb2.ConversationDirective + error: _talk_api_pb2.ConversationError + signaling: ServerSignaling + metadata: _talk_api_pb2.ConversationMetadata + metric: _talk_api_pb2.ConversationMetric + disconnection: _talk_api_pb2.ConversationDisconnection + event: _talk_api_pb2.ConversationEvent + def __init__(self, code: _Optional[int] = ..., success: bool = ..., initialization: _Optional[_Union[_talk_api_pb2.ConversationInitialization, _Mapping]] = ..., configuration: _Optional[_Union[_talk_api_pb2.ConversationConfiguration, _Mapping]] = ..., interruption: _Optional[_Union[_talk_api_pb2.ConversationInterruption, _Mapping]] = ..., user: _Optional[_Union[_talk_api_pb2.ConversationUserMessage, _Mapping]] = ..., assistant: _Optional[_Union[_talk_api_pb2.ConversationAssistantMessage, _Mapping]] = ..., tool: _Optional[_Union[_talk_api_pb2.ConversationToolCall, _Mapping]] = ..., toolResult: _Optional[_Union[_talk_api_pb2.ConversationToolResult, _Mapping]] = ..., directive: _Optional[_Union[_talk_api_pb2.ConversationDirective, _Mapping]] = ..., error: _Optional[_Union[_talk_api_pb2.ConversationError, _Mapping]] = ..., signaling: _Optional[_Union[ServerSignaling, _Mapping]] = ..., metadata: _Optional[_Union[_talk_api_pb2.ConversationMetadata, _Mapping]] = ..., metric: _Optional[_Union[_talk_api_pb2.ConversationMetric, _Mapping]] = ..., disconnection: _Optional[_Union[_talk_api_pb2.ConversationDisconnection, _Mapping]] = ..., event: _Optional[_Union[_talk_api_pb2.ConversationEvent, _Mapping]] = ...) -> None: ... diff --git a/rapida/clients/protos/webrtc_pb2_grpc.py b/rapida/clients/protos/webrtc_pb2_grpc.py new file mode 100644 index 0000000..bae2a7f --- /dev/null +++ b/rapida/clients/protos/webrtc_pb2_grpc.py @@ -0,0 +1,113 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + +import rapida.clients.protos.webrtc_pb2 as webrtc__pb2 + +GRPC_GENERATED_VERSION = '1.78.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in webrtc_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) + + +class WebRTCStub(object): + """============================================================================ + WebRTC Service + ============================================================================ + + WebRTC Service for browser-based real-time communication. + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.WebTalk = channel.stream_stream( + '/talk_api.WebRTC/WebTalk', + request_serializer=webrtc__pb2.WebTalkRequest.SerializeToString, + response_deserializer=webrtc__pb2.WebTalkResponse.FromString, + _registered_method=True) + + +class WebRTCServicer(object): + """============================================================================ + WebRTC Service + ============================================================================ + + WebRTC Service for browser-based real-time communication. + """ + + def WebTalk(self, request_iterator, context): + """Bi-directional streaming RPC for WebRTC-based conversation + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_WebRTCServicer_to_server(servicer, server): + rpc_method_handlers = { + 'WebTalk': grpc.stream_stream_rpc_method_handler( + servicer.WebTalk, + request_deserializer=webrtc__pb2.WebTalkRequest.FromString, + response_serializer=webrtc__pb2.WebTalkResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'talk_api.WebRTC', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('talk_api.WebRTC', rpc_method_handlers) + + + # This class is part of an EXPERIMENTAL API. +class WebRTC(object): + """============================================================================ + WebRTC Service + ============================================================================ + + WebRTC Service for browser-based real-time communication. + """ + + @staticmethod + def WebTalk(request_iterator, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.stream_stream( + request_iterator, + target, + '/talk_api.WebRTC/WebTalk', + webrtc__pb2.WebTalkRequest.SerializeToString, + webrtc__pb2.WebTalkResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/rapida/configs/__init__.py b/rapida/configs/__init__.py index fc535af..b7a5840 100644 --- a/rapida/configs/__init__.py +++ b/rapida/configs/__init__.py @@ -24,14 +24,14 @@ This module provides functions for managing projects through the ProjectService. """ -ASSISTANT_API = "workflow-01.rapida.ai" -WEB_API = "api.rapida.ai" -ENDPOINT_API = "endpoint-01.rapida.ai" +ASSISTANT_API = "assistant-01.in.rapida.ai" +WEB_API = "api-01.in.rapida.ai" +ENDPOINT_API = "endpoint-01.in.rapida.ai" LOCAL_ASSISTANT_API = "localhost:9007" LOCAL_WEB_API = "localhost:9001" LOCAL_ENDPOINT_API = "localhost:9005" -GRPC_ENDPOINT_URL = "endpoint-01.rapida.ai" -GRPC_ASSISTANT_URL = "workflow-01.rapida.ai" +GRPC_ENDPOINT_URL = "endpoint-01.in.rapida.ai" +GRPC_ASSISTANT_URL = "assistant-01.in.rapida.ai" GRPC_GATEWAY_URL = "gateway-01.rapida.ai" diff --git a/requirements.txt b/requirements.txt index 71e9d53..c9391d0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,8 +6,8 @@ annotated-types==0.7.0; python_version >= '3.8' attrs==25.3.0; python_version >= '3.8' frozenlist==1.7.0; python_version >= '3.9' grpc-interceptor==0.15.4; python_version >= '3.7' and python_version < '4.0' -grpcio==1.74.0; python_version >= '3.9' -grpcio-tools==1.74.0; python_version >= '3.9' +grpcio==1.72.1; python_version >= '3.9' +grpcio-tools==1.72.1; python_version >= '3.9' idna==3.10; python_version >= '3.6' invoke==2.2.0; python_version >= '3.6' multidict==6.5.0; python_version >= '3.9' diff --git a/setup.cfg b/setup.cfg index 264b66a..4b13f0b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,5 +3,3 @@ branch = true include = rapida/* omit = site-packages - - diff --git a/tests/agentkit/__init__.py b/tests/agentkit/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/agentkit/test_agentkit.py b/tests/agentkit/test_agentkit.py new file mode 100644 index 0000000..c6441a1 --- /dev/null +++ b/tests/agentkit/test_agentkit.py @@ -0,0 +1,1151 @@ +# Copyright (c) 2024. Rapida +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +""" +Comprehensive test suite for rapida/agentkit/__init__.py + +Covers: + - AgentKitAgent: all response builders and request helpers + - Talk() conversation flow (initialization -> configuration -> message) + - SSLConfig: field storage and load_credentials() + - AuthConfig: defaults and custom values + - AuthorizationInterceptor: allow / deny / custom validator / custom header + - AgentKitServer: lifecycle, SSL, auth integration +""" + +from unittest.mock import MagicMock, Mock, patch, mock_open + +import pytest + +from rapida.agentkit import ( + AgentKitAgent, + AgentKitServer, + AuthConfig, + AuthorizationInterceptor, + SSLConfig, +) +from rapida.clients.protos.agentkit_pb2 import TalkInput, TalkOutput +from rapida.clients.protos.common_pb2 import AssistantDefinition +from rapida.clients.protos.talk_api_pb2 import ( + ConversationConfiguration, + ConversationDirective, + ConversationInitialization, + ConversationUserMessage, + StreamMode, +) +from rapida.utils.rapida_value import any_to_string + + +# ============================================================================ +# TEST FIXTURES & HELPERS +# ============================================================================ + + +class _EchoAgent(AgentKitAgent): + """Concrete AgentKitAgent subclass for Talk() integration tests. + + On initialization: sends initialization_response. + On configuration: sends configuration_response. + On text message: echoes the text back as a streaming delta + final chunk. + """ + + def Talk(self, request_iterator, context): + for request in request_iterator: + if self.is_initialization_request(request): + yield self.initialization_response(request.initialization) + elif self.is_configuration_request(request): + yield self.configuration_response(request.configuration) + elif self.is_text_message(request): + msg_id = self.get_message_id(request) + text = self.get_user_text(request) + yield self.assistant_response(msg_id, text, completed=False) + yield self.assistant_response(msg_id, text + "!", completed=True) + + +def make_initialization(conv_id: int = 42, assistant_id: int = 7) -> ConversationInitialization: + """Build a ConversationInitialization with the given IDs.""" + return ConversationInitialization( + assistantConversationId=conv_id, + assistant=AssistantDefinition(assistantId=assistant_id, version="v1"), + ) + + +def make_configuration() -> ConversationConfiguration: + """Build a minimal ConversationConfiguration.""" + return ConversationConfiguration(streamMode=StreamMode.STREAM_MODE_TEXT) + + +def talkinput_init(conv_id: int = 42, assistant_id: int = 7) -> TalkInput: + """Build a TalkInput carrying a ConversationInitialization.""" + return TalkInput(initialization=make_initialization(conv_id, assistant_id)) + + +def talkinput_config() -> TalkInput: + """Build a TalkInput carrying a ConversationConfiguration.""" + return TalkInput(configuration=make_configuration()) + + +def talkinput_text(msg_id: str = "msg-1", text: str = "hello") -> TalkInput: + """Build a TalkInput carrying a text ConversationUserMessage.""" + return TalkInput( + message=ConversationUserMessage(id=msg_id, text=text, completed=True) + ) + + +def talkinput_audio(msg_id: str = "msg-a") -> TalkInput: + """Build a TalkInput carrying an audio ConversationUserMessage.""" + return TalkInput( + message=ConversationUserMessage(id=msg_id, audio=b"\x00\x01\x02", completed=False) + ) + + +# ============================================================================ +# AgentKitAgent — Response Builders +# ============================================================================ + + +class TestAgentKitAgentResponseBuilders: + """Tests for the TalkOutput response builder methods on AgentKitAgent.""" + + def setup_method(self): + self.agent = AgentKitAgent() + + # --- response() --- + + def test_response_default_code_is_200(self): + out = self.agent.response() + assert out.code == 200 + + def test_response_default_success_is_true(self): + out = self.agent.response() + assert out.success is True + + def test_response_default_has_no_data_field(self): + out = self.agent.response() + assert out.WhichOneof("data") is None + + def test_response_custom_code_failure(self): + out = self.agent.response(code=503, success=False) + assert out.code == 503 + assert out.success is False + + def test_response_returns_talk_output_type(self): + out = self.agent.response() + assert isinstance(out, TalkOutput) + + # --- initialization_response() --- + + def test_initialization_response_sets_initialization_data_field(self): + out = self.agent.initialization_response(make_initialization()) + assert out.WhichOneof("data") == "initialization" + + def test_initialization_response_preserves_conversation_id(self): + out = self.agent.initialization_response(make_initialization(conv_id=1234)) + assert out.initialization.assistantConversationId == 1234 + + def test_initialization_response_preserves_assistant_id(self): + out = self.agent.initialization_response(make_initialization(assistant_id=99)) + assert out.initialization.assistant.assistantId == 99 + + def test_initialization_response_default_code_200(self): + out = self.agent.initialization_response(make_initialization()) + assert out.code == 200 + assert out.success is True + + # --- configuration_response() --- + + def test_configuration_response_returns_200(self): + out = self.agent.configuration_response() + assert out.code == 200 + assert out.success is True + + def test_configuration_response_has_no_data_field(self): + """TalkOutput has no configuration field; ack carries no data payload.""" + out = self.agent.configuration_response(make_configuration()) + assert out.WhichOneof("data") is None + + def test_configuration_response_no_arg_also_has_no_data(self): + out = self.agent.configuration_response() + assert out.WhichOneof("data") is None + + # --- assistant_response() --- + + def test_assistant_response_sets_assistant_data_field(self): + out = self.agent.assistant_response("m-1", "Hello") + assert out.WhichOneof("data") == "assistant" + + def test_assistant_response_streaming_chunk_not_completed(self): + out = self.agent.assistant_response("m-1", "Hello ", completed=False) + assert out.assistant.id == "m-1" + assert out.assistant.text == "Hello " + assert out.assistant.completed is False + + def test_assistant_response_final_chunk_completed(self): + out = self.agent.assistant_response("m-2", "world!", completed=True) + assert out.assistant.text == "world!" + assert out.assistant.completed is True + + def test_assistant_response_default_completed_is_false(self): + out = self.agent.assistant_response("m-3", "partial text") + assert out.assistant.completed is False + + def test_assistant_response_empty_content(self): + out = self.agent.assistant_response("m-4", "") + assert out.assistant.text == "" + assert out.WhichOneof("data") == "assistant" + + # --- error_response() --- + + def test_error_response_sets_error_data_field(self): + out = self.agent.error_response(500, "Internal error") + assert out.WhichOneof("data") == "error" + + def test_error_response_code_and_message(self): + out = self.agent.error_response(500, "Internal error") + assert out.code == 500 + assert out.error.errorCode == 500 + assert out.error.errorMessage == "Internal error" + + def test_error_response_marks_success_false(self): + out = self.agent.error_response(404, "Not found") + assert out.success is False + + def test_error_response_custom_code(self): + out = self.agent.error_response(422, "Unprocessable entity") + assert out.error.errorCode == 422 + + # --- tool_call() --- + + def test_tool_call_sets_tool_data_field(self): + out = self.agent.tool_call("m", "t-1", "search", {"q": "rapida"}) + assert out.WhichOneof("data") == "tool" + + def test_tool_call_stores_ids_and_name(self): + out = self.agent.tool_call("msg-5", "t-1", "web_search", {"query": "rapida"}) + tc = out.tool + assert tc.id == "msg-5" + assert tc.toolId == "t-1" + assert tc.name == "web_search" + + def test_tool_call_args_packed_as_any(self): + out = self.agent.tool_call("m", "t", "fn", {"query": "hello world"}) + assert "query" in out.tool.args + assert any_to_string(out.tool.args["query"]) == "hello world" + + def test_tool_call_multiple_args(self): + out = self.agent.tool_call("m", "t", "fn", {"a": "1", "b": "two"}) + assert any_to_string(out.tool.args["a"]) == "1" + assert any_to_string(out.tool.args["b"]) == "two" + + def test_tool_call_empty_args(self): + out = self.agent.tool_call("m", "t", "fn", {}) + assert len(out.tool.args) == 0 + + def test_tool_call_none_args(self): + out = self.agent.tool_call("m", "t", "fn", None) + assert len(out.tool.args) == 0 + + # --- tool_call_result() --- + + def test_tool_call_result_sets_tool_result_data_field(self): + out = self.agent.tool_call_result("m", "t", "fn", {"status": "ok"}) + assert out.WhichOneof("data") == "toolResult" + + def test_tool_call_result_dict_result_stored(self): + out = self.agent.tool_call_result("m", "t", "fn", {"key": "value"}, success=True) + tr = out.toolResult + assert tr.success is True + assert any_to_string(tr.args["key"]) == "value" + + def test_tool_call_result_string_stored_under_result_key(self): + out = self.agent.tool_call_result("m", "t", "fn", "done") + assert any_to_string(out.toolResult.args["result"]) == "done" + + def test_tool_call_result_none_produces_empty_args(self): + out = self.agent.tool_call_result("m", "t", "fn", None) + assert len(out.toolResult.args) == 0 + + def test_tool_call_result_failure_flag(self): + out = self.agent.tool_call_result("m", "t", "fn", "err", success=False) + assert out.toolResult.success is False + + def test_tool_call_result_stores_ids_and_name(self): + out = self.agent.tool_call_result("msg-x", "tid-y", "lookup", {"r": "v"}) + tr = out.toolResult + assert tr.id == "msg-x" + assert tr.toolId == "tid-y" + assert tr.name == "lookup" + + # --- transfer_call() --- + + def test_transfer_call_sets_directive_data_field(self): + out = self.agent.transfer_call("m", {"to": "+1"}) + assert out.WhichOneof("data") == "directive" + + def test_transfer_call_directive_type_is_transfer(self): + out = self.agent.transfer_call("m", {"to": "+1234567890"}) + assert out.directive.type == ConversationDirective.TRANSFER_CONVERSATION + + def test_transfer_call_args_packed_as_any(self): + out = self.agent.transfer_call("m", {"to": "+1999000"}) + assert any_to_string(out.directive.args["to"]) == "+1999000" + + def test_transfer_call_empty_args(self): + out = self.agent.transfer_call("m", {}) + assert out.directive.type == ConversationDirective.TRANSFER_CONVERSATION + assert len(out.directive.args) == 0 + + # --- terminate_call() --- + + def test_terminate_call_sets_directive_data_field(self): + out = self.agent.terminate_call("m", {}) + assert out.WhichOneof("data") == "directive" + + def test_terminate_call_directive_type_is_end_conversation(self): + out = self.agent.terminate_call("m", {"reason": "done"}) + assert out.directive.type == ConversationDirective.END_CONVERSATION + + def test_terminate_call_args_packed_as_any(self): + out = self.agent.terminate_call("m", {"reason": "user request"}) + assert any_to_string(out.directive.args["reason"]) == "user request" + + def test_terminate_call_empty_args(self): + out = self.agent.terminate_call("m", {}) + assert len(out.directive.args) == 0 + + def test_transfer_and_terminate_use_different_directive_types(self): + transfer = self.agent.transfer_call("m", {}) + terminate = self.agent.terminate_call("m", {}) + assert transfer.directive.type != terminate.directive.type + + +# ============================================================================ +# AgentKitAgent — Request Helpers +# ============================================================================ + + +class TestAgentKitAgentRequestHelpers: + """Tests for the request inspection helper methods on AgentKitAgent.""" + + def setup_method(self): + self.agent = AgentKitAgent() + + # --- is_initialization_request() --- + + def test_is_initialization_request_true_for_init(self): + assert self.agent.is_initialization_request(talkinput_init()) is True + + def test_is_initialization_request_false_for_message(self): + assert self.agent.is_initialization_request(talkinput_text()) is False + + def test_is_initialization_request_false_for_config(self): + assert self.agent.is_initialization_request(talkinput_config()) is False + + # --- is_configuration_request() --- + + def test_is_configuration_request_true_for_config(self): + assert self.agent.is_configuration_request(talkinput_config()) is True + + def test_is_configuration_request_false_for_init(self): + assert self.agent.is_configuration_request(talkinput_init()) is False + + def test_is_configuration_request_false_for_message(self): + assert self.agent.is_configuration_request(talkinput_text()) is False + + # --- is_message_request() --- + + def test_is_message_request_true_for_text(self): + assert self.agent.is_message_request(talkinput_text()) is True + + def test_is_message_request_true_for_audio(self): + assert self.agent.is_message_request(talkinput_audio()) is True + + def test_is_message_request_false_for_init(self): + assert self.agent.is_message_request(talkinput_init()) is False + + # --- is_text_message() --- + + def test_is_text_message_true_for_text(self): + assert self.agent.is_text_message(talkinput_text()) is True + + def test_is_text_message_false_for_audio(self): + assert self.agent.is_text_message(talkinput_audio()) is False + + def test_is_text_message_false_for_init(self): + assert self.agent.is_text_message(talkinput_init()) is False + + def test_is_text_message_false_for_config(self): + assert self.agent.is_text_message(talkinput_config()) is False + + # --- is_audio_message() --- + + def test_is_audio_message_true_for_audio(self): + assert self.agent.is_audio_message(talkinput_audio()) is True + + def test_is_audio_message_false_for_text(self): + assert self.agent.is_audio_message(talkinput_text()) is False + + def test_is_audio_message_false_for_init(self): + assert self.agent.is_audio_message(talkinput_init()) is False + + # --- get_user_text() --- + + def test_get_user_text_returns_text_content(self): + assert self.agent.get_user_text(talkinput_text(text="hello world")) == "hello world" + + def test_get_user_text_none_for_audio_message(self): + assert self.agent.get_user_text(talkinput_audio()) is None + + def test_get_user_text_none_for_init(self): + assert self.agent.get_user_text(talkinput_init()) is None + + def test_get_user_text_none_for_config(self): + assert self.agent.get_user_text(talkinput_config()) is None + + def test_get_user_text_empty_string(self): + req = talkinput_text(text="") + # Empty string is still a valid text field being set + result = self.agent.get_user_text(req) + # Empty string in proto3 is the default — HasField won't be True for scalar fields + # but ConversationUserMessage.text is part of a oneof "message", so HasField works + assert result == "" or result is None # proto3 empty string edge case + + # --- get_message_id() --- + + def test_get_message_id_returns_id_for_text(self): + assert self.agent.get_message_id(talkinput_text(msg_id="test-123")) == "test-123" + + def test_get_message_id_returns_id_for_audio(self): + assert self.agent.get_message_id(talkinput_audio(msg_id="aud-1")) == "aud-1" + + def test_get_message_id_none_for_init(self): + assert self.agent.get_message_id(talkinput_init()) is None + + def test_get_message_id_none_for_config(self): + assert self.agent.get_message_id(talkinput_config()) is None + + # --- get_conversation_id() --- + + def test_get_conversation_id_returns_id(self): + assert self.agent.get_conversation_id(talkinput_init(conv_id=9999)) == 9999 + + def test_get_conversation_id_zero_id(self): + req = talkinput_init(conv_id=0) + # 0 is valid for uint64 — returns 0, not None + result = self.agent.get_conversation_id(req) + assert result == 0 + + def test_get_conversation_id_none_for_message(self): + assert self.agent.get_conversation_id(talkinput_text()) is None + + def test_get_conversation_id_none_for_config(self): + assert self.agent.get_conversation_id(talkinput_config()) is None + + # --- get_assistant_id() --- + + def test_get_assistant_id_returns_id(self): + assert self.agent.get_assistant_id(talkinput_init(assistant_id=777)) == 777 + + def test_get_assistant_id_none_for_message(self): + assert self.agent.get_assistant_id(talkinput_text()) is None + + def test_get_assistant_id_none_for_config(self): + assert self.agent.get_assistant_id(talkinput_config()) is None + + def test_get_assistant_id_none_when_no_assistant_sub_message(self): + # Initialization without an assistant sub-message set + req = TalkInput( + initialization=ConversationInitialization(assistantConversationId=1) + ) + assert self.agent.get_assistant_id(req) is None + + +# ============================================================================ +# Talk() Conversation Flow Integration +# ============================================================================ + + +class TestAgentKitAgentTalkFlow: + """End-to-end iteration tests for a full Talk() streaming conversation.""" + + def setup_method(self): + self.agent = _EchoAgent() + self.context = Mock() + + def _run(self, requests: list) -> list: + return list(self.agent.Talk(iter(requests), self.context)) + + def test_initialization_produces_one_ack(self): + responses = self._run([talkinput_init(conv_id=10)]) + assert len(responses) == 1 + + def test_initialization_ack_has_initialization_data_field(self): + responses = self._run([talkinput_init(conv_id=10)]) + assert responses[0].WhichOneof("data") == "initialization" + + def test_initialization_ack_preserves_conversation_id(self): + responses = self._run([talkinput_init(conv_id=10)]) + assert responses[0].initialization.assistantConversationId == 10 + + def test_initialization_must_come_before_messages(self): + # Full canonical flow: init -> config -> message -> responses + responses = self._run([ + talkinput_init(conv_id=5), + talkinput_config(), + talkinput_text(msg_id="u-1", text="hi"), + ]) + assert responses[0].WhichOneof("data") == "initialization" + + def test_configuration_ack_has_no_data_field(self): + responses = self._run([talkinput_init(), talkinput_config()]) + config_ack = responses[1] + assert config_ack.WhichOneof("data") is None + assert config_ack.code == 200 + + def test_text_message_produces_delta_and_final(self): + responses = self._run([ + talkinput_init(), + talkinput_text(msg_id="m-1", text="ping"), + ]) + # [0] init ack, [1] delta, [2] final + assert len(responses) == 3 + delta = responses[1] + final = responses[2] + assert delta.WhichOneof("data") == "assistant" + assert delta.assistant.text == "ping" + assert delta.assistant.completed is False + assert final.assistant.text == "ping!" + assert final.assistant.completed is True + + def test_full_flow_response_count(self): + responses = self._run([ + talkinput_init(), + talkinput_config(), + talkinput_text(msg_id="u-1", text="hello"), + ]) + # init ack + config ack + delta + final = 4 + assert len(responses) == 4 + + def test_full_flow_correct_order(self): + responses = self._run([ + talkinput_init(conv_id=5), + talkinput_config(), + talkinput_text(msg_id="u-1", text="hi"), + ]) + assert responses[0].WhichOneof("data") == "initialization" + assert responses[1].WhichOneof("data") is None # config ack + assert responses[2].assistant.completed is False # streaming delta + assert responses[3].assistant.completed is True # final + + def test_multiple_messages_in_one_session(self): + responses = self._run([ + talkinput_init(), + talkinput_text(msg_id="u-1", text="first"), + talkinput_text(msg_id="u-2", text="second"), + ]) + # init ack + (delta + final) * 2 = 5 + assert len(responses) == 5 + assert responses[1].assistant.text == "first" + assert responses[3].assistant.text == "second" + + def test_terminate_call_yields_end_conversation_directive(self): + class _TermAgent(AgentKitAgent): + def Talk(self, req_iter, ctx): + for req in req_iter: + if self.is_initialization_request(req): + yield self.initialization_response(req.initialization) + elif self.is_text_message(req): + yield self.terminate_call( + self.get_message_id(req), {"reason": "bye"} + ) + + agent = _TermAgent() + responses = list( + agent.Talk(iter([talkinput_init(), talkinput_text(msg_id="end")]), Mock()) + ) + term = responses[1] + assert term.directive.type == ConversationDirective.END_CONVERSATION + assert any_to_string(term.directive.args["reason"]) == "bye" + + def test_transfer_call_yields_transfer_conversation_directive(self): + class _TransferAgent(AgentKitAgent): + def Talk(self, req_iter, ctx): + for req in req_iter: + if self.is_initialization_request(req): + yield self.initialization_response(req.initialization) + elif self.is_text_message(req): + yield self.transfer_call( + self.get_message_id(req), {"to": "+15550001234"} + ) + + agent = _TransferAgent() + responses = list( + agent.Talk(iter([talkinput_init(), talkinput_text(msg_id="t")]), Mock()) + ) + assert responses[1].directive.type == ConversationDirective.TRANSFER_CONVERSATION + assert any_to_string(responses[1].directive.args["to"]) == "+15550001234" + + def test_tool_call_and_result_in_same_conversation(self): + class _ToolAgent(AgentKitAgent): + def Talk(self, req_iter, ctx): + for req in req_iter: + if self.is_initialization_request(req): + yield self.initialization_response(req.initialization) + elif self.is_text_message(req): + mid = self.get_message_id(req) + yield self.tool_call(mid, "t-1", "search", {"q": "test"}) + yield self.tool_call_result(mid, "t-1", "search", {"hits": "5"}) + yield self.assistant_response(mid, "Found 5 results", completed=True) + + agent = _ToolAgent() + responses = list( + agent.Talk(iter([talkinput_init(), talkinput_text(msg_id="q-1")]), Mock()) + ) + assert responses[0].WhichOneof("data") == "initialization" + assert responses[1].WhichOneof("data") == "tool" + assert responses[2].WhichOneof("data") == "toolResult" + assert responses[3].WhichOneof("data") == "assistant" + assert responses[3].assistant.completed is True + + def test_error_response_in_talk(self): + class _ErrorAgent(AgentKitAgent): + def Talk(self, req_iter, ctx): + for req in req_iter: + if self.is_initialization_request(req): + yield self.initialization_response(req.initialization) + elif self.is_text_message(req): + yield self.error_response(500, "Something went wrong") + + agent = _ErrorAgent() + responses = list( + agent.Talk(iter([talkinput_init(), talkinput_text()]), Mock()) + ) + err = responses[1] + assert err.WhichOneof("data") == "error" + assert err.success is False + assert err.error.errorCode == 500 + + +# ============================================================================ +# SSLConfig +# ============================================================================ + + +class TestSSLConfig: + """Tests for SSLConfig dataclass field storage and credential loading.""" + + def test_fields_stored_correctly(self): + cfg = SSLConfig(cert_path="c.crt", key_path="k.key", ca_cert_path="ca.crt") + assert cfg.cert_path == "c.crt" + assert cfg.key_path == "k.key" + assert cfg.ca_cert_path == "ca.crt" + + def test_ca_cert_path_defaults_to_none(self): + cfg = SSLConfig(cert_path="c.crt", key_path="k.key") + assert cfg.ca_cert_path is None + + def test_load_credentials_no_ca_calls_ssl_server_credentials(self): + cfg = SSLConfig(cert_path="c.crt", key_path="k.key") + with patch("builtins.open", mock_open(read_data=b"DATA")): + with patch("os.path.exists", return_value=False): + with patch("grpc.ssl_server_credentials") as mock_creds: + cfg.load_credentials() + mock_creds.assert_called_once() + + def test_load_credentials_no_ca_require_client_auth_false(self): + cfg = SSLConfig(cert_path="c.crt", key_path="k.key") + with patch("builtins.open", mock_open(read_data=b"DATA")): + with patch("os.path.exists", return_value=False): + with patch("grpc.ssl_server_credentials") as mock_creds: + cfg.load_credentials() + _, kwargs = mock_creds.call_args + assert kwargs["require_client_auth"] is False + + def test_load_credentials_no_ca_root_certificates_is_none(self): + cfg = SSLConfig(cert_path="c.crt", key_path="k.key") + with patch("builtins.open", mock_open(read_data=b"DATA")): + with patch("os.path.exists", return_value=False): + with patch("grpc.ssl_server_credentials") as mock_creds: + cfg.load_credentials() + _, kwargs = mock_creds.call_args + assert kwargs["root_certificates"] is None + + def test_load_credentials_with_ca_passes_ca_data(self): + cfg = SSLConfig(cert_path="c.crt", key_path="k.key", ca_cert_path="ca.crt") + + file_data = { + "k.key": b"PRIVATE_KEY", + "c.crt": b"CERTIFICATE", + "ca.crt": b"CA_CERT", + } + + def fake_open(path, mode="r"): + m = MagicMock() + m.__enter__ = lambda s: s + m.__exit__ = MagicMock(return_value=False) + m.read = MagicMock(return_value=file_data[path]) + return m + + with patch("builtins.open", side_effect=fake_open): + with patch("os.path.exists", return_value=True): + with patch("grpc.ssl_server_credentials") as mock_creds: + cfg.load_credentials() + + _, kwargs = mock_creds.call_args + assert kwargs["root_certificates"] == b"CA_CERT" + assert kwargs["require_client_auth"] is True + + def test_load_credentials_with_ca_passes_key_and_cert(self): + cfg = SSLConfig(cert_path="c.crt", key_path="k.key", ca_cert_path="ca.crt") + + file_data = { + "k.key": b"PRIVATE_KEY", + "c.crt": b"CERTIFICATE", + "ca.crt": b"CA_CERT", + } + + def fake_open(path, mode="r"): + m = MagicMock() + m.__enter__ = lambda s: s + m.__exit__ = MagicMock(return_value=False) + m.read = MagicMock(return_value=file_data[path]) + return m + + with patch("builtins.open", side_effect=fake_open): + with patch("os.path.exists", return_value=True): + with patch("grpc.ssl_server_credentials") as mock_creds: + cfg.load_credentials() + + args, _ = mock_creds.call_args + key_cert_pairs = args[0] + assert key_cert_pairs == [(b"PRIVATE_KEY", b"CERTIFICATE")] + + +# ============================================================================ +# AuthConfig +# ============================================================================ + + +class TestAuthConfig: + """Tests for AuthConfig dataclass defaults and custom values.""" + + def test_default_enabled_is_false(self): + cfg = AuthConfig() + assert cfg.enabled is False + + def test_default_token_is_none(self): + cfg = AuthConfig() + assert cfg.token is None + + def test_default_header_key_is_authorization(self): + cfg = AuthConfig() + assert cfg.header_key == "authorization" + + def test_default_validator_is_none(self): + cfg = AuthConfig() + assert cfg.validator is None + + def test_custom_fields_stored(self): + validator = lambda t, m: True + cfg = AuthConfig( + enabled=True, + token="secret", + header_key="x-api-key", + validator=validator, + ) + assert cfg.enabled is True + assert cfg.token == "secret" + assert cfg.header_key == "x-api-key" + assert cfg.validator is validator + + +# ============================================================================ +# AuthorizationInterceptor +# ============================================================================ + + +class TestAuthorizationInterceptor: + """Tests for the gRPC server interceptor that enforces token auth.""" + + def _make_call_details(self, metadata: dict) -> Mock: + details = Mock() + details.invocation_metadata = metadata + return details + + def test_disabled_auth_always_passes_through(self): + interceptor = AuthorizationInterceptor(AuthConfig(enabled=False)) + continuation = Mock(return_value="handler") + details = self._make_call_details({}) + result = interceptor.intercept_service(continuation, details) + continuation.assert_called_once_with(details) + assert result == "handler" + + def test_disabled_auth_ignores_token_value(self): + interceptor = AuthorizationInterceptor(AuthConfig(enabled=False, token="tok")) + continuation = Mock(return_value="handler") + details = self._make_call_details({"authorization": "wrong"}) + result = interceptor.intercept_service(continuation, details) + continuation.assert_called_once_with(details) + assert result == "handler" + + def test_valid_token_passes_through(self): + interceptor = AuthorizationInterceptor( + AuthConfig(enabled=True, token="my-token") + ) + continuation = Mock(return_value="handler") + details = self._make_call_details({"authorization": "my-token"}) + result = interceptor.intercept_service(continuation, details) + continuation.assert_called_once_with(details) + assert result == "handler" + + def test_invalid_token_blocks_request(self): + interceptor = AuthorizationInterceptor( + AuthConfig(enabled=True, token="my-token") + ) + continuation = Mock() + details = self._make_call_details({"authorization": "wrong-token"}) + result = interceptor.intercept_service(continuation, details) + continuation.assert_not_called() + assert result is not None + + def test_missing_token_header_blocks_request(self): + interceptor = AuthorizationInterceptor( + AuthConfig(enabled=True, token="my-token") + ) + continuation = Mock() + details = self._make_call_details({}) + result = interceptor.intercept_service(continuation, details) + continuation.assert_not_called() + assert result is not None + + def test_custom_validator_allow(self): + interceptor = AuthorizationInterceptor( + AuthConfig(enabled=True, validator=lambda t, m: t == "allowed") + ) + continuation = Mock(return_value="handler") + details = self._make_call_details({"authorization": "allowed"}) + result = interceptor.intercept_service(continuation, details) + continuation.assert_called_once_with(details) + assert result == "handler" + + def test_custom_validator_deny(self): + interceptor = AuthorizationInterceptor( + AuthConfig(enabled=True, validator=lambda t, m: False) + ) + continuation = Mock() + details = self._make_call_details({"authorization": "anything"}) + result = interceptor.intercept_service(continuation, details) + continuation.assert_not_called() + assert result is not None + + def test_custom_validator_receives_full_metadata(self): + received = {} + + def validator(token, metadata): + received["token"] = token + received["metadata"] = metadata + return True + + interceptor = AuthorizationInterceptor( + AuthConfig(enabled=True, validator=validator) + ) + details = self._make_call_details({"authorization": "tok", "x-extra": "data"}) + interceptor.intercept_service(Mock(), details) + assert received["token"] == "tok" + assert received["metadata"]["x-extra"] == "data" + + def test_custom_header_key_used_for_lookup(self): + interceptor = AuthorizationInterceptor( + AuthConfig(enabled=True, token="tok", header_key="x-api-key") + ) + continuation = Mock(return_value="handler") + details = self._make_call_details({"x-api-key": "tok"}) + result = interceptor.intercept_service(continuation, details) + continuation.assert_called_once_with(details) + assert result == "handler" + + def test_custom_header_key_wrong_value_blocks(self): + interceptor = AuthorizationInterceptor( + AuthConfig(enabled=True, token="tok", header_key="x-api-key") + ) + continuation = Mock() + details = self._make_call_details({"x-api-key": "bad"}) + interceptor.intercept_service(continuation, details) + continuation.assert_not_called() + + def test_abort_handler_is_not_none(self): + interceptor = AuthorizationInterceptor(AuthConfig(enabled=True, token="t")) + handler = interceptor._abort_handler() + assert handler is not None + + +# ============================================================================ +# AgentKitServer +# ============================================================================ + + +class TestAgentKitServer: + """Tests for AgentKitServer initialization, lifecycle, SSL, and auth.""" + + def _make_server(self, **kwargs) -> AgentKitServer: + return AgentKitServer(agent=AgentKitAgent(), **kwargs) + + # --- __init__ defaults --- + + def test_default_host(self): + assert self._make_server().host == "0.0.0.0" + + def test_default_port(self): + assert self._make_server().port == 50051 + + def test_default_max_workers(self): + assert self._make_server().max_workers == 10 + + def test_custom_host_and_port(self): + server = self._make_server(host="127.0.0.1", port=9090) + assert server.host == "127.0.0.1" + assert server.port == 9090 + + def test_address_property(self): + server = self._make_server(host="0.0.0.0", port=8080) + assert server.address == "0.0.0.0:8080" + + def test_is_running_false_before_start(self): + assert self._make_server().is_running is False + + # --- SSL config parsing --- + + def test_ssl_config_parsed_from_dict(self): + server = self._make_server( + ssl_config={ + "cert_path": "c.crt", + "key_path": "k.key", + "ca_cert_path": "ca.crt", + } + ) + assert server._ssl_config is not None + assert server._ssl_config.cert_path == "c.crt" + assert server._ssl_config.key_path == "k.key" + assert server._ssl_config.ca_cert_path == "ca.crt" + + def test_ssl_config_none_when_not_provided(self): + assert self._make_server()._ssl_config is None + + def test_ssl_config_no_ca_cert_optional(self): + server = self._make_server(ssl_config={"cert_path": "c.crt", "key_path": "k.key"}) + assert server._ssl_config.ca_cert_path is None + + # --- Auth config parsing --- + + def test_auth_config_parsed_from_dict(self): + server = self._make_server( + auth_config={ + "enabled": True, + "token": "secret", + "header_key": "x-auth", + } + ) + assert server._auth_config is not None + assert server._auth_config.enabled is True + assert server._auth_config.token == "secret" + assert server._auth_config.header_key == "x-auth" + + def test_auth_config_none_when_not_provided(self): + assert self._make_server()._auth_config is None + + def test_auth_config_default_enabled_false(self): + server = self._make_server(auth_config={"enabled": False}) + assert server._auth_config.enabled is False + + # --- start() insecure --- + + def test_start_insecure_calls_add_insecure_port(self): + server = self._make_server(port=59997) + mock_grpc_server = MagicMock() + with patch("grpc.server", return_value=mock_grpc_server): + with patch("rapida.agentkit.add_AgentKitServicer_to_server"): + server.start() + mock_grpc_server.add_insecure_port.assert_called_once_with("0.0.0.0:59997") + + def test_start_calls_server_start(self): + mock_grpc_server = MagicMock() + with patch("grpc.server", return_value=mock_grpc_server): + with patch("rapida.agentkit.add_AgentKitServicer_to_server"): + self._make_server().start() + mock_grpc_server.start.assert_called_once() + + def test_start_sets_is_running_true(self): + server = self._make_server() + with patch("grpc.server", return_value=MagicMock()): + with patch("rapida.agentkit.add_AgentKitServicer_to_server"): + server.start() + assert server.is_running is True + + def test_start_registers_agent_with_server(self): + server = self._make_server() + mock_grpc_server = MagicMock() + with patch("grpc.server", return_value=mock_grpc_server): + with patch("rapida.agentkit.add_AgentKitServicer_to_server") as mock_add: + server.start() + mock_add.assert_called_once_with(server.agent, mock_grpc_server) + + # --- start() with SSL --- + + def test_start_ssl_calls_add_secure_port(self): + server = self._make_server( + port=59996, + ssl_config={"cert_path": "c.crt", "key_path": "k.key"}, + ) + mock_grpc_server = MagicMock() + mock_credentials = MagicMock() + with patch("grpc.server", return_value=mock_grpc_server): + with patch("rapida.agentkit.add_AgentKitServicer_to_server"): + with patch("os.path.exists", return_value=True): + with patch.object( + SSLConfig, "load_credentials", return_value=mock_credentials + ): + server.start() + mock_grpc_server.add_secure_port.assert_called_once_with( + "0.0.0.0:59996", mock_credentials + ) + + def test_start_ssl_does_not_call_insecure_port(self): + server = self._make_server( + ssl_config={"cert_path": "c.crt", "key_path": "k.key"} + ) + mock_grpc_server = MagicMock() + with patch("grpc.server", return_value=mock_grpc_server): + with patch("rapida.agentkit.add_AgentKitServicer_to_server"): + with patch("os.path.exists", return_value=True): + with patch.object(SSLConfig, "load_credentials", return_value=MagicMock()): + server.start() + mock_grpc_server.add_insecure_port.assert_not_called() + + def test_start_ssl_cert_not_found_raises_file_not_found(self): + server = self._make_server( + ssl_config={"cert_path": "missing.crt", "key_path": "k.key"} + ) + with patch("grpc.server", return_value=MagicMock()): + with patch("rapida.agentkit.add_AgentKitServicer_to_server"): + with patch("os.path.exists", return_value=False): + with pytest.raises(FileNotFoundError, match="missing.crt"): + server.start() + + def test_start_ssl_key_not_found_raises_file_not_found(self): + server = self._make_server( + ssl_config={"cert_path": "c.crt", "key_path": "missing.key"} + ) + + def mock_exists(path): + return path == "c.crt" + + with patch("grpc.server", return_value=MagicMock()): + with patch("rapida.agentkit.add_AgentKitServicer_to_server"): + with patch("os.path.exists", side_effect=mock_exists): + with pytest.raises(FileNotFoundError, match="missing.key"): + server.start() + + # --- start() with auth --- + + def test_start_with_auth_adds_authorization_interceptor(self): + server = self._make_server(auth_config={"enabled": True, "token": "tok"}) + captured_interceptors = [] + + def capture_server(executor, interceptors=None): + captured_interceptors.extend(interceptors or []) + return MagicMock() + + with patch("grpc.server", side_effect=capture_server): + with patch("rapida.agentkit.add_AgentKitServicer_to_server"): + server.start() + + assert len(captured_interceptors) == 1 + assert isinstance(captured_interceptors[0], AuthorizationInterceptor) + + def test_start_without_auth_adds_no_interceptors(self): + server = self._make_server() + captured_interceptors = [] + + def capture_server(executor, interceptors=None): + captured_interceptors.extend(interceptors or []) + return MagicMock() + + with patch("grpc.server", side_effect=capture_server): + with patch("rapida.agentkit.add_AgentKitServicer_to_server"): + server.start() + + assert len(captured_interceptors) == 0 + + def test_start_with_auth_disabled_adds_no_interceptors(self): + server = self._make_server(auth_config={"enabled": False, "token": "tok"}) + captured_interceptors = [] + + def capture_server(executor, interceptors=None): + captured_interceptors.extend(interceptors or []) + return MagicMock() + + with patch("grpc.server", side_effect=capture_server): + with patch("rapida.agentkit.add_AgentKitServicer_to_server"): + server.start() + + assert len(captured_interceptors) == 0 + + # --- stop() --- + + def test_stop_calls_grpc_server_stop(self): + server = self._make_server() + mock_grpc_server = MagicMock() + server._server = mock_grpc_server + server.stop(grace=10) + mock_grpc_server.stop.assert_called_once_with(10) + + def test_stop_with_default_grace(self): + server = self._make_server() + mock_grpc_server = MagicMock() + server._server = mock_grpc_server + server.stop() + mock_grpc_server.stop.assert_called_once_with(5) + + def test_stop_noop_when_server_never_started(self): + server = self._make_server() + # Must not raise + server.stop() + + # --- wait_for_termination() --- + + def test_wait_for_termination_returns_true_when_not_started(self): + assert self._make_server().wait_for_termination(timeout=0.1) is True + + def test_wait_for_termination_delegates_to_grpc_server(self): + server = self._make_server() + mock_grpc_server = MagicMock() + mock_grpc_server.wait_for_termination.return_value = True + server._server = mock_grpc_server + result = server.wait_for_termination(timeout=3.0) + mock_grpc_server.wait_for_termination.assert_called_once_with(3.0) + assert result is True + + def test_wait_for_termination_no_timeout(self): + server = self._make_server() + mock_grpc_server = MagicMock() + mock_grpc_server.wait_for_termination.return_value = True + server._server = mock_grpc_server + server.wait_for_termination() + mock_grpc_server.wait_for_termination.assert_called_once_with(None) diff --git a/tests/test_proto_imports.py b/tests/test_proto_imports.py index 6af898e..604184f 100644 --- a/tests/test_proto_imports.py +++ b/tests/test_proto_imports.py @@ -14,9 +14,9 @@ class TestCommonPb2Imports: """Test imports from common_pb2 module.""" - + MODULE = "rapida.clients.protos.common_pb2" - + EXPECTED_IMPORTS = [ "FieldSelector", "Criteria", @@ -48,16 +48,16 @@ class TestCommonPb2Imports: "AssistantDefinition", "Source", # Enum ] - + @pytest.fixture def module(self): """Load the protobuf module.""" return importlib.import_module(self.MODULE) - + def test_module_loads(self, module): """Test that the module can be imported.""" assert module is not None - + @pytest.mark.parametrize("class_name", EXPECTED_IMPORTS) def test_import_exists(self, module, class_name): """Test that each expected class can be imported from the module.""" @@ -66,7 +66,7 @@ def test_import_exists(self, module, class_name): f"The proto file may have changed. " f"Available exports: {[name for name in dir(module) if not name.startswith('_')]}" ) - + def test_list_available_exports(self, module): """Helper test to show all available exports from the module.""" exports = [name for name in dir(module) if not name.startswith('_')] @@ -77,9 +77,9 @@ def test_list_available_exports(self, module): class TestAssistantKnowledgePb2Imports: """Test imports from assistant_knowledge_pb2 module.""" - + MODULE = "rapida.clients.protos.assistant_knowledge_pb2" - + EXPECTED_IMPORTS = [ "AssistantKnowledge", "CreateAssistantKnowledgeRequest", @@ -90,11 +90,11 @@ class TestAssistantKnowledgePb2Imports: "GetAllAssistantKnowledgeRequest", "GetAllAssistantKnowledgeResponse", ] - + @pytest.fixture def module(self): return importlib.import_module(self.MODULE) - + @pytest.mark.parametrize("class_name", EXPECTED_IMPORTS) def test_import_exists(self, module, class_name): assert hasattr(module, class_name), ( @@ -105,9 +105,9 @@ def test_import_exists(self, module, class_name): class TestVaultApiPb2Imports: """Test imports from vault_api_pb2 module.""" - + MODULE = "rapida.clients.protos.vault_api_pb2" - + EXPECTED_IMPORTS = [ "VaultCredential", "CreateProviderCredentialRequest", @@ -116,11 +116,11 @@ class TestVaultApiPb2Imports: "GetCredentialResponse", "GetAllOrganizationCredentialRequest", ] - + @pytest.fixture def module(self): return importlib.import_module(self.MODULE) - + @pytest.mark.parametrize("class_name", EXPECTED_IMPORTS) def test_import_exists(self, module, class_name): assert hasattr(module, class_name), ( @@ -131,9 +131,9 @@ def test_import_exists(self, module, class_name): class TestTalkApiPb2Imports: """Test imports from talk_api_pb2 module.""" - + MODULE = "rapida.clients.protos.talk_api_pb2" - + EXPECTED_IMPORTS = [ "CreateMessageMetricRequest", "CreateMessageMetricResponse", @@ -144,11 +144,11 @@ class TestTalkApiPb2Imports: "CreatePhoneCallRequest", "CreatePhoneCallResponse", ] - + @pytest.fixture def module(self): return importlib.import_module(self.MODULE) - + @pytest.mark.parametrize("class_name", EXPECTED_IMPORTS) def test_import_exists(self, module, class_name): assert hasattr(module, class_name), ( @@ -159,9 +159,9 @@ def test_import_exists(self, module, class_name): class TestAssistantAnalysisPb2Imports: """Test imports from assistant_analysis_pb2 module.""" - + MODULE = "rapida.clients.protos.assistant_analysis_pb2" - + EXPECTED_IMPORTS = [ "AssistantAnalysis", "CreateAssistantAnalysisRequest", @@ -172,11 +172,11 @@ class TestAssistantAnalysisPb2Imports: "GetAllAssistantAnalysisRequest", "GetAllAssistantAnalysisResponse", ] - + @pytest.fixture def module(self): return importlib.import_module(self.MODULE) - + @pytest.mark.parametrize("class_name", EXPECTED_IMPORTS) def test_import_exists(self, module, class_name): assert hasattr(module, class_name), ( @@ -187,9 +187,9 @@ def test_import_exists(self, module, class_name): class TestInvokerApiPb2Imports: """Test imports from invoker_api_pb2 module.""" - + MODULE = "rapida.clients.protos.invoker_api_pb2" - + EXPECTED_IMPORTS = [ "EndpointDefinition", "InvokeRequest", @@ -199,11 +199,11 @@ class TestInvokerApiPb2Imports: "ProbeRequest", "ProbeResponse", ] - + @pytest.fixture def module(self): return importlib.import_module(self.MODULE) - + @pytest.mark.parametrize("class_name", EXPECTED_IMPORTS) def test_import_exists(self, module, class_name): assert hasattr(module, class_name), ( @@ -214,9 +214,9 @@ def test_import_exists(self, module, class_name): class TestWebApiPb2Imports: """Test imports from web_api_pb2 module.""" - + MODULE = "rapida.clients.protos.web_api_pb2" - + EXPECTED_IMPORTS = [ "AuthenticateRequest", "RegisterUserRequest", @@ -269,11 +269,11 @@ class TestWebApiPb2Imports: "CreateProjectCredentialResponse", "GetAllProjectCredentialResponse", ] - + @pytest.fixture def module(self): return importlib.import_module(self.MODULE) - + @pytest.mark.parametrize("class_name", EXPECTED_IMPORTS) def test_import_exists(self, module, class_name): assert hasattr(module, class_name), ( @@ -284,9 +284,9 @@ def test_import_exists(self, module, class_name): class TestAssistantWebhookPb2Imports: """Test imports from assistant_webhook_pb2 module.""" - + MODULE = "rapida.clients.protos.assistant_webhook_pb2" - + EXPECTED_IMPORTS = [ "AssistantWebhook", "AssistantWebhookLog", @@ -302,11 +302,11 @@ class TestAssistantWebhookPb2Imports: "GetAssistantWebhookLogResponse", "GetAllAssistantWebhookLogResponse", ] - + @pytest.fixture def module(self): return importlib.import_module(self.MODULE) - + @pytest.mark.parametrize("class_name", EXPECTED_IMPORTS) def test_import_exists(self, module, class_name): assert hasattr(module, class_name), ( @@ -317,20 +317,20 @@ def test_import_exists(self, module, class_name): class TestConnectApiPb2Imports: """Test imports from connect_api_pb2 module.""" - + MODULE = "rapida.clients.protos.connect_api_pb2" - + EXPECTED_IMPORTS = [ "GeneralConnectRequest", "GeneralConnectResponse", "GetConnectorFilesRequest", "GetConnectorFilesResponse", ] - + @pytest.fixture def module(self): return importlib.import_module(self.MODULE) - + @pytest.mark.parametrize("class_name", EXPECTED_IMPORTS) def test_import_exists(self, module, class_name): assert hasattr(module, class_name), ( @@ -341,9 +341,9 @@ def test_import_exists(self, module, class_name): class TestEndpointApiPb2Imports: """Test imports from endpoint_api_pb2 module.""" - + MODULE = "rapida.clients.protos.endpoint_api_pb2" - + EXPECTED_IMPORTS = [ "EndpointAttribute", "EndpointProviderModelAttribute", @@ -377,11 +377,11 @@ class TestEndpointApiPb2Imports: "GetEndpointLogRequest", "GetEndpointLogResponse", ] - + @pytest.fixture def module(self): return importlib.import_module(self.MODULE) - + @pytest.mark.parametrize("class_name", EXPECTED_IMPORTS) def test_import_exists(self, module, class_name): assert hasattr(module, class_name), ( @@ -392,9 +392,9 @@ def test_import_exists(self, module, class_name): class TestAssistantToolPb2Imports: """Test imports from assistant_tool_pb2 module.""" - + MODULE = "rapida.clients.protos.assistant_tool_pb2" - + EXPECTED_IMPORTS = [ "AssistantTool", "CreateAssistantToolRequest", @@ -405,11 +405,11 @@ class TestAssistantToolPb2Imports: "GetAllAssistantToolRequest", "GetAllAssistantToolResponse", ] - + @pytest.fixture def module(self): return importlib.import_module(self.MODULE) - + @pytest.mark.parametrize("class_name", EXPECTED_IMPORTS) def test_import_exists(self, module, class_name): assert hasattr(module, class_name), ( @@ -420,9 +420,9 @@ def test_import_exists(self, module, class_name): class TestIntegrationApiPb2Imports: """Test imports from integration_api_pb2 module.""" - + MODULE = "rapida.clients.protos.integration_api_pb2" - + EXPECTED_IMPORTS = [ "Credential", "ToolDefinition", @@ -443,11 +443,11 @@ class TestIntegrationApiPb2Imports: "GetModerationRequest", "GetModerationResponse", ] - + @pytest.fixture def module(self): return importlib.import_module(self.MODULE) - + @pytest.mark.parametrize("class_name", EXPECTED_IMPORTS) def test_import_exists(self, module, class_name): assert hasattr(module, class_name), ( @@ -458,9 +458,9 @@ def test_import_exists(self, module, class_name): class TestAssistantDeploymentPb2Imports: """Test imports from assistant_deployment_pb2 module.""" - + MODULE = "rapida.clients.protos.assistant_deployment_pb2" - + EXPECTED_IMPORTS = [ "DeploymentAudioProvider", "AssistantWebpluginDeployment", @@ -470,11 +470,11 @@ class TestAssistantDeploymentPb2Imports: "AssistantApiDeployment", "GetAssistantDeploymentRequest", ] - + @pytest.fixture def module(self): return importlib.import_module(self.MODULE) - + @pytest.mark.parametrize("class_name", EXPECTED_IMPORTS) def test_import_exists(self, module, class_name): assert hasattr(module, class_name), ( @@ -485,9 +485,9 @@ def test_import_exists(self, module, class_name): class TestKnowledgeApiPb2Imports: """Test imports from knowledge_api_pb2 module.""" - + MODULE = "rapida.clients.protos.knowledge_api_pb2" - + EXPECTED_IMPORTS = [ "CreateKnowledgeRequest", "CreateKnowledgeResponse", @@ -508,11 +508,11 @@ class TestKnowledgeApiPb2Imports: "UpdateKnowledgeDocumentSegmentRequest", "DeleteKnowledgeDocumentSegmentRequest", ] - + @pytest.fixture def module(self): return importlib.import_module(self.MODULE) - + @pytest.mark.parametrize("class_name", EXPECTED_IMPORTS) def test_import_exists(self, module, class_name): assert hasattr(module, class_name), ( @@ -523,9 +523,9 @@ def test_import_exists(self, module, class_name): class TestAssistantApiPb2Imports: """Test imports from assistant_api_pb2 module.""" - + MODULE = "rapida.clients.protos.assistant_api_pb2" - + EXPECTED_IMPORTS = [ "Assistant", "CreateAssistantRequest", @@ -543,11 +543,11 @@ class TestAssistantApiPb2Imports: "GetAssistantConversationRequest", "GetAssistantConversationResponse", ] - + @pytest.fixture def module(self): return importlib.import_module(self.MODULE) - + @pytest.mark.parametrize("class_name", EXPECTED_IMPORTS) def test_import_exists(self, module, class_name): assert hasattr(module, class_name), ( @@ -558,17 +558,17 @@ def test_import_exists(self, module, class_name): class TestAssistantProviderPb2Imports: """Test imports from assistant_provider_pb2 module.""" - + MODULE = "rapida.clients.protos.assistant_provider_pb2" - + EXPECTED_IMPORTS = [ "AssistantProviderModel", ] - + @pytest.fixture def module(self): return importlib.import_module(self.MODULE) - + @pytest.mark.parametrize("class_name", EXPECTED_IMPORTS) def test_import_exists(self, module, class_name): assert hasattr(module, class_name), ( @@ -584,7 +584,7 @@ def test_import_exists(self, module, class_name): def get_module_exports(module_path: str) -> List[str]: """ Helper function to get all public exports from a module. - + Usage: exports = get_module_exports("rapida.clients.protos.common_pb2") print(exports) @@ -599,7 +599,7 @@ def get_module_exports(module_path: str) -> List[str]: def validate_imports(module_path: str, expected_imports: List[str]) -> Tuple[List[str], List[str], List[str]]: """ Validate imports against a module and return valid, invalid, and extra exports. - + Returns: Tuple of (valid_imports, invalid_imports, extra_exports) """ @@ -607,11 +607,11 @@ def validate_imports(module_path: str, expected_imports: List[str]) -> Tuple[Lis module = importlib.import_module(module_path) actual_exports = set(name for name in dir(module) if not name.startswith('_')) expected_set = set(expected_imports) - + valid = list(expected_set & actual_exports) invalid = list(expected_set - actual_exports) extra = list(actual_exports - expected_set) - + return sorted(valid), sorted(invalid), sorted(extra) except ImportError as e: return [], expected_imports, [f"ERROR: {e}"] @@ -619,11 +619,11 @@ def validate_imports(module_path: str, expected_imports: List[str]) -> Tuple[Lis class TestRapidaPackageImport: """Test that the main rapida package can be imported without errors.""" - + def test_rapida_import(self): """ Test that 'import rapida' works without ImportError. - + If this test fails, it means there's a broken import in rapida/__init__.py """ try: @@ -643,7 +643,7 @@ def test_rapida_import(self): class TestProtoImportSummary: """Generate a summary report of all proto import issues.""" - + PROTO_MODULES = { "rapida.clients.protos.common_pb2": TestCommonPb2Imports.EXPECTED_IMPORTS, "rapida.clients.protos.assistant_knowledge_pb2": TestAssistantKnowledgePb2Imports.EXPECTED_IMPORTS, @@ -662,22 +662,22 @@ class TestProtoImportSummary: "rapida.clients.protos.assistant_api_pb2": TestAssistantApiPb2Imports.EXPECTED_IMPORTS, "rapida.clients.protos.assistant_provider_pb2": TestAssistantProviderPb2Imports.EXPECTED_IMPORTS, } - + def test_generate_import_report(self): """ Generate a comprehensive report of all import issues. - + This test always passes but prints a detailed report. """ print("\n" + "=" * 80) print("PROTO IMPORT VALIDATION REPORT") print("=" * 80) - + all_issues = [] - + for module_path, expected_imports in self.PROTO_MODULES.items(): valid, invalid, extra = validate_imports(module_path, expected_imports) - + if invalid: all_issues.append((module_path, invalid)) print(f"\n❌ {module_path}") @@ -686,9 +686,9 @@ def test_generate_import_report(self): print(f" AVAILABLE ALTERNATIVES: {extra[:10]}{'...' if len(extra) > 10 else ''}") else: print(f"\n✅ {module_path} - All {len(valid)} imports valid") - + print("\n" + "=" * 80) - + if all_issues: print("\n⚠️ SUMMARY: Found import issues in the following modules:") for module_path, invalid in all_issues: @@ -696,5 +696,5 @@ def test_generate_import_report(self): print("\nTo fix: Update rapida/__init__.py to remove or replace these imports.") else: print("\n✅ SUMMARY: All proto imports are valid!") - + print("=" * 80)