You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/README.md
+59-59Lines changed: 59 additions & 59 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ ACP offers an API to search for the agents served by the ACP server.
18
18
Once a client has an agent identifier `AgentID`, it can use it to either retrieve the agent descriptor or to control agent runs.
19
19
20
20
#### Retrieve all agents supported by the server
21
-
In this case the client is doing a search of all agents in the server without specifying any search filter. Results is a list of agents.
21
+
In this case, the client is doing a search of all agents in the server without specifying any search filter. Result is the list of all agents.
22
22
23
23
```mermaid
24
24
sequenceDiagram
@@ -29,7 +29,7 @@ sequenceDiagram
29
29
```
30
30
31
31
#### Retrieve an agent from its name and version
32
-
In this case the client knows name and version of an agent (e.g. learnt from the record in the Agent Directory) and wants to retrieve its `id` to interact with the agent.
32
+
In this case, the client knows name and version of an agent (e.g. learnt from the record in the Agent Directory) and wants to retrieve its `id` to interact with the agent.
33
33
34
34
```mermaid
35
35
sequenceDiagram
@@ -40,7 +40,7 @@ sequenceDiagram
40
40
```
41
41
42
42
#### Retrieve agent descriptor from its identifier
43
-
In this case the client knows the agent id and wants to retrieve its descriptor to learn about the capabilities supported and the data schemas to use.
43
+
In this case, the client knows the agent id and wants to retrieve its descriptor to learn about the capabilities supported and the data schemas to use.
44
44
45
45
```mermaid
46
46
sequenceDiagram
@@ -71,13 +71,13 @@ sequenceDiagram
71
71
```
72
72
In the sequence above:
73
73
1. The client requests to start a run on a specific agent, providing its `agent_id`, and specifying:
74
-
* Configuration: a run configuration is flavoring the behavior of this agent for this run
75
-
* Input: run input provides the data the agent will operate on
76
-
* Metadata: metadata is a free format object that can be used by the client to tag the run with arbitrary information
77
-
1. The server returns a run object which include the run identifier and a status, which at the beginning will be `pending`.
78
-
1. The client retrieves the status of the run until completion
79
-
1. The server returns the run object with the updated status
80
-
1. The client request the output of the run
74
+
* Configuration: a run configuration is flavoring the behavior of this agent for this run.
75
+
* Input: run input provides the data the agent will operate on.
76
+
* Metadata: metadata is a free format object that can be used by the client to tag the run with arbitrary information.
77
+
1. The server returns a run object which includes the run identifier and a status, the status at the beginning will be `pending`.
78
+
1. The client retrieves the status of the run until completion.
79
+
1. The server returns the run object with the updated status.
80
+
1. The client request the output of the run.
81
81
1. The server returns the final result of the run.
82
82
83
83
>
@@ -98,10 +98,10 @@ sequenceDiagram
98
98
```
99
99
100
100
In the sequence above:
101
-
1. The client requests to start a run on a specific agent
102
-
1. The server returns a run object
103
-
1. The client request the output of the run providing addition`block_timeout` parameter, and blocs until run status changes or timeout expires.
104
-
1. The server returns the final result of the run. Note that in case the timeout expired before, the server would have returned no content.
101
+
1. The client requests to start a run on a specific agent.
102
+
1. The server returns a run object.
103
+
1. The client request the output of the run providing additional`block_timeout` parameter, and blocks until run status changes or timeout expires.
104
+
1. The server returns the final result of the run. Note that in case the timeout had expired before, the server would have returned no content.
105
105
106
106
#### Start a Run of an Agent with a callback
107
107
Agents can support callbacks, i.e. asynchronously call back the client upon run status change. The support for interrupts is signaled in the agent descriptor.
@@ -119,16 +119,16 @@ sequenceDiagram
119
119
S->>-C: RunOutput={type="result", result}
120
120
```
121
121
In the sequence above:
122
-
1. The client requests to start a run on a specific agent, providing an additional `callback`
123
-
1. The server returns a run object
122
+
1. The client requests to start a run on a specific agent, providing an additional `callback`.
123
+
1. The server returns a run object.
124
124
1. Upon status change, the server calls the provided call back with the run object.
125
-
1. The client request the output of the run
125
+
1. The client request the output of the run.
126
126
1. The server return the final result of the run.
127
127
128
128
### Run Interrupt and Resume
129
129
Agent can support interrupts, i.e. the run execution can interrupt to request additional input to the client. The support for interrupts is signaled in the agent ACP descriptor.
130
130
131
-
When an interrupt occurs, the server provides the client with an interrupt payload, which specifies the interrupt type that have occurred and all the information associated with that interrupt, i.e. a request for additional input.
131
+
When an interrupt occurs, the server provides the client with an interrupt payload, which specifies the interrupt type that has occurred and all the information associated with that interrupt, i.e. a request for additional input.
132
132
133
133
The client can collect the needed input for the specific interrupt and resume the run by providing the resume payload, i.e. the additional input requested by the interrupt.
134
134
@@ -140,7 +140,7 @@ The interrupt is provided by the server when the client requests the output.
140
140
141
141
#### Start a run and resume it upon interruption
142
142
143
-
In this case, the client asks for the agent output and receives and interrupt instead of the final output. The client then resumes the run providing the needed input and finally when run is completed, gets the result.
143
+
In this case, the client asks for the agent output and receives an interrupt instead of the final output. The client then resumes the run providing the needed input and finally when the run is completed, gets the result.
144
144
145
145
```mermaid
146
146
sequenceDiagram
@@ -157,12 +157,12 @@ sequenceDiagram
157
157
S->>-C: RunOutput={type="result", result}
158
158
```
159
159
In the sequence above:
160
-
1. The client start the run
161
-
1. The server returns the run object
162
-
1. The client requests the output
163
-
1. The server returns an interrupt, specifying interrupt type and the associated payload
164
-
1. The client resumes the run providing the needed input in the resume payload
165
-
1. the client requests the output
160
+
1. The client start the run.
161
+
1. The server returns the run object.
162
+
1. The client requests the output.
163
+
1. The server returns an interrupt, specifying interrupt type and the associated payload.
164
+
1. The client resumes the run providing the needed input in the resume payload.
165
+
1. the client requests the output.
166
166
1. The server returns the final result.
167
167
168
168
### Thread Runs
@@ -172,14 +172,14 @@ When an agent supports thread run, each run is associated to a thread, and at th
172
172
173
173
Subsequent runs on the same thread use the previously created state, together with the run input provided.
174
174
175
-
The server offers ways to retrieve the current thread state and the history of the runs on a thread and the evolution of the thread states over execution of runs.
175
+
The server offers ways to retrieve the current thread state, the history of the runs on a thread, and the evolution of the thread states over execution of runs.
176
176
177
177
>
178
178
> Note that the format of the thread state is not specified by ACP, but it is (optionally) defined in the agent ACP descriptor. If specified, it can be retrieved by the client, if not it's not accessible to the client.
179
179
>
180
180
181
181
#### Start of multiple runs over the same thread
182
-
In this case the client starts a sequence of runs on the same threads accumulating a state in the server. In this specific example the input is a chat message, while the state kept in the server is the chat history.
182
+
In this case the client starts a sequence of runs on the same thread accumulating a state in the server. In this specific example the input is a chat message, while the state kept in the server is the chat history.
183
183
184
184
```mermaid
185
185
sequenceDiagram
@@ -203,18 +203,18 @@ sequenceDiagram
203
203
S->>-C: ThreadState=[<br/>"Hello, my name is John?",<br/>"Hello John, how can I help?"<br/>"Can you remind my name?",<br/>"Yes, your name is John"<br/>]
204
204
```
205
205
In the sequence above:
206
-
1. The client starts the first run and provides the first message of the chat
207
-
1. The server return the run object which **includes a thread ID** because the server supports threaded runs
208
-
1. The client requests the run output
206
+
1. The client starts the first run and provides the first message of the chat.
207
+
1. The server returns the run object which **includes a thread ID** because the server supports thread runs.
208
+
1. The client requests the run output.
209
209
1. The server returns the run output which is the next chat message from the agent and leaves a state with the current chat history.
210
210
1. The client starts a new run providing:
211
-
* The same thread ID, which means that the run will use the existing state associated with the thread
212
-
* The input for the run, i.e. the next message in the chat (assuming the existence of the server of the chat history)
213
-
1. The server start the runs using the existing chat history and returns the run object
214
-
1. The client requests the run output
215
-
1. The server update the thread state and returns the run output
216
-
1. Finally, the client requests the thread state (this is an optional operation)
217
-
1. The server returns the current thread state which collect the whole chat history
211
+
* The same thread ID, which means that the run will use the existing state associated with the thread.
212
+
* The input for the run, i.e. the next message in the chat (assuming the existence of the chat history on the server).
213
+
1. The server starts the runs using the existing chat history and returns the run object.
214
+
1. The client requests the run output.
215
+
1. The server updates the thread state and returns the run output.
216
+
1. Finally, the client requests the thread state (this is an optional operation).
217
+
1. The server returns the current thread state which collects the whole chat history.
218
218
219
219
### Output Streaming
220
220
ACP supports output streaming. Agent can stream intermediate results of a Run to provide better response time and user experience.
S->>C: StreamEvent={id="2", event="agent_event", data={run_id, type="result", result={"message": "Hello, how can"}}}
243
243
S->>C: StreamEvent={id="3", event="agent_event", data={run_id, type="result", result={"message": "Hello, how can I help"}}}
244
-
S->>C: StreamEvent={id="4",, event="agent_event", data={run_id, type="result", result={"message": "Hello, how can I help you"}}}
245
-
S->>C: StreamEvent={id="5",, event="agent_event", data={run_id, type="result", result={"message": "Hello, how can I help you today"}}}
244
+
S->>C: StreamEvent={id="4", event="agent_event", data={run_id, type="result", result={"message": "Hello, how can I help you"}}}
245
+
S->>C: StreamEvent={id="5", event="agent_event", data={run_id, type="result", result={"message": "Hello, how can I help you today"}}}
246
246
S->>C: Close Connection
247
247
end
248
248
```
249
249
250
250
In the sequence above:
251
-
1. The client requests to start a run on a specific agent specifying streaming mode = 'result'
252
-
1. The server returns a run object
253
-
1. The client request the output streaming and keeps the connection open
254
-
1. The server returns an event with message="Hello"
255
-
1. The server returns an event with updated message "Hello, how"
256
-
1. The server returns an event with updated message "Hello, how can"
257
-
1. The server returns an event with updated message "Hello, how can I help"
258
-
1. The server returns an event with updated message "Hello, how can I help you"
259
-
1. The server returns an event with updated message "Hello, how can I help you today"
260
-
1. The server closes the conenction because the output is complete
251
+
1. The client requests to start a run on a specific agent specifying streaming mode = 'result'.
252
+
1. The server returns a run object.
253
+
1. The client requests the output streaming and keeps the connection open.
254
+
1. The server returns an event with message="Hello".
255
+
1. The server returns an event with updated message "Hello, how".
256
+
1. The server returns an event with updated message "Hello, how can".
257
+
1. The server returns an event with updated message "Hello, how can I help".
258
+
1. The server returns an event with updated message "Hello, how can I help you".
259
+
1. The server returns an event with updated message "Hello, how can I help you today".
260
+
1. The server closes the connection because the output is complete.
261
261
262
262
## Agent ACP descriptor
263
263
264
264
Agent ACP Descriptor is a descriptor that contains all the needed information to know how:
265
-
* Identify an agent
266
-
* Know its capabilities
267
-
* Consume its capabilities
265
+
* Identify an agent.
266
+
* Know its capabilities.
267
+
* Consume its capabilities.
268
268
269
269
The Agent ACP Descriptor can be obtained from the Agent Directory or can be obtained through an [ACP call](#retrieve-agent-descriptor-from-its-identifier).
270
270
@@ -312,11 +312,11 @@ Agent Specs section includes ACP invocation capabilities and the schema definiti
312
312
The ACP capabilities that the agent support, e.g. `streaming`, `callbacks`, `interrupts` etc.
313
313
314
314
The schemas of all the objects that this agent supports for:
315
-
* Agent Configuration
316
-
* Run Input
317
-
* Run Output
318
-
* Interrupt and Resume Payloads
319
-
* Thread State
315
+
* Agent Configuration.
316
+
* Run Input.
317
+
* Run Output.
318
+
* Interrupt and Resume Payloads.
319
+
* Thread State.
320
320
321
321
Note that these schemas are needed in the agent ACP descriptor, since they are agent specific and are not defined by ACP, i.e. ACP defines a generic JSON object for the data structures listed above.
322
322
@@ -439,8 +439,8 @@ Note that these schemas are needed in the agent ACP descriptor, since they are a
439
439
The agent supports threads, interrupts, and callback.
440
440
441
441
It declares schemas for input, output, and config:
442
-
* As input, it expects the next message of the chat from the user
443
-
* As output, it produces the next message of the chat from the agent
442
+
* As input, it expects the next message of the chat from the user.
443
+
* As output, it produces the next message of the chat from the agent.
444
444
* As config it expects the style of the email to be written.
445
445
446
446
It supports one kind of interrupt, which is used to ask user for approval before sending the email. It provides subject, body, and recipients of the email as interrupt payload and expects approval as input to resume.
0 commit comments