Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,12 +5,6 @@ from components.mongodbconnection import provideClient
|
|
| 5 |
from components.agentcreation import VelocityPayableAgent
|
| 6 |
|
| 7 |
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
app=FastAPI()
|
| 15 |
client=provideClient()
|
| 16 |
db=client["agentpaymentdb"]
|
|
@@ -24,8 +18,8 @@ class Agent(BaseModel):
|
|
| 24 |
agent_id:str
|
| 25 |
|
| 26 |
|
|
|
|
| 27 |
class Payment(BaseModel):
|
| 28 |
-
agent_id:str
|
| 29 |
instruction:str
|
| 30 |
|
| 31 |
|
|
@@ -51,11 +45,11 @@ def load_keypair(agent):
|
|
| 51 |
|
| 52 |
|
| 53 |
@app.post("/init_agent")
|
| 54 |
-
def
|
| 55 |
|
| 56 |
try:
|
| 57 |
velocitypayableinstance=VelocityPayableAgent()
|
| 58 |
-
velocitypayableinstance.Agentinit()
|
| 59 |
return True
|
| 60 |
except Exception as e:
|
| 61 |
return False
|
|
|
|
| 5 |
from components.agentcreation import VelocityPayableAgent
|
| 6 |
|
| 7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
app=FastAPI()
|
| 9 |
client=provideClient()
|
| 10 |
db=client["agentpaymentdb"]
|
|
|
|
| 18 |
agent_id:str
|
| 19 |
|
| 20 |
|
| 21 |
+
|
| 22 |
class Payment(BaseModel):
|
|
|
|
| 23 |
instruction:str
|
| 24 |
|
| 25 |
|
|
|
|
| 45 |
|
| 46 |
|
| 47 |
@app.post("/init_agent")
|
| 48 |
+
def AgentI(request:Agent):
|
| 49 |
|
| 50 |
try:
|
| 51 |
velocitypayableinstance=VelocityPayableAgent()
|
| 52 |
+
velocitypayableinstance.Agentinit(request.agent_id)
|
| 53 |
return True
|
| 54 |
except Exception as e:
|
| 55 |
return False
|