MorpheusAIs / moragents

Morpheus Local Agents
MIT License
8 stars 7 forks source link

feat: send agent w/autotx #28

Open cbrzn opened 2 weeks ago

cbrzn commented 2 weeks ago

This PR aims to add the agent with the send functionality using AutoTx

LachsBagel commented 1 week ago

@cbrzn thanks

@cliffordattractor will leave his comments with regards to integration.

cliffordattractor commented 1 week ago

Hi @cbrzn - thanks for the PR.

It looks like this agent signs the swap tx on the back-end rather than passing it to the front end to be signed by the user's wallet in the browser. Please can you confirm whether this is the case?

cbrzn commented 1 week ago

Hi @cbrzn - thanks for the PR.

It looks like this agent signs the swap tx on the back-end rather than passing it to the front end to be signed by the user's wallet in the browser. Please can you confirm whether this is the case?

hey @cliffordattractor that's not the case, the agents create the transaction object and then returns it so it can be passed to any signer. I updated the code to show how to get the transaction details.

I think these transaction objects should be added to the context list which is then passed to the frontend, but not sure - Happy to collaborate with you for front end integration so please let us know any questions or needs you may have :smile:

cliffordattractor commented 5 days ago

Hi @cbrzn,

Thanks for clarifying. In order for us to be able to integrate it we need it to be working end-to-end, so the full user journey should include signing the transaction in the front-end and then the agent providing some feedback regarding the status of the transaction.

I am currently thinking about how we can make it easier for new agents to integrate with the front-end so I'd be happy to collab with you on that. As a starting point please check out how the swap agent currently works

I'd welcome your feedback on the following ideas. I make these suggestions because I think they will make your job easier to integrate an agent with the front-end, so please let me know if you prefer some alternative.

  1. The chat endpoint should use websockets.

  2. The chat endpoint could return a transaction as well as chat messages, e.g. {'role':'assistant', 'content': '', 'tx':{...}}

  3. The front-end should call tx_status as defined in the swap_agent README, but also include the transaction_id, so that the back-end knows whether the transaction was initiated or cancelled by the user and can monitor it then send appropriate messages back to the user via the chat websockets API.

Hope that makes sense, happy to jump on a call to discuss.

dOrgJelli commented 4 days ago

Hey @cliffordattractor, thanks for the feedback! Unfortunately we aren't able to dedicate dev time to integrate with the front-end, and when I last talked to Rakshak we were under the impression that this would be done by yourself or someone else working on the app.

I think that you should have everything you need to move forward on getting the transactions generated by autotx and sending those back to the front-end. Please let us know if you have any questions, and also happy to collab on making the front-end integration easy for other agents to use.