@@ -6,10 +6,10 @@ Entities:
661 . [ ServiceClient] ( #class-serviceclient )
77 - [ \_\_ init\_\_ ] ( #__init__ )
88 - [ call_rpc] ( #call_rpc )
9+ - [ _ get_service_stub] ( #_get_service_stub )
910 - [ _ generate_grpc_stub] ( #_generate_grpc_stub )
1011 - [ get_grpc_base_channel] ( #get_grpc_base_channel )
1112 - [ _ get_grpc_channel] ( #_get_grpc_channel )
12- - [ _ get_service_call_metadata] ( #_get_service_call_metadata )
1313 - [ _ filter_existing_channels_from_new_payment_channels] ( #_filter_existing_channels_from_new_payment_channels )
1414 - [ load_open_channels] ( #load_open_channels )
1515 - [ get_current_block_number] ( #get_current_block_number )
@@ -23,10 +23,11 @@ Entities:
2323 - [ generate_training_signature] ( #generate_training_signature )
2424 - [ get_free_call_config] ( #get_free_call_config )
2525 - [ get_service_details] ( #get_service_details )
26+ - [ training] ( #training )
27+ - [ _ get_training_model_id] ( #_get_training_model_id )
2628 - [ get_concurrency_flag] ( #get_concurrency_flag )
2729 - [ get_concurrency_token_and_channel] ( #get_concurrency_token_and_channel )
2830 - [ set_concurrency_token_and_channel] ( #set_concurrency_token_and_channel )
29- - [ get_path_to_pb_files] ( #get_path_to_pb_files )
3031 - [ get_services_and_messages_info] ( #get_services_and_messages_info )
3132 - [ get_services_and_messages_info_as_pretty_string] ( #get_services_and_messages_info_as_pretty_string )
3233
@@ -58,14 +59,16 @@ the `PaymentStrategy` inheritor classes.
5859- ` payment_channel_provider ` (PaymentChannelProvider): An instance of the ` PaymentChannelProvider ` class for
5960working with channels and interacting with MPE.
6061- ` payment_channel_state_service_client ` (Any): Stub for interacting with PaymentChannelStateService via gRPC.
61- - ` service ` (Any): The gRPC service stub instance .
62+ - ` service_stubs ` (Any): The gRPC service stubs .
6263- ` pb2_module ` (ModuleType): The imported protobuf module.
6364- ` payment_channels ` (list[ PaymentChannel] ): The list of payment channels.
6465- ` last_read_block ` (int): The last read block number.
6566- ` account ` (Account): An instance of the ` Account ` class for interacting with the MultiPartyEscrow and
6667SingularityNetToken contracts.
6768- ` sdk_web3 ` (Web3): The ` Web3 ` instance.
6869- ` mpe_address ` (str): The MPE contract address.
70+ - ` path_to_pb_files ` (Path): The path to the protobuf files.
71+ - ` __training ` (Training): An instance of the ` Training ` class.
6972
7073#### methods
7174
@@ -79,14 +82,16 @@ Initializes a new instance of the class.
7982- ` service_id ` (str): The ID of the service.
8083- ` service_metadata ` (MPEServiceMetadata): The metadata for the service.
8184- ` group ` (dict): The payment group from the service metadata.
82- - ` service_stub ` (ServiceStub): The gRPC service stub .
85+ - ` service_stubs ` (list [ ServiceStub] ): The gRPC service stubs .
8386- ` payment_strategy ` (PaymentStrategy): The payment channel management strategy.
8487- ` options ` (dict): Additional options for the service client.
8588- ` mpe_contract ` (MPEContract): The MPE contract instance.
8689- ` account ` (Account): An instance of the ` Account ` class.
8790- ` sdk_web3 ` (Web3): The ` Web3 ` instance.
8891- ` pb2_module ` (str | ModuleType): The module containing the gRPC message definitions.
8992- ` payment_channel_provider ` (PaymentChannelProvider): The payment channel provider instance.
93+ - ` path_to_pb_files ` (Path): The path to the protobuf files.
94+ - ` training_added ` (bool): Whether training enabled on the service or not.
9095
9196###### returns:
9297
@@ -107,6 +112,18 @@ that are passed to the called method as arguments.
107112
108113- The response from the RPC method call. (Any)
109114
115+ #### ` _get_service_stub `
116+
117+ Generates a gRPC stub instance for all the service stubs and returns one which matches the rpc name.
118+
119+ ###### args:
120+
121+ - ` rpc_name ` (str): The name of the RPC method to call.
122+
123+ ###### returns:
124+
125+ - service_stub (Any): The gRPC service stub.
126+
110127#### ` _generate_grpc_stub `
111128
112129Generates a gRPC stub instance for the given service stub.
@@ -148,16 +165,6 @@ a ValueError is raised with an error message.
148165
149166- ValueError: If the scheme in the service metadata is neither "http" nor "https".
150167
151- #### ` _get_service_call_metadata `
152-
153- Retrieves the metadata required for making a service call using the payment strategy.
154-
155- ###### returns:
156-
157- - Payment metadata. (list[ tuple[ str, Any]] )
158-
159- <!-- TODO: implement method "_intercept_call"-->
160-
161168#### ` _filter_existing_channels_from_new_payment_channels `
162169
163170Filters the new channel list so that only those that are not yet among the existing ones remain,
@@ -300,6 +307,30 @@ Retrieves the details of the service.
300307- A tuple containing the organization ID, service ID, group ID, and the first endpoint for the group.
301308(tuple[ str, str, str, str] )
302309
310+ #### ` training `
311+
312+ Property that returns the training object associated with the service.
313+
314+ ###### returns:
315+
316+ - The training object associated with the service. (Training)
317+
318+ ###### raises:
319+
320+ - NoTrainingException: If training is not implemented for the service.
321+
322+ #### ` _get_training_model_id `
323+
324+ Converts model ID from ` str ` to stub object.
325+
326+ ###### args:
327+
328+ - ` model_id ` (str): The model ID to convert.
329+
330+ ###### returns:
331+
332+ - The stub object for the model ID. (Any)
333+
303334#### ` get_concurrency_flag `
304335
305336Returns the value of the ` concurrency ` option from the ` self.options ` dict.
@@ -330,19 +361,6 @@ Sets the concurrency token and channel for the payment strategy.
330361
331362- _ None_
332363
333- #### ` get_path_to_pb_files `
334-
335- Returns the path to the directory containing the protobuf files for a given organization and service.
336-
337- ###### args:
338-
339- - ` org_id ` (str): The ID of the organization.
340- - ` service_id ` (str): The ID of the service.
341-
342- ###### returns:
343-
344- - The path to the directory containing the protobuf files. (str)
345-
346364#### ` get_services_and_messages_info `
347365
348366Retrieves information about services and messages defined in a protobuf file.
0 commit comments