From 3b1a11bb89bf6317f397eafd20dd64676e5fb00a Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Wed, 23 Sep 2026 18:34:31 +0000 Subject: [PATCH 1/2] =?UTF-8?q?##=20Go=20SDK=20Changes:=20*=20`Glean.Agent?= =?UTF-8?q?s.CreateRun()`:=20=20=20*=20=20`request.PlatformAgentRunCreateR?= =?UTF-8?q?equest.ExecutionMode`=20**Added**=20=20=20*=20=20`response.stat?= =?UTF-8?q?us[201]`=20**Added**=20(Breaking=20=E2=9A=A0=EF=B8=8F)=20*=20`G?= =?UTF-8?q?lean.Agents.GetRun()`:=20**Added**=20*=20`Glean.Agents.CancelRu?= =?UTF-8?q?n()`:=20**Added**=20*=20`Glean.Agents.RespondToRun()`:=20**Adde?= =?UTF-8?q?d**=20*=20`Glean.Chat.Create()`:=20=20=20*=20=20`request.Reques?= =?UTF-8?q?t.Text`=20**Added**=20=20=20*=20=20`response.Output[].Content[]?= =?UTF-8?q?.StructuredOutput`=20**Added**=20*=20`Glean.Client.Search.Retri?= =?UTF-8?q?eveFeed()`:=20=20=20*=20=20`request.FeedRequest.Categories[]`?= =?UTF-8?q?=20**Changed**=20=20=20*=20=20`response.Results[]`=20**Changed*?= =?UTF-8?q?*?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .speakeasy/gen.lock | 422 +++++++-- .speakeasy/gen.yaml | 2 +- .speakeasy/glean-merged-spec.yaml | 514 ++++++++++- .speakeasy/tests.arazzo.yaml | 83 +- .speakeasy/workflow.lock | 12 +- README.md | 29 +- RELEASES.md | 12 +- agents.go | 864 +++++++++++++++++- docs/models/components/decision.md | 21 + docs/models/components/executionmode.md | 22 + docs/models/components/feedrequestcategory.md | 4 +- docs/models/components/feedresultcategory.md | 4 +- docs/models/components/justificationtype.md | 4 +- .../platformagentrunapprovaldecision.md | 11 + .../platformagentruncancellationrequest.md | 10 + .../platformagentruncreaterequest.md | 13 +- .../components/platformagentrunerror.md | 11 + .../components/platformagentrunresponse.md | 11 + .../platformagentrunresponsesrequest.md | 11 + .../components/platformagentrunstate.md | 30 + .../platformagentruntoolapproval.md | 16 + .../platformagentruntoolapprovaltype.md | 20 + .../platformchatjsonschemaformat.md | 14 + .../platformchatjsonschemaformattype.md | 20 + .../platformchatoutputtextcontent.md | 11 +- .../components/platformchattextformat.md | 10 + .../components/platformchattextformattype.md | 20 + .../components/platformdurableagentrun.md | 18 + docs/models/components/structuredoutput.md | 10 + .../platformagentscancelrunrequest.md | 9 + .../platformagentscancelrunresponse.md | 9 + .../platformagentscreaterunresponse.md | 11 +- ...platformagentscreaterunresponsesrequest.md | 9 + ...latformagentscreaterunresponsesresponse.md | 9 + .../operations/platformagentsgetrunrequest.md | 9 + .../platformagentsgetrunresponse.md | 9 + .../operations/platformchatcreateformat.md | 32 + .../operations/platformchatcreaterequest.md | 13 +- .../platformchatcreatestreamformat.md | 32 + .../platformchatcreatestreamrequest.md | 13 +- .../platformchatcreatestreamtext.md | 11 + .../operations/platformchatcreatetext.md | 11 + docs/sdks/agents/README.md | 187 +++- docs/sdks/chat/README.md | 52 +- glean.go | 10 +- models/components/feedentry.go | 4 +- models/components/feedrequest.go | 6 + models/components/feedresult.go | 4 +- .../platformagentrunapprovaldecision.go | 57 ++ .../platformagentruncancellationrequest.go | 16 + .../platformagentruncreaterequest.go | 41 +- models/components/platformagentrunerror.go | 25 + models/components/platformagentrunresponse.go | 25 + .../platformagentrunresponsesrequest.go | 25 + models/components/platformagentrunstate.go | 32 + .../platformagentruntoolapproval.go | 112 +++ .../platformchatjsonschemaformat.go | 94 ++ .../platformchatoutputtextcontent.go | 31 +- models/components/platformchattextformat.go | 57 ++ models/components/platformdurableagentrun.go | 105 +++ models/operations/platformagentscancelrun.go | 47 + models/operations/platformagentscreaterun.go | 10 + .../platformagentscreaterunresponses.go | 47 + models/operations/platformagentsgetrun.go | 48 + models/operations/platformchatcreate.go | 121 +++ models/operations/platformchatcreatestream.go | 121 +++ tests/agents_test.go | 61 ++ tests/chat_test.go | 26 +- tests/messages_test.go | 2 +- .../internal/handler/generated_handlers.go | 3 + .../pathgetapiagentsagentidrunsrunid.go | 73 ++ .../pathpostapiagentsagentidcancellations.go | 78 ++ .../pathpostapiagentsagentidresponses.go | 89 ++ .../sdk/models/components/feedentry.go | 6 + .../sdk/models/components/feedrequest.go | 6 + .../sdk/models/components/feedresult.go | 6 + .../platformagentrunapprovaldecision.go | 57 ++ .../platformagentruncancellationrequest.go | 16 + .../platformagentruncreaterequest.go | 41 +- .../components/platformagentrunerror.go | 25 + .../components/platformagentrunresponse.go | 25 + .../platformagentrunresponsesrequest.go | 25 + .../components/platformagentrunstate.go | 53 ++ .../platformagentruntoolapproval.go | 112 +++ .../platformchatjsonschemaformat.go | 94 ++ .../platformchatoutputtextcontent.go | 32 +- .../components/platformchattextformat.go | 57 ++ .../components/platformdurableagentrun.go | 105 +++ .../operations/platformagentscancelrun.go | 47 + .../operations/platformagentscreaterun.go | 10 + .../platformagentscreaterunresponses.go | 47 + .../models/operations/platformagentsgetrun.go | 48 + .../models/operations/platformchatcreate.go | 125 +++ .../operations/platformchatcreatestream.go | 125 +++ tests/summarize_test.go | 13 +- 95 files changed, 4906 insertions(+), 184 deletions(-) create mode 100644 docs/models/components/decision.md create mode 100644 docs/models/components/executionmode.md create mode 100644 docs/models/components/platformagentrunapprovaldecision.md create mode 100644 docs/models/components/platformagentruncancellationrequest.md create mode 100644 docs/models/components/platformagentrunerror.md create mode 100644 docs/models/components/platformagentrunresponse.md create mode 100644 docs/models/components/platformagentrunresponsesrequest.md create mode 100644 docs/models/components/platformagentrunstate.md create mode 100644 docs/models/components/platformagentruntoolapproval.md create mode 100644 docs/models/components/platformagentruntoolapprovaltype.md create mode 100644 docs/models/components/platformchatjsonschemaformat.md create mode 100644 docs/models/components/platformchatjsonschemaformattype.md create mode 100644 docs/models/components/platformchattextformat.md create mode 100644 docs/models/components/platformchattextformattype.md create mode 100644 docs/models/components/platformdurableagentrun.md create mode 100644 docs/models/components/structuredoutput.md create mode 100644 docs/models/operations/platformagentscancelrunrequest.md create mode 100644 docs/models/operations/platformagentscancelrunresponse.md create mode 100644 docs/models/operations/platformagentscreaterunresponsesrequest.md create mode 100644 docs/models/operations/platformagentscreaterunresponsesresponse.md create mode 100644 docs/models/operations/platformagentsgetrunrequest.md create mode 100644 docs/models/operations/platformagentsgetrunresponse.md create mode 100644 docs/models/operations/platformchatcreateformat.md create mode 100644 docs/models/operations/platformchatcreatestreamformat.md create mode 100644 docs/models/operations/platformchatcreatestreamtext.md create mode 100644 docs/models/operations/platformchatcreatetext.md create mode 100644 models/components/platformagentrunapprovaldecision.go create mode 100644 models/components/platformagentruncancellationrequest.go create mode 100644 models/components/platformagentrunerror.go create mode 100644 models/components/platformagentrunresponse.go create mode 100644 models/components/platformagentrunresponsesrequest.go create mode 100644 models/components/platformagentrunstate.go create mode 100644 models/components/platformagentruntoolapproval.go create mode 100644 models/components/platformchatjsonschemaformat.go create mode 100644 models/components/platformchattextformat.go create mode 100644 models/components/platformdurableagentrun.go create mode 100644 models/operations/platformagentscancelrun.go create mode 100644 models/operations/platformagentscreaterunresponses.go create mode 100644 models/operations/platformagentsgetrun.go create mode 100644 tests/mockserver/internal/handler/pathgetapiagentsagentidrunsrunid.go create mode 100644 tests/mockserver/internal/handler/pathpostapiagentsagentidcancellations.go create mode 100644 tests/mockserver/internal/handler/pathpostapiagentsagentidresponses.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformagentrunapprovaldecision.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformagentruncancellationrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformagentrunerror.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformagentrunresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformagentrunresponsesrequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformagentrunstate.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformagentruntoolapproval.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformchatjsonschemaformat.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformchattextformat.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformdurableagentrun.go create mode 100644 tests/mockserver/internal/sdk/models/operations/platformagentscancelrun.go create mode 100644 tests/mockserver/internal/sdk/models/operations/platformagentscreaterunresponses.go create mode 100644 tests/mockserver/internal/sdk/models/operations/platformagentsgetrun.go diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index de4bb127..dddabaea 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,18 +1,18 @@ lockVersion: 2.0.0 id: 9d90eb9e-33f8-4170-8944-988f4000aad0 management: - docChecksum: 6c50d3df7af689ff921a7b236aa524a5 + docChecksum: 1974948f3cdb42c18f515f1fb0fea2dd docVersion: 0.9.0 - speakeasyVersion: 1.797.0 - generationVersion: 2.937.18 - releaseVersion: 0.15.14 - configChecksum: 267579f997c9c6d35425e9ffb299ce7b + speakeasyVersion: 1.798.0 + generationVersion: 2.938.0 + releaseVersion: 0.15.15 + configChecksum: 2440721a4689a69c2b3ee8dcb9850c77 repoURL: https://github.com/gleanwork/api-client-go.git installationURL: https://github.com/gleanwork/api-client-go persistentEdits: - generation_id: 4bab0995-7f0a-40a8-91eb-8e6cced77424 - pristine_commit_hash: d351fb9ab21e9e15a2db14f520a899f87db23435 - pristine_tree_hash: bb2c14b09117c2fa4653f48e8341721d5c98687b + generation_id: 863a782d-b3e6-4b93-9bdf-5cb094c9eb27 + pristine_commit_hash: 01e8c05f045a03e91fb1d6a83a36b0c7031de461 + pristine_tree_hash: 75448e033e5b49ab1db1263a7f2652013d0aa043 features: go: acceptHeaders: 2.81.2 @@ -73,8 +73,8 @@ trackedFiles: pristine_git_object: 9c4d301118236a7c81e8b0fffb6e387ed59361c2 agents.go: id: 148cd435d94c - last_write_checksum: sha1:65d409ead0e8b8370cb1daacc2d353bbcbc08e20 - pristine_git_object: 0fa790eca6027dd7209460a25b775e9a8938e932 + last_write_checksum: sha1:84f6745847f4790b167ddb07e869f88c079b3491 + pristine_git_object: 106f2f98ca9006abd4fa01c5f5a9a3a293091af1 announcements.go: id: 5da39fbc3664 last_write_checksum: sha1:40db85bb384db08da04661a1524793d3f827d903 @@ -1011,6 +1011,10 @@ trackedFiles: id: 57c23eb39f0f last_write_checksum: sha1:3cf760218b084013dd2ae5ea0d38f18d45e3802c pristine_git_object: d94af6b4bf02ff85831d7a93fd18a7d16f9f3969 + docs/models/components/decision.md: + id: 7556720b8112 + last_write_checksum: sha1:ab6270b5fc84659d4ab22d3f0d3f447d3b151f65 + pristine_git_object: 9f532b7cdcf422275e5650883fca5b4f5022ac7c docs/models/components/deleteannouncementrequest.md: id: 2505cfa5ef29 last_write_checksum: sha1:481fe407f3e2f1eca32c6edbdd7691e0b1fbdfe0 @@ -1319,6 +1323,10 @@ trackedFiles: id: 445fa998586d last_write_checksum: sha1:44cc6f46f527f26addb32824ad42a2768101a45d pristine_git_object: 775c53beb9d28f79404be6f89bc2e0b5004d2a30 + docs/models/components/executionmode.md: + id: b048e1e1962a + last_write_checksum: sha1:6b6ee292cf66833d5d9aa823503592ca1d5425bf + pristine_git_object: dbb86ac3764e59c00af1e86ec0b9d2b3358e65f8 docs/models/components/exportinfo.md: id: 7b4a50bf6885 last_write_checksum: sha1:63edd4429aed11cd7ce4c33db92d0ffa4f2d9cd2 @@ -1405,8 +1413,8 @@ trackedFiles: pristine_git_object: c8e4adbb9259788d825acac24b08c9cd9afca960 docs/models/components/feedrequestcategory.md: id: 801f1c3c64d4 - last_write_checksum: sha1:6c2c7d3084a4f7180d718aa113a756e0114a8a17 - pristine_git_object: 600e92c9ecd06adfffc86c2c45bc7ec0138cc57a + last_write_checksum: sha1:b8310ae0ac8b9588c4a6228d8bcfc9b490efe9ac + pristine_git_object: d62f5c32b8392a549c4782408b670e509bc07579 docs/models/components/feedrequestoptions.md: id: 76c5e4412304 last_write_checksum: sha1:674915ceaa3b9eec9d9543dc9f0e6a85b394174e @@ -1421,8 +1429,8 @@ trackedFiles: pristine_git_object: 86a3734a33e235d580f920fc6402a48ecfaaf1b4 docs/models/components/feedresultcategory.md: id: 94c0249352b4 - last_write_checksum: sha1:d074d45bc8a31484273e50046ff75401f95fb16d - pristine_git_object: 9fbcbe072f0f559fcb975324ad04b9a04cbddc14 + last_write_checksum: sha1:866280540c83d3a32e18a6ec2e1cdef36bb77d65 + pristine_git_object: 9135724ee179218e1cfba360f144c6d3f27dbe77 docs/models/components/fieldscope.md: id: 23caffb85bb7 last_write_checksum: sha1:65cdffa9b7bf28a760c906f49dc7417f37b9e56f @@ -1757,8 +1765,8 @@ trackedFiles: pristine_git_object: 229c8af1dcde17c3b4507889380258a7d2bb939d docs/models/components/justificationtype.md: id: 5a15880767a5 - last_write_checksum: sha1:df8d3ed19002a00708209f0aa2edeffd0edc93fc - pristine_git_object: bb1dd31bd08dc3e1b514e68d80b1370478d1318b + last_write_checksum: sha1:717cb9ce6a88e15d03dc348ffb006fd2a6e3cd86 + pristine_git_object: 172b7300d9765c00eff62e0885bd168001ee2e62 docs/models/components/knowledgetype.md: id: cf27a7cefa69 last_write_checksum: sha1:f7294d6350e558a0a626ac41241ccbf0facacf10 @@ -2071,10 +2079,42 @@ trackedFiles: id: 2623b503a857 last_write_checksum: sha1:50179d43e85d31722c5b7ac82546324bd4a47532 pristine_git_object: 221cdf9e3f066adaa7054359fbf1663850963c6f + docs/models/components/platformagentrunapprovaldecision.md: + id: 649b621b14e2 + last_write_checksum: sha1:03c6d2e994601b4eac6255d52f4efe499b37eea6 + pristine_git_object: caf4cddfb5924443592448f275400dc73c30d0d8 + docs/models/components/platformagentruncancellationrequest.md: + id: cec33967833e + last_write_checksum: sha1:e25325a5ed37cd8dcd2040a1c4bcc647a6df2c9c + pristine_git_object: f892989771bd12cc362df37e1d2f1ef05cb48838 docs/models/components/platformagentruncreaterequest.md: id: ad098fb679da - last_write_checksum: sha1:627225812d316549e4e618bb103cae7ab2326bd2 - pristine_git_object: ee828f9fcd09ddeea137c6001864e0a8134a3854 + last_write_checksum: sha1:90f16832b9aa57e0d5dcbe632518f51fda48ad4c + pristine_git_object: 48a297bb5b937a3a81a57168de2d870f9fa82799 + docs/models/components/platformagentrunerror.md: + id: 0e3dd8d17013 + last_write_checksum: sha1:4171b09a338e8e3df6a0e5f69434f4e23570531f + pristine_git_object: 27075f5f9818e1f037f36e64b6dbda533f16a813 + docs/models/components/platformagentrunresponse.md: + id: 833fcfdb1aaf + last_write_checksum: sha1:5aa7f66883546350871d6269e1d8b4820469fa47 + pristine_git_object: 78e99b3f8ddd7b5b50692b39adf7d8c7eea1a43f + docs/models/components/platformagentrunresponsesrequest.md: + id: a11eb5e7dd59 + last_write_checksum: sha1:89ded8847975a94142a40b49b9541479350193f7 + pristine_git_object: d31673f002e86e5ecdd5774dee5960ae951c1c6e + docs/models/components/platformagentrunstate.md: + id: 6870c89b0b95 + last_write_checksum: sha1:a6fc0889d914c8a3f2552ac1e399bdc0c3c8d61c + pristine_git_object: fe897db6d3633509868c3d575b75e3a9f5081696 + docs/models/components/platformagentruntoolapproval.md: + id: 83826de1dc3c + last_write_checksum: sha1:a57e9c1b215d6b339525ce7c3516ac6f298b6ed4 + pristine_git_object: 53878151762774eb44d591b01844abea09a049c1 + docs/models/components/platformagentruntoolapprovaltype.md: + id: edcbfd54e97f + last_write_checksum: sha1:8fed0f4f7bf1e976536994e8dc0138458abe3336 + pristine_git_object: c713b366c39b0378f15c2a415dd2b35130a640ba docs/models/components/platformagentrunwaitresponse.md: id: 5a1e78680e6a last_write_checksum: sha1:7b3292aef782f7ff140e322330338c0d7e61c595 @@ -2179,6 +2219,14 @@ trackedFiles: id: d433e7bbef35 last_write_checksum: sha1:96ba61d8e70c8bf65248cabc8e87da18f25e2443 pristine_git_object: 96b25bc9714c603b63a073911e4993616a0c9623 + docs/models/components/platformchatjsonschemaformat.md: + id: 2c0f3b566ae6 + last_write_checksum: sha1:7c4c346d2a2906749617beee19c0a51c73324230 + pristine_git_object: bdc1ee4376f0ed67a80dade1e4cdf0d16df374a4 + docs/models/components/platformchatjsonschemaformattype.md: + id: 6daac227dfba + last_write_checksum: sha1:eec93622bb67b54e28e4a2c818f0dda901ce0348 + pristine_git_object: eb58f922927ff6b51427184ddb2e8682cc4c8247 docs/models/components/platformchatoutputmessage.md: id: 06f5e11e058a last_write_checksum: sha1:73ffe24339285866a2bb28a600c320c92ceaa70d @@ -2193,8 +2241,8 @@ trackedFiles: pristine_git_object: 33fa46bceab6eba07b946cda7b5f4558bb23c7c2 docs/models/components/platformchatoutputtextcontent.md: id: 41ecc87e478f - last_write_checksum: sha1:ff82c2a42a0e4a9fcee99eac25ae1645e1324a62 - pristine_git_object: 6c9f40393cb6c57b3b052c04842d7575a1db8372 + last_write_checksum: sha1:b61efa6fecd4d81d45fac1681744e0e484ae7302 + pristine_git_object: 9c31be646e03ca18254e5e51fe77783d5e41a10c docs/models/components/platformchatoutputtextcontenttype.md: id: 12dc2e11fdf6 last_write_checksum: sha1:c88f6b705823a0493f4b5946fd9e8a144f2afc98 @@ -2287,6 +2335,14 @@ trackedFiles: id: 2d12925cd635 last_write_checksum: sha1:6469e7ab79a9f99521c8ff46d277d00fa4290e09 pristine_git_object: 21c9a72827392fc8a9cf718c0031995ccd1bb123 + docs/models/components/platformchattextformat.md: + id: e5fc35b91179 + last_write_checksum: sha1:d1220ad3f886d769e84b9f45bb4a60e74d77109f + pristine_git_object: 53194c3826466a11afd910f131172e5782dcfd44 + docs/models/components/platformchattextformattype.md: + id: 08be4e855c9e + last_write_checksum: sha1:ce2a820d3efee2524da98f001f8d8e866a1aa07b + pristine_git_object: 7809722c5b67d292b5b1915929733b38384401de docs/models/components/platformcontentschedulewebhookevent.md: id: 889cf2a8f5f3 last_write_checksum: sha1:f45849d9475e8469e5f1fb4227442b09fe29ca57 @@ -2303,6 +2359,10 @@ trackedFiles: id: a9c5d462f657 last_write_checksum: sha1:da017c178fad90c4bc9874cfb9712d55b0b31424 pristine_git_object: f6ecd25db1d046fa947157eae5a665178eade0c9 + docs/models/components/platformdurableagentrun.md: + id: b4bf0f58bc45 + last_write_checksum: sha1:81ae8715ae1c8876a8724ba11c0ad25f6d0f6902 + pristine_git_object: 2f2d20dea3c342ba9dc62fff14cb068a5f7f3aca docs/models/components/platformfilter.md: id: 97ac5bc59c2c last_write_checksum: sha1:a494626c2bffdca982c62513ae59162808dd51d3 @@ -2943,6 +3003,10 @@ trackedFiles: id: 6f79f182392b last_write_checksum: sha1:8735edc61426456a59165d84deb63005859da9e6 pristine_git_object: 60da51a750b46810d1ebd29c58d53449c011181c + docs/models/components/structuredoutput.md: + id: ca8639e22ee5 + last_write_checksum: sha1:0fefd8718435f3a6ea2372819a35db97ec6927a3 + pristine_git_object: 45e8ab02d1f563d01c5045ae21340c61bd259a2d docs/models/components/structuredresult.md: id: e48e5e4cdd13 last_write_checksum: sha1:55763c7e2e012a891f3ac5fa580298abc1a28a29 @@ -3927,14 +3991,30 @@ trackedFiles: id: 6b2c24781086 last_write_checksum: sha1:b08915936cacc45d7c057bbb71b65116064b9ad2 pristine_git_object: 6077b6e72612d535b72ae2fafe6875eb6e701884 + docs/models/operations/platformagentscancelrunrequest.md: + id: 3b8be7d1f644 + last_write_checksum: sha1:a87635fc12f19524dda912dc075d6e654a910f58 + pristine_git_object: 396b860ad773dbd618cd9f647fb975c06a3bc306 + docs/models/operations/platformagentscancelrunresponse.md: + id: 0b0d63bd73e3 + last_write_checksum: sha1:59eb5369546791e592570c06865bcedef8cfb133 + pristine_git_object: 9a18819c253dd39d1a3d46d6377f7cb5d8e48de6 docs/models/operations/platformagentscreaterunrequest.md: id: "388574933310" last_write_checksum: sha1:c457411bf5b3f0d9c7f62ef18bf3eb7a7267191f pristine_git_object: 0e8fb866a8ea8643804f0807958c393d497ae4d7 docs/models/operations/platformagentscreaterunresponse.md: id: aa686cb7fdf0 - last_write_checksum: sha1:605b43f6e9ed9c6d439248e64737cd7bf4c30e48 - pristine_git_object: b556283cfeee3a10e45e579ca57ed7f651577aff + last_write_checksum: sha1:ffb875128ab1926821ad7ad30a068328e9270a04 + pristine_git_object: 23270fe111e6024e522faa2ae599e204fd2ddbcd + docs/models/operations/platformagentscreaterunresponsesrequest.md: + id: 4a56b845a1b0 + last_write_checksum: sha1:afd89b1d492efbb79ab38973ae1ff073846cdbff + pristine_git_object: c0003b18c26a9597aa69a4bbda638d68dcbb38f7 + docs/models/operations/platformagentscreaterunresponsesresponse.md: + id: f94714555866 + last_write_checksum: sha1:6a2d7411e19ff15d51fdb0bf8b8b4e12fb7a52e3 + pristine_git_object: 154ce807a1423fd43c96c1e22fad866cce4148a8 docs/models/operations/platformagentsgetrequest.md: id: 706ad4a6bd32 last_write_checksum: sha1:aa9b6e618bcc3144d2e4f10fd1ef40f2da62d879 @@ -3943,6 +4023,14 @@ trackedFiles: id: c3c9765f3dbc last_write_checksum: sha1:77efea6fdc983f1ccb58327efc9681210e113119 pristine_git_object: a75818418d84e35ea42377c6deb30abffb189d14 + docs/models/operations/platformagentsgetrunrequest.md: + id: 390cf892ae0a + last_write_checksum: sha1:8f7d07a636681c368994b2aec7fa767f7b90f3cb + pristine_git_object: fd58e8f1d35fcc6e8f7f7e193bb0d1979ae03f78 + docs/models/operations/platformagentsgetrunresponse.md: + id: ee5cf7632835 + last_write_checksum: sha1:843d25d9838e188ff4e9c24f6f0ef6c956d78ff4 + pristine_git_object: 9c4d88db9e4445de07e63b1940fa0ef2d9a2b7c3 docs/models/operations/platformagentsgetschemasrequest.md: id: 58d615b7c78f last_write_checksum: sha1:1634b04a8ff20c6a4ab8f80708eaa80f3f974de1 @@ -3955,30 +4043,46 @@ trackedFiles: id: 5d2bbcca598b last_write_checksum: sha1:8a3081593f15a1812e169bfa2a8c0cce9e2b26d7 pristine_git_object: 0d1b6420ee4b3ec4c73562ec84f114cbf12cfda2 + docs/models/operations/platformchatcreateformat.md: + id: f472fd6ab7ef + last_write_checksum: sha1:0d4c7723b7f3577260783f6a6afc21be86cc2377 + pristine_git_object: 477a77ee6681d5195c5ffb154ad932d6b4876191 docs/models/operations/platformchatcreateinput.md: id: 30dd49c63c34 last_write_checksum: sha1:740e992cfc0b9a59b9de9c29245cbea208ccf4f9 pristine_git_object: 75527c74b0e3064240c1cb821603c3634e0587e6 docs/models/operations/platformchatcreaterequest.md: id: e3b4683f75d8 - last_write_checksum: sha1:90f2538ec367b7d94a10f66e53a66711dd5eb0b4 - pristine_git_object: 2741f2e57d33d8eaef96b87d64e026c7d67a9db4 + last_write_checksum: sha1:9f90237c1db125439a8f947e910e31b4845e32aa + pristine_git_object: cf9312cc3372ef538a57ea9148f46f2c656f74ee docs/models/operations/platformchatcreateresponse.md: id: 44dd0bebd3e0 last_write_checksum: sha1:c199be9376c87946a95f722d76bf1cbe1cee0f7f pristine_git_object: 59916df907d2170456595f61bbefd2cb5e0b1905 + docs/models/operations/platformchatcreatestreamformat.md: + id: 9f0d72f05096 + last_write_checksum: sha1:38010b3a06f448660e04b72fee46643eaa3ad4d8 + pristine_git_object: 745f4030dc37797b77af7e11af4685577806718f docs/models/operations/platformchatcreatestreaminput.md: id: 4282b848314f last_write_checksum: sha1:3e04b9c840357296336d1e9f95cb23b17be905c3 pristine_git_object: 85f27bb98da0e0f76043ea3b1be3b24d57985fde docs/models/operations/platformchatcreatestreamrequest.md: id: bf073c591777 - last_write_checksum: sha1:b343c7acae4877bd416c171685f6a0b53b09831f - pristine_git_object: 45090306ad2fd497442c6b4c75d6e138a1c83614 + last_write_checksum: sha1:0315a8ab75a99922f9a42132cc413d3b0980c606 + pristine_git_object: 2e0dc61fc333ef8d15964fa0f33b581bb48a958b docs/models/operations/platformchatcreatestreamresponse.md: id: 93f28a75abac last_write_checksum: sha1:373f206501f4b002de874437ce3b599400fc2ab2 pristine_git_object: 55e735d2c3618f4ad8d7bc9e605131a37ab5247f + docs/models/operations/platformchatcreatestreamtext.md: + id: 5e6e2b9eeb59 + last_write_checksum: sha1:9db9889bedaffbe87e716667af11d305c7760c6c + pristine_git_object: 4359c98a12ac704b8dcc80bde6d24060772e701e + docs/models/operations/platformchatcreatetext.md: + id: 419ceefc2ea7 + last_write_checksum: sha1:ebccb75913de6a19bf2fd37d26ac96ac4163b8b0 + pristine_git_object: 3d060170a6477f681b729a5f2684006bb865e143 docs/models/operations/platformsearchfiltersrequest.md: id: fb15f593735d last_write_checksum: sha1:c13cb4e9d601b04cbbdcc315a4651fc95465ad11 @@ -4477,8 +4581,8 @@ trackedFiles: pristine_git_object: 018ef72bf766f3a72131d0539b29ae19162b8c75 docs/sdks/agents/README.md: id: 5965d8232fd8 - last_write_checksum: sha1:696e8b906d2c55639cd4843128ef2d1b4c1a79e5 - pristine_git_object: 56d12e3f930b4a291960b8b47033b8a1a091d5a2 + last_write_checksum: sha1:4ccc0734426829354be67697e5c7c07b2caa037d + pristine_git_object: af8dc6cf788a80d5392b729207559d1a8f5e575f docs/sdks/announcements/README.md: id: 3d2e130a217c last_write_checksum: sha1:97d528dc357f375132308cb8343e29e151f0ffa1 @@ -4489,8 +4593,8 @@ trackedFiles: pristine_git_object: eb3586c19afd9dfda47ca746441495da0473be29 docs/sdks/chat/README.md: id: 393193527c2c - last_write_checksum: sha1:2dfaed593102d4be6bb4a8f7ed6dfceff65457f7 - pristine_git_object: a967e8840e00d43887ee16e00407a46fd8bfd12e + last_write_checksum: sha1:968ff8d6503a3dcab124c68f4a185d12a51fba32 + pristine_git_object: c953510466409aa34c441ed6bbbdd65e6196e0a0 docs/sdks/clientagents/README.md: id: 8e00e6d6b64e last_write_checksum: sha1:1c55b753752a361bf1e78a079dd3368800327811 @@ -4621,8 +4725,8 @@ trackedFiles: pristine_git_object: a3cb3e5448f3fdcfad77ed2a4ba47ae848d5cd5d glean.go: id: f5ed099b8e85 - last_write_checksum: sha1:ac1bd3efa372e216e07791621d4a486de085ea13 - pristine_git_object: ddc49b20f51b84f3b320ab7f5f8264fdffa08bf3 + last_write_checksum: sha1:3038c00dfed9cf6af92ad1c55fd9284071ec4b96 + pristine_git_object: 1de99baf2233c86ac3de18fa504f4abff0f198f5 go.mod: id: c47645c391ad last_write_checksum: sha1:cf65a2c96e303858d4cf70e07d4c44d3f1c1db38 @@ -5709,12 +5813,12 @@ trackedFiles: pristine_git_object: 220dbff76d0d3d12e6bdcb05787a6df030124ca5 models/components/feedentry.go: id: 2826af1aa01a - last_write_checksum: sha1:1111a6323d6c9b70b6ea5e0643fc99960121a68e - pristine_git_object: 86228c48db84a2b3a6a84bec354909ad7002565d + last_write_checksum: sha1:1333e4c4f56b8613298657ec14ada1f04eea8fbc + pristine_git_object: 41628c63744d4832553d5f0f7db8e1eac3324a2d models/components/feedrequest.go: id: 9f0a682fc981 - last_write_checksum: sha1:55f3ff5d588d9aced47cacfba91e1f214fe9888d - pristine_git_object: bee5b0e19a8cc17e51982fce00f52de2915f8984 + last_write_checksum: sha1:c59ecc919a3f4f7408e446dfca09fd08e5d545e4 + pristine_git_object: 2b2692b2670501facc6b3e91a72b24d8e6967b6b models/components/feedrequestoptions.go: id: a56c104c989d last_write_checksum: sha1:7f238a9abb079c78202b1a9f65c87b82420f63ec @@ -5725,8 +5829,8 @@ trackedFiles: pristine_git_object: 60cb4b19cbb9bd29e37128e3110b2bf0a8f80d30 models/components/feedresult.go: id: f017ac6e3ac3 - last_write_checksum: sha1:7fcccb99106914485f938f6c7ea3f7ec22281e2d - pristine_git_object: 36b351704471d2b3230a09222003a9021c8d6fc1 + last_write_checksum: sha1:4304735a71fa98d003b6bfe1a742d0a617f0a65f + pristine_git_object: 55ef73935786dc6cb8dbde4393a3c6168f2be96f models/components/followupaction.go: id: aba266d23418 last_write_checksum: sha1:0a17407e6beba30680e5c38151e426a5ce7aab76 @@ -6215,10 +6319,38 @@ trackedFiles: id: bf1f26400d1e last_write_checksum: sha1:be677c65b00a137f18cac6f355af4dfa195c55f4 pristine_git_object: 14050d3cdb84c8883f47e264596c80bcfccd55fa + models/components/platformagentrunapprovaldecision.go: + id: 8067d609d0fc + last_write_checksum: sha1:cfffa8c7af95679f50fcb33f23911abacf9c6df6 + pristine_git_object: ee17b58c30f35c469566e60050bc7a07401fc4d4 + models/components/platformagentruncancellationrequest.go: + id: 3c54cb1c58f3 + last_write_checksum: sha1:4508fc06adf7ca4d7c0d12758c7198127ab11cf7 + pristine_git_object: 7fd15acf0cd1c841762d27455ee39b2ed97a51f2 models/components/platformagentruncreaterequest.go: id: d6155d4018cd - last_write_checksum: sha1:a25246c245d940a649ee88008c0ed82a8356d128 - pristine_git_object: c73076110bd9b7fd4ef84a2b5974afac00fb6226 + last_write_checksum: sha1:ac3eba3f8f4ee17a49348050fa8ea367a900a3a6 + pristine_git_object: 1b770122fb39a58bd7186cb33c50382fcbe66480 + models/components/platformagentrunerror.go: + id: f90834e4f743 + last_write_checksum: sha1:f6e130c1624bc894046785c6a3a4d256a54e6964 + pristine_git_object: 5bd6076823e19ef0a3b92f4a7049b125b6a9a89e + models/components/platformagentrunresponse.go: + id: ce826e2e702c + last_write_checksum: sha1:f4d326ee6175bbee9190f6623846072dcc74646a + pristine_git_object: e929b7951a7af8a8ea5615ed0ec848f9718f3e74 + models/components/platformagentrunresponsesrequest.go: + id: 08f4e6c365f7 + last_write_checksum: sha1:1b2fa2974916b9d03c9108c272bc6729d429e585 + pristine_git_object: 22e29a2294b5b55205f5eb04479f2df22f9696f2 + models/components/platformagentrunstate.go: + id: c0d5e4f99db0 + last_write_checksum: sha1:1d74537825b462bc7f19fb919c86a8ae222463e6 + pristine_git_object: 7369bc41e392acb396e7912e1fc9e7898183af63 + models/components/platformagentruntoolapproval.go: + id: b157c419b893 + last_write_checksum: sha1:47cb7d397898fbc97bb28880cb01ea3ae1e6a83c + pristine_git_object: 5c13cbdb02624f188b090230e2a2f7d22dc297d3 models/components/platformagentrunwaitresponse.go: id: b2a989acac2b last_write_checksum: sha1:0b2f1b15efd8fb833ce1be928ebf0d93207effae @@ -6275,14 +6407,18 @@ trackedFiles: id: 577974bd3a40 last_write_checksum: sha1:1c4e4ef333e9e507ebcce9318b02ff48941db332 pristine_git_object: 18221040a6701124b81f121e36ac3b25d7d10b9a + models/components/platformchatjsonschemaformat.go: + id: c9fcfc223460 + last_write_checksum: sha1:2846d87155a2dd02c6a4884fc6c8b8fb9be814e9 + pristine_git_object: 08394674b02997b4d2864213a69f1eafa864a28c models/components/platformchatoutputmessage.go: id: c04115e996ec last_write_checksum: sha1:9321fdec6aa6e947adcc7425bb9245825661a754 pristine_git_object: 87b675c90c58d28a5ca8093ced2faf984f93d82e models/components/platformchatoutputtextcontent.go: id: e6c4b8aa2653 - last_write_checksum: sha1:51425f43988af175b21dd43620015e39c827360e - pristine_git_object: 80419d110ae5634930bcc04adafd8b3674b73ea6 + last_write_checksum: sha1:fabf9b9561cc4cb05292329a894d248187f7258b + pristine_git_object: 920248ed7dfb3aac83887c0457df0e696def09dd models/components/platformchatpersonsource.go: id: 38616021af6a last_write_checksum: sha1:d7511cd57b585803f0797dd17917d7c3e7a219e7 @@ -6343,6 +6479,10 @@ trackedFiles: id: 9da067dfcdeb last_write_checksum: sha1:2ed43b962c233d947dde6098bee0ff86651d6363 pristine_git_object: e164209bd5f77d9f2d6ed57ac2cce6b37d3a6bec + models/components/platformchattextformat.go: + id: 639aa9e822e0 + last_write_checksum: sha1:823d8df9f696bbfeba0a3dd79778eed342e2226f + pristine_git_object: 99899176af87d11f47f1d5b6f4afe89dcb58ccd7 models/components/platformcontentschedulewebhookevent.go: id: adbbe4c6b378 last_write_checksum: sha1:ee7ba967c1c07210b1c3a031778e7417313c58bc @@ -6359,6 +6499,10 @@ trackedFiles: id: b89aac2687a9 last_write_checksum: sha1:c10a1e2448213c920b1bc4f72473e5d75d022c89 pristine_git_object: 4dccb7a482ac6a471561ebea730079233597cd64 + models/components/platformdurableagentrun.go: + id: 8de84b28b5f0 + last_write_checksum: sha1:84d100bf66545e0879c292e7e3b23670f3663d22 + pristine_git_object: ad3e18c58336fe3629eb3c2bee8851b4070d0c81 models/components/platformfilter.go: id: a50e32890c64 last_write_checksum: sha1:f7195ed299e25135e21b473e01e8ca8696e7d04b @@ -7511,14 +7655,26 @@ trackedFiles: id: 06c4e62c7e7e last_write_checksum: sha1:1c83c1577be79e580865fb55fa690c062d87b2be pristine_git_object: 29ba7f18aeff70e7af37590b4c22c6848bc9aacf + models/operations/platformagentscancelrun.go: + id: c8b5dfced589 + last_write_checksum: sha1:74018babd71c43fb241055e3cfa17aad796ee82f + pristine_git_object: 8045e13b47dc1c27db2e0a844d65112f7c410aa2 models/operations/platformagentscreaterun.go: id: 1fc8613e236d - last_write_checksum: sha1:67b9ae1a213f0eb3c79dea6e0d4f3d88f625ddf3 - pristine_git_object: 1dc8933becef11a11caff573bcd4a094ff3d228f + last_write_checksum: sha1:5537289b2bd742c94bf67ceb1b17ee947705b39c + pristine_git_object: 46ca8679730053dbaa7b96f1fcfe49319adbd158 + models/operations/platformagentscreaterunresponses.go: + id: 6a79f96cb143 + last_write_checksum: sha1:67ad175c40f715394aa7be944584dae4c878e55b + pristine_git_object: 43e1bae7f32ceea10570ac6fddc7b52d16019035 models/operations/platformagentsget.go: id: 8431a1222a2d last_write_checksum: sha1:797a5afaf403816cba54294291f66508559c4608 pristine_git_object: a35f0b31d16f7a5343f3e99938524587cad28022 + models/operations/platformagentsgetrun.go: + id: 3c96a18c6bc1 + last_write_checksum: sha1:6f56ba44f9dde1ee5bff3790ec17ca135548317a + pristine_git_object: 38e5bfc88c3ade9deab38058bcb4719c38a4dbbe models/operations/platformagentsgetschemas.go: id: 97ca789bb925 last_write_checksum: sha1:93f4741f483d53411d844377487bb0a903f45e82 @@ -7529,12 +7685,12 @@ trackedFiles: pristine_git_object: 1e0880ae25ebe7796f31fa22f3f1af83277e3b8d models/operations/platformchatcreate.go: id: 3dbde8b4a586 - last_write_checksum: sha1:9d990ab0265a9b22a4fd2a165d64c242d3aedb31 - pristine_git_object: 11ab8620b986fc17b691095deca28089f3fae0cf + last_write_checksum: sha1:4b676fa4527dc14d4c0e296e5150e4a3fd2b5822 + pristine_git_object: 0e093a18b43159de33c6459dd7505b6f750f267c models/operations/platformchatcreatestream.go: id: 5fad7b2f2198 - last_write_checksum: sha1:ea2873d2fc60303ec51d2e706d1f7f23100ef5d5 - pristine_git_object: 919107615ce66b094f172814d34984796666913c + last_write_checksum: sha1:5f2a27def59eaffe8000d808ea9a4f5a66ad3d98 + pristine_git_object: c10eeeb6dfe841d7a2f11ae396730602ebd4b9b4 models/operations/platformsearch.go: id: 875844d95a55 last_write_checksum: sha1:af90d019e81b20bba89e2c676cbd115dbba6fa12 @@ -7905,8 +8061,8 @@ trackedFiles: pristine_git_object: e01e64d74275c548227d1230509ec9bc80bcc4ee tests/agents_test.go: id: 8512a40a0375 - last_write_checksum: sha1:7320ee3a251911e37751d0aa3738e2bdddaf0d0f - pristine_git_object: 5a3e9abac864684624246db6b2c314f37e8f55c7 + last_write_checksum: sha1:6f9577acf987073c871026b4a6c09902160fa3e8 + pristine_git_object: 09d4517818e07c78acaed0b65351409a99dcf5d6 tests/announcements_test.go: id: 983abc2e09c3 last_write_checksum: sha1:cb5b57a0d61b67a848b2e21a1e4435b8f995a72e @@ -7921,8 +8077,8 @@ trackedFiles: pristine_git_object: 294a7750becac3a4f3871f1d5860701efb00fe90 tests/chat_test.go: id: 7bb6349174a9 - last_write_checksum: sha1:7808128272355f0480b8a62f7739f9dae28986b5 - pristine_git_object: 45c015c4ea410dd35bf3f152c50d47804a3a9c71 + last_write_checksum: sha1:cd17570d0325bfdc7ff6b6d0302c2a555c44e30c + pristine_git_object: 9dc328647d3c2666aaaba529ca3944f7b582df9f tests/clientactivity_test.go: id: a9737434a9ce last_write_checksum: sha1:02ee2359e784247291c5bec183d5c724f335c0d2 @@ -8009,8 +8165,8 @@ trackedFiles: pristine_git_object: 6d9cbca42012c2760de3ecaf4f569c53d32197da tests/messages_test.go: id: 3433c956b7a3 - last_write_checksum: sha1:352ecfa3a01795bbe7fad9b0202c4ccaa02448c3 - pristine_git_object: 64ef64fe1c0ccbc223987d87ddddf3d6e2de7799 + last_write_checksum: sha1:63e7b1c9a68b43467855286635a88cb166b2bc79 + pristine_git_object: febdc0e8a34b769bfc6dcfe3a9e33053b2267433 tests/mockserver/.gitignore: id: 7705eb663274 last_write_checksum: sha1:228e1b05712a973948fd771323a2140a3b355ff4 @@ -8065,8 +8221,8 @@ trackedFiles: pristine_git_object: 929558ef2e1165f7e09da6d0a64f016c90971655 tests/mockserver/internal/handler/generated_handlers.go: id: 61ac4f7cce9e - last_write_checksum: sha1:6b77f36c3b3dc12b960b49941ee55263a0a6c05f - pristine_git_object: 8e541a71eba67ec8fd003759038b2b1ec43d6ab9 + last_write_checksum: sha1:76b084b327cf42ef0df8fc6100203c03d8fa6562 + pristine_git_object: 0bea5676f41873a3d0f0fe7ce14292bf5bf4455e tests/mockserver/internal/handler/pathdeleterestapiindexcustommetadataschemagroupname.go: id: 979e4583765b last_write_checksum: sha1:b1d4edb259d907c7a88b634bf16f0cf152321693 @@ -8079,6 +8235,10 @@ trackedFiles: id: 118e0c46ba00 last_write_checksum: sha1:8ad0cc0ad413e34c3d950ee07ccd13ce861a261b pristine_git_object: 821cdaf9e7e105e44baf2fb6c2352df5c5bd20f7 + tests/mockserver/internal/handler/pathgetapiagentsagentidrunsrunid.go: + id: 475b833c9801 + last_write_checksum: sha1:2d7a9ed6338061ad7eb2f9e2e309024d30adbbeb + pristine_git_object: ef533289ca2dda616beb7d43c16b5f6bc93f070e tests/mockserver/internal/handler/pathgetapiagentsagentidschemas.go: id: a3a921765081 last_write_checksum: sha1:41dfbc3d70153e24cc2a898336d7d2a9c6e3d3df @@ -8199,6 +8359,14 @@ trackedFiles: id: 24dd79d2c474 last_write_checksum: sha1:14d3e93a3f37b61145188a9e6544398fcfc200e4 pristine_git_object: 40105d8daeb4ec2dd77c36244a4db0e63b847ee1 + tests/mockserver/internal/handler/pathpostapiagentsagentidcancellations.go: + id: c7e3aaed90f3 + last_write_checksum: sha1:6fd6979475ad5d59149eee88cd9b965a4f80f384 + pristine_git_object: 220eecad4f2cff1cf34a06807a9f4155aea09c51 + tests/mockserver/internal/handler/pathpostapiagentsagentidresponses.go: + id: b4e00766ad35 + last_write_checksum: sha1:e96eadc24ca328288e2d43790941eb5dffc25ea2 + pristine_git_object: 39f7cc82122bf8c7e303a3a7f5aac2d8b0a9b08d tests/mockserver/internal/handler/pathpostapiagentsagentidruns.go: id: b038130eb997 last_write_checksum: sha1:badf21e13cd2f0afdc5fd5f325c1a34de39d0107 @@ -9605,12 +9773,12 @@ trackedFiles: pristine_git_object: 04cc3a93272ac70933b0485bee31b335e05ab623 tests/mockserver/internal/sdk/models/components/feedentry.go: id: d25fd66fcf7a - last_write_checksum: sha1:5c737e067de0426319bf913fed08aa7ce31df6ec - pristine_git_object: e84bac4d71b95d2ddc00e376a419422a7f2dd4f9 + last_write_checksum: sha1:f0a0c2321e2aff01b51b21b61df68d95f5ba979f + pristine_git_object: 44f5dfe7632e9ca462176445542fe70166921464 tests/mockserver/internal/sdk/models/components/feedrequest.go: id: b06bc4cef0cf - last_write_checksum: sha1:a33f5163423670d804e9ac093380cd39d2037d84 - pristine_git_object: ea9a683c0d79a52d131d08d5231e438cefde4030 + last_write_checksum: sha1:dba9418e46ca3f7d4fddec08c66623f9771d590d + pristine_git_object: 9489bdd527389d50e3826ebbeedc8de805528e57 tests/mockserver/internal/sdk/models/components/feedrequestoptions.go: id: fd9245fe1bf2 last_write_checksum: sha1:fa30b7fd6ee3e45896d7bbe36e33e7c0cb9000ba @@ -9621,8 +9789,8 @@ trackedFiles: pristine_git_object: 54f9d1a8997983156c84e69f888c59a80d06c2b1 tests/mockserver/internal/sdk/models/components/feedresult.go: id: 47411573e67a - last_write_checksum: sha1:c82f576ebad4b8367fbb6b41492ac30d3e6b202a - pristine_git_object: 6e4408b5a7fc07cebe91bd117fd1b1228878193e + last_write_checksum: sha1:ecef21a7754d70942718bf1dc156a8222c8fa36d + pristine_git_object: 4d9a33d3f245e67bb3d7ace1b5396672c73e236d tests/mockserver/internal/sdk/models/components/followupaction.go: id: 38179fec19b1 last_write_checksum: sha1:32a31f7af77a58ce6f3284e8550d01fcf0d3bddd @@ -10111,10 +10279,38 @@ trackedFiles: id: d12a92c365e5 last_write_checksum: sha1:c39a6b74fe9c30850bf5bedd6827577bf4b56566 pristine_git_object: a3139f71ea2e70673649a36519c072d817d45969 + tests/mockserver/internal/sdk/models/components/platformagentrunapprovaldecision.go: + id: 472aff0ebb8d + last_write_checksum: sha1:4eb74e1cf61f74b4cc97f1fb7b864820f600f59c + pristine_git_object: 81c2c7c43e6947a7daa66df6d6a368e8075ddc70 + tests/mockserver/internal/sdk/models/components/platformagentruncancellationrequest.go: + id: 920f2cf33bbe + last_write_checksum: sha1:50b42e8f29f75fd7c4d69c3961cefcc2173453a4 + pristine_git_object: cfec353b3e8c36971f1b9964bcb353a2043bed91 tests/mockserver/internal/sdk/models/components/platformagentruncreaterequest.go: id: 77a686bb0b6e - last_write_checksum: sha1:c2becf7b5aea9541b963fd98b364c2825c731f27 - pristine_git_object: dfce10e1e21abb00331b48528dd419203790fe99 + last_write_checksum: sha1:7bcf07a397331eef669c52d5976140e16120b07e + pristine_git_object: 42491ee08cea501e4ffbae50f1276f2a823d4488 + tests/mockserver/internal/sdk/models/components/platformagentrunerror.go: + id: 5d83a49f0204 + last_write_checksum: sha1:82e4ff51195529c2d3c991c1ce522666a42e886f + pristine_git_object: da40549acc2e6a75110936f36326b5db2f50d04d + tests/mockserver/internal/sdk/models/components/platformagentrunresponse.go: + id: 365272d4200e + last_write_checksum: sha1:48919051b1f5dd3c2c73cf8bb1ae865c9de00558 + pristine_git_object: 829fc7280a96ddea7f7197e79b73c58a046c2aaa + tests/mockserver/internal/sdk/models/components/platformagentrunresponsesrequest.go: + id: c4599e559808 + last_write_checksum: sha1:68ca0450063110e460235b6f9484b0ec1650e9be + pristine_git_object: 266eca3020df0dd0a14ecfe1bc6e691e4cf57688 + tests/mockserver/internal/sdk/models/components/platformagentrunstate.go: + id: 71c3a486e299 + last_write_checksum: sha1:ceec60790319ece420bc6698c00e746b452b7c7d + pristine_git_object: 76009fe707d99c7bb7c011a6fcf823b3a327ed7a + tests/mockserver/internal/sdk/models/components/platformagentruntoolapproval.go: + id: 616c170e0960 + last_write_checksum: sha1:adf20c65ada399a54ae182e59c60d335eb93b446 + pristine_git_object: 9037db212f8e4e29c57870811de7dba0ec0f559d tests/mockserver/internal/sdk/models/components/platformagentrunwaitresponse.go: id: 368b82c238d0 last_write_checksum: sha1:77ffebf146f2f6f671f10a8ad893f672ee8c67a5 @@ -10171,14 +10367,18 @@ trackedFiles: id: 56818bc51e4c last_write_checksum: sha1:42af3af208da28f93f0f2201e3daa8b46a7e1dba pristine_git_object: 97c1e067fb5ecb6b2f97606419d967243488f520 + tests/mockserver/internal/sdk/models/components/platformchatjsonschemaformat.go: + id: cc1306c208a9 + last_write_checksum: sha1:527ce820f2fb0f577db45b4e8606a75e30972a35 + pristine_git_object: c4d9b0045f3e0a8916c241e2eb5c74ad087d369e tests/mockserver/internal/sdk/models/components/platformchatoutputmessage.go: id: 7ca1fc5cc683 last_write_checksum: sha1:bf719da0350fbfafdb9b2459c45ec90fdeff26be pristine_git_object: e8c6012073e865db79260a12e8b831b0bdc61be0 tests/mockserver/internal/sdk/models/components/platformchatoutputtextcontent.go: id: b5d5f31f9886 - last_write_checksum: sha1:54300f2566d258c2125b840e17a7697051c02dfa - pristine_git_object: f3be4768043133e7909aca58d1c7f863c74bcecf + last_write_checksum: sha1:fea1f3e8d5792e1a177da5c0daa1d9a345327a4a + pristine_git_object: 098822c3050a5e4b1f4491cfd5a79b4abc982653 tests/mockserver/internal/sdk/models/components/platformchatpersonsource.go: id: b44852860bd9 last_write_checksum: sha1:ae83c0e9521f08d5818d9aa5cff33ca7233239a7 @@ -10239,6 +10439,10 @@ trackedFiles: id: cb4b807c5c50 last_write_checksum: sha1:6cc1fb47210182778dd6dd3a302a118d8c23b73a pristine_git_object: 8aeae90099849c9ecb918ad377780b2d6e8a7b0c + tests/mockserver/internal/sdk/models/components/platformchattextformat.go: + id: 14602a472dd8 + last_write_checksum: sha1:826eb39a034b76967e29dfe3f70f4bec9e0e8135 + pristine_git_object: 2549e7933847138506f468b7a25b926e41956ed5 tests/mockserver/internal/sdk/models/components/platformcontentschedulewebhookevent.go: id: aa997737c72e last_write_checksum: sha1:cf082854fbef3c2fb99b4415f333e65a3e97950a @@ -10255,6 +10459,10 @@ trackedFiles: id: 14cae8b8b46f last_write_checksum: sha1:eeef00ef9e08df054c9f0b37881495b3ddc400c6 pristine_git_object: 790da9be746c8ffb31da4ddd45e70435cae25c20 + tests/mockserver/internal/sdk/models/components/platformdurableagentrun.go: + id: c5a46edb6f15 + last_write_checksum: sha1:458ce005910afe9a31b5d4768d399c7c308ec921 + pristine_git_object: 0e838da68a2022cc3289e7a047b06fd366a35ba4 tests/mockserver/internal/sdk/models/components/platformfilter.go: id: 1762bf95c464 last_write_checksum: sha1:9a4357e8b4ccf75dd97072960321efb36dcf13a1 @@ -11403,14 +11611,26 @@ trackedFiles: id: b553eb9bdb35 last_write_checksum: sha1:5248f738207e7e99637a538c31c57d93394a588c pristine_git_object: d6f74b3f76e41314e5e33934c50f5bd0bda958de + tests/mockserver/internal/sdk/models/operations/platformagentscancelrun.go: + id: 0800b4f494e5 + last_write_checksum: sha1:90d511938d50df74af601cab9ebdfda8aee8ecee + pristine_git_object: 98be8dfce70b036828c4ee0bec59fd229a7bb017 tests/mockserver/internal/sdk/models/operations/platformagentscreaterun.go: id: eb220c44e3e3 - last_write_checksum: sha1:4f2318a6152e1b1d3e4ddf1654202580c600cadc - pristine_git_object: a677b6c1a99819e1ff2ed687039a833c3bc1bead + last_write_checksum: sha1:1ed9b8927c9574064da906ecec60e96ba738cafb + pristine_git_object: 8384192e7d59fd2fbf2e58d89abcb83d0460faa4 + tests/mockserver/internal/sdk/models/operations/platformagentscreaterunresponses.go: + id: 6df59ccad09b + last_write_checksum: sha1:2551ca356b30b61298b18ec5ade2ca93b932fd28 + pristine_git_object: 0676583cb12faab3722897dfd7eaf1f9c82e7d38 tests/mockserver/internal/sdk/models/operations/platformagentsget.go: id: e74910e78a17 last_write_checksum: sha1:56851bbd3fbefcf411fff643accc8124be24b7d2 pristine_git_object: 9b2282ad03704136d35901a9d908e7f554310534 + tests/mockserver/internal/sdk/models/operations/platformagentsgetrun.go: + id: f9201af53484 + last_write_checksum: sha1:5d7ed6d664f5469277666e731cc3597b6c87b637 + pristine_git_object: 51427bc45d662a72c28cb7173da4520958b4b610 tests/mockserver/internal/sdk/models/operations/platformagentsgetschemas.go: id: bf409518e189 last_write_checksum: sha1:767ce5c40fc319d756445283490a4a043213ef84 @@ -11421,12 +11641,12 @@ trackedFiles: pristine_git_object: cdbc9f550e7d2339b0946fe4783a3b79a851f39d tests/mockserver/internal/sdk/models/operations/platformchatcreate.go: id: 38da4ead08a1 - last_write_checksum: sha1:19b0801c6aea2f64707c910040ce0abe0abf0007 - pristine_git_object: c9dbd053cf81d79d52e8f61733224a1b98bbf3c1 + last_write_checksum: sha1:132487da1ca61b58f81bd20d939ffedd7109bb3f + pristine_git_object: 58f6721f458a1908990afc4e4fd18729ac8cfbd4 tests/mockserver/internal/sdk/models/operations/platformchatcreatestream.go: id: 32e8d932ca7e - last_write_checksum: sha1:828c8e37232571f5737fed9c01bcbde3dc856068 - pristine_git_object: d94a54b7ed3d227a61ab2b41f443a8aca9adf755 + last_write_checksum: sha1:1a6315bfac761b2d944e618ecfd6f1cb188b5184 + pristine_git_object: 72e44e52569b6b6fb2337c2652105791315952bf tests/mockserver/internal/sdk/models/operations/platformsearch.go: id: d990791ac101 last_write_checksum: sha1:9da9b49850375b74bf6296fcec336ba9ad1e1eea @@ -11897,8 +12117,8 @@ trackedFiles: pristine_git_object: f6ef683531884725f5107c32848516513f87e494 tests/summarize_test.go: id: 1b63b0a16e69 - last_write_checksum: sha1:f1b596f0a91987ee9dd10c02397efc3da0cb5a4d - pristine_git_object: f09e42ea38a122721f4e8c2773d4d5d5511f3234 + last_write_checksum: sha1:6da9f736fef20def1b16946fe93d02a1c5cb94ec + pristine_git_object: 4bfe1645d67bb70c7dc680bf793b2c4d9ae38d2f tests/testclient.go: id: 78d36c6e169c last_write_checksum: sha1:507c44e437934fbff8d295201c1327e18bd00df8 @@ -12936,7 +13156,7 @@ examples: path: agent_id: "" requestBody: - application/json: {"messages": [{"role": "USER", "content": [{"text": "What is our parental leave policy?", "type": "text"}]}], "stream": false} + application/json: {"messages": [{"role": "USER", "content": [{"text": "What is our parental leave policy?", "type": "text"}]}], "stream": false, "execution_mode": "REQUEST_BOUND"} responses: "200": application/json: {"run": {"agent_id": "", "messages": [{"role": "USER", "content": []}], "status": "error"}, "messages": [{"role": "USER", "content": []}], "request_id": ""} @@ -12947,6 +13167,8 @@ examples: application/problem+json: {"type": "https://developer.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developer.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} "422": application/problem+json: {"type": "https://developers.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developers.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}], "authentication_suggestions": []} + "201": + application/json: {"run": {"run_id": "", "agent_id": "", "state": "REQUIRES_INPUT", "created_at": "2025-06-25T09:13:22.201Z", "updated_at": "2024-01-10T17:12:38.186Z", "pending_interactions": []}, "request_id": ""} platform-search: speakeasy-default-platform-search: requestBody: @@ -13101,7 +13323,7 @@ examples: platform-chat-create: speakeasy-default-platform-chat-create: requestBody: - application/json: {"input": "What is our parental leave policy?", "stream": false, "store": true} + application/json: {"input": "Summarize our parental leave policy as JSON.", "stream": false, "store": true, "text": {"format": {"type": "JSON_SCHEMA", "name": "policy_summary", "schema": {"type": "object", "properties": {"eligible_employees": {"type": "string"}, "duration_weeks": {"type": "integer"}}, "required": ["eligible_employees", "duration_weeks"]}, "strict": true}}} responses: "200": application/json: {"id": "", "object": "RESPONSE", "created_at": "2026-05-19T05:32:52.505Z", "status": "COMPLETED", "output": [{"type": "MESSAGE", "role": "ASSISTANT", "content": [{"type": "OUTPUT_TEXT", "text": ""}]}], "store": false, "request_id": ""} @@ -13328,8 +13550,49 @@ examples: platform-chat-create-stream: speakeasy-default-platform-chat-create-stream: requestBody: - application/json: {"input": "What is our parental leave policy?", "stream": true, "store": true} + application/json: {"input": "Summarize our parental leave policy as JSON.", "stream": true, "store": true, "text": {"format": {"type": "JSON_SCHEMA", "name": "policy_summary", "schema": {"type": "object", "properties": {"eligible_employees": {"type": "string"}, "duration_weeks": {"type": "integer"}}, "required": ["eligible_employees", "duration_weeks"]}, "strict": true}}} + responses: + "400": + application/problem+json: {"type": "https://developers.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developers.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} + "500": + application/problem+json: {"type": "https://developers.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developers.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} + platform-agents-get-run: + speakeasy-default-platform-agents-get-run: + parameters: + path: + agent_id: "{agent_id}" + run_id: "{run_id}" responses: + "200": + application/json: {"run": {"run_id": "", "agent_id": "", "state": "CANCELLING", "created_at": "2025-02-20T06:37:06.101Z", "updated_at": "2025-06-13T07:24:18.599Z", "pending_interactions": []}, "request_id": ""} + "400": + application/problem+json: {"type": "https://developers.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developers.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} + "500": + application/problem+json: {"type": "https://developers.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developers.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} + platform-agents-cancel-run: + speakeasy-default-platform-agents-cancel-run: + parameters: + path: + agent_id: "{agent_id}" + requestBody: + application/json: {"run_id": "{run_id}"} + responses: + "200": + application/json: {"run": {"run_id": "", "agent_id": "", "state": "REQUIRES_INPUT", "created_at": "2026-04-14T14:14:08.916Z", "updated_at": "2025-07-26T12:32:21.659Z", "pending_interactions": []}, "request_id": ""} + "400": + application/problem+json: {"type": "https://developers.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developers.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} + "500": + application/problem+json: {"type": "https://developers.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developers.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} + platform-agents-create-run-responses: + speakeasy-default-platform-agents-create-run-responses: + parameters: + path: + agent_id: "{agent_id}" + requestBody: + application/json: {"run_id": "{run_id}", "responses": [{"interaction_id": "{interaction_id}", "decision": "APPROVE"}]} + responses: + "200": + application/json: {"run": {"run_id": "", "agent_id": "", "state": "QUEUED", "created_at": "2024-08-26T19:05:47.442Z", "updated_at": "2026-08-22T09:50:35.176Z", "pending_interactions": [{"interaction_id": "", "type": "TOOL_APPROVAL", "display_name": "King.Trantow44", "description": "provided collectivization whereas disapprove gah astride under stoop louse", "arguments": {"key": "", "key1": ""}}]}, "request_id": ""} "400": application/problem+json: {"type": "https://developers.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developers.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} "500": @@ -13532,7 +13795,10 @@ generatedTests: platform-trigger-presets-get: "2026-08-21T02:35:39Z" platform-trigger-presets-input-values-list: "2026-08-21T02:35:39Z" platform-trigger-presets-events-search: "2026-08-21T02:35:39Z" -releaseNotes: "## Go SDK Changes:\n* `Glean.Agents.CreateRun()`: `response.Run.Messages[].Content[].Annotations` **Added**\n* `Glean.Client.Agents.Import()`: `request.ImportAgentRequest` **Changed**\n* `Glean.Client.Agents.Run()`: `response.Run.Messages[].Content[].Annotations` **Added**\n* `Glean.Client.Search.RetrieveFeed()`: \n * `request.FeedRequest.Categories[]` **Changed**\n * `response.Results[]` **Changed**\n" + platform-agents-get-run: "2026-09-23T18:30:44Z" + platform-agents-cancel-run: "2026-09-23T18:30:44Z" + platform-agents-create-run-responses: "2026-09-23T18:30:44Z" +releaseNotes: "## Go SDK Changes:\n* `Glean.Agents.CreateRun()`: \n * `request.PlatformAgentRunCreateRequest.ExecutionMode` **Added**\n * `response.status[201]` **Added** (Breaking ⚠️)\n* `Glean.Agents.GetRun()`: **Added**\n* `Glean.Agents.CancelRun()`: **Added**\n* `Glean.Agents.RespondToRun()`: **Added**\n* `Glean.Chat.Create()`: \n * `request.Request.Text` **Added**\n * `response.Output[].Content[].StructuredOutput` **Added**\n* `Glean.Client.Search.RetrieveFeed()`: \n * `request.FeedRequest.Categories[]` **Changed**\n * `response.Results[]` **Changed**\n" generatedFiles: - .devcontainer/README.md - .devcontainer/devcontainer.json diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 416b373f..971e188e 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -32,7 +32,7 @@ generation: generateNewTests: true skipResponseBodyAssertions: true go: - version: 0.15.14 + version: 0.15.15 additionalDependencies: {} allowUnknownFieldsInWeakUnions: false baseErrorName: GleanError diff --git a/.speakeasy/glean-merged-spec.yaml b/.speakeasy/glean-merged-spec.yaml index 7ee55ac5..8ba3d65e 100644 --- a/.speakeasy/glean-merged-spec.yaml +++ b/.speakeasy/glean-merged-spec.yaml @@ -2,8 +2,8 @@ openapi: 3.1.0 info: version: "0.9.0" title: Glean API - x-source-commit-sha: 5f1d873383438dc574c1075f9476915610e56875 - x-open-api-commit-sha: 6a8c8e16bbbca13a130766a72f307fb373b8256a + x-source-commit-sha: 600aa35531e44582cf056cb0531c04e7ec04d472 + x-open-api-commit-sha: c9917479fd934576f376c1f21d0bb426ee4fd46e description: | # Introduction In addition to the data sources that Glean has built-in support for, Glean also provides a REST API that enables customers to put arbitrary content in the search index. This is useful, for example, for doing permissions-aware search over content in internal tools that reside on-prem as well as for searching over applications that Glean does not currently support first class. In addition these APIs allow the customer to push organization data (people info, organization structure etc) into Glean. @@ -179,7 +179,7 @@ paths: - Agents summary: Create agent run description: | - Execute an agent run. Set `stream` to true to receive server-sent events; otherwise the response contains the final agent messages. + Execute an agent run. By default, set `stream` to true to receive server-sent events; otherwise the response contains the final agent messages. Set `execution_mode` to `DURABLE` to persist a new run and return its initial snapshot with HTTP 201 without waiting for execution. Poll the agent-scoped GET run endpoint for progress. Durable execution continues after an HTTP disconnect, but is not automatically resumed after a QE restart or crash. An active turn becomes overdue more than 40 minutes after acceptance (a 30-minute execution timeout plus 10 minutes of grace). The next GET of the run marks the overdue turn FAILED without replay; there is no periodic sweep. Without a GET, the stored run can remain RUNNING. Failure does not prove that external tool work has stopped. Paused runs are not expired; an accepted approval continuation starts a fresh deadline. Each POST creates a new run; retrying a POST can create another execution. Submit pending approval decisions through the run responses endpoint, and cancellation can be requested through the run cancellations endpoint. A run tracks one workflow execution; automatic background-subagent wake turns are separate executions, not continuations tracked by this run ID. operationId: platform-agents-create-run x-visibility: Public x-codegen-request-body-name: payload @@ -214,7 +214,6 @@ paths: id: 1 event: message data: {"messages":[{"role":"GLEAN_AI","content":[{"text":"Hello","type":"text"}]}]} - id: 2 event: message data: {"messages":[{"role":"GLEAN_AI","content":[{"text":", I can help with HR policy questions.","type":"text"}]}]} @@ -222,6 +221,13 @@ paths: id: 3 event: run.failed data: {"error":{"type":"https://developers.glean.com/errors/spend-limit-exceeded","title":"Spend Limit Exceeded","status":403,"detail":"You've reached the monthly limit set by your admin.","code":"spend_limit_exceeded","request_id":"req_123","documentation_url":"https://developers.glean.com/errors/spend-limit-exceeded"}} + "201": + description: | + Durable run persisted and started. The snapshot is immediately retrievable through GET /api/agents/{agent_id}/runs/{run_id}. Execution failures appear in the run state. + content: + application/json: + schema: + $ref: "#/components/schemas/PlatformAgentRunResponse" "400": $ref: "#/components/responses/PlatformBadRequest" "401": @@ -252,6 +258,174 @@ paths: x-speakeasy-name-override: createRun security: - APIToken: [] + /api/agents/{agent_id}/runs/{run_id}: + get: + tags: + - Agents + summary: Get agent run + description: | + Retrieve a persisted workflow execution owned by the authenticated user. The run must belong to the specified agent, and the user must still have access to that agent. Unknown runs, runs owned by another user, and mismatched agent/run identifiers return 404. Requires the agents.run scope. Executions without a persisted workflow record are not available through this endpoint. + operationId: platform-agents-get-run + x-visibility: Public + parameters: + - in: path + name: agent_id + description: ID of the agent that owns the run. + required: true + example: "{agent_id}" + schema: + type: string + minLength: 1 + maxLength: 256 + - in: path + name: run_id + description: ID of the durable run to retrieve. + required: true + example: "{run_id}" + schema: + type: string + minLength: 1 + maxLength: 256 + responses: + "200": + description: Current persisted run snapshot. A failed execution is still a successful retrieval. + content: + application/json: + schema: + $ref: "#/components/schemas/PlatformAgentRunResponse" + "400": + $ref: "#/components/responses/PlatformBadRequest" + "401": + $ref: "#/components/responses/PlatformUnauthorized" + "403": + $ref: "#/components/responses/PlatformForbidden" + "404": + $ref: "#/components/responses/PlatformNotFound" + "408": + $ref: "#/components/responses/PlatformRequestTimeout" + "429": + $ref: "#/components/responses/PlatformTooManyRequests" + "500": + $ref: "#/components/responses/PlatformInternalServerError" + "503": + $ref: "#/components/responses/PlatformServiceUnavailable" + x-speakeasy-group: agents + x-speakeasy-name-override: getRun + security: + - APIToken: [] + /api/agents/{agent_id}/cancellations: + post: + tags: + - Agents + summary: Cancel an agent run + description: | + Request cooperative cancellation of the durable agent run identified by `run_id` in the JSON body. Requires ownership, current agent access, and the agents.run scope. Sending a cancellation signal does not itself change an active run from RUNNING; poll GET run for the final state. Paused runs become CANCELLED without resuming execution. Repeated requests and requests for terminal runs return the current snapshot. Completion may win a race with cancellation. Completed tool side effects cannot be undone, and external work may continue if a tool does not support cancellation. Cancellation targets this run, not separate background-subagent executions. An active run without a cancellation registration returns 409. Cancellation signaling requires Redis. An interrupted active run can instead become FAILED through deadline cleanup; this does not verify that external tool work has stopped. + operationId: platform-agents-cancel-run + x-visibility: Public + x-codegen-request-body-name: payload + parameters: + - in: path + name: agent_id + description: ID of the agent that owns the run. + required: true + example: "{agent_id}" + schema: + type: string + minLength: 1 + maxLength: 256 + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/PlatformAgentRunCancellationRequest" + responses: + "200": + description: Current run snapshot after requesting cancellation, or an unchanged terminal run. + content: + application/json: + schema: + $ref: "#/components/schemas/PlatformAgentRunResponse" + "400": + $ref: "#/components/responses/PlatformBadRequest" + "401": + $ref: "#/components/responses/PlatformUnauthorized" + "403": + $ref: "#/components/responses/PlatformForbidden" + "404": + $ref: "#/components/responses/PlatformNotFound" + "408": + $ref: "#/components/responses/PlatformRequestTimeout" + "409": + $ref: "#/components/responses/PlatformConflict" + "413": + $ref: "#/components/responses/PlatformRequestTooLarge" + "429": + $ref: "#/components/responses/PlatformTooManyRequests" + "500": + $ref: "#/components/responses/PlatformInternalServerError" + "503": + $ref: "#/components/responses/PlatformServiceUnavailable" + x-speakeasy-group: agents + x-speakeasy-name-override: cancelRun + security: + - APIToken: [] + /api/agents/{agent_id}/responses: + post: + tags: + - Agents + summary: Respond to agent run approvals + description: | + Submit decisions for every pending tool approval in the paused run's current batch. The run is identified by `run_id` in the JSON body. Decisions apply only to the stored invocations and arguments; argument edits, authentication responses, and session-wide grants are not supported. The caller must own the run, still have agent access, and have the agents.run scope. Acceptance persists the decisions before resuming the same run and chat session. Identical accepted decisions return the current snapshot without another continuation. Conflicting, stale, incomplete, or non-pending decisions return 409. Cancellation registration failure returns 503 without accepting the decisions; retry the same approval batch. This retry guarantee does not cover an indeterminate database commit outcome. Go workflow approval resumes currently support one tool invocation and one approval response. Unsupported multi-tool or multi-decision Go resumes fail without executing tools. The resumed action must resolve to the tool identified by the stored approval request and paused checkpoint. Missing or inconsistent identity fails without executing tools. Execution continues after HTTP disconnects, but is not automatically resumed after a QE crash. Each accepted continuation starts a fresh 30-minute execution timeout and 40-minute cleanup deadline. Identical retries do not extend that deadline. Waiting for approval does not expire a run. The next GET marks an overdue active turn FAILED without replaying execution. + operationId: platform-agents-create-run-responses + x-visibility: Public + parameters: + - in: path + name: agent_id + description: ID of the agent that owns the run. + required: true + example: "{agent_id}" + schema: + type: string + minLength: 1 + maxLength: 256 + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/PlatformAgentRunResponsesRequest" + responses: + "200": + description: Decisions accepted, or an identical retry. Poll GET run for continued execution. + content: + application/json: + schema: + $ref: "#/components/schemas/PlatformAgentRunResponse" + "400": + $ref: "#/components/responses/PlatformBadRequest" + "401": + $ref: "#/components/responses/PlatformUnauthorized" + "403": + $ref: "#/components/responses/PlatformForbidden" + "404": + $ref: "#/components/responses/PlatformNotFound" + "408": + $ref: "#/components/responses/PlatformRequestTimeout" + "409": + $ref: "#/components/responses/PlatformConflict" + "413": + $ref: "#/components/responses/PlatformRequestTooLarge" + "429": + $ref: "#/components/responses/PlatformTooManyRequests" + "500": + $ref: "#/components/responses/PlatformInternalServerError" + "503": + $ref: "#/components/responses/PlatformServiceUnavailable" + x-speakeasy-group: agents + x-speakeasy-name-override: respondToRun + security: + - APIToken: [] /api/chat: post: tags: @@ -2532,7 +2706,7 @@ paths: description: Not Authorized "403": description: Forbidden - x-visibility: Preview + x-visibility: Public x-codegen-request-body-name: payload x-speakeasy-name-override: retrieveApplication x-speakeasy-group: client.chat @@ -2720,7 +2894,7 @@ paths: description: Forbidden "500": description: Internal server error - x-visibility: Preview + x-visibility: Public x-speakeasy-group: client.agents x-speakeasy-name-override: create /rest/api/v1/agents/{agent_id}: @@ -2763,7 +2937,7 @@ paths: "500": description: Internal server error deprecated: true - x-visibility: Preview + x-visibility: Public x-glean-deprecated: docs: https://developers.glean.com/api/platform-api/agents-overview id: e01a59ea-5de0-481f-97b6-d28dd65379e6 @@ -2815,7 +2989,7 @@ paths: $ref: '#/components/schemas/ErrorResponse' "500": description: Internal server error - x-visibility: Preview + x-visibility: Public x-speakeasy-group: client.agents x-speakeasy-name-override: update /rest/api/v1/agents/{agent_id}/schemas: @@ -2864,7 +3038,7 @@ paths: "500": description: Internal server error deprecated: true - x-visibility: Preview + x-visibility: Public x-glean-deprecated: docs: https://developers.glean.com/api/platform-api/agents-overview id: 9ca398ba-cf22-4523-9d9c-86e5f82d6ec7 @@ -2921,7 +3095,7 @@ paths: $ref: '#/components/schemas/ErrorResponse' "500": description: Internal server error - x-visibility: Preview + x-visibility: Public x-speakeasy-group: client.agents x-speakeasy-name-override: import /rest/api/v1/agents/search: @@ -2965,7 +3139,7 @@ paths: "500": description: Internal server error deprecated: true - x-visibility: Preview + x-visibility: Public x-glean-deprecated: docs: https://developers.glean.com/api/platform-api/agents-overview id: 3ab6f4c0-0b97-4a0b-b5da-e888e4bb7706 @@ -3039,7 +3213,7 @@ paths: "500": description: Internal server error deprecated: true - x-visibility: Preview + x-visibility: Public x-glean-deprecated: docs: https://developers.glean.com/api/platform-api/agents-overview id: db3f42a5-8820-451e-b57a-14bf6ca3915c @@ -3088,7 +3262,7 @@ paths: "500": description: Internal server error deprecated: true - x-visibility: Preview + x-visibility: Public x-glean-deprecated: docs: https://developers.glean.com/api/platform-api/agents-overview id: 683b90e1-48d3-4d7a-a32d-b48eb194fcf0 @@ -3362,7 +3536,7 @@ paths: description: Not Authorized "429": description: Too Many Requests - x-visibility: Preview + x-visibility: Public x-codegen-request-body-name: payload x-speakeasy-name-override: retrieve x-speakeasy-group: client.collections @@ -3436,7 +3610,7 @@ paths: description: Forbidden "429": description: Too Many Requests - x-visibility: Preview + x-visibility: Public x-codegen-request-body-name: payload x-speakeasy-name-override: retrievePermissions x-speakeasy-group: client.documents @@ -3508,7 +3682,7 @@ paths: description: Not Found "429": description: Too Many Requests - x-visibility: Preview + x-visibility: Public x-codegen-request-body-name: payload x-speakeasy-name-override: retrieveByFacets x-speakeasy-group: client.documents @@ -3580,7 +3754,7 @@ paths: description: Not Authorized "429": description: Too Many Requests - x-visibility: Preview + x-visibility: Public x-codegen-request-body-name: payload x-speakeasy-name-override: retrieve x-speakeasy-group: client.messages @@ -3806,7 +3980,7 @@ paths: $ref: '#/components/schemas/ErrorInfo' "429": description: Too Many Requests - x-visibility: Preview + x-visibility: Public x-codegen-request-body-name: payload x-speakeasy-group: client.search x-speakeasy-name-override: queryAsAdmin @@ -3922,7 +4096,7 @@ paths: description: Document does not exist or user cannot access document "429": description: Too Many Requests - x-visibility: Preview + x-visibility: Public x-codegen-request-body-name: payload x-speakeasy-group: client.search x-speakeasy-name-override: recommendations @@ -4459,7 +4633,7 @@ paths: description: Not Found "429": description: Too Many Requests - x-visibility: Preview + x-visibility: Public x-speakeasy-name-override: list x-speakeasy-group: client.tools /rest/api/v1/tools/call: @@ -4492,7 +4666,7 @@ paths: description: Not Found "429": description: Too Many Requests - x-visibility: Preview + x-visibility: Public x-speakeasy-name-override: run x-speakeasy-group: client.tools /rest/api/v1/actions/actionpack/{actionPackId}/auth: @@ -4522,7 +4696,7 @@ paths: description: Action pack not found "429": description: Too Many Requests - x-visibility: Preview + x-visibility: Public x-speakeasy-name-override: retrieveActionPackAuthStatus x-speakeasy-group: client.tools post: @@ -4563,7 +4737,7 @@ paths: description: Action pack not found "429": description: Too Many Requests - x-visibility: Preview + x-visibility: Public x-speakeasy-name-override: authorizeActionPack x-speakeasy-group: client.tools parameters: @@ -4599,7 +4773,7 @@ paths: description: Tool server not found "429": description: Too Many Requests - x-visibility: Preview + x-visibility: Public x-glean-experimental: id: 52fde6ec-c18b-4de6-b761-f82008542ae7 introduced: "2026-07-02" @@ -4643,7 +4817,7 @@ paths: description: Tool server not found "429": description: Too Many Requests - x-visibility: Preview + x-visibility: Public x-glean-experimental: id: 1935476e-ecaf-4c1f-a9fd-1e768cf68f30 introduced: "2026-07-02" @@ -4703,7 +4877,7 @@ paths: description: Too Many Requests "503": description: Tool schemas could not be resolved from the server - x-visibility: Preview + x-visibility: Public x-glean-experimental: id: 332eb38f-1b5d-4896-88e3-59db5e96e4e1 introduced: "2026-07-30" @@ -6133,6 +6307,7 @@ paths: description: Permissions error "500": description: Internal error + x-visibility: Public x-speakeasy-group: client.governance.data.policies x-speakeasy-name-override: update /rest/api/v1/governance/data/policies: @@ -6529,7 +6704,7 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorResponse' - x-visibility: Preview + x-visibility: Public x-speakeasy-group: client.datasources x-speakeasy-name-override: retrieveConfiguration patch: @@ -6577,7 +6752,7 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorResponse' - x-visibility: Preview + x-visibility: Public x-speakeasy-group: client.datasources x-speakeasy-name-override: updateConfiguration /rest/api/v1/datasource/{datasourceInstanceId}/credentialstatus: @@ -6619,7 +6794,7 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorResponse' - x-visibility: Preview + x-visibility: Public x-speakeasy-group: client.datasources x-speakeasy-name-override: retrieveCredentialStatus /rest/api/v1/datasource/{datasourceInstanceId}/credentials: @@ -6668,7 +6843,7 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorResponse' - x-visibility: Preview + x-visibility: Public x-speakeasy-group: client.datasources x-speakeasy-name-override: rotateCredentials /rest/api/v1/chat#stream: @@ -7351,8 +7526,16 @@ components: additionalProperties: true stream: type: boolean - description: Whether to stream the run response as server-sent events. + description: Whether to stream the run response as server-sent events. Not supported in DURABLE mode. default: false + execution_mode: + type: string + enum: + - REQUEST_BOUND + - DURABLE + default: REQUEST_BOUND + description: | + REQUEST_BOUND preserves the existing wait/stream behavior. DURABLE starts a fresh, persisted execution with a 30-minute execution timeout and returns immediately. DURABLE requires stream to be false or omitted and does not accept metadata.chat_session_id. It does not bypass tool approval requirements or provide automatic QE-crash resumption. Expiry is read-triggered: the next GET of the run marks an active turn FAILED if more than 40 minutes have passed since the turn was accepted. There is no periodic sweep, so the stored run can remain RUNNING until it is read. Expiry never replays execution or expires approval-paused runs, and failure does not prove that external tool work has stopped. PlatformAgentRunCreate: type: object required: @@ -7404,6 +7587,124 @@ components: request_id: type: string description: Platform-generated request ID for support correlation. + PlatformAgentRunState: + type: string + enum: + - QUEUED + - RUNNING + - REQUIRES_INPUT + - SUCCEEDED + - FAILED + - CANCELLING + - CANCELLED + - EXPIRED + description: State of the persisted workflow execution. REQUIRES_INPUT is nonterminal. + PlatformAgentRunToolApproval: + type: object + description: Pending approval for a specific persisted tool invocation and its arguments. + required: + - interaction_id + - type + - display_name + - description + - arguments + properties: + interaction_id: + type: string + description: Identifies this specific invocation approval, not the tool definition. + type: + type: string + enum: + - TOOL_APPROVAL + description: Interaction type identifying a tool execution approval request. + tool_id: + type: string + description: Platform tool identifier when recorded. Omitted for requests without one, such as some MCP tools. + display_name: + type: string + description: Display name of the tool requesting approval. + description: + type: string + description: Description of the tool associated with this approval request. + arguments: + type: object + additionalProperties: true + description: Arguments from the persisted approval request. Older platform tools use flattened parameters. + expires_at: + type: string + format: date-time + description: Approval deadline, when one is set. Omitted when the approval has no expiration. + PlatformAgentRunError: + type: object + description: Caller-safe details of an agent run execution failure. + required: + - code + - message + properties: + code: + type: string + description: Machine-readable execution failure code. + message: + type: string + description: Caller-safe execution failure description. + PlatformDurableAgentRun: + type: object + description: Agent run state, pending tool approvals, and output available independently of the creation request. + required: + - run_id + - agent_id + - state + - created_at + - updated_at + - pending_interactions + properties: + run_id: + type: string + description: ID of the run, preserved across approval continuations. + agent_id: + type: string + description: ID of the agent that owns the run. + state: + $ref: "#/components/schemas/PlatformAgentRunState" + description: Current lifecycle state of the run. + created_at: + type: string + format: date-time + description: Timestamp when the run was first persisted. + updated_at: + type: string + format: date-time + description: | + Latest persisted activity timestamp across the execution and its messages, including checkpoint messages. This is not a worker heartbeat or an exact state-transition timestamp. + expires_at: + type: string + format: date-time + description: Execution deadline, when one is set. Not the run history retention deadline. + pending_interactions: + type: array + description: Unanswered tool approvals when the run is in REQUIRES_INPUT. Empty in other states. + items: + $ref: "#/components/schemas/PlatformAgentRunToolApproval" + output: + type: object + additionalProperties: true + description: Accumulated text-only agent output under the messages key, when available. + error: + $ref: "#/components/schemas/PlatformAgentRunError" + description: Caller-safe failure details when the run is in FAILED. + PlatformAgentRunResponse: + type: object + description: Persisted agent run snapshot with a request ID for support correlation. + required: + - run + - request_id + properties: + run: + $ref: "#/components/schemas/PlatformDurableAgentRun" + description: Current persisted snapshot of the requested agent run. + request_id: + type: string + description: Platform-generated request ID for support correlation. PlatformAuthenticationSuggestion: type: object description: One tool the caller must authorize before the agent can run. @@ -7429,6 +7730,64 @@ components: description: One entry per tool the caller must authorize. items: $ref: "#/components/schemas/PlatformAuthenticationSuggestion" + PlatformAgentRunCancellationRequest: + type: object + additionalProperties: false + description: Request cooperative cancellation of a run owned by the caller. + required: + - run_id + example: + run_id: "{run_id}" + properties: + run_id: + type: string + minLength: 1 + maxLength: 256 + description: ID of the run to cancel. Must belong to the agent identified in the path. + PlatformAgentRunApprovalDecision: + type: object + additionalProperties: false + description: Approve or reject the invocation identified by a pending interaction ID. + required: + - interaction_id + - decision + properties: + interaction_id: + type: string + minLength: 1 + maxLength: 256 + description: The interaction_id returned in the run's pending_interactions. + decision: + type: string + enum: + - APPROVE + - REJECT + description: The decision for this invocation only. Rejection follows normal workflow behavior. + PlatformAgentRunResponsesRequest: + type: object + additionalProperties: false + description: Invocation-scoped decisions for the complete pending approval batch. + required: + - run_id + - responses + example: + run_id: "{run_id}" + responses: + - interaction_id: "{interaction_id}" + decision: APPROVE + properties: + run_id: + type: string + minLength: 1 + maxLength: 256 + description: ID of the run whose pending approvals are being answered. Must belong to the agent identified in the path. + responses: + type: array + minItems: 1 + maxItems: 100 + description: One decision per pending interaction. Interaction IDs must be unique. + items: + $ref: "#/components/schemas/PlatformAgentRunApprovalDecision" PlatformChatInputMessage: type: object additionalProperties: false @@ -7444,13 +7803,72 @@ components: content: type: string minLength: 1 + PlatformChatTextFormat: + type: object + additionalProperties: false + description: Unconstrained plain-text assistant output. + required: + - type + properties: + type: + type: string + description: Discriminator. Must be TEXT. + enum: + - TEXT + PlatformChatJsonSchemaFormat: + type: object + additionalProperties: false + description: Constrains the assistant response to a caller-supplied JSON Schema. + required: + - type + - name + - schema + properties: + type: + type: string + description: Discriminator. Must be JSON_SCHEMA. + enum: + - JSON_SCHEMA + name: + type: string + minLength: 1 + maxLength: 64 + description: A stable identifier for the schema. + description: + type: string + maxLength: 1024 + description: An optional human-readable description of the schema. + schema: + type: object + additionalProperties: true + description: A JSON Schema object describing the desired output shape. + strict: + type: boolean + default: true + description: | + When true, the provider validates the response against the schema. Unsupported by some providers; defaults to true. PlatformChatCreateRequest: type: object additionalProperties: false required: - input example: - input: What is our parental leave policy? + input: Summarize our parental leave policy as JSON. + text: + format: + type: JSON_SCHEMA + name: policy_summary + schema: + type: object + properties: + eligible_employees: + type: string + duration_weeks: + type: integer + required: + - eligible_employees + - duration_weeks + strict: true properties: input: description: | @@ -7477,6 +7895,18 @@ components: minLength: 1 description: | Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`. + text: + type: object + additionalProperties: false + description: | + Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. + properties: + format: + description: | + Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. + oneOf: + - $ref: "#/components/schemas/PlatformChatTextFormat" + - $ref: "#/components/schemas/PlatformChatJsonSchemaFormat" PlatformChatStreamResponseId: type: string minLength: 1 @@ -7496,6 +7926,12 @@ components: - OUTPUT_TEXT text: type: string + structured_output: + type: + - object + - "null" + description: | + Parsed and validated JSON object when structured output was requested. Present only when the request included `text.format.type: JSON_SCHEMA`. annotations: type: array items: @@ -13344,7 +13780,7 @@ components: - toolType - requestType - requestId - x-visibility: Preview + x-visibility: Public x-glean-experimental: id: 4e3ee791-45e0-4125-845f-4b7701aa983c introduced: "2026-07-02" @@ -13378,7 +13814,7 @@ components: description: Preview information for this tool request. required: - toolName - x-visibility: Preview + x-visibility: Public x-glean-experimental: id: 8544e887-4569-4b14-bde0-d1be9e90dbc3 introduced: "2026-07-02" @@ -13390,7 +13826,7 @@ components: description: ID of the MCP server (populated when toolType is MCP). description: | Context for authentication responses, containing identifiers for the entity being authenticated. - x-visibility: Preview + x-visibility: Public x-glean-experimental: id: a7c1d3e5-9f42-4b8a-b6e0-2d4f8a1c3e5b introduced: "2026-07-09" @@ -13439,7 +13875,7 @@ components: For SANDBOX_EGRESS requests: - isGranted: whether the sandbox egress call is approved - x-visibility: Preview + x-visibility: Public x-glean-experimental: id: 3eae3ee7-2c06-4027-be14-98260a3ce608 introduced: "2026-07-02" @@ -16128,6 +16564,8 @@ components: - EDIT_DOC - CHAT_TO_ARTIFACT - SHARE_ARTIFACT + - CREATE_AGENT + - MANAGER_INVITE description: Categories of content requested. An allowlist gives flexibility to request content separately or together. requestOptions: $ref: '#/components/schemas/FeedRequestOptions' @@ -16603,6 +17041,8 @@ components: - EDIT_DOC - CHAT_TO_ARTIFACT - SHARE_ARTIFACT + - CREATE_AGENT + - MANAGER_INVITE description: Type of the justification. justification: type: string @@ -16701,6 +17141,8 @@ components: - EDIT_DOC - CHAT_TO_ARTIFACT - SHARE_ARTIFACT + - CREATE_AGENT + - MANAGER_INVITE description: Category of the result, one of the requested categories in incoming request. primaryEntry: $ref: '#/components/schemas/FeedEntry' diff --git a/.speakeasy/tests.arazzo.yaml b/.speakeasy/tests.arazzo.yaml index 1fd5fde4..97a70cd1 100644 --- a/.speakeasy/tests.arazzo.yaml +++ b/.speakeasy/tests.arazzo.yaml @@ -164637,6 +164637,7 @@ workflows: requestBody: contentType: application/json payload: + execution_mode: REQUEST_BOUND messages: - content: - text: What is our parental leave policy? @@ -164900,9 +164901,24 @@ workflows: requestBody: contentType: application/json payload: - input: What is our parental leave policy? + input: Summarize our parental leave policy as JSON. store: true stream: false + text: + format: + name: policy_summary + schema: + properties: + duration_weeks: + type: integer + eligible_employees: + type: string + required: + - eligible_employees + - duration_weeks + type: object + strict: true + type: JSON_SCHEMA successCriteria: - condition: $statusCode == 200 - condition: $response.header.Content-Type == application/json @@ -165311,3 +165327,68 @@ workflows: type: simple x-speakeasy-test-group: triggers x-speakeasy-test-rebuild: true + - workflowId: platform-agents-get-run + steps: + - stepId: test + operationId: platform-agents-get-run + parameters: + - name: agent_id + in: path + value: '{agent_id}' + - name: run_id + in: path + value: '{run_id}' + successCriteria: + - condition: $statusCode == 200 + - condition: $response.header.Content-Type == application/json + - context: $response.body + condition: | + {"run":{"run_id":"","agent_id":"","state":"CANCELLING","created_at":"2025-02-20T06:37:06.101Z","updated_at":"2025-06-13T07:24:18.599Z","pending_interactions":[]},"request_id":""} + type: simple + x-speakeasy-test-group: agents + x-speakeasy-test-rebuild: true + - workflowId: platform-agents-cancel-run + steps: + - stepId: test + operationId: platform-agents-cancel-run + parameters: + - name: agent_id + in: path + value: '{agent_id}' + requestBody: + contentType: application/json + payload: + run_id: '{run_id}' + successCriteria: + - condition: $statusCode == 200 + - condition: $response.header.Content-Type == application/json + - context: $response.body + condition: | + {"run":{"run_id":"","agent_id":"","state":"REQUIRES_INPUT","created_at":"2026-04-14T14:14:08.916Z","updated_at":"2025-07-26T12:32:21.659Z","pending_interactions":[]},"request_id":""} + type: simple + x-speakeasy-test-group: agents + x-speakeasy-test-rebuild: true + - workflowId: platform-agents-create-run-responses + steps: + - stepId: test + operationId: platform-agents-create-run-responses + parameters: + - name: agent_id + in: path + value: '{agent_id}' + requestBody: + contentType: application/json + payload: + responses: + - decision: APPROVE + interaction_id: '{interaction_id}' + run_id: '{run_id}' + successCriteria: + - condition: $statusCode == 200 + - condition: $response.header.Content-Type == application/json + - context: $response.body + condition: | + {"run":{"run_id":"","agent_id":"","state":"QUEUED","created_at":"2024-08-26T19:05:47.442Z","updated_at":"2026-08-22T09:50:35.176Z","pending_interactions":[{"interaction_id":"","type":"TOOL_APPROVAL","display_name":"King.Trantow44","description":"provided collectivization whereas disapprove gah astride under stoop louse","arguments":{"key":"","key1":""}}]},"request_id":""} + type: simple + x-speakeasy-test-group: agents + x-speakeasy-test-rebuild: true diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 00cda168..c1f0054a 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.797.0 +speakeasyVersion: 1.798.0 sources: Glean API: sourceNamespace: glean-api-specs - sourceRevisionDigest: sha256:1f470e422d6b202bf6bb80cc2e4b73077b7dab6d476cda804245fc0402ea42f1 - sourceBlobDigest: sha256:8919e7ffe50c1ca78844cd89c216e8ab3c54a8e0003bd5072e7fe3cd35fb192c + sourceRevisionDigest: sha256:09823f8003cfb3ebf08b6adfa434cefda4c97f7ee64ae18dc0066fe392647c97 + sourceBlobDigest: sha256:fc4fcf9c37dfd0e8387153211f760a21a602ede64951d4e4c824e8e1b168b7b8 tags: - latest petstore-oas: @@ -17,10 +17,10 @@ targets: glean: source: Glean API sourceNamespace: glean-api-specs - sourceRevisionDigest: sha256:1f470e422d6b202bf6bb80cc2e4b73077b7dab6d476cda804245fc0402ea42f1 - sourceBlobDigest: sha256:8919e7ffe50c1ca78844cd89c216e8ab3c54a8e0003bd5072e7fe3cd35fb192c + sourceRevisionDigest: sha256:09823f8003cfb3ebf08b6adfa434cefda4c97f7ee64ae18dc0066fe392647c97 + sourceBlobDigest: sha256:fc4fcf9c37dfd0e8387153211f760a21a602ede64951d4e4c824e8e1b168b7b8 codeSamplesNamespace: glean-api-specs-go-code-samples - codeSamplesRevisionDigest: sha256:db1b62343d7bf2cd4b059b6dea2f5fb245f627b9559d9ccdd4b508fa37fc9c8f + codeSamplesRevisionDigest: sha256:e0b322a1f857ede51de9462d1d1c564b4f177e1469aa2afa4f108a43e395a957 petstore: source: petstore-oas sourceNamespace: petstore-oas diff --git a/README.md b/README.md index 6f288e67..cc918f14 100644 --- a/README.md +++ b/README.md @@ -234,6 +234,9 @@ For more information on obtaining the appropriate token type, please contact you * [Get](docs/sdks/agents/README.md#get) - Get agent * [GetSchemas](docs/sdks/agents/README.md#getschemas) - Get agent schemas * [CreateRun](docs/sdks/agents/README.md#createrun) - Create agent run +* [GetRun](docs/sdks/agents/README.md#getrun) - Get agent run +* [CancelRun](docs/sdks/agents/README.md#cancelrun) - Cancel an agent run +* [RespondToRun](docs/sdks/agents/README.md#respondtorun) - Respond to agent run approvals ### [Chat](docs/sdks/chat/README.md) @@ -520,6 +523,7 @@ package main import ( "context" apiclientgo "github.com/gleanwork/api-client-go" + "github.com/gleanwork/api-client-go/models/components" "github.com/gleanwork/api-client-go/models/operations" "log" "os" @@ -534,8 +538,31 @@ func main() { res, err := s.Chat.CreateStream(ctx, operations.PlatformChatCreateStreamRequest{ Input: operations.CreatePlatformChatCreateStreamInputStr( - "What is our parental leave policy?", + "Summarize our parental leave policy as JSON.", ), + Text: &operations.PlatformChatCreateStreamText{ + Format: apiclientgo.Pointer(operations.CreatePlatformChatCreateStreamFormatPlatformChatJSONSchemaFormat( + components.PlatformChatJSONSchemaFormat{ + Type: components.PlatformChatJSONSchemaFormatTypeJSONSchema, + Name: "policy_summary", + Schema: map[string]any{ + "type": "object", + "properties": map[string]any{ + "eligible_employees": map[string]any{ + "type": "string", + }, + "duration_weeks": map[string]any{ + "type": "integer", + }, + }, + "required": []any{ + "eligible_employees", + "duration_weeks", + }, + }, + }, + )), + }, }) if err != nil { log.Fatal(err) diff --git a/RELEASES.md b/RELEASES.md index 3cc08eab..9359958a 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -998,4 +998,14 @@ Based on: ### Generated - [go v0.15.14] . ### Releases -- [Go v0.15.14] https://github.com/gleanwork/api-client-go/releases/tag/v0.15.14 - . \ No newline at end of file +- [Go v0.15.14] https://github.com/gleanwork/api-client-go/releases/tag/v0.15.14 - . + +## 2026-09-23 18:28:33 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.798.0 (2.938.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [go v0.15.15] . +### Releases +- [Go v0.15.15] https://github.com/gleanwork/api-client-go/releases/tag/v0.15.15 - . \ No newline at end of file diff --git a/agents.go b/agents.go index 0fa790ec..106f2f98 100644 --- a/agents.go +++ b/agents.go @@ -858,7 +858,7 @@ func (s *Agents) GetSchemas(ctx context.Context, agentID string, includeTools *b } // CreateRun - Create agent run -// Execute an agent run. Set `stream` to true to receive server-sent events; otherwise the response contains the final agent messages. +// Execute an agent run. By default, set `stream` to true to receive server-sent events; otherwise the response contains the final agent messages. Set `execution_mode` to `DURABLE` to persist a new run and return its initial snapshot with HTTP 201 without waiting for execution. Poll the agent-scoped GET run endpoint for progress. Durable execution continues after an HTTP disconnect, but is not automatically resumed after a QE restart or crash. An active turn becomes overdue more than 40 minutes after acceptance (a 30-minute execution timeout plus 10 minutes of grace). The next GET of the run marks the overdue turn FAILED without replay; there is no periodic sweep. Without a GET, the stored run can remain RUNNING. Failure does not prove that external tool work has stopped. Paused runs are not expired; an accepted approval continuation starts a fresh deadline. Each POST creates a new run; retrying a POST can create another execution. Submit pending approval decisions through the run responses endpoint, and cancellation can be requested through the run cancellations endpoint. A run tracks one workflow execution; automatic background-subagent wake turns are separate executions, not continuations tracked by this run ID. func (s *Agents) CreateRun(ctx context.Context, agentID string, platformAgentRunCreateRequest components.PlatformAgentRunCreateRequest, opts ...operations.Option) (*operations.PlatformAgentsCreateRunResponse, error) { request := operations.PlatformAgentsCreateRunRequest{ AgentID: agentID, @@ -1065,6 +1065,27 @@ func (s *Agents) CreateRun(ctx context.Context, agentID string, platformAgentRun } return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } + case httpRes.StatusCode == 201: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.PlatformAgentRunResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.PlatformAgentRunResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } case httpRes.StatusCode == 422: switch { case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/problem+json`): @@ -1179,3 +1200,844 @@ func (s *Agents) CreateRun(ctx context.Context, agentID string, platformAgentRun return res, nil } + +// GetRun - Get agent run +// Retrieve a persisted workflow execution owned by the authenticated user. The run must belong to the specified agent, and the user must still have access to that agent. Unknown runs, runs owned by another user, and mismatched agent/run identifiers return 404. Requires the agents.run scope. Executions without a persisted workflow record are not available through this endpoint. +func (s *Agents) GetRun(ctx context.Context, agentID string, runID string, opts ...operations.Option) (*operations.PlatformAgentsGetRunResponse, error) { + request := operations.PlatformAgentsGetRunRequest{ + AgentID: agentID, + RunID: runID, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/agents/{agent_id}/runs/{run_id}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "platform-agents-get-run", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.PlatformAgentsGetRunResponse{ + HTTPMeta: components.HTTPMetadata{ + Request: req, + Response: httpRes, + }, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.PlatformAgentRunResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.PlatformAgentRunResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 401: + fallthrough + case httpRes.StatusCode == 403: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode == 408: + fallthrough + case httpRes.StatusCode == 429: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/problem+json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out apierrors.PlatformProblemDetailError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + out.HTTPMeta = components.HTTPMetadata{ + Request: req, + Response: httpRes, + } + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 500: + fallthrough + case httpRes.StatusCode == 503: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/problem+json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out apierrors.PlatformProblemDetailError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + out.HTTPMeta = components.HTTPMetadata{ + Request: req, + Response: httpRes, + } + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// CancelRun - Cancel an agent run +// Request cooperative cancellation of the durable agent run identified by `run_id` in the JSON body. Requires ownership, current agent access, and the agents.run scope. Sending a cancellation signal does not itself change an active run from RUNNING; poll GET run for the final state. Paused runs become CANCELLED without resuming execution. Repeated requests and requests for terminal runs return the current snapshot. Completion may win a race with cancellation. Completed tool side effects cannot be undone, and external work may continue if a tool does not support cancellation. Cancellation targets this run, not separate background-subagent executions. An active run without a cancellation registration returns 409. Cancellation signaling requires Redis. An interrupted active run can instead become FAILED through deadline cleanup; this does not verify that external tool work has stopped. +func (s *Agents) CancelRun(ctx context.Context, agentID string, platformAgentRunCancellationRequest components.PlatformAgentRunCancellationRequest, opts ...operations.Option) (*operations.PlatformAgentsCancelRunResponse, error) { + request := operations.PlatformAgentsCancelRunRequest{ + AgentID: agentID, + PlatformAgentRunCancellationRequest: platformAgentRunCancellationRequest, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/agents/{agent_id}/cancellations", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "platform-agents-cancel-run", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "PlatformAgentRunCancellationRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.PlatformAgentsCancelRunResponse{ + HTTPMeta: components.HTTPMetadata{ + Request: req, + Response: httpRes, + }, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.PlatformAgentRunResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.PlatformAgentRunResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 401: + fallthrough + case httpRes.StatusCode == 403: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode == 408: + fallthrough + case httpRes.StatusCode == 409: + fallthrough + case httpRes.StatusCode == 413: + fallthrough + case httpRes.StatusCode == 429: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/problem+json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out apierrors.PlatformProblemDetailError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + out.HTTPMeta = components.HTTPMetadata{ + Request: req, + Response: httpRes, + } + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 500: + fallthrough + case httpRes.StatusCode == 503: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/problem+json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out apierrors.PlatformProblemDetailError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + out.HTTPMeta = components.HTTPMetadata{ + Request: req, + Response: httpRes, + } + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// RespondToRun - Respond to agent run approvals +// Submit decisions for every pending tool approval in the paused run's current batch. The run is identified by `run_id` in the JSON body. Decisions apply only to the stored invocations and arguments; argument edits, authentication responses, and session-wide grants are not supported. The caller must own the run, still have agent access, and have the agents.run scope. Acceptance persists the decisions before resuming the same run and chat session. Identical accepted decisions return the current snapshot without another continuation. Conflicting, stale, incomplete, or non-pending decisions return 409. Cancellation registration failure returns 503 without accepting the decisions; retry the same approval batch. This retry guarantee does not cover an indeterminate database commit outcome. Go workflow approval resumes currently support one tool invocation and one approval response. Unsupported multi-tool or multi-decision Go resumes fail without executing tools. The resumed action must resolve to the tool identified by the stored approval request and paused checkpoint. Missing or inconsistent identity fails without executing tools. Execution continues after HTTP disconnects, but is not automatically resumed after a QE crash. Each accepted continuation starts a fresh 30-minute execution timeout and 40-minute cleanup deadline. Identical retries do not extend that deadline. Waiting for approval does not expire a run. The next GET marks an overdue active turn FAILED without replaying execution. +func (s *Agents) RespondToRun(ctx context.Context, agentID string, platformAgentRunResponsesRequest components.PlatformAgentRunResponsesRequest, opts ...operations.Option) (*operations.PlatformAgentsCreateRunResponsesResponse, error) { + request := operations.PlatformAgentsCreateRunResponsesRequest{ + AgentID: agentID, + PlatformAgentRunResponsesRequest: platformAgentRunResponsesRequest, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/api/agents/{agent_id}/responses", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "platform-agents-create-run-responses", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "PlatformAgentRunResponsesRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.PlatformAgentsCreateRunResponsesResponse{ + HTTPMeta: components.HTTPMetadata{ + Request: req, + Response: httpRes, + }, + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.PlatformAgentRunResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.PlatformAgentRunResponse = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 401: + fallthrough + case httpRes.StatusCode == 403: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode == 408: + fallthrough + case httpRes.StatusCode == 409: + fallthrough + case httpRes.StatusCode == 413: + fallthrough + case httpRes.StatusCode == 429: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/problem+json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out apierrors.PlatformProblemDetailError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + out.HTTPMeta = components.HTTPMetadata{ + Request: req, + Response: httpRes, + } + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 500: + fallthrough + case httpRes.StatusCode == 503: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/problem+json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out apierrors.PlatformProblemDetailError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + out.HTTPMeta = components.HTTPMetadata{ + Request: req, + Response: httpRes, + } + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/docs/models/components/decision.md b/docs/models/components/decision.md new file mode 100644 index 00000000..9f532b7c --- /dev/null +++ b/docs/models/components/decision.md @@ -0,0 +1,21 @@ +# Decision + +The decision for this invocation only. Rejection follows normal workflow behavior. + +## Example Usage + +```go +import ( + "github.com/gleanwork/api-client-go/models/components" +) + +value := components.DecisionApprove +``` + + +## Values + +| Name | Value | +| ----------------- | ----------------- | +| `DecisionApprove` | APPROVE | +| `DecisionReject` | REJECT | \ No newline at end of file diff --git a/docs/models/components/executionmode.md b/docs/models/components/executionmode.md new file mode 100644 index 00000000..dbb86ac3 --- /dev/null +++ b/docs/models/components/executionmode.md @@ -0,0 +1,22 @@ +# ExecutionMode + +REQUEST_BOUND preserves the existing wait/stream behavior. DURABLE starts a fresh, persisted execution with a 30-minute execution timeout and returns immediately. DURABLE requires stream to be false or omitted and does not accept metadata.chat_session_id. It does not bypass tool approval requirements or provide automatic QE-crash resumption. Expiry is read-triggered: the next GET of the run marks an active turn FAILED if more than 40 minutes have passed since the turn was accepted. There is no periodic sweep, so the stored run can remain RUNNING until it is read. Expiry never replays execution or expires approval-paused runs, and failure does not prove that external tool work has stopped. + + +## Example Usage + +```go +import ( + "github.com/gleanwork/api-client-go/models/components" +) + +value := components.ExecutionModeRequestBound +``` + + +## Values + +| Name | Value | +| --------------------------- | --------------------------- | +| `ExecutionModeRequestBound` | REQUEST_BOUND | +| `ExecutionModeDurable` | DURABLE | \ No newline at end of file diff --git a/docs/models/components/feedrequestcategory.md b/docs/models/components/feedrequestcategory.md index 600e92c9..d62f5c32 100644 --- a/docs/models/components/feedrequestcategory.md +++ b/docs/models/components/feedrequestcategory.md @@ -66,4 +66,6 @@ value := components.FeedRequestCategoryDocumentSuggestion | `FeedRequestCategoryArtifactCreation` | ARTIFACT_CREATION | | `FeedRequestCategoryEditDoc` | EDIT_DOC | | `FeedRequestCategoryChatToArtifact` | CHAT_TO_ARTIFACT | -| `FeedRequestCategoryShareArtifact` | SHARE_ARTIFACT | \ No newline at end of file +| `FeedRequestCategoryShareArtifact` | SHARE_ARTIFACT | +| `FeedRequestCategoryCreateAgent` | CREATE_AGENT | +| `FeedRequestCategoryManagerInvite` | MANAGER_INVITE | \ No newline at end of file diff --git a/docs/models/components/feedresultcategory.md b/docs/models/components/feedresultcategory.md index 9fbcbe07..9135724e 100644 --- a/docs/models/components/feedresultcategory.md +++ b/docs/models/components/feedresultcategory.md @@ -71,4 +71,6 @@ custom := components.FeedResultCategory("custom_value") | `FeedResultCategoryArtifactCreation` | ARTIFACT_CREATION | | `FeedResultCategoryEditDoc` | EDIT_DOC | | `FeedResultCategoryChatToArtifact` | CHAT_TO_ARTIFACT | -| `FeedResultCategoryShareArtifact` | SHARE_ARTIFACT | \ No newline at end of file +| `FeedResultCategoryShareArtifact` | SHARE_ARTIFACT | +| `FeedResultCategoryCreateAgent` | CREATE_AGENT | +| `FeedResultCategoryManagerInvite` | MANAGER_INVITE | \ No newline at end of file diff --git a/docs/models/components/justificationtype.md b/docs/models/components/justificationtype.md index bb1dd31b..172b7300 100644 --- a/docs/models/components/justificationtype.md +++ b/docs/models/components/justificationtype.md @@ -85,4 +85,6 @@ custom := components.JustificationType("custom_value") | `JustificationTypeArtifactCreation` | ARTIFACT_CREATION | | `JustificationTypeEditDoc` | EDIT_DOC | | `JustificationTypeChatToArtifact` | CHAT_TO_ARTIFACT | -| `JustificationTypeShareArtifact` | SHARE_ARTIFACT | \ No newline at end of file +| `JustificationTypeShareArtifact` | SHARE_ARTIFACT | +| `JustificationTypeCreateAgent` | CREATE_AGENT | +| `JustificationTypeManagerInvite` | MANAGER_INVITE | \ No newline at end of file diff --git a/docs/models/components/platformagentrunapprovaldecision.md b/docs/models/components/platformagentrunapprovaldecision.md new file mode 100644 index 00000000..caf4cddf --- /dev/null +++ b/docs/models/components/platformagentrunapprovaldecision.md @@ -0,0 +1,11 @@ +# PlatformAgentRunApprovalDecision + +Approve or reject the invocation identified by a pending interaction ID. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `InteractionID` | `string` | :heavy_check_mark: | The interaction_id returned in the run's pending_interactions. | +| `Decision` | [components.Decision](../../models/components/decision.md) | :heavy_check_mark: | The decision for this invocation only. Rejection follows normal workflow behavior. | \ No newline at end of file diff --git a/docs/models/components/platformagentruncancellationrequest.md b/docs/models/components/platformagentruncancellationrequest.md new file mode 100644 index 00000000..f8929897 --- /dev/null +++ b/docs/models/components/platformagentruncancellationrequest.md @@ -0,0 +1,10 @@ +# PlatformAgentRunCancellationRequest + +Request cooperative cancellation of a run owned by the caller. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `RunID` | `string` | :heavy_check_mark: | ID of the run to cancel. Must belong to the agent identified in the path. | \ No newline at end of file diff --git a/docs/models/components/platformagentruncreaterequest.md b/docs/models/components/platformagentruncreaterequest.md index ee828f9f..48a297bb 100644 --- a/docs/models/components/platformagentruncreaterequest.md +++ b/docs/models/components/platformagentruncreaterequest.md @@ -6,9 +6,10 @@ Request to run an agent. A request MUST supply either `messages` (a non-empty co ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Input` | map[string]`any` | :heavy_minus_sign: | Input fields for an input-form triggered agent. | -| `Messages` | [][components.PlatformMessageInput](../../models/components/platformmessageinput.md) | :heavy_minus_sign: | Messages to pass to the agent. When provided, the array MUST contain at least one message and each message MUST specify a valid `role` and non-empty `content`.
| -| `Metadata` | map[string]`any` | :heavy_minus_sign: | Metadata to pass to the agent. | -| `Stream` | `*bool` | :heavy_minus_sign: | Whether to stream the run response as server-sent events. | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Input` | map[string]`any` | :heavy_minus_sign: | Input fields for an input-form triggered agent. | +| `Messages` | [][components.PlatformMessageInput](../../models/components/platformmessageinput.md) | :heavy_minus_sign: | Messages to pass to the agent. When provided, the array MUST contain at least one message and each message MUST specify a valid `role` and non-empty `content`.
| +| `Metadata` | map[string]`any` | :heavy_minus_sign: | Metadata to pass to the agent. | +| `Stream` | `*bool` | :heavy_minus_sign: | Whether to stream the run response as server-sent events. Not supported in DURABLE mode. | +| `ExecutionMode` | [*components.ExecutionMode](../../models/components/executionmode.md) | :heavy_minus_sign: | REQUEST_BOUND preserves the existing wait/stream behavior. DURABLE starts a fresh, persisted execution with a 30-minute execution timeout and returns immediately. DURABLE requires stream to be false or omitted and does not accept metadata.chat_session_id. It does not bypass tool approval requirements or provide automatic QE-crash resumption. Expiry is read-triggered: the next GET of the run marks an active turn FAILED if more than 40 minutes have passed since the turn was accepted. There is no periodic sweep, so the stored run can remain RUNNING until it is read. Expiry never replays execution or expires approval-paused runs, and failure does not prove that external tool work has stopped.
| \ No newline at end of file diff --git a/docs/models/components/platformagentrunerror.md b/docs/models/components/platformagentrunerror.md new file mode 100644 index 00000000..27075f5f --- /dev/null +++ b/docs/models/components/platformagentrunerror.md @@ -0,0 +1,11 @@ +# PlatformAgentRunError + +Caller-safe details of an agent run execution failure. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `Code` | `string` | :heavy_check_mark: | Machine-readable execution failure code. | +| `Message` | `string` | :heavy_check_mark: | Caller-safe execution failure description. | \ No newline at end of file diff --git a/docs/models/components/platformagentrunresponse.md b/docs/models/components/platformagentrunresponse.md new file mode 100644 index 00000000..78e99b3f --- /dev/null +++ b/docs/models/components/platformagentrunresponse.md @@ -0,0 +1,11 @@ +# PlatformAgentRunResponse + +Persisted agent run snapshot with a request ID for support correlation. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `Run` | [components.PlatformDurableAgentRun](../../models/components/platformdurableagentrun.md) | :heavy_check_mark: | Agent run state, pending tool approvals, and output available independently of the creation request. | +| `RequestID` | `string` | :heavy_check_mark: | Platform-generated request ID for support correlation. | \ No newline at end of file diff --git a/docs/models/components/platformagentrunresponsesrequest.md b/docs/models/components/platformagentrunresponsesrequest.md new file mode 100644 index 00000000..d31673f0 --- /dev/null +++ b/docs/models/components/platformagentrunresponsesrequest.md @@ -0,0 +1,11 @@ +# PlatformAgentRunResponsesRequest + +Invocation-scoped decisions for the complete pending approval batch. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `RunID` | `string` | :heavy_check_mark: | ID of the run whose pending approvals are being answered. Must belong to the agent identified in the path. | +| `Responses` | [][components.PlatformAgentRunApprovalDecision](../../models/components/platformagentrunapprovaldecision.md) | :heavy_check_mark: | One decision per pending interaction. Interaction IDs must be unique. | \ No newline at end of file diff --git a/docs/models/components/platformagentrunstate.md b/docs/models/components/platformagentrunstate.md new file mode 100644 index 00000000..fe897db6 --- /dev/null +++ b/docs/models/components/platformagentrunstate.md @@ -0,0 +1,30 @@ +# PlatformAgentRunState + +State of the persisted workflow execution. REQUIRES_INPUT is nonterminal. + +## Example Usage + +```go +import ( + "github.com/gleanwork/api-client-go/models/components" +) + +value := components.PlatformAgentRunStateQueued + +// Open enum: custom values can be created with a direct type cast +custom := components.PlatformAgentRunState("custom_value") +``` + + +## Values + +| Name | Value | +| ------------------------------------ | ------------------------------------ | +| `PlatformAgentRunStateQueued` | QUEUED | +| `PlatformAgentRunStateRunning` | RUNNING | +| `PlatformAgentRunStateRequiresInput` | REQUIRES_INPUT | +| `PlatformAgentRunStateSucceeded` | SUCCEEDED | +| `PlatformAgentRunStateFailed` | FAILED | +| `PlatformAgentRunStateCancelling` | CANCELLING | +| `PlatformAgentRunStateCancelled` | CANCELLED | +| `PlatformAgentRunStateExpired` | EXPIRED | \ No newline at end of file diff --git a/docs/models/components/platformagentruntoolapproval.md b/docs/models/components/platformagentruntoolapproval.md new file mode 100644 index 00000000..53878151 --- /dev/null +++ b/docs/models/components/platformagentruntoolapproval.md @@ -0,0 +1,16 @@ +# PlatformAgentRunToolApproval + +Pending approval for a specific persisted tool invocation and its arguments. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `InteractionID` | `string` | :heavy_check_mark: | Identifies this specific invocation approval, not the tool definition. | +| `Type` | [components.PlatformAgentRunToolApprovalType](../../models/components/platformagentruntoolapprovaltype.md) | :heavy_check_mark: | Interaction type identifying a tool execution approval request. | +| `ToolID` | `*string` | :heavy_minus_sign: | Platform tool identifier when recorded. Omitted for requests without one, such as some MCP tools. | +| `DisplayName` | `string` | :heavy_check_mark: | Display name of the tool requesting approval. | +| `Description` | `string` | :heavy_check_mark: | Description of the tool associated with this approval request. | +| `Arguments` | map[string]`any` | :heavy_check_mark: | Arguments from the persisted approval request. Older platform tools use flattened parameters. | +| `ExpiresAt` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | Approval deadline, when one is set. Omitted when the approval has no expiration. | \ No newline at end of file diff --git a/docs/models/components/platformagentruntoolapprovaltype.md b/docs/models/components/platformagentruntoolapprovaltype.md new file mode 100644 index 00000000..c713b366 --- /dev/null +++ b/docs/models/components/platformagentruntoolapprovaltype.md @@ -0,0 +1,20 @@ +# PlatformAgentRunToolApprovalType + +Interaction type identifying a tool execution approval request. + +## Example Usage + +```go +import ( + "github.com/gleanwork/api-client-go/models/components" +) + +value := components.PlatformAgentRunToolApprovalTypeToolApproval +``` + + +## Values + +| Name | Value | +| ---------------------------------------------- | ---------------------------------------------- | +| `PlatformAgentRunToolApprovalTypeToolApproval` | TOOL_APPROVAL | \ No newline at end of file diff --git a/docs/models/components/platformchatjsonschemaformat.md b/docs/models/components/platformchatjsonschemaformat.md new file mode 100644 index 00000000..bdc1ee43 --- /dev/null +++ b/docs/models/components/platformchatjsonschemaformat.md @@ -0,0 +1,14 @@ +# PlatformChatJSONSchemaFormat + +Constrains the assistant response to a caller-supplied JSON Schema. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `Type` | [components.PlatformChatJSONSchemaFormatType](../../models/components/platformchatjsonschemaformattype.md) | :heavy_check_mark: | Discriminator. Must be JSON_SCHEMA. | +| `Name` | `string` | :heavy_check_mark: | A stable identifier for the schema. | +| `Description` | `*string` | :heavy_minus_sign: | An optional human-readable description of the schema. | +| `Schema` | map[string]`any` | :heavy_check_mark: | A JSON Schema object describing the desired output shape. | +| `Strict` | `*bool` | :heavy_minus_sign: | When true, the provider validates the response against the schema. Unsupported by some providers; defaults to true.
| \ No newline at end of file diff --git a/docs/models/components/platformchatjsonschemaformattype.md b/docs/models/components/platformchatjsonschemaformattype.md new file mode 100644 index 00000000..eb58f922 --- /dev/null +++ b/docs/models/components/platformchatjsonschemaformattype.md @@ -0,0 +1,20 @@ +# PlatformChatJSONSchemaFormatType + +Discriminator. Must be JSON_SCHEMA. + +## Example Usage + +```go +import ( + "github.com/gleanwork/api-client-go/models/components" +) + +value := components.PlatformChatJSONSchemaFormatTypeJSONSchema +``` + + +## Values + +| Name | Value | +| -------------------------------------------- | -------------------------------------------- | +| `PlatformChatJSONSchemaFormatTypeJSONSchema` | JSON_SCHEMA | \ No newline at end of file diff --git a/docs/models/components/platformchatoutputtextcontent.md b/docs/models/components/platformchatoutputtextcontent.md index 6c9f4039..9c31be64 100644 --- a/docs/models/components/platformchatoutputtextcontent.md +++ b/docs/models/components/platformchatoutputtextcontent.md @@ -3,8 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `Type` | [components.PlatformChatOutputTextContentType](../../models/components/platformchatoutputtextcontenttype.md) | :heavy_check_mark: | N/A | -| `Text` | `string` | :heavy_check_mark: | N/A | -| `Annotations` | [][components.PlatformChatCitationAnnotation](../../models/components/platformchatcitationannotation.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | +| `Type` | [components.PlatformChatOutputTextContentType](../../models/components/platformchatoutputtextcontenttype.md) | :heavy_check_mark: | N/A | +| `Text` | `string` | :heavy_check_mark: | N/A | +| `StructuredOutput` | [*components.StructuredOutput](../../models/components/structuredoutput.md) | :heavy_minus_sign: | Parsed and validated JSON object when structured output was requested. Present only when the request included `text.format.type: JSON_SCHEMA`.
| +| `Annotations` | [][components.PlatformChatCitationAnnotation](../../models/components/platformchatcitationannotation.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/platformchattextformat.md b/docs/models/components/platformchattextformat.md new file mode 100644 index 00000000..53194c38 --- /dev/null +++ b/docs/models/components/platformchattextformat.md @@ -0,0 +1,10 @@ +# PlatformChatTextFormat + +Unconstrained plain-text assistant output. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `Type` | [components.PlatformChatTextFormatType](../../models/components/platformchattextformattype.md) | :heavy_check_mark: | Discriminator. Must be TEXT. | \ No newline at end of file diff --git a/docs/models/components/platformchattextformattype.md b/docs/models/components/platformchattextformattype.md new file mode 100644 index 00000000..7809722c --- /dev/null +++ b/docs/models/components/platformchattextformattype.md @@ -0,0 +1,20 @@ +# PlatformChatTextFormatType + +Discriminator. Must be TEXT. + +## Example Usage + +```go +import ( + "github.com/gleanwork/api-client-go/models/components" +) + +value := components.PlatformChatTextFormatTypeText +``` + + +## Values + +| Name | Value | +| -------------------------------- | -------------------------------- | +| `PlatformChatTextFormatTypeText` | TEXT | \ No newline at end of file diff --git a/docs/models/components/platformdurableagentrun.md b/docs/models/components/platformdurableagentrun.md new file mode 100644 index 00000000..2f2d20de --- /dev/null +++ b/docs/models/components/platformdurableagentrun.md @@ -0,0 +1,18 @@ +# PlatformDurableAgentRun + +Agent run state, pending tool approvals, and output available independently of the creation request. + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `RunID` | `string` | :heavy_check_mark: | ID of the run, preserved across approval continuations. | +| `AgentID` | `string` | :heavy_check_mark: | ID of the agent that owns the run. | +| `State` | [components.PlatformAgentRunState](../../models/components/platformagentrunstate.md) | :heavy_check_mark: | State of the persisted workflow execution. REQUIRES_INPUT is nonterminal. | +| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | Timestamp when the run was first persisted. | +| `UpdatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | Latest persisted activity timestamp across the execution and its messages, including checkpoint messages. This is not a worker heartbeat or an exact state-transition timestamp.
| +| `ExpiresAt` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | Execution deadline, when one is set. Not the run history retention deadline. | +| `PendingInteractions` | [][components.PlatformAgentRunToolApproval](../../models/components/platformagentruntoolapproval.md) | :heavy_check_mark: | Unanswered tool approvals when the run is in REQUIRES_INPUT. Empty in other states. | +| `Output` | map[string]`any` | :heavy_minus_sign: | Accumulated text-only agent output under the messages key, when available. | +| `Error` | [*components.PlatformAgentRunError](../../models/components/platformagentrunerror.md) | :heavy_minus_sign: | Caller-safe details of an agent run execution failure. | \ No newline at end of file diff --git a/docs/models/components/structuredoutput.md b/docs/models/components/structuredoutput.md new file mode 100644 index 00000000..45e8ab02 --- /dev/null +++ b/docs/models/components/structuredoutput.md @@ -0,0 +1,10 @@ +# StructuredOutput + +Parsed and validated JSON object when structured output was requested. Present only when the request included `text.format.type: JSON_SCHEMA`. + + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/platformagentscancelrunrequest.md b/docs/models/operations/platformagentscancelrunrequest.md new file mode 100644 index 00000000..396b860a --- /dev/null +++ b/docs/models/operations/platformagentscancelrunrequest.md @@ -0,0 +1,9 @@ +# PlatformAgentsCancelRunRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `AgentID` | `string` | :heavy_check_mark: | ID of the agent that owns the run. | {agent_id} | +| `PlatformAgentRunCancellationRequest` | [components.PlatformAgentRunCancellationRequest](../../models/components/platformagentruncancellationrequest.md) | :heavy_check_mark: | N/A | {
"run_id": "{run_id}"
} | \ No newline at end of file diff --git a/docs/models/operations/platformagentscancelrunresponse.md b/docs/models/operations/platformagentscancelrunresponse.md new file mode 100644 index 00000000..9a18819c --- /dev/null +++ b/docs/models/operations/platformagentscancelrunresponse.md @@ -0,0 +1,9 @@ +# PlatformAgentsCancelRunResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | +| `HTTPMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | +| `PlatformAgentRunResponse` | [*components.PlatformAgentRunResponse](../../models/components/platformagentrunresponse.md) | :heavy_minus_sign: | Current run snapshot after requesting cancellation, or an unchanged terminal run. | \ No newline at end of file diff --git a/docs/models/operations/platformagentscreaterunresponse.md b/docs/models/operations/platformagentscreaterunresponse.md index b556283c..23270fe1 100644 --- a/docs/models/operations/platformagentscreaterunresponse.md +++ b/docs/models/operations/platformagentscreaterunresponse.md @@ -3,8 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | -| `HTTPMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `PlatformAgentRunWaitResponse` | [*components.PlatformAgentRunWaitResponse](../../models/components/platformagentrunwaitresponse.md) | :heavy_minus_sign: | Successful response. | -| `Res` | `*string` | :heavy_minus_sign: | Successful response. | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `HTTPMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | +| `PlatformAgentRunWaitResponse` | [*components.PlatformAgentRunWaitResponse](../../models/components/platformagentrunwaitresponse.md) | :heavy_minus_sign: | Successful response. | +| `Res` | `*string` | :heavy_minus_sign: | Successful response. | +| `PlatformAgentRunResponse` | [*components.PlatformAgentRunResponse](../../models/components/platformagentrunresponse.md) | :heavy_minus_sign: | Durable run persisted and started. The snapshot is immediately retrievable through GET /api/agents/{agent_id}/runs/{run_id}. Execution failures appear in the run state.
| \ No newline at end of file diff --git a/docs/models/operations/platformagentscreaterunresponsesrequest.md b/docs/models/operations/platformagentscreaterunresponsesrequest.md new file mode 100644 index 00000000..c0003b18 --- /dev/null +++ b/docs/models/operations/platformagentscreaterunresponsesrequest.md @@ -0,0 +1,9 @@ +# PlatformAgentsCreateRunResponsesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `AgentID` | `string` | :heavy_check_mark: | ID of the agent that owns the run. | {agent_id} | +| `PlatformAgentRunResponsesRequest` | [components.PlatformAgentRunResponsesRequest](../../models/components/platformagentrunresponsesrequest.md) | :heavy_check_mark: | N/A | {
"run_id": "{run_id}",
"responses": [
{
"interaction_id": "{interaction_id}",
"decision": "APPROVE"
}
]
} | \ No newline at end of file diff --git a/docs/models/operations/platformagentscreaterunresponsesresponse.md b/docs/models/operations/platformagentscreaterunresponsesresponse.md new file mode 100644 index 00000000..154ce807 --- /dev/null +++ b/docs/models/operations/platformagentscreaterunresponsesresponse.md @@ -0,0 +1,9 @@ +# PlatformAgentsCreateRunResponsesResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | +| `HTTPMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | +| `PlatformAgentRunResponse` | [*components.PlatformAgentRunResponse](../../models/components/platformagentrunresponse.md) | :heavy_minus_sign: | Decisions accepted, or an identical retry. Poll GET run for continued execution. | \ No newline at end of file diff --git a/docs/models/operations/platformagentsgetrunrequest.md b/docs/models/operations/platformagentsgetrunrequest.md new file mode 100644 index 00000000..fd58e8f1 --- /dev/null +++ b/docs/models/operations/platformagentsgetrunrequest.md @@ -0,0 +1,9 @@ +# PlatformAgentsGetRunRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | +| `AgentID` | `string` | :heavy_check_mark: | ID of the agent that owns the run. | {agent_id} | +| `RunID` | `string` | :heavy_check_mark: | ID of the durable run to retrieve. | {run_id} | \ No newline at end of file diff --git a/docs/models/operations/platformagentsgetrunresponse.md b/docs/models/operations/platformagentsgetrunresponse.md new file mode 100644 index 00000000..9c4d88db --- /dev/null +++ b/docs/models/operations/platformagentsgetrunresponse.md @@ -0,0 +1,9 @@ +# PlatformAgentsGetRunResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | +| `HTTPMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | +| `PlatformAgentRunResponse` | [*components.PlatformAgentRunResponse](../../models/components/platformagentrunresponse.md) | :heavy_minus_sign: | Current persisted run snapshot. A failed execution is still a successful retrieval. | \ No newline at end of file diff --git a/docs/models/operations/platformchatcreateformat.md b/docs/models/operations/platformchatcreateformat.md new file mode 100644 index 00000000..477a77ee --- /dev/null +++ b/docs/models/operations/platformchatcreateformat.md @@ -0,0 +1,32 @@ +# PlatformChatCreateFormat + +Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. + + + +## Supported Types + +### PlatformChatTextFormat + +```go +platformChatCreateFormat := operations.CreatePlatformChatCreateFormatPlatformChatTextFormat(components.PlatformChatTextFormat{/* values here */}) +``` + +### PlatformChatJSONSchemaFormat + +```go +platformChatCreateFormat := operations.CreatePlatformChatCreateFormatPlatformChatJSONSchemaFormat(components.PlatformChatJSONSchemaFormat{/* values here */}) +``` + +## Union Discrimination + +Use the `Type` field to determine which variant is active, then access the corresponding field: + +```go +switch platformChatCreateFormat.Type { + case operations.PlatformChatCreateFormatTypePlatformChatTextFormat: + // platformChatCreateFormat.PlatformChatTextFormat is populated + case operations.PlatformChatCreateFormatTypePlatformChatJSONSchemaFormat: + // platformChatCreateFormat.PlatformChatJSONSchemaFormat is populated +} +``` diff --git a/docs/models/operations/platformchatcreaterequest.md b/docs/models/operations/platformchatcreaterequest.md index 2741f2e5..cf9312cc 100644 --- a/docs/models/operations/platformchatcreaterequest.md +++ b/docs/models/operations/platformchatcreaterequest.md @@ -3,9 +3,10 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | -| `Input` | [operations.PlatformChatCreateInput](../../models/operations/platformchatcreateinput.md) | :heavy_check_mark: | Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`.
| -| `Stream` | `*bool` | :heavy_minus_sign: | N/A | -| `Store` | `*bool` | :heavy_minus_sign: | When true (default), persist the interaction and return a `conversation_id`. When false, run ephemerally with no persistence.
| -| `ConversationID` | `*string` | :heavy_minus_sign: | Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`.
| \ No newline at end of file +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Input` | [operations.PlatformChatCreateInput](../../models/operations/platformchatcreateinput.md) | :heavy_check_mark: | Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`.
| +| `Stream` | `*bool` | :heavy_minus_sign: | N/A | +| `Store` | `*bool` | :heavy_minus_sign: | When true (default), persist the interaction and return a `conversation_id`. When false, run ephemerally with no persistence.
| +| `ConversationID` | `*string` | :heavy_minus_sign: | Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`.
| +| `Text` | [*operations.PlatformChatCreateText](../../models/operations/platformchatcreatetext.md) | :heavy_minus_sign: | Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true.
| \ No newline at end of file diff --git a/docs/models/operations/platformchatcreatestreamformat.md b/docs/models/operations/platformchatcreatestreamformat.md new file mode 100644 index 00000000..745f4030 --- /dev/null +++ b/docs/models/operations/platformchatcreatestreamformat.md @@ -0,0 +1,32 @@ +# PlatformChatCreateStreamFormat + +Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. + + + +## Supported Types + +### PlatformChatTextFormat + +```go +platformChatCreateStreamFormat := operations.CreatePlatformChatCreateStreamFormatPlatformChatTextFormat(components.PlatformChatTextFormat{/* values here */}) +``` + +### PlatformChatJSONSchemaFormat + +```go +platformChatCreateStreamFormat := operations.CreatePlatformChatCreateStreamFormatPlatformChatJSONSchemaFormat(components.PlatformChatJSONSchemaFormat{/* values here */}) +``` + +## Union Discrimination + +Use the `Type` field to determine which variant is active, then access the corresponding field: + +```go +switch platformChatCreateStreamFormat.Type { + case operations.PlatformChatCreateStreamFormatTypePlatformChatTextFormat: + // platformChatCreateStreamFormat.PlatformChatTextFormat is populated + case operations.PlatformChatCreateStreamFormatTypePlatformChatJSONSchemaFormat: + // platformChatCreateStreamFormat.PlatformChatJSONSchemaFormat is populated +} +``` diff --git a/docs/models/operations/platformchatcreatestreamrequest.md b/docs/models/operations/platformchatcreatestreamrequest.md index 45090306..2e0dc61f 100644 --- a/docs/models/operations/platformchatcreatestreamrequest.md +++ b/docs/models/operations/platformchatcreatestreamrequest.md @@ -3,9 +3,10 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | -| `Input` | [operations.PlatformChatCreateStreamInput](../../models/operations/platformchatcreatestreaminput.md) | :heavy_check_mark: | Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`.
| -| `Stream` | `*bool` | :heavy_minus_sign: | N/A | -| `Store` | `*bool` | :heavy_minus_sign: | When true (default), persist the interaction and return a `conversation_id`. When false, run ephemerally with no persistence.
| -| `ConversationID` | `*string` | :heavy_minus_sign: | Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`.
| \ No newline at end of file +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Input` | [operations.PlatformChatCreateStreamInput](../../models/operations/platformchatcreatestreaminput.md) | :heavy_check_mark: | Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`.
| +| `Stream` | `*bool` | :heavy_minus_sign: | N/A | +| `Store` | `*bool` | :heavy_minus_sign: | When true (default), persist the interaction and return a `conversation_id`. When false, run ephemerally with no persistence.
| +| `ConversationID` | `*string` | :heavy_minus_sign: | Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`.
| +| `Text` | [*operations.PlatformChatCreateStreamText](../../models/operations/platformchatcreatestreamtext.md) | :heavy_minus_sign: | Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true.
| \ No newline at end of file diff --git a/docs/models/operations/platformchatcreatestreamtext.md b/docs/models/operations/platformchatcreatestreamtext.md new file mode 100644 index 00000000..4359c98a --- /dev/null +++ b/docs/models/operations/platformchatcreatestreamtext.md @@ -0,0 +1,11 @@ +# PlatformChatCreateStreamText + +Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. + + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | +| `Format` | [*operations.PlatformChatCreateStreamFormat](../../models/operations/platformchatcreatestreamformat.md) | :heavy_minus_sign: | Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema.
| \ No newline at end of file diff --git a/docs/models/operations/platformchatcreatetext.md b/docs/models/operations/platformchatcreatetext.md new file mode 100644 index 00000000..3d060170 --- /dev/null +++ b/docs/models/operations/platformchatcreatetext.md @@ -0,0 +1,11 @@ +# PlatformChatCreateText + +Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. + + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | +| `Format` | [*operations.PlatformChatCreateFormat](../../models/operations/platformchatcreateformat.md) | :heavy_minus_sign: | Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema.
| \ No newline at end of file diff --git a/docs/sdks/agents/README.md b/docs/sdks/agents/README.md index 56d12e3f..af8dc6cf 100644 --- a/docs/sdks/agents/README.md +++ b/docs/sdks/agents/README.md @@ -8,6 +8,9 @@ * [Get](#get) - Get agent * [GetSchemas](#getschemas) - Get agent schemas * [CreateRun](#createrun) - Create agent run +* [GetRun](#getrun) - Get agent run +* [CancelRun](#cancelrun) - Cancel an agent run +* [RespondToRun](#respondtorun) - Respond to agent run approvals ## Search @@ -180,7 +183,7 @@ func main() { ## CreateRun -Execute an agent run. Set `stream` to true to receive server-sent events; otherwise the response contains the final agent messages. +Execute an agent run. By default, set `stream` to true to receive server-sent events; otherwise the response contains the final agent messages. Set `execution_mode` to `DURABLE` to persist a new run and return its initial snapshot with HTTP 201 without waiting for execution. Poll the agent-scoped GET run endpoint for progress. Durable execution continues after an HTTP disconnect, but is not automatically resumed after a QE restart or crash. An active turn becomes overdue more than 40 minutes after acceptance (a 30-minute execution timeout plus 10 minutes of grace). The next GET of the run marks the overdue turn FAILED without replay; there is no periodic sweep. Without a GET, the stored run can remain RUNNING. Failure does not prove that external tool work has stopped. Paused runs are not expired; an accepted approval continuation starts a fresh deadline. Each POST creates a new run; retrying a POST can create another execution. Submit pending approval decisions through the run responses endpoint, and cancellation can be requested through the run cancellations endpoint. A run tracks one workflow execution; automatic background-subagent wake turns are separate executions, not continuations tracked by this run ID. ### Example Usage @@ -246,4 +249,184 @@ func main() { | apierrors.PlatformUnauthorizedAgentToolsProblemError | 422 | application/problem+json | | apierrors.PlatformProblemDetailError | 400, 401, 403, 404, 408, 409, 413, 429 | application/problem+json | | apierrors.PlatformProblemDetailError | 500, 503 | application/problem+json | -| apierrors.APIError | 4XX, 5XX | \*/\* | \ No newline at end of file +| apierrors.APIError | 4XX, 5XX | \*/\* | + +## GetRun + +Retrieve a persisted workflow execution owned by the authenticated user. The run must belong to the specified agent, and the user must still have access to that agent. Unknown runs, runs owned by another user, and mismatched agent/run identifiers return 404. Requires the agents.run scope. Executions without a persisted workflow record are not available through this endpoint. + + +### Example Usage + + +```go +package main + +import( + "context" + "os" + apiclientgo "github.com/gleanwork/api-client-go" + "log" +) + +func main() { + ctx := context.Background() + + s := apiclientgo.New( + apiclientgo.WithSecurity(os.Getenv("GLEAN_API_TOKEN")), + ) + + res, err := s.Agents.GetRun(ctx, "{agent_id}", "{run_id}") + if err != nil { + log.Fatal(err) + } + if res.PlatformAgentRunResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `agentID` | `string` | :heavy_check_mark: | ID of the agent that owns the run. | {agent_id} | +| `runID` | `string` | :heavy_check_mark: | ID of the durable run to retrieve. | {run_id} | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | + +### Response + +**[*operations.PlatformAgentsGetRunResponse](../../models/operations/platformagentsgetrunresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | +| apierrors.PlatformProblemDetailError | 400, 401, 403, 404, 408, 429 | application/problem+json | +| apierrors.PlatformProblemDetailError | 500, 503 | application/problem+json | +| apierrors.APIError | 4XX, 5XX | \*/\* | + +## CancelRun + +Request cooperative cancellation of the durable agent run identified by `run_id` in the JSON body. Requires ownership, current agent access, and the agents.run scope. Sending a cancellation signal does not itself change an active run from RUNNING; poll GET run for the final state. Paused runs become CANCELLED without resuming execution. Repeated requests and requests for terminal runs return the current snapshot. Completion may win a race with cancellation. Completed tool side effects cannot be undone, and external work may continue if a tool does not support cancellation. Cancellation targets this run, not separate background-subagent executions. An active run without a cancellation registration returns 409. Cancellation signaling requires Redis. An interrupted active run can instead become FAILED through deadline cleanup; this does not verify that external tool work has stopped. + + +### Example Usage + + +```go +package main + +import( + "context" + "os" + apiclientgo "github.com/gleanwork/api-client-go" + "github.com/gleanwork/api-client-go/models/components" + "log" +) + +func main() { + ctx := context.Background() + + s := apiclientgo.New( + apiclientgo.WithSecurity(os.Getenv("GLEAN_API_TOKEN")), + ) + + res, err := s.Agents.CancelRun(ctx, "{agent_id}", components.PlatformAgentRunCancellationRequest{ + RunID: "{run_id}", + }) + if err != nil { + log.Fatal(err) + } + if res.PlatformAgentRunResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `agentID` | `string` | :heavy_check_mark: | ID of the agent that owns the run. | {agent_id} | +| `platformAgentRunCancellationRequest` | [components.PlatformAgentRunCancellationRequest](../../models/components/platformagentruncancellationrequest.md) | :heavy_check_mark: | N/A | {
"run_id": "{run_id}"
} | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | + +### Response + +**[*operations.PlatformAgentsCancelRunResponse](../../models/operations/platformagentscancelrunresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| apierrors.PlatformProblemDetailError | 400, 401, 403, 404, 408, 409, 413, 429 | application/problem+json | +| apierrors.PlatformProblemDetailError | 500, 503 | application/problem+json | +| apierrors.APIError | 4XX, 5XX | \*/\* | + +## RespondToRun + +Submit decisions for every pending tool approval in the paused run's current batch. The run is identified by `run_id` in the JSON body. Decisions apply only to the stored invocations and arguments; argument edits, authentication responses, and session-wide grants are not supported. The caller must own the run, still have agent access, and have the agents.run scope. Acceptance persists the decisions before resuming the same run and chat session. Identical accepted decisions return the current snapshot without another continuation. Conflicting, stale, incomplete, or non-pending decisions return 409. Cancellation registration failure returns 503 without accepting the decisions; retry the same approval batch. This retry guarantee does not cover an indeterminate database commit outcome. Go workflow approval resumes currently support one tool invocation and one approval response. Unsupported multi-tool or multi-decision Go resumes fail without executing tools. The resumed action must resolve to the tool identified by the stored approval request and paused checkpoint. Missing or inconsistent identity fails without executing tools. Execution continues after HTTP disconnects, but is not automatically resumed after a QE crash. Each accepted continuation starts a fresh 30-minute execution timeout and 40-minute cleanup deadline. Identical retries do not extend that deadline. Waiting for approval does not expire a run. The next GET marks an overdue active turn FAILED without replaying execution. + + +### Example Usage + + +```go +package main + +import( + "context" + "os" + apiclientgo "github.com/gleanwork/api-client-go" + "github.com/gleanwork/api-client-go/models/components" + "log" +) + +func main() { + ctx := context.Background() + + s := apiclientgo.New( + apiclientgo.WithSecurity(os.Getenv("GLEAN_API_TOKEN")), + ) + + res, err := s.Agents.RespondToRun(ctx, "{agent_id}", components.PlatformAgentRunResponsesRequest{ + RunID: "{run_id}", + Responses: []components.PlatformAgentRunApprovalDecision{ + components.PlatformAgentRunApprovalDecision{ + InteractionID: "{interaction_id}", + Decision: components.DecisionApprove, + }, + }, + }) + if err != nil { + log.Fatal(err) + } + if res.PlatformAgentRunResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `agentID` | `string` | :heavy_check_mark: | ID of the agent that owns the run. | {agent_id} | +| `platformAgentRunResponsesRequest` | [components.PlatformAgentRunResponsesRequest](../../models/components/platformagentrunresponsesrequest.md) | :heavy_check_mark: | N/A | {
"run_id": "{run_id}",
"responses": [
{
"interaction_id": "{interaction_id}",
"decision": "APPROVE"
}
]
} | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | + +### Response + +**[*operations.PlatformAgentsCreateRunResponsesResponse](../../models/operations/platformagentscreaterunresponsesresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| apierrors.PlatformProblemDetailError | 400, 401, 403, 404, 408, 409, 413, 429 | application/problem+json | +| apierrors.PlatformProblemDetailError | 500, 503 | application/problem+json | +| apierrors.APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/chat/README.md b/docs/sdks/chat/README.md index a967e884..c9535104 100644 --- a/docs/sdks/chat/README.md +++ b/docs/sdks/chat/README.md @@ -23,6 +23,7 @@ import( "os" apiclientgo "github.com/gleanwork/api-client-go" "github.com/gleanwork/api-client-go/models/operations" + "github.com/gleanwork/api-client-go/models/components" "log" ) @@ -35,8 +36,31 @@ func main() { res, err := s.Chat.Create(ctx, operations.PlatformChatCreateRequest{ Input: operations.CreatePlatformChatCreateInputStr( - "What is our parental leave policy?", + "Summarize our parental leave policy as JSON.", ), + Text: &operations.PlatformChatCreateText{ + Format: apiclientgo.Pointer(operations.CreatePlatformChatCreateFormatPlatformChatJSONSchemaFormat( + components.PlatformChatJSONSchemaFormat{ + Type: components.PlatformChatJSONSchemaFormatTypeJSONSchema, + Name: "policy_summary", + Schema: map[string]any{ + "type": "object", + "properties": map[string]any{ + "eligible_employees": map[string]any{ + "type": "string", + }, + "duration_weeks": map[string]any{ + "type": "integer", + }, + }, + "required": []any{ + "eligible_employees", + "duration_weeks", + }, + }, + }, + )), + }, }) if err != nil { log.Fatal(err) @@ -83,6 +107,7 @@ import( "os" apiclientgo "github.com/gleanwork/api-client-go" "github.com/gleanwork/api-client-go/models/operations" + "github.com/gleanwork/api-client-go/models/components" "log" ) @@ -95,8 +120,31 @@ func main() { res, err := s.Chat.CreateStream(ctx, operations.PlatformChatCreateStreamRequest{ Input: operations.CreatePlatformChatCreateStreamInputStr( - "What is our parental leave policy?", + "Summarize our parental leave policy as JSON.", ), + Text: &operations.PlatformChatCreateStreamText{ + Format: apiclientgo.Pointer(operations.CreatePlatformChatCreateStreamFormatPlatformChatJSONSchemaFormat( + components.PlatformChatJSONSchemaFormat{ + Type: components.PlatformChatJSONSchemaFormatTypeJSONSchema, + Name: "policy_summary", + Schema: map[string]any{ + "type": "object", + "properties": map[string]any{ + "eligible_employees": map[string]any{ + "type": "string", + }, + "duration_weeks": map[string]any{ + "type": "integer", + }, + }, + "required": []any{ + "eligible_employees", + "duration_weeks", + }, + }, + }, + )), + }, }) if err != nil { log.Fatal(err) diff --git a/glean.go b/glean.go index ddc49b20..1de99baf 100644 --- a/glean.go +++ b/glean.go @@ -2,7 +2,7 @@ package apiclientgo -// Generated from OpenAPI doc version 0.9.0 and generator version 2.937.18 +// Generated from OpenAPI doc version 0.9.0 and generator version 2.938.0 import ( "context" @@ -161,11 +161,11 @@ func WithTimeout(timeout time.Duration) SDKOption { // New creates a new instance of the SDK with the provided options func New(opts ...SDKOption) *Glean { sdk := &Glean{ - SDKVersion: "0.15.14", + SDKVersion: "0.15.15", sdkConfiguration: config.SDKConfiguration{ - UserAgent: "speakeasy-sdk/go 0.15.14 2.937.18 0.9.0 github.com/gleanwork/api-client-go", - SDKVersion: "0.15.14", - GenVersion: "2.937.18", + UserAgent: "speakeasy-sdk/go 0.15.15 2.938.0 0.9.0 github.com/gleanwork/api-client-go", + SDKVersion: "0.15.15", + GenVersion: "2.938.0", OpenAPIDocVersion: "0.9.0", ServerList: ServerList, ServerVariables: []map[string]string{ diff --git a/models/components/feedentry.go b/models/components/feedentry.go index 86228c48..41628c63 100644 --- a/models/components/feedentry.go +++ b/models/components/feedentry.go @@ -122,6 +122,8 @@ const ( JustificationTypeEditDoc JustificationType = "EDIT_DOC" JustificationTypeChatToArtifact JustificationType = "CHAT_TO_ARTIFACT" JustificationTypeShareArtifact JustificationType = "SHARE_ARTIFACT" + JustificationTypeCreateAgent JustificationType = "CREATE_AGENT" + JustificationTypeManagerInvite JustificationType = "MANAGER_INVITE" ) func (e JustificationType) ToPointer() *JustificationType { @@ -132,7 +134,7 @@ func (e JustificationType) ToPointer() *JustificationType { func (e *JustificationType) IsExact() bool { if e != nil { switch *e { - case "FREQUENTLY_ACCESSED", "RECENTLY_ACCESSED", "TRENDING_DOCUMENT", "VERIFICATION_REMINDER", "SUGGESTED_DOCUMENT", "EMPTY_STATE_SUGGESTION", "FRECENCY_SCORED", "SERVER_GENERATED", "USE_CASE", "UPDATE_SINCE_LAST_VIEW", "RECENTLY_STARTED", "EVENT", "USER_MENTION", "ANNOUNCEMENT", "EXTERNAL_ANNOUNCEMENT", "POPULARITY_BASED_TRENDING", "COMPANY_RESOURCE", "EVENT_DOCUMENT_FROM_CONTENT", "EVENT_DOCUMENT_FROM_SEARCH", "VISIT_AFFINITY_SCORED", "SUGGESTED_APP", "SUGGESTED_PERSON", "ACTIVITY_HIGHLIGHT", "SAVED_SEARCH", "SUGGESTED_CHANNEL", "PEOPLE_CELEBRATIONS", "SOCIAL_LINK", "ZERO_STATE_CHAT_SUGGESTION", "ZERO_STATE_CHAT_TOOL_SUGGESTION", "ZERO_STATE_PROMPT_TEMPLATE_SUGGESTION", "ZERO_STATE_STATIC_WORKFLOW_SUGGESTION", "ZERO_STATE_AGENT_SUGGESTION", "PERSONALIZED_CHAT_SUGGESTION", "DAILY_DIGEST", "PODCAST", "TASK", "PLAN_MY_DAY", "END_MY_DAY", "STARTER_KIT_EXTENSION", "STARTER_KIT_ORG_CHART", "STARTER_KIT_ADD_DOC", "MEETING_RECAP", "MEETING_ROOM", "MEETING_PREP_AUTOMATION", "ACTIVE_DISCUSSION", "MID_DAY_CATCH_UP", "QUERY_SUGGESTION", "COWORK_CUJ_PROMO", "CARD_STACK_PROMO", "WEEKLY_MEETINGS", "FOLLOW_UP", "MILESTONE_TIMELINE_CHECK", "PROJECT_DISCUSSION_DIGEST", "PROJECT_FOCUS_BLOCK", "PROJECT_NEXT_STEP", "DEMO_CARD", "RESOLVE_MEETING_CONFLICT", "FINDING_MEETING_ROOM", "OOO_PLANNER", "OOO_CATCH_UP", "ADMIN_HEALTH_CENTER", "KNOWLEDGE_GAP", "ARTIFACT_CREATION", "EDIT_DOC", "CHAT_TO_ARTIFACT", "SHARE_ARTIFACT": + case "FREQUENTLY_ACCESSED", "RECENTLY_ACCESSED", "TRENDING_DOCUMENT", "VERIFICATION_REMINDER", "SUGGESTED_DOCUMENT", "EMPTY_STATE_SUGGESTION", "FRECENCY_SCORED", "SERVER_GENERATED", "USE_CASE", "UPDATE_SINCE_LAST_VIEW", "RECENTLY_STARTED", "EVENT", "USER_MENTION", "ANNOUNCEMENT", "EXTERNAL_ANNOUNCEMENT", "POPULARITY_BASED_TRENDING", "COMPANY_RESOURCE", "EVENT_DOCUMENT_FROM_CONTENT", "EVENT_DOCUMENT_FROM_SEARCH", "VISIT_AFFINITY_SCORED", "SUGGESTED_APP", "SUGGESTED_PERSON", "ACTIVITY_HIGHLIGHT", "SAVED_SEARCH", "SUGGESTED_CHANNEL", "PEOPLE_CELEBRATIONS", "SOCIAL_LINK", "ZERO_STATE_CHAT_SUGGESTION", "ZERO_STATE_CHAT_TOOL_SUGGESTION", "ZERO_STATE_PROMPT_TEMPLATE_SUGGESTION", "ZERO_STATE_STATIC_WORKFLOW_SUGGESTION", "ZERO_STATE_AGENT_SUGGESTION", "PERSONALIZED_CHAT_SUGGESTION", "DAILY_DIGEST", "PODCAST", "TASK", "PLAN_MY_DAY", "END_MY_DAY", "STARTER_KIT_EXTENSION", "STARTER_KIT_ORG_CHART", "STARTER_KIT_ADD_DOC", "MEETING_RECAP", "MEETING_ROOM", "MEETING_PREP_AUTOMATION", "ACTIVE_DISCUSSION", "MID_DAY_CATCH_UP", "QUERY_SUGGESTION", "COWORK_CUJ_PROMO", "CARD_STACK_PROMO", "WEEKLY_MEETINGS", "FOLLOW_UP", "MILESTONE_TIMELINE_CHECK", "PROJECT_DISCUSSION_DIGEST", "PROJECT_FOCUS_BLOCK", "PROJECT_NEXT_STEP", "DEMO_CARD", "RESOLVE_MEETING_CONFLICT", "FINDING_MEETING_ROOM", "OOO_PLANNER", "OOO_CATCH_UP", "ADMIN_HEALTH_CENTER", "KNOWLEDGE_GAP", "ARTIFACT_CREATION", "EDIT_DOC", "CHAT_TO_ARTIFACT", "SHARE_ARTIFACT", "CREATE_AGENT", "MANAGER_INVITE": return true } } diff --git a/models/components/feedrequest.go b/models/components/feedrequest.go index bee5b0e1..2b2692b2 100644 --- a/models/components/feedrequest.go +++ b/models/components/feedrequest.go @@ -62,6 +62,8 @@ const ( FeedRequestCategoryEditDoc FeedRequestCategory = "EDIT_DOC" FeedRequestCategoryChatToArtifact FeedRequestCategory = "CHAT_TO_ARTIFACT" FeedRequestCategoryShareArtifact FeedRequestCategory = "SHARE_ARTIFACT" + FeedRequestCategoryCreateAgent FeedRequestCategory = "CREATE_AGENT" + FeedRequestCategoryManagerInvite FeedRequestCategory = "MANAGER_INVITE" ) func (e FeedRequestCategory) ToPointer() *FeedRequestCategory { @@ -176,6 +178,10 @@ func (e *FeedRequestCategory) UnmarshalJSON(data []byte) error { case "CHAT_TO_ARTIFACT": fallthrough case "SHARE_ARTIFACT": + fallthrough + case "CREATE_AGENT": + fallthrough + case "MANAGER_INVITE": *e = FeedRequestCategory(v) return nil default: diff --git a/models/components/feedresult.go b/models/components/feedresult.go index 36b35170..55ef7393 100644 --- a/models/components/feedresult.go +++ b/models/components/feedresult.go @@ -58,6 +58,8 @@ const ( FeedResultCategoryEditDoc FeedResultCategory = "EDIT_DOC" FeedResultCategoryChatToArtifact FeedResultCategory = "CHAT_TO_ARTIFACT" FeedResultCategoryShareArtifact FeedResultCategory = "SHARE_ARTIFACT" + FeedResultCategoryCreateAgent FeedResultCategory = "CREATE_AGENT" + FeedResultCategoryManagerInvite FeedResultCategory = "MANAGER_INVITE" ) func (e FeedResultCategory) ToPointer() *FeedResultCategory { @@ -68,7 +70,7 @@ func (e FeedResultCategory) ToPointer() *FeedResultCategory { func (e *FeedResultCategory) IsExact() bool { if e != nil { switch *e { - case "DOCUMENT_SUGGESTION", "DOCUMENT_SUGGESTION_SCENARIO", "TRENDING_DOCUMENT", "USE_CASE", "VERIFICATION_REMINDER", "EVENT", "ANNOUNCEMENT", "MENTION", "DATASOURCE_AFFINITY", "RECENT", "COMPANY_RESOURCE", "EXPERIMENTAL", "PEOPLE_CELEBRATIONS", "SOCIAL_LINK", "EXTERNAL_TASKS", "DISPLAYABLE_LIST", "ZERO_STATE_CHAT_SUGGESTION", "ZERO_STATE_CHAT_TOOL_SUGGESTION", "ZERO_STATE_WORKFLOW_CREATED_BY_ME", "ZERO_STATE_WORKFLOW_FAVORITES", "ZERO_STATE_WORKFLOW_POPULAR", "ZERO_STATE_WORKFLOW_RECENT", "ZERO_STATE_WORKFLOW_SUGGESTION", "PERSONALIZED_CHAT_SUGGESTION", "DAILY_DIGEST", "PODCAST", "TASK", "PLAN_MY_DAY", "END_MY_DAY", "STARTER_KIT", "MEETING_PREP_AUTOMATION", "MID_DAY_CATCH_UP", "QUERY_SUGGESTION", "COWORK_CUJ_PROMO", "CARD_STACK_PROMO", "WEEKLY_MEETINGS", "FOLLOW_UP", "MILESTONE_TIMELINE_CHECK", "PROJECT_DISCUSSION_DIGEST", "PROJECT_FOCUS_BLOCK", "PROJECT_NEXT_STEP", "DEMO_CARD", "RESOLVE_MEETING_CONFLICT", "FINDING_MEETING_ROOM", "OOO_PLANNER", "OOO_CATCH_UP", "ADMIN_HEALTH_CENTER", "KNOWLEDGE_GAP", "ARTIFACT_CREATION", "EDIT_DOC", "CHAT_TO_ARTIFACT", "SHARE_ARTIFACT": + case "DOCUMENT_SUGGESTION", "DOCUMENT_SUGGESTION_SCENARIO", "TRENDING_DOCUMENT", "USE_CASE", "VERIFICATION_REMINDER", "EVENT", "ANNOUNCEMENT", "MENTION", "DATASOURCE_AFFINITY", "RECENT", "COMPANY_RESOURCE", "EXPERIMENTAL", "PEOPLE_CELEBRATIONS", "SOCIAL_LINK", "EXTERNAL_TASKS", "DISPLAYABLE_LIST", "ZERO_STATE_CHAT_SUGGESTION", "ZERO_STATE_CHAT_TOOL_SUGGESTION", "ZERO_STATE_WORKFLOW_CREATED_BY_ME", "ZERO_STATE_WORKFLOW_FAVORITES", "ZERO_STATE_WORKFLOW_POPULAR", "ZERO_STATE_WORKFLOW_RECENT", "ZERO_STATE_WORKFLOW_SUGGESTION", "PERSONALIZED_CHAT_SUGGESTION", "DAILY_DIGEST", "PODCAST", "TASK", "PLAN_MY_DAY", "END_MY_DAY", "STARTER_KIT", "MEETING_PREP_AUTOMATION", "MID_DAY_CATCH_UP", "QUERY_SUGGESTION", "COWORK_CUJ_PROMO", "CARD_STACK_PROMO", "WEEKLY_MEETINGS", "FOLLOW_UP", "MILESTONE_TIMELINE_CHECK", "PROJECT_DISCUSSION_DIGEST", "PROJECT_FOCUS_BLOCK", "PROJECT_NEXT_STEP", "DEMO_CARD", "RESOLVE_MEETING_CONFLICT", "FINDING_MEETING_ROOM", "OOO_PLANNER", "OOO_CATCH_UP", "ADMIN_HEALTH_CENTER", "KNOWLEDGE_GAP", "ARTIFACT_CREATION", "EDIT_DOC", "CHAT_TO_ARTIFACT", "SHARE_ARTIFACT", "CREATE_AGENT", "MANAGER_INVITE": return true } } diff --git a/models/components/platformagentrunapprovaldecision.go b/models/components/platformagentrunapprovaldecision.go new file mode 100644 index 00000000..ee17b58c --- /dev/null +++ b/models/components/platformagentrunapprovaldecision.go @@ -0,0 +1,57 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// Decision - The decision for this invocation only. Rejection follows normal workflow behavior. +type Decision string + +const ( + DecisionApprove Decision = "APPROVE" + DecisionReject Decision = "REJECT" +) + +func (e Decision) ToPointer() *Decision { + return &e +} +func (e *Decision) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "APPROVE": + fallthrough + case "REJECT": + *e = Decision(v) + return nil + default: + return fmt.Errorf("invalid value for Decision: %v", v) + } +} + +// PlatformAgentRunApprovalDecision - Approve or reject the invocation identified by a pending interaction ID. +type PlatformAgentRunApprovalDecision struct { + // The interaction_id returned in the run's pending_interactions. + InteractionID string `json:"interaction_id"` + // The decision for this invocation only. Rejection follows normal workflow behavior. + Decision Decision `json:"decision"` +} + +func (p *PlatformAgentRunApprovalDecision) GetInteractionID() string { + if p == nil { + return "" + } + return p.InteractionID +} + +func (p *PlatformAgentRunApprovalDecision) GetDecision() Decision { + if p == nil { + return Decision("") + } + return p.Decision +} diff --git a/models/components/platformagentruncancellationrequest.go b/models/components/platformagentruncancellationrequest.go new file mode 100644 index 00000000..7fd15acf --- /dev/null +++ b/models/components/platformagentruncancellationrequest.go @@ -0,0 +1,16 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// PlatformAgentRunCancellationRequest - Request cooperative cancellation of a run owned by the caller. +type PlatformAgentRunCancellationRequest struct { + // ID of the run to cancel. Must belong to the agent identified in the path. + RunID string `json:"run_id"` +} + +func (p *PlatformAgentRunCancellationRequest) GetRunID() string { + if p == nil { + return "" + } + return p.RunID +} diff --git a/models/components/platformagentruncreaterequest.go b/models/components/platformagentruncreaterequest.go index c7307611..1b770122 100644 --- a/models/components/platformagentruncreaterequest.go +++ b/models/components/platformagentruncreaterequest.go @@ -3,9 +3,38 @@ package components import ( + "encoding/json" + "fmt" "github.com/gleanwork/api-client-go/internal/utils" ) +// ExecutionMode - REQUEST_BOUND preserves the existing wait/stream behavior. DURABLE starts a fresh, persisted execution with a 30-minute execution timeout and returns immediately. DURABLE requires stream to be false or omitted and does not accept metadata.chat_session_id. It does not bypass tool approval requirements or provide automatic QE-crash resumption. Expiry is read-triggered: the next GET of the run marks an active turn FAILED if more than 40 minutes have passed since the turn was accepted. There is no periodic sweep, so the stored run can remain RUNNING until it is read. Expiry never replays execution or expires approval-paused runs, and failure does not prove that external tool work has stopped. +type ExecutionMode string + +const ( + ExecutionModeRequestBound ExecutionMode = "REQUEST_BOUND" + ExecutionModeDurable ExecutionMode = "DURABLE" +) + +func (e ExecutionMode) ToPointer() *ExecutionMode { + return &e +} +func (e *ExecutionMode) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "REQUEST_BOUND": + fallthrough + case "DURABLE": + *e = ExecutionMode(v) + return nil + default: + return fmt.Errorf("invalid value for ExecutionMode: %v", v) + } +} + // PlatformAgentRunCreateRequest - Request to run an agent. A request MUST supply either `messages` (a non-empty conversation) or `input` (for input-form triggered agents). type PlatformAgentRunCreateRequest struct { // Input fields for an input-form triggered agent. @@ -15,8 +44,11 @@ type PlatformAgentRunCreateRequest struct { Messages []PlatformMessageInput `json:"messages,omitempty"` // Metadata to pass to the agent. Metadata map[string]any `json:"metadata,omitempty"` - // Whether to stream the run response as server-sent events. + // Whether to stream the run response as server-sent events. Not supported in DURABLE mode. Stream *bool `default:"false" json:"stream"` + // REQUEST_BOUND preserves the existing wait/stream behavior. DURABLE starts a fresh, persisted execution with a 30-minute execution timeout and returns immediately. DURABLE requires stream to be false or omitted and does not accept metadata.chat_session_id. It does not bypass tool approval requirements or provide automatic QE-crash resumption. Expiry is read-triggered: the next GET of the run marks an active turn FAILED if more than 40 minutes have passed since the turn was accepted. There is no periodic sweep, so the stored run can remain RUNNING until it is read. Expiry never replays execution or expires approval-paused runs, and failure does not prove that external tool work has stopped. + // + ExecutionMode *ExecutionMode `default:"REQUEST_BOUND" json:"execution_mode"` } func (p PlatformAgentRunCreateRequest) MarshalJSON() ([]byte, error) { @@ -57,3 +89,10 @@ func (p *PlatformAgentRunCreateRequest) GetStream() *bool { } return p.Stream } + +func (p *PlatformAgentRunCreateRequest) GetExecutionMode() *ExecutionMode { + if p == nil { + return nil + } + return p.ExecutionMode +} diff --git a/models/components/platformagentrunerror.go b/models/components/platformagentrunerror.go new file mode 100644 index 00000000..5bd60768 --- /dev/null +++ b/models/components/platformagentrunerror.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// PlatformAgentRunError - Caller-safe details of an agent run execution failure. +type PlatformAgentRunError struct { + // Machine-readable execution failure code. + Code string `json:"code"` + // Caller-safe execution failure description. + Message string `json:"message"` +} + +func (p *PlatformAgentRunError) GetCode() string { + if p == nil { + return "" + } + return p.Code +} + +func (p *PlatformAgentRunError) GetMessage() string { + if p == nil { + return "" + } + return p.Message +} diff --git a/models/components/platformagentrunresponse.go b/models/components/platformagentrunresponse.go new file mode 100644 index 00000000..e929b795 --- /dev/null +++ b/models/components/platformagentrunresponse.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// PlatformAgentRunResponse - Persisted agent run snapshot with a request ID for support correlation. +type PlatformAgentRunResponse struct { + // Agent run state, pending tool approvals, and output available independently of the creation request. + Run PlatformDurableAgentRun `json:"run"` + // Platform-generated request ID for support correlation. + RequestID string `json:"request_id"` +} + +func (p *PlatformAgentRunResponse) GetRun() PlatformDurableAgentRun { + if p == nil { + return PlatformDurableAgentRun{} + } + return p.Run +} + +func (p *PlatformAgentRunResponse) GetRequestID() string { + if p == nil { + return "" + } + return p.RequestID +} diff --git a/models/components/platformagentrunresponsesrequest.go b/models/components/platformagentrunresponsesrequest.go new file mode 100644 index 00000000..22e29a22 --- /dev/null +++ b/models/components/platformagentrunresponsesrequest.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// PlatformAgentRunResponsesRequest - Invocation-scoped decisions for the complete pending approval batch. +type PlatformAgentRunResponsesRequest struct { + // ID of the run whose pending approvals are being answered. Must belong to the agent identified in the path. + RunID string `json:"run_id"` + // One decision per pending interaction. Interaction IDs must be unique. + Responses []PlatformAgentRunApprovalDecision `json:"responses"` +} + +func (p *PlatformAgentRunResponsesRequest) GetRunID() string { + if p == nil { + return "" + } + return p.RunID +} + +func (p *PlatformAgentRunResponsesRequest) GetResponses() []PlatformAgentRunApprovalDecision { + if p == nil { + return []PlatformAgentRunApprovalDecision{} + } + return p.Responses +} diff --git a/models/components/platformagentrunstate.go b/models/components/platformagentrunstate.go new file mode 100644 index 00000000..7369bc41 --- /dev/null +++ b/models/components/platformagentrunstate.go @@ -0,0 +1,32 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// PlatformAgentRunState - State of the persisted workflow execution. REQUIRES_INPUT is nonterminal. +type PlatformAgentRunState string + +const ( + PlatformAgentRunStateQueued PlatformAgentRunState = "QUEUED" + PlatformAgentRunStateRunning PlatformAgentRunState = "RUNNING" + PlatformAgentRunStateRequiresInput PlatformAgentRunState = "REQUIRES_INPUT" + PlatformAgentRunStateSucceeded PlatformAgentRunState = "SUCCEEDED" + PlatformAgentRunStateFailed PlatformAgentRunState = "FAILED" + PlatformAgentRunStateCancelling PlatformAgentRunState = "CANCELLING" + PlatformAgentRunStateCancelled PlatformAgentRunState = "CANCELLED" + PlatformAgentRunStateExpired PlatformAgentRunState = "EXPIRED" +) + +func (e PlatformAgentRunState) ToPointer() *PlatformAgentRunState { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *PlatformAgentRunState) IsExact() bool { + if e != nil { + switch *e { + case "QUEUED", "RUNNING", "REQUIRES_INPUT", "SUCCEEDED", "FAILED", "CANCELLING", "CANCELLED", "EXPIRED": + return true + } + } + return false +} diff --git a/models/components/platformagentruntoolapproval.go b/models/components/platformagentruntoolapproval.go new file mode 100644 index 00000000..5c13cbdb --- /dev/null +++ b/models/components/platformagentruntoolapproval.go @@ -0,0 +1,112 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/gleanwork/api-client-go/internal/utils" + "time" +) + +// PlatformAgentRunToolApprovalType - Interaction type identifying a tool execution approval request. +type PlatformAgentRunToolApprovalType string + +const ( + PlatformAgentRunToolApprovalTypeToolApproval PlatformAgentRunToolApprovalType = "TOOL_APPROVAL" +) + +func (e PlatformAgentRunToolApprovalType) ToPointer() *PlatformAgentRunToolApprovalType { + return &e +} +func (e *PlatformAgentRunToolApprovalType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "TOOL_APPROVAL": + *e = PlatformAgentRunToolApprovalType(v) + return nil + default: + return fmt.Errorf("invalid value for PlatformAgentRunToolApprovalType: %v", v) + } +} + +// PlatformAgentRunToolApproval - Pending approval for a specific persisted tool invocation and its arguments. +type PlatformAgentRunToolApproval struct { + // Identifies this specific invocation approval, not the tool definition. + InteractionID string `json:"interaction_id"` + // Interaction type identifying a tool execution approval request. + Type PlatformAgentRunToolApprovalType `json:"type"` + // Platform tool identifier when recorded. Omitted for requests without one, such as some MCP tools. + ToolID *string `json:"tool_id,omitempty"` + // Display name of the tool requesting approval. + DisplayName string `json:"display_name"` + // Description of the tool associated with this approval request. + Description string `json:"description"` + // Arguments from the persisted approval request. Older platform tools use flattened parameters. + Arguments map[string]any `json:"arguments"` + // Approval deadline, when one is set. Omitted when the approval has no expiration. + ExpiresAt *time.Time `json:"expires_at,omitempty"` +} + +func (p PlatformAgentRunToolApproval) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PlatformAgentRunToolApproval) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, nil); err != nil { + return err + } + return nil +} + +func (p *PlatformAgentRunToolApproval) GetInteractionID() string { + if p == nil { + return "" + } + return p.InteractionID +} + +func (p *PlatformAgentRunToolApproval) GetType() PlatformAgentRunToolApprovalType { + if p == nil { + return PlatformAgentRunToolApprovalType("") + } + return p.Type +} + +func (p *PlatformAgentRunToolApproval) GetToolID() *string { + if p == nil { + return nil + } + return p.ToolID +} + +func (p *PlatformAgentRunToolApproval) GetDisplayName() string { + if p == nil { + return "" + } + return p.DisplayName +} + +func (p *PlatformAgentRunToolApproval) GetDescription() string { + if p == nil { + return "" + } + return p.Description +} + +func (p *PlatformAgentRunToolApproval) GetArguments() map[string]any { + if p == nil { + return map[string]any{} + } + return p.Arguments +} + +func (p *PlatformAgentRunToolApproval) GetExpiresAt() *time.Time { + if p == nil { + return nil + } + return p.ExpiresAt +} diff --git a/models/components/platformchatjsonschemaformat.go b/models/components/platformchatjsonschemaformat.go new file mode 100644 index 00000000..08394674 --- /dev/null +++ b/models/components/platformchatjsonschemaformat.go @@ -0,0 +1,94 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/gleanwork/api-client-go/internal/utils" +) + +// PlatformChatJSONSchemaFormatType - Discriminator. Must be JSON_SCHEMA. +type PlatformChatJSONSchemaFormatType string + +const ( + PlatformChatJSONSchemaFormatTypeJSONSchema PlatformChatJSONSchemaFormatType = "JSON_SCHEMA" +) + +func (e PlatformChatJSONSchemaFormatType) ToPointer() *PlatformChatJSONSchemaFormatType { + return &e +} +func (e *PlatformChatJSONSchemaFormatType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "JSON_SCHEMA": + *e = PlatformChatJSONSchemaFormatType(v) + return nil + default: + return fmt.Errorf("invalid value for PlatformChatJSONSchemaFormatType: %v", v) + } +} + +// PlatformChatJSONSchemaFormat - Constrains the assistant response to a caller-supplied JSON Schema. +type PlatformChatJSONSchemaFormat struct { + // Discriminator. Must be JSON_SCHEMA. + Type PlatformChatJSONSchemaFormatType `json:"type"` + // A stable identifier for the schema. + Name string `json:"name"` + // An optional human-readable description of the schema. + Description *string `json:"description,omitempty"` + // A JSON Schema object describing the desired output shape. + Schema map[string]any `json:"schema"` + // When true, the provider validates the response against the schema. Unsupported by some providers; defaults to true. + // + Strict *bool `default:"true" json:"strict"` +} + +func (p PlatformChatJSONSchemaFormat) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PlatformChatJSONSchemaFormat) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, nil); err != nil { + return err + } + return nil +} + +func (p *PlatformChatJSONSchemaFormat) GetType() PlatformChatJSONSchemaFormatType { + if p == nil { + return PlatformChatJSONSchemaFormatType("") + } + return p.Type +} + +func (p *PlatformChatJSONSchemaFormat) GetName() string { + if p == nil { + return "" + } + return p.Name +} + +func (p *PlatformChatJSONSchemaFormat) GetDescription() *string { + if p == nil { + return nil + } + return p.Description +} + +func (p *PlatformChatJSONSchemaFormat) GetSchema() map[string]any { + if p == nil { + return map[string]any{} + } + return p.Schema +} + +func (p *PlatformChatJSONSchemaFormat) GetStrict() *bool { + if p == nil { + return nil + } + return p.Strict +} diff --git a/models/components/platformchatoutputtextcontent.go b/models/components/platformchatoutputtextcontent.go index 80419d11..920248ed 100644 --- a/models/components/platformchatoutputtextcontent.go +++ b/models/components/platformchatoutputtextcontent.go @@ -31,10 +31,28 @@ func (e *PlatformChatOutputTextContentType) UnmarshalJSON(data []byte) error { } } +// StructuredOutput - Parsed and validated JSON object when structured output was requested. Present only when the request included `text.format.type: JSON_SCHEMA`. +type StructuredOutput struct { +} + +func (s StructuredOutput) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *StructuredOutput) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + type PlatformChatOutputTextContent struct { - Type PlatformChatOutputTextContentType `json:"type"` - Text string `json:"text"` - Annotations []PlatformChatCitationAnnotation `json:"annotations,omitempty"` + Type PlatformChatOutputTextContentType `json:"type"` + Text string `json:"text"` + // Parsed and validated JSON object when structured output was requested. Present only when the request included `text.format.type: JSON_SCHEMA`. + // + StructuredOutput *StructuredOutput `json:"structured_output,omitempty"` + Annotations []PlatformChatCitationAnnotation `json:"annotations,omitempty"` } func (p PlatformChatOutputTextContent) MarshalJSON() ([]byte, error) { @@ -62,6 +80,13 @@ func (p *PlatformChatOutputTextContent) GetText() string { return p.Text } +func (p *PlatformChatOutputTextContent) GetStructuredOutput() *StructuredOutput { + if p == nil { + return nil + } + return p.StructuredOutput +} + func (p *PlatformChatOutputTextContent) GetAnnotations() []PlatformChatCitationAnnotation { if p == nil { return nil diff --git a/models/components/platformchattextformat.go b/models/components/platformchattextformat.go new file mode 100644 index 00000000..99899176 --- /dev/null +++ b/models/components/platformchattextformat.go @@ -0,0 +1,57 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/gleanwork/api-client-go/internal/utils" +) + +// PlatformChatTextFormatType - Discriminator. Must be TEXT. +type PlatformChatTextFormatType string + +const ( + PlatformChatTextFormatTypeText PlatformChatTextFormatType = "TEXT" +) + +func (e PlatformChatTextFormatType) ToPointer() *PlatformChatTextFormatType { + return &e +} +func (e *PlatformChatTextFormatType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "TEXT": + *e = PlatformChatTextFormatType(v) + return nil + default: + return fmt.Errorf("invalid value for PlatformChatTextFormatType: %v", v) + } +} + +// PlatformChatTextFormat - Unconstrained plain-text assistant output. +type PlatformChatTextFormat struct { + // Discriminator. Must be TEXT. + Type PlatformChatTextFormatType `json:"type"` +} + +func (p PlatformChatTextFormat) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PlatformChatTextFormat) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, nil); err != nil { + return err + } + return nil +} + +func (p *PlatformChatTextFormat) GetType() PlatformChatTextFormatType { + if p == nil { + return PlatformChatTextFormatType("") + } + return p.Type +} diff --git a/models/components/platformdurableagentrun.go b/models/components/platformdurableagentrun.go new file mode 100644 index 00000000..ad3e18c5 --- /dev/null +++ b/models/components/platformdurableagentrun.go @@ -0,0 +1,105 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/gleanwork/api-client-go/internal/utils" + "time" +) + +// PlatformDurableAgentRun - Agent run state, pending tool approvals, and output available independently of the creation request. +type PlatformDurableAgentRun struct { + // ID of the run, preserved across approval continuations. + RunID string `json:"run_id"` + // ID of the agent that owns the run. + AgentID string `json:"agent_id"` + // State of the persisted workflow execution. REQUIRES_INPUT is nonterminal. + State PlatformAgentRunState `json:"state"` + // Timestamp when the run was first persisted. + CreatedAt time.Time `json:"created_at"` + // Latest persisted activity timestamp across the execution and its messages, including checkpoint messages. This is not a worker heartbeat or an exact state-transition timestamp. + // + UpdatedAt time.Time `json:"updated_at"` + // Execution deadline, when one is set. Not the run history retention deadline. + ExpiresAt *time.Time `json:"expires_at,omitempty"` + // Unanswered tool approvals when the run is in REQUIRES_INPUT. Empty in other states. + PendingInteractions []PlatformAgentRunToolApproval `json:"pending_interactions"` + // Accumulated text-only agent output under the messages key, when available. + Output map[string]any `json:"output,omitempty"` + // Caller-safe details of an agent run execution failure. + Error *PlatformAgentRunError `json:"error,omitempty"` +} + +func (p PlatformDurableAgentRun) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PlatformDurableAgentRun) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, nil); err != nil { + return err + } + return nil +} + +func (p *PlatformDurableAgentRun) GetRunID() string { + if p == nil { + return "" + } + return p.RunID +} + +func (p *PlatformDurableAgentRun) GetAgentID() string { + if p == nil { + return "" + } + return p.AgentID +} + +func (p *PlatformDurableAgentRun) GetState() PlatformAgentRunState { + if p == nil { + return PlatformAgentRunState("") + } + return p.State +} + +func (p *PlatformDurableAgentRun) GetCreatedAt() time.Time { + if p == nil { + return time.Time{} + } + return p.CreatedAt +} + +func (p *PlatformDurableAgentRun) GetUpdatedAt() time.Time { + if p == nil { + return time.Time{} + } + return p.UpdatedAt +} + +func (p *PlatformDurableAgentRun) GetExpiresAt() *time.Time { + if p == nil { + return nil + } + return p.ExpiresAt +} + +func (p *PlatformDurableAgentRun) GetPendingInteractions() []PlatformAgentRunToolApproval { + if p == nil { + return []PlatformAgentRunToolApproval{} + } + return p.PendingInteractions +} + +func (p *PlatformDurableAgentRun) GetOutput() map[string]any { + if p == nil { + return nil + } + return p.Output +} + +func (p *PlatformDurableAgentRun) GetError() *PlatformAgentRunError { + if p == nil { + return nil + } + return p.Error +} diff --git a/models/operations/platformagentscancelrun.go b/models/operations/platformagentscancelrun.go new file mode 100644 index 00000000..8045e13b --- /dev/null +++ b/models/operations/platformagentscancelrun.go @@ -0,0 +1,47 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/gleanwork/api-client-go/models/components" +) + +type PlatformAgentsCancelRunRequest struct { + // ID of the agent that owns the run. + AgentID string `pathParam:"style=simple,explode=false,name=agent_id"` + PlatformAgentRunCancellationRequest components.PlatformAgentRunCancellationRequest `request:"mediaType=application/json"` +} + +func (p *PlatformAgentsCancelRunRequest) GetAgentID() string { + if p == nil { + return "" + } + return p.AgentID +} + +func (p *PlatformAgentsCancelRunRequest) GetPlatformAgentRunCancellationRequest() components.PlatformAgentRunCancellationRequest { + if p == nil { + return components.PlatformAgentRunCancellationRequest{} + } + return p.PlatformAgentRunCancellationRequest +} + +type PlatformAgentsCancelRunResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Current run snapshot after requesting cancellation, or an unchanged terminal run. + PlatformAgentRunResponse *components.PlatformAgentRunResponse +} + +func (p *PlatformAgentsCancelRunResponse) GetHTTPMeta() components.HTTPMetadata { + if p == nil { + return components.HTTPMetadata{} + } + return p.HTTPMeta +} + +func (p *PlatformAgentsCancelRunResponse) GetPlatformAgentRunResponse() *components.PlatformAgentRunResponse { + if p == nil { + return nil + } + return p.PlatformAgentRunResponse +} diff --git a/models/operations/platformagentscreaterun.go b/models/operations/platformagentscreaterun.go index 1dc8933b..46ca8679 100644 --- a/models/operations/platformagentscreaterun.go +++ b/models/operations/platformagentscreaterun.go @@ -32,6 +32,9 @@ type PlatformAgentsCreateRunResponse struct { PlatformAgentRunWaitResponse *components.PlatformAgentRunWaitResponse // Successful response. Res *string + // Durable run persisted and started. The snapshot is immediately retrievable through GET /api/agents/{agent_id}/runs/{run_id}. Execution failures appear in the run state. + // + PlatformAgentRunResponse *components.PlatformAgentRunResponse } func (p *PlatformAgentsCreateRunResponse) GetHTTPMeta() components.HTTPMetadata { @@ -54,3 +57,10 @@ func (p *PlatformAgentsCreateRunResponse) GetRes() *string { } return p.Res } + +func (p *PlatformAgentsCreateRunResponse) GetPlatformAgentRunResponse() *components.PlatformAgentRunResponse { + if p == nil { + return nil + } + return p.PlatformAgentRunResponse +} diff --git a/models/operations/platformagentscreaterunresponses.go b/models/operations/platformagentscreaterunresponses.go new file mode 100644 index 00000000..43e1bae7 --- /dev/null +++ b/models/operations/platformagentscreaterunresponses.go @@ -0,0 +1,47 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/gleanwork/api-client-go/models/components" +) + +type PlatformAgentsCreateRunResponsesRequest struct { + // ID of the agent that owns the run. + AgentID string `pathParam:"style=simple,explode=false,name=agent_id"` + PlatformAgentRunResponsesRequest components.PlatformAgentRunResponsesRequest `request:"mediaType=application/json"` +} + +func (p *PlatformAgentsCreateRunResponsesRequest) GetAgentID() string { + if p == nil { + return "" + } + return p.AgentID +} + +func (p *PlatformAgentsCreateRunResponsesRequest) GetPlatformAgentRunResponsesRequest() components.PlatformAgentRunResponsesRequest { + if p == nil { + return components.PlatformAgentRunResponsesRequest{} + } + return p.PlatformAgentRunResponsesRequest +} + +type PlatformAgentsCreateRunResponsesResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Decisions accepted, or an identical retry. Poll GET run for continued execution. + PlatformAgentRunResponse *components.PlatformAgentRunResponse +} + +func (p *PlatformAgentsCreateRunResponsesResponse) GetHTTPMeta() components.HTTPMetadata { + if p == nil { + return components.HTTPMetadata{} + } + return p.HTTPMeta +} + +func (p *PlatformAgentsCreateRunResponsesResponse) GetPlatformAgentRunResponse() *components.PlatformAgentRunResponse { + if p == nil { + return nil + } + return p.PlatformAgentRunResponse +} diff --git a/models/operations/platformagentsgetrun.go b/models/operations/platformagentsgetrun.go new file mode 100644 index 00000000..38e5bfc8 --- /dev/null +++ b/models/operations/platformagentsgetrun.go @@ -0,0 +1,48 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/gleanwork/api-client-go/models/components" +) + +type PlatformAgentsGetRunRequest struct { + // ID of the agent that owns the run. + AgentID string `pathParam:"style=simple,explode=false,name=agent_id"` + // ID of the durable run to retrieve. + RunID string `pathParam:"style=simple,explode=false,name=run_id"` +} + +func (p *PlatformAgentsGetRunRequest) GetAgentID() string { + if p == nil { + return "" + } + return p.AgentID +} + +func (p *PlatformAgentsGetRunRequest) GetRunID() string { + if p == nil { + return "" + } + return p.RunID +} + +type PlatformAgentsGetRunResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Current persisted run snapshot. A failed execution is still a successful retrieval. + PlatformAgentRunResponse *components.PlatformAgentRunResponse +} + +func (p *PlatformAgentsGetRunResponse) GetHTTPMeta() components.HTTPMetadata { + if p == nil { + return components.HTTPMetadata{} + } + return p.HTTPMeta +} + +func (p *PlatformAgentsGetRunResponse) GetPlatformAgentRunResponse() *components.PlatformAgentRunResponse { + if p == nil { + return nil + } + return p.PlatformAgentRunResponse +} diff --git a/models/operations/platformchatcreate.go b/models/operations/platformchatcreate.go index 11ab8620..0e093a18 100644 --- a/models/operations/platformchatcreate.go +++ b/models/operations/platformchatcreate.go @@ -107,6 +107,117 @@ func (u PlatformChatCreateInput) MarshalJSON() ([]byte, error) { return nil, errors.New("could not marshal union type PlatformChatCreateInput: all fields are null") } +type PlatformChatCreateFormatType string + +const ( + PlatformChatCreateFormatTypePlatformChatTextFormat PlatformChatCreateFormatType = "PlatformChatTextFormat" + PlatformChatCreateFormatTypePlatformChatJSONSchemaFormat PlatformChatCreateFormatType = "PlatformChatJsonSchemaFormat" +) + +// PlatformChatCreateFormat - Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. +type PlatformChatCreateFormat struct { + PlatformChatTextFormat *components.PlatformChatTextFormat `queryParam:"inline" union:"member"` + PlatformChatJSONSchemaFormat *components.PlatformChatJSONSchemaFormat `queryParam:"inline" union:"member"` + + Type PlatformChatCreateFormatType +} + +func CreatePlatformChatCreateFormatPlatformChatTextFormat(platformChatTextFormat components.PlatformChatTextFormat) PlatformChatCreateFormat { + typ := PlatformChatCreateFormatTypePlatformChatTextFormat + + return PlatformChatCreateFormat{ + PlatformChatTextFormat: &platformChatTextFormat, + Type: typ, + } +} + +func CreatePlatformChatCreateFormatPlatformChatJSONSchemaFormat(platformChatJSONSchemaFormat components.PlatformChatJSONSchemaFormat) PlatformChatCreateFormat { + typ := PlatformChatCreateFormatTypePlatformChatJSONSchemaFormat + + return PlatformChatCreateFormat{ + PlatformChatJSONSchemaFormat: &platformChatJSONSchemaFormat, + Type: typ, + } +} + +func (u *PlatformChatCreateFormat) UnmarshalJSON(data []byte) (err error) { + previous := *u + *u = PlatformChatCreateFormat{} + defer func() { + if err != nil { + *u = previous + } + }() + + var candidates []utils.UnionCandidate + + // Collect all valid candidates + var platformChatTextFormat components.PlatformChatTextFormat = components.PlatformChatTextFormat{} + if err := utils.UnmarshalJSON(data, &platformChatTextFormat, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: PlatformChatCreateFormatTypePlatformChatTextFormat, + Value: &platformChatTextFormat, + }) + } + + var platformChatJSONSchemaFormat components.PlatformChatJSONSchemaFormat = components.PlatformChatJSONSchemaFormat{} + if err := utils.UnmarshalJSON(data, &platformChatJSONSchemaFormat, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: PlatformChatCreateFormatTypePlatformChatJSONSchemaFormat, + Value: &platformChatJSONSchemaFormat, + }) + } + + if len(candidates) == 0 { + return fmt.Errorf("could not unmarshal `%s` into any supported union types for PlatformChatCreateFormat", string(data)) + } + + // Pick the best candidate using multi-stage filtering + best := utils.PickBestUnionCandidate(candidates, data) + if best == nil { + return fmt.Errorf("could not unmarshal `%s` into any supported union types for PlatformChatCreateFormat", string(data)) + } + + // Set the union type and value based on the best candidate + u.Type = best.Type.(PlatformChatCreateFormatType) + switch best.Type { + case PlatformChatCreateFormatTypePlatformChatTextFormat: + u.PlatformChatTextFormat = best.Value.(*components.PlatformChatTextFormat) + return nil + case PlatformChatCreateFormatTypePlatformChatJSONSchemaFormat: + u.PlatformChatJSONSchemaFormat = best.Value.(*components.PlatformChatJSONSchemaFormat) + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for PlatformChatCreateFormat", string(data)) +} + +func (u PlatformChatCreateFormat) MarshalJSON() ([]byte, error) { + if u.PlatformChatTextFormat != nil { + return utils.MarshalJSON(u.PlatformChatTextFormat, "", true) + } + + if u.PlatformChatJSONSchemaFormat != nil { + return utils.MarshalJSON(u.PlatformChatJSONSchemaFormat, "", true) + } + + return nil, errors.New("could not marshal union type PlatformChatCreateFormat: all fields are null") +} + +// PlatformChatCreateText - Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. +type PlatformChatCreateText struct { + // Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. + // + Format *PlatformChatCreateFormat `json:"format,omitempty"` +} + +func (p *PlatformChatCreateText) GetFormat() *PlatformChatCreateFormat { + if p == nil { + return nil + } + return p.Format +} + type PlatformChatCreateRequest struct { // Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`. // @@ -119,6 +230,9 @@ type PlatformChatCreateRequest struct { // Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`. // ConversationID *string `json:"conversation_id,omitempty"` + // Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. + // + Text *PlatformChatCreateText `json:"text,omitempty"` } func (p PlatformChatCreateRequest) MarshalJSON() ([]byte, error) { @@ -157,6 +271,13 @@ func (p *PlatformChatCreateRequest) GetConversationID() *string { return p.ConversationID } +func (p *PlatformChatCreateRequest) GetText() *PlatformChatCreateText { + if p == nil { + return nil + } + return p.Text +} + type PlatformChatCreateResponse struct { HTTPMeta components.HTTPMetadata `json:"-"` // Successful response. diff --git a/models/operations/platformchatcreatestream.go b/models/operations/platformchatcreatestream.go index 91910761..c10eeeb6 100644 --- a/models/operations/platformchatcreatestream.go +++ b/models/operations/platformchatcreatestream.go @@ -108,6 +108,117 @@ func (u PlatformChatCreateStreamInput) MarshalJSON() ([]byte, error) { return nil, errors.New("could not marshal union type PlatformChatCreateStreamInput: all fields are null") } +type PlatformChatCreateStreamFormatType string + +const ( + PlatformChatCreateStreamFormatTypePlatformChatTextFormat PlatformChatCreateStreamFormatType = "PlatformChatTextFormat" + PlatformChatCreateStreamFormatTypePlatformChatJSONSchemaFormat PlatformChatCreateStreamFormatType = "PlatformChatJsonSchemaFormat" +) + +// PlatformChatCreateStreamFormat - Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. +type PlatformChatCreateStreamFormat struct { + PlatformChatTextFormat *components.PlatformChatTextFormat `queryParam:"inline" union:"member"` + PlatformChatJSONSchemaFormat *components.PlatformChatJSONSchemaFormat `queryParam:"inline" union:"member"` + + Type PlatformChatCreateStreamFormatType +} + +func CreatePlatformChatCreateStreamFormatPlatformChatTextFormat(platformChatTextFormat components.PlatformChatTextFormat) PlatformChatCreateStreamFormat { + typ := PlatformChatCreateStreamFormatTypePlatformChatTextFormat + + return PlatformChatCreateStreamFormat{ + PlatformChatTextFormat: &platformChatTextFormat, + Type: typ, + } +} + +func CreatePlatformChatCreateStreamFormatPlatformChatJSONSchemaFormat(platformChatJSONSchemaFormat components.PlatformChatJSONSchemaFormat) PlatformChatCreateStreamFormat { + typ := PlatformChatCreateStreamFormatTypePlatformChatJSONSchemaFormat + + return PlatformChatCreateStreamFormat{ + PlatformChatJSONSchemaFormat: &platformChatJSONSchemaFormat, + Type: typ, + } +} + +func (u *PlatformChatCreateStreamFormat) UnmarshalJSON(data []byte) (err error) { + previous := *u + *u = PlatformChatCreateStreamFormat{} + defer func() { + if err != nil { + *u = previous + } + }() + + var candidates []utils.UnionCandidate + + // Collect all valid candidates + var platformChatTextFormat components.PlatformChatTextFormat = components.PlatformChatTextFormat{} + if err := utils.UnmarshalJSON(data, &platformChatTextFormat, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: PlatformChatCreateStreamFormatTypePlatformChatTextFormat, + Value: &platformChatTextFormat, + }) + } + + var platformChatJSONSchemaFormat components.PlatformChatJSONSchemaFormat = components.PlatformChatJSONSchemaFormat{} + if err := utils.UnmarshalJSON(data, &platformChatJSONSchemaFormat, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: PlatformChatCreateStreamFormatTypePlatformChatJSONSchemaFormat, + Value: &platformChatJSONSchemaFormat, + }) + } + + if len(candidates) == 0 { + return fmt.Errorf("could not unmarshal `%s` into any supported union types for PlatformChatCreateStreamFormat", string(data)) + } + + // Pick the best candidate using multi-stage filtering + best := utils.PickBestUnionCandidate(candidates, data) + if best == nil { + return fmt.Errorf("could not unmarshal `%s` into any supported union types for PlatformChatCreateStreamFormat", string(data)) + } + + // Set the union type and value based on the best candidate + u.Type = best.Type.(PlatformChatCreateStreamFormatType) + switch best.Type { + case PlatformChatCreateStreamFormatTypePlatformChatTextFormat: + u.PlatformChatTextFormat = best.Value.(*components.PlatformChatTextFormat) + return nil + case PlatformChatCreateStreamFormatTypePlatformChatJSONSchemaFormat: + u.PlatformChatJSONSchemaFormat = best.Value.(*components.PlatformChatJSONSchemaFormat) + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for PlatformChatCreateStreamFormat", string(data)) +} + +func (u PlatformChatCreateStreamFormat) MarshalJSON() ([]byte, error) { + if u.PlatformChatTextFormat != nil { + return utils.MarshalJSON(u.PlatformChatTextFormat, "", true) + } + + if u.PlatformChatJSONSchemaFormat != nil { + return utils.MarshalJSON(u.PlatformChatJSONSchemaFormat, "", true) + } + + return nil, errors.New("could not marshal union type PlatformChatCreateStreamFormat: all fields are null") +} + +// PlatformChatCreateStreamText - Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. +type PlatformChatCreateStreamText struct { + // Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. + // + Format *PlatformChatCreateStreamFormat `json:"format,omitempty"` +} + +func (p *PlatformChatCreateStreamText) GetFormat() *PlatformChatCreateStreamFormat { + if p == nil { + return nil + } + return p.Format +} + type PlatformChatCreateStreamRequest struct { // Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`. // @@ -120,6 +231,9 @@ type PlatformChatCreateStreamRequest struct { // Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`. // ConversationID *string `json:"conversation_id,omitempty"` + // Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. + // + Text *PlatformChatCreateStreamText `json:"text,omitempty"` } func (p PlatformChatCreateStreamRequest) MarshalJSON() ([]byte, error) { @@ -158,6 +272,13 @@ func (p *PlatformChatCreateStreamRequest) GetConversationID() *string { return p.ConversationID } +func (p *PlatformChatCreateStreamRequest) GetText() *PlatformChatCreateStreamText { + if p == nil { + return nil + } + return p.Text +} + type PlatformChatCreateStreamResponse struct { HTTPMeta components.HTTPMetadata `json:"-"` // Successful response. diff --git a/tests/agents_test.go b/tests/agents_test.go index 5a3e9aba..09d45178 100644 --- a/tests/agents_test.go +++ b/tests/agents_test.go @@ -151,3 +151,64 @@ func TestAgents_PlatformAgentsCreateRun(t *testing.T) { assert.Equal(t, 200, res.HTTPMeta.Response.StatusCode) } + +func TestAgents_PlatformAgentsGetRun(t *testing.T) { + ctx := context.Background() + + testHTTPClient := createTestHTTPClient("platform-agents-get-run") + + s := apiclientgo.New( + apiclientgo.WithServerURL(utils.GetEnv("TEST_SERVER_URL", "http://localhost:18080")), + apiclientgo.WithClient(testHTTPClient), + apiclientgo.WithSecurity(utils.GetEnv("GLEAN_API_TOKEN", "value")), + ) + + res, err := s.Agents.GetRun(ctx, "{agent_id}", "{run_id}") + require.NoError(t, err) + assert.Equal(t, 200, res.HTTPMeta.Response.StatusCode) + +} + +func TestAgents_PlatformAgentsCancelRun(t *testing.T) { + ctx := context.Background() + + testHTTPClient := createTestHTTPClient("platform-agents-cancel-run") + + s := apiclientgo.New( + apiclientgo.WithServerURL(utils.GetEnv("TEST_SERVER_URL", "http://localhost:18080")), + apiclientgo.WithClient(testHTTPClient), + apiclientgo.WithSecurity(utils.GetEnv("GLEAN_API_TOKEN", "value")), + ) + + res, err := s.Agents.CancelRun(ctx, "{agent_id}", components.PlatformAgentRunCancellationRequest{ + RunID: "{run_id}", + }) + require.NoError(t, err) + assert.Equal(t, 200, res.HTTPMeta.Response.StatusCode) + +} + +func TestAgents_PlatformAgentsCreateRunResponses(t *testing.T) { + ctx := context.Background() + + testHTTPClient := createTestHTTPClient("platform-agents-create-run-responses") + + s := apiclientgo.New( + apiclientgo.WithServerURL(utils.GetEnv("TEST_SERVER_URL", "http://localhost:18080")), + apiclientgo.WithClient(testHTTPClient), + apiclientgo.WithSecurity(utils.GetEnv("GLEAN_API_TOKEN", "value")), + ) + + res, err := s.Agents.RespondToRun(ctx, "{agent_id}", components.PlatformAgentRunResponsesRequest{ + RunID: "{run_id}", + Responses: []components.PlatformAgentRunApprovalDecision{ + components.PlatformAgentRunApprovalDecision{ + InteractionID: "{interaction_id}", + Decision: components.DecisionApprove, + }, + }, + }) + require.NoError(t, err) + assert.Equal(t, 200, res.HTTPMeta.Response.StatusCode) + +} diff --git a/tests/chat_test.go b/tests/chat_test.go index 45c015c4..9dc32864 100644 --- a/tests/chat_test.go +++ b/tests/chat_test.go @@ -6,6 +6,7 @@ import ( "context" apiclientgo "github.com/gleanwork/api-client-go" "github.com/gleanwork/api-client-go/internal/utils" + "github.com/gleanwork/api-client-go/models/components" "github.com/gleanwork/api-client-go/models/operations" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -25,8 +26,31 @@ func TestChat_PlatformChatCreate(t *testing.T) { res, err := s.Chat.Create(ctx, operations.PlatformChatCreateRequest{ Input: operations.CreatePlatformChatCreateInputStr( - "What is our parental leave policy?", + "Summarize our parental leave policy as JSON.", ), + Text: &operations.PlatformChatCreateText{ + Format: apiclientgo.Pointer(operations.CreatePlatformChatCreateFormatPlatformChatJSONSchemaFormat( + components.PlatformChatJSONSchemaFormat{ + Type: components.PlatformChatJSONSchemaFormatTypeJSONSchema, + Name: "policy_summary", + Schema: map[string]any{ + "properties": map[string]any{ + "duration_weeks": map[string]any{ + "type": "integer", + }, + "eligible_employees": map[string]any{ + "type": "string", + }, + }, + "required": []any{ + "eligible_employees", + "duration_weeks", + }, + "type": "object", + }, + }, + )), + }, }) require.NoError(t, err) assert.Equal(t, 200, res.HTTPMeta.Response.StatusCode) diff --git a/tests/messages_test.go b/tests/messages_test.go index 64ef64fe..febdc0e8 100644 --- a/tests/messages_test.go +++ b/tests/messages_test.go @@ -27,7 +27,7 @@ func TestMessages_Messages(t *testing.T) { IDType: components.IDTypeConversationID, ID: "", TimestampMillis: apiclientgo.Pointer[int64](558834), - Datasource: components.DatasourceFacebookworkplace, + Datasource: components.DatasourceGchat, }, nil) require.NoError(t, err) assert.Equal(t, 200, res.HTTPMeta.Response.StatusCode) diff --git a/tests/mockserver/internal/handler/generated_handlers.go b/tests/mockserver/internal/handler/generated_handlers.go index 8e541a71..0bea5676 100644 --- a/tests/mockserver/internal/handler/generated_handlers.go +++ b/tests/mockserver/internal/handler/generated_handlers.go @@ -15,6 +15,7 @@ func GeneratedHandlers(ctx context.Context, dir *logging.HTTPFileDirectory, rt * NewGeneratedHandler(ctx, http.MethodDelete, "/rest/api/index/custom-metadata/schema/{groupName}", pathDeleteRestAPIIndexCustomMetadataSchemaGroupName(dir, rt)), NewGeneratedHandler(ctx, http.MethodDelete, "/rest/api/index/document/{docId}/custom-metadata/{groupName}", pathDeleteRestAPIIndexDocumentDocIDCustomMetadataGroupName(dir, rt)), NewGeneratedHandler(ctx, http.MethodGet, "/api/agents/{agent_id}", pathGetAPIAgentsAgentID(dir, rt)), + NewGeneratedHandler(ctx, http.MethodGet, "/api/agents/{agent_id}/runs/{run_id}", pathGetAPIAgentsAgentIDRunsRunID(dir, rt)), NewGeneratedHandler(ctx, http.MethodGet, "/api/agents/{agent_id}/schemas", pathGetAPIAgentsAgentIDSchemas(dir, rt)), NewGeneratedHandler(ctx, http.MethodGet, "/api/search/filters", pathGetAPISearchFilters(dir, rt)), NewGeneratedHandler(ctx, http.MethodGet, "/api/skills", pathGetAPISkills(dir, rt)), @@ -46,6 +47,8 @@ func GeneratedHandlers(ctx context.Context, dir *logging.HTTPFileDirectory, rt * NewGeneratedHandler(ctx, http.MethodPatch, "/api/triggers/{trigger_id}", pathPatchAPITriggersTriggerID(dir, rt)), NewGeneratedHandler(ctx, http.MethodPatch, "/rest/api/v1/configure/datasources/{datasourceId}/instances/{instanceId}", pathPatchRestAPIV1ConfigureDatasourcesDatasourceIDInstancesInstanceID(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/api/agents/search", pathPostAPIAgentsSearch(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/api/agents/{agent_id}/cancellations", pathPostAPIAgentsAgentIDCancellations(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/api/agents/{agent_id}/responses", pathPostAPIAgentsAgentIDResponses(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/api/agents/{agent_id}/runs", pathPostAPIAgentsAgentIDRuns(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/api/chat", pathPostAPIChat(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/api/index/v1/adddatasource", pathPostAPIIndexV1Adddatasource(dir, rt)), diff --git a/tests/mockserver/internal/handler/pathgetapiagentsagentidrunsrunid.go b/tests/mockserver/internal/handler/pathgetapiagentsagentidrunsrunid.go new file mode 100644 index 00000000..ef533289 --- /dev/null +++ b/tests/mockserver/internal/handler/pathgetapiagentsagentidrunsrunid.go @@ -0,0 +1,73 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathGetAPIAgentsAgentIDRunsRunID(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "platform-agents-get-run[0]": + dir.HandlerFunc("platform-agents-get-run", testPlatformAgentsGetRunPlatformAgentsGetRun0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPlatformAgentsGetRunPlatformAgentsGetRun0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.PlatformAgentRunResponse = &components.PlatformAgentRunResponse{ + Run: components.PlatformDurableAgentRun{ + RunID: "", + AgentID: "", + State: components.PlatformAgentRunStateCancelling, + CreatedAt: types.MustTimeFromString("2025-02-20T06:37:06.101Z"), + UpdatedAt: types.MustTimeFromString("2025-06-13T07:24:18.599Z"), + PendingInteractions: []components.PlatformAgentRunToolApproval{}, + }, + RequestID: "", + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostapiagentsagentidcancellations.go b/tests/mockserver/internal/handler/pathpostapiagentsagentidcancellations.go new file mode 100644 index 00000000..220eecad --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostapiagentsagentidcancellations.go @@ -0,0 +1,78 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostAPIAgentsAgentIDCancellations(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "platform-agents-cancel-run[0]": + dir.HandlerFunc("platform-agents-cancel-run", testPlatformAgentsCancelRunPlatformAgentsCancelRun0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPlatformAgentsCancelRunPlatformAgentsCancelRun0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.PlatformAgentRunResponse = &components.PlatformAgentRunResponse{ + Run: components.PlatformDurableAgentRun{ + RunID: "", + AgentID: "", + State: components.PlatformAgentRunStateRequiresInput, + CreatedAt: types.MustTimeFromString("2026-04-14T14:14:08.916Z"), + UpdatedAt: types.MustTimeFromString("2025-07-26T12:32:21.659Z"), + PendingInteractions: []components.PlatformAgentRunToolApproval{}, + }, + RequestID: "", + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostapiagentsagentidresponses.go b/tests/mockserver/internal/handler/pathpostapiagentsagentidresponses.go new file mode 100644 index 00000000..39f7cc82 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostapiagentsagentidresponses.go @@ -0,0 +1,89 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostAPIAgentsAgentIDResponses(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "platform-agents-create-run-responses[0]": + dir.HandlerFunc("platform-agents-create-run-responses", testPlatformAgentsCreateRunResponsesPlatformAgentsCreateRunResponses0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPlatformAgentsCreateRunResponsesPlatformAgentsCreateRunResponses0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.PlatformAgentRunResponse = &components.PlatformAgentRunResponse{ + Run: components.PlatformDurableAgentRun{ + RunID: "", + AgentID: "", + State: components.PlatformAgentRunStateQueued, + CreatedAt: types.MustTimeFromString("2024-08-26T19:05:47.442Z"), + UpdatedAt: types.MustTimeFromString("2026-08-22T09:50:35.176Z"), + PendingInteractions: []components.PlatformAgentRunToolApproval{ + components.PlatformAgentRunToolApproval{ + InteractionID: "", + Type: components.PlatformAgentRunToolApprovalTypeToolApproval, + DisplayName: "King.Trantow44", + Description: "provided collectivization whereas disapprove gah astride under stoop louse", + Arguments: map[string]any{ + "key": "", + "key1": "", + }, + }, + }, + }, + RequestID: "", + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/sdk/models/components/feedentry.go b/tests/mockserver/internal/sdk/models/components/feedentry.go index e84bac4d..44f5dfe7 100644 --- a/tests/mockserver/internal/sdk/models/components/feedentry.go +++ b/tests/mockserver/internal/sdk/models/components/feedentry.go @@ -122,6 +122,8 @@ const ( JustificationTypeEditDoc JustificationType = "EDIT_DOC" JustificationTypeChatToArtifact JustificationType = "CHAT_TO_ARTIFACT" JustificationTypeShareArtifact JustificationType = "SHARE_ARTIFACT" + JustificationTypeCreateAgent JustificationType = "CREATE_AGENT" + JustificationTypeManagerInvite JustificationType = "MANAGER_INVITE" ) func (e JustificationType) ToPointer() *JustificationType { @@ -264,6 +266,10 @@ func (e *JustificationType) UnmarshalJSON(data []byte) error { case "CHAT_TO_ARTIFACT": fallthrough case "SHARE_ARTIFACT": + fallthrough + case "CREATE_AGENT": + fallthrough + case "MANAGER_INVITE": *e = JustificationType(v) return nil default: diff --git a/tests/mockserver/internal/sdk/models/components/feedrequest.go b/tests/mockserver/internal/sdk/models/components/feedrequest.go index ea9a683c..9489bdd5 100644 --- a/tests/mockserver/internal/sdk/models/components/feedrequest.go +++ b/tests/mockserver/internal/sdk/models/components/feedrequest.go @@ -62,6 +62,8 @@ const ( FeedRequestCategoryEditDoc FeedRequestCategory = "EDIT_DOC" FeedRequestCategoryChatToArtifact FeedRequestCategory = "CHAT_TO_ARTIFACT" FeedRequestCategoryShareArtifact FeedRequestCategory = "SHARE_ARTIFACT" + FeedRequestCategoryCreateAgent FeedRequestCategory = "CREATE_AGENT" + FeedRequestCategoryManagerInvite FeedRequestCategory = "MANAGER_INVITE" ) func (e FeedRequestCategory) ToPointer() *FeedRequestCategory { @@ -176,6 +178,10 @@ func (e *FeedRequestCategory) UnmarshalJSON(data []byte) error { case "CHAT_TO_ARTIFACT": fallthrough case "SHARE_ARTIFACT": + fallthrough + case "CREATE_AGENT": + fallthrough + case "MANAGER_INVITE": *e = FeedRequestCategory(v) return nil default: diff --git a/tests/mockserver/internal/sdk/models/components/feedresult.go b/tests/mockserver/internal/sdk/models/components/feedresult.go index 6e4408b5..4d9a33d3 100644 --- a/tests/mockserver/internal/sdk/models/components/feedresult.go +++ b/tests/mockserver/internal/sdk/models/components/feedresult.go @@ -63,6 +63,8 @@ const ( FeedResultCategoryEditDoc FeedResultCategory = "EDIT_DOC" FeedResultCategoryChatToArtifact FeedResultCategory = "CHAT_TO_ARTIFACT" FeedResultCategoryShareArtifact FeedResultCategory = "SHARE_ARTIFACT" + FeedResultCategoryCreateAgent FeedResultCategory = "CREATE_AGENT" + FeedResultCategoryManagerInvite FeedResultCategory = "MANAGER_INVITE" ) func (e FeedResultCategory) ToPointer() *FeedResultCategory { @@ -177,6 +179,10 @@ func (e *FeedResultCategory) UnmarshalJSON(data []byte) error { case "CHAT_TO_ARTIFACT": fallthrough case "SHARE_ARTIFACT": + fallthrough + case "CREATE_AGENT": + fallthrough + case "MANAGER_INVITE": *e = FeedResultCategory(v) return nil default: diff --git a/tests/mockserver/internal/sdk/models/components/platformagentrunapprovaldecision.go b/tests/mockserver/internal/sdk/models/components/platformagentrunapprovaldecision.go new file mode 100644 index 00000000..81c2c7c4 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformagentrunapprovaldecision.go @@ -0,0 +1,57 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// Decision - The decision for this invocation only. Rejection follows normal workflow behavior. +type Decision string + +const ( + DecisionApprove Decision = "APPROVE" + DecisionReject Decision = "REJECT" +) + +func (e Decision) ToPointer() *Decision { + return &e +} +func (e *Decision) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "APPROVE": + fallthrough + case "REJECT": + *e = Decision(v) + return nil + default: + return fmt.Errorf("invalid value for Decision: %v", v) + } +} + +// PlatformAgentRunApprovalDecision - Approve or reject the invocation identified by a pending interaction ID. +type PlatformAgentRunApprovalDecision struct { + // The interaction_id returned in the run's pending_interactions. + InteractionID string `json:"interaction_id"` + // The decision for this invocation only. Rejection follows normal workflow behavior. + Decision Decision `json:"decision"` +} + +func (o *PlatformAgentRunApprovalDecision) GetInteractionID() string { + if o == nil { + return "" + } + return o.InteractionID +} + +func (o *PlatformAgentRunApprovalDecision) GetDecision() Decision { + if o == nil { + return Decision("") + } + return o.Decision +} diff --git a/tests/mockserver/internal/sdk/models/components/platformagentruncancellationrequest.go b/tests/mockserver/internal/sdk/models/components/platformagentruncancellationrequest.go new file mode 100644 index 00000000..cfec353b --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformagentruncancellationrequest.go @@ -0,0 +1,16 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// PlatformAgentRunCancellationRequest - Request cooperative cancellation of a run owned by the caller. +type PlatformAgentRunCancellationRequest struct { + // ID of the run to cancel. Must belong to the agent identified in the path. + RunID string `json:"run_id"` +} + +func (o *PlatformAgentRunCancellationRequest) GetRunID() string { + if o == nil { + return "" + } + return o.RunID +} diff --git a/tests/mockserver/internal/sdk/models/components/platformagentruncreaterequest.go b/tests/mockserver/internal/sdk/models/components/platformagentruncreaterequest.go index dfce10e1..42491ee0 100644 --- a/tests/mockserver/internal/sdk/models/components/platformagentruncreaterequest.go +++ b/tests/mockserver/internal/sdk/models/components/platformagentruncreaterequest.go @@ -3,9 +3,38 @@ package components import ( + "encoding/json" + "fmt" "mockserver/internal/sdk/utils" ) +// ExecutionMode - REQUEST_BOUND preserves the existing wait/stream behavior. DURABLE starts a fresh, persisted execution with a 30-minute execution timeout and returns immediately. DURABLE requires stream to be false or omitted and does not accept metadata.chat_session_id. It does not bypass tool approval requirements or provide automatic QE-crash resumption. Expiry is read-triggered: the next GET of the run marks an active turn FAILED if more than 40 minutes have passed since the turn was accepted. There is no periodic sweep, so the stored run can remain RUNNING until it is read. Expiry never replays execution or expires approval-paused runs, and failure does not prove that external tool work has stopped. +type ExecutionMode string + +const ( + ExecutionModeRequestBound ExecutionMode = "REQUEST_BOUND" + ExecutionModeDurable ExecutionMode = "DURABLE" +) + +func (e ExecutionMode) ToPointer() *ExecutionMode { + return &e +} +func (e *ExecutionMode) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "REQUEST_BOUND": + fallthrough + case "DURABLE": + *e = ExecutionMode(v) + return nil + default: + return fmt.Errorf("invalid value for ExecutionMode: %v", v) + } +} + // PlatformAgentRunCreateRequest - Request to run an agent. A request MUST supply either `messages` (a non-empty conversation) or `input` (for input-form triggered agents). type PlatformAgentRunCreateRequest struct { // Input fields for an input-form triggered agent. @@ -15,8 +44,11 @@ type PlatformAgentRunCreateRequest struct { Messages []PlatformMessageInput `json:"messages,omitempty"` // Metadata to pass to the agent. Metadata map[string]any `json:"metadata,omitempty"` - // Whether to stream the run response as server-sent events. + // Whether to stream the run response as server-sent events. Not supported in DURABLE mode. Stream *bool `default:"false" json:"stream"` + // REQUEST_BOUND preserves the existing wait/stream behavior. DURABLE starts a fresh, persisted execution with a 30-minute execution timeout and returns immediately. DURABLE requires stream to be false or omitted and does not accept metadata.chat_session_id. It does not bypass tool approval requirements or provide automatic QE-crash resumption. Expiry is read-triggered: the next GET of the run marks an active turn FAILED if more than 40 minutes have passed since the turn was accepted. There is no periodic sweep, so the stored run can remain RUNNING until it is read. Expiry never replays execution or expires approval-paused runs, and failure does not prove that external tool work has stopped. + // + ExecutionMode *ExecutionMode `default:"REQUEST_BOUND" json:"execution_mode"` } func (p PlatformAgentRunCreateRequest) MarshalJSON() ([]byte, error) { @@ -57,3 +89,10 @@ func (o *PlatformAgentRunCreateRequest) GetStream() *bool { } return o.Stream } + +func (o *PlatformAgentRunCreateRequest) GetExecutionMode() *ExecutionMode { + if o == nil { + return nil + } + return o.ExecutionMode +} diff --git a/tests/mockserver/internal/sdk/models/components/platformagentrunerror.go b/tests/mockserver/internal/sdk/models/components/platformagentrunerror.go new file mode 100644 index 00000000..da40549a --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformagentrunerror.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// PlatformAgentRunError - Caller-safe details of an agent run execution failure. +type PlatformAgentRunError struct { + // Machine-readable execution failure code. + Code string `json:"code"` + // Caller-safe execution failure description. + Message string `json:"message"` +} + +func (o *PlatformAgentRunError) GetCode() string { + if o == nil { + return "" + } + return o.Code +} + +func (o *PlatformAgentRunError) GetMessage() string { + if o == nil { + return "" + } + return o.Message +} diff --git a/tests/mockserver/internal/sdk/models/components/platformagentrunresponse.go b/tests/mockserver/internal/sdk/models/components/platformagentrunresponse.go new file mode 100644 index 00000000..829fc728 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformagentrunresponse.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// PlatformAgentRunResponse - Persisted agent run snapshot with a request ID for support correlation. +type PlatformAgentRunResponse struct { + // Agent run state, pending tool approvals, and output available independently of the creation request. + Run PlatformDurableAgentRun `json:"run"` + // Platform-generated request ID for support correlation. + RequestID string `json:"request_id"` +} + +func (o *PlatformAgentRunResponse) GetRun() PlatformDurableAgentRun { + if o == nil { + return PlatformDurableAgentRun{} + } + return o.Run +} + +func (o *PlatformAgentRunResponse) GetRequestID() string { + if o == nil { + return "" + } + return o.RequestID +} diff --git a/tests/mockserver/internal/sdk/models/components/platformagentrunresponsesrequest.go b/tests/mockserver/internal/sdk/models/components/platformagentrunresponsesrequest.go new file mode 100644 index 00000000..266eca30 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformagentrunresponsesrequest.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// PlatformAgentRunResponsesRequest - Invocation-scoped decisions for the complete pending approval batch. +type PlatformAgentRunResponsesRequest struct { + // ID of the run whose pending approvals are being answered. Must belong to the agent identified in the path. + RunID string `json:"run_id"` + // One decision per pending interaction. Interaction IDs must be unique. + Responses []PlatformAgentRunApprovalDecision `json:"responses"` +} + +func (o *PlatformAgentRunResponsesRequest) GetRunID() string { + if o == nil { + return "" + } + return o.RunID +} + +func (o *PlatformAgentRunResponsesRequest) GetResponses() []PlatformAgentRunApprovalDecision { + if o == nil { + return []PlatformAgentRunApprovalDecision{} + } + return o.Responses +} diff --git a/tests/mockserver/internal/sdk/models/components/platformagentrunstate.go b/tests/mockserver/internal/sdk/models/components/platformagentrunstate.go new file mode 100644 index 00000000..76009fe7 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformagentrunstate.go @@ -0,0 +1,53 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// PlatformAgentRunState - State of the persisted workflow execution. REQUIRES_INPUT is nonterminal. +type PlatformAgentRunState string + +const ( + PlatformAgentRunStateQueued PlatformAgentRunState = "QUEUED" + PlatformAgentRunStateRunning PlatformAgentRunState = "RUNNING" + PlatformAgentRunStateRequiresInput PlatformAgentRunState = "REQUIRES_INPUT" + PlatformAgentRunStateSucceeded PlatformAgentRunState = "SUCCEEDED" + PlatformAgentRunStateFailed PlatformAgentRunState = "FAILED" + PlatformAgentRunStateCancelling PlatformAgentRunState = "CANCELLING" + PlatformAgentRunStateCancelled PlatformAgentRunState = "CANCELLED" + PlatformAgentRunStateExpired PlatformAgentRunState = "EXPIRED" +) + +func (e PlatformAgentRunState) ToPointer() *PlatformAgentRunState { + return &e +} +func (e *PlatformAgentRunState) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "QUEUED": + fallthrough + case "RUNNING": + fallthrough + case "REQUIRES_INPUT": + fallthrough + case "SUCCEEDED": + fallthrough + case "FAILED": + fallthrough + case "CANCELLING": + fallthrough + case "CANCELLED": + fallthrough + case "EXPIRED": + *e = PlatformAgentRunState(v) + return nil + default: + return fmt.Errorf("invalid value for PlatformAgentRunState: %v", v) + } +} diff --git a/tests/mockserver/internal/sdk/models/components/platformagentruntoolapproval.go b/tests/mockserver/internal/sdk/models/components/platformagentruntoolapproval.go new file mode 100644 index 00000000..9037db21 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformagentruntoolapproval.go @@ -0,0 +1,112 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "mockserver/internal/sdk/utils" + "time" +) + +// PlatformAgentRunToolApprovalType - Interaction type identifying a tool execution approval request. +type PlatformAgentRunToolApprovalType string + +const ( + PlatformAgentRunToolApprovalTypeToolApproval PlatformAgentRunToolApprovalType = "TOOL_APPROVAL" +) + +func (e PlatformAgentRunToolApprovalType) ToPointer() *PlatformAgentRunToolApprovalType { + return &e +} +func (e *PlatformAgentRunToolApprovalType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "TOOL_APPROVAL": + *e = PlatformAgentRunToolApprovalType(v) + return nil + default: + return fmt.Errorf("invalid value for PlatformAgentRunToolApprovalType: %v", v) + } +} + +// PlatformAgentRunToolApproval - Pending approval for a specific persisted tool invocation and its arguments. +type PlatformAgentRunToolApproval struct { + // Identifies this specific invocation approval, not the tool definition. + InteractionID string `json:"interaction_id"` + // Interaction type identifying a tool execution approval request. + Type PlatformAgentRunToolApprovalType `json:"type"` + // Platform tool identifier when recorded. Omitted for requests without one, such as some MCP tools. + ToolID *string `json:"tool_id,omitempty"` + // Display name of the tool requesting approval. + DisplayName string `json:"display_name"` + // Description of the tool associated with this approval request. + Description string `json:"description"` + // Arguments from the persisted approval request. Older platform tools use flattened parameters. + Arguments map[string]any `json:"arguments"` + // Approval deadline, when one is set. Omitted when the approval has no expiration. + ExpiresAt *time.Time `json:"expires_at,omitempty"` +} + +func (p PlatformAgentRunToolApproval) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PlatformAgentRunToolApproval) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, []string{"interaction_id", "type", "display_name", "description", "arguments"}); err != nil { + return err + } + return nil +} + +func (o *PlatformAgentRunToolApproval) GetInteractionID() string { + if o == nil { + return "" + } + return o.InteractionID +} + +func (o *PlatformAgentRunToolApproval) GetType() PlatformAgentRunToolApprovalType { + if o == nil { + return PlatformAgentRunToolApprovalType("") + } + return o.Type +} + +func (o *PlatformAgentRunToolApproval) GetToolID() *string { + if o == nil { + return nil + } + return o.ToolID +} + +func (o *PlatformAgentRunToolApproval) GetDisplayName() string { + if o == nil { + return "" + } + return o.DisplayName +} + +func (o *PlatformAgentRunToolApproval) GetDescription() string { + if o == nil { + return "" + } + return o.Description +} + +func (o *PlatformAgentRunToolApproval) GetArguments() map[string]any { + if o == nil { + return map[string]any{} + } + return o.Arguments +} + +func (o *PlatformAgentRunToolApproval) GetExpiresAt() *time.Time { + if o == nil { + return nil + } + return o.ExpiresAt +} diff --git a/tests/mockserver/internal/sdk/models/components/platformchatjsonschemaformat.go b/tests/mockserver/internal/sdk/models/components/platformchatjsonschemaformat.go new file mode 100644 index 00000000..c4d9b004 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformchatjsonschemaformat.go @@ -0,0 +1,94 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "mockserver/internal/sdk/utils" +) + +// PlatformChatJSONSchemaFormatType - Discriminator. Must be JSON_SCHEMA. +type PlatformChatJSONSchemaFormatType string + +const ( + PlatformChatJSONSchemaFormatTypeJSONSchema PlatformChatJSONSchemaFormatType = "JSON_SCHEMA" +) + +func (e PlatformChatJSONSchemaFormatType) ToPointer() *PlatformChatJSONSchemaFormatType { + return &e +} +func (e *PlatformChatJSONSchemaFormatType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "JSON_SCHEMA": + *e = PlatformChatJSONSchemaFormatType(v) + return nil + default: + return fmt.Errorf("invalid value for PlatformChatJSONSchemaFormatType: %v", v) + } +} + +// PlatformChatJSONSchemaFormat - Constrains the assistant response to a caller-supplied JSON Schema. +type PlatformChatJSONSchemaFormat struct { + // Discriminator. Must be JSON_SCHEMA. + Type PlatformChatJSONSchemaFormatType `json:"type"` + // A stable identifier for the schema. + Name string `json:"name"` + // An optional human-readable description of the schema. + Description *string `json:"description,omitempty"` + // A JSON Schema object describing the desired output shape. + Schema map[string]any `json:"schema"` + // When true, the provider validates the response against the schema. Unsupported by some providers; defaults to true. + // + Strict *bool `default:"true" json:"strict"` +} + +func (p PlatformChatJSONSchemaFormat) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PlatformChatJSONSchemaFormat) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, []string{"type", "name", "schema"}); err != nil { + return err + } + return nil +} + +func (o *PlatformChatJSONSchemaFormat) GetType() PlatformChatJSONSchemaFormatType { + if o == nil { + return PlatformChatJSONSchemaFormatType("") + } + return o.Type +} + +func (o *PlatformChatJSONSchemaFormat) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +func (o *PlatformChatJSONSchemaFormat) GetDescription() *string { + if o == nil { + return nil + } + return o.Description +} + +func (o *PlatformChatJSONSchemaFormat) GetSchema() map[string]any { + if o == nil { + return map[string]any{} + } + return o.Schema +} + +func (o *PlatformChatJSONSchemaFormat) GetStrict() *bool { + if o == nil { + return nil + } + return o.Strict +} diff --git a/tests/mockserver/internal/sdk/models/components/platformchatoutputtextcontent.go b/tests/mockserver/internal/sdk/models/components/platformchatoutputtextcontent.go index f3be4768..098822c3 100644 --- a/tests/mockserver/internal/sdk/models/components/platformchatoutputtextcontent.go +++ b/tests/mockserver/internal/sdk/models/components/platformchatoutputtextcontent.go @@ -5,6 +5,7 @@ package components import ( "encoding/json" "fmt" + "mockserver/internal/sdk/optionalnullable" "mockserver/internal/sdk/utils" ) @@ -31,10 +32,28 @@ func (e *PlatformChatOutputTextContentType) UnmarshalJSON(data []byte) error { } } +// StructuredOutput - Parsed and validated JSON object when structured output was requested. Present only when the request included `text.format.type: JSON_SCHEMA`. +type StructuredOutput struct { +} + +func (s StructuredOutput) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *StructuredOutput) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + type PlatformChatOutputTextContent struct { - Type PlatformChatOutputTextContentType `json:"type"` - Text string `json:"text"` - Annotations []PlatformChatCitationAnnotation `json:"annotations,omitempty"` + Type PlatformChatOutputTextContentType `json:"type"` + Text string `json:"text"` + // Parsed and validated JSON object when structured output was requested. Present only when the request included `text.format.type: JSON_SCHEMA`. + // + StructuredOutput optionalnullable.OptionalNullable[StructuredOutput] `json:"structured_output,omitempty"` + Annotations []PlatformChatCitationAnnotation `json:"annotations,omitempty"` } func (p PlatformChatOutputTextContent) MarshalJSON() ([]byte, error) { @@ -62,6 +81,13 @@ func (o *PlatformChatOutputTextContent) GetText() string { return o.Text } +func (o *PlatformChatOutputTextContent) GetStructuredOutput() optionalnullable.OptionalNullable[StructuredOutput] { + if o == nil { + return nil + } + return o.StructuredOutput +} + func (o *PlatformChatOutputTextContent) GetAnnotations() []PlatformChatCitationAnnotation { if o == nil { return nil diff --git a/tests/mockserver/internal/sdk/models/components/platformchattextformat.go b/tests/mockserver/internal/sdk/models/components/platformchattextformat.go new file mode 100644 index 00000000..2549e793 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformchattextformat.go @@ -0,0 +1,57 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "mockserver/internal/sdk/utils" +) + +// PlatformChatTextFormatType - Discriminator. Must be TEXT. +type PlatformChatTextFormatType string + +const ( + PlatformChatTextFormatTypeText PlatformChatTextFormatType = "TEXT" +) + +func (e PlatformChatTextFormatType) ToPointer() *PlatformChatTextFormatType { + return &e +} +func (e *PlatformChatTextFormatType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "TEXT": + *e = PlatformChatTextFormatType(v) + return nil + default: + return fmt.Errorf("invalid value for PlatformChatTextFormatType: %v", v) + } +} + +// PlatformChatTextFormat - Unconstrained plain-text assistant output. +type PlatformChatTextFormat struct { + // Discriminator. Must be TEXT. + Type PlatformChatTextFormatType `json:"type"` +} + +func (p PlatformChatTextFormat) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PlatformChatTextFormat) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, []string{"type"}); err != nil { + return err + } + return nil +} + +func (o *PlatformChatTextFormat) GetType() PlatformChatTextFormatType { + if o == nil { + return PlatformChatTextFormatType("") + } + return o.Type +} diff --git a/tests/mockserver/internal/sdk/models/components/platformdurableagentrun.go b/tests/mockserver/internal/sdk/models/components/platformdurableagentrun.go new file mode 100644 index 00000000..0e838da6 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformdurableagentrun.go @@ -0,0 +1,105 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "mockserver/internal/sdk/utils" + "time" +) + +// PlatformDurableAgentRun - Agent run state, pending tool approvals, and output available independently of the creation request. +type PlatformDurableAgentRun struct { + // ID of the run, preserved across approval continuations. + RunID string `json:"run_id"` + // ID of the agent that owns the run. + AgentID string `json:"agent_id"` + // State of the persisted workflow execution. REQUIRES_INPUT is nonterminal. + State PlatformAgentRunState `json:"state"` + // Timestamp when the run was first persisted. + CreatedAt time.Time `json:"created_at"` + // Latest persisted activity timestamp across the execution and its messages, including checkpoint messages. This is not a worker heartbeat or an exact state-transition timestamp. + // + UpdatedAt time.Time `json:"updated_at"` + // Execution deadline, when one is set. Not the run history retention deadline. + ExpiresAt *time.Time `json:"expires_at,omitempty"` + // Unanswered tool approvals when the run is in REQUIRES_INPUT. Empty in other states. + PendingInteractions []PlatformAgentRunToolApproval `json:"pending_interactions"` + // Accumulated text-only agent output under the messages key, when available. + Output map[string]any `json:"output,omitempty"` + // Caller-safe details of an agent run execution failure. + Error *PlatformAgentRunError `json:"error,omitempty"` +} + +func (p PlatformDurableAgentRun) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PlatformDurableAgentRun) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, []string{"run_id", "agent_id", "state", "created_at", "updated_at", "pending_interactions"}); err != nil { + return err + } + return nil +} + +func (o *PlatformDurableAgentRun) GetRunID() string { + if o == nil { + return "" + } + return o.RunID +} + +func (o *PlatformDurableAgentRun) GetAgentID() string { + if o == nil { + return "" + } + return o.AgentID +} + +func (o *PlatformDurableAgentRun) GetState() PlatformAgentRunState { + if o == nil { + return PlatformAgentRunState("") + } + return o.State +} + +func (o *PlatformDurableAgentRun) GetCreatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.CreatedAt +} + +func (o *PlatformDurableAgentRun) GetUpdatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.UpdatedAt +} + +func (o *PlatformDurableAgentRun) GetExpiresAt() *time.Time { + if o == nil { + return nil + } + return o.ExpiresAt +} + +func (o *PlatformDurableAgentRun) GetPendingInteractions() []PlatformAgentRunToolApproval { + if o == nil { + return []PlatformAgentRunToolApproval{} + } + return o.PendingInteractions +} + +func (o *PlatformDurableAgentRun) GetOutput() map[string]any { + if o == nil { + return nil + } + return o.Output +} + +func (o *PlatformDurableAgentRun) GetError() *PlatformAgentRunError { + if o == nil { + return nil + } + return o.Error +} diff --git a/tests/mockserver/internal/sdk/models/operations/platformagentscancelrun.go b/tests/mockserver/internal/sdk/models/operations/platformagentscancelrun.go new file mode 100644 index 00000000..98be8dfc --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/platformagentscancelrun.go @@ -0,0 +1,47 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PlatformAgentsCancelRunRequest struct { + // ID of the agent that owns the run. + AgentID string `pathParam:"style=simple,explode=false,name=agent_id"` + Body components.PlatformAgentRunCancellationRequest `request:"mediaType=application/json"` +} + +func (o *PlatformAgentsCancelRunRequest) GetAgentID() string { + if o == nil { + return "" + } + return o.AgentID +} + +func (o *PlatformAgentsCancelRunRequest) GetBody() components.PlatformAgentRunCancellationRequest { + if o == nil { + return components.PlatformAgentRunCancellationRequest{} + } + return o.Body +} + +type PlatformAgentsCancelRunResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Current run snapshot after requesting cancellation, or an unchanged terminal run. + PlatformAgentRunResponse *components.PlatformAgentRunResponse +} + +func (o *PlatformAgentsCancelRunResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *PlatformAgentsCancelRunResponse) GetPlatformAgentRunResponse() *components.PlatformAgentRunResponse { + if o == nil { + return nil + } + return o.PlatformAgentRunResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/platformagentscreaterun.go b/tests/mockserver/internal/sdk/models/operations/platformagentscreaterun.go index a677b6c1..8384192e 100644 --- a/tests/mockserver/internal/sdk/models/operations/platformagentscreaterun.go +++ b/tests/mockserver/internal/sdk/models/operations/platformagentscreaterun.go @@ -32,6 +32,9 @@ type PlatformAgentsCreateRunResponse struct { PlatformAgentRunWaitResponse *components.PlatformAgentRunWaitResponse // Successful response. Res *string + // Durable run persisted and started. The snapshot is immediately retrievable through GET /api/agents/{agent_id}/runs/{run_id}. Execution failures appear in the run state. + // + PlatformAgentRunResponse *components.PlatformAgentRunResponse } func (o *PlatformAgentsCreateRunResponse) GetHTTPMeta() components.HTTPMetadata { @@ -54,3 +57,10 @@ func (o *PlatformAgentsCreateRunResponse) GetRes() *string { } return o.Res } + +func (o *PlatformAgentsCreateRunResponse) GetPlatformAgentRunResponse() *components.PlatformAgentRunResponse { + if o == nil { + return nil + } + return o.PlatformAgentRunResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/platformagentscreaterunresponses.go b/tests/mockserver/internal/sdk/models/operations/platformagentscreaterunresponses.go new file mode 100644 index 00000000..0676583c --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/platformagentscreaterunresponses.go @@ -0,0 +1,47 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PlatformAgentsCreateRunResponsesRequest struct { + // ID of the agent that owns the run. + AgentID string `pathParam:"style=simple,explode=false,name=agent_id"` + Body components.PlatformAgentRunResponsesRequest `request:"mediaType=application/json"` +} + +func (o *PlatformAgentsCreateRunResponsesRequest) GetAgentID() string { + if o == nil { + return "" + } + return o.AgentID +} + +func (o *PlatformAgentsCreateRunResponsesRequest) GetBody() components.PlatformAgentRunResponsesRequest { + if o == nil { + return components.PlatformAgentRunResponsesRequest{} + } + return o.Body +} + +type PlatformAgentsCreateRunResponsesResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Decisions accepted, or an identical retry. Poll GET run for continued execution. + PlatformAgentRunResponse *components.PlatformAgentRunResponse +} + +func (o *PlatformAgentsCreateRunResponsesResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *PlatformAgentsCreateRunResponsesResponse) GetPlatformAgentRunResponse() *components.PlatformAgentRunResponse { + if o == nil { + return nil + } + return o.PlatformAgentRunResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/platformagentsgetrun.go b/tests/mockserver/internal/sdk/models/operations/platformagentsgetrun.go new file mode 100644 index 00000000..51427bc4 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/platformagentsgetrun.go @@ -0,0 +1,48 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PlatformAgentsGetRunRequest struct { + // ID of the agent that owns the run. + AgentID string `pathParam:"style=simple,explode=false,name=agent_id"` + // ID of the durable run to retrieve. + RunID string `pathParam:"style=simple,explode=false,name=run_id"` +} + +func (o *PlatformAgentsGetRunRequest) GetAgentID() string { + if o == nil { + return "" + } + return o.AgentID +} + +func (o *PlatformAgentsGetRunRequest) GetRunID() string { + if o == nil { + return "" + } + return o.RunID +} + +type PlatformAgentsGetRunResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Current persisted run snapshot. A failed execution is still a successful retrieval. + PlatformAgentRunResponse *components.PlatformAgentRunResponse +} + +func (o *PlatformAgentsGetRunResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *PlatformAgentsGetRunResponse) GetPlatformAgentRunResponse() *components.PlatformAgentRunResponse { + if o == nil { + return nil + } + return o.PlatformAgentRunResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/platformchatcreate.go b/tests/mockserver/internal/sdk/models/operations/platformchatcreate.go index c9dbd053..58f6721f 100644 --- a/tests/mockserver/internal/sdk/models/operations/platformchatcreate.go +++ b/tests/mockserver/internal/sdk/models/operations/platformchatcreate.go @@ -3,6 +3,7 @@ package operations import ( + "encoding/json" "errors" "fmt" "mockserver/internal/sdk/models/components" @@ -74,6 +75,120 @@ func (u PlatformChatCreateInput) MarshalJSON() ([]byte, error) { return nil, errors.New("could not marshal union type PlatformChatCreateInput: all fields are null") } +type PlatformChatCreateFormatType string + +const ( + PlatformChatCreateFormatTypeText PlatformChatCreateFormatType = "TEXT" + PlatformChatCreateFormatTypeJSONSchema PlatformChatCreateFormatType = "JSON_SCHEMA" +) + +// PlatformChatCreateFormat - Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. +type PlatformChatCreateFormat struct { + PlatformChatTextFormat *components.PlatformChatTextFormat `queryParam:"inline"` + PlatformChatJSONSchemaFormat *components.PlatformChatJSONSchemaFormat `queryParam:"inline"` + + Type PlatformChatCreateFormatType +} + +func CreatePlatformChatCreateFormatText(text components.PlatformChatTextFormat) PlatformChatCreateFormat { + typ := PlatformChatCreateFormatTypeText + + typStr := components.PlatformChatTextFormatType(typ) + text.Type = typStr + + return PlatformChatCreateFormat{ + PlatformChatTextFormat: &text, + Type: typ, + } +} + +func CreatePlatformChatCreateFormatJSONSchema(jsonSchema components.PlatformChatJSONSchemaFormat) PlatformChatCreateFormat { + typ := PlatformChatCreateFormatTypeJSONSchema + + typStr := components.PlatformChatJSONSchemaFormatType(typ) + jsonSchema.Type = typStr + + return PlatformChatCreateFormat{ + PlatformChatJSONSchemaFormat: &jsonSchema, + Type: typ, + } +} + +func (u *PlatformChatCreateFormat) UnmarshalJSON(data []byte) error { + + type discriminator struct { + Type string `json:"type"` + } + + dis := new(discriminator) + if err := json.Unmarshal(data, &dis); err != nil { + return fmt.Errorf("could not unmarshal discriminator: %w", err) + } + + switch dis.Type { + case "TEXT": + platformChatTextFormat := new(components.PlatformChatTextFormat) + if err := utils.UnmarshalJSON(data, &platformChatTextFormat, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == TEXT) type components.PlatformChatTextFormat within PlatformChatCreateFormat: %w", string(data), err) + } + + u.PlatformChatTextFormat = platformChatTextFormat + u.Type = PlatformChatCreateFormatTypeText + return nil + case "JSON_SCHEMA": + platformChatJSONSchemaFormat := new(components.PlatformChatJSONSchemaFormat) + if err := utils.UnmarshalJSON(data, &platformChatJSONSchemaFormat, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == JSON_SCHEMA) type components.PlatformChatJSONSchemaFormat within PlatformChatCreateFormat: %w", string(data), err) + } + + u.PlatformChatJSONSchemaFormat = platformChatJSONSchemaFormat + u.Type = PlatformChatCreateFormatTypeJSONSchema + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for PlatformChatCreateFormat", string(data)) +} + +func (u PlatformChatCreateFormat) MarshalJSON() ([]byte, error) { + if u.PlatformChatTextFormat != nil { + return utils.MarshalJSON(u.PlatformChatTextFormat, "", true) + } + + if u.PlatformChatJSONSchemaFormat != nil { + return utils.MarshalJSON(u.PlatformChatJSONSchemaFormat, "", true) + } + + return nil, errors.New("could not marshal union type PlatformChatCreateFormat: all fields are null") +} + +// PlatformChatCreateText - Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. +type PlatformChatCreateText struct { + // Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. + // + Format *PlatformChatCreateFormat `json:"format,omitempty"` +} + +func (o *PlatformChatCreateText) GetFormat() *PlatformChatCreateFormat { + if o == nil { + return nil + } + return o.Format +} + +func (o *PlatformChatCreateText) GetFormatText() *components.PlatformChatTextFormat { + if v := o.GetFormat(); v != nil { + return v.PlatformChatTextFormat + } + return nil +} + +func (o *PlatformChatCreateText) GetFormatJSONSchema() *components.PlatformChatJSONSchemaFormat { + if v := o.GetFormat(); v != nil { + return v.PlatformChatJSONSchemaFormat + } + return nil +} + type PlatformChatCreateRequest struct { // Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`. // @@ -85,6 +200,9 @@ type PlatformChatCreateRequest struct { // Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`. // ConversationID *string `json:"conversation_id,omitempty"` + // Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. + // + Text *PlatformChatCreateText `json:"text,omitempty"` } func (p PlatformChatCreateRequest) MarshalJSON() ([]byte, error) { @@ -123,6 +241,13 @@ func (o *PlatformChatCreateRequest) GetConversationID() *string { return o.ConversationID } +func (o *PlatformChatCreateRequest) GetText() *PlatformChatCreateText { + if o == nil { + return nil + } + return o.Text +} + type PlatformChatCreateResponse struct { HTTPMeta components.HTTPMetadata `json:"-"` // Successful response. diff --git a/tests/mockserver/internal/sdk/models/operations/platformchatcreatestream.go b/tests/mockserver/internal/sdk/models/operations/platformchatcreatestream.go index d94a54b7..72e44e52 100644 --- a/tests/mockserver/internal/sdk/models/operations/platformchatcreatestream.go +++ b/tests/mockserver/internal/sdk/models/operations/platformchatcreatestream.go @@ -3,6 +3,7 @@ package operations import ( + "encoding/json" "errors" "fmt" "mockserver/internal/sdk/models/components" @@ -75,6 +76,120 @@ func (u PlatformChatCreateStreamInput) MarshalJSON() ([]byte, error) { return nil, errors.New("could not marshal union type PlatformChatCreateStreamInput: all fields are null") } +type PlatformChatCreateStreamFormatType string + +const ( + PlatformChatCreateStreamFormatTypeText PlatformChatCreateStreamFormatType = "TEXT" + PlatformChatCreateStreamFormatTypeJSONSchema PlatformChatCreateStreamFormatType = "JSON_SCHEMA" +) + +// PlatformChatCreateStreamFormat - Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. +type PlatformChatCreateStreamFormat struct { + PlatformChatTextFormat *components.PlatformChatTextFormat `queryParam:"inline"` + PlatformChatJSONSchemaFormat *components.PlatformChatJSONSchemaFormat `queryParam:"inline"` + + Type PlatformChatCreateStreamFormatType +} + +func CreatePlatformChatCreateStreamFormatText(text components.PlatformChatTextFormat) PlatformChatCreateStreamFormat { + typ := PlatformChatCreateStreamFormatTypeText + + typStr := components.PlatformChatTextFormatType(typ) + text.Type = typStr + + return PlatformChatCreateStreamFormat{ + PlatformChatTextFormat: &text, + Type: typ, + } +} + +func CreatePlatformChatCreateStreamFormatJSONSchema(jsonSchema components.PlatformChatJSONSchemaFormat) PlatformChatCreateStreamFormat { + typ := PlatformChatCreateStreamFormatTypeJSONSchema + + typStr := components.PlatformChatJSONSchemaFormatType(typ) + jsonSchema.Type = typStr + + return PlatformChatCreateStreamFormat{ + PlatformChatJSONSchemaFormat: &jsonSchema, + Type: typ, + } +} + +func (u *PlatformChatCreateStreamFormat) UnmarshalJSON(data []byte) error { + + type discriminator struct { + Type string `json:"type"` + } + + dis := new(discriminator) + if err := json.Unmarshal(data, &dis); err != nil { + return fmt.Errorf("could not unmarshal discriminator: %w", err) + } + + switch dis.Type { + case "TEXT": + platformChatTextFormat := new(components.PlatformChatTextFormat) + if err := utils.UnmarshalJSON(data, &platformChatTextFormat, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == TEXT) type components.PlatformChatTextFormat within PlatformChatCreateStreamFormat: %w", string(data), err) + } + + u.PlatformChatTextFormat = platformChatTextFormat + u.Type = PlatformChatCreateStreamFormatTypeText + return nil + case "JSON_SCHEMA": + platformChatJSONSchemaFormat := new(components.PlatformChatJSONSchemaFormat) + if err := utils.UnmarshalJSON(data, &platformChatJSONSchemaFormat, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == JSON_SCHEMA) type components.PlatformChatJSONSchemaFormat within PlatformChatCreateStreamFormat: %w", string(data), err) + } + + u.PlatformChatJSONSchemaFormat = platformChatJSONSchemaFormat + u.Type = PlatformChatCreateStreamFormatTypeJSONSchema + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for PlatformChatCreateStreamFormat", string(data)) +} + +func (u PlatformChatCreateStreamFormat) MarshalJSON() ([]byte, error) { + if u.PlatformChatTextFormat != nil { + return utils.MarshalJSON(u.PlatformChatTextFormat, "", true) + } + + if u.PlatformChatJSONSchemaFormat != nil { + return utils.MarshalJSON(u.PlatformChatJSONSchemaFormat, "", true) + } + + return nil, errors.New("could not marshal union type PlatformChatCreateStreamFormat: all fields are null") +} + +// PlatformChatCreateStreamText - Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. +type PlatformChatCreateStreamText struct { + // Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. + // + Format *PlatformChatCreateStreamFormat `json:"format,omitempty"` +} + +func (o *PlatformChatCreateStreamText) GetFormat() *PlatformChatCreateStreamFormat { + if o == nil { + return nil + } + return o.Format +} + +func (o *PlatformChatCreateStreamText) GetFormatText() *components.PlatformChatTextFormat { + if v := o.GetFormat(); v != nil { + return v.PlatformChatTextFormat + } + return nil +} + +func (o *PlatformChatCreateStreamText) GetFormatJSONSchema() *components.PlatformChatJSONSchemaFormat { + if v := o.GetFormat(); v != nil { + return v.PlatformChatJSONSchemaFormat + } + return nil +} + type PlatformChatCreateStreamRequest struct { // Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`. // @@ -86,6 +201,9 @@ type PlatformChatCreateStreamRequest struct { // Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`. // ConversationID *string `json:"conversation_id,omitempty"` + // Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. + // + Text *PlatformChatCreateStreamText `json:"text,omitempty"` } func (p PlatformChatCreateStreamRequest) MarshalJSON() ([]byte, error) { @@ -124,6 +242,13 @@ func (o *PlatformChatCreateStreamRequest) GetConversationID() *string { return o.ConversationID } +func (o *PlatformChatCreateStreamRequest) GetText() *PlatformChatCreateStreamText { + if o == nil { + return nil + } + return o.Text +} + type PlatformChatCreateStreamResponse struct { HTTPMeta components.HTTPMetadata `json:"-"` // Successful response. diff --git a/tests/summarize_test.go b/tests/summarize_test.go index f09e42ea..4bfe1645 100644 --- a/tests/summarize_test.go +++ b/tests/summarize_test.go @@ -25,15 +25,14 @@ func TestSummarize_Summarize(t *testing.T) { res, err := s.Client.Documents.Summarize(ctx, components.SummarizeRequest{ DocumentSpecs: []components.DocumentSpecUnion{ - components.CreateDocumentSpecUnionDocumentSpec3( - components.DocumentSpec3{ - UgcType: components.DocumentSpecUgcType1Announcements, - ContentID: 634958, - }, - ), components.CreateDocumentSpecUnionDocumentSpec1( components.DocumentSpec1{ - URL: "https://internal-sustenance.info/", + URL: "https://dim-glider.com/", + }, + ), + components.CreateDocumentSpecUnionDocumentSpec2( + components.DocumentSpec2{ + ID: "", }, ), }, From 80de9631c4418e9ad0de5de93cac7c931b38bd8c Mon Sep 17 00:00:00 2001 From: "speakeasy-github[bot]" <128539517+speakeasy-github[bot]@users.noreply.github.com> Date: Wed, 23 Sep 2026 18:34:38 +0000 Subject: [PATCH 2/2] empty commit to trigger [run-tests] workflow