agent-protocol
2050 строк · 77.6 Кб
1{
2"openapi": "3.0.1",
3"info": {
4"title": "Agent Protocol",
5"description": "Specification of the API protocol for communication with an agent.",
6"version": "v1"
7},
8"servers": [
9{
10"url": "http://0.0.0.0:8000",
11"description": "Agent Protocol API"
12}
13],
14"paths": {
15"/ap/v1/agent/tasks": {
16"post": {
17"operationId": "createAgentTask",
18"summary": "Creates a task for the agent.",
19"requestBody": {
20"content": {
21"application/json": {
22"schema": {
23"description": "Body of the task request.",
24"type": "object",
25"properties": {
26"input": {
27"description": "Input prompt for the task.",
28"type": "string",
29"example": "Write 'Washington' to the file 'output.txt'.",
30"nullable": true
31},
32"additional_input": {
33"description": "Input parameters for the task. Any value is allowed.",
34"type": "object",
35"example": "{\n\"debug\": false,\n\"mode\": \"benchmarks\"\n}"
36}
37}
38}
39}
40}
41},
42"responses": {
43"200": {
44"description": "A new agent task was successfully created.",
45"content": {
46"application/json": {
47"schema": {
48"allOf": [
49{
50"description": "Body of the task request.",
51"type": "object",
52"properties": {
53"input": {
54"description": "Input prompt for the task.",
55"type": "string",
56"example": "Write 'Washington' to the file 'output.txt'.",
57"nullable": true
58},
59"additional_input": {
60"description": "Input parameters for the task. Any value is allowed.",
61"type": "object",
62"example": "{\n\"debug\": false,\n\"mode\": \"benchmarks\"\n}"
63}
64}
65},
66{
67"type": "object",
68"description": "Definition of an agent task.",
69"required": ["task_id", "artifacts"],
70"properties": {
71"task_id": {
72"description": "The ID of the task.",
73"type": "string",
74"example": "50da533e-3904-4401-8a07-c49adf88b5eb"
75},
76"artifacts": {
77"description": "A list of artifacts that the task has produced.",
78"type": "array",
79"items": {
80"description": "An Artifact either created by or submitted to the agent.",
81"type": "object",
82"properties": {
83"artifact_id": {
84"description": "ID of the artifact.",
85"type": "string",
86"example": "b225e278-8b4c-4f99-a696-8facf19f0e56"
87},
88"agent_created": {
89"description": "Whether the artifact has been created by the agent.",
90"type": "boolean",
91"example": false
92},
93"file_name": {
94"description": "Filename of the artifact.",
95"type": "string",
96"example": "main.py"
97},
98"relative_path": {
99"description": "Relative path of the artifact in the agent's workspace.",
100"type": "string",
101"example": "python/code/",
102"nullable": true
103}
104},
105"required": [
106"artifact_id",
107"agent_created",
108"file_name"
109]
110},
111"example": [
112"7a49f31c-f9c6-4346-a22c-e32bc5af4d8e",
113"ab7b4091-2560-4692-a4fe-d831ea3ca7d6"
114],
115"default": []
116}
117}
118}
119]
120}
121}
122},
123"x-postman-variables": [
124{
125"type": "save",
126"name": "task_id",
127"path": ".task_id"
128}
129]
130},
131"422": {
132"description": "Unable to process request. Likely due to improperly formatted request.",
133"content": {
134"application/json": {
135"schema": {
136"description": "A generic JSON object without any specific requirements.",
137"type": "object"
138}
139}
140}
141},
142"default": {
143"description": "Internal Server Error"
144}
145},
146"tags": ["agent"]
147},
148"get": {
149"operationId": "listAgentTasks",
150"summary": "List all tasks that have been created for the agent.",
151"parameters": [
152{
153"name": "current_page",
154"in": "query",
155"description": "Page number",
156"required": false,
157"schema": {
158"type": "integer",
159"format": "int32",
160"default": 1,
161"minimum": 1
162},
163"example": 2
164},
165{
166"name": "page_size",
167"in": "query",
168"description": "Number of items per page",
169"required": false,
170"schema": {
171"type": "integer",
172"format": "int32",
173"default": 10,
174"minimum": 1
175},
176"example": 25
177}
178],
179"responses": {
180"200": {
181"description": "Returned list of agent's tasks.",
182"content": {
183"application/json": {
184"schema": {
185"type": "object",
186"properties": {
187"tasks": {
188"type": "array",
189"items": {
190"allOf": [
191{
192"description": "Body of the task request.",
193"type": "object",
194"properties": {
195"input": {
196"description": "Input prompt for the task.",
197"type": "string",
198"example": "Write 'Washington' to the file 'output.txt'.",
199"nullable": true
200},
201"additional_input": {
202"description": "Input parameters for the task. Any value is allowed.",
203"type": "object",
204"example": "{\n\"debug\": false,\n\"mode\": \"benchmarks\"\n}"
205}
206}
207},
208{
209"type": "object",
210"description": "Definition of an agent task.",
211"required": ["task_id", "artifacts"],
212"properties": {
213"task_id": {
214"description": "The ID of the task.",
215"type": "string",
216"example": "50da533e-3904-4401-8a07-c49adf88b5eb"
217},
218"artifacts": {
219"description": "A list of artifacts that the task has produced.",
220"type": "array",
221"items": {
222"description": "An Artifact either created by or submitted to the agent.",
223"type": "object",
224"properties": {
225"artifact_id": {
226"description": "ID of the artifact.",
227"type": "string",
228"example": "b225e278-8b4c-4f99-a696-8facf19f0e56"
229},
230"agent_created": {
231"description": "Whether the artifact has been created by the agent.",
232"type": "boolean",
233"example": false
234},
235"file_name": {
236"description": "Filename of the artifact.",
237"type": "string",
238"example": "main.py"
239},
240"relative_path": {
241"description": "Relative path of the artifact in the agent's workspace.",
242"type": "string",
243"example": "python/code/",
244"nullable": true
245}
246},
247"required": [
248"artifact_id",
249"agent_created",
250"file_name"
251]
252},
253"example": [
254"7a49f31c-f9c6-4346-a22c-e32bc5af4d8e",
255"ab7b4091-2560-4692-a4fe-d831ea3ca7d6"
256],
257"default": []
258}
259}
260}
261]
262}
263},
264"pagination": {
265"type": "object",
266"properties": {
267"total_items": {
268"description": "Total number of items.",
269"type": "integer",
270"example": 42
271},
272"total_pages": {
273"description": "Total number of pages.",
274"type": "integer",
275"example": 97
276},
277"current_page": {
278"description": "Current_page page number.",
279"type": "integer",
280"example": 1
281},
282"page_size": {
283"description": "Number of items per page.",
284"type": "integer",
285"example": 25
286}
287},
288"required": [
289"total_items",
290"total_pages",
291"current_page",
292"page_size"
293]
294}
295},
296"required": ["tasks", "pagination"]
297}
298}
299}
300},
301"default": {
302"description": "Internal Server Error"
303}
304},
305"tags": ["agent"]
306}
307},
308"/ap/v1/agent/tasks/{task_id}": {
309"get": {
310"operationId": "getAgentTask",
311"summary": "Get details about a specified agent task.",
312"parameters": [
313{
314"name": "task_id",
315"in": "path",
316"description": "ID of the task",
317"required": true,
318"schema": {
319"type": "string"
320},
321"example": "1d5a533e-3904-4401-8a07-c49adf88b981",
322"x-postman-variables": [
323{
324"type": "load",
325"name": "task_id"
326}
327]
328}
329],
330"responses": {
331"200": {
332"description": "Returned details about an agent task.",
333"content": {
334"application/json": {
335"schema": {
336"allOf": [
337{
338"description": "Body of the task request.",
339"type": "object",
340"properties": {
341"input": {
342"description": "Input prompt for the task.",
343"type": "string",
344"example": "Write 'Washington' to the file 'output.txt'.",
345"nullable": true
346},
347"additional_input": {
348"description": "Input parameters for the task. Any value is allowed.",
349"type": "object",
350"example": "{\n\"debug\": false,\n\"mode\": \"benchmarks\"\n}"
351}
352}
353},
354{
355"type": "object",
356"description": "Definition of an agent task.",
357"required": ["task_id", "artifacts"],
358"properties": {
359"task_id": {
360"description": "The ID of the task.",
361"type": "string",
362"example": "50da533e-3904-4401-8a07-c49adf88b5eb"
363},
364"artifacts": {
365"description": "A list of artifacts that the task has produced.",
366"type": "array",
367"items": {
368"description": "An Artifact either created by or submitted to the agent.",
369"type": "object",
370"properties": {
371"artifact_id": {
372"description": "ID of the artifact.",
373"type": "string",
374"example": "b225e278-8b4c-4f99-a696-8facf19f0e56"
375},
376"agent_created": {
377"description": "Whether the artifact has been created by the agent.",
378"type": "boolean",
379"example": false
380},
381"file_name": {
382"description": "Filename of the artifact.",
383"type": "string",
384"example": "main.py"
385},
386"relative_path": {
387"description": "Relative path of the artifact in the agent's workspace.",
388"type": "string",
389"example": "python/code/",
390"nullable": true
391}
392},
393"required": [
394"artifact_id",
395"agent_created",
396"file_name"
397]
398},
399"example": [
400"7a49f31c-f9c6-4346-a22c-e32bc5af4d8e",
401"ab7b4091-2560-4692-a4fe-d831ea3ca7d6"
402],
403"default": []
404}
405}
406}
407]
408}
409}
410}
411},
412"404": {
413"description": "Unable to find entity with a given identifier",
414"content": {
415"application/json": {
416"schema": {
417"type": "object",
418"properties": {
419"message": {
420"description": "Message stating the entity was not found",
421"type": "string",
422"example": "Unable to find entity with the provided id"
423}
424},
425"required": ["message"]
426}
427}
428}
429},
430"default": {
431"description": "Internal Server Error"
432}
433},
434"tags": ["agent"]
435}
436},
437"/ap/v1/agent/tasks/{task_id}/steps": {
438"get": {
439"operationId": "listAgentTaskSteps",
440"summary": "List all steps for the specified task.",
441"parameters": [
442{
443"name": "task_id",
444"in": "path",
445"description": "ID of the task.",
446"required": true,
447"schema": {
448"type": "string"
449},
450"example": "50da533e-3904-4401-8a07-c49adf88b5eb",
451"x-postman-variables": [
452{
453"type": "load",
454"name": "task_id"
455}
456]
457},
458{
459"name": "current_page",
460"in": "query",
461"description": "Page number",
462"required": false,
463"schema": {
464"type": "integer",
465"format": "int32",
466"default": 1,
467"minimum": 1
468},
469"example": 2
470},
471{
472"name": "page_size",
473"in": "query",
474"description": "Number of items per page",
475"required": false,
476"schema": {
477"type": "integer",
478"format": "int32",
479"default": 10,
480"minimum": 1
481},
482"example": 25
483}
484],
485"responses": {
486"200": {
487"description": "Returned list of agent's steps for the specified task.",
488"content": {
489"application/json": {
490"schema": {
491"type": "object",
492"properties": {
493"steps": {
494"type": "array",
495"items": {
496"allOf": [
497{
498"description": "Body of the task request.",
499"type": "object",
500"properties": {
501"input": {
502"description": "Input prompt for the step.",
503"type": "string",
504"example": "Write the words you receive to the file 'output.txt'.",
505"nullable": true
506},
507"additional_input": {
508"description": "Input parameters for the task step. Any value is allowed.",
509"type": "object",
510"example": "{\n\"file_to_refactor\": \"models.py\"\n}"
511}
512}
513},
514{
515"type": "object",
516"required": [
517"step_id",
518"task_id",
519"status",
520"is_last",
521"artifacts"
522],
523"properties": {
524"task_id": {
525"description": "The ID of the task this step belongs to.",
526"type": "string",
527"example": "50da533e-3904-4401-8a07-c49adf88b5eb"
528},
529"step_id": {
530"description": "The ID of the task step.",
531"type": "string",
532"example": "6bb1801a-fd80-45e8-899a-4dd723cc602e"
533},
534"name": {
535"description": "The name of the task step.",
536"type": "string",
537"example": "Write to file",
538"nullable": true
539},
540"status": {
541"description": "The status of the task step.",
542"type": "string",
543"example": "created",
544"enum": ["created", "running", "completed"]
545},
546"output": {
547"description": "Output of the task step.",
548"type": "string",
549"example": "I am going to use the write_to_file command and write Washington to a file called output.txt <write_to_file('output.txt', 'Washington')",
550"nullable": true
551},
552"additional_output": {
553"description": "Output that the task step has produced. Any value is allowed.",
554"type": "object",
555"example": "{\n\"tokens\": 7894,\n\"estimated_cost\": \"0,24$\"\n}",
556"nullable": true
557},
558"artifacts": {
559"description": "A list of artifacts that the step has produced.",
560"type": "array",
561"items": {
562"description": "An Artifact either created by or submitted to the agent.",
563"type": "object",
564"properties": {
565"artifact_id": {
566"description": "ID of the artifact.",
567"type": "string",
568"example": "b225e278-8b4c-4f99-a696-8facf19f0e56"
569},
570"agent_created": {
571"description": "Whether the artifact has been created by the agent.",
572"type": "boolean",
573"example": false
574},
575"file_name": {
576"description": "Filename of the artifact.",
577"type": "string",
578"example": "main.py"
579},
580"relative_path": {
581"description": "Relative path of the artifact in the agent's workspace.",
582"type": "string",
583"example": "python/code/",
584"nullable": true
585}
586},
587"required": [
588"artifact_id",
589"agent_created",
590"file_name"
591]
592},
593"default": []
594},
595"is_last": {
596"description": "Whether this is the last step in the task.",
597"type": "boolean",
598"example": true,
599"default": false
600}
601}
602}
603]
604}
605},
606"pagination": {
607"type": "object",
608"properties": {
609"total_items": {
610"description": "Total number of items.",
611"type": "integer",
612"example": 42
613},
614"total_pages": {
615"description": "Total number of pages.",
616"type": "integer",
617"example": 97
618},
619"current_page": {
620"description": "Current_page page number.",
621"type": "integer",
622"example": 1
623},
624"page_size": {
625"description": "Number of items per page.",
626"type": "integer",
627"example": 25
628}
629},
630"required": [
631"total_items",
632"total_pages",
633"current_page",
634"page_size"
635]
636}
637},
638"required": ["steps", "pagination"]
639}
640}
641}
642},
643"404": {
644"description": "Unable to find entity with a given identifier",
645"content": {
646"application/json": {
647"schema": {
648"type": "object",
649"properties": {
650"message": {
651"description": "Message stating the entity was not found",
652"type": "string",
653"example": "Unable to find entity with the provided id"
654}
655},
656"required": ["message"]
657}
658}
659}
660},
661"default": {
662"description": "Internal Server Error"
663}
664},
665"tags": ["agent"]
666},
667"post": {
668"operationId": "executeAgentTaskStep",
669"summary": "Execute a step in the specified agent task.",
670"parameters": [
671{
672"name": "task_id",
673"in": "path",
674"description": "ID of the task",
675"required": true,
676"schema": {
677"type": "string"
678},
679"example": "50da533e-3904-4401-8a07-c49adf88b5eb",
680"x-postman-variables": [
681{
682"type": "load",
683"name": "task_id"
684}
685]
686}
687],
688"requestBody": {
689"content": {
690"application/json": {
691"schema": {
692"description": "Body of the task request.",
693"type": "object",
694"properties": {
695"input": {
696"description": "Input prompt for the step.",
697"type": "string",
698"example": "Write the words you receive to the file 'output.txt'.",
699"nullable": true
700},
701"additional_input": {
702"description": "Input parameters for the task step. Any value is allowed.",
703"type": "object",
704"example": "{\n\"file_to_refactor\": \"models.py\"\n}"
705}
706}
707}
708}
709}
710},
711"responses": {
712"200": {
713"description": "Executed step for the agent task.",
714"content": {
715"application/json": {
716"schema": {
717"allOf": [
718{
719"description": "Body of the task request.",
720"type": "object",
721"properties": {
722"input": {
723"description": "Input prompt for the step.",
724"type": "string",
725"example": "Write the words you receive to the file 'output.txt'.",
726"nullable": true
727},
728"additional_input": {
729"description": "Input parameters for the task step. Any value is allowed.",
730"type": "object",
731"example": "{\n\"file_to_refactor\": \"models.py\"\n}"
732}
733}
734},
735{
736"type": "object",
737"required": [
738"step_id",
739"task_id",
740"status",
741"is_last",
742"artifacts"
743],
744"properties": {
745"task_id": {
746"description": "The ID of the task this step belongs to.",
747"type": "string",
748"example": "50da533e-3904-4401-8a07-c49adf88b5eb"
749},
750"step_id": {
751"description": "The ID of the task step.",
752"type": "string",
753"example": "6bb1801a-fd80-45e8-899a-4dd723cc602e"
754},
755"name": {
756"description": "The name of the task step.",
757"type": "string",
758"example": "Write to file",
759"nullable": true
760},
761"status": {
762"description": "The status of the task step.",
763"type": "string",
764"example": "created",
765"enum": ["created", "running", "completed"]
766},
767"output": {
768"description": "Output of the task step.",
769"type": "string",
770"example": "I am going to use the write_to_file command and write Washington to a file called output.txt <write_to_file('output.txt', 'Washington')",
771"nullable": true
772},
773"additional_output": {
774"description": "Output that the task step has produced. Any value is allowed.",
775"type": "object",
776"example": "{\n\"tokens\": 7894,\n\"estimated_cost\": \"0,24$\"\n}",
777"nullable": true
778},
779"artifacts": {
780"description": "A list of artifacts that the step has produced.",
781"type": "array",
782"items": {
783"description": "An Artifact either created by or submitted to the agent.",
784"type": "object",
785"properties": {
786"artifact_id": {
787"description": "ID of the artifact.",
788"type": "string",
789"example": "b225e278-8b4c-4f99-a696-8facf19f0e56"
790},
791"agent_created": {
792"description": "Whether the artifact has been created by the agent.",
793"type": "boolean",
794"example": false
795},
796"file_name": {
797"description": "Filename of the artifact.",
798"type": "string",
799"example": "main.py"
800},
801"relative_path": {
802"description": "Relative path of the artifact in the agent's workspace.",
803"type": "string",
804"example": "python/code/",
805"nullable": true
806}
807},
808"required": [
809"artifact_id",
810"agent_created",
811"file_name"
812]
813},
814"default": []
815},
816"is_last": {
817"description": "Whether this is the last step in the task.",
818"type": "boolean",
819"example": true,
820"default": false
821}
822}
823}
824]
825}
826}
827},
828"x-postman-variables": [
829{
830"type": "save",
831"name": "step_id",
832"path": ".step_id"
833}
834]
835},
836"404": {
837"description": "Unable to find entity with a given identifier",
838"content": {
839"application/json": {
840"schema": {
841"type": "object",
842"properties": {
843"message": {
844"description": "Message stating the entity was not found",
845"type": "string",
846"example": "Unable to find entity with the provided id"
847}
848},
849"required": ["message"]
850}
851}
852}
853},
854"422": {
855"description": "Unable to process request. Likely due to improperly formatted request.",
856"content": {
857"application/json": {
858"schema": {
859"description": "A generic JSON object without any specific requirements.",
860"type": "object"
861}
862}
863}
864},
865"default": {
866"description": "Internal Server Error"
867}
868},
869"tags": ["agent"]
870}
871},
872"/ap/v1/agent/tasks/{task_id}/steps/{step_id}": {
873"get": {
874"operationId": "getAgentTaskStep",
875"summary": "Get details about a specified task step.",
876"parameters": [
877{
878"name": "task_id",
879"in": "path",
880"description": "ID of the task",
881"required": true,
882"schema": {
883"type": "string"
884},
885"example": "50da533e-3904-4401-8a07-c49adf88b5eb",
886"x-postman-variables": [
887{
888"type": "load",
889"name": "task_id"
890},
891{
892"type": "load",
893"name": "step_id"
894}
895]
896},
897{
898"name": "step_id",
899"in": "path",
900"description": "ID of the step",
901"required": true,
902"schema": {
903"type": "string"
904},
905"example": "28ca533e-3904-4401-8a07-c49adf8891c2",
906"x-postman-variables": [
907{
908"type": "load",
909"name": "step_id"
910}
911]
912}
913],
914"responses": {
915"200": {
916"description": "Returned details about an agent task step.",
917"content": {
918"application/json": {
919"schema": {
920"allOf": [
921{
922"description": "Body of the task request.",
923"type": "object",
924"properties": {
925"input": {
926"description": "Input prompt for the step.",
927"type": "string",
928"example": "Write the words you receive to the file 'output.txt'.",
929"nullable": true
930},
931"additional_input": {
932"description": "Input parameters for the task step. Any value is allowed.",
933"type": "object",
934"example": "{\n\"file_to_refactor\": \"models.py\"\n}"
935}
936}
937},
938{
939"type": "object",
940"required": [
941"step_id",
942"task_id",
943"status",
944"is_last",
945"artifacts"
946],
947"properties": {
948"task_id": {
949"description": "The ID of the task this step belongs to.",
950"type": "string",
951"example": "50da533e-3904-4401-8a07-c49adf88b5eb"
952},
953"step_id": {
954"description": "The ID of the task step.",
955"type": "string",
956"example": "6bb1801a-fd80-45e8-899a-4dd723cc602e"
957},
958"name": {
959"description": "The name of the task step.",
960"type": "string",
961"example": "Write to file",
962"nullable": true
963},
964"status": {
965"description": "The status of the task step.",
966"type": "string",
967"example": "created",
968"enum": ["created", "running", "completed"]
969},
970"output": {
971"description": "Output of the task step.",
972"type": "string",
973"example": "I am going to use the write_to_file command and write Washington to a file called output.txt <write_to_file('output.txt', 'Washington')",
974"nullable": true
975},
976"additional_output": {
977"description": "Output that the task step has produced. Any value is allowed.",
978"type": "object",
979"example": "{\n\"tokens\": 7894,\n\"estimated_cost\": \"0,24$\"\n}",
980"nullable": true
981},
982"artifacts": {
983"description": "A list of artifacts that the step has produced.",
984"type": "array",
985"items": {
986"description": "An Artifact either created by or submitted to the agent.",
987"type": "object",
988"properties": {
989"artifact_id": {
990"description": "ID of the artifact.",
991"type": "string",
992"example": "b225e278-8b4c-4f99-a696-8facf19f0e56"
993},
994"agent_created": {
995"description": "Whether the artifact has been created by the agent.",
996"type": "boolean",
997"example": false
998},
999"file_name": {
1000"description": "Filename of the artifact.",
1001"type": "string",
1002"example": "main.py"
1003},
1004"relative_path": {
1005"description": "Relative path of the artifact in the agent's workspace.",
1006"type": "string",
1007"example": "python/code/",
1008"nullable": true
1009}
1010},
1011"required": [
1012"artifact_id",
1013"agent_created",
1014"file_name"
1015]
1016},
1017"default": []
1018},
1019"is_last": {
1020"description": "Whether this is the last step in the task.",
1021"type": "boolean",
1022"example": true,
1023"default": false
1024}
1025}
1026}
1027]
1028}
1029}
1030}
1031},
1032"404": {
1033"description": "Unable to find entity with a given identifier",
1034"content": {
1035"application/json": {
1036"schema": {
1037"type": "object",
1038"properties": {
1039"message": {
1040"description": "Message stating the entity was not found",
1041"type": "string",
1042"example": "Unable to find entity with the provided id"
1043}
1044},
1045"required": ["message"]
1046}
1047}
1048}
1049},
1050"default": {
1051"description": "Internal Server Error"
1052}
1053},
1054"tags": ["agent"]
1055}
1056},
1057"/ap/v1/agent/tasks/{task_id}/artifacts": {
1058"get": {
1059"operationId": "listAgentTaskArtifacts",
1060"summary": "List all artifacts that have been created for the given task.",
1061"parameters": [
1062{
1063"name": "task_id",
1064"in": "path",
1065"description": "ID of the task",
1066"required": true,
1067"schema": {
1068"type": "string"
1069},
1070"example": "50da533e-3904-4401-8a07-c49adf88b5eb",
1071"x-postman-variables": [
1072{
1073"type": "load",
1074"name": "task_id"
1075}
1076]
1077},
1078{
1079"name": "current_page",
1080"in": "query",
1081"description": "Page number",
1082"required": false,
1083"schema": {
1084"type": "integer",
1085"format": "int32",
1086"default": 1,
1087"minimum": 1
1088},
1089"example": 2
1090},
1091{
1092"name": "page_size",
1093"in": "query",
1094"description": "Number of items per page",
1095"required": false,
1096"schema": {
1097"type": "integer",
1098"format": "int32",
1099"default": 10,
1100"minimum": 1
1101},
1102"example": 25
1103}
1104],
1105"responses": {
1106"200": {
1107"description": "Returned the list of artifacts for the task.",
1108"content": {
1109"application/json": {
1110"schema": {
1111"type": "object",
1112"properties": {
1113"artifacts": {
1114"type": "array",
1115"items": {
1116"description": "An Artifact either created by or submitted to the agent.",
1117"type": "object",
1118"properties": {
1119"artifact_id": {
1120"description": "ID of the artifact.",
1121"type": "string",
1122"example": "b225e278-8b4c-4f99-a696-8facf19f0e56"
1123},
1124"agent_created": {
1125"description": "Whether the artifact has been created by the agent.",
1126"type": "boolean",
1127"example": false
1128},
1129"file_name": {
1130"description": "Filename of the artifact.",
1131"type": "string",
1132"example": "main.py"
1133},
1134"relative_path": {
1135"description": "Relative path of the artifact in the agent's workspace.",
1136"type": "string",
1137"example": "python/code/",
1138"nullable": true
1139}
1140},
1141"required": [
1142"artifact_id",
1143"agent_created",
1144"file_name"
1145]
1146}
1147},
1148"pagination": {
1149"type": "object",
1150"properties": {
1151"total_items": {
1152"description": "Total number of items.",
1153"type": "integer",
1154"example": 42
1155},
1156"total_pages": {
1157"description": "Total number of pages.",
1158"type": "integer",
1159"example": 97
1160},
1161"current_page": {
1162"description": "Current_page page number.",
1163"type": "integer",
1164"example": 1
1165},
1166"page_size": {
1167"description": "Number of items per page.",
1168"type": "integer",
1169"example": 25
1170}
1171},
1172"required": [
1173"total_items",
1174"total_pages",
1175"current_page",
1176"page_size"
1177]
1178}
1179},
1180"required": ["artifacts", "pagination"]
1181}
1182}
1183}
1184},
1185"404": {
1186"description": "Unable to find entity with a given identifier",
1187"content": {
1188"application/json": {
1189"schema": {
1190"type": "object",
1191"properties": {
1192"message": {
1193"description": "Message stating the entity was not found",
1194"type": "string",
1195"example": "Unable to find entity with the provided id"
1196}
1197},
1198"required": ["message"]
1199}
1200}
1201}
1202},
1203"default": {
1204"description": "Internal Server Error"
1205}
1206},
1207"tags": ["agent"]
1208},
1209"post": {
1210"operationId": "uploadAgentTaskArtifacts",
1211"summary": "Upload an artifact for the specified task.",
1212"parameters": [
1213{
1214"name": "task_id",
1215"in": "path",
1216"description": "ID of the task",
1217"required": true,
1218"schema": {
1219"type": "string"
1220},
1221"example": "50da533e-3904-4401-8a07-c49adf88b5eb",
1222"x-postman-variables": [
1223{
1224"type": "load",
1225"name": "task_id"
1226}
1227]
1228}
1229],
1230"requestBody": {
1231"content": {
1232"multipart/form-data": {
1233"schema": {
1234"description": "Artifact to upload to the agent.",
1235"type": "object",
1236"properties": {
1237"file": {
1238"description": "File to upload.",
1239"type": "string",
1240"format": "binary",
1241"example": "binary representation of file"
1242},
1243"relative_path": {
1244"description": "Relative path of the artifact in the agent's workspace.",
1245"type": "string",
1246"example": "python/code"
1247}
1248},
1249"required": ["file"]
1250}
1251}
1252}
1253},
1254"responses": {
1255"200": {
1256"description": "Returned the content of the artifact.",
1257"content": {
1258"application/json": {
1259"schema": {
1260"description": "An Artifact either created by or submitted to the agent.",
1261"type": "object",
1262"properties": {
1263"artifact_id": {
1264"description": "ID of the artifact.",
1265"type": "string",
1266"example": "b225e278-8b4c-4f99-a696-8facf19f0e56"
1267},
1268"agent_created": {
1269"description": "Whether the artifact has been created by the agent.",
1270"type": "boolean",
1271"example": false
1272},
1273"file_name": {
1274"description": "Filename of the artifact.",
1275"type": "string",
1276"example": "main.py"
1277},
1278"relative_path": {
1279"description": "Relative path of the artifact in the agent's workspace.",
1280"type": "string",
1281"example": "python/code/",
1282"nullable": true
1283}
1284},
1285"required": ["artifact_id", "agent_created", "file_name"]
1286}
1287}
1288}
1289},
1290"404": {
1291"description": "Unable to find entity with a given identifier",
1292"content": {
1293"application/json": {
1294"schema": {
1295"type": "object",
1296"properties": {
1297"message": {
1298"description": "Message stating the entity was not found",
1299"type": "string",
1300"example": "Unable to find entity with the provided id"
1301}
1302},
1303"required": ["message"]
1304}
1305}
1306}
1307},
1308"default": {
1309"description": "Internal Server Error"
1310}
1311},
1312"tags": ["agent"]
1313}
1314},
1315"/ap/v1/agent/tasks/{task_id}/artifacts/{artifact_id}": {
1316"get": {
1317"operationId": "downloadAgentTaskArtifact",
1318"summary": "Download a specified artifact.",
1319"parameters": [
1320{
1321"name": "task_id",
1322"in": "path",
1323"description": "ID of the task",
1324"required": true,
1325"schema": {
1326"type": "string"
1327},
1328"example": "50da533e-3904-4401-8a07-c49adf88b5eb",
1329"x-postman-variables": [
1330{
1331"type": "load",
1332"name": "task_id"
1333}
1334]
1335},
1336{
1337"name": "artifact_id",
1338"in": "path",
1339"description": "ID of the artifact",
1340"required": true,
1341"schema": {
1342"type": "string"
1343},
1344"example": "1e41533e-3904-4401-8a07-c49adf8893de"
1345}
1346],
1347"responses": {
1348"200": {
1349"description": "Returned the content of the artifact.",
1350"content": {
1351"application/octet-stream": {
1352"schema": {
1353"type": "string",
1354"format": "binary"
1355}
1356}
1357}
1358},
1359"404": {
1360"description": "Unable to find entity with a given identifier",
1361"content": {
1362"application/json": {
1363"schema": {
1364"type": "object",
1365"properties": {
1366"message": {
1367"description": "Message stating the entity was not found",
1368"type": "string",
1369"example": "Unable to find entity with the provided id"
1370}
1371},
1372"required": ["message"]
1373}
1374}
1375}
1376},
1377"default": {
1378"description": "Internal Server Error"
1379}
1380},
1381"tags": ["agent"]
1382}
1383}
1384},
1385"components": {
1386"schemas": {
1387"Pagination": {
1388"type": "object",
1389"properties": {
1390"total_items": {
1391"description": "Total number of items.",
1392"type": "integer",
1393"example": 42
1394},
1395"total_pages": {
1396"description": "Total number of pages.",
1397"type": "integer",
1398"example": 97
1399},
1400"current_page": {
1401"description": "Current_page page number.",
1402"type": "integer",
1403"example": 1
1404},
1405"page_size": {
1406"description": "Number of items per page.",
1407"type": "integer",
1408"example": 25
1409}
1410},
1411"required": ["total_items", "total_pages", "current_page", "page_size"]
1412},
1413"TaskListResponse": {
1414"type": "object",
1415"properties": {
1416"tasks": {
1417"type": "array",
1418"items": {
1419"allOf": [
1420{
1421"description": "Body of the task request.",
1422"type": "object",
1423"properties": {
1424"input": {
1425"description": "Input prompt for the task.",
1426"type": "string",
1427"example": "Write 'Washington' to the file 'output.txt'.",
1428"nullable": true
1429},
1430"additional_input": {
1431"description": "Input parameters for the task. Any value is allowed.",
1432"type": "object",
1433"example": "{\n\"debug\": false,\n\"mode\": \"benchmarks\"\n}"
1434}
1435}
1436},
1437{
1438"type": "object",
1439"description": "Definition of an agent task.",
1440"required": ["task_id", "artifacts"],
1441"properties": {
1442"task_id": {
1443"description": "The ID of the task.",
1444"type": "string",
1445"example": "50da533e-3904-4401-8a07-c49adf88b5eb"
1446},
1447"artifacts": {
1448"description": "A list of artifacts that the task has produced.",
1449"type": "array",
1450"items": {
1451"description": "An Artifact either created by or submitted to the agent.",
1452"type": "object",
1453"properties": {
1454"artifact_id": {
1455"description": "ID of the artifact.",
1456"type": "string",
1457"example": "b225e278-8b4c-4f99-a696-8facf19f0e56"
1458},
1459"agent_created": {
1460"description": "Whether the artifact has been created by the agent.",
1461"type": "boolean",
1462"example": false
1463},
1464"file_name": {
1465"description": "Filename of the artifact.",
1466"type": "string",
1467"example": "main.py"
1468},
1469"relative_path": {
1470"description": "Relative path of the artifact in the agent's workspace.",
1471"type": "string",
1472"example": "python/code/",
1473"nullable": true
1474}
1475},
1476"required": [
1477"artifact_id",
1478"agent_created",
1479"file_name"
1480]
1481},
1482"example": [
1483"7a49f31c-f9c6-4346-a22c-e32bc5af4d8e",
1484"ab7b4091-2560-4692-a4fe-d831ea3ca7d6"
1485],
1486"default": []
1487}
1488}
1489}
1490]
1491}
1492},
1493"pagination": {
1494"type": "object",
1495"properties": {
1496"total_items": {
1497"description": "Total number of items.",
1498"type": "integer",
1499"example": 42
1500},
1501"total_pages": {
1502"description": "Total number of pages.",
1503"type": "integer",
1504"example": 97
1505},
1506"current_page": {
1507"description": "Current_page page number.",
1508"type": "integer",
1509"example": 1
1510},
1511"page_size": {
1512"description": "Number of items per page.",
1513"type": "integer",
1514"example": 25
1515}
1516},
1517"required": [
1518"total_items",
1519"total_pages",
1520"current_page",
1521"page_size"
1522]
1523}
1524},
1525"required": ["tasks", "pagination"]
1526},
1527"TaskStepsListResponse": {
1528"type": "object",
1529"properties": {
1530"steps": {
1531"type": "array",
1532"items": {
1533"allOf": [
1534{
1535"description": "Body of the task request.",
1536"type": "object",
1537"properties": {
1538"input": {
1539"description": "Input prompt for the step.",
1540"type": "string",
1541"example": "Write the words you receive to the file 'output.txt'.",
1542"nullable": true
1543},
1544"additional_input": {
1545"description": "Input parameters for the task step. Any value is allowed.",
1546"type": "object",
1547"example": "{\n\"file_to_refactor\": \"models.py\"\n}"
1548}
1549}
1550},
1551{
1552"type": "object",
1553"required": [
1554"step_id",
1555"task_id",
1556"status",
1557"is_last",
1558"artifacts"
1559],
1560"properties": {
1561"task_id": {
1562"description": "The ID of the task this step belongs to.",
1563"type": "string",
1564"example": "50da533e-3904-4401-8a07-c49adf88b5eb"
1565},
1566"step_id": {
1567"description": "The ID of the task step.",
1568"type": "string",
1569"example": "6bb1801a-fd80-45e8-899a-4dd723cc602e"
1570},
1571"name": {
1572"description": "The name of the task step.",
1573"type": "string",
1574"example": "Write to file",
1575"nullable": true
1576},
1577"status": {
1578"description": "The status of the task step.",
1579"type": "string",
1580"example": "created",
1581"enum": ["created", "running", "completed"]
1582},
1583"output": {
1584"description": "Output of the task step.",
1585"type": "string",
1586"example": "I am going to use the write_to_file command and write Washington to a file called output.txt <write_to_file('output.txt', 'Washington')",
1587"nullable": true
1588},
1589"additional_output": {
1590"description": "Output that the task step has produced. Any value is allowed.",
1591"type": "object",
1592"example": "{\n\"tokens\": 7894,\n\"estimated_cost\": \"0,24$\"\n}",
1593"nullable": true
1594},
1595"artifacts": {
1596"description": "A list of artifacts that the step has produced.",
1597"type": "array",
1598"items": {
1599"description": "An Artifact either created by or submitted to the agent.",
1600"type": "object",
1601"properties": {
1602"artifact_id": {
1603"description": "ID of the artifact.",
1604"type": "string",
1605"example": "b225e278-8b4c-4f99-a696-8facf19f0e56"
1606},
1607"agent_created": {
1608"description": "Whether the artifact has been created by the agent.",
1609"type": "boolean",
1610"example": false
1611},
1612"file_name": {
1613"description": "Filename of the artifact.",
1614"type": "string",
1615"example": "main.py"
1616},
1617"relative_path": {
1618"description": "Relative path of the artifact in the agent's workspace.",
1619"type": "string",
1620"example": "python/code/",
1621"nullable": true
1622}
1623},
1624"required": [
1625"artifact_id",
1626"agent_created",
1627"file_name"
1628]
1629},
1630"default": []
1631},
1632"is_last": {
1633"description": "Whether this is the last step in the task.",
1634"type": "boolean",
1635"example": true,
1636"default": false
1637}
1638}
1639}
1640]
1641}
1642},
1643"pagination": {
1644"type": "object",
1645"properties": {
1646"total_items": {
1647"description": "Total number of items.",
1648"type": "integer",
1649"example": 42
1650},
1651"total_pages": {
1652"description": "Total number of pages.",
1653"type": "integer",
1654"example": 97
1655},
1656"current_page": {
1657"description": "Current_page page number.",
1658"type": "integer",
1659"example": 1
1660},
1661"page_size": {
1662"description": "Number of items per page.",
1663"type": "integer",
1664"example": 25
1665}
1666},
1667"required": [
1668"total_items",
1669"total_pages",
1670"current_page",
1671"page_size"
1672]
1673}
1674},
1675"required": ["steps", "pagination"]
1676},
1677"TaskArtifactsListResponse": {
1678"type": "object",
1679"properties": {
1680"artifacts": {
1681"type": "array",
1682"items": {
1683"description": "An Artifact either created by or submitted to the agent.",
1684"type": "object",
1685"properties": {
1686"artifact_id": {
1687"description": "ID of the artifact.",
1688"type": "string",
1689"example": "b225e278-8b4c-4f99-a696-8facf19f0e56"
1690},
1691"agent_created": {
1692"description": "Whether the artifact has been created by the agent.",
1693"type": "boolean",
1694"example": false
1695},
1696"file_name": {
1697"description": "Filename of the artifact.",
1698"type": "string",
1699"example": "main.py"
1700},
1701"relative_path": {
1702"description": "Relative path of the artifact in the agent's workspace.",
1703"type": "string",
1704"example": "python/code/",
1705"nullable": true
1706}
1707},
1708"required": ["artifact_id", "agent_created", "file_name"]
1709}
1710},
1711"pagination": {
1712"type": "object",
1713"properties": {
1714"total_items": {
1715"description": "Total number of items.",
1716"type": "integer",
1717"example": 42
1718},
1719"total_pages": {
1720"description": "Total number of pages.",
1721"type": "integer",
1722"example": 97
1723},
1724"current_page": {
1725"description": "Current_page page number.",
1726"type": "integer",
1727"example": 1
1728},
1729"page_size": {
1730"description": "Number of items per page.",
1731"type": "integer",
1732"example": 25
1733}
1734},
1735"required": [
1736"total_items",
1737"total_pages",
1738"current_page",
1739"page_size"
1740]
1741}
1742},
1743"required": ["artifacts", "pagination"]
1744},
1745"TaskInput": {
1746"description": "Input parameters for the task. Any value is allowed.",
1747"type": "object",
1748"example": "{\n\"debug\": false,\n\"mode\": \"benchmarks\"\n}"
1749},
1750"Artifact": {
1751"description": "An Artifact either created by or submitted to the agent.",
1752"type": "object",
1753"properties": {
1754"artifact_id": {
1755"description": "ID of the artifact.",
1756"type": "string",
1757"example": "b225e278-8b4c-4f99-a696-8facf19f0e56"
1758},
1759"agent_created": {
1760"description": "Whether the artifact has been created by the agent.",
1761"type": "boolean",
1762"example": false
1763},
1764"file_name": {
1765"description": "Filename of the artifact.",
1766"type": "string",
1767"example": "main.py"
1768},
1769"relative_path": {
1770"description": "Relative path of the artifact in the agent's workspace.",
1771"type": "string",
1772"example": "python/code/",
1773"nullable": true
1774}
1775},
1776"required": ["artifact_id", "agent_created", "file_name"]
1777},
1778"ArtifactUpload": {
1779"description": "Artifact to upload to the agent.",
1780"type": "object",
1781"properties": {
1782"file": {
1783"description": "File to upload.",
1784"type": "string",
1785"format": "binary",
1786"example": "binary representation of file"
1787},
1788"relative_path": {
1789"description": "Relative path of the artifact in the agent's workspace.",
1790"type": "string",
1791"example": "python/code"
1792}
1793},
1794"required": ["file"]
1795},
1796"StepInput": {
1797"description": "Input parameters for the task step. Any value is allowed.",
1798"type": "object",
1799"example": "{\n\"file_to_refactor\": \"models.py\"\n}"
1800},
1801"StepOutput": {
1802"description": "Output that the task step has produced. Any value is allowed.",
1803"type": "object",
1804"example": "{\n\"tokens\": 7894,\n\"estimated_cost\": \"0,24$\"\n}",
1805"nullable": true
1806},
1807"TaskRequestBody": {
1808"description": "Body of the task request.",
1809"type": "object",
1810"properties": {
1811"input": {
1812"description": "Input prompt for the task.",
1813"type": "string",
1814"example": "Write 'Washington' to the file 'output.txt'.",
1815"nullable": true
1816},
1817"additional_input": {
1818"description": "Input parameters for the task. Any value is allowed.",
1819"type": "object",
1820"example": "{\n\"debug\": false,\n\"mode\": \"benchmarks\"\n}"
1821}
1822}
1823},
1824"Task": {
1825"allOf": [
1826{
1827"description": "Body of the task request.",
1828"type": "object",
1829"properties": {
1830"input": {
1831"description": "Input prompt for the task.",
1832"type": "string",
1833"example": "Write 'Washington' to the file 'output.txt'.",
1834"nullable": true
1835},
1836"additional_input": {
1837"description": "Input parameters for the task. Any value is allowed.",
1838"type": "object",
1839"example": "{\n\"debug\": false,\n\"mode\": \"benchmarks\"\n}"
1840}
1841}
1842},
1843{
1844"type": "object",
1845"description": "Definition of an agent task.",
1846"required": ["task_id", "artifacts"],
1847"properties": {
1848"task_id": {
1849"description": "The ID of the task.",
1850"type": "string",
1851"example": "50da533e-3904-4401-8a07-c49adf88b5eb"
1852},
1853"artifacts": {
1854"description": "A list of artifacts that the task has produced.",
1855"type": "array",
1856"items": {
1857"description": "An Artifact either created by or submitted to the agent.",
1858"type": "object",
1859"properties": {
1860"artifact_id": {
1861"description": "ID of the artifact.",
1862"type": "string",
1863"example": "b225e278-8b4c-4f99-a696-8facf19f0e56"
1864},
1865"agent_created": {
1866"description": "Whether the artifact has been created by the agent.",
1867"type": "boolean",
1868"example": false
1869},
1870"file_name": {
1871"description": "Filename of the artifact.",
1872"type": "string",
1873"example": "main.py"
1874},
1875"relative_path": {
1876"description": "Relative path of the artifact in the agent's workspace.",
1877"type": "string",
1878"example": "python/code/",
1879"nullable": true
1880}
1881},
1882"required": ["artifact_id", "agent_created", "file_name"]
1883},
1884"example": [
1885"7a49f31c-f9c6-4346-a22c-e32bc5af4d8e",
1886"ab7b4091-2560-4692-a4fe-d831ea3ca7d6"
1887],
1888"default": []
1889}
1890}
1891}
1892]
1893},
1894"StepRequestBody": {
1895"description": "Body of the task request.",
1896"type": "object",
1897"properties": {
1898"input": {
1899"description": "Input prompt for the step.",
1900"type": "string",
1901"example": "Write the words you receive to the file 'output.txt'.",
1902"nullable": true
1903},
1904"additional_input": {
1905"description": "Input parameters for the task step. Any value is allowed.",
1906"type": "object",
1907"example": "{\n\"file_to_refactor\": \"models.py\"\n}"
1908}
1909}
1910},
1911"Step": {
1912"allOf": [
1913{
1914"description": "Body of the task request.",
1915"type": "object",
1916"properties": {
1917"input": {
1918"description": "Input prompt for the step.",
1919"type": "string",
1920"example": "Write the words you receive to the file 'output.txt'.",
1921"nullable": true
1922},
1923"additional_input": {
1924"description": "Input parameters for the task step. Any value is allowed.",
1925"type": "object",
1926"example": "{\n\"file_to_refactor\": \"models.py\"\n}"
1927}
1928}
1929},
1930{
1931"type": "object",
1932"required": [
1933"step_id",
1934"task_id",
1935"status",
1936"is_last",
1937"artifacts"
1938],
1939"properties": {
1940"task_id": {
1941"description": "The ID of the task this step belongs to.",
1942"type": "string",
1943"example": "50da533e-3904-4401-8a07-c49adf88b5eb"
1944},
1945"step_id": {
1946"description": "The ID of the task step.",
1947"type": "string",
1948"example": "6bb1801a-fd80-45e8-899a-4dd723cc602e"
1949},
1950"name": {
1951"description": "The name of the task step.",
1952"type": "string",
1953"example": "Write to file",
1954"nullable": true
1955},
1956"status": {
1957"description": "The status of the task step.",
1958"type": "string",
1959"example": "created",
1960"enum": ["created", "running", "completed"]
1961},
1962"output": {
1963"description": "Output of the task step.",
1964"type": "string",
1965"example": "I am going to use the write_to_file command and write Washington to a file called output.txt <write_to_file('output.txt', 'Washington')",
1966"nullable": true
1967},
1968"additional_output": {
1969"description": "Output that the task step has produced. Any value is allowed.",
1970"type": "object",
1971"example": "{\n\"tokens\": 7894,\n\"estimated_cost\": \"0,24$\"\n}",
1972"nullable": true
1973},
1974"artifacts": {
1975"description": "A list of artifacts that the step has produced.",
1976"type": "array",
1977"items": {
1978"description": "An Artifact either created by or submitted to the agent.",
1979"type": "object",
1980"properties": {
1981"artifact_id": {
1982"description": "ID of the artifact.",
1983"type": "string",
1984"example": "b225e278-8b4c-4f99-a696-8facf19f0e56"
1985},
1986"agent_created": {
1987"description": "Whether the artifact has been created by the agent.",
1988"type": "boolean",
1989"example": false
1990},
1991"file_name": {
1992"description": "Filename of the artifact.",
1993"type": "string",
1994"example": "main.py"
1995},
1996"relative_path": {
1997"description": "Relative path of the artifact in the agent's workspace.",
1998"type": "string",
1999"example": "python/code/",
2000"nullable": true
2001}
2002},
2003"required": ["artifact_id", "agent_created", "file_name"]
2004},
2005"default": []
2006},
2007"is_last": {
2008"description": "Whether this is the last step in the task.",
2009"type": "boolean",
2010"example": true,
2011"default": false
2012}
2013}
2014}
2015]
2016}
2017},
2018"responses": {
2019"UnprocessableEntity": {
2020"description": "Unable to process request. Likely due to improperly formatted request.",
2021"content": {
2022"application/json": {
2023"schema": {
2024"description": "A generic JSON object without any specific requirements.",
2025"type": "object"
2026}
2027}
2028}
2029},
2030"NotFound": {
2031"description": "Unable to find entity with a given identifier",
2032"content": {
2033"application/json": {
2034"schema": {
2035"type": "object",
2036"properties": {
2037"message": {
2038"description": "Message stating the entity was not found",
2039"type": "string",
2040"example": "Unable to find entity with the provided id"
2041}
2042},
2043"required": ["message"]
2044}
2045}
2046}
2047}
2048}
2049}
2050}
2051