[docs]defget_service_action_metadata(service_method:Callable)->ServiceActionMetadata:""" Retrieve metadata for arbitrary service's method. For instance which endpoint is being used. Example:: from genai import Credentials, Client from genai.utils import get_service_action_metadata credentials = Credentials.from_env() client = Client(credentials=credentials) metadata = get_service_action_metadata(client.text.tokenization.create) """metadata=getattr(service_method,_METADATA_KEY,None)ifnotisinstance(metadata,ServiceActionMetadata):raiseValueError("Provided callable does not have any metadata.")returnmetadata