fetchai / uAgents

A fast and lightweight framework for creating decentralized agents with ease.
Apache License 2.0
995 stars 241 forks source link

Intermittent issues with @agent.on_rest_get and @agent.on_rest_post #544

Closed tanaygodse closed 1 month ago

tanaygodse commented 1 month ago

Prerequisites

Category

Bug (unexpected behavior)

Expected Behavior

The @agent.on_rest_get and @agent.on_rest_post decorators should function correctly for all agents.

Observed Behavior

The @agent.on_rest_get and @agent.on_rest_post decorators intermittently give an error that rest_on_get and rest_on_post method is not defined for agent. This was previously working for me on macOSX and then when we tried on Windows, this method was not working. However on the next day the functionality stopped working on macOSX as well, this was without making any changes, to the code and using the same virtual environment(venv) and no pip install or upgrade done between the two days.

To Reproduce

No response

Version

v0.15.2

Environment Details (Optional)

No response

Failure Logs (Optional)

No response

Additional Information (Optional)

No response

Archento commented 1 month ago

[...] give an error that rest_on_get and rest_on_post method is not defined for agent.

This is the answer to your question.

The agent REST interfaces have not been released yet which means that if you're using v0.15.2 the decorators are not defined for the agent object.

You'll need to either:

tanaygodse commented 1 month ago

Hey @Archento, the interfaces were working previously and then stopped working, why is that the case? They were available with the pip version of uagents.

jrriehl commented 1 month ago

Just to be sure, I downloaded the source from v0.15.2 on pypi (https://pypi.org/project/uagents/0.15.2/#files) and verified that there is no implementation of rest endpoints there. Is it possible that the issue resulted from installing via poetry from the main branch (tagged as v0.15.2), while perhaps doing a pip install uagents from pypi and having conflicting or corrupted python environments?