src.uagents.registration
generate_backoff_time ↗ (opens in a new tab)
def generate_backoff_time(retry: int) -> float
Generate a backoff time starting from 0.128 seconds and limited to ~131 seconds
coerce_metadata_to_str ↗ (opens in a new tab)
def coerce_metadata_to_str( metadata: Optional[Dict[str, Any]] ) -> Optional[Dict[str, Union[str, Dict[str, str]]]]
Step through the metadata and convert any non-string values to strings.
extract_geo_metadata ↗ (opens in a new tab)
def extract_geo_metadata( metadata: Optional[Dict[str, Any]]) -> Optional[Dict[str, Any]]
Extract geo-location metadata from the metadata dictionary.
LedgerBasedRegistrationPolicy Objects ↗ (opens in a new tab)
class LedgerBasedRegistrationPolicy(AgentRegistrationPolicy)
check_contract_version ↗ (opens in a new tab)
def check_contract_version()
Check the version of the deployed Almanac contract and log a warning if it is different from the supported version.
register ↗ (opens in a new tab)
async def register(agent_address: str, protocols: List[str], endpoints: List[AgentEndpoint], metadata: Optional[Dict[str, Any]] = None)
Register the agent on the Almanac contract if registration is about to expire or the registration data has changed.