Invokes an endpoint to execute a specific operation using the Rapida API.
Parameters
Configuration for the client connection.
endpoint
EndpointDefinition
required
Unique identifier of the endpoint to invoke.
args
Map<string, google_protobuf_any_pb.Any>
Arguments passed to the endpoint as a key-value map.
options
Map<string, google_protobuf_any_pb.Any>
Request options for runtime behavior and configuration.
metadata
Map<string, google_protobuf_any_pb.Any>
Metadata associated with the request for tracking and analytics.
Usage
from rapida import (
ConnectionConfig,
EndpointDefinition,
InvokeRequest,
invoke,
string_to_any,
)
from pprint import pprint
connection_config = ConnectionConfig.default_connection_config(
ConnectionConfig.with_sdk("{your-rapida-api-key}")
)
argument_value = string_to_any("Hello how are you doing")
metadata_value = string_to_any("metadata_to_track")
option_value = string_to_any("4567898656789")
response = invoke(
client_cfg=connection_config,
request=InvokeRequest(
endpoint=EndpointDefinition(endpointId=2223006263292198912),
args={"can": argument_value},
metadata={"test": metadata_value},
options={"opts1": option_value},
),
)
pprint(response)
Response
Numeric status code for the operation.
Indicates whether the operation was successful.
Stable, machine-readable numeric code for the error.
Developer-oriented error message for debugging.
End-user-friendly error message.
Type of the content (e.g., audio, image, video, text).
Format of the content (e.g., raw string, URL).
Unique ID for tracking the request.
Duration of the operation in milliseconds.
Description of the metric.