From b6774a5fb5b0a795896b0d3e709c2194f120a9ad Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Wed, 23 Sep 2026 03:45:18 +0000 Subject: [PATCH 1/2] =?UTF-8?q?##=20Python=20SDK=20Changes:=20*=20`glean.a?= =?UTF-8?q?gents.create=5Frun()`:=20=20=20*=20=20`request.execution=5Fmode?= =?UTF-8?q?`=20**Added**=20=20=20*=20=20`response.status[201]`=20**Added**?= =?UTF-8?q?=20(Breaking=20=E2=9A=A0=EF=B8=8F)=20*=20`glean.agents.get=5Fru?= =?UTF-8?q?n()`:=20**Added**=20*=20`glean.agents.cancel=5Frun()`:=20**Adde?= =?UTF-8?q?d**=20*=20`glean.chat.create()`:=20=20=20*=20=20`request.text`?= =?UTF-8?q?=20**Added**=20=20=20*=20=20`response.output[].content[].struct?= =?UTF-8?q?ured=5Foutput`=20**Added**=20*=20`glean.client.search.retrieve?= =?UTF-8?q?=5Ffeed()`:=20=20=20*=20=20`request.categories[]`=20**Changed**?= =?UTF-8?q?=20=20=20*=20=20`response.results[]`=20**Changed**?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .speakeasy/gen.lock | 399 +++++++++++---- .speakeasy/gen.yaml | 2 +- .speakeasy/glean-merged-spec.yaml | 413 ++++++++++++++-- .speakeasy/tests.arazzo.yaml | 59 ++- .speakeasy/workflow.lock | 12 +- README.md | 27 +- RELEASES.md | 12 +- docs/models/executionmode.md | 20 + docs/models/feedrequestcategory.md | 4 +- docs/models/feedresultcategory.md | 4 +- docs/models/justificationtype.md | 4 +- .../platformagentruncancellationrequest.md | 10 + docs/models/platformagentruncreaterequest.md | 13 +- docs/models/platformagentrunerror.md | 11 + docs/models/platformagentrunresponse.md | 11 + docs/models/platformagentrunstate.md | 27 + docs/models/platformagentruntoolapproval.md | 16 + .../platformagentruntoolapprovaltype.md | 18 + docs/models/platformagentscancelrunrequest.md | 9 + .../models/platformagentscreaterunresponse.md | 6 + docs/models/platformagentsgetrunrequest.md | 9 + docs/models/platformchatcreateformat.md | 20 + docs/models/platformchatcreaterequest.md | 13 +- docs/models/platformchatcreatestreamformat.md | 20 + .../models/platformchatcreatestreamrequest.md | 13 +- docs/models/platformchatcreatestreamtext.md | 11 + docs/models/platformchatcreatetext.md | 11 + docs/models/platformchatjsonschemaformat.md | 14 + .../platformchatjsonschemaformattype.md | 18 + docs/models/platformchatoutputtextcontent.md | 11 +- docs/models/platformchattextformat.md | 10 + docs/models/platformchattextformattype.md | 18 + docs/models/platformdurableagentrun.md | 18 + docs/models/structuredoutput.md | 10 + docs/sdks/agents/README.md | 113 ++++- docs/sdks/chatsdk/README.md | 76 ++- pyproject.toml | 2 +- src/glean/api_client/_version.py | 6 +- src/glean/api_client/agents.py | 468 +++++++++++++++++- src/glean/api_client/chat_sdk.py | 38 ++ src/glean/api_client/client_agents.py | 32 +- src/glean/api_client/client_chat.py | 4 +- src/glean/api_client/client_datasources.py | 16 +- src/glean/api_client/client_documents.py | 8 +- src/glean/api_client/client_search.py | 8 +- src/glean/api_client/collections.py | 4 +- src/glean/api_client/messages.py | 4 +- src/glean/api_client/models/__init__.py | 117 +++++ src/glean/api_client/models/feedentry.py | 2 + src/glean/api_client/models/feedrequest.py | 2 + src/glean/api_client/models/feedresult.py | 2 + .../models/platform_agents_cancel_runop.py | 30 ++ .../models/platform_agents_create_runop.py | 11 +- .../models/platform_agents_get_runop.py | 25 + .../models/platform_chat_create_streamop.py | 84 +++- .../models/platform_chat_createop.py | 84 +++- .../platformagentruncancellationrequest.py | 19 + .../models/platformagentruncreaterequest.py | 25 +- .../models/platformagentrunerror.py | 24 + .../models/platformagentrunresponse.py | 28 ++ .../models/platformagentrunstate.py | 18 + .../models/platformagentruntoolapproval.py | 75 +++ .../models/platformchatjsonschemaformat.py | 75 +++ .../models/platformchatoutputtextcontent.py | 38 +- .../models/platformchattextformat.py | 26 + .../models/platformdurableagentrun.py | 98 ++++ src/glean/api_client/tools.py | 28 +- .../internal/handler/generated_handlers.go | 2 + .../pathgetapiagentsagentidrunsrunid.go | 73 +++ .../pathpostapiagentsagentidcancellations.go | 78 +++ .../handler/pathpostrestapiv1getchat.go | 4 +- .../sdk/models/components/feedentry.go | 6 + .../sdk/models/components/feedrequest.go | 6 + .../sdk/models/components/feedresult.go | 6 + .../platformagentruncancellationrequest.go | 16 + .../platformagentruncreaterequest.go | 41 +- .../components/platformagentrunerror.go | 25 + .../components/platformagentrunresponse.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 + .../models/operations/platformagentsgetrun.go | 48 ++ .../models/operations/platformchatcreate.go | 125 +++++ .../operations/platformchatcreatestream.go | 125 +++++ tests/test_agents.py | 29 ++ tests/test_chat_sdk.py | 29 +- tests/test_messages.py | 2 +- tests/test_summarize.py | 6 +- 93 files changed, 3731 insertions(+), 288 deletions(-) create mode 100644 docs/models/executionmode.md create mode 100644 docs/models/platformagentruncancellationrequest.md create mode 100644 docs/models/platformagentrunerror.md create mode 100644 docs/models/platformagentrunresponse.md create mode 100644 docs/models/platformagentrunstate.md create mode 100644 docs/models/platformagentruntoolapproval.md create mode 100644 docs/models/platformagentruntoolapprovaltype.md create mode 100644 docs/models/platformagentscancelrunrequest.md create mode 100644 docs/models/platformagentsgetrunrequest.md create mode 100644 docs/models/platformchatcreateformat.md create mode 100644 docs/models/platformchatcreatestreamformat.md create mode 100644 docs/models/platformchatcreatestreamtext.md create mode 100644 docs/models/platformchatcreatetext.md create mode 100644 docs/models/platformchatjsonschemaformat.md create mode 100644 docs/models/platformchatjsonschemaformattype.md create mode 100644 docs/models/platformchattextformat.md create mode 100644 docs/models/platformchattextformattype.md create mode 100644 docs/models/platformdurableagentrun.md create mode 100644 docs/models/structuredoutput.md create mode 100644 src/glean/api_client/models/platform_agents_cancel_runop.py create mode 100644 src/glean/api_client/models/platform_agents_get_runop.py create mode 100644 src/glean/api_client/models/platformagentruncancellationrequest.py create mode 100644 src/glean/api_client/models/platformagentrunerror.py create mode 100644 src/glean/api_client/models/platformagentrunresponse.py create mode 100644 src/glean/api_client/models/platformagentrunstate.py create mode 100644 src/glean/api_client/models/platformagentruntoolapproval.py create mode 100644 src/glean/api_client/models/platformchatjsonschemaformat.py create mode 100644 src/glean/api_client/models/platformchattextformat.py create mode 100644 src/glean/api_client/models/platformdurableagentrun.py create mode 100644 tests/mockserver/internal/handler/pathgetapiagentsagentidrunsrunid.go create mode 100644 tests/mockserver/internal/handler/pathpostapiagentsagentidcancellations.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/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/platformagentsgetrun.go diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index fe5bc566..ebed50b9 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,19 @@ lockVersion: 2.0.0 id: 3e3290ca-0ee8-4981-b1bc-14536048fa63 management: - docChecksum: 6c50d3df7af689ff921a7b236aa524a5 + docChecksum: 1b0a334fa262d55afaea8654c72c9ee7 docVersion: 0.9.0 - speakeasyVersion: 1.797.0 - generationVersion: 2.937.18 - releaseVersion: 0.17.14 - configChecksum: e7d16589fea449f13b5c916e3b7884a6 + speakeasyVersion: 1.798.0 + generationVersion: 2.938.0 + releaseVersion: 0.17.15 + configChecksum: 1eb09757dc51c042e574b3e04826405c repoURL: https://github.com/gleanwork/api-client-python.git installationURL: https://github.com/gleanwork/api-client-python.git published: true persistentEdits: - generation_id: e096375a-646e-4fd0-81c4-55efcbfda47f - pristine_commit_hash: 299fa282fab309cfb9dcf2999bcc4179015e1cb9 - pristine_tree_hash: 4c0295eda3bb3c0d350e0332b1b12911ce8e0c1a + generation_id: 14748d10-b903-41ab-8c4c-a5def6189a65 + pristine_commit_hash: e6eb5e30aa299bb01ce0c0645d23b4c7ca636afd + pristine_tree_hash: f372f11b9aafddb4f2fc992f5cffe3b07bf11a36 features: python: acceptHeaders: 3.0.0 @@ -1384,6 +1384,10 @@ trackedFiles: id: e28a808b01dc last_write_checksum: sha1:5fe888a1a5120889a681270563b8dfb8e24ce8a2 pristine_git_object: 9fa8de74a849d5f7628c70defcd8e7f6d0f8121c + docs/models/executionmode.md: + id: 37fe0bb6902b + last_write_checksum: sha1:65629e297aaa78f932f50bb6ca954b028ebde92b + pristine_git_object: 4203001650a0e9c53b4fda947f12f849797de8cc docs/models/exportinfo.md: id: 08c8529beddd last_write_checksum: sha1:fd668b48fbff594629afdc2a988ffff580eb0b99 @@ -1474,8 +1478,8 @@ trackedFiles: pristine_git_object: a851a7f13eb25d515fa9b9244c5dfdc98fa14e2c docs/models/feedrequestcategory.md: id: 31a02f3064c7 - last_write_checksum: sha1:88334249125c3dca934c9adab500ae1b30bee4ae - pristine_git_object: 659067097afa1b9f6f30ba835d72e7a8c2cedac6 + last_write_checksum: sha1:6c058c44c4c9cc02dd16dbf222a4576348789c0f + pristine_git_object: 662a836bc9b99d7fe65d08ba4280adcacf0aa096 docs/models/feedrequestoptions.md: id: 58eb26b19e77 last_write_checksum: sha1:fd2ab08736cef8156169b0cfee8c52e7aed1accf @@ -1494,8 +1498,8 @@ trackedFiles: pristine_git_object: f6f92abf16b61f88b527e1c906f605e98306878e docs/models/feedresultcategory.md: id: a5f77f38d0a7 - last_write_checksum: sha1:c42683288d7fc9def7cd7ec3b22a128ddaff6daf - pristine_git_object: 86b5a71fb3f09f75f8c7314dd2222ccb20ee4e9f + last_write_checksum: sha1:3defded05526cfd53ff95f819046e9cebaddd2b0 + pristine_git_object: b1ed34c83753598c152bc76c41196860f036262e docs/models/fieldscope.md: id: e6b52bcb22a6 last_write_checksum: sha1:13a1492ce39d2f89a01d626996a345a1339a1873 @@ -1938,8 +1942,8 @@ trackedFiles: pristine_git_object: 647f9bb67a6af30d7fd71c8ddb3c5e1bf40bb938 docs/models/justificationtype.md: id: 8286affacee4 - last_write_checksum: sha1:5a0d77fbd2f34cb813482ea62b5e0ca29a8da3a7 - pristine_git_object: 71c24af0e73a4a64b150c60e499338e02a971685 + last_write_checksum: sha1:3cd9f468ee470bfe137224e72c46b03501e33905 + pristine_git_object: 7764769f62ea15ddd762c89e561431c2490b3edb docs/models/knowledgetype.md: id: 1e0c90679228 last_write_checksum: sha1:0030a7539b9362bbb59e0bbd36580676058b3540 @@ -2300,14 +2304,42 @@ trackedFiles: id: 2b8087b0fcda last_write_checksum: sha1:a34783d31877e4a81505588767aa6e5eccf96fda pristine_git_object: d6dffe1463ba8b77cdbfb57994a8b2bb886d07c2 + docs/models/platformagentruncancellationrequest.md: + id: ae6d3326d695 + last_write_checksum: sha1:055397307c76c3e1c2b4443f6a79ed8321412e5d + pristine_git_object: 94d5766dcf1b98decb24a64d5d789893cc32be96 docs/models/platformagentruncreaterequest.md: id: c1b58ab047ae - last_write_checksum: sha1:4ee8bc479e4cb19b7846c0e27dcef6d09ecda294 - pristine_git_object: 8fff9f30b2380cb75cc1367a4491b28185e95de4 + last_write_checksum: sha1:c1303da9a1ac5fc2d267a33d89ff6bf343720ee8 + pristine_git_object: bb7b3c727f84645d2d4d7ecb721628533ed2a4e0 + docs/models/platformagentrunerror.md: + id: 6e1f79d46287 + last_write_checksum: sha1:3837082422cf37c2d69464a2fc113a661cca6b9b + pristine_git_object: 9ef838b7dca1aeb2445da25b3db928be9b31487c + docs/models/platformagentrunresponse.md: + id: be99b7d57a06 + last_write_checksum: sha1:72f82b38a718a3a60a9dcf729e7f6d6ba0c85ff4 + pristine_git_object: 29594895b7ba54b2d25aef70dba06cbc4db28031 + docs/models/platformagentrunstate.md: + id: 38926be15f45 + last_write_checksum: sha1:5d178150084e171d2c07e8414a7f624a58715c2f + pristine_git_object: 4880387aa45afc07692acb4e9ef4675de141d493 + docs/models/platformagentruntoolapproval.md: + id: 74dbc64873cb + last_write_checksum: sha1:f383ae27bdade853cfd0111ad6655206e06d5c83 + pristine_git_object: 441521eee5aef3676d33afb1dd09b4b7955ff1ca + docs/models/platformagentruntoolapprovaltype.md: + id: 9942c102fe44 + last_write_checksum: sha1:3dec0ca4cb8b1c02acf560e2b0d32724dc90d4e7 + pristine_git_object: 7ffe0f37e35921bac19ab037e79027e82190c1e9 docs/models/platformagentrunwaitresponse.md: id: 216b0600404e last_write_checksum: sha1:af98dfbf6f900d7fa891640a5ad5259919062f55 pristine_git_object: f41e4044dc63ccca2b8e1cae5ab576d810f495ea + docs/models/platformagentscancelrunrequest.md: + id: fce231cbf21a + last_write_checksum: sha1:804b3ef186a7225865bbc4dfe3279ec0f2f2d54c + pristine_git_object: 6d39d4a8f955045bed8c9f0622442b4b2830ea6a docs/models/platformagentschemasresponse.md: id: a9f2476c738d last_write_checksum: sha1:91bc217f67657540aba343504479320ef577cf64 @@ -2318,12 +2350,16 @@ trackedFiles: pristine_git_object: 7914d693da7f33298da11e98695dcdd15689a680 docs/models/platformagentscreaterunresponse.md: id: 24710130cfb1 - last_write_checksum: sha1:7060b94ca4737945356ac99814fe4cebec042bfe - pristine_git_object: 8282996d41c67596131337d85e86d52c65cd642e + last_write_checksum: sha1:c555de37d34b953d4f511609b5825e7894222330 + pristine_git_object: b7a18f153fcdd1d15775630ff2e25060b5eeccf5 docs/models/platformagentsgetrequest.md: id: a51f3665418a last_write_checksum: sha1:34c8865c924c12194975f0a8cf1f98addb134b9d pristine_git_object: 615a5fc0c2249da985738ffb23bb598730e464d0 + docs/models/platformagentsgetrunrequest.md: + id: 1ab6f3c85f7c + last_write_checksum: sha1:8a1a81ce074bfa94304e6d15bdcc3bf2a0c1de01 + pristine_git_object: 9c849b538e739769bcf5584145c2b3e3ff616f59 docs/models/platformagentsgetschemasrequest.md: id: 3591800143f3 last_write_checksum: sha1:27a8e74a3fc50f378ed596e5c1a8bd3adb6fe0ea @@ -2368,22 +2404,38 @@ trackedFiles: id: f52ac98c71f7 last_write_checksum: sha1:08119b0731b552212f11f6f657a933cd06d9daec pristine_git_object: 8bed3e0696e7a1665d1fc1ef77e883aa51affcb1 + docs/models/platformchatcreateformat.md: + id: 53f6779cbcc1 + last_write_checksum: sha1:d2b68def8f3f46964b40e23908b228dae2655976 + pristine_git_object: 25911073b669c1dd17a2c5eaf013ce2b4e5a658d docs/models/platformchatcreateinput.md: id: b5ef80519bcf last_write_checksum: sha1:923de319896bc8dbb4af15eae03baae730fd3042 pristine_git_object: 9ee0df259532723cb625e145c48c0daf7d7a0d8e docs/models/platformchatcreaterequest.md: id: cd33a9dfda85 - last_write_checksum: sha1:0e26aaf39478d21d6bcf3730943323ff34b2a710 - pristine_git_object: 82808d05f9f69e0885883471aac9783c67801d62 + last_write_checksum: sha1:f91b8d077e108c2443046cd352c0e0b61088c20f + pristine_git_object: a100754d2fdfb6f0f3e2b5d3159821af7940a599 + docs/models/platformchatcreatestreamformat.md: + id: ccb1551a8c8e + last_write_checksum: sha1:57dfe924da40ac64e9f79e0c71581f77d6df3928 + pristine_git_object: cc3cd2a27c473e4f1cefd06b11d62422ff99a2ca docs/models/platformchatcreatestreaminput.md: id: 8db5acf6cc48 last_write_checksum: sha1:26e70a3ce28592c6059c62370d882f66f28e1387 pristine_git_object: 250ba3f9e5482057896cf121968d834590649a3f docs/models/platformchatcreatestreamrequest.md: id: 2f7f30973ec2 - last_write_checksum: sha1:6e27a56cbd02cb01db44a93d1758245221c2897d - pristine_git_object: 484d017f9d5e02aeae6539c1a354644b4c1b9436 + last_write_checksum: sha1:c1446ea9c05c4dfd89c358f5dcca1239a0fa7872 + pristine_git_object: aec04e2f76921921e815343430d1092e1c59bcbc + docs/models/platformchatcreatestreamtext.md: + id: a52a018a9526 + last_write_checksum: sha1:3e9e6bae9fefd9b98013439548d486e4beb2f239 + pristine_git_object: 7430aa9b3f62d0ba505d24f7d5d103f992182964 + docs/models/platformchatcreatetext.md: + id: 12feab50ab5f + last_write_checksum: sha1:4f98b57804261f0fc9731fab7b4d4050539d333b + pristine_git_object: c478436a86c79fa8d90a49a78fdef9b7b8d562d0 docs/models/platformchatcustomentitysource.md: id: 6e12deaeb23d last_write_checksum: sha1:b8ef7e1c92d45a3a3329a88b57361ba9553f28b3 @@ -2440,6 +2492,14 @@ trackedFiles: id: 0b46bce28b93 last_write_checksum: sha1:f48e66526e0a2167b36ca51042ccd0df50b1c59c pristine_git_object: cdf92876978850841d258d07db48586891089897 + docs/models/platformchatjsonschemaformat.md: + id: 29557ecc1f88 + last_write_checksum: sha1:b197e839c292086859672655aec3ad11fc4b0225 + pristine_git_object: 3e3ca482c1a6e8e541186a2c11ed9357173dec8f + docs/models/platformchatjsonschemaformattype.md: + id: e4b29294992e + last_write_checksum: sha1:39db49a6c9769940dfedd5c91242023fc29d9f9c + pristine_git_object: 392a76942323c44d896f2234f90aa09765f265c5 docs/models/platformchatoutputmessage.md: id: d236a3fe09a2 last_write_checksum: sha1:be7029860368e4db9a914916e2e2617f233f24aa @@ -2454,8 +2514,8 @@ trackedFiles: pristine_git_object: c14068505b05003de4e946a3418828950b15479a docs/models/platformchatoutputtextcontent.md: id: fd2f6a03da55 - last_write_checksum: sha1:c72902588f7531a39f1783e29433709cfe157a7a - pristine_git_object: 1ea074b5e646042d60c921c8d3351e31bc0ccde2 + last_write_checksum: sha1:816d395dc42172fdb4095d8dae2d444d9d7aa2f4 + pristine_git_object: 36632e3d967a901c9b5b1b79eb2281194f13c947 docs/models/platformchatoutputtextcontenttype.md: id: 2eca715382a5 last_write_checksum: sha1:89991c8d41e18cda29836b95477f9d6fc9919f58 @@ -2548,6 +2608,14 @@ trackedFiles: id: c6a5277b7a47 last_write_checksum: sha1:71c8bed820b7b848be51e3bff787a8de38f69e5a pristine_git_object: d878152e2e4f6647625177367828b3089c1b7688 + docs/models/platformchattextformat.md: + id: a4833ce90d4b + last_write_checksum: sha1:42528858a22ad1cca3768b7288f087a2537a7935 + pristine_git_object: 12f678b7a178b7302a0b88a3def5841eeb36d950 + docs/models/platformchattextformattype.md: + id: 9e6fcfac780d + last_write_checksum: sha1:2798b71f71f95463c94a66dd13fb46ed2c771030 + pristine_git_object: 9dca496f3bd03eecee4196bf3bc511881540242f docs/models/platformcontentschedulewebhookevent.md: id: 7cf591a2907e last_write_checksum: sha1:3df88866a52033aa4555602e8b7128abdb1f6d14 @@ -2564,6 +2632,10 @@ trackedFiles: id: 6a7d5eaea3c5 last_write_checksum: sha1:980bca6d1b189a0a14969236485ffdd8a6673f6b pristine_git_object: 926494c10c4e191a01e7fc879c0888742c8b593d + docs/models/platformdurableagentrun.md: + id: 9afb4bdaa146 + last_write_checksum: sha1:bc97ffd5e89973049ab0cc2c9073ade21221a2dd + pristine_git_object: fede41af609d3320ebdd62cee1465f7a6a620d10 docs/models/platformfilter.md: id: 4e97760ae8b9 last_write_checksum: sha1:c331962f750f8e583ea3f50d70027a2a23225ad3 @@ -3360,6 +3432,10 @@ trackedFiles: id: 794ea7f6265f last_write_checksum: sha1:7bee77ab7e9a46141d09a5a5980d3136ae34ac10 pristine_git_object: 9da32f0e7841e87099fbe94de2e2e025f62070c2 + docs/models/structuredoutput.md: + id: f2e447188759 + last_write_checksum: sha1:0fefd8718435f3a6ea2372819a35db97ec6927a3 + pristine_git_object: 45e8ab02d1f563d01c5045ae21340c61bd259a2d docs/models/structuredresult.md: id: 64daefd6d356 last_write_checksum: sha1:ae2a47158f5495406f756eabceab6bb523faabf3 @@ -3766,8 +3842,8 @@ trackedFiles: pristine_git_object: 61dd41f0319201cc105e29174ab1cc0018cecbce docs/sdks/agents/README.md: id: 5965d8232fd8 - last_write_checksum: sha1:977d88ddf87ce7b29b8f61e7b77d967061628b08 - pristine_git_object: f05a4d5990ac529b1af76f716cce568ce33285f7 + last_write_checksum: sha1:9cae5bfd2ac7b601b5c56d2c7e902a1fa1893971 + pristine_git_object: 0622c635279012d0c384790a37cc6376b10ca1e5 docs/sdks/announcements/README.md: id: 3d2e130a217c last_write_checksum: sha1:ecfa655bb27dee6890656542cfafda0aa6ed1ab9 @@ -3778,8 +3854,8 @@ trackedFiles: pristine_git_object: 85153af7ec594c2dbd1e4a8c2eba5ce713796265 docs/sdks/chatsdk/README.md: id: 83b4ee321663 - last_write_checksum: sha1:6c25689a8771f1ba40b4badf390c0b2d42911502 - pristine_git_object: 4ccddf5196dda92a3b9e62efb1031e1d0c4e976f + last_write_checksum: sha1:bc0aaa0a6744cbd8d2f3fe67b09a1790c8cd9797 + pristine_git_object: a6bdce514d78f2e59ae88641ce246b2f766bfbb1 docs/sdks/clientactivity/README.md: id: a309613986a5 last_write_checksum: sha1:d9737458d891593ba2fb3372ab6e60ea728fe9a5 @@ -3914,8 +3990,8 @@ trackedFiles: pristine_git_object: 79e388be87446ab6a4064b372bad0e8376d0cb5e pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:99d21663bbe69e903d52e6af936915a4e61eae46 - pristine_git_object: 47df73c31b9b71aac2f687d754fff2e18d7312aa + last_write_checksum: sha1:50549d323659a35ab0a59c8c19451dc2d0aeba56 + pristine_git_object: b7cb0276a9bf207ec590dcac01947fd965245496 scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:c2c83f71dea61eb50c9e05da83b16d18b4da8794 @@ -3942,12 +4018,12 @@ trackedFiles: pristine_git_object: 55f23c1feabfedeb7e8cd5bea8b910f0ae0b77d9 src/glean/api_client/_version.py: id: 0ce22b26136b - last_write_checksum: sha1:1bee0a78c745386143585f3a1bfeb8c1ee164211 - pristine_git_object: baf219c0556adcfb313b1d21660cf2f18d738bb4 + last_write_checksum: sha1:6c63f673880e68be2815c4272eb4f4360d15423c + pristine_git_object: 4af11e8ed077223e781737633b6fd821ee561c3d src/glean/api_client/agents.py: id: b925701a9217 - last_write_checksum: sha1:1520d795d519aba795c8edbce2f833c99b8a4fa5 - pristine_git_object: 68817cd017a63a1ce88ff1154a0f04a99c682be1 + last_write_checksum: sha1:6c725f4f2ce4bc41343338be64ba4717015313db + pristine_git_object: 12a99b3efd4f95142f9b18ed7f5bca285315f8f7 src/glean/api_client/announcements.py: id: 452f3d593912 last_write_checksum: sha1:4b9f4ff97fb9754b5da3a36c1cc8edb02318ed7a @@ -3962,8 +4038,8 @@ trackedFiles: pristine_git_object: bf7b1b3b25ce6530403b0dd9f60599d236c780ce src/glean/api_client/chat_sdk.py: id: f2f30e13ca42 - last_write_checksum: sha1:acdaeec3c4f12f543112a53120066de155f5cba9 - pristine_git_object: 9a48f24ace4767119e7dce70e87ad8c9f0344c94 + last_write_checksum: sha1:106d956665429a3966b36f0a7cf70c35a9b39356 + pristine_git_object: b37457a825c6f8f7dd5a1183acf376b0bb187718 src/glean/api_client/client.py: id: c0c188098f10 last_write_checksum: sha1:bfadba5dfdc64280fd9c7bdbf96a0651e5db429f @@ -3974,28 +4050,28 @@ trackedFiles: pristine_git_object: 42aa2ffce8105a293a0a02353f41f083136fdc5f src/glean/api_client/client_agents.py: id: 61b53ccd2b3b - last_write_checksum: sha1:710d3b5fe2689de3432a731ae661c913aac26fd6 - pristine_git_object: fa6802c829618bb5025142233e08af4e3ad56b3e + last_write_checksum: sha1:884e42cb2021a664d6bf7c7a13e20d8d095eec43 + pristine_git_object: 0d3bb2dfb1f57120e97ca058821e2f1d8b33d24a src/glean/api_client/client_authentication.py: id: 0b237b7c1b11 last_write_checksum: sha1:4217581430cfa2131471291a6ce36854af64dcb7 pristine_git_object: 9cd4f878de6dc1a2e29fe9456824cb66fc6a3c4b src/glean/api_client/client_chat.py: id: 42cbb9b5acf3 - last_write_checksum: sha1:7449407ee74f9c6b86f1858622805b4ebe235ac2 - pristine_git_object: 1095d5f14af723e97da53e1f1de33d8f6322ad6b + last_write_checksum: sha1:16aedf83e7fcec7161c2138c7e4546d5bcc9362c + pristine_git_object: 3c75dccfc8d8b03437e887404c06e3ae34fc62a9 src/glean/api_client/client_datasources.py: id: 75635d40099f - last_write_checksum: sha1:c07b4e9aecede3c49184b2929475c05d675430ea - pristine_git_object: 0cfdfc1b672dc3f63780df6d462c3595cb4af38d + last_write_checksum: sha1:3e4ef743bd527805f995f264c011eb29a0d4e41a + pristine_git_object: f62bca1a92ebfc9b8ee849155b3cc1f41b0a8c19 src/glean/api_client/client_documents.py: id: dac599de515c - last_write_checksum: sha1:67a32fc2e80bf0ce181037aed0edbd66cc75e074 - pristine_git_object: d93ffbbf0b761e7a84e54f152f2a528f61e792a8 + last_write_checksum: sha1:482492424fd4422b2b072bf5841f93a5c9133591 + pristine_git_object: 7b2678cd385b1aeb4cb72d9661cdf5725b783b02 src/glean/api_client/client_search.py: id: 49ce2de81382 - last_write_checksum: sha1:3a2eebd48e3e4ae8cd231eeb1ae4191b71712939 - pristine_git_object: 6c95bb5b54f8ba3ea4935a16174d15454c66a906 + last_write_checksum: sha1:31d63b285133e11cf5313e493782aee7bd306241 + pristine_git_object: d97480ed4592be09071c9346232711c2027f01b1 src/glean/api_client/client_shortcuts.py: id: 5ef5dacbcba9 last_write_checksum: sha1:94f35f0be652742f2f6d6912df01e133ec1247e2 @@ -4006,8 +4082,8 @@ trackedFiles: pristine_git_object: 706d849954ab96c0c5e733d935165dd97299c77b src/glean/api_client/collections.py: id: df34f0fd10dd - last_write_checksum: sha1:0415b7acc409d8777dc5d545bf0f77a795b30f7e - pristine_git_object: ddc1b4d7efd33893ab808f43ba94381225550d95 + last_write_checksum: sha1:9b2d8b09e3fcb933c33f9ec07d60c7716c3186c0 + pristine_git_object: 23338f6784c0b928d6eb81aef8c6875cd54d2c4f src/glean/api_client/custommetadata.py: id: d5621a2ad56e last_write_checksum: sha1:ea635be1586ca604b7a93b42573212318ee37542 @@ -4122,12 +4198,12 @@ trackedFiles: pristine_git_object: e178944fb4b06aab8e7a5edcaefaf6996fa4c2ad src/glean/api_client/messages.py: id: 3751db64257b - last_write_checksum: sha1:a74562295b385e4b5e4026cd95b382432db3dafb - pristine_git_object: 77016bfff6209866592fd8b42f2f3527f900992b + last_write_checksum: sha1:63c0b0fd9b273d38d2d0a695a5b244b5347b0908 + pristine_git_object: b140b656b788bb0deb8a974420783b338f0521e2 src/glean/api_client/models/__init__.py: id: d5f6ea5efcbe - last_write_checksum: sha1:e64af386979758264547b1d79da56e038b789f6b - pristine_git_object: f428e57aa5e5ce47e679e1090f6ff0946ac92493 + last_write_checksum: sha1:b44e1e1107835fd937a8b54f764666468d62e85f + pristine_git_object: 44c4c0845efa43cf24854e7058617bcc54f9cf3c src/glean/api_client/models/accessrequestpermissiondeniedresponse_error.py: id: 22a2fa0d5899 last_write_checksum: sha1:f7dd6f906a4dd7433992f77395f9fb491fa5ac5c @@ -5206,16 +5282,16 @@ trackedFiles: pristine_git_object: 44041cb376d89949c815ea1e7813505940605855 src/glean/api_client/models/feedentry.py: id: 023eb6c10ae1 - last_write_checksum: sha1:bad47b3f46b621a302ef187b25cdece3774a0bc8 - pristine_git_object: c0d16f3e7b7287b7d047552d70a797e696f86177 + last_write_checksum: sha1:803bdce57dc5815add1ac47744ecfb35ec26b3b8 + pristine_git_object: 83e2c6f0abadf1a67f849ff34c9ec825be039bd4 src/glean/api_client/models/feedop.py: id: b8067ac0a127 last_write_checksum: sha1:c58cb0a3a01925eb14d84176c5c6e9d8f4d84cf1 pristine_git_object: f39626285f84630e5a9233736d652914b759d44b src/glean/api_client/models/feedrequest.py: id: 33496b6a5bab - last_write_checksum: sha1:f13f3978c3edf1105b389e48f8116dc5488d61b5 - pristine_git_object: 363ac76d73ca89155bb071fbb83068ac478a0551 + last_write_checksum: sha1:5d2d1b1a5b9cca934cd4d1a91b24b1a78a5afe3a + pristine_git_object: 75cd4b1bd2b9eb2508887a6e83485136713adef4 src/glean/api_client/models/feedrequestoptions.py: id: b99003fbf522 last_write_checksum: sha1:d5ffee29242075cbe6d2dd5ec916b0c3d40acf54 @@ -5226,8 +5302,8 @@ trackedFiles: pristine_git_object: 683438c837601f483526ec18756fadc7222edb24 src/glean/api_client/models/feedresult.py: id: ae187332b37a - last_write_checksum: sha1:08ef5b972d1ad12881eaafe29413128836e39ae1 - pristine_git_object: a3f149b990f63df3d29c8e3b66c4330d6c6f6759 + last_write_checksum: sha1:d0e0236236965e4d5f2b3dd8776849e5e0bc36fc + pristine_git_object: f450760d9e50554270028662971d013df801cbd6 src/glean/api_client/models/followupaction.py: id: e2de5c4c8524 last_write_checksum: sha1:49e1a826449081fecfcd828c940604db949a8533 @@ -5836,10 +5912,18 @@ trackedFiles: id: 5b14b683421a last_write_checksum: sha1:73484002a7a37df4baaf05fd282bf904acf54cc9 pristine_git_object: 1e291af2ba4ec81b33d9b03faad6cb8365c8ab55 + src/glean/api_client/models/platform_agents_cancel_runop.py: + id: c5b34ef0de1f + last_write_checksum: sha1:e4e08794926fc36c0f3f00adffcd792b99d281ca + pristine_git_object: 6e55e914cdae054f23fe205107c9ead3c9684a1a src/glean/api_client/models/platform_agents_create_runop.py: id: f17d1b61b15b - last_write_checksum: sha1:6792547db343d9d6f264962866cadb1ae3338d52 - pristine_git_object: e99e8d10f23df59ac1a044369784acf521c747ab + last_write_checksum: sha1:e7445ccfa3cfa2bfa0690542ac18463519c67378 + pristine_git_object: 1594967fbdaadbc33ac831ad52d5286433a4f117 + src/glean/api_client/models/platform_agents_get_runop.py: + id: d0d53e3d4a09 + last_write_checksum: sha1:a9757d1e5e80c4610e7fc7591a4a816d6bb0a194 + pristine_git_object: 01a8e34febfc748e2c1a51455b3ad070d4736d8c src/glean/api_client/models/platform_agents_get_schemasop.py: id: 54795e674f69 last_write_checksum: sha1:2179f25a466baab76de315e6e736876ba97b60f1 @@ -5850,12 +5934,12 @@ trackedFiles: pristine_git_object: 880c65c1e74dd49543d650516f29141c6cdd486d src/glean/api_client/models/platform_chat_create_streamop.py: id: 6950e1c0b047 - last_write_checksum: sha1:9e15087313982499851cfb3ba3f63090f5711ba8 - pristine_git_object: 7e6268b7f8f3855c2f5b1a422db02f4d9e06fc4b + last_write_checksum: sha1:489939715defc6fa1f52fc4664326dd4f582aa97 + pristine_git_object: 10c83a83983658fceef0fe3066ef939145035157 src/glean/api_client/models/platform_chat_createop.py: id: 6f911817c878 - last_write_checksum: sha1:8190a133a530c4a765fd42025a364220e65dcff1 - pristine_git_object: 4069a99089cae96228982f98a9a45cd8e1e0c9de + last_write_checksum: sha1:4133f592f181982f11cc9199ce9a9b7af60dce6a + pristine_git_object: 1812a49682ddc269112ef551e55660b821b15612 src/glean/api_client/models/platform_search_filtersop.py: id: 3876ec8f6e5b last_write_checksum: sha1:0551a1836339a7b0f5dea4cf8946e001384d3146 @@ -5968,10 +6052,30 @@ trackedFiles: id: 6a27f28ec4bf last_write_checksum: sha1:04e126eefa9aa91ff20eae6156e1737fb9210774 pristine_git_object: 26bf40035054db162a6577ff5ca9354a56bcea84 + src/glean/api_client/models/platformagentruncancellationrequest.py: + id: c360b403c269 + last_write_checksum: sha1:465a10141b822a844c3f8b01480bdb1d7d17c748 + pristine_git_object: 14efa2f2f726ccb26370ddca42b27b791c54be61 src/glean/api_client/models/platformagentruncreaterequest.py: id: fc8dc50abaee - last_write_checksum: sha1:a86106b88394793f38020e509ecb22a3a7c56c27 - pristine_git_object: fe723996349ce9181f4b5bbf25eec3604a992b62 + last_write_checksum: sha1:0a2e22bb784fe1c5b1f36158bee47aa387ca2084 + pristine_git_object: 645f523e6632da76f0bdc8872e8d0132db6dbc00 + src/glean/api_client/models/platformagentrunerror.py: + id: a415b46071c5 + last_write_checksum: sha1:2ff1839f6e55e7992ecc086c228466471a81a9d0 + pristine_git_object: bc6da9431de29c294d57a3ff1e02965c95eb1c2b + src/glean/api_client/models/platformagentrunresponse.py: + id: 2a470b92b531 + last_write_checksum: sha1:46b1415eb828502439abb0e2c081747dd17761a5 + pristine_git_object: 7c02b1cae6d89db4d0ee5236633be25c77425154 + src/glean/api_client/models/platformagentrunstate.py: + id: de5f902c89fb + last_write_checksum: sha1:6cb219241a6cf9614dfcbf910639fbf2ea577e6b + pristine_git_object: dc860898c5a2a5837168fb26654e5aaeb6feb50e + src/glean/api_client/models/platformagentruntoolapproval.py: + id: 914f1fbb5e0d + last_write_checksum: sha1:73b36d78d4eb9aa89234b08062226f2d68a4d5f1 + pristine_git_object: c51c46ed4490f4eb072cf3a30a8d704e58e51307 src/glean/api_client/models/platformagentrunwaitresponse.py: id: 3498df9c1961 last_write_checksum: sha1:3f8f7707d02ded94a0021b99c00e3df4223b772b @@ -6028,14 +6132,18 @@ trackedFiles: id: e32871fda394 last_write_checksum: sha1:1ddb82a8dcac6a1943b99fb2cdfb2c464e8eab07 pristine_git_object: 9d21d2a18e6de246b38312c05fafc8698635ac6a + src/glean/api_client/models/platformchatjsonschemaformat.py: + id: 322d59bf877b + last_write_checksum: sha1:d0425f69e2957aec73d75171a4f7a0d0971ae6df + pristine_git_object: c22174e07d47e011f182bbdbbac05355996b67e2 src/glean/api_client/models/platformchatoutputmessage.py: id: 15c8512d3810 last_write_checksum: sha1:1f0846a6e9bf7c2a1b9f5ea870cb0c4f6896c449 pristine_git_object: 9082277a0bb6b75d23c5fef7eead2aa13d8147cf src/glean/api_client/models/platformchatoutputtextcontent.py: id: 91b9987e8b98 - last_write_checksum: sha1:a24b36ff3c3d310f82183fd5d0c39a0182bef73a - pristine_git_object: d37425276eb8efbdd22c199f76b5448f8c9cb0b4 + last_write_checksum: sha1:901d84ef8719d7d7dbff8c7c0af9a6ee5eef538a + pristine_git_object: eb56d9a116b6a3ff747db32b2ffcd5cf57dd794a src/glean/api_client/models/platformchatpersonsource.py: id: 617b816c747b last_write_checksum: sha1:1068fde6d156f689d9f93b799dd8b5a2fa399315 @@ -6096,6 +6204,10 @@ trackedFiles: id: aa2699dde615 last_write_checksum: sha1:82061a27d94f683de9be3c439c45e5aa075cb2bf pristine_git_object: c4c16ab8bdbddd7554803c73557c31f474df4be8 + src/glean/api_client/models/platformchattextformat.py: + id: 4436e4437556 + last_write_checksum: sha1:ecc4be5d35513e1210ebe1b1e0bc3e05994392c0 + pristine_git_object: aa54c4dc3c2b0ee6258485830b0686c67dde1024 src/glean/api_client/models/platformcontentschedulewebhookevent.py: id: 9967e953a04e last_write_checksum: sha1:c4967523e69ff60285e770e785059a415498409f @@ -6112,6 +6224,10 @@ trackedFiles: id: 9fcc235e9237 last_write_checksum: sha1:b3b267d4ea3fcd6b46dc447e2e0dae3fda859ff7 pristine_git_object: a1eb453df5bc9f744651211e88c82dc25a7037d6 + src/glean/api_client/models/platformdurableagentrun.py: + id: 9183fd1b5740 + last_write_checksum: sha1:5e19454934cb4e186b75fb44aa081785eff50bf9 + pristine_git_object: 842b5cb8128b114784a2c11cc1cb319b47501099 src/glean/api_client/models/platformfilter.py: id: e0719ea40cc5 last_write_checksum: sha1:a56bda496c9eb473d9aaa08426e077e2694216d9 @@ -7054,8 +7170,8 @@ trackedFiles: pristine_git_object: 89e97e10c092905a2b012a8f05f8fc986d018c6e src/glean/api_client/tools.py: id: 3ea40147c1cc - last_write_checksum: sha1:83c2360844995f2f83170f8e8c8388ffe5800758 - pristine_git_object: a9a8b1001149141922966a721ceed7660f21796c + last_write_checksum: sha1:017a12cc5b3fdce612fdb317a468b370e5100cc3 + pristine_git_object: 702acd70ae3e1296fbc0346dac0870d4e3d1b16f src/glean/api_client/triggers.py: id: 9fac703b5844 last_write_checksum: sha1:d69e3d7a3d4cc92b7ee4a37e61c976bf6b36351b @@ -7210,8 +7326,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:8f3d1ce64d57facd197137b06b865273bcdcda24 + pristine_git_object: fe34708349235b26c246116780a0efa270dc6f6a tests/mockserver/internal/handler/pathdeleterestapiindexcustommetadataschemagroupname.go: id: 979e4583765b last_write_checksum: sha1:b1d4edb259d907c7a88b634bf16f0cf152321693 @@ -7224,6 +7340,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 @@ -7344,6 +7464,10 @@ 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/pathpostapiagentsagentidruns.go: id: b038130eb997 last_write_checksum: sha1:badf21e13cd2f0afdc5fd5f325c1a34de39d0107 @@ -7642,8 +7766,8 @@ trackedFiles: pristine_git_object: abb763ddc8504b28c0cb6fdf8d25237d46e21bab tests/mockserver/internal/handler/pathpostrestapiv1getchat.go: id: a0ec7bafa599 - last_write_checksum: sha1:b48e2313407814ee4f8ed181b8e5299a84960c44 - pristine_git_object: 96d4127e0455272a9842e2d1954e5fcefa3278cc + last_write_checksum: sha1:2267292ba8173cf8df70ddbc6ac02ff3439cb879 + pristine_git_object: 8740195860b6c08e036caae19aab8e7374350960 tests/mockserver/internal/handler/pathpostrestapiv1getchatapplication.go: id: 7d101c69d4bc last_write_checksum: sha1:7b81898137fdb3a89b4dcfa318b9b5b92e8860c0 @@ -8750,12 +8874,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 @@ -8766,8 +8890,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 @@ -9256,10 +9380,30 @@ trackedFiles: id: d12a92c365e5 last_write_checksum: sha1:c39a6b74fe9c30850bf5bedd6827577bf4b56566 pristine_git_object: a3139f71ea2e70673649a36519c072d817d45969 + 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/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 @@ -9316,14 +9460,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 @@ -9384,6 +9532,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 @@ -9400,6 +9552,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 @@ -10548,14 +10704,22 @@ 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/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 @@ -10566,12 +10730,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 @@ -11022,8 +11186,8 @@ trackedFiles: pristine_git_object: db4221c9f5953adc8f8219979060f1248ae5c342 tests/test_agents.py: id: 2eb70a860f3a - last_write_checksum: sha1:78899739204e9e80aae4337c6396a57ab816a4e0 - pristine_git_object: 39a3f77bf4a5c99d3def7a0bb99493a9ef83e95c + last_write_checksum: sha1:52bb0e7d1785d68247a96b9fc47bba4b553114ee + pristine_git_object: 2e475cd54c01a3d49f6a5d085f431e83406ee0cb tests/test_announcements.py: id: 720cc07fca06 last_write_checksum: sha1:1d0dcab6446633bc6809bc67e14b6cc1755aa319 @@ -11038,8 +11202,8 @@ trackedFiles: pristine_git_object: d2b02f269ac418b9a9240772f28ab1bd3cfa4997 tests/test_chat_sdk.py: id: d6e6d5c5a1b2 - last_write_checksum: sha1:55b3a1b8bff0873ec0804da755fda550158e7d03 - pristine_git_object: 80a927281e7f1800c50cdf1eaaad0c72f057523c + last_write_checksum: sha1:69a50e3e45fd00c1ad528a68939e264bff809fc1 + pristine_git_object: cfc1294c86dd149b7825f7dffd95f0f19052f079 tests/test_client.py: id: 6b61d4b06ccc last_write_checksum: sha1:df970d19cdb9f9e057722699dc73965b6f9b1758 @@ -11126,8 +11290,8 @@ trackedFiles: pristine_git_object: 6cc8aeec3c52329d389081db0a27f10f53f214b9 tests/test_messages.py: id: be23089b1f8b - last_write_checksum: sha1:2404e23964ef6a1f5ddc900402b34e597d2d9617 - pristine_git_object: 132005ec7d1e35f805b6a8c28e07e043bce22f0a + last_write_checksum: sha1:b7415512608102fa07b1990a350a7da66946fe46 + pristine_git_object: 636f01d348f30db3ee81985044634511b615af16 tests/test_people.py: id: 37c243940039 last_write_checksum: sha1:2b78b1c5ea17f267895188b1b48ff9fe2bc19f17 @@ -11154,8 +11318,8 @@ trackedFiles: pristine_git_object: 63587d5a9e7b7e506ce9daf00d51ce92afb56035 tests/test_summarize.py: id: a255d8a6f627 - last_write_checksum: sha1:a327189497f3a2b98c2e277757da4e4ba22cf768 - pristine_git_object: 072b3207b89ff92c8a22b828c32ce23e2ae0ba88 + last_write_checksum: sha1:6244d4da1522f443776e78aeb31dd83ebdc90c42 + pristine_git_object: 2b5d1f38b094214933fc3b8da79ff8ed979c5122 tests/test_tools.py: id: 70889bdf7321 last_write_checksum: sha1:e9e37efd6a65d805c02d70d548df9c87dd062b0e @@ -12145,7 +12309,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": ""} @@ -12156,6 +12320,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: @@ -12310,7 +12476,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": ""} @@ -12537,8 +12703,35 @@ 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": @@ -12743,7 +12936,9 @@ generatedTests: platform-trigger-presets-get: "2026-08-21T02:33:03Z" platform-trigger-presets-input-values-list: "2026-08-21T02:33:03Z" platform-trigger-presets-events-search: "2026-08-21T02:33:03Z" -releaseNotes: "## Python SDK Changes:\n* `glean.agents.create_run()`: `response.run.messages[].content[].annotations` **Added**\n* `glean.client.agents.import()`: `request` **Changed**\n* `glean.client.agents.run()`: `response.run.messages[].content[].annotations` **Added**\n* `glean.client.search.retrieve_feed()`: \n * `request.categories[]` **Changed**\n * `response.results[]` **Changed**\n" + platform-agents-get-run: "2026-09-23T03:42:15Z" + platform-agents-cancel-run: "2026-09-23T03:42:15Z" +releaseNotes: "## Python SDK Changes:\n* `glean.agents.create_run()`: \n * `request.execution_mode` **Added**\n * `response.status[201]` **Added** (Breaking ⚠️)\n* `glean.agents.get_run()`: **Added**\n* `glean.agents.cancel_run()`: **Added**\n* `glean.chat.create()`: \n * `request.text` **Added**\n * `response.output[].content[].structured_output` **Added**\n* `glean.client.search.retrieve_feed()`: \n * `request.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 e449cccd..7b5f20a3 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -34,7 +34,7 @@ generation: generateNewTests: true skipResponseBodyAssertions: true python: - version: 0.17.14 + version: 0.17.15 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/glean-merged-spec.yaml b/.speakeasy/glean-merged-spec.yaml index 7ee55ac5..2406a543 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: 6777d6f02fc9f842cabcaa5ec3bf44b9c9c15781 + x-open-api-commit-sha: e1b4cb0a0f7fd4f8438872f9fd5249f26d649e72 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. Each POST creates a new run; retrying a POST can create another execution. 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,118 @@ 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/chat: post: tags: @@ -2532,7 +2650,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 +2838,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 +2881,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 +2933,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 +2982,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 +3039,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 +3083,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 +3157,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 +3206,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 +3480,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 +3554,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 +3626,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 +3698,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 +3924,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 +4040,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 +4577,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 +4610,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 +4640,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 +4681,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 +4717,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 +4761,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 +4821,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" @@ -6529,7 +6647,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 +6695,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 +6737,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 +6786,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 +7469,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 +7530,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 +7673,20 @@ 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. PlatformChatInputMessage: type: object additionalProperties: false @@ -7444,13 +7702,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 +7794,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 +7825,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 +13679,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 +13713,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 +13725,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 +13774,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 +16463,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 +16940,8 @@ components: - EDIT_DOC - CHAT_TO_ARTIFACT - SHARE_ARTIFACT + - CREATE_AGENT + - MANAGER_INVITE description: Type of the justification. justification: type: string @@ -16701,6 +17040,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 a0c16dd3..efaaf7e0 100644 --- a/.speakeasy/tests.arazzo.yaml +++ b/.speakeasy/tests.arazzo.yaml @@ -158786,6 +158786,7 @@ workflows: requestBody: contentType: application/json payload: + execution_mode: REQUEST_BOUND messages: - content: - text: What is our parental leave policy? @@ -159049,9 +159050,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 @@ -159458,3 +159474,44 @@ 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 diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index b09477b0..fa0f0058 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:9a8a003d8829a81afb889b0a2a60dc27aa5255ae7abd5435befd39322b901487 + sourceBlobDigest: sha256:d02faf09c4a85ffdb953f8b58c9bdef36b047ba38fc066ffa3098b79db4d984d tags: - latest Glean Client API: @@ -16,10 +16,10 @@ targets: glean: source: Glean API sourceNamespace: glean-api-specs - sourceRevisionDigest: sha256:1f470e422d6b202bf6bb80cc2e4b73077b7dab6d476cda804245fc0402ea42f1 - sourceBlobDigest: sha256:8919e7ffe50c1ca78844cd89c216e8ab3c54a8e0003bd5072e7fe3cd35fb192c + sourceRevisionDigest: sha256:9a8a003d8829a81afb889b0a2a60dc27aa5255ae7abd5435befd39322b901487 + sourceBlobDigest: sha256:d02faf09c4a85ffdb953f8b58c9bdef36b047ba38fc066ffa3098b79db4d984d codeSamplesNamespace: glean-api-specs-python-code-samples - codeSamplesRevisionDigest: sha256:07e63ad12522c0ccf6dc9dab0943696972a489679ebc077bb6bfd23d25a123b8 + codeSamplesRevisionDigest: sha256:4b2e09c30603fa7bafedcd030f47d04e433326986d431bc3add72686a1146188 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 1322a150..769b82df 100644 --- a/README.md +++ b/README.md @@ -321,6 +321,8 @@ For more information on obtaining the appropriate token type, please contact you * [get](docs/sdks/agents/README.md#get) - Get agent * [get_schemas](docs/sdks/agents/README.md#get_schemas) - Get agent schemas * [create_run](docs/sdks/agents/README.md#create_run) - Create agent run +* [get_run](docs/sdks/agents/README.md#get_run) - Get agent run +* [cancel_run](docs/sdks/agents/README.md#cancel_run) - Cancel an agent run ### [Chat](docs/sdks/chatsdk/README.md) @@ -605,7 +607,7 @@ The stream is also a [Context Manager][context-manager] and can be used with the underlying connection when the context is exited. ```python -from glean.api_client import Glean +from glean.api_client import Glean, models import os @@ -613,7 +615,28 @@ with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), ) as glean: - res = glean.chat.create_stream(input="What is our parental leave policy?", store=True) + res = glean.chat.create_stream(input="Summarize our parental leave policy as JSON.", store=True, text={ + "format_": { + "type": models.PlatformChatJSONSchemaFormatType.JSON_SCHEMA, + "name": "policy_summary", + "schema_": { + "type": "object", + "properties": { + "eligible_employees": { + "type": "string", + }, + "duration_weeks": { + "type": "integer", + }, + }, + "required": [ + "eligible_employees", + "duration_weeks", + ], + }, + "strict": True, + }, + }) with res as event_stream: for event in event_stream: diff --git a/RELEASES.md b/RELEASES.md index 5d10ffd7..58c8a68b 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -998,4 +998,14 @@ Based on: ### Generated - [python v0.17.14] . ### Releases -- [PyPI v0.17.14] https://pypi.org/project/glean-api-client/0.17.14 - . \ No newline at end of file +- [PyPI v0.17.14] https://pypi.org/project/glean-api-client/0.17.14 - . + +## 2026-09-23 03:41:15 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.798.0 (2.938.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.17.15] . +### Releases +- [PyPI v0.17.15] https://pypi.org/project/glean-api-client/0.17.15 - . \ No newline at end of file diff --git a/docs/models/executionmode.md b/docs/models/executionmode.md new file mode 100644 index 00000000..42030016 --- /dev/null +++ b/docs/models/executionmode.md @@ -0,0 +1,20 @@ +# 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 + +```python +from glean.api_client.models import ExecutionMode + +value = ExecutionMode.REQUEST_BOUND +``` + + +## Values + +| Name | Value | +| --------------- | --------------- | +| `REQUEST_BOUND` | REQUEST_BOUND | +| `DURABLE` | DURABLE | \ No newline at end of file diff --git a/docs/models/feedrequestcategory.md b/docs/models/feedrequestcategory.md index 65906709..662a836b 100644 --- a/docs/models/feedrequestcategory.md +++ b/docs/models/feedrequestcategory.md @@ -64,4 +64,6 @@ value = FeedRequestCategory.DOCUMENT_SUGGESTION | `ARTIFACT_CREATION` | ARTIFACT_CREATION | | `EDIT_DOC` | EDIT_DOC | | `CHAT_TO_ARTIFACT` | CHAT_TO_ARTIFACT | -| `SHARE_ARTIFACT` | SHARE_ARTIFACT | \ No newline at end of file +| `SHARE_ARTIFACT` | SHARE_ARTIFACT | +| `CREATE_AGENT` | CREATE_AGENT | +| `MANAGER_INVITE` | MANAGER_INVITE | \ No newline at end of file diff --git a/docs/models/feedresultcategory.md b/docs/models/feedresultcategory.md index 86b5a71f..b1ed34c8 100644 --- a/docs/models/feedresultcategory.md +++ b/docs/models/feedresultcategory.md @@ -68,4 +68,6 @@ value = FeedResultCategory.DOCUMENT_SUGGESTION | `ARTIFACT_CREATION` | ARTIFACT_CREATION | | `EDIT_DOC` | EDIT_DOC | | `CHAT_TO_ARTIFACT` | CHAT_TO_ARTIFACT | -| `SHARE_ARTIFACT` | SHARE_ARTIFACT | \ No newline at end of file +| `SHARE_ARTIFACT` | SHARE_ARTIFACT | +| `CREATE_AGENT` | CREATE_AGENT | +| `MANAGER_INVITE` | MANAGER_INVITE | \ No newline at end of file diff --git a/docs/models/justificationtype.md b/docs/models/justificationtype.md index 71c24af0..7764769f 100644 --- a/docs/models/justificationtype.md +++ b/docs/models/justificationtype.md @@ -82,4 +82,6 @@ value = JustificationType.FREQUENTLY_ACCESSED | `ARTIFACT_CREATION` | ARTIFACT_CREATION | | `EDIT_DOC` | EDIT_DOC | | `CHAT_TO_ARTIFACT` | CHAT_TO_ARTIFACT | -| `SHARE_ARTIFACT` | SHARE_ARTIFACT | \ No newline at end of file +| `SHARE_ARTIFACT` | SHARE_ARTIFACT | +| `CREATE_AGENT` | CREATE_AGENT | +| `MANAGER_INVITE` | MANAGER_INVITE | \ No newline at end of file diff --git a/docs/models/platformagentruncancellationrequest.md b/docs/models/platformagentruncancellationrequest.md new file mode 100644 index 00000000..94d5766d --- /dev/null +++ b/docs/models/platformagentruncancellationrequest.md @@ -0,0 +1,10 @@ +# PlatformAgentRunCancellationRequest + +Request cooperative cancellation of a run owned by the caller. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `run_id` | *str* | :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/platformagentruncreaterequest.md b/docs/models/platformagentruncreaterequest.md index 8fff9f30..bb7b3c72 100644 --- a/docs/models/platformagentruncreaterequest.md +++ b/docs/models/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` | Dict[str, *Any*] | :heavy_minus_sign: | Input fields for an input-form triggered agent. | -| `messages` | List[[models.PlatformMessageInput](../models/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` | Dict[str, *Any*] | :heavy_minus_sign: | Metadata to pass to the agent. | -| `stream` | *Optional[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` | Dict[str, *Any*] | :heavy_minus_sign: | Input fields for an input-form triggered agent. | +| `messages` | List[[models.PlatformMessageInput](../models/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` | Dict[str, *Any*] | :heavy_minus_sign: | Metadata to pass to the agent. | +| `stream` | *Optional[bool]* | :heavy_minus_sign: | Whether to stream the run response as server-sent events. Not supported in DURABLE mode. | +| `execution_mode` | [Optional[models.ExecutionMode]](../models/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/platformagentrunerror.md b/docs/models/platformagentrunerror.md new file mode 100644 index 00000000..9ef838b7 --- /dev/null +++ b/docs/models/platformagentrunerror.md @@ -0,0 +1,11 @@ +# PlatformAgentRunError + +Caller-safe details of an agent run execution failure. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `code` | *str* | :heavy_check_mark: | Machine-readable execution failure code. | +| `message` | *str* | :heavy_check_mark: | Caller-safe execution failure description. | \ No newline at end of file diff --git a/docs/models/platformagentrunresponse.md b/docs/models/platformagentrunresponse.md new file mode 100644 index 00000000..29594895 --- /dev/null +++ b/docs/models/platformagentrunresponse.md @@ -0,0 +1,11 @@ +# PlatformAgentRunResponse + +Persisted agent run snapshot with a request ID for support correlation. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `run` | [models.PlatformDurableAgentRun](../models/platformdurableagentrun.md) | :heavy_check_mark: | Agent run state, pending tool approvals, and output available independently of the creation request. | +| `request_id` | *str* | :heavy_check_mark: | Platform-generated request ID for support correlation. | \ No newline at end of file diff --git a/docs/models/platformagentrunstate.md b/docs/models/platformagentrunstate.md new file mode 100644 index 00000000..4880387a --- /dev/null +++ b/docs/models/platformagentrunstate.md @@ -0,0 +1,27 @@ +# PlatformAgentRunState + +State of the persisted workflow execution. REQUIRES_INPUT is nonterminal. + +## Example Usage + +```python +from glean.api_client.models import PlatformAgentRunState + +value = PlatformAgentRunState.QUEUED + +# Open enum: unrecognized values are captured as UnrecognizedStr +``` + + +## Values + +| Name | Value | +| ---------------- | ---------------- | +| `QUEUED` | QUEUED | +| `RUNNING` | RUNNING | +| `REQUIRES_INPUT` | REQUIRES_INPUT | +| `SUCCEEDED` | SUCCEEDED | +| `FAILED` | FAILED | +| `CANCELLING` | CANCELLING | +| `CANCELLED` | CANCELLED | +| `EXPIRED` | EXPIRED | \ No newline at end of file diff --git a/docs/models/platformagentruntoolapproval.md b/docs/models/platformagentruntoolapproval.md new file mode 100644 index 00000000..441521ee --- /dev/null +++ b/docs/models/platformagentruntoolapproval.md @@ -0,0 +1,16 @@ +# PlatformAgentRunToolApproval + +Pending approval for a specific persisted tool invocation and its arguments. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `interaction_id` | *str* | :heavy_check_mark: | Identifies this specific invocation approval, not the tool definition. | +| `type` | [models.PlatformAgentRunToolApprovalType](../models/platformagentruntoolapprovaltype.md) | :heavy_check_mark: | Interaction type identifying a tool execution approval request. | +| `tool_id` | *Optional[str]* | :heavy_minus_sign: | Platform tool identifier when recorded. Omitted for requests without one, such as some MCP tools. | +| `display_name` | *str* | :heavy_check_mark: | Display name of the tool requesting approval. | +| `description` | *str* | :heavy_check_mark: | Description of the tool associated with this approval request. | +| `arguments` | Dict[str, *Any*] | :heavy_check_mark: | Arguments from the persisted approval request. Older platform tools use flattened parameters. | +| `expires_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :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/platformagentruntoolapprovaltype.md b/docs/models/platformagentruntoolapprovaltype.md new file mode 100644 index 00000000..7ffe0f37 --- /dev/null +++ b/docs/models/platformagentruntoolapprovaltype.md @@ -0,0 +1,18 @@ +# PlatformAgentRunToolApprovalType + +Interaction type identifying a tool execution approval request. + +## Example Usage + +```python +from glean.api_client.models import PlatformAgentRunToolApprovalType + +value = PlatformAgentRunToolApprovalType.TOOL_APPROVAL +``` + + +## Values + +| Name | Value | +| --------------- | --------------- | +| `TOOL_APPROVAL` | TOOL_APPROVAL | \ No newline at end of file diff --git a/docs/models/platformagentscancelrunrequest.md b/docs/models/platformagentscancelrunrequest.md new file mode 100644 index 00000000..6d39d4a8 --- /dev/null +++ b/docs/models/platformagentscancelrunrequest.md @@ -0,0 +1,9 @@ +# PlatformAgentsCancelRunRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `agent_id` | *str* | :heavy_check_mark: | ID of the agent that owns the run. | {agent_id} | +| `platform_agent_run_cancellation_request` | [models.PlatformAgentRunCancellationRequest](../models/platformagentruncancellationrequest.md) | :heavy_check_mark: | N/A | {
"run_id": "{run_id}"
} | \ No newline at end of file diff --git a/docs/models/platformagentscreaterunresponse.md b/docs/models/platformagentscreaterunresponse.md index 8282996d..b7a18f15 100644 --- a/docs/models/platformagentscreaterunresponse.md +++ b/docs/models/platformagentscreaterunresponse.md @@ -15,3 +15,9 @@ value: models.PlatformAgentRunWaitResponse = /* values here */ value: str = /* values here */ ``` +### `models.PlatformAgentRunResponse` + +```python +value: models.PlatformAgentRunResponse = /* values here */ +``` + diff --git a/docs/models/platformagentsgetrunrequest.md b/docs/models/platformagentsgetrunrequest.md new file mode 100644 index 00000000..9c849b53 --- /dev/null +++ b/docs/models/platformagentsgetrunrequest.md @@ -0,0 +1,9 @@ +# PlatformAgentsGetRunRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | +| `agent_id` | *str* | :heavy_check_mark: | ID of the agent that owns the run. | {agent_id} | +| `run_id` | *str* | :heavy_check_mark: | ID of the durable run to retrieve. | {run_id} | \ No newline at end of file diff --git a/docs/models/platformchatcreateformat.md b/docs/models/platformchatcreateformat.md new file mode 100644 index 00000000..25911073 --- /dev/null +++ b/docs/models/platformchatcreateformat.md @@ -0,0 +1,20 @@ +# PlatformChatCreateFormat + +Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. + + + +## Supported Types + +### `models.PlatformChatTextFormat` + +```python +value: models.PlatformChatTextFormat = /* values here */ +``` + +### `models.PlatformChatJSONSchemaFormat` + +```python +value: models.PlatformChatJSONSchemaFormat = /* values here */ +``` + diff --git a/docs/models/platformchatcreaterequest.md b/docs/models/platformchatcreaterequest.md index 82808d05..a100754d 100644 --- a/docs/models/platformchatcreaterequest.md +++ b/docs/models/platformchatcreaterequest.md @@ -3,9 +3,10 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | -| `input` | [models.PlatformChatCreateInput](../models/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` | *Optional[Literal[False]]* | :heavy_minus_sign: | N/A | -| `store` | *Optional[bool]* | :heavy_minus_sign: | When true (default), persist the interaction and return a `conversation_id`. When false, run ephemerally with no persistence.
| -| `conversation_id` | *Optional[str]* | :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` | [models.PlatformChatCreateInput](../models/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` | *Optional[Literal[False]]* | :heavy_minus_sign: | N/A | +| `store` | *Optional[bool]* | :heavy_minus_sign: | When true (default), persist the interaction and return a `conversation_id`. When false, run ephemerally with no persistence.
| +| `conversation_id` | *Optional[str]* | :heavy_minus_sign: | Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`.
| +| `text` | [Optional[models.PlatformChatCreateText]](../models/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/platformchatcreatestreamformat.md b/docs/models/platformchatcreatestreamformat.md new file mode 100644 index 00000000..cc3cd2a2 --- /dev/null +++ b/docs/models/platformchatcreatestreamformat.md @@ -0,0 +1,20 @@ +# PlatformChatCreateStreamFormat + +Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. + + + +## Supported Types + +### `models.PlatformChatTextFormat` + +```python +value: models.PlatformChatTextFormat = /* values here */ +``` + +### `models.PlatformChatJSONSchemaFormat` + +```python +value: models.PlatformChatJSONSchemaFormat = /* values here */ +``` + diff --git a/docs/models/platformchatcreatestreamrequest.md b/docs/models/platformchatcreatestreamrequest.md index 484d017f..aec04e2f 100644 --- a/docs/models/platformchatcreatestreamrequest.md +++ b/docs/models/platformchatcreatestreamrequest.md @@ -3,9 +3,10 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | -| `input` | [models.PlatformChatCreateStreamInput](../models/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` | *Optional[Literal[True]]* | :heavy_minus_sign: | N/A | -| `store` | *Optional[bool]* | :heavy_minus_sign: | When true (default), persist the interaction and return a `conversation_id`. When false, run ephemerally with no persistence.
| -| `conversation_id` | *Optional[str]* | :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` | [models.PlatformChatCreateStreamInput](../models/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` | *Optional[Literal[True]]* | :heavy_minus_sign: | N/A | +| `store` | *Optional[bool]* | :heavy_minus_sign: | When true (default), persist the interaction and return a `conversation_id`. When false, run ephemerally with no persistence.
| +| `conversation_id` | *Optional[str]* | :heavy_minus_sign: | Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`.
| +| `text` | [Optional[models.PlatformChatCreateStreamText]](../models/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/platformchatcreatestreamtext.md b/docs/models/platformchatcreatestreamtext.md new file mode 100644 index 00000000..7430aa9b --- /dev/null +++ b/docs/models/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_` | [Optional[models.PlatformChatCreateStreamFormat]](../models/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/platformchatcreatetext.md b/docs/models/platformchatcreatetext.md new file mode 100644 index 00000000..c478436a --- /dev/null +++ b/docs/models/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_` | [Optional[models.PlatformChatCreateFormat]](../models/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/models/platformchatjsonschemaformat.md b/docs/models/platformchatjsonschemaformat.md new file mode 100644 index 00000000..3e3ca482 --- /dev/null +++ b/docs/models/platformchatjsonschemaformat.md @@ -0,0 +1,14 @@ +# PlatformChatJSONSchemaFormat + +Constrains the assistant response to a caller-supplied JSON Schema. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `type` | [models.PlatformChatJSONSchemaFormatType](../models/platformchatjsonschemaformattype.md) | :heavy_check_mark: | Discriminator. Must be JSON_SCHEMA. | +| `name` | *str* | :heavy_check_mark: | A stable identifier for the schema. | +| `description` | *Optional[str]* | :heavy_minus_sign: | An optional human-readable description of the schema. | +| `schema_` | Dict[str, *Any*] | :heavy_check_mark: | A JSON Schema object describing the desired output shape. | +| `strict` | *Optional[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/platformchatjsonschemaformattype.md b/docs/models/platformchatjsonschemaformattype.md new file mode 100644 index 00000000..392a7694 --- /dev/null +++ b/docs/models/platformchatjsonschemaformattype.md @@ -0,0 +1,18 @@ +# PlatformChatJSONSchemaFormatType + +Discriminator. Must be JSON_SCHEMA. + +## Example Usage + +```python +from glean.api_client.models import PlatformChatJSONSchemaFormatType + +value = PlatformChatJSONSchemaFormatType.JSON_SCHEMA +``` + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `JSON_SCHEMA` | JSON_SCHEMA | \ No newline at end of file diff --git a/docs/models/platformchatoutputtextcontent.md b/docs/models/platformchatoutputtextcontent.md index 1ea074b5..36632e3d 100644 --- a/docs/models/platformchatoutputtextcontent.md +++ b/docs/models/platformchatoutputtextcontent.md @@ -3,8 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `type` | [models.PlatformChatOutputTextContentType](../models/platformchatoutputtextcontenttype.md) | :heavy_check_mark: | N/A | -| `text` | *str* | :heavy_check_mark: | N/A | -| `annotations` | List[[models.PlatformChatCitationAnnotation](../models/platformchatcitationannotation.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | +| `type` | [models.PlatformChatOutputTextContentType](../models/platformchatoutputtextcontenttype.md) | :heavy_check_mark: | N/A | +| `text` | *str* | :heavy_check_mark: | N/A | +| `structured_output` | [OptionalNullable[models.StructuredOutput]](../models/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` | List[[models.PlatformChatCitationAnnotation](../models/platformchatcitationannotation.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/platformchattextformat.md b/docs/models/platformchattextformat.md new file mode 100644 index 00000000..12f678b7 --- /dev/null +++ b/docs/models/platformchattextformat.md @@ -0,0 +1,10 @@ +# PlatformChatTextFormat + +Unconstrained plain-text assistant output. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `type` | [models.PlatformChatTextFormatType](../models/platformchattextformattype.md) | :heavy_check_mark: | Discriminator. Must be TEXT. | \ No newline at end of file diff --git a/docs/models/platformchattextformattype.md b/docs/models/platformchattextformattype.md new file mode 100644 index 00000000..9dca496f --- /dev/null +++ b/docs/models/platformchattextformattype.md @@ -0,0 +1,18 @@ +# PlatformChatTextFormatType + +Discriminator. Must be TEXT. + +## Example Usage + +```python +from glean.api_client.models import PlatformChatTextFormatType + +value = PlatformChatTextFormatType.TEXT +``` + + +## Values + +| Name | Value | +| ------ | ------ | +| `TEXT` | TEXT | \ No newline at end of file diff --git a/docs/models/platformdurableagentrun.md b/docs/models/platformdurableagentrun.md new file mode 100644 index 00000000..fede41af --- /dev/null +++ b/docs/models/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 | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `run_id` | *str* | :heavy_check_mark: | ID of the run, preserved across approval continuations. | +| `agent_id` | *str* | :heavy_check_mark: | ID of the agent that owns the run. | +| `state` | [models.PlatformAgentRunState](../models/platformagentrunstate.md) | :heavy_check_mark: | State of the persisted workflow execution. REQUIRES_INPUT is nonterminal. | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Timestamp when the run was first persisted. | +| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :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.
| +| `expires_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Execution deadline, when one is set. Not the run history retention deadline. | +| `pending_interactions` | List[[models.PlatformAgentRunToolApproval](../models/platformagentruntoolapproval.md)] | :heavy_check_mark: | Unanswered tool approvals when the run is in REQUIRES_INPUT. Empty in other states. | +| `output` | Dict[str, *Any*] | :heavy_minus_sign: | Accumulated text-only agent output under the messages key, when available. | +| `error` | [Optional[models.PlatformAgentRunError]](../models/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/structuredoutput.md b/docs/models/structuredoutput.md new file mode 100644 index 00000000..45e8ab02 --- /dev/null +++ b/docs/models/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/sdks/agents/README.md b/docs/sdks/agents/README.md index f05a4d59..0622c635 100644 --- a/docs/sdks/agents/README.md +++ b/docs/sdks/agents/README.md @@ -8,6 +8,8 @@ * [get](#get) - Get agent * [get_schemas](#get_schemas) - Get agent schemas * [create_run](#create_run) - Create agent run +* [get_run](#get_run) - Get agent run +* [cancel_run](#cancel_run) - Cancel an agent run ## search @@ -141,7 +143,7 @@ with Glean( ## create_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. Each POST creates a new run; retrying a POST can create another execution. 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 @@ -166,7 +168,7 @@ with Glean( }, ], }, - ], stream=False) + ], stream=False, execution_mode=models.ExecutionMode.REQUEST_BOUND) # Handle response print(res) @@ -175,14 +177,15 @@ with Glean( ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `agent_id` | *str* | :heavy_check_mark: | ID of the agent to run. | {agent_id} | -| `input` | Dict[str, *Any*] | :heavy_minus_sign: | Input fields for an input-form triggered agent. | | -| `messages` | List[[models.PlatformMessageInput](../../models/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` | Dict[str, *Any*] | :heavy_minus_sign: | Metadata to pass to the agent. | | -| `stream` | *Optional[bool]* | :heavy_minus_sign: | Whether to stream the run response as server-sent events. | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `agent_id` | *str* | :heavy_check_mark: | ID of the agent to run. | {agent_id} | +| `input` | Dict[str, *Any*] | :heavy_minus_sign: | Input fields for an input-form triggered agent. | | +| `messages` | List[[models.PlatformMessageInput](../../models/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` | Dict[str, *Any*] | :heavy_minus_sign: | Metadata to pass to the agent. | | +| `stream` | *Optional[bool]* | :heavy_minus_sign: | Whether to stream the run response as server-sent events. Not supported in DURABLE mode. | | +| `execution_mode` | [Optional[models.ExecutionMode]](../../models/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.
| | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -195,4 +198,92 @@ with Glean( | errors.PlatformUnauthorizedAgentToolsProblemError | 422 | application/problem+json | | errors.PlatformProblemDetailError | 400, 401, 403, 404, 408, 409, 413, 429 | application/problem+json | | errors.PlatformProblemDetailError | 500, 503 | application/problem+json | -| errors.GleanError | 4XX, 5XX | \*/\* | \ No newline at end of file +| errors.GleanError | 4XX, 5XX | \*/\* | + +## get_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. + + +### Example Usage + + +```python +from glean.api_client import Glean +import os + + +with Glean( + api_token=os.getenv("GLEAN_API_TOKEN", ""), +) as glean: + + res = glean.agents.get_run(agent_id="{agent_id}", run_id="{run_id}") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `agent_id` | *str* | :heavy_check_mark: | ID of the agent that owns the run. | {agent_id} | +| `run_id` | *str* | :heavy_check_mark: | ID of the durable run to retrieve. | {run_id} | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[models.PlatformAgentRunResponse](../../models/platformagentrunresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.PlatformProblemDetailError | 400, 401, 403, 404, 408, 429 | application/problem+json | +| errors.PlatformProblemDetailError | 500, 503 | application/problem+json | +| errors.GleanError | 4XX, 5XX | \*/\* | + +## cancel_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. + + +### Example Usage + + +```python +from glean.api_client import Glean +import os + + +with Glean( + api_token=os.getenv("GLEAN_API_TOKEN", ""), +) as glean: + + res = glean.agents.cancel_run(agent_id="{agent_id}", run_id="{run_id}") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `agent_id` | *str* | :heavy_check_mark: | ID of the agent that owns the run. | {agent_id} | +| `run_id` | *str* | :heavy_check_mark: | ID of the run to cancel. Must belong to the agent identified in the path. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[models.PlatformAgentRunResponse](../../models/platformagentrunresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.PlatformProblemDetailError | 400, 401, 403, 404, 408, 409, 413, 429 | application/problem+json | +| errors.PlatformProblemDetailError | 500, 503 | application/problem+json | +| errors.GleanError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/chatsdk/README.md b/docs/sdks/chatsdk/README.md index 4ccddf51..a6bdce51 100644 --- a/docs/sdks/chatsdk/README.md +++ b/docs/sdks/chatsdk/README.md @@ -16,7 +16,7 @@ Run an assistant turn. The default response is JSON. HTTP clients request server ```python -from glean.api_client import Glean +from glean.api_client import Glean, models import os @@ -24,7 +24,28 @@ with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), ) as glean: - res = glean.chat.create(input="What is our parental leave policy?", store=True) + res = glean.chat.create(input="Summarize our parental leave policy as JSON.", store=True, text={ + "format_": { + "type": models.PlatformChatJSONSchemaFormatType.JSON_SCHEMA, + "name": "policy_summary", + "schema_": { + "type": "object", + "properties": { + "eligible_employees": { + "type": "string", + }, + "duration_weeks": { + "type": "integer", + }, + }, + "required": [ + "eligible_employees", + "duration_weeks", + ], + }, + "strict": True, + }, + }) # Handle response print(res) @@ -33,12 +54,13 @@ with Glean( ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | -| `input` | [models.PlatformChatCreateInput](../../models/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`.
| -| `store` | *Optional[bool]* | :heavy_minus_sign: | When true (default), persist the interaction and return a `conversation_id`. When false, run ephemerally with no persistence.
| -| `conversation_id` | *Optional[str]* | :heavy_minus_sign: | Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`.
| -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `input` | [models.PlatformChatCreateInput](../../models/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`.
| +| `store` | *Optional[bool]* | :heavy_minus_sign: | When true (default), persist the interaction and return a `conversation_id`. When false, run ephemerally with no persistence.
| +| `conversation_id` | *Optional[str]* | :heavy_minus_sign: | Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`.
| +| `text` | [Optional[models.PlatformChatCreateText]](../../models/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.
| +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response @@ -61,7 +83,7 @@ SDK-only logical operation. HTTP clients must call the base path; the URL fragme ```python -from glean.api_client import Glean +from glean.api_client import Glean, models import os @@ -69,7 +91,28 @@ with Glean( api_token=os.getenv("GLEAN_API_TOKEN", ""), ) as glean: - res = glean.chat.create_stream(input="What is our parental leave policy?", store=True) + res = glean.chat.create_stream(input="Summarize our parental leave policy as JSON.", store=True, text={ + "format_": { + "type": models.PlatformChatJSONSchemaFormatType.JSON_SCHEMA, + "name": "policy_summary", + "schema_": { + "type": "object", + "properties": { + "eligible_employees": { + "type": "string", + }, + "duration_weeks": { + "type": "integer", + }, + }, + "required": [ + "eligible_employees", + "duration_weeks", + ], + }, + "strict": True, + }, + }) with res as event_stream: for event in event_stream: @@ -80,12 +123,13 @@ with Glean( ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | -| `input` | [models.PlatformChatCreateStreamInput](../../models/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`.
| -| `store` | *Optional[bool]* | :heavy_minus_sign: | When true (default), persist the interaction and return a `conversation_id`. When false, run ephemerally with no persistence.
| -| `conversation_id` | *Optional[str]* | :heavy_minus_sign: | Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`.
| -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `input` | [models.PlatformChatCreateStreamInput](../../models/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`.
| +| `store` | *Optional[bool]* | :heavy_minus_sign: | When true (default), persist the interaction and return a `conversation_id`. When false, run ephemerally with no persistence.
| +| `conversation_id` | *Optional[str]* | :heavy_minus_sign: | Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`.
| +| `text` | [Optional[models.PlatformChatCreateStreamText]](../../models/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.
| +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response diff --git a/pyproject.toml b/pyproject.toml index 47df73c3..b7cb0276 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "glean-api-client" -version = "0.17.14" +version = "0.17.15" description = "Python Client SDK Generated by Speakeasy." authors = [{ name = "Glean Technologies, Inc." },] readme = "README-PYPI.md" diff --git a/src/glean/api_client/_version.py b/src/glean/api_client/_version.py index baf219c0..4af11e8e 100644 --- a/src/glean/api_client/_version.py +++ b/src/glean/api_client/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "glean-api-client" -__version__: str = "0.17.14" +__version__: str = "0.17.15" __openapi_doc_version__: str = "0.9.0" -__gen_version__: str = "2.937.18" -__user_agent__: str = "speakeasy-sdk/python 0.17.14 2.937.18 0.9.0 glean-api-client" +__gen_version__: str = "2.938.0" +__user_agent__: str = "speakeasy-sdk/python 0.17.15 2.938.0 0.9.0 glean-api-client" try: if __package__ is not None: diff --git a/src/glean/api_client/agents.py b/src/glean/api_client/agents.py index 68817cd0..12a99b3e 100644 --- a/src/glean/api_client/agents.py +++ b/src/glean/api_client/agents.py @@ -667,6 +667,9 @@ def create_run( ] = None, metadata: Optional[Mapping[str, Any]] = None, stream: Optional[bool] = False, + execution_mode: Optional[ + models.ExecutionMode + ] = models.ExecutionMode.REQUEST_BOUND, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, accept_header_override: Optional[CreateRunAcceptEnum] = None, @@ -675,7 +678,7 @@ def create_run( ) -> models.PlatformAgentsCreateRunResponse: r"""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. Each POST creates a new run; retrying a POST can create another execution. 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. :param agent_id: ID of the agent to run. @@ -683,7 +686,9 @@ def create_run( :param messages: 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`. :param metadata: Metadata to pass to the agent. - :param stream: Whether to stream the run response as server-sent events. + :param stream: Whether to stream the run response as server-sent events. Not supported in DURABLE mode. + :param execution_mode: 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. + :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -709,6 +714,7 @@ def create_run( ), metadata=utils.unmarshal(metadata, Optional[Dict[str, Any]]), stream=stream, + execution_mode=execution_mode, ), ) @@ -773,6 +779,8 @@ def create_run( ) if utils.match_response(http_res, "200", "text/event-stream"): return http_res.text + if utils.match_response(http_res, "201", "application/json"): + return unmarshal_json_response(models.PlatformAgentRunResponse, http_res) if utils.match_response(http_res, "422", "application/problem+json"): response_data = unmarshal_json_response( errors.PlatformUnauthorizedAgentToolsProblemErrorData, http_res @@ -816,6 +824,9 @@ async def create_run_async( ] = None, metadata: Optional[Mapping[str, Any]] = None, stream: Optional[bool] = False, + execution_mode: Optional[ + models.ExecutionMode + ] = models.ExecutionMode.REQUEST_BOUND, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, accept_header_override: Optional[CreateRunAcceptEnum] = None, @@ -824,7 +835,7 @@ async def create_run_async( ) -> models.PlatformAgentsCreateRunResponse: r"""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. Each POST creates a new run; retrying a POST can create another execution. 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. :param agent_id: ID of the agent to run. @@ -832,7 +843,9 @@ async def create_run_async( :param messages: 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`. :param metadata: Metadata to pass to the agent. - :param stream: Whether to stream the run response as server-sent events. + :param stream: Whether to stream the run response as server-sent events. Not supported in DURABLE mode. + :param execution_mode: 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. + :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -858,6 +871,7 @@ async def create_run_async( ), metadata=utils.unmarshal(metadata, Optional[Dict[str, Any]]), stream=stream, + execution_mode=execution_mode, ), ) @@ -922,6 +936,8 @@ async def create_run_async( ) if utils.match_response(http_res, "200", "text/event-stream"): return http_res.text + if utils.match_response(http_res, "201", "application/json"): + return unmarshal_json_response(models.PlatformAgentRunResponse, http_res) if utils.match_response(http_res, "422", "application/problem+json"): response_data = unmarshal_json_response( errors.PlatformUnauthorizedAgentToolsProblemErrorData, http_res @@ -951,3 +967,447 @@ async def create_run_async( raise errors.GleanError("API error occurred", http_res, http_res_text) raise errors.GleanError("Unexpected response received", http_res) + + def get_run( + self, + *, + agent_id: str, + run_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.PlatformAgentRunResponse: + r"""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. + + + :param agent_id: ID of the agent that owns the run. + :param run_id: ID of the durable run to retrieve. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.PlatformAgentsGetRunRequest( + agent_id=agent_id, + run_id=run_id, + ) + + req = self._build_request( + method="GET", + path="/api/agents/{agent_id}/runs/{run_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="platform-agents-get-run", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Agents"], + extensions={"x-visibility": "Public"}, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.PlatformAgentRunResponse, http_res) + if utils.match_response( + http_res, + ["400", "401", "403", "404", "408", "429"], + "application/problem+json", + ): + response_data = unmarshal_json_response( + errors.PlatformProblemDetailErrorData, http_res + ) + raise errors.PlatformProblemDetailError(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/problem+json"): + response_data = unmarshal_json_response( + errors.PlatformProblemDetailErrorData, http_res + ) + raise errors.PlatformProblemDetailError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) + + async def get_run_async( + self, + *, + agent_id: str, + run_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.PlatformAgentRunResponse: + r"""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. + + + :param agent_id: ID of the agent that owns the run. + :param run_id: ID of the durable run to retrieve. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.PlatformAgentsGetRunRequest( + agent_id=agent_id, + run_id=run_id, + ) + + req = self._build_request_async( + method="GET", + path="/api/agents/{agent_id}/runs/{run_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="platform-agents-get-run", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Agents"], + extensions={"x-visibility": "Public"}, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.PlatformAgentRunResponse, http_res) + if utils.match_response( + http_res, + ["400", "401", "403", "404", "408", "429"], + "application/problem+json", + ): + response_data = unmarshal_json_response( + errors.PlatformProblemDetailErrorData, http_res + ) + raise errors.PlatformProblemDetailError(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/problem+json"): + response_data = unmarshal_json_response( + errors.PlatformProblemDetailErrorData, http_res + ) + raise errors.PlatformProblemDetailError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) + + def cancel_run( + self, + *, + agent_id: str, + run_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.PlatformAgentRunResponse: + r"""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. + + + :param agent_id: ID of the agent that owns the run. + :param run_id: ID of the run to cancel. Must belong to the agent identified in the path. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.PlatformAgentsCancelRunRequest( + agent_id=agent_id, + platform_agent_run_cancellation_request=models.PlatformAgentRunCancellationRequest( + run_id=run_id, + ), + ) + + req = self._build_request( + method="POST", + path="/api/agents/{agent_id}/cancellations", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.platform_agent_run_cancellation_request, + False, + False, + "json", + models.PlatformAgentRunCancellationRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="platform-agents-cancel-run", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Agents"], + extensions={ + "x-codegen-request-body-name": "payload", + "x-visibility": "Public", + }, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.PlatformAgentRunResponse, http_res) + if utils.match_response( + http_res, + ["400", "401", "403", "404", "408", "409", "413", "429"], + "application/problem+json", + ): + response_data = unmarshal_json_response( + errors.PlatformProblemDetailErrorData, http_res + ) + raise errors.PlatformProblemDetailError(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/problem+json"): + response_data = unmarshal_json_response( + errors.PlatformProblemDetailErrorData, http_res + ) + raise errors.PlatformProblemDetailError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) + + async def cancel_run_async( + self, + *, + agent_id: str, + run_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.PlatformAgentRunResponse: + r"""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. + + + :param agent_id: ID of the agent that owns the run. + :param run_id: ID of the run to cancel. Must belong to the agent identified in the path. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.PlatformAgentsCancelRunRequest( + agent_id=agent_id, + platform_agent_run_cancellation_request=models.PlatformAgentRunCancellationRequest( + run_id=run_id, + ), + ) + + req = self._build_request_async( + method="POST", + path="/api/agents/{agent_id}/cancellations", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.platform_agent_run_cancellation_request, + False, + False, + "json", + models.PlatformAgentRunCancellationRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="platform-agents-cancel-run", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Agents"], + extensions={ + "x-codegen-request-body-name": "payload", + "x-visibility": "Public", + }, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.PlatformAgentRunResponse, http_res) + if utils.match_response( + http_res, + ["400", "401", "403", "404", "408", "409", "413", "429"], + "application/problem+json", + ): + response_data = unmarshal_json_response( + errors.PlatformProblemDetailErrorData, http_res + ) + raise errors.PlatformProblemDetailError(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/problem+json"): + response_data = unmarshal_json_response( + errors.PlatformProblemDetailErrorData, http_res + ) + raise errors.PlatformProblemDetailError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) diff --git a/src/glean/api_client/chat_sdk.py b/src/glean/api_client/chat_sdk.py index 9a48f24a..b37457a8 100644 --- a/src/glean/api_client/chat_sdk.py +++ b/src/glean/api_client/chat_sdk.py @@ -18,6 +18,9 @@ def create( ], store: Optional[bool] = True, conversation_id: Optional[str] = None, + text: Optional[ + Union[models.PlatformChatCreateText, models.PlatformChatCreateTextTypedDict] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -34,6 +37,8 @@ def create( :param conversation_id: Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`. + :param text: 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. + :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -53,6 +58,9 @@ def create( input=utils.get_pydantic_model(input, models.PlatformChatCreateInput), store=store, conversation_id=conversation_id, + text=utils.get_pydantic_model( + text, Optional[models.PlatformChatCreateText] + ), ) req = self._build_request( @@ -139,6 +147,9 @@ async def create_async( ], store: Optional[bool] = True, conversation_id: Optional[str] = None, + text: Optional[ + Union[models.PlatformChatCreateText, models.PlatformChatCreateTextTypedDict] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -155,6 +166,8 @@ async def create_async( :param conversation_id: Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`. + :param text: 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. + :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -174,6 +187,9 @@ async def create_async( input=utils.get_pydantic_model(input, models.PlatformChatCreateInput), store=store, conversation_id=conversation_id, + text=utils.get_pydantic_model( + text, Optional[models.PlatformChatCreateText] + ), ) req = self._build_request_async( @@ -261,6 +277,12 @@ def create_stream( ], store: Optional[bool] = True, conversation_id: Optional[str] = None, + text: Optional[ + Union[ + models.PlatformChatCreateStreamText, + models.PlatformChatCreateStreamTextTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -277,6 +299,8 @@ def create_stream( :param conversation_id: Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`. + :param text: 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. + :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -296,6 +320,9 @@ def create_stream( input=utils.get_pydantic_model(input, models.PlatformChatCreateStreamInput), store=store, conversation_id=conversation_id, + text=utils.get_pydantic_model( + text, Optional[models.PlatformChatCreateStreamText] + ), ) req = self._build_request( @@ -395,6 +422,12 @@ async def create_stream_async( ], store: Optional[bool] = True, conversation_id: Optional[str] = None, + text: Optional[ + Union[ + models.PlatformChatCreateStreamText, + models.PlatformChatCreateStreamTextTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -411,6 +444,8 @@ async def create_stream_async( :param conversation_id: Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`. + :param text: 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. + :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -430,6 +465,9 @@ async def create_stream_async( input=utils.get_pydantic_model(input, models.PlatformChatCreateStreamInput), store=store, conversation_id=conversation_id, + text=utils.get_pydantic_model( + text, Optional[models.PlatformChatCreateStreamText] + ), ) req = self._build_request_async( diff --git a/src/glean/api_client/client_agents.py b/src/glean/api_client/client_agents.py index fa6802c8..0d3bb2df 100644 --- a/src/glean/api_client/client_agents.py +++ b/src/glean/api_client/client_agents.py @@ -100,7 +100,7 @@ def create( self.sdk_configuration.security, models.Security ), tags=["Agents"], - extensions={"x-visibility": "Preview"}, + extensions={"x-visibility": "Public"}, ), request=req, is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), @@ -207,7 +207,7 @@ async def create_async( self.sdk_configuration.security, models.Security ), tags=["Agents"], - extensions={"x-visibility": "Preview"}, + extensions={"x-visibility": "Public"}, ), request=req, is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), @@ -310,7 +310,7 @@ def retrieve( "message": "Use GET /api/agents/{agent_id} instead.", "removal": "2027-04-15", }, - "x-visibility": "Preview", + "x-visibility": "Public", }, ), request=req, @@ -418,7 +418,7 @@ async def retrieve_async( "message": "Use GET /api/agents/{agent_id} instead.", "removal": "2027-04-15", }, - "x-visibility": "Preview", + "x-visibility": "Public", }, ), request=req, @@ -530,7 +530,7 @@ def update( self.sdk_configuration.security, models.Security ), tags=["Agents"], - extensions={"x-visibility": "Preview"}, + extensions={"x-visibility": "Public"}, ), request=req, is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), @@ -641,7 +641,7 @@ async def update_async( self.sdk_configuration.security, models.Security ), tags=["Agents"], - extensions={"x-visibility": "Preview"}, + extensions={"x-visibility": "Public"}, ), request=req, is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), @@ -748,7 +748,7 @@ def retrieve_schemas( "message": "Use GET /api/agents/{agent_id}/schemas instead.", "removal": "2027-04-15", }, - "x-visibility": "Preview", + "x-visibility": "Public", }, ), request=req, @@ -856,7 +856,7 @@ async def retrieve_schemas_async( "message": "Use GET /api/agents/{agent_id}/schemas instead.", "removal": "2027-04-15", }, - "x-visibility": "Preview", + "x-visibility": "Public", }, ), request=req, @@ -991,7 +991,7 @@ def import_( self.sdk_configuration.security, models.Security ), tags=["Agents"], - extensions={"x-visibility": "Preview"}, + extensions={"x-visibility": "Public"}, ), request=req, is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), @@ -1125,7 +1125,7 @@ async def import__async( self.sdk_configuration.security, models.Security ), tags=["Agents"], - extensions={"x-visibility": "Preview"}, + extensions={"x-visibility": "Public"}, ), request=req, is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), @@ -1229,7 +1229,7 @@ def list( "message": "Use POST /api/agents/search instead.", "removal": "2027-04-15", }, - "x-visibility": "Preview", + "x-visibility": "Public", }, ), request=req, @@ -1334,7 +1334,7 @@ async def list_async( "message": "Use POST /api/agents/search instead.", "removal": "2027-04-15", }, - "x-visibility": "Preview", + "x-visibility": "Public", }, ), request=req, @@ -1452,7 +1452,7 @@ def run_stream( "message": "Use POST /api/agents/{agent_id}/runs with stream=true instead.", "removal": "2027-04-15", }, - "x-visibility": "Preview", + "x-visibility": "Public", }, ), request=req, @@ -1575,7 +1575,7 @@ async def run_stream_async( "message": "Use POST /api/agents/{agent_id}/runs with stream=true instead.", "removal": "2027-04-15", }, - "x-visibility": "Preview", + "x-visibility": "Public", }, ), request=req, @@ -1698,7 +1698,7 @@ def run( "message": "Use POST /api/agents/{agent_id}/runs instead.", "removal": "2027-04-15", }, - "x-visibility": "Preview", + "x-visibility": "Public", }, ), request=req, @@ -1818,7 +1818,7 @@ async def run_async( "message": "Use POST /api/agents/{agent_id}/runs instead.", "removal": "2027-04-15", }, - "x-visibility": "Preview", + "x-visibility": "Public", }, ), request=req, diff --git a/src/glean/api_client/client_chat.py b/src/glean/api_client/client_chat.py index 1095d5f1..3c75dccf 100644 --- a/src/glean/api_client/client_chat.py +++ b/src/glean/api_client/client_chat.py @@ -1184,7 +1184,7 @@ def retrieve_application( tags=["Chat"], extensions={ "x-codegen-request-body-name": "payload", - "x-visibility": "Preview", + "x-visibility": "Public", }, ), request=req, @@ -1288,7 +1288,7 @@ async def retrieve_application_async( tags=["Chat"], extensions={ "x-codegen-request-body-name": "payload", - "x-visibility": "Preview", + "x-visibility": "Public", }, ), request=req, diff --git a/src/glean/api_client/client_datasources.py b/src/glean/api_client/client_datasources.py index 0cfdfc1b..f62bca1a 100644 --- a/src/glean/api_client/client_datasources.py +++ b/src/glean/api_client/client_datasources.py @@ -82,7 +82,7 @@ def retrieve_configuration( self.sdk_configuration.security, models.Security ), tags=["Datasources"], - extensions={"x-visibility": "Preview"}, + extensions={"x-visibility": "Public"}, ), request=req, is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), @@ -178,7 +178,7 @@ async def retrieve_configuration_async( self.sdk_configuration.security, models.Security ), tags=["Datasources"], - extensions={"x-visibility": "Preview"}, + extensions={"x-visibility": "Public"}, ), request=req, is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), @@ -291,7 +291,7 @@ def update_configuration( self.sdk_configuration.security, models.Security ), tags=["Datasources"], - extensions={"x-visibility": "Preview"}, + extensions={"x-visibility": "Public"}, ), request=req, is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), @@ -404,7 +404,7 @@ async def update_configuration_async( self.sdk_configuration.security, models.Security ), tags=["Datasources"], - extensions={"x-visibility": "Preview"}, + extensions={"x-visibility": "Public"}, ), request=req, is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), @@ -497,7 +497,7 @@ def retrieve_credential_status( self.sdk_configuration.security, models.Security ), tags=["Datasources"], - extensions={"x-visibility": "Preview"}, + extensions={"x-visibility": "Public"}, ), request=req, is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), @@ -590,7 +590,7 @@ async def retrieve_credential_status_async( self.sdk_configuration.security, models.Security ), tags=["Datasources"], - extensions={"x-visibility": "Preview"}, + extensions={"x-visibility": "Public"}, ), request=req, is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), @@ -701,7 +701,7 @@ def rotate_credentials( self.sdk_configuration.security, models.Security ), tags=["Datasources"], - extensions={"x-visibility": "Preview"}, + extensions={"x-visibility": "Public"}, ), request=req, is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), @@ -812,7 +812,7 @@ async def rotate_credentials_async( self.sdk_configuration.security, models.Security ), tags=["Datasources"], - extensions={"x-visibility": "Preview"}, + extensions={"x-visibility": "Public"}, ), request=req, is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), diff --git a/src/glean/api_client/client_documents.py b/src/glean/api_client/client_documents.py index d93ffbbf..7b2678cd 100644 --- a/src/glean/api_client/client_documents.py +++ b/src/glean/api_client/client_documents.py @@ -93,7 +93,7 @@ def retrieve_permissions( tags=["Documents"], extensions={ "x-codegen-request-body-name": "payload", - "x-visibility": "Preview", + "x-visibility": "Public", }, ), request=req, @@ -194,7 +194,7 @@ async def retrieve_permissions_async( tags=["Documents"], extensions={ "x-codegen-request-body-name": "payload", - "x-visibility": "Preview", + "x-visibility": "Public", }, ), request=req, @@ -509,7 +509,7 @@ def retrieve_by_facets( tags=["Documents"], extensions={ "x-codegen-request-body-name": "payload", - "x-visibility": "Preview", + "x-visibility": "Public", }, ), request=req, @@ -620,7 +620,7 @@ async def retrieve_by_facets_async( tags=["Documents"], extensions={ "x-codegen-request-body-name": "payload", - "x-visibility": "Preview", + "x-visibility": "Public", }, ), request=req, diff --git a/src/glean/api_client/client_search.py b/src/glean/api_client/client_search.py index 6c95bb5b..d97480ed 100644 --- a/src/glean/api_client/client_search.py +++ b/src/glean/api_client/client_search.py @@ -144,7 +144,7 @@ def query_as_admin( tags=["Search"], extensions={ "x-codegen-request-body-name": "payload", - "x-visibility": "Preview", + "x-visibility": "Public", }, ), request=req, @@ -300,7 +300,7 @@ async def query_as_admin_async( tags=["Search"], extensions={ "x-codegen-request-body-name": "payload", - "x-visibility": "Preview", + "x-visibility": "Public", }, ), request=req, @@ -945,7 +945,7 @@ def recommendations( tags=["Search"], extensions={ "x-codegen-request-body-name": "payload", - "x-visibility": "Preview", + "x-visibility": "Public", }, ), request=req, @@ -1088,7 +1088,7 @@ async def recommendations_async( tags=["Search"], extensions={ "x-codegen-request-body-name": "payload", - "x-visibility": "Preview", + "x-visibility": "Public", }, ), request=req, diff --git a/src/glean/api_client/collections.py b/src/glean/api_client/collections.py index ddc1b4d7..23338f67 100644 --- a/src/glean/api_client/collections.py +++ b/src/glean/api_client/collections.py @@ -1617,7 +1617,7 @@ def retrieve( tags=["Collections"], extensions={ "x-codegen-request-body-name": "payload", - "x-visibility": "Preview", + "x-visibility": "Public", }, ), request=req, @@ -1727,7 +1727,7 @@ async def retrieve_async( tags=["Collections"], extensions={ "x-codegen-request-body-name": "payload", - "x-visibility": "Preview", + "x-visibility": "Public", }, ), request=req, diff --git a/src/glean/api_client/messages.py b/src/glean/api_client/messages.py index 77016bff..b140b656 100644 --- a/src/glean/api_client/messages.py +++ b/src/glean/api_client/messages.py @@ -109,7 +109,7 @@ def retrieve( tags=["Messages"], extensions={ "x-codegen-request-body-name": "payload", - "x-visibility": "Preview", + "x-visibility": "Public", }, ), request=req, @@ -227,7 +227,7 @@ async def retrieve_async( tags=["Messages"], extensions={ "x-codegen-request-body-name": "payload", - "x-visibility": "Preview", + "x-visibility": "Public", }, ), request=req, diff --git a/src/glean/api_client/models/__init__.py b/src/glean/api_client/models/__init__.py index f428e57a..44c4c084 100644 --- a/src/glean/api_client/models/__init__.py +++ b/src/glean/api_client/models/__init__.py @@ -1279,12 +1279,20 @@ from .peruserinsight import PerUserInsight, PerUserInsightTypedDict from .pinop import PinRequestRequest, PinRequestRequestTypedDict from .pinrequest import PinRequest, PinRequestTypedDict + from .platform_agents_cancel_runop import ( + PlatformAgentsCancelRunRequest, + PlatformAgentsCancelRunRequestTypedDict, + ) from .platform_agents_create_runop import ( PlatformAgentsCreateRunRequest, PlatformAgentsCreateRunRequestTypedDict, PlatformAgentsCreateRunResponse, PlatformAgentsCreateRunResponseTypedDict, ) + from .platform_agents_get_runop import ( + PlatformAgentsGetRunRequest, + PlatformAgentsGetRunRequestTypedDict, + ) from .platform_agents_get_schemasop import ( PlatformAgentsGetSchemasRequest, PlatformAgentsGetSchemasRequestTypedDict, @@ -1294,16 +1302,24 @@ PlatformAgentsGetRequestTypedDict, ) from .platform_chat_create_streamop import ( + PlatformChatCreateStreamFormat, + PlatformChatCreateStreamFormatTypedDict, PlatformChatCreateStreamInput, PlatformChatCreateStreamInputTypedDict, PlatformChatCreateStreamRequest, PlatformChatCreateStreamRequestTypedDict, + PlatformChatCreateStreamText, + PlatformChatCreateStreamTextTypedDict, ) from .platform_chat_createop import ( + PlatformChatCreateFormat, + PlatformChatCreateFormatTypedDict, PlatformChatCreateInput, PlatformChatCreateInputTypedDict, PlatformChatCreateRequest, PlatformChatCreateRequestTypedDict, + PlatformChatCreateText, + PlatformChatCreateTextTypedDict, ) from .platform_search_filtersop import ( PlatformSearchFiltersRequest, @@ -1414,10 +1430,29 @@ PlatformAgentGetResponseTypedDict, ) from .platformagentrun import PlatformAgentRun, PlatformAgentRunTypedDict + from .platformagentruncancellationrequest import ( + PlatformAgentRunCancellationRequest, + PlatformAgentRunCancellationRequestTypedDict, + ) from .platformagentruncreaterequest import ( + ExecutionMode, PlatformAgentRunCreateRequest, PlatformAgentRunCreateRequestTypedDict, ) + from .platformagentrunerror import ( + PlatformAgentRunError, + PlatformAgentRunErrorTypedDict, + ) + from .platformagentrunresponse import ( + PlatformAgentRunResponse, + PlatformAgentRunResponseTypedDict, + ) + from .platformagentrunstate import PlatformAgentRunState + from .platformagentruntoolapproval import ( + PlatformAgentRunToolApproval, + PlatformAgentRunToolApprovalType, + PlatformAgentRunToolApprovalTypedDict, + ) from .platformagentrunwaitresponse import ( PlatformAgentRunWaitResponse, PlatformAgentRunWaitResponseTypedDict, @@ -1488,6 +1523,11 @@ PlatformChatInputMessageRole, PlatformChatInputMessageTypedDict, ) + from .platformchatjsonschemaformat import ( + PlatformChatJSONSchemaFormat, + PlatformChatJSONSchemaFormatType, + PlatformChatJSONSchemaFormatTypedDict, + ) from .platformchatoutputmessage import ( PlatformChatOutputMessage, PlatformChatOutputMessageRole, @@ -1498,6 +1538,8 @@ PlatformChatOutputTextContent, PlatformChatOutputTextContentType, PlatformChatOutputTextContentTypedDict, + StructuredOutput, + StructuredOutputTypedDict, ) from .platformchatpersonsource import ( PlatformChatPersonSource, @@ -1566,6 +1608,11 @@ PlatformChatStreamResponseFailedServerSentEvent, PlatformChatStreamResponseFailedServerSentEventTypedDict, ) + from .platformchattextformat import ( + PlatformChatTextFormat, + PlatformChatTextFormatType, + PlatformChatTextFormatTypedDict, + ) from .platformcontentschedulewebhookevent import ( PlatformContentScheduleWebhookEvent, PlatformContentScheduleWebhookEventTypedDict, @@ -1579,6 +1626,10 @@ PlatformDocumentChangeWebhookEvent, PlatformDocumentChangeWebhookEventTypedDict, ) + from .platformdurableagentrun import ( + PlatformDurableAgentRun, + PlatformDurableAgentRunTypedDict, + ) from .platformfilter import PlatformFilter, PlatformFilterTypedDict from .platformfilterfieldinfo import ( PlatformFilterFieldInfo, @@ -2804,6 +2855,7 @@ "EventClassificationName", "EventClassificationTypedDict", "EventStrategyName", + "ExecutionMode", "ExportInfo", "ExportInfoExportType", "ExportInfoStatus", @@ -3219,20 +3271,34 @@ "PlatformAgentGetResponse", "PlatformAgentGetResponseTypedDict", "PlatformAgentRun", + "PlatformAgentRunCancellationRequest", + "PlatformAgentRunCancellationRequestTypedDict", "PlatformAgentRunCreateRequest", "PlatformAgentRunCreateRequestTypedDict", + "PlatformAgentRunError", + "PlatformAgentRunErrorTypedDict", + "PlatformAgentRunResponse", + "PlatformAgentRunResponseTypedDict", + "PlatformAgentRunState", + "PlatformAgentRunToolApproval", + "PlatformAgentRunToolApprovalType", + "PlatformAgentRunToolApprovalTypedDict", "PlatformAgentRunTypedDict", "PlatformAgentRunWaitResponse", "PlatformAgentRunWaitResponseTypedDict", "PlatformAgentSchemasResponse", "PlatformAgentSchemasResponseTypedDict", "PlatformAgentTypedDict", + "PlatformAgentsCancelRunRequest", + "PlatformAgentsCancelRunRequestTypedDict", "PlatformAgentsCreateRunRequest", "PlatformAgentsCreateRunRequestTypedDict", "PlatformAgentsCreateRunResponse", "PlatformAgentsCreateRunResponseTypedDict", "PlatformAgentsGetRequest", "PlatformAgentsGetRequestTypedDict", + "PlatformAgentsGetRunRequest", + "PlatformAgentsGetRunRequestTypedDict", "PlatformAgentsGetSchemasRequest", "PlatformAgentsGetSchemasRequestTypedDict", "PlatformAgentsSearchRequest", @@ -3252,14 +3318,22 @@ "PlatformChatCompletedResponseObject", "PlatformChatCompletedResponseStatus", "PlatformChatCompletedResponseTypedDict", + "PlatformChatCreateFormat", + "PlatformChatCreateFormatTypedDict", "PlatformChatCreateInput", "PlatformChatCreateInputTypedDict", "PlatformChatCreateRequest", "PlatformChatCreateRequestTypedDict", + "PlatformChatCreateStreamFormat", + "PlatformChatCreateStreamFormatTypedDict", "PlatformChatCreateStreamInput", "PlatformChatCreateStreamInputTypedDict", "PlatformChatCreateStreamRequest", "PlatformChatCreateStreamRequestTypedDict", + "PlatformChatCreateStreamText", + "PlatformChatCreateStreamTextTypedDict", + "PlatformChatCreateText", + "PlatformChatCreateTextTypedDict", "PlatformChatCustomEntitySource", "PlatformChatCustomEntitySourceType", "PlatformChatCustomEntitySourceTypedDict", @@ -3281,6 +3355,9 @@ "PlatformChatInputMessage", "PlatformChatInputMessageRole", "PlatformChatInputMessageTypedDict", + "PlatformChatJSONSchemaFormat", + "PlatformChatJSONSchemaFormatType", + "PlatformChatJSONSchemaFormatTypedDict", "PlatformChatOutputMessage", "PlatformChatOutputMessageRole", "PlatformChatOutputMessageType", @@ -3325,6 +3402,9 @@ "PlatformChatStreamResponseFailedServerSentEventTypedDict", "PlatformChatStreamResponseFailedType", "PlatformChatStreamResponseFailedTypedDict", + "PlatformChatTextFormat", + "PlatformChatTextFormatType", + "PlatformChatTextFormatTypedDict", "PlatformContentScheduleWebhookEvent", "PlatformContentScheduleWebhookEventTypedDict", "PlatformContentType", @@ -3332,6 +3412,8 @@ "PlatformDatasourceFilterInfoTypedDict", "PlatformDocumentChangeWebhookEvent", "PlatformDocumentChangeWebhookEventTypedDict", + "PlatformDurableAgentRun", + "PlatformDurableAgentRunTypedDict", "PlatformFilter", "PlatformFilterFieldInfo", "PlatformFilterFieldInfoTypedDict", @@ -3698,6 +3780,8 @@ "StructuredLinkTypedDict", "StructuredLocation", "StructuredLocationTypedDict", + "StructuredOutput", + "StructuredOutputTypedDict", "StructuredResult", "StructuredResultSource", "StructuredResultTypedDict", @@ -4793,22 +4877,34 @@ "PinRequestRequestTypedDict": ".pinop", "PinRequest": ".pinrequest", "PinRequestTypedDict": ".pinrequest", + "PlatformAgentsCancelRunRequest": ".platform_agents_cancel_runop", + "PlatformAgentsCancelRunRequestTypedDict": ".platform_agents_cancel_runop", "PlatformAgentsCreateRunRequest": ".platform_agents_create_runop", "PlatformAgentsCreateRunRequestTypedDict": ".platform_agents_create_runop", "PlatformAgentsCreateRunResponse": ".platform_agents_create_runop", "PlatformAgentsCreateRunResponseTypedDict": ".platform_agents_create_runop", + "PlatformAgentsGetRunRequest": ".platform_agents_get_runop", + "PlatformAgentsGetRunRequestTypedDict": ".platform_agents_get_runop", "PlatformAgentsGetSchemasRequest": ".platform_agents_get_schemasop", "PlatformAgentsGetSchemasRequestTypedDict": ".platform_agents_get_schemasop", "PlatformAgentsGetRequest": ".platform_agents_getop", "PlatformAgentsGetRequestTypedDict": ".platform_agents_getop", + "PlatformChatCreateStreamFormat": ".platform_chat_create_streamop", + "PlatformChatCreateStreamFormatTypedDict": ".platform_chat_create_streamop", "PlatformChatCreateStreamInput": ".platform_chat_create_streamop", "PlatformChatCreateStreamInputTypedDict": ".platform_chat_create_streamop", "PlatformChatCreateStreamRequest": ".platform_chat_create_streamop", "PlatformChatCreateStreamRequestTypedDict": ".platform_chat_create_streamop", + "PlatformChatCreateStreamText": ".platform_chat_create_streamop", + "PlatformChatCreateStreamTextTypedDict": ".platform_chat_create_streamop", + "PlatformChatCreateFormat": ".platform_chat_createop", + "PlatformChatCreateFormatTypedDict": ".platform_chat_createop", "PlatformChatCreateInput": ".platform_chat_createop", "PlatformChatCreateInputTypedDict": ".platform_chat_createop", "PlatformChatCreateRequest": ".platform_chat_createop", "PlatformChatCreateRequestTypedDict": ".platform_chat_createop", + "PlatformChatCreateText": ".platform_chat_createop", + "PlatformChatCreateTextTypedDict": ".platform_chat_createop", "PlatformSearchFiltersRequest": ".platform_search_filtersop", "PlatformSearchFiltersRequestTypedDict": ".platform_search_filtersop", "PlatformSearchFiltersResponseResponse": ".platform_search_filtersop", @@ -4870,8 +4966,19 @@ "PlatformAgentGetResponseTypedDict": ".platformagentgetresponse", "PlatformAgentRun": ".platformagentrun", "PlatformAgentRunTypedDict": ".platformagentrun", + "PlatformAgentRunCancellationRequest": ".platformagentruncancellationrequest", + "PlatformAgentRunCancellationRequestTypedDict": ".platformagentruncancellationrequest", + "ExecutionMode": ".platformagentruncreaterequest", "PlatformAgentRunCreateRequest": ".platformagentruncreaterequest", "PlatformAgentRunCreateRequestTypedDict": ".platformagentruncreaterequest", + "PlatformAgentRunError": ".platformagentrunerror", + "PlatformAgentRunErrorTypedDict": ".platformagentrunerror", + "PlatformAgentRunResponse": ".platformagentrunresponse", + "PlatformAgentRunResponseTypedDict": ".platformagentrunresponse", + "PlatformAgentRunState": ".platformagentrunstate", + "PlatformAgentRunToolApproval": ".platformagentruntoolapproval", + "PlatformAgentRunToolApprovalType": ".platformagentruntoolapproval", + "PlatformAgentRunToolApprovalTypedDict": ".platformagentruntoolapproval", "PlatformAgentRunWaitResponse": ".platformagentrunwaitresponse", "PlatformAgentRunWaitResponseTypedDict": ".platformagentrunwaitresponse", "PlatformAgentSchemasResponse": ".platformagentschemasresponse", @@ -4914,6 +5021,9 @@ "PlatformChatInputMessage": ".platformchatinputmessage", "PlatformChatInputMessageRole": ".platformchatinputmessage", "PlatformChatInputMessageTypedDict": ".platformchatinputmessage", + "PlatformChatJSONSchemaFormat": ".platformchatjsonschemaformat", + "PlatformChatJSONSchemaFormatType": ".platformchatjsonschemaformat", + "PlatformChatJSONSchemaFormatTypedDict": ".platformchatjsonschemaformat", "PlatformChatOutputMessage": ".platformchatoutputmessage", "PlatformChatOutputMessageRole": ".platformchatoutputmessage", "PlatformChatOutputMessageType": ".platformchatoutputmessage", @@ -4921,6 +5031,8 @@ "PlatformChatOutputTextContent": ".platformchatoutputtextcontent", "PlatformChatOutputTextContentType": ".platformchatoutputtextcontent", "PlatformChatOutputTextContentTypedDict": ".platformchatoutputtextcontent", + "StructuredOutput": ".platformchatoutputtextcontent", + "StructuredOutputTypedDict": ".platformchatoutputtextcontent", "PlatformChatPersonSource": ".platformchatpersonsource", "PlatformChatPersonSourceType": ".platformchatpersonsource", "PlatformChatPersonSourceTypedDict": ".platformchatpersonsource", @@ -4958,6 +5070,9 @@ "PlatformChatStreamResponseFailedTypedDict": ".platformchatstreamresponsefailed", "PlatformChatStreamResponseFailedServerSentEvent": ".platformchatstreamresponsefailedserversentevent", "PlatformChatStreamResponseFailedServerSentEventTypedDict": ".platformchatstreamresponsefailedserversentevent", + "PlatformChatTextFormat": ".platformchattextformat", + "PlatformChatTextFormatType": ".platformchattextformat", + "PlatformChatTextFormatTypedDict": ".platformchattextformat", "PlatformContentScheduleWebhookEvent": ".platformcontentschedulewebhookevent", "PlatformContentScheduleWebhookEventTypedDict": ".platformcontentschedulewebhookevent", "PlatformContentType": ".platformcontenttype", @@ -4965,6 +5080,8 @@ "PlatformDatasourceFilterInfoTypedDict": ".platformdatasourcefilterinfo", "PlatformDocumentChangeWebhookEvent": ".platformdocumentchangewebhookevent", "PlatformDocumentChangeWebhookEventTypedDict": ".platformdocumentchangewebhookevent", + "PlatformDurableAgentRun": ".platformdurableagentrun", + "PlatformDurableAgentRunTypedDict": ".platformdurableagentrun", "PlatformFilter": ".platformfilter", "PlatformFilterTypedDict": ".platformfilter", "PlatformFilterFieldInfo": ".platformfilterfieldinfo", diff --git a/src/glean/api_client/models/feedentry.py b/src/glean/api_client/models/feedentry.py index c0d16f3e..83e2c6f0 100644 --- a/src/glean/api_client/models/feedentry.py +++ b/src/glean/api_client/models/feedentry.py @@ -136,6 +136,8 @@ class JustificationType(str, Enum, metaclass=utils.OpenEnumMeta): EDIT_DOC = "EDIT_DOC" CHAT_TO_ARTIFACT = "CHAT_TO_ARTIFACT" SHARE_ARTIFACT = "SHARE_ARTIFACT" + CREATE_AGENT = "CREATE_AGENT" + MANAGER_INVITE = "MANAGER_INVITE" class FeedEntryTypedDict(TypedDict): diff --git a/src/glean/api_client/models/feedrequest.py b/src/glean/api_client/models/feedrequest.py index 363ac76d..75cd4b1b 100644 --- a/src/glean/api_client/models/feedrequest.py +++ b/src/glean/api_client/models/feedrequest.py @@ -64,6 +64,8 @@ class FeedRequestCategory(str, Enum): EDIT_DOC = "EDIT_DOC" CHAT_TO_ARTIFACT = "CHAT_TO_ARTIFACT" SHARE_ARTIFACT = "SHARE_ARTIFACT" + CREATE_AGENT = "CREATE_AGENT" + MANAGER_INVITE = "MANAGER_INVITE" class FeedRequestTypedDict(TypedDict): diff --git a/src/glean/api_client/models/feedresult.py b/src/glean/api_client/models/feedresult.py index a3f149b9..f450760d 100644 --- a/src/glean/api_client/models/feedresult.py +++ b/src/glean/api_client/models/feedresult.py @@ -66,6 +66,8 @@ class FeedResultCategory(str, Enum, metaclass=utils.OpenEnumMeta): EDIT_DOC = "EDIT_DOC" CHAT_TO_ARTIFACT = "CHAT_TO_ARTIFACT" SHARE_ARTIFACT = "SHARE_ARTIFACT" + CREATE_AGENT = "CREATE_AGENT" + MANAGER_INVITE = "MANAGER_INVITE" class PlacementReason(str, Enum, metaclass=utils.OpenEnumMeta): diff --git a/src/glean/api_client/models/platform_agents_cancel_runop.py b/src/glean/api_client/models/platform_agents_cancel_runop.py new file mode 100644 index 00000000..6e55e914 --- /dev/null +++ b/src/glean/api_client/models/platform_agents_cancel_runop.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .platformagentruncancellationrequest import ( + PlatformAgentRunCancellationRequest, + PlatformAgentRunCancellationRequestTypedDict, +) +from glean.api_client.types import BaseModel +from glean.api_client.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing_extensions import Annotated, TypedDict + + +class PlatformAgentsCancelRunRequestTypedDict(TypedDict): + agent_id: str + r"""ID of the agent that owns the run.""" + platform_agent_run_cancellation_request: ( + PlatformAgentRunCancellationRequestTypedDict + ) + + +class PlatformAgentsCancelRunRequest(BaseModel): + agent_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""ID of the agent that owns the run.""" + + platform_agent_run_cancellation_request: Annotated[ + PlatformAgentRunCancellationRequest, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] diff --git a/src/glean/api_client/models/platform_agents_create_runop.py b/src/glean/api_client/models/platform_agents_create_runop.py index e99e8d10..1594967f 100644 --- a/src/glean/api_client/models/platform_agents_create_runop.py +++ b/src/glean/api_client/models/platform_agents_create_runop.py @@ -5,6 +5,10 @@ PlatformAgentRunCreateRequest, PlatformAgentRunCreateRequestTypedDict, ) +from .platformagentrunresponse import ( + PlatformAgentRunResponse, + PlatformAgentRunResponseTypedDict, +) from .platformagentrunwaitresponse import ( PlatformAgentRunWaitResponse, PlatformAgentRunWaitResponseTypedDict, @@ -35,10 +39,13 @@ class PlatformAgentsCreateRunRequest(BaseModel): PlatformAgentsCreateRunResponseTypedDict = TypeAliasType( "PlatformAgentsCreateRunResponseTypedDict", - Union[PlatformAgentRunWaitResponseTypedDict, str], + Union[ + PlatformAgentRunResponseTypedDict, PlatformAgentRunWaitResponseTypedDict, str + ], ) PlatformAgentsCreateRunResponse = TypeAliasType( - "PlatformAgentsCreateRunResponse", Union[PlatformAgentRunWaitResponse, str] + "PlatformAgentsCreateRunResponse", + Union[PlatformAgentRunResponse, PlatformAgentRunWaitResponse, str], ) diff --git a/src/glean/api_client/models/platform_agents_get_runop.py b/src/glean/api_client/models/platform_agents_get_runop.py new file mode 100644 index 00000000..01a8e34f --- /dev/null +++ b/src/glean/api_client/models/platform_agents_get_runop.py @@ -0,0 +1,25 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from glean.api_client.types import BaseModel +from glean.api_client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class PlatformAgentsGetRunRequestTypedDict(TypedDict): + agent_id: str + r"""ID of the agent that owns the run.""" + run_id: str + r"""ID of the durable run to retrieve.""" + + +class PlatformAgentsGetRunRequest(BaseModel): + agent_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""ID of the agent that owns the run.""" + + run_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""ID of the durable run to retrieve.""" diff --git a/src/glean/api_client/models/platform_chat_create_streamop.py b/src/glean/api_client/models/platform_chat_create_streamop.py index 7e6268b7..10c83a83 100644 --- a/src/glean/api_client/models/platform_chat_create_streamop.py +++ b/src/glean/api_client/models/platform_chat_create_streamop.py @@ -5,10 +5,18 @@ PlatformChatInputMessage, PlatformChatInputMessageTypedDict, ) +from .platformchatjsonschemaformat import ( + PlatformChatJSONSchemaFormat, + PlatformChatJSONSchemaFormatTypedDict, +) +from .platformchattextformat import ( + PlatformChatTextFormat, + PlatformChatTextFormatTypedDict, +) from glean.api_client.types import BaseModel, UNSET_SENTINEL -from glean.api_client.utils import validate_const +from glean.api_client.utils import get_discriminator, validate_const import pydantic -from pydantic import model_serializer +from pydantic import Discriminator, Tag, model_serializer from pydantic.functional_validators import AfterValidator from typing import List, Literal, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -31,6 +39,63 @@ """ +PlatformChatCreateStreamFormatTypedDict = TypeAliasType( + "PlatformChatCreateStreamFormatTypedDict", + Union[PlatformChatTextFormatTypedDict, PlatformChatJSONSchemaFormatTypedDict], +) +r"""Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. + +""" + + +PlatformChatCreateStreamFormat = Annotated[ + Union[ + Annotated[PlatformChatTextFormat, Tag("TEXT")], + Annotated[PlatformChatJSONSchemaFormat, Tag("JSON_SCHEMA")], + ], + Discriminator(lambda m: get_discriminator(m, "type", "type")), +] +r"""Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. + +""" + + +class PlatformChatCreateStreamTextTypedDict(TypedDict): + r"""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.""" + + format_: NotRequired[PlatformChatCreateStreamFormatTypedDict] + r"""Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. + + """ + + +class PlatformChatCreateStreamText(BaseModel): + r"""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.""" + + format_: Annotated[ + Optional[PlatformChatCreateStreamFormat], pydantic.Field(alias="format") + ] = None + r"""Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. + + """ + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["format"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + class PlatformChatCreateStreamRequestTypedDict(TypedDict): input: PlatformChatCreateStreamInputTypedDict r"""Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`. @@ -45,6 +110,10 @@ class PlatformChatCreateStreamRequestTypedDict(TypedDict): r"""Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`. """ + text: NotRequired[PlatformChatCreateStreamTextTypedDict] + r"""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. + + """ class PlatformChatCreateStreamRequest(BaseModel): @@ -68,9 +137,14 @@ class PlatformChatCreateStreamRequest(BaseModel): """ + text: Optional[PlatformChatCreateStreamText] = None + r"""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. + + """ + @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["stream", "store", "conversation_id"]) + optional_fields = set(["stream", "store", "conversation_id", "text"]) serialized = handler(self) m = {} @@ -85,6 +159,10 @@ def serialize_model(self, handler): return m +try: + PlatformChatCreateStreamText.model_rebuild() +except NameError: + pass try: PlatformChatCreateStreamRequest.model_rebuild() except NameError: diff --git a/src/glean/api_client/models/platform_chat_createop.py b/src/glean/api_client/models/platform_chat_createop.py index 4069a990..1812a496 100644 --- a/src/glean/api_client/models/platform_chat_createop.py +++ b/src/glean/api_client/models/platform_chat_createop.py @@ -5,10 +5,18 @@ PlatformChatInputMessage, PlatformChatInputMessageTypedDict, ) +from .platformchatjsonschemaformat import ( + PlatformChatJSONSchemaFormat, + PlatformChatJSONSchemaFormatTypedDict, +) +from .platformchattextformat import ( + PlatformChatTextFormat, + PlatformChatTextFormatTypedDict, +) from glean.api_client.types import BaseModel, UNSET_SENTINEL -from glean.api_client.utils import validate_const +from glean.api_client.utils import get_discriminator, validate_const import pydantic -from pydantic import model_serializer +from pydantic import Discriminator, Tag, model_serializer from pydantic.functional_validators import AfterValidator from typing import List, Literal, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -31,6 +39,63 @@ """ +PlatformChatCreateFormatTypedDict = TypeAliasType( + "PlatformChatCreateFormatTypedDict", + Union[PlatformChatTextFormatTypedDict, PlatformChatJSONSchemaFormatTypedDict], +) +r"""Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. + +""" + + +PlatformChatCreateFormat = Annotated[ + Union[ + Annotated[PlatformChatTextFormat, Tag("TEXT")], + Annotated[PlatformChatJSONSchemaFormat, Tag("JSON_SCHEMA")], + ], + Discriminator(lambda m: get_discriminator(m, "type", "type")), +] +r"""Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. + +""" + + +class PlatformChatCreateTextTypedDict(TypedDict): + r"""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.""" + + format_: NotRequired[PlatformChatCreateFormatTypedDict] + r"""Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. + + """ + + +class PlatformChatCreateText(BaseModel): + r"""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.""" + + format_: Annotated[ + Optional[PlatformChatCreateFormat], pydantic.Field(alias="format") + ] = None + r"""Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. + + """ + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["format"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + class PlatformChatCreateRequestTypedDict(TypedDict): input: PlatformChatCreateInputTypedDict r"""Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`. @@ -45,6 +110,10 @@ class PlatformChatCreateRequestTypedDict(TypedDict): r"""Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`. """ + text: NotRequired[PlatformChatCreateTextTypedDict] + r"""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. + + """ class PlatformChatCreateRequest(BaseModel): @@ -68,9 +137,14 @@ class PlatformChatCreateRequest(BaseModel): """ + text: Optional[PlatformChatCreateText] = None + r"""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. + + """ + @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["stream", "store", "conversation_id"]) + optional_fields = set(["stream", "store", "conversation_id", "text"]) serialized = handler(self) m = {} @@ -85,6 +159,10 @@ def serialize_model(self, handler): return m +try: + PlatformChatCreateText.model_rebuild() +except NameError: + pass try: PlatformChatCreateRequest.model_rebuild() except NameError: diff --git a/src/glean/api_client/models/platformagentruncancellationrequest.py b/src/glean/api_client/models/platformagentruncancellationrequest.py new file mode 100644 index 00000000..14efa2f2 --- /dev/null +++ b/src/glean/api_client/models/platformagentruncancellationrequest.py @@ -0,0 +1,19 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from glean.api_client.types import BaseModel +from typing_extensions import TypedDict + + +class PlatformAgentRunCancellationRequestTypedDict(TypedDict): + r"""Request cooperative cancellation of a run owned by the caller.""" + + run_id: str + r"""ID of the run to cancel. Must belong to the agent identified in the path.""" + + +class PlatformAgentRunCancellationRequest(BaseModel): + r"""Request cooperative cancellation of a run owned by the caller.""" + + run_id: str + r"""ID of the run to cancel. Must belong to the agent identified in the path.""" diff --git a/src/glean/api_client/models/platformagentruncreaterequest.py b/src/glean/api_client/models/platformagentruncreaterequest.py index fe723996..645f523e 100644 --- a/src/glean/api_client/models/platformagentruncreaterequest.py +++ b/src/glean/api_client/models/platformagentruncreaterequest.py @@ -2,12 +2,20 @@ from __future__ import annotations from .platformmessage_input import PlatformMessageInput, PlatformMessageInputTypedDict +from enum import Enum from glean.api_client.types import BaseModel, UNSET_SENTINEL from pydantic import model_serializer from typing import Any, Dict, List, Optional from typing_extensions import NotRequired, TypedDict +class ExecutionMode(str, Enum): + r"""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.""" + + REQUEST_BOUND = "REQUEST_BOUND" + DURABLE = "DURABLE" + + class PlatformAgentRunCreateRequestTypedDict(TypedDict): r"""Request to run an agent. A request MUST supply either `messages` (a non-empty conversation) or `input` (for input-form triggered agents).""" @@ -20,7 +28,11 @@ class PlatformAgentRunCreateRequestTypedDict(TypedDict): metadata: NotRequired[Dict[str, Any]] r"""Metadata to pass to the agent.""" stream: NotRequired[bool] - r"""Whether to stream the run response as server-sent events.""" + r"""Whether to stream the run response as server-sent events. Not supported in DURABLE mode.""" + execution_mode: NotRequired[ExecutionMode] + r"""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. + + """ class PlatformAgentRunCreateRequest(BaseModel): @@ -38,11 +50,18 @@ class PlatformAgentRunCreateRequest(BaseModel): r"""Metadata to pass to the agent.""" stream: Optional[bool] = False - r"""Whether to stream the run response as server-sent events.""" + r"""Whether to stream the run response as server-sent events. Not supported in DURABLE mode.""" + + execution_mode: Optional[ExecutionMode] = ExecutionMode.REQUEST_BOUND + r"""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. + + """ @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["input", "messages", "metadata", "stream"]) + optional_fields = set( + ["input", "messages", "metadata", "stream", "execution_mode"] + ) serialized = handler(self) m = {} diff --git a/src/glean/api_client/models/platformagentrunerror.py b/src/glean/api_client/models/platformagentrunerror.py new file mode 100644 index 00000000..bc6da943 --- /dev/null +++ b/src/glean/api_client/models/platformagentrunerror.py @@ -0,0 +1,24 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from glean.api_client.types import BaseModel +from typing_extensions import TypedDict + + +class PlatformAgentRunErrorTypedDict(TypedDict): + r"""Caller-safe details of an agent run execution failure.""" + + code: str + r"""Machine-readable execution failure code.""" + message: str + r"""Caller-safe execution failure description.""" + + +class PlatformAgentRunError(BaseModel): + r"""Caller-safe details of an agent run execution failure.""" + + code: str + r"""Machine-readable execution failure code.""" + + message: str + r"""Caller-safe execution failure description.""" diff --git a/src/glean/api_client/models/platformagentrunresponse.py b/src/glean/api_client/models/platformagentrunresponse.py new file mode 100644 index 00000000..7c02b1ca --- /dev/null +++ b/src/glean/api_client/models/platformagentrunresponse.py @@ -0,0 +1,28 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .platformdurableagentrun import ( + PlatformDurableAgentRun, + PlatformDurableAgentRunTypedDict, +) +from glean.api_client.types import BaseModel +from typing_extensions import TypedDict + + +class PlatformAgentRunResponseTypedDict(TypedDict): + r"""Persisted agent run snapshot with a request ID for support correlation.""" + + run: PlatformDurableAgentRunTypedDict + r"""Agent run state, pending tool approvals, and output available independently of the creation request.""" + request_id: str + r"""Platform-generated request ID for support correlation.""" + + +class PlatformAgentRunResponse(BaseModel): + r"""Persisted agent run snapshot with a request ID for support correlation.""" + + run: PlatformDurableAgentRun + r"""Agent run state, pending tool approvals, and output available independently of the creation request.""" + + request_id: str + r"""Platform-generated request ID for support correlation.""" diff --git a/src/glean/api_client/models/platformagentrunstate.py b/src/glean/api_client/models/platformagentrunstate.py new file mode 100644 index 00000000..dc860898 --- /dev/null +++ b/src/glean/api_client/models/platformagentrunstate.py @@ -0,0 +1,18 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum +from glean.api_client import utils + + +class PlatformAgentRunState(str, Enum, metaclass=utils.OpenEnumMeta): + r"""State of the persisted workflow execution. REQUIRES_INPUT is nonterminal.""" + + QUEUED = "QUEUED" + RUNNING = "RUNNING" + REQUIRES_INPUT = "REQUIRES_INPUT" + SUCCEEDED = "SUCCEEDED" + FAILED = "FAILED" + CANCELLING = "CANCELLING" + CANCELLED = "CANCELLED" + EXPIRED = "EXPIRED" diff --git a/src/glean/api_client/models/platformagentruntoolapproval.py b/src/glean/api_client/models/platformagentruntoolapproval.py new file mode 100644 index 00000000..c51c46ed --- /dev/null +++ b/src/glean/api_client/models/platformagentruntoolapproval.py @@ -0,0 +1,75 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from datetime import datetime +from enum import Enum +from glean.api_client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Any, Dict, Optional +from typing_extensions import NotRequired, TypedDict + + +class PlatformAgentRunToolApprovalType(str, Enum): + r"""Interaction type identifying a tool execution approval request.""" + + TOOL_APPROVAL = "TOOL_APPROVAL" + + +class PlatformAgentRunToolApprovalTypedDict(TypedDict): + r"""Pending approval for a specific persisted tool invocation and its arguments.""" + + interaction_id: str + r"""Identifies this specific invocation approval, not the tool definition.""" + type: PlatformAgentRunToolApprovalType + r"""Interaction type identifying a tool execution approval request.""" + display_name: str + r"""Display name of the tool requesting approval.""" + description: str + r"""Description of the tool associated with this approval request.""" + arguments: Dict[str, Any] + r"""Arguments from the persisted approval request. Older platform tools use flattened parameters.""" + tool_id: NotRequired[str] + r"""Platform tool identifier when recorded. Omitted for requests without one, such as some MCP tools.""" + expires_at: NotRequired[datetime] + r"""Approval deadline, when one is set. Omitted when the approval has no expiration.""" + + +class PlatformAgentRunToolApproval(BaseModel): + r"""Pending approval for a specific persisted tool invocation and its arguments.""" + + interaction_id: str + r"""Identifies this specific invocation approval, not the tool definition.""" + + type: PlatformAgentRunToolApprovalType + r"""Interaction type identifying a tool execution approval request.""" + + display_name: str + r"""Display name of the tool requesting approval.""" + + description: str + r"""Description of the tool associated with this approval request.""" + + arguments: Dict[str, Any] + r"""Arguments from the persisted approval request. Older platform tools use flattened parameters.""" + + tool_id: Optional[str] = None + r"""Platform tool identifier when recorded. Omitted for requests without one, such as some MCP tools.""" + + expires_at: Optional[datetime] = None + r"""Approval deadline, when one is set. Omitted when the approval has no expiration.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["tool_id", "expires_at"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/glean/api_client/models/platformchatjsonschemaformat.py b/src/glean/api_client/models/platformchatjsonschemaformat.py new file mode 100644 index 00000000..c22174e0 --- /dev/null +++ b/src/glean/api_client/models/platformchatjsonschemaformat.py @@ -0,0 +1,75 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum +from glean.api_client.types import BaseModel, UNSET_SENTINEL +import pydantic +from pydantic import model_serializer +from typing import Any, Dict, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class PlatformChatJSONSchemaFormatType(str, Enum): + r"""Discriminator. Must be JSON_SCHEMA.""" + + JSON_SCHEMA = "JSON_SCHEMA" + + +class PlatformChatJSONSchemaFormatTypedDict(TypedDict): + r"""Constrains the assistant response to a caller-supplied JSON Schema.""" + + type: PlatformChatJSONSchemaFormatType + r"""Discriminator. Must be JSON_SCHEMA.""" + name: str + r"""A stable identifier for the schema.""" + schema_: Dict[str, Any] + r"""A JSON Schema object describing the desired output shape.""" + description: NotRequired[str] + r"""An optional human-readable description of the schema.""" + strict: NotRequired[bool] + r"""When true, the provider validates the response against the schema. Unsupported by some providers; defaults to true. + + """ + + +class PlatformChatJSONSchemaFormat(BaseModel): + r"""Constrains the assistant response to a caller-supplied JSON Schema.""" + + type: PlatformChatJSONSchemaFormatType + r"""Discriminator. Must be JSON_SCHEMA.""" + + name: str + r"""A stable identifier for the schema.""" + + schema_: Annotated[Dict[str, Any], pydantic.Field(alias="schema")] + r"""A JSON Schema object describing the desired output shape.""" + + description: Optional[str] = None + r"""An optional human-readable description of the schema.""" + + strict: Optional[bool] = True + r"""When true, the provider validates the response against the schema. Unsupported by some providers; defaults to true. + + """ + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["description", "strict"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +try: + PlatformChatJSONSchemaFormat.model_rebuild() +except NameError: + pass diff --git a/src/glean/api_client/models/platformchatoutputtextcontent.py b/src/glean/api_client/models/platformchatoutputtextcontent.py index d3742527..eb56d9a1 100644 --- a/src/glean/api_client/models/platformchatoutputtextcontent.py +++ b/src/glean/api_client/models/platformchatoutputtextcontent.py @@ -6,7 +6,13 @@ PlatformChatCitationAnnotationTypedDict, ) from enum import Enum -from glean.api_client.types import BaseModel, UNSET_SENTINEL +from glean.api_client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) from pydantic import model_serializer from typing import List, Optional from typing_extensions import NotRequired, TypedDict @@ -16,9 +22,21 @@ class PlatformChatOutputTextContentType(str, Enum): OUTPUT_TEXT = "OUTPUT_TEXT" +class StructuredOutputTypedDict(TypedDict): + r"""Parsed and validated JSON object when structured output was requested. Present only when the request included `text.format.type: JSON_SCHEMA`.""" + + +class StructuredOutput(BaseModel): + r"""Parsed and validated JSON object when structured output was requested. Present only when the request included `text.format.type: JSON_SCHEMA`.""" + + class PlatformChatOutputTextContentTypedDict(TypedDict): type: PlatformChatOutputTextContentType text: str + structured_output: NotRequired[Nullable[StructuredOutputTypedDict]] + r"""Parsed and validated JSON object when structured output was requested. Present only when the request included `text.format.type: JSON_SCHEMA`. + + """ annotations: NotRequired[List[PlatformChatCitationAnnotationTypedDict]] @@ -27,20 +45,34 @@ class PlatformChatOutputTextContent(BaseModel): text: str + structured_output: OptionalNullable[StructuredOutput] = UNSET + r"""Parsed and validated JSON object when structured output was requested. Present only when the request included `text.format.type: JSON_SCHEMA`. + + """ + annotations: Optional[List[PlatformChatCitationAnnotation]] = None @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["annotations"]) + optional_fields = set(["structured_output", "annotations"]) + nullable_fields = set(["structured_output"]) serialized = handler(self) m = {} for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): m[k] = val return m diff --git a/src/glean/api_client/models/platformchattextformat.py b/src/glean/api_client/models/platformchattextformat.py new file mode 100644 index 00000000..aa54c4dc --- /dev/null +++ b/src/glean/api_client/models/platformchattextformat.py @@ -0,0 +1,26 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum +from glean.api_client.types import BaseModel +from typing_extensions import TypedDict + + +class PlatformChatTextFormatType(str, Enum): + r"""Discriminator. Must be TEXT.""" + + TEXT = "TEXT" + + +class PlatformChatTextFormatTypedDict(TypedDict): + r"""Unconstrained plain-text assistant output.""" + + type: PlatformChatTextFormatType + r"""Discriminator. Must be TEXT.""" + + +class PlatformChatTextFormat(BaseModel): + r"""Unconstrained plain-text assistant output.""" + + type: PlatformChatTextFormatType + r"""Discriminator. Must be TEXT.""" diff --git a/src/glean/api_client/models/platformdurableagentrun.py b/src/glean/api_client/models/platformdurableagentrun.py new file mode 100644 index 00000000..842b5cb8 --- /dev/null +++ b/src/glean/api_client/models/platformdurableagentrun.py @@ -0,0 +1,98 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .platformagentrunerror import PlatformAgentRunError, PlatformAgentRunErrorTypedDict +from .platformagentrunstate import PlatformAgentRunState +from .platformagentruntoolapproval import ( + PlatformAgentRunToolApproval, + PlatformAgentRunToolApprovalTypedDict, +) +from datetime import datetime +from glean.api_client import models +from glean.api_client.types import BaseModel, UNSET_SENTINEL +from pydantic import field_serializer, model_serializer +from typing import Any, Dict, List, Optional +from typing_extensions import NotRequired, TypedDict + + +class PlatformDurableAgentRunTypedDict(TypedDict): + r"""Agent run state, pending tool approvals, and output available independently of the creation request.""" + + run_id: str + r"""ID of the run, preserved across approval continuations.""" + agent_id: str + r"""ID of the agent that owns the run.""" + state: PlatformAgentRunState + r"""State of the persisted workflow execution. REQUIRES_INPUT is nonterminal.""" + created_at: datetime + r"""Timestamp when the run was first persisted.""" + updated_at: datetime + r"""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. + + """ + pending_interactions: List[PlatformAgentRunToolApprovalTypedDict] + r"""Unanswered tool approvals when the run is in REQUIRES_INPUT. Empty in other states.""" + expires_at: NotRequired[datetime] + r"""Execution deadline, when one is set. Not the run history retention deadline.""" + output: NotRequired[Dict[str, Any]] + r"""Accumulated text-only agent output under the messages key, when available.""" + error: NotRequired[PlatformAgentRunErrorTypedDict] + r"""Caller-safe details of an agent run execution failure.""" + + +class PlatformDurableAgentRun(BaseModel): + r"""Agent run state, pending tool approvals, and output available independently of the creation request.""" + + run_id: str + r"""ID of the run, preserved across approval continuations.""" + + agent_id: str + r"""ID of the agent that owns the run.""" + + state: PlatformAgentRunState + r"""State of the persisted workflow execution. REQUIRES_INPUT is nonterminal.""" + + created_at: datetime + r"""Timestamp when the run was first persisted.""" + + updated_at: datetime + r"""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. + + """ + + pending_interactions: List[PlatformAgentRunToolApproval] + r"""Unanswered tool approvals when the run is in REQUIRES_INPUT. Empty in other states.""" + + expires_at: Optional[datetime] = None + r"""Execution deadline, when one is set. Not the run history retention deadline.""" + + output: Optional[Dict[str, Any]] = None + r"""Accumulated text-only agent output under the messages key, when available.""" + + error: Optional[PlatformAgentRunError] = None + r"""Caller-safe details of an agent run execution failure.""" + + @field_serializer("state") + def serialize_state(self, value): + if isinstance(value, str): + try: + return models.PlatformAgentRunState(value) + except ValueError: + return value + return value + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["expires_at", "output", "error"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/glean/api_client/tools.py b/src/glean/api_client/tools.py index a9a8b100..702acd70 100644 --- a/src/glean/api_client/tools.py +++ b/src/glean/api_client/tools.py @@ -78,7 +78,7 @@ def list( self.sdk_configuration.security, models.Security ), tags=["Tools", "Tools"], - extensions={"x-visibility": "Preview"}, + extensions={"x-visibility": "Public"}, ), request=req, is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), @@ -164,7 +164,7 @@ async def list_async( self.sdk_configuration.security, models.Security ), tags=["Tools", "Tools"], - extensions={"x-visibility": "Preview"}, + extensions={"x-visibility": "Public"}, ), request=req, is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), @@ -261,7 +261,7 @@ def run( self.sdk_configuration.security, models.Security ), tags=["Tools", "Tools"], - extensions={"x-visibility": "Preview"}, + extensions={"x-visibility": "Public"}, ), request=req, is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), @@ -358,7 +358,7 @@ async def run_async( self.sdk_configuration.security, models.Security ), tags=["Tools", "Tools"], - extensions={"x-visibility": "Preview"}, + extensions={"x-visibility": "Public"}, ), request=req, is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), @@ -447,7 +447,7 @@ def retrieve_action_pack_auth_status( self.sdk_configuration.security, models.Security ), tags=["Tools"], - extensions={"x-visibility": "Preview"}, + extensions={"x-visibility": "Public"}, ), request=req, is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), @@ -538,7 +538,7 @@ async def retrieve_action_pack_auth_status_async( self.sdk_configuration.security, models.Security ), tags=["Tools"], - extensions={"x-visibility": "Preview"}, + extensions={"x-visibility": "Public"}, ), request=req, is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), @@ -647,7 +647,7 @@ def authorize_action_pack( self.sdk_configuration.security, models.Security ), tags=["Tools"], - extensions={"x-visibility": "Preview"}, + extensions={"x-visibility": "Public"}, ), request=req, is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), @@ -756,7 +756,7 @@ async def authorize_action_pack_async( self.sdk_configuration.security, models.Security ), tags=["Tools"], - extensions={"x-visibility": "Preview"}, + extensions={"x-visibility": "Public"}, ), request=req, is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), @@ -851,7 +851,7 @@ def retrieve_tool_server_auth_status( "id": "52fde6ec-c18b-4de6-b761-f82008542ae7", "introduced": "2026-07-02", }, - "x-visibility": "Preview", + "x-visibility": "Public", }, ), request=req, @@ -947,7 +947,7 @@ async def retrieve_tool_server_auth_status_async( "id": "52fde6ec-c18b-4de6-b761-f82008542ae7", "introduced": "2026-07-02", }, - "x-visibility": "Preview", + "x-visibility": "Public", }, ), request=req, @@ -1062,7 +1062,7 @@ def authorize_tool_server( "id": "1935476e-ecaf-4c1f-a9fd-1e768cf68f30", "introduced": "2026-07-02", }, - "x-visibility": "Preview", + "x-visibility": "Public", }, ), request=req, @@ -1177,7 +1177,7 @@ async def authorize_tool_server_async( "id": "1935476e-ecaf-4c1f-a9fd-1e768cf68f30", "introduced": "2026-07-02", }, - "x-visibility": "Preview", + "x-visibility": "Public", }, ), request=req, @@ -1284,7 +1284,7 @@ def get_tool_server_tools( "id": "332eb38f-1b5d-4896-88e3-59db5e96e4e1", "introduced": "2026-07-30", }, - "x-visibility": "Preview", + "x-visibility": "Public", }, ), request=req, @@ -1389,7 +1389,7 @@ async def get_tool_server_tools_async( "id": "332eb38f-1b5d-4896-88e3-59db5e96e4e1", "introduced": "2026-07-30", }, - "x-visibility": "Preview", + "x-visibility": "Public", }, ), request=req, diff --git a/tests/mockserver/internal/handler/generated_handlers.go b/tests/mockserver/internal/handler/generated_handlers.go index 8e541a71..fe347083 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,7 @@ 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}/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/pathpostrestapiv1getchat.go b/tests/mockserver/internal/handler/pathpostrestapiv1getchat.go index 96d4127e..87401958 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1getchat.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1getchat.go @@ -628,8 +628,8 @@ func testGetchatGetchat0(w http.ResponseWriter, req *http.Request) { Roles: []components.UserRoleSpecification{}, SourceDocumentSpec: types.Pointer(components.CreateDocumentSpecUnionDocumentSpec3( components.DocumentSpec3{ - UgcType: components.DocumentSpecUgcType1Announcements, - ContentID: 848009, + UgcType: components.DocumentSpecUgcType1Shortcuts, + ContentID: 602763, }, )), SourceType: components.AnswerSourceTypeAssistant.ToPointer(), 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/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/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/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/test_agents.py b/tests/test_agents.py index 39a3f77b..2e475cd5 100644 --- a/tests/test_agents.py +++ b/tests/test_agents.py @@ -142,5 +142,34 @@ def test_agents_platform_agents_create_run(): }, ], stream=False, + execution_mode=models.ExecutionMode.REQUEST_BOUND, ) assert res is not None + + +def test_agents_platform_agents_get_run(): + test_http_client = create_test_http_client("platform-agents-get-run") + + with Glean( + server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), + client=test_http_client, + api_token=os.getenv("GLEAN_API_TOKEN", "value"), + ) as glean: + assert glean is not None + + res = glean.agents.get_run(agent_id="{agent_id}", run_id="{run_id}") + assert res is not None + + +def test_agents_platform_agents_cancel_run(): + test_http_client = create_test_http_client("platform-agents-cancel-run") + + with Glean( + server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), + client=test_http_client, + api_token=os.getenv("GLEAN_API_TOKEN", "value"), + ) as glean: + assert glean is not None + + res = glean.agents.cancel_run(agent_id="{agent_id}", run_id="{run_id}") + assert res is not None diff --git a/tests/test_chat_sdk.py b/tests/test_chat_sdk.py index 80a92728..cfc1294c 100644 --- a/tests/test_chat_sdk.py +++ b/tests/test_chat_sdk.py @@ -1,6 +1,6 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" -from glean.api_client import Glean +from glean.api_client import Glean, models import os from tests.test_client import create_test_http_client @@ -15,5 +15,30 @@ def test_chat_sdk_platform_chat_create(): ) as glean: assert glean is not None - res = glean.chat.create(input="What is our parental leave policy?", store=True) + res = glean.chat.create( + input="Summarize our parental leave policy as JSON.", + store=True, + text={ + "format_": { + "type": models.PlatformChatJSONSchemaFormatType.JSON_SCHEMA, + "name": "policy_summary", + "schema_": { + "properties": { + "duration_weeks": { + "type": "integer", + }, + "eligible_employees": { + "type": "string", + }, + }, + "required": [ + "eligible_employees", + "duration_weeks", + ], + "type": "object", + }, + "strict": True, + }, + }, + ) assert res is not None diff --git a/tests/test_messages.py b/tests/test_messages.py index 132005ec..636f01d3 100644 --- a/tests/test_messages.py +++ b/tests/test_messages.py @@ -18,7 +18,7 @@ def test_messages_messages(): res = glean.client.messages.retrieve( id_type=models.IDType.CONVERSATION_ID, id="", - datasource=models.Datasource.FACEBOOKWORKPLACE, + datasource=models.Datasource.GCHAT, timestamp_millis=558834, ) assert res is not None diff --git a/tests/test_summarize.py b/tests/test_summarize.py index 072b3207..2b5d1f38 100644 --- a/tests/test_summarize.py +++ b/tests/test_summarize.py @@ -18,11 +18,11 @@ def test_summarize_summarize(): res = glean.client.documents.summarize( document_specs=[ { - "id": "", + "ugc_type": models.DocumentSpecUgcType2.ARTIFACTS, + "ugc_id": "", }, { - "ugc_type": models.DocumentSpecUgcType2.SHORTCUTS, - "ugc_id": "", + "id": "", }, ] ) From 05c13f98550bdb552df0517f83819d3a24c5bd30 Mon Sep 17 00:00:00 2001 From: "speakeasy-github[bot]" <128539517+speakeasy-github[bot]@users.noreply.github.com> Date: Wed, 23 Sep 2026 03:45:25 +0000 Subject: [PATCH 2/2] empty commit to trigger [run-tests] workflow