Skip to content

Commit

Permalink
feat(core): enable update registration policy after agent init (#561)
Browse files Browse the repository at this point in the history
  • Loading branch information
Archento authored Oct 18, 2024
1 parent f05f8b3 commit a6d0a85
Show file tree
Hide file tree
Showing 6 changed files with 1,270 additions and 1,068 deletions.
3 changes: 1 addition & 2 deletions python/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.0
files: ^python/
rev: v0.6.9
hooks:
- id: ruff
args: [--fix]
Expand Down
16 changes: 15 additions & 1 deletion python/docs/api/uagents/agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ An agent that interacts within a communication environment.
- `mailbox_client` _MailboxClient_ - The client for interacting with the agentverse mailbox.
- `protocols` _Dict[str, Protocol]_ - Dictionary mapping all supported protocol digests to their
corresponding protocols.
- `metadata` _Dict[str, Any]_ - Metadata associated with the agent.
- `metadata` _Optional[Dict[str, Any]]_ - Metadata associated with the agent.
<a id="src.uagents.agent.Agent.__init__"></a>
Expand Down Expand Up @@ -533,6 +533,20 @@ Update the queries attribute.
- `queries` - The queries attribute.
<a id="src.uagents.agent.Agent.update_registration_policy"></a>
#### update`_`registration`_`policy
```python
def update_registration_policy(policy: AgentRegistrationPolicy)
```
Update the registration policy.
**Arguments**:
- `policy` - The registration policy.
<a id="src.uagents.agent.Agent.register"></a>
#### register
Expand Down
26 changes: 26 additions & 0 deletions python/docs/api/uagents/registration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<a id="src.uagents.registration"></a>

# src.uagents.registration

<a id="src.uagents.registration.generate_backoff_time"></a>

#### generate`_`backoff`_`time

```python
def generate_backoff_time(retry: int) -> float
```

Generate a backoff time starting from 0.128 seconds and limited to ~131 seconds

<a id="src.uagents.registration.coerce_metadata_to_str"></a>

#### coerce`_`metadata`_`to`_`str

```python
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.

Loading

0 comments on commit a6d0a85

Please sign in to comment.