@@ -29,11 +29,91 @@ pnpm i
2929pnpm run dev
3030```
3131
32- Leveraging turborepo , this will start both frontend and backend.
32+ Leveraging TurboRepo , this will start both frontend and backend.
3333Your code will be running and syncing with Restack to execute agents.
3434
3535## Run agents
3636
37- ### from frontend
37+ ### From frontend
3838
39- ![ Run agents from frontend] ( ./agent-reactflow.png )
39+ ![ Run agents from frontend] ( ./agent-reactflow.png )
40+
41+ ### from UI
42+
43+ You can run agents from the UI by clicking the "Run" button.
44+
45+ ![ Run agents from UI] ( ./agent-post.png )
46+
47+ ### from API
48+
49+ You can run agents from the API by using the generated endpoint:
50+
51+ ` POST http://localhost:6233/api/agents/agentFlow `
52+
53+ ### from any client
54+
55+ You can run agents with any client connected to Restack, for example:
56+
57+ ``` bash
58+ pnpm schedule-agent
59+ ```
60+
61+ executes ` scheduleAgent.ts ` which will connect to Restack and execute the ` agentFlow ` agent.
62+
63+ ## Send events to the Agent
64+
65+ ### from Backend Developer UI
66+
67+ You can send events like or end from the UI.
68+
69+ ![ Send events from UI] ( ./agent-event.png )
70+
71+ And see the events in the run:
72+
73+ ![ See events in UI] ( ./agent-run.png )
74+
75+ ### from API
76+
77+ You can send events to the agent by using the following endpoint:
78+
79+ ` PUT http://localhost:6233/api/agents/agentFlow/:agentId/:runId `
80+
81+ with the payload:
82+
83+ ``` json
84+ {
85+ "name" : " idVerification" ,
86+ "input" : {
87+ "type" : " id" ,
88+ "documentNumber" : " 1234567890"
89+ }
90+ }
91+ ```
92+
93+ to send messages to the agent.
94+
95+ or
96+
97+ ``` json
98+ {
99+ "eventName" : " end"
100+ }
101+ ```
102+
103+ to end the conversation with the agent.
104+
105+ ### from any client
106+
107+ You can send event to the agent with any client connected to Restack, for example:
108+
109+ Modify agentId and runId in eventAgent.ts and then run:
110+
111+ ``` bash
112+ pnpm event-agent
113+ ```
114+
115+ It will connect to Restack and send an events to the agent.
116+
117+ ## Deploy on Restack Cloud
118+
119+ To deploy the application on Restack, you can create an account at [ https://console.restack.io ] ( https://console.restack.io )
0 commit comments