From fc16fb625701af483e3453b14e42dd7d886dce48 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Thu, 3 Dec 2026 08:38:19 +0000 Subject: [PATCH] ## Python SDK Changes: * `glean.agents.list_runs()`: **Added** * `glean.agents.list_versions()`: **Added** * `glean.agents.create_version()`: **Added** * `glean.agents.get_version()`: **Added** * `glean.agents.delete_version()`: **Added** * `glean.agents.create()`: * `request.draft` **Added** * `response.agent.is_draft` **Added** * `glean.agents.search()`: * `request` **Changed** * `response` **Changed** * `glean.agents.get()`: `response.agent.is_draft` **Added** * `glean.agents.update()`: * `request.draft` **Added** * `response.agent.is_draft` **Added** * `glean.admin.agents.list()`: `response.results[].is_draft` **Added** --- .speakeasy/gen.lock | 472 +++++-- .speakeasy/gen.yaml | 2 +- .speakeasy/glean-merged-spec.yaml | 603 +++++++- .speakeasy/tests.arazzo.yaml | 89 +- .speakeasy/workflow.lock | 10 +- README.md | 15 +- RELEASES.md | 12 +- docs/models/platformagent.md | 1 + docs/models/platformagentcreaterequest.md | 3 +- docs/models/platformagentrunsummary.md | 15 + docs/models/platformagentruntrigger.md | 24 + .../platformagentscreateversionrequest.md | 9 + .../platformagentsdeleteversionrequest.md | 9 + .../models/platformagentsgetversionrequest.md | 9 + docs/models/platformagentslistrunsrequest.md | 10 + .../platformagentslistversionsrequest.md | 10 + docs/models/platformagentssearchrequest.md | 4 +- docs/models/platformagentssearchresponse.md | 10 +- docs/models/platformagentupdaterequest.md | 3 +- docs/models/platformagentversion.md | 12 + .../platformagentversioncreaterequest.md | 11 + .../models/platformagentversiongetresponse.md | 11 + .../platformagentversionslistresponse.md | 13 + .../platformagentversionwithdefinition.md | 13 + .../models/platformlistadminagentsresponse.md | 12 +- docs/models/platformlistagentrunsresponse.md | 13 + .../models/platformlistdepartmentsresponse.md | 12 +- docs/models/platformlistidpgroupsresponse.md | 12 +- .../platformlistoauthclientsresponse.md | 12 +- docs/models/platformlistusersresponse.md | 12 +- docs/sdks/adminagents/README.md | 2 +- docs/sdks/adminidpgroups/README.md | 2 +- docs/sdks/agents/README.md | 240 +++- docs/sdks/clients/README.md | 2 +- docs/sdks/departments/README.md | 2 +- docs/sdks/users/README.md | 2 +- pyproject.toml | 2 +- src/glean/api_client/_version.py | 4 +- src/glean/api_client/admin_agents.py | 4 +- src/glean/api_client/admin_idpgroups.py | 4 +- src/glean/api_client/agents.py | 1229 ++++++++++++++++- src/glean/api_client/clients.py | 4 +- src/glean/api_client/departments.py | 4 +- src/glean/api_client/models/__init__.py | 99 ++ .../platform_agents_create_versionop.py | 29 + .../platform_agents_delete_versionop.py | 26 + .../models/platform_agents_get_versionop.py | 26 + .../models/platform_agents_list_runsop.py | 70 + .../models/platform_agents_list_versionsop.py | 66 + src/glean/api_client/models/platformagent.py | 10 + .../models/platformagentcreaterequest.py | 10 + .../models/platformagentrunsummary.py | 102 ++ .../models/platformagentruntrigger.py | 15 + .../models/platformagentssearchrequest.py | 16 +- .../models/platformagentssearchresponse.py | 60 +- .../models/platformagentupdaterequest.py | 10 + .../api_client/models/platformagentversion.py | 35 + .../platformagentversioncreaterequest.py | 29 + .../models/platformagentversiongetresponse.py | 29 + .../platformagentversionslistresponse.py | 79 ++ .../platformagentversionwithdefinition.py | 41 + .../models/platformlistadminagentsresponse.py | 8 +- .../models/platformlistagentrunsresponse.py | 82 ++ .../models/platformlistdepartmentsresponse.py | 4 +- .../models/platformlistidpgroupsresponse.py | 4 +- .../platformlistoauthclientsresponse.py | 8 +- .../models/platformlistusersresponse.py | 8 +- src/glean/api_client/users.py | 4 +- .../internal/handler/generated_handlers.go | 4 + .../handler/pathgetapiagentsagentidruns.go | 75 + .../pathgetapiagentsagentidversions.go | 67 + ...athgetapiagentsagentidversionsversionid.go | 81 ++ .../pathpostapiagentsagentidversions.go | 86 ++ .../handler/pathpostapiagentssearch.go | 1 + .../sdk/models/components/platformagent.go | 10 + .../components/platformagentcreaterequest.go | 25 + .../components/platformagentrunsummary.go | 79 ++ .../components/platformagentruntrigger.go | 42 + .../components/platformagentssearchrequest.go | 34 + .../platformagentssearchresponse.go | 24 +- .../components/platformagentupdaterequest.go | 10 + .../models/components/platformagentversion.go | 52 + .../platformagentversioncreaterequest.go | 26 + .../platformagentversiongetresponse.go | 26 + .../platformagentversionslistresponse.go | 48 + .../platformagentversionwithdefinition.go | 61 + .../platformlistadminagentsresponse.go | 3 +- .../platformlistagentrunsresponse.go | 48 + .../platformlistdepartmentsresponse.go | 2 +- .../platformlistidpgroupsresponse.go | 2 +- .../platformlistoauthclientsresponse.go | 3 +- .../components/platformlistusersresponse.go | 3 +- .../models/operations/platformagentscreate.go | 2 +- .../operations/platformagentscreateversion.go | 48 + .../operations/platformagentsdeleteversion.go | 40 + .../operations/platformagentsgetversion.go | 49 + .../operations/platformagentslistruns.go | 71 + .../operations/platformagentslistversions.go | 70 + .../models/operations/platformagentsupdate.go | 2 +- tests/test_agents.py | 66 +- tests/test_summarize.py | 6 +- 101 files changed, 4721 insertions(+), 259 deletions(-) create mode 100644 docs/models/platformagentrunsummary.md create mode 100644 docs/models/platformagentruntrigger.md create mode 100644 docs/models/platformagentscreateversionrequest.md create mode 100644 docs/models/platformagentsdeleteversionrequest.md create mode 100644 docs/models/platformagentsgetversionrequest.md create mode 100644 docs/models/platformagentslistrunsrequest.md create mode 100644 docs/models/platformagentslistversionsrequest.md create mode 100644 docs/models/platformagentversion.md create mode 100644 docs/models/platformagentversioncreaterequest.md create mode 100644 docs/models/platformagentversiongetresponse.md create mode 100644 docs/models/platformagentversionslistresponse.md create mode 100644 docs/models/platformagentversionwithdefinition.md create mode 100644 docs/models/platformlistagentrunsresponse.md create mode 100644 src/glean/api_client/models/platform_agents_create_versionop.py create mode 100644 src/glean/api_client/models/platform_agents_delete_versionop.py create mode 100644 src/glean/api_client/models/platform_agents_get_versionop.py create mode 100644 src/glean/api_client/models/platform_agents_list_runsop.py create mode 100644 src/glean/api_client/models/platform_agents_list_versionsop.py create mode 100644 src/glean/api_client/models/platformagentrunsummary.py create mode 100644 src/glean/api_client/models/platformagentruntrigger.py create mode 100644 src/glean/api_client/models/platformagentversion.py create mode 100644 src/glean/api_client/models/platformagentversioncreaterequest.py create mode 100644 src/glean/api_client/models/platformagentversiongetresponse.py create mode 100644 src/glean/api_client/models/platformagentversionslistresponse.py create mode 100644 src/glean/api_client/models/platformagentversionwithdefinition.py create mode 100644 src/glean/api_client/models/platformlistagentrunsresponse.py create mode 100644 tests/mockserver/internal/handler/pathgetapiagentsagentidruns.go create mode 100644 tests/mockserver/internal/handler/pathgetapiagentsagentidversions.go create mode 100644 tests/mockserver/internal/handler/pathgetapiagentsagentidversionsversionid.go create mode 100644 tests/mockserver/internal/handler/pathpostapiagentsagentidversions.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformagentrunsummary.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformagentruntrigger.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformagentversion.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformagentversioncreaterequest.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformagentversiongetresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformagentversionslistresponse.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformagentversionwithdefinition.go create mode 100644 tests/mockserver/internal/sdk/models/components/platformlistagentrunsresponse.go create mode 100644 tests/mockserver/internal/sdk/models/operations/platformagentscreateversion.go create mode 100644 tests/mockserver/internal/sdk/models/operations/platformagentsdeleteversion.go create mode 100644 tests/mockserver/internal/sdk/models/operations/platformagentsgetversion.go create mode 100644 tests/mockserver/internal/sdk/models/operations/platformagentslistruns.go create mode 100644 tests/mockserver/internal/sdk/models/operations/platformagentslistversions.go diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index aadcaf53e..8d7aa863e 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: e404575285afab94491c593bded9d1e7 + docChecksum: 5d21c758864c7cde94c260bfb24cd8f4 docVersion: 0.9.0 speakeasyVersion: 1.813.1 generationVersion: 2.969.4 - releaseVersion: 0.18.2 - configChecksum: f95195d0c2d54de0cb4007ad03604e3d + releaseVersion: 0.18.3 + configChecksum: 9a92e5c0663b411554e7aa02f55de716 repoURL: https://github.com/gleanwork/api-client-python.git installationURL: https://github.com/gleanwork/api-client-python.git published: true persistentEdits: - generation_id: ec0459c7-c2e0-464c-bbdf-412c65956267 - pristine_commit_hash: f00f11416ce46d01e92ee5d26eed940d5943d2f9 - pristine_tree_hash: c0de4a611cd05a77fad1a78ef46bccba05d344d3 + generation_id: f470cd22-66eb-4bbb-adba-0fd90529c2f6 + pristine_commit_hash: 183808e00a2a84295db8f78ed88dbcebf8438a28 + pristine_tree_hash: a6d50732c26364218160c7f47b155f4c756ab12b features: python: acceptHeaders: 3.0.0 @@ -2342,8 +2342,8 @@ trackedFiles: pristine_git_object: 1ff91d25d4ae8bf84a9cb7f956dcef2eca7c8e9a docs/models/platformagent.md: id: 6d684a308415 - last_write_checksum: sha1:5f7b65a1ac3dffd8a2bbd5e43da66971666dd552 - pristine_git_object: 510c0f419a7aaf40a52a29297bde9d5dde29a23c + last_write_checksum: sha1:758c12a2c4681cc87acdf8609e81ba8e67fec56d + pristine_git_object: b638644e7dc9d13383bce87ee114b386b03bbf14 docs/models/platformagentcapabilities.md: id: 7d0c164cb136 last_write_checksum: sha1:70a0ba43c0c1fce847913b5e6c801b8ff9b17e77 @@ -2366,8 +2366,8 @@ trackedFiles: pristine_git_object: 63c0b9ab023a9add52bc919391df647d469dda9e docs/models/platformagentcreaterequest.md: id: ac4609e00004 - last_write_checksum: sha1:bbfe83d05bcc550f1761aa9063c6db311439d3df - pristine_git_object: aa9558517135e4b2920f244863533ed2e75c8513 + last_write_checksum: sha1:6c4fec63e48ff0c91937ca22df35e1d1362b1114 + pristine_git_object: ce07c1d7e5e242a98d74879bff27377294f79202 docs/models/platformagentdependency.md: id: 86d93df28310 last_write_checksum: sha1:7dad6c87c4eac38ec0a892548125f569f77771ca @@ -2464,6 +2464,10 @@ trackedFiles: id: c7f7c04f055a last_write_checksum: sha1:0b7f3af3016aa7bb8d717a5625151391e1c49950 pristine_git_object: 8e57c1285565be735668dc1cdb614d66d52fb99b + docs/models/platformagentrunsummary.md: + id: b13049082704 + last_write_checksum: sha1:6845f8d0fa2dbc6c8213846617378842a9bedc9c + pristine_git_object: d62e1d7bc3f57625f934267fcbb7c0e4612285d5 docs/models/platformagentruntoolapproval.md: id: 74dbc64873cb last_write_checksum: sha1:f383ae27bdade853cfd0111ad6655206e06d5c83 @@ -2472,6 +2476,10 @@ trackedFiles: id: 9942c102fe44 last_write_checksum: sha1:3dec0ca4cb8b1c02acf560e2b0d32724dc90d4e7 pristine_git_object: 7ffe0f37e35921bac19ab037e79027e82190c1e9 + docs/models/platformagentruntrigger.md: + id: 7b85a2f96582 + last_write_checksum: sha1:38ff2799f16750c9901729a3b31c351eafa5f8a2 + pristine_git_object: de105d7aee0a900b4af1808058e55d13eb8464d1 docs/models/platformagentrunwaitresponse.md: id: 216b0600404e last_write_checksum: sha1:af98dfbf6f900d7fa891640a5ad5259919062f55 @@ -2520,10 +2528,18 @@ trackedFiles: id: aa4efe71b679 last_write_checksum: sha1:fc4275fe4b9b08ef6593d99c915b5dba118abd94 pristine_git_object: e61605c8c6e5fe5d6cde50e98483e2636c5fa5f2 + docs/models/platformagentscreateversionrequest.md: + id: 77b67b0465fd + last_write_checksum: sha1:e0067cbc3b42ed4412e9265b7bc13405b1b8b19d + pristine_git_object: 3a9d18acc35338fe44c0e4c7f93daddd8e1f08e2 docs/models/platformagentsdeleterequest.md: id: 2c91d7dce25d last_write_checksum: sha1:155c610ad9ee02398542e19cccdf039a43bc983a pristine_git_object: 9d5dcff845274f059d5b51483350c80fe857c482 + docs/models/platformagentsdeleteversionrequest.md: + id: a27fefde8faa + last_write_checksum: sha1:75c8a72960391d8e0fdc2c6a915b5bc2e10c4613 + pristine_git_object: 14d98f5858395d634d2c023b3aec1bcb044e9e1f docs/models/platformagentselectedtool.md: id: d60384c35a41 last_write_checksum: sha1:331c7ee92e313f19fc0ff28c2d2b417750ee477d @@ -2544,6 +2560,10 @@ trackedFiles: id: 3591800143f3 last_write_checksum: sha1:27a8e74a3fc50f378ed596e5c1a8bd3adb6fe0ea pristine_git_object: 6d512b5719eac34760fff50cac1eb50cfac0df3a + docs/models/platformagentsgetversionrequest.md: + id: 1e8ae121da1c + last_write_checksum: sha1:134385a4131ed1e9cbc079101a9e2e9a0d19d195 + pristine_git_object: 44f4a9751b1895891da85a634beb40ee9d88cc72 docs/models/platformagentskill.md: id: f1560dbdd520 last_write_checksum: sha1:5fdf266f744147a3af5c781ed0c31c638f3d5474 @@ -2556,14 +2576,22 @@ trackedFiles: id: e4e0b896feff last_write_checksum: sha1:f715cc966b3376672b3d8226dcdfe7be1a18db03 pristine_git_object: 48860ed958a81235bae53b4163d7bfae5eba57ad + docs/models/platformagentslistrunsrequest.md: + id: 26cb2010b2d7 + last_write_checksum: sha1:06dec9b76c13088d8a71eebbb697cb1a1f631b9c + pristine_git_object: bf9f1871e0b5f1fbf256e5e6dc9df3b3ef21d551 + docs/models/platformagentslistversionsrequest.md: + id: 5b363545455c + last_write_checksum: sha1:175657aaf72d31ac80bcb8c5ca5f307fab9bc940 + pristine_git_object: 01b6c40e72fac5a301490d56581551de7c10b54a docs/models/platformagentssearchrequest.md: id: 863c7f027d45 - last_write_checksum: sha1:7e2501648e5c73a9615222c88d00f5d83ac42a61 - pristine_git_object: 381dc6be51c9a4d008f63c94b04fff7ea7bd1887 + last_write_checksum: sha1:53217de071efe5ee79577ee585f71f15bc8f6441 + pristine_git_object: ab886096a24f11aa41fac2d8e8bc4d4f5460f293 docs/models/platformagentssearchresponse.md: id: e2656d1b178b - last_write_checksum: sha1:11cfb0f78ed223bdc13cb93b7ec8fded52db7f99 - pristine_git_object: 1c961815688a6cbd9b0e3a298ea0641fcff045fe + last_write_checksum: sha1:ba15410165a13855eba8371e22a77ceccd0177a9 + pristine_git_object: d1d509d4ff65b877d56c22672ecf0287526a354b docs/models/platformagentsupdaterequest.md: id: 3f349b96ecaa last_write_checksum: sha1:c474c5e395eeb2b0357df87faf6713b33bc768e2 @@ -2582,8 +2610,28 @@ trackedFiles: pristine_git_object: 3d9be092703b124f4ca943f7157224e99d6eaae6 docs/models/platformagentupdaterequest.md: id: 26a02c00b565 - last_write_checksum: sha1:ba039375c187204e5e58c6e394ff1a7d70917626 - pristine_git_object: 35f1f089a1f4606777acee762cb9a83a32cbb909 + last_write_checksum: sha1:96538cdb5887852e263ad546222bc591d1510a6a + pristine_git_object: e838aaacea01d921a1da6132d6fa3fad54962bfa + docs/models/platformagentversion.md: + id: 192919240b4d + last_write_checksum: sha1:eeeeabf763da51dc090859bb29785291b69a031c + pristine_git_object: e65dc33687ed384ff0ae14b8467202f0375f7b60 + docs/models/platformagentversioncreaterequest.md: + id: be4b9d77bb65 + last_write_checksum: sha1:3f330c2c94f8a466a003809c1268729b520fab7f + pristine_git_object: d2afde3c54fadc61cb3800ca643ed5a313a26ee1 + docs/models/platformagentversiongetresponse.md: + id: 780f4aefa3cf + last_write_checksum: sha1:895c8a7de852e4d09d120561ae02bae0a9269f8a + pristine_git_object: f0a68595d1af0b27279ce789fbd416291cf4bc46 + docs/models/platformagentversionslistresponse.md: + id: 082aaa6a7eb3 + last_write_checksum: sha1:76c24edbe5917753e2515f13bbf48b19165aa94f + pristine_git_object: 930a789ea4a73e648633915a461b429bc65e8878 + docs/models/platformagentversionwithdefinition.md: + id: 26d103b3fb46 + last_write_checksum: sha1:814440d54c9f76f8839bf7b60a5f129708f34b70 + pristine_git_object: fdf7799e0acad14f1d618caef7961d316a2c3a21 docs/models/platformanonymousauthtoken.md: id: a3fe43f9547a last_write_checksum: sha1:b7c9b2a16c66fd50caa7e1e41cbaab0a540ff9c4 @@ -2970,24 +3018,28 @@ trackedFiles: pristine_git_object: d5818940117912f19e95f2f903c5702d5da2a9f1 docs/models/platformlistadminagentsresponse.md: id: 4894159e13b7 - last_write_checksum: sha1:4ac82b224c67bdaf885672241e68b664c617acb6 - pristine_git_object: 74158e87938988b56e8d5d1fb450535c0bca5526 + last_write_checksum: sha1:f666541d115265d9df0d511aee455644aae1bf6c + pristine_git_object: 579ed264354c57010827955ce7a5519d530a75a7 + docs/models/platformlistagentrunsresponse.md: + id: 4974a712183f + last_write_checksum: sha1:0e17c236ec238e3b2863dc62e9738b5a3dfda0af + pristine_git_object: 54155fb5b0ae1fb38b83e62d7e599a22344012df docs/models/platformlistdepartmentsresponse.md: id: 69a15ba2a142 - last_write_checksum: sha1:f55379fa1379d6572077b6b1f751f5b9cfb8c6e7 - pristine_git_object: c363687e367e6e1a48f66e0c89c2d33c3ed97453 + last_write_checksum: sha1:28c0580aaf22b2ce5294ccf56cbb303994d9e687 + pristine_git_object: 640ae915701d814d123fafa9273a33527f7f2d73 docs/models/platformlistidpgroupsresponse.md: id: 431a0ed6bdbe - last_write_checksum: sha1:8e46270a18a104189ee08b1431255c33d33d24ee - pristine_git_object: c8bbd4b7a3b225a7a82c264000b6d77c6d9a2a3f + last_write_checksum: sha1:1f4ccc71515f034375ab8a3730e02dfd49b72743 + pristine_git_object: c1ce7a4c6a5c067a06452ce190e4b8e5af3961e3 docs/models/platformlistoauthclientsresponse.md: id: dda199d26b05 - last_write_checksum: sha1:2b3206627cc0375cdf54bbb19b711e4d840ff156 - pristine_git_object: 6296c58f184616b9219d4f38452a5d259a6f832b + last_write_checksum: sha1:49561f7201d0b0c7712fe88506e81c9828d33395 + pristine_git_object: 32206bc509cc45f39f956485602f3b5400ed0a81 docs/models/platformlistusersresponse.md: id: bcf3838547ae - last_write_checksum: sha1:e11723f467de65a28f53da3ad0eedb0a8ea3e82c - pristine_git_object: a75d2c0615bc0014fa3f5081137cebc2b33a4c80 + last_write_checksum: sha1:c3ad445affa1fab443c49a83793a0435b900635a + pristine_git_object: 7104a5131b4d35bd98f3d782cf113a3c3e3f46b2 docs/models/platformmessage.md: id: ea30c4fdad14 last_write_checksum: sha1:890468283cb6b47c68edf4b7b241dec096699d95 @@ -4350,16 +4402,16 @@ trackedFiles: pristine_git_object: 61dd41f0319201cc105e29174ab1cc0018cecbce docs/sdks/adminagents/README.md: id: 665e1b8d841f - last_write_checksum: sha1:e517c92fd6b470687d8d20e502e70dd4ff15aef9 - pristine_git_object: 51b0d1dcf7a791952abf652bb5b62ad9eb4fd909 + last_write_checksum: sha1:1bfc3b39c20b43aa5ad39a0ae7b13126e6381faf + pristine_git_object: 8df7d3716817ef0fe9d8d15f564ab7521c93639a docs/sdks/adminidpgroups/README.md: id: b6a9054823ec - last_write_checksum: sha1:491474aa4e883a8915452f676fb15b5b45db390a - pristine_git_object: 0574fa5679645560b594228a2061b0c3c9326335 + last_write_checksum: sha1:715ce8e614ad10597ba19bc5e800b58036961747 + pristine_git_object: c63e8c75deb045f1f5389442c0995424f597cc97 docs/sdks/agents/README.md: id: 5965d8232fd8 - last_write_checksum: sha1:a95c11ce1204f2fcd4aec150e794594b8eaca27f - pristine_git_object: c5bc6c2c3f2cca3c9a7be1f08554bcecc1fe8531 + last_write_checksum: sha1:674438cdbd99e8544e09fcd636d27ab1d0866388 + pristine_git_object: 1425304f5ad12d4fd36366c87776d30d1bffc477 docs/sdks/announcements/README.md: id: 3d2e130a217c last_write_checksum: sha1:e6750d27c83a17ac456bc84cf48a2c8d36a0d5ee @@ -4402,8 +4454,8 @@ trackedFiles: pristine_git_object: fd4c69477d809e0eb57fb7583a0dac7202cb8db5 docs/sdks/clients/README.md: id: ba883fd0c1cf - last_write_checksum: sha1:0a6a714b890937142d07c6036d56907b4cd430e3 - pristine_git_object: 3c679b0187d753c19660e37d43f6978052219afa + last_write_checksum: sha1:d7ca133c26afe04192524c69aacae529023cc643 + pristine_git_object: 038cc8aa5b5e52eea75035c6785f6bcfd78c788e docs/sdks/clientsearch/README.md: id: 0a2a3cf68489 last_write_checksum: sha1:99ccebe91c1ecfbd78fc84eb3a3b804e105ba86c @@ -4426,8 +4478,8 @@ trackedFiles: pristine_git_object: 591db4d22a99e6ab341f39b8573f9a46e0777c37 docs/sdks/departments/README.md: id: 12342c54f2cb - last_write_checksum: sha1:f31385f326d09b3ec9f198840ac5c116f3445a75 - pristine_git_object: daa008d7229a9ca396a45ac7c6edc18698ff46f0 + last_write_checksum: sha1:bf5a707dac89e90b6d69d76e2bdcd08625eceb45 + pristine_git_object: cd39e77856a8dcbd4bc523f928bc89765078fb29 docs/sdks/documentssdk/README.md: id: 170a0b5b4d02 last_write_checksum: sha1:25b5ba12873295d749dccd95c1568fd6df97d1f1 @@ -4510,8 +4562,8 @@ trackedFiles: pristine_git_object: 247855caababfe9bd69dfdec41b48c0ef37ccde8 docs/sdks/users/README.md: id: 5d80027045fe - last_write_checksum: sha1:3d2413654479e392ba2ea3f910e78c2c3bddc825 - pristine_git_object: 5fd6a2c999be94752411349e0a8be17f582fc7d3 + last_write_checksum: sha1:e2576f093a86223fccad991895ca708f2397a8c0 + pristine_git_object: 508999b4460719466355fb53198e5b3e7d1755f8 docs/sdks/visibilityoverrides/README.md: id: c7d003d6a68f last_write_checksum: sha1:fc3e187db9d3cc0e525fa1c3f0a6c309f94ed64f @@ -4530,8 +4582,8 @@ trackedFiles: pristine_git_object: 79e388be87446ab6a4064b372bad0e8376d0cb5e pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:a977c4151ee827468dea59bbe83c574354d3fd96 - pristine_git_object: c72b3762456a588b361a95cb167fa451a91d44e4 + last_write_checksum: sha1:e99bb0983f07e3a326488a1592e6b8cedb9246d1 + pristine_git_object: acb346d7e898836521100748692da4f1927a02fa scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:1ad9251ca23c3f195fed36dfc0d83254a65bd895 @@ -4558,24 +4610,24 @@ trackedFiles: pristine_git_object: d7f9b51b5278bc431e9787d13e98d7199e08bed4 src/glean/api_client/_version.py: id: 0ce22b26136b - last_write_checksum: sha1:87f083b081a79fa2d8bfbca3921c8672b20cbe70 - pristine_git_object: 03f4b3e3bc48091f828fa1b64b6aee25a427ef9a + last_write_checksum: sha1:c4ae62cb966cf5bacddd3935e99b6f5d52b50d93 + pristine_git_object: fb1201e37c49c59dc48d64e5e0c981f1066e94f9 src/glean/api_client/admin.py: id: 583cfae82adf last_write_checksum: sha1:e73ee99e804e8bb3859346c4f8117a608da53862 pristine_git_object: 0d3f32802452398650c159c8f24a8e565c93e342 src/glean/api_client/admin_agents.py: id: d9becdfd4be8 - last_write_checksum: sha1:70b32110f6789575d85f122804ec3e48ed994b92 - pristine_git_object: 6fd07dd6f86ba6632caf40d3a41ec42c154a4fb0 + last_write_checksum: sha1:c0853de38d7cb4b2c541d6c8ca8048eea53c9d6c + pristine_git_object: aea15e858261d65cb3a116f93604eff2a8b926b1 src/glean/api_client/admin_idpgroups.py: id: 8f0ad8c9671c - last_write_checksum: sha1:d4751084dc6780ea8aaa98ce000e5650d75b0de4 - pristine_git_object: 5802968f9e2622e2eba593eb07385a4eff94b72f + last_write_checksum: sha1:1bbb3b8c37013a8f83327fb28d5c3565a8da4acb + pristine_git_object: df4d78a1a14ec76a41757c2d0b313c87223284d8 src/glean/api_client/agents.py: id: b925701a9217 - last_write_checksum: sha1:cdeef340a5e7adcf46407e2e781a90c7726a89b2 - pristine_git_object: 51f5d37e81b9c93bfa8e395115b76dd4afbe8ab5 + last_write_checksum: sha1:b9ba67381233029fa7b96434dca9e71c9aba1ecb + pristine_git_object: 8c2722cf47cae1a89b80d40170a7fb865b8a404e src/glean/api_client/announcements.py: id: 452f3d593912 last_write_checksum: sha1:034640f1156b65b678f191eb7da60678f049ca39 @@ -4638,8 +4690,8 @@ trackedFiles: pristine_git_object: a32adc434780783e5f8af978da829e2ed367dfbc src/glean/api_client/clients.py: id: 42c841daa28c - last_write_checksum: sha1:e6559b380927842147e2da1e736b0d824c50a8d8 - pristine_git_object: 11cc3ed79762f46ae828fe936af4c1f574ac72f0 + last_write_checksum: sha1:5dd2cac3fa35bc850871f427e3eb8eab9ffba7c0 + pristine_git_object: 8c3240fd1bbd075bbc779463af58283fced16315 src/glean/api_client/collections.py: id: df34f0fd10dd last_write_checksum: sha1:05ad538ea0f8843387247247be2d0db085ccca6c @@ -4654,8 +4706,8 @@ trackedFiles: pristine_git_object: e387ce4fe842388b52fd57746655dd2187cb3e74 src/glean/api_client/departments.py: id: 04b4ac5904bb - last_write_checksum: sha1:73c0d609453bff0542f6b482dddf7853ab172aff - pristine_git_object: b0f88746135d3ce598f1597bc2daa6ebe1eadcd8 + last_write_checksum: sha1:3fc3b09822d07372efc8693fde803c7cb161548a + pristine_git_object: 62198cb82975ae2a0c91942cf91cd8d42c889856 src/glean/api_client/documents_sdk.py: id: 9e873980fc76 last_write_checksum: sha1:66d8859c3e9a72b0dc9b28aa9fb9e3da35fe5dac @@ -4770,8 +4822,8 @@ trackedFiles: pristine_git_object: 1b1e73ed47f8015a05740e4f42e5f71883d0dc4c src/glean/api_client/models/__init__.py: id: d5f6ea5efcbe - last_write_checksum: sha1:83348daf91f1731fabb7c9ca2aed18c4643bf4b6 - pristine_git_object: 50b6c7b969f7765a20f08c78e2cd53e82b300fd7 + last_write_checksum: sha1:6f3841442ecdcfa5aa4c0532783c579d9187f4b2 + pristine_git_object: a2a8e5b6ff659895c7764d6b7b7ea1b4ecd7769f src/glean/api_client/models/accessrequestpermissiondeniedresponse_error.py: id: 22a2fa0d5899 last_write_checksum: sha1:7931c6e1056d03612c02ce490326cd5d0cbea349 @@ -6536,6 +6588,14 @@ trackedFiles: id: f17d1b61b15b last_write_checksum: sha1:6b9903bfc68c7a4c8dc81a3a35a7e621bec9cbbd pristine_git_object: e126fb5da5fd3e5c225b916e55a47b5b0d17bf84 + src/glean/api_client/models/platform_agents_create_versionop.py: + id: 18b603335077 + last_write_checksum: sha1:ac56eab4ce0d98273e02d46ab8f7003e88d4343a + pristine_git_object: 3ba8695f8791dac4fad2beacdc752340a71bb7f2 + src/glean/api_client/models/platform_agents_delete_versionop.py: + id: f261148929ad + last_write_checksum: sha1:48e84b4e9dc677f1af11782c32285cc49f15a21e + pristine_git_object: 983194cc1ec8d3af45bcfd8a4f592fe088f318d3 src/glean/api_client/models/platform_agents_deleteop.py: id: dbb23f04cfbb last_write_checksum: sha1:e38163b1e01cf6f4e8996ad428637476d297d309 @@ -6548,10 +6608,22 @@ trackedFiles: id: 54795e674f69 last_write_checksum: sha1:50003cec52b82b85365c65a5ebdffa70b4de3b91 pristine_git_object: 5f5e9681a6006ea02869b6f04bef26652d75e9f2 + src/glean/api_client/models/platform_agents_get_versionop.py: + id: a8e1275acaae + last_write_checksum: sha1:d704be56ccce312a749f94a9294537903cd1c6d3 + pristine_git_object: 3e05ebf9555a66172b4bd290a08dc071454ee75f src/glean/api_client/models/platform_agents_getop.py: id: 606568a4c8fc last_write_checksum: sha1:d6616e9005bfa655890d0c625b9886e812588ee2 pristine_git_object: 44245eaca49d502b072acbb1b2f59d34e5defd06 + src/glean/api_client/models/platform_agents_list_runsop.py: + id: 85a08c78f79a + last_write_checksum: sha1:47cb64cf05c36e26651f50c92613fbfd19f6c7b3 + pristine_git_object: e7b0a162ea0fa016967196b33714d2a18d3ba9a4 + src/glean/api_client/models/platform_agents_list_versionsop.py: + id: 6dcf9122b916 + last_write_checksum: sha1:2b5174bd9afbc0e7400fff4604262c6700518b39 + pristine_git_object: ff330ed5a3ca2af86ee46f45a73c450093008da6 src/glean/api_client/models/platform_agents_updateop.py: id: f28b7bbd80c9 last_write_checksum: sha1:899546550abc79d94497d4d817427b6325f02f30 @@ -6706,8 +6778,8 @@ trackedFiles: pristine_git_object: d4f2de244c4294c7f6a646c9d07d72c792104935 src/glean/api_client/models/platformagent.py: id: edd82e5a258f - last_write_checksum: sha1:3ff28375aa3189c0e66dc11e60429db53c2204b8 - pristine_git_object: e5645ffbd9ef3242b934982955f7c4af0c9e8a86 + last_write_checksum: sha1:d2ca884454d95707818777473df29bc8a5225a6e + pristine_git_object: c1e65b7a2b135b9ba9531c4648178ca8e6ec4abc src/glean/api_client/models/platformagentcapabilities.py: id: 16d4984052e6 last_write_checksum: sha1:4a29985c9b42042fec3e5553e94198d8ec1a3afe @@ -6730,8 +6802,8 @@ trackedFiles: pristine_git_object: 64a9a797514bb3fb1f2660405962238c495463fc src/glean/api_client/models/platformagentcreaterequest.py: id: b843832ad4e6 - last_write_checksum: sha1:829fd2b7733d36f6abe554fb66befaf6966409f0 - pristine_git_object: f7b2fb1d41968762d976a457a940519fc6171f67 + last_write_checksum: sha1:134af695bc94ab69d0d172b78d1a8bf81bcc5597 + pristine_git_object: dc8a60f9e2010a0282753cb0ecb7248e0f7c5a13 src/glean/api_client/models/platformagentdependency.py: id: c31be34811a7 last_write_checksum: sha1:4bbabbb8f8758d4ea0a033631be1ffa7bcd8dc82 @@ -6816,10 +6888,18 @@ trackedFiles: id: ff3ceeef01ba last_write_checksum: sha1:2032de0253e0141d46a9f666d2b7657660916fe5 pristine_git_object: 277fddcbc203b6efd848bdab9fb9fd3dc4bbda88 + src/glean/api_client/models/platformagentrunsummary.py: + id: 7ff03d3add9c + last_write_checksum: sha1:22b939189a0e7f97a8df0a55e292a6437705f404 + pristine_git_object: 2cfc8394ce3a22b3d744336f12eec776d13e38f2 src/glean/api_client/models/platformagentruntoolapproval.py: id: 914f1fbb5e0d last_write_checksum: sha1:beb9f840c1e13b40abd411c9b751e3d3dc95ffb9 pristine_git_object: a08485c567136f98304083b38086ce04b6396979 + src/glean/api_client/models/platformagentruntrigger.py: + id: dd1adfa0a700 + last_write_checksum: sha1:ce1ec1a41ab169a12a411507ed0c42c46bdebc9a + pristine_git_object: 40e898a64570963e17a20f67a28e3587d0cfbe8c src/glean/api_client/models/platformagentrunwaitresponse.py: id: 3498df9c1961 last_write_checksum: sha1:8f520469ff38ad0016796638a67d794aa065ba18 @@ -6854,12 +6934,12 @@ trackedFiles: pristine_git_object: 5386567eb2be0db84163ffe2b3a69127b23674f8 src/glean/api_client/models/platformagentssearchrequest.py: id: eb40369d333e - last_write_checksum: sha1:fb843f78f2a76f6149924852d577de4279dc4382 - pristine_git_object: bf27e3f8dff50fd3e23b7a3b57c30df191a9de55 + last_write_checksum: sha1:183aa205c49c97bfeb32418b621b6c6e2d615851 + pristine_git_object: ca68b949f6e593bfd07ec66bc06102adeebd0469 src/glean/api_client/models/platformagentssearchresponse.py: id: 2c3bddef7679 - last_write_checksum: sha1:faf471011e3afbb305a34dc9c1bc21eb6bca2adf - pristine_git_object: 317432d0f9ef2c6f143e5ae4e57bb9af5bebd4c5 + last_write_checksum: sha1:3c054c8717bad0005ca8637202cee20a07d7555b + pristine_git_object: f1cd7c8a07b9ccdc007e1577d2a38e3dfa4dfd26 src/glean/api_client/models/platformagenttoolset.py: id: 51779994a2ff last_write_checksum: sha1:8c2453eb33fc43b93e93b8f59dbf1b6184821292 @@ -6870,8 +6950,28 @@ trackedFiles: pristine_git_object: d9241c63ad8ffe584b4bfa0a2ecdcd696853b8a0 src/glean/api_client/models/platformagentupdaterequest.py: id: 30f9327fa395 - last_write_checksum: sha1:557474f4c5d693e6265b4cdb472dbc89dc981971 - pristine_git_object: 526ebbbbab303583fb3be2bf2fc9762889bc7ba6 + last_write_checksum: sha1:0a9ebb785e6199ff6dc323e799168b360392dab1 + pristine_git_object: 89a65130d98782146865f456677e55aad8bf8204 + src/glean/api_client/models/platformagentversion.py: + id: 6abdefb53578 + last_write_checksum: sha1:bf467f3ccfc87bf66fc8aaade3a7e46ab0592577 + pristine_git_object: b3ee3605edaadb07de6da4711590216249f5eebe + src/glean/api_client/models/platformagentversioncreaterequest.py: + id: 182951dd3dde + last_write_checksum: sha1:cb5c4a551c9fb4173c9791dc173bfc676ec42247 + pristine_git_object: 327b8b874a40d0ed5fa4f1a83a95cae807c7e540 + src/glean/api_client/models/platformagentversiongetresponse.py: + id: 4219503d0933 + last_write_checksum: sha1:99364331724856f5f50ea802ff7fa67892532965 + pristine_git_object: 4afc1d8b32d8868c37aa3471d0dfe241206f1ce5 + src/glean/api_client/models/platformagentversionslistresponse.py: + id: 9028190f6635 + last_write_checksum: sha1:123b3246a3f688742a69c762b997ca14294ef192 + pristine_git_object: 4e7e0339cdc6c9015d7645878f4e2ec28d965649 + src/glean/api_client/models/platformagentversionwithdefinition.py: + id: 4a1614a98600 + last_write_checksum: sha1:74ab9b8e6a4b8d3745981754551f6fec7b3794a6 + pristine_git_object: c39aed1700e3f179266a8abb8ba6c20923ccf42d src/glean/api_client/models/platformanonymousauthtoken.py: id: d6ed962e28a2 last_write_checksum: sha1:5225faf0e1d49e6237606d2a1e5522b1d44b4f36 @@ -7114,24 +7214,28 @@ trackedFiles: pristine_git_object: 894c92a4d4abba11e641b1cddbca476b5bde17f9 src/glean/api_client/models/platformlistadminagentsresponse.py: id: f2bde0abdb4c - last_write_checksum: sha1:af4313e7b0eb293fdd4b41209ffa6878791c37a2 - pristine_git_object: 77c92a0ef2c855ae66b5808f7182766058524d3c + last_write_checksum: sha1:cd0bff407260a34b268eca93b11de3f85f9cfe67 + pristine_git_object: da24dab157c7805bfad8ecba6d179049ea36050b + src/glean/api_client/models/platformlistagentrunsresponse.py: + id: 36136c76e2a2 + last_write_checksum: sha1:ee34a7e69d4a4efcfd81a127cfc6b84cf502b1a4 + pristine_git_object: b1146cfcd68827b25942ae90633a363599cfafb7 src/glean/api_client/models/platformlistdepartmentsresponse.py: id: e9f64ae3372f - last_write_checksum: sha1:fecbc9fd3475ba90fc491dd9d735c4abed1a54b1 - pristine_git_object: de00d93acf23dc62c101edd4eb06bf1f76bcc99f + last_write_checksum: sha1:8e3a2b5610f25401843b4aa4e25f02e228ca55bb + pristine_git_object: 54e88bf18f9ee9c2b353b04bad2aebca4ed04641 src/glean/api_client/models/platformlistidpgroupsresponse.py: id: 44674fdaaef8 - last_write_checksum: sha1:1ba5f66a0e09c1afb329d3af82195dc07a5f761c - pristine_git_object: 357000ad80487e78240fe2b90f366a4d5eacc0f3 + last_write_checksum: sha1:54ec829e6f07294321abaddf891aae715c651852 + pristine_git_object: f36dc6d727cc7656f01bb10652234d06e686c0a6 src/glean/api_client/models/platformlistoauthclientsresponse.py: id: 235bf58adc51 - last_write_checksum: sha1:91b7bc54c077dde637d4d8bf752da27acc9ead7c - pristine_git_object: dc8fd19218c082de8952192bcf031ca1d6d84560 + last_write_checksum: sha1:64bd17833aeb3fe017f4ee3ab93b77d9f1acf401 + pristine_git_object: 89451272f91b7aacc672c1a4ce5f69c9a8ca2c28 src/glean/api_client/models/platformlistusersresponse.py: id: b6850e9c2d42 - last_write_checksum: sha1:01a25e26cd4ac52c3e5c3c9f30e2a37456e76f32 - pristine_git_object: eaa6372faa9ce96e2efcfa9acab4d90b50e2b35e + last_write_checksum: sha1:3992a35c93c385b73ac20391dba7c05aeea4fd91 + pristine_git_object: 5b0c10d701c5fbcbdd12fa6dae453be49db632d5 src/glean/api_client/models/platformmessage.py: id: 5124dae40c5d last_write_checksum: sha1:44b6469147e93a949f98513471367939bef9b56b @@ -8214,8 +8318,8 @@ trackedFiles: pristine_git_object: 795420690ec7f336d8ee2648b6d6c718984a5cc8 src/glean/api_client/users.py: id: f7d2f9613f16 - last_write_checksum: sha1:62408e6f9a412f0c911d437c3e0e755d0e57ef82 - pristine_git_object: 2e13bdb51e3129ec2f30be8ea99c38697d5d10d3 + last_write_checksum: sha1:1b0d836cdb2e5cb3298b345f44328d0a28f0b1eb + pristine_git_object: 718c662d3b28755e97af862ec6965d0eef4c55e4 src/glean/api_client/utils/__init__.py: id: d681dc4f06b3 last_write_checksum: sha1:fe273919f43134738846009bf64f4497dde41416 @@ -8354,8 +8458,8 @@ trackedFiles: pristine_git_object: 5d86a6fec60596301e276b69a67329becdb53d3b tests/mockserver/internal/handler/generated_handlers.go: id: 61ac4f7cce9e - last_write_checksum: sha1:cee5bda2c27c56d9dacc4b1d7936dd048cae2780 - pristine_git_object: 6b63ed70cd8c1749a6eed88658dd168fcb56338f + last_write_checksum: sha1:772808155870c01469d5abed0b7f1924c1242de0 + pristine_git_object: aab377c24821cf0ba28b2d7499843cea00e10b26 tests/mockserver/internal/handler/pathdeleterestapiindexcustommetadataschemagroupname.go: id: 979e4583765b last_write_checksum: sha1:2615bb2fcb7c82c3967985727a99ccee31262b1f @@ -8388,6 +8492,10 @@ trackedFiles: id: 118e0c46ba00 last_write_checksum: sha1:6f390c554aa2ecad97dd334a79b9a840927d3dbd pristine_git_object: 15481a97f6b8c8264fa766714040b056af9447ad + tests/mockserver/internal/handler/pathgetapiagentsagentidruns.go: + id: b1cbb05aedca + last_write_checksum: sha1:6899eda103e338160aad18b90674bdaa39cafebd + pristine_git_object: 62d103411ecb463f84626a41375f789710e4714f tests/mockserver/internal/handler/pathgetapiagentsagentidrunsrunid.go: id: 475b833c9801 last_write_checksum: sha1:e882dfea48bfca8e467c110867157a6ef955bb95 @@ -8396,6 +8504,14 @@ trackedFiles: id: a3a921765081 last_write_checksum: sha1:5a5128b1f57ed5fd3446458733ce250f52dc59a3 pristine_git_object: ffa9eca001bb7d3108d6bd9811b495f2034d4259 + tests/mockserver/internal/handler/pathgetapiagentsagentidversions.go: + id: 32ede5f8fb46 + last_write_checksum: sha1:3429ba6b0546216c068ba3e46c6176fd95707576 + pristine_git_object: a11718bed85a555a242f7837e1f5b5d55be0d1ca + tests/mockserver/internal/handler/pathgetapiagentsagentidversionsversionid.go: + id: 4158beaca34a + last_write_checksum: sha1:5edb8e2b6bb04fe2f6947a0b4752a89a1320e5db + pristine_git_object: 3e13daceb5c954da724aafe7d3e8ac7a40960c46 tests/mockserver/internal/handler/pathgetapidepartments.go: id: dc7ce8014e0e last_write_checksum: sha1:f06b6b68c622d971797e8b26e4ccceb80c149201 @@ -8568,10 +8684,14 @@ trackedFiles: id: b038130eb997 last_write_checksum: sha1:a18279e3768b21e61fc4bf118fcdd8710ac29ae3 pristine_git_object: 6cad40c5ded1be6d92e98eb52de95d4a5aefd29e + tests/mockserver/internal/handler/pathpostapiagentsagentidversions.go: + id: 39ab6ef1c62c + last_write_checksum: sha1:2a15eadd76d7f5ebd9438ac324b8f62b31b1bdb4 + pristine_git_object: 9e5f2f2f891b8e40ca44dce0cab5d74ceddf8922 tests/mockserver/internal/handler/pathpostapiagentssearch.go: id: 7e4a6cf9ab84 - last_write_checksum: sha1:15afcaa9f949a428e6be875ba16669bb75b4a782 - pristine_git_object: 3414ce407ce9c4630b4a1925f55c1ef8fd81cd8d + last_write_checksum: sha1:9e759845715080260cdc6a35ecc78e452f7e3e62 + pristine_git_object: c7b8021c2845607add942af8b8e103bb54ae6ea6 tests/mockserver/internal/handler/pathpostapianonymousauthtokens.go: id: 32a0be7ec363 last_write_checksum: sha1:97ab2458037ee2bd28a98110756d23cb1fb40f59 @@ -10490,8 +10610,8 @@ trackedFiles: pristine_git_object: d34c4f86aa5967d3b555518afafefa29c9106db9 tests/mockserver/internal/sdk/models/components/platformagent.go: id: dcdd9a7bc9de - last_write_checksum: sha1:d439b050632d6d15459f06e0a8af9b9a14f4a70b - pristine_git_object: 51dd21faf855adc5425f61473fd38704dde1b829 + last_write_checksum: sha1:0793c1f53bfbe2f2c1d5a39489cc8a7ace32aa54 + pristine_git_object: 281a16c8c87a1be748396c40f79c7b83e123f957 tests/mockserver/internal/sdk/models/components/platformagentcapabilities.go: id: 2807a52a8b1a last_write_checksum: sha1:9d501149286de61ae65a0ef7dd4286c8ca281439 @@ -10514,8 +10634,8 @@ trackedFiles: pristine_git_object: bef62e0bcf7af0d59d450ea67a914701b1b82834 tests/mockserver/internal/sdk/models/components/platformagentcreaterequest.go: id: 51781b8cb8a1 - last_write_checksum: sha1:1dbde51742043e84bb49a543d6bd0e5c0f346e06 - pristine_git_object: cd9c2e977a1662929a895b115becf772f16cb32a + last_write_checksum: sha1:7af88d864efa9af1b62c76084daf4c1af76a5e44 + pristine_git_object: aa31cd58d82139f02ea6b747a6857fc98b69f98b tests/mockserver/internal/sdk/models/components/platformagentdependency.go: id: 3f7712d41e8a last_write_checksum: sha1:e40c1b77c9d40ac78a790bc19ba3c34c90d2f969 @@ -10600,10 +10720,18 @@ trackedFiles: id: 3c3488893a2d last_write_checksum: sha1:147c8368fe6e8f89e891a863db12cd027f5e46f2 pristine_git_object: 08ad85abb836e39f5964fd73e90fcddf34ec2ed2 + tests/mockserver/internal/sdk/models/components/platformagentrunsummary.go: + id: 46da1e5c2cd5 + last_write_checksum: sha1:362c8322a6211e0b0f7c811b3e900071d2f3e8fb + pristine_git_object: 44363579e99caea2d4d46ef6efa6c6e18e98e958 tests/mockserver/internal/sdk/models/components/platformagentruntoolapproval.go: id: 616c170e0960 last_write_checksum: sha1:06132befdf29c651ca4792ddfa6a39bfaf524370 pristine_git_object: 9f86791e185913da63c177215c818100642b5b3d + tests/mockserver/internal/sdk/models/components/platformagentruntrigger.go: + id: 22c606adead4 + last_write_checksum: sha1:58bac772b6b083b2ee503d792e6822c1ce8daaa3 + pristine_git_object: cf2b1b9fcc00cbda70cb09d6d66166b61995d98d tests/mockserver/internal/sdk/models/components/platformagentrunwaitresponse.go: id: 368b82c238d0 last_write_checksum: sha1:908ad30f069047dd4cdf6e6eed32696c0c753fe1 @@ -10638,12 +10766,12 @@ trackedFiles: pristine_git_object: c48274f8bf005b4ec2e799c584311236e2de2ac2 tests/mockserver/internal/sdk/models/components/platformagentssearchrequest.go: id: 7eaeaea3b941 - last_write_checksum: sha1:c55cfd76cbc8b921e65e631c390804e793908519 - pristine_git_object: b1089d54016d210324aa38bbc267e566aff440f5 + last_write_checksum: sha1:b8bba68c8080be7db471f0dbfc880f60f166b225 + pristine_git_object: c37073b01bdb5f3b6771887dcd73585dca7dcd40 tests/mockserver/internal/sdk/models/components/platformagentssearchresponse.go: id: f299b36c97da - last_write_checksum: sha1:421fb8f88350d02af54156156366d15f07c57f0f - pristine_git_object: 891f69638389ccd5d71ace062705ba6764e47e46 + last_write_checksum: sha1:0fe4c34a9c207c98fe290ae263753913fadf2836 + pristine_git_object: 6b8481d5c4779d87ca3860fd457b08f0a6290924 tests/mockserver/internal/sdk/models/components/platformagenttoolset.go: id: 4decc9d14146 last_write_checksum: sha1:4b72d7054410f158ad0818dd97263f5a2d54e983 @@ -10654,8 +10782,28 @@ trackedFiles: pristine_git_object: 4a53656d4058a702ca6892fdaaf11ecb0ac69d3b tests/mockserver/internal/sdk/models/components/platformagentupdaterequest.go: id: c4201fdb93ac - last_write_checksum: sha1:5be1c2bbcb3b088df866dec4c574308b480accd4 - pristine_git_object: 3cf44a122068ee3128a20c062fa0d51cb720a938 + last_write_checksum: sha1:2a06c989da548fd728cc5dd8a54ce0fa0687630a + pristine_git_object: 2b07afdce2d3e8807af838cd8ca4fd12a08706f6 + tests/mockserver/internal/sdk/models/components/platformagentversion.go: + id: 9887566a9bd6 + last_write_checksum: sha1:ddcc2d17c6f1f81cc57047188fa05240f3629d7a + pristine_git_object: 68f584db77565026047bc5dc2c857bb5b86f8b14 + tests/mockserver/internal/sdk/models/components/platformagentversioncreaterequest.go: + id: a76dbb4d40e8 + last_write_checksum: sha1:94e934b7bd1b928a18136ea174f987e2b0e0d4f7 + pristine_git_object: f2b3a7603d22da5132585d8af866277daf80d496 + tests/mockserver/internal/sdk/models/components/platformagentversiongetresponse.go: + id: 3655950c7f44 + last_write_checksum: sha1:8d1beee9cb9e59760a6c5f03a308c8d6ea637dc0 + pristine_git_object: d00c1c04130a4111f399d1144d0f9b2b1ec93e6b + tests/mockserver/internal/sdk/models/components/platformagentversionslistresponse.go: + id: 84066baf4fe2 + last_write_checksum: sha1:459f32dcc6977850e93920ae96951cb41482f01f + pristine_git_object: ae107ffc91747ce1b9b70c2eafd964431b7b9de8 + tests/mockserver/internal/sdk/models/components/platformagentversionwithdefinition.go: + id: 33cc426ecf98 + last_write_checksum: sha1:eb6fe1a48965a3078329dfa09d205f992a9f8161 + pristine_git_object: de8a78c3986a76410724955469fe4c75e53863d6 tests/mockserver/internal/sdk/models/components/platformanonymousauthtoken.go: id: 40614e5e590d last_write_checksum: sha1:f8a3e8bfd081e3be299ba6aabfe2d7fc14a00232 @@ -10898,24 +11046,28 @@ trackedFiles: pristine_git_object: cbc2c22668af0f91a368e432291b934804357560 tests/mockserver/internal/sdk/models/components/platformlistadminagentsresponse.go: id: df07b2205bbb - last_write_checksum: sha1:8ae00dd02f8dd05c5373b9a4c19296ab4c210eae - pristine_git_object: c5ba2f2e82d3032e63d99dfa22b8d7cad961bc95 + last_write_checksum: sha1:9b23421dd1caf16aafd2cedb5c217656857a725e + pristine_git_object: 5ede5672839863dd14d1250d1b348c6c465cf1c6 + tests/mockserver/internal/sdk/models/components/platformlistagentrunsresponse.go: + id: 524cf9827a91 + last_write_checksum: sha1:3658de5679702e599653e1470e1a7e5af0c46a8c + pristine_git_object: ae144ba7105f93bcc1d3e41ea067c716b187a13f tests/mockserver/internal/sdk/models/components/platformlistdepartmentsresponse.go: id: adc42a0bfc78 - last_write_checksum: sha1:f68c6751d54155d29e7a905443a30f075885c487 - pristine_git_object: a00ff10bd71ffeaafd74c0e1d1b3e23c82511280 + last_write_checksum: sha1:d8ca8c640a0845396e621d523867893f76368dad + pristine_git_object: f92fc19cb67b6b90b348efbc6c1dee07b1389b43 tests/mockserver/internal/sdk/models/components/platformlistidpgroupsresponse.go: id: 55a2cbdd724a - last_write_checksum: sha1:5c7c5cb2b28ead8f33176301cdb1c841c03b7cda - pristine_git_object: 6c2cdf0e9918bf8dff8ac4f3991c6f1ffcb0b686 + last_write_checksum: sha1:3c77eaea4a493035e49d92fbbf7968f8ec364115 + pristine_git_object: ec313b0199acde345410d3d5dea83bfb93983284 tests/mockserver/internal/sdk/models/components/platformlistoauthclientsresponse.go: id: f9141dfe3b1e - last_write_checksum: sha1:6e4911a0ca93d594c117d9c77f42ad46c4005c66 - pristine_git_object: 2b393bcc05490d7084c4222214b04057bf4b6b89 + last_write_checksum: sha1:9687522480d19121dcaa27dc4e313980b36577bb + pristine_git_object: 31abc42b533852369923897044caae071801abe0 tests/mockserver/internal/sdk/models/components/platformlistusersresponse.go: id: 5cdeb58de0ed - last_write_checksum: sha1:d8a45dfce7a90998a999819650fc82241d7443db - pristine_git_object: e3b40b30790262235f67af2773d5e5f1c20c6652 + last_write_checksum: sha1:ccf2d1bc428c67d460d8cd4bc151fa27718ff35b + pristine_git_object: 3f409fb70d6197273c0b770c05b9518970a45335 tests/mockserver/internal/sdk/models/components/platformmessage.go: id: 5eb3e8c3fd80 last_write_checksum: sha1:a0bd9faaca42357ca01a61ec39c17e81f9d1f6f8 @@ -12206,8 +12358,8 @@ trackedFiles: pristine_git_object: 1dc8cb1ce0b4d02c24fad133da0ecfa0d9c7d14a tests/mockserver/internal/sdk/models/operations/platformagentscreate.go: id: 1705b980be18 - last_write_checksum: sha1:9c7ee1f2c4c768d3525947dac4dbbeb8ee7ab57a - pristine_git_object: f2775424aa4f1c5041f9062fe92c85d50eab285a + last_write_checksum: sha1:8113f2baa31c20fc36c0ee103ee45305bfe8db93 + pristine_git_object: d2b009ecb4dcf67e3943ad74eae1b1a0cbd07f28 tests/mockserver/internal/sdk/models/operations/platformagentscreaterun.go: id: eb220c44e3e3 last_write_checksum: sha1:c8487ba5d0a7224ae6cd70f45b742c4cbbc4a1ce @@ -12220,10 +12372,18 @@ trackedFiles: id: 9ed71d865e7b last_write_checksum: sha1:eba1411425e77cf4a31e5c4859cf0d9fb100989e pristine_git_object: de3a83b4f56e6c373b9fabdcaefde7505a98a432 + tests/mockserver/internal/sdk/models/operations/platformagentscreateversion.go: + id: 57a8c7967180 + last_write_checksum: sha1:eed1fda4640c89ec4634da1798ddec4117232b4b + pristine_git_object: a2e8f8f10a70ca617f73c0147e06b02db6a38f33 tests/mockserver/internal/sdk/models/operations/platformagentsdelete.go: id: b3838df3ce36 last_write_checksum: sha1:595921a28be0e508272724fffed8c7f6e4cb8d4e pristine_git_object: 5835a20488ac46a01e1b83cf103eb4d2e69e6f8d + tests/mockserver/internal/sdk/models/operations/platformagentsdeleteversion.go: + id: fd9e540eca55 + last_write_checksum: sha1:2d43f7ce1f9c30b5fcdca841daf1b0474c62acf3 + pristine_git_object: 4285fb3b673c40472bef995ff8ef2e86174b659f tests/mockserver/internal/sdk/models/operations/platformagentsget.go: id: e74910e78a17 last_write_checksum: sha1:415352a9aa35e8d678b1f5fe472c87b939db5267 @@ -12236,14 +12396,26 @@ trackedFiles: id: bf409518e189 last_write_checksum: sha1:2379990bf28ee0daf3819a9d7440e909799d9fd9 pristine_git_object: 959340d0c279a666f94e7489df4f0ea23dc7cc80 + tests/mockserver/internal/sdk/models/operations/platformagentsgetversion.go: + id: e7fe93090f68 + last_write_checksum: sha1:20fd4ca2623391395241c7f7d1612027f56e398b + pristine_git_object: 022e62567e6318654eb05f443c53630fdebdf489 + tests/mockserver/internal/sdk/models/operations/platformagentslistruns.go: + id: d6cb397f45f9 + last_write_checksum: sha1:7f395975770bc895ca5692ba7f9523a69b7322ac + pristine_git_object: ab4f6464cad6e85b50359e27ad6edddced6ceebf + tests/mockserver/internal/sdk/models/operations/platformagentslistversions.go: + id: 9a0be9b4c525 + last_write_checksum: sha1:c992654da06447e142adab37b722bb3d9a20e63e + pristine_git_object: bb0af5d4f39039a2d20970d924101a8a41045a20 tests/mockserver/internal/sdk/models/operations/platformagentssearch.go: id: 1bfa86240c50 last_write_checksum: sha1:5e06e0696a34e9b608e0e4f89e6d8f56990fca77 pristine_git_object: 4577d3f9625229f6380f2a1cb670b0c8a7e2faaf tests/mockserver/internal/sdk/models/operations/platformagentsupdate.go: id: 572ae19775e1 - last_write_checksum: sha1:847fb5c41e6db32dc3341ea8f4d3f04808d3497f - pristine_git_object: ed24f5f0ebbe1f93ba36267696a811e7256fddb1 + last_write_checksum: sha1:798b23efb887f12cb2864dfbe0b93a0f456866fc + pristine_git_object: 010ccea0a9266bab01a67b2c54b7e0a50cab4d01 tests/mockserver/internal/sdk/models/operations/platformanonymousauthtokenscreate.go: id: b25fec134c50 last_write_checksum: sha1:754ddc527ab13e03bb78cfbe76918ed0bf408bd6 @@ -12762,8 +12934,8 @@ trackedFiles: pristine_git_object: 7a7b4f022114dadb9e4b2357e6f118e3f433297a tests/test_agents.py: id: 2eb70a860f3a - last_write_checksum: sha1:331c12ed5156e17c68c1169db796538dcf5c8c7b - pristine_git_object: 5532cb18cf31f95f51f57b06736f622d6fdeb431 + last_write_checksum: sha1:410926fc935a67695f5c49e480c0864d9ad27a09 + pristine_git_object: c8d8efca90b0a257fbc1b1f9d34547f86fa2db8a tests/test_announcements.py: id: 720cc07fca06 last_write_checksum: sha1:39bc24c23ab0faa485022e86e6ede90b4ef9b7ba @@ -12914,8 +13086,8 @@ trackedFiles: pristine_git_object: 526919dd9f43054d8d75711a293a78e098117a59 tests/test_summarize.py: id: a255d8a6f627 - last_write_checksum: sha1:876530142700cffca9c3f6bf0119cd052b6258ca - pristine_git_object: 59a3def446ee27bfad56068d665960c9b8ff0bb3 + last_write_checksum: sha1:392ad5fa776bd43a774a992fc9e9208a1403a0f4 + pristine_git_object: 6ccab41179c978ffdaf348e606ee7731ceec3829 tests/test_tools.py: id: 70889bdf7321 last_write_checksum: sha1:474f60fca9f3dbfa783d7f3b822c0f44748ad915 @@ -13873,10 +14045,10 @@ examples: platform-agents-search: speakeasy-default-platform-agents-search: requestBody: - application/json: {"name": "HR Policy Agent"} + application/json: {"name": "HR Policy Agent", "page_size": 100} responses: "200": - application/json: {"agents": [], "request_id": ""} + application/json: {"agents": [], "has_more": true, "request_id": ""} "400": 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"}]} "500": @@ -14573,7 +14745,7 @@ examples: platform-agents-create: speakeasy-default-platform-agents-create: requestBody: - application/json: {"name": "HR Policy Agent", "instructions": "Answer employee questions about HR policies and benefits."} + application/json: {"name": "HR Policy Agent", "instructions": "Answer employee questions about HR policies and benefits.", "draft": false} responses: "201": application/json: {"agent": {"name": "HR Policy Agent", "agent_id": "ef33aecf52c142a6873adf76037b642e", "capabilities": {}, "subagents": [{"name": "HR Policy Agent"}]}, "request_id": ""} @@ -14672,6 +14844,72 @@ examples: responses: "200": image/*: "x-file: example.file" + platform-agents-list-runs: + speakeasy-default-platform-agents-list-runs: + parameters: + path: + agent_id: "{agent_id}" + query: + page_size: 50 + responses: + "200": + application/json: {"results": [{"run_id": "", "agent_id": "", "state": "RUNNING", "created_at": "2024-09-28T20:59:41.155Z"}], "has_more": false, "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-list-versions: + speakeasy-default-platform-agents-list-versions: + parameters: + path: + agent_id: "{agent_id}" + query: + page_size: 20 + responses: + "200": + application/json: {"results": [], "has_more": true, "request_id": ""} + "400": + application/problem+json: {"type": "https://developers.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developers.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} + "500": + application/problem+json: {"type": "https://developers.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developers.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} + platform-agents-create-version: + speakeasy-default-platform-agents-create-version: + parameters: + path: + agent_id: "{agent_id}" + requestBody: + application/json: {"display_name": "Caterina.Walsh", "agent": {"name": "HR Policy Agent", "instructions": "Answer employee questions about HR policies and benefits.", "draft": false}} + responses: + "201": + application/json: {"version": {"version_id": "", "display_name": "Imani_Lebsack", "created_at": "2025-05-23T00:57:48.585Z", "agent": {"name": "HR Policy Agent", "agent_id": "ef33aecf52c142a6873adf76037b642e", "capabilities": {}, "subagents": [{"name": "HR Policy Agent"}]}}, "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-get-version: + speakeasy-default-platform-agents-get-version: + parameters: + path: + agent_id: "{agent_id}" + version_id: "{version_id}" + responses: + "200": + application/json: {"version": {"version_id": "", "display_name": "Mauricio.Pouros72", "created_at": "2025-04-07T11:45:00.644Z", "agent": {"name": "HR Policy Agent", "agent_id": "ef33aecf52c142a6873adf76037b642e", "capabilities": {}, "subagents": [{"name": "HR Policy Agent"}]}}, "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-delete-version: + speakeasy-default-platform-agents-delete-version: + parameters: + path: + agent_id: "{agent_id}" + version_id: "{version_id}" + 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"}]} examplesVersion: 1.0.2 generatedTests: activity: "2025-04-28T22:05:12+01:00" @@ -14897,13 +15135,11 @@ generatedTests: platform-models-list: "2026-12-01T00:45:52Z" platform-anonymous-auth-tokens-create: "2026-12-01T00:45:52Z" getImage: "2026-12-01T00:45:52Z" -releaseNotes: | - ## Python SDK Changes: - * `glean.models.list()`: **Added** - * `glean.anonymousauthtokens.create()`: **Added** - * `glean.client.chat.retrieve_image()`: **Added** - * `glean.chat.create()`: `request` **Changed** - * `glean.chat.create_stream()`: `request` **Changed** + platform-agents-list-runs: "2026-12-03T08:35:13Z" + platform-agents-list-versions: "2026-12-03T08:35:13Z" + platform-agents-create-version: "2026-12-03T08:35:13Z" + platform-agents-get-version: "2026-12-03T08:35:13Z" +releaseNotes: "## Python SDK Changes:\n* `glean.agents.list_runs()`: **Added**\n* `glean.agents.list_versions()`: **Added**\n* `glean.agents.create_version()`: **Added**\n* `glean.agents.get_version()`: **Added**\n* `glean.agents.delete_version()`: **Added**\n* `glean.agents.create()`: \n * `request.draft` **Added**\n * `response.agent.is_draft` **Added**\n* `glean.agents.search()`: \n * `request` **Changed**\n * `response` **Changed**\n* `glean.agents.get()`: `response.agent.is_draft` **Added**\n* `glean.agents.update()`: \n * `request.draft` **Added**\n * `response.agent.is_draft` **Added**\n* `glean.admin.agents.list()`: `response.results[].is_draft` **Added**\n" generatedFiles: - .devcontainer/README.md - .devcontainer/devcontainer.json diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index ec308872c..50250b843 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -36,7 +36,7 @@ generation: generateNewTests: true skipResponseBodyAssertions: true python: - version: 0.18.2 + version: 0.18.3 additionalDependencies: dev: {} main: diff --git a/.speakeasy/glean-merged-spec.yaml b/.speakeasy/glean-merged-spec.yaml index 122563994..8e2c595db 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: 31ad03140234f66424854f64d0106442914e8fae - x-open-api-commit-sha: f55eff25e144e29e05f049264bcf2db6777b91d3 + x-source-commit-sha: 0c49d16a3e12b2bc1b633fcb6f63c90afe08d937 + x-open-api-commit-sha: cb746e81904ce8596a6d235257ad253e71bca962 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. @@ -37,7 +37,7 @@ paths: - Agents summary: Create agent description: | - Create and publish an agent from its complete definition. + Create an agent from its complete definition. The agent is published unless `draft` is true. operationId: platform-agents-create x-glean-scopes: legacy: @@ -60,7 +60,7 @@ paths: $ref: "#/components/schemas/PlatformAgentCreateRequest" responses: "201": - description: Agent created and published. + description: Agent created. content: application/json: schema: @@ -97,7 +97,7 @@ paths: - Agents summary: Search agents description: | - Search agents available to the authenticated user by agent name. + Search agents available to the authenticated user by agent name. Results come one page at a time. When has_more is true, send next_cursor as cursor, with the same name, to get the next page. operationId: platform-agents-search x-glean-scopes: legacy: @@ -200,7 +200,7 @@ paths: - Agents summary: Update agent description: | - Update and publish an agent. Supplied fields replace their saved values and omitted fields are kept. + Update an agent. Supplied fields replace their saved values, and omitted fields are kept. Updates to a published agent are published. Updates to a draft agent stay in its draft until `draft` is false. operationId: platform-agents-update x-glean-scopes: legacy: @@ -231,7 +231,7 @@ paths: $ref: "#/components/schemas/PlatformAgentUpdateRequest" responses: "200": - description: Agent updated and published. + description: Agent updated. content: application/json: schema: @@ -370,6 +370,76 @@ paths: security: - APIToken: [] /api/agents/{agent_id}/runs: + get: + tags: + - Agents + summary: List agent runs + description: | + List the authenticated user's persisted runs of an agent, newest first. Each result holds run metadata only + operationId: platform-agents-list-runs + x-glean-scopes: + legacy: + - AGENTS + platform: + - agents:run + x-visibility: Public + x-glean-release: + stage: beta + introduced: "2026-12-01" + parameters: + - in: path + name: agent_id + description: ID of the agent whose runs should be listed. + required: true + example: "{agent_id}" + schema: + type: string + minLength: 1 + maxLength: 256 + - in: query + name: page_size + description: Maximum number of runs to return. Defaults to 50. Maximum is 100. + required: false + schema: + type: integer + minimum: 1 + maximum: 100 + default: 50 + - in: query + name: cursor + description: | + Opaque pagination cursor from a previous response. Send it with the same agent_id that the previous request used. + required: false + schema: + type: string + minLength: 1 + responses: + "200": + description: Successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/PlatformListAgentRunsResponse" + "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: listRuns + security: + - APIToken: [] post: tags: - Agents @@ -643,6 +713,258 @@ paths: x-speakeasy-name-override: respondToRun security: - APIToken: [] + /api/agents/{agent_id}/versions: + get: + tags: + - Agents + summary: List agent versions + description: | + List saved versions of an agent, newest first. Requires permission to edit the agent. + operationId: platform-agents-list-versions + x-glean-scopes: + legacy: + - AGENTS + platform: + - agents:read + x-visibility: Public + x-glean-release: + stage: beta + introduced: "2026-11-26" + parameters: + - in: path + name: agent_id + description: ID of the agent whose versions to list. + required: true + example: "{agent_id}" + schema: + type: string + minLength: 1 + - in: query + name: page_size + description: Maximum number of versions to return. Defaults to 20. Maximum is 50. + required: false + schema: + type: integer + minimum: 1 + maximum: 50 + default: 20 + - in: query + name: cursor + description: Opaque pagination cursor returned as next_cursor by the previous page. + required: false + schema: + type: string + minLength: 1 + responses: + "200": + description: Successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/PlatformAgentVersionsListResponse" + "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: listVersions + security: + - APIToken: [] + post: + tags: + - Agents + summary: Create agent version + description: | + Save a complete agent as a named version without publishing it. The agent's published definition is unchanged. When the agent already has 50 saved versions, the oldest one is deleted. Requires permission to edit the agent. + operationId: platform-agents-create-version + x-glean-scopes: + legacy: + - AGENTS + platform: + - agents:write + x-visibility: Public + x-glean-release: + stage: beta + introduced: "2026-11-26" + x-codegen-request-body-name: payload + parameters: + - in: path + name: agent_id + description: ID of the agent to save a version of. + required: true + example: "{agent_id}" + schema: + type: string + minLength: 1 + requestBody: + required: true + content: + application/json: + example: + display_name: Stricter HR policy wording + agent: + name: HR Policy Agent + instructions: Answer only from the 2026 HR policy handbook. + schema: + $ref: "#/components/schemas/PlatformAgentVersionCreateRequest" + responses: + "201": + description: Agent version created. + content: + application/json: + schema: + $ref: "#/components/schemas/PlatformAgentVersionGetResponse" + "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" + "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: createVersion + security: + - APIToken: [] + /api/agents/{agent_id}/versions/{version_id}: + get: + tags: + - Agents + summary: Get agent version + description: | + Retrieve a saved version of an agent, including the complete agent it saved. + operationId: platform-agents-get-version + x-glean-scopes: + legacy: + - AGENTS + platform: + - agents:read + x-visibility: Public + x-glean-release: + stage: beta + introduced: "2026-11-26" + parameters: + - in: path + name: agent_id + description: ID of the agent. + required: true + example: "{agent_id}" + schema: + type: string + minLength: 1 + - in: path + name: version_id + description: Opaque ID of the agent version to retrieve, as returned by List agent versions. + required: true + example: "{version_id}" + schema: + type: string + minLength: 1 + responses: + "200": + description: Successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/PlatformAgentVersionGetResponse" + "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: getVersion + security: + - APIToken: [] + delete: + tags: + - Agents + summary: Delete agent version + description: | + Delete a saved version of an agent. The agent itself is unchanged. Requires permission to edit the agent. + operationId: platform-agents-delete-version + x-glean-scopes: + legacy: + - AGENTS + platform: + - agents:write + x-visibility: Public + x-glean-release: + stage: beta + introduced: "2026-11-26" + parameters: + - in: path + name: agent_id + description: ID of the agent. + required: true + example: "{agent_id}" + schema: + type: string + minLength: 1 + - in: path + name: version_id + description: Opaque ID of the agent version to delete, as returned by List agent versions. + required: true + example: "{version_id}" + schema: + type: string + minLength: 1 + responses: + "204": + description: Agent version deleted. + "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: deleteVersion + security: + - APIToken: [] /api/chat: post: tags: @@ -2620,7 +2942,7 @@ paths: stage: beta introduced: "2026-09-25" description: | - Requires usage.limit_increase_requests:read. The collection is limited to the authenticated canonical user's requests, including resolved requests. Cursors bind the filters and current authorization context; a billing grant cannot widen results. Supported token issuance, experimental opt-in, and request-more enablement are required. Missing opt-in or a disabled flag returns 404. + Requires usage.limit_increase_requests:read. The collection is limited to the authenticated canonical user's requests, including resolved requests. Cursors bind the filters and current authorization context; a billing grant cannot widen results. Supported token issuance, experimental opt-in, and request-more enablement are required. Missing opt-in or a disabled flag returns 404. A page leaves out a stored request that this API cannot represent; reading that request by identifier returns 503. parameters: - $ref: "#/components/parameters/PageSize" description: Maximum page size; defaults to 20 and cannot exceed 100. @@ -2800,7 +3122,7 @@ paths: stage: beta introduced: "2026-09-25" description: | - Requires admin.usage.limit_increase_requests:read and current workspace billing read permission. Agent ownership is not queue access. Cursors bind filters and current authorization context. Supported token issuance, experimental opt-in, and request-more enablement are required. Missing opt-in or a disabled flag returns 404, not a successful empty page. + Requires admin.usage.limit_increase_requests:read and current workspace billing read permission. Agent ownership is not queue access. Cursors bind filters and current authorization context. Supported token issuance, experimental opt-in, and request-more enablement are required. Missing opt-in or a disabled flag returns 404, not a successful empty page. A page leaves out a stored request that this API cannot represent; reading that request by identifier returns 503. parameters: - $ref: "#/components/parameters/PageSize" description: Maximum page size; defaults to 20 and cannot exceed 100. @@ -2970,7 +3292,7 @@ paths: - OAuth clients summary: List OAuth clients description: | - List the static OAuth clients that admins created for this workspace, ordered by display_name and then by client_id. Dynamically registered clients and Glean's own clients, such as Glean Desktop, are not listed. Disabled clients are left out unless an is_enabled filter includes the value "false". Use filters to find clients by name, client_id, usage_client_id, LLM Gateway access, or supported app. To set a usage limit for a client, send its ai_gateway.usage_client_id, not its client_id, to the usage APIs. The caller needs admin read or billing read permission. + List the static OAuth clients that admins created for this workspace, ordered by display_name and then by client_id. Only about the first 2 KB of a name is compared, less when client_id is long, so names that share that leading part are ordered by client_id. Dynamically registered clients and Glean's own clients, such as Glean Desktop, are not listed. Disabled clients are left out unless an is_enabled filter includes the value "false". Use filters to find clients by name, client_id, usage_client_id, LLM Gateway access, or supported app. To set a usage limit for a client, send its ai_gateway.usage_client_id, not its client_id, to the usage APIs. The caller needs admin read or billing read permission. operationId: platform-admin-oauth-clients-list x-glean-scopes: legacy: @@ -3096,7 +3418,7 @@ paths: - Departments summary: List departments description: | - List the departments in the Glean directory, ordered by display_name and then by department_id. The list includes every department that at least one user belongs to or that a usage limit names, so a caller can show the name of a department that a usage limit still names after its users leave it. Department names are exact, so names that differ only by case are different departments. Send a name filter to return only the departments whose display_name contains a value. + List the departments in the Glean directory, ordered by display_name and then by department_id. Only about the first 2 KB of a name is compared, less when department_id is long, so names that share that leading part are ordered by department_id. The list includes every department that at least one user belongs to or that a usage limit names, so a caller can show the name of a department that a usage limit still names after its users leave it. Department names are exact, so names that differ only by case are different departments. Send a name filter to return only the departments whose display_name contains a value. operationId: platform-departments-list x-glean-scopes: legacy: @@ -3234,7 +3556,7 @@ paths: - IdP Groups summary: List IdP groups description: | - List the identity provider (IdP) groups that Glean loads from the directory, ordered by display_name and then by idp_group_id. Use idp_group_id to name a group in other Platform APIs, such as the usage limit evaluation and limit increase request APIs. Usage limits apply only to IdP groups from the datasource instance in usage_settings.user_grouping.idp_group_provider_instance of the get usage settings response, and this API always lists that instance's groups. To list only those groups, pass that value in a provider_instance filter of the filters parameter, for example `filters=[{"field":"provider_instance","operator":"EQUALS","values":["okta"]}]`, URL-encoded as `filters=%5B%7B%22field%22%3A%22provider_instance%22%2C%22operator%22%3A%22EQUALS%22%2C%22values%22%3A%5B%22okta%22%5D%7D%5D`. Send a provider filter to list only one provider's groups, and a name filter to list only the groups whose display_name contains a value. Internal O365 ownership groups and SharePoint groups are left out. The caller must be able to read the workspace configuration or the workspace billing. + List the identity provider (IdP) groups that Glean loads from the directory, ordered by display_name and then by idp_group_id. Only about the first 2 KB of a name is compared, less when idp_group_id is long, so names that share that leading part are ordered by idp_group_id. Use idp_group_id to name a group in other Platform APIs, such as the usage limit evaluation and limit increase request APIs. Usage limits apply only to IdP groups from the datasource instance in usage_settings.user_grouping.idp_group_provider_instance of the get usage settings response, and this API always lists that instance's groups. To list only those groups, pass that value in a provider_instance filter of the filters parameter, for example `filters=[{"field":"provider_instance","operator":"EQUALS","values":["okta"]}]`, URL-encoded as `filters=%5B%7B%22field%22%3A%22provider_instance%22%2C%22operator%22%3A%22EQUALS%22%2C%22values%22%3A%5B%22okta%22%5D%7D%5D`. Send a provider filter to list only one provider's groups, and a name filter to list only the groups whose display_name contains a value. Internal O365 ownership groups and SharePoint groups are left out. The caller must be able to read the workspace configuration or the workspace billing. operationId: platform-admin-idp-groups-list x-glean-scopes: legacy: @@ -3421,7 +3743,7 @@ paths: - Users summary: List users description: | - List the users in the Glean directory, ordered by display_name and then by user_id. The list includes the same people as the Glean People directory. Filter by name, email, manager_id, or department_id to find specific users. Use the returned user_id values with other Platform APIs, for example as usage limit targets. + List the users in the Glean directory, ordered by display_name and then by user_id. Only about the first 2 KB of a name is compared, less when user_id is long, so names that share that leading part are ordered by user_id. The list includes the same people as the Glean People directory. Filter by name, email, manager_id, or department_id to find specific users. Use the returned user_id values with other Platform APIs, for example as usage limit targets. operationId: platform-users-list x-glean-scopes: legacy: @@ -3598,7 +3920,7 @@ paths: - Admin Agents summary: List all agents description: | - List every agent in the workspace, ordered by name and then by agent_id. Each agent has the same shape that Get agent returns. Unlike agent search, the list does not depend on who an agent is shared with, so it includes private and disabled agents. Deleted agents are left out. Use the agent_id with other Platform APIs, for example as a usage limit target. The caller must be able to read all agents, administer agents, or read workspace billing. + List every agent in the workspace, ordered by name and then by agent_id. Only about the first 2 KB of a name is compared, less when agent_id is long, so names that share that leading part are ordered by agent_id. Each agent has the same shape that Get agent returns. Unlike agent search, the list does not depend on who an agent is shared with, so it includes private and disabled agents. Deleted agents are left out. Use the agent_id with other Platform APIs, for example as a usage limit target. The caller must be able to read all agents, administer agents, or read workspace billing. operationId: platform-admin-agents-list x-glean-scopes: legacy: @@ -10440,6 +10762,11 @@ components: $ref: "#/components/schemas/PlatformSubagent" trigger: $ref: "#/components/schemas/PlatformAgentTrigger" + draft: + type: boolean + default: false + description: | + Whether to save the agent as an unpublished draft instead of publishing it. PlatformAgentCapabilities: type: object additionalProperties: true @@ -10495,6 +10822,10 @@ components: $ref: "#/components/schemas/PlatformSubagent" trigger: $ref: "#/components/schemas/PlatformAgentTrigger" + is_draft: + type: boolean + description: | + Whether the agent is an unpublished draft that has never been published. Omitted for a published agent. created_by: $ref: "#/components/schemas/PlatformPersonReference" description: Person who created the agent. Omitted when the agent hides attribution. @@ -10696,17 +11027,38 @@ components: type: string description: Case-insensitive substring to match against agent names. If omitted or empty, no name filter is applied. example: HR Policy Agent + page_size: + type: integer + minimum: 1 + maximum: 100 + default: 100 + description: Maximum number of agents to return. Defaults to 100. Maximum is 100. + cursor: + type: string + minLength: 1 + description: | + Opaque pagination cursor from a previous response. Send the same name that the previous request used. + example: "" PlatformAgentsSearchResponse: type: object required: - agents + - has_more - request_id properties: agents: type: array - description: Agents matching the search request. + description: Agents on this page that match the search request. items: $ref: "#/components/schemas/PlatformAgent" + has_more: + type: boolean + description: Whether more matching agents are available after this page. + next_cursor: + type: + - string + - "null" + description: Opaque cursor for the next page; null or absent when has_more is false. request_id: type: string description: Platform-generated request ID for support correlation. @@ -10776,6 +11128,10 @@ components: $ref: "#/components/schemas/PlatformAgentTrigger" description: | How the agent is invoked. Applies to top-level agents only. The supplied object replaces the entire saved trigger, including its input fields, prompts, and content filters, so omitted fields are removed. + draft: + type: boolean + description: | + Whether the update is saved as an unpublished draft. Defaults to the agent's current state. `false` publishes a draft agent. `true` isn't allowed for a published agent. PlatformActionSummary: type: object required: @@ -10833,6 +11189,82 @@ 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. + PlatformAgentRunTrigger: + type: string + enum: + - MANUAL + - SCHEDULE + - CONTENT_CHANGE + - CONTENT_SCHEDULE + description: | + What started an agent run. MANUAL is a user or API request, SCHEDULE is a recurring schedule, CONTENT_CHANGE is a change to indexed content, and CONTENT_SCHEDULE is a time relative to a content event such as a meeting. + PlatformAgentRunSummary: + type: object + description: Metadata of a persisted agent run, without its output or pending approvals. + additionalProperties: false + required: + - run_id + - agent_id + - state + - created_at + properties: + run_id: + type: string + description: ID of the run. Use it with the agent-scoped GET run endpoint. + agent_id: + type: string + description: ID of the agent that owns the run. + state: + $ref: "#/components/schemas/PlatformAgentRunState" + description: Stored lifecycle state of the run. + created_at: + type: string + format: date-time + description: Timestamp when the run was first persisted. + ended_at: + type: string + format: date-time + description: Timestamp when the run reached SUCCEEDED, FAILED, or CANCELLED. Omitted in other states. + triggered_by: + $ref: "#/components/schemas/PlatformAgentRunTrigger" + description: What started the run. Omitted when the run did not record it. + PlatformListAgentRunsResponse: + type: object + description: One page of the authenticated user's runs of an agent. + additionalProperties: false + required: + - results + - has_more + - request_id + properties: + results: + type: array + description: The runs on this page, newest first, ordered by created_at and then by run_id. + items: + $ref: "#/components/schemas/PlatformAgentRunSummary" + has_more: + type: boolean + description: Whether more runs are available after this page. + next_cursor: + type: + - string + - "null" + description: Opaque cursor for the next page; null or absent when has_more is false. + request_id: + type: string + description: Request identifier for correlating this response. PlatformMessageRole: type: string description: Role of the message author. @@ -11218,18 +11650,6 @@ components: mapping: message: "#/components/schemas/PlatformAgentRunMessageEvent" run.failed: "#/components/schemas/PlatformAgentRunFailedEvent" - 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. @@ -11419,6 +11839,93 @@ components: description: One decision per pending interaction. Interaction IDs must be unique. items: $ref: "#/components/schemas/PlatformAgentRunApprovalDecision" + PlatformAgentVersion: + type: object + description: A named, immutable snapshot of an agent. + required: + - version_id + - display_name + - created_at + properties: + version_id: + type: string + description: | + Opaque ID of the version, unique within the agent. It is not an ordinal; do not sort or compare IDs. + display_name: + type: string + description: Name given to the version when it was created. + created_at: + type: string + format: date-time + description: Time the version was created. + PlatformAgentVersionsListResponse: + type: object + description: One page of saved versions of an agent. + additionalProperties: false + required: + - results + - has_more + - request_id + properties: + results: + type: array + description: Versions of the agent, newest first. + items: + $ref: "#/components/schemas/PlatformAgentVersion" + has_more: + type: boolean + description: Whether more versions are available after this page. + next_cursor: + type: + - string + - "null" + description: Opaque cursor for the next page; null or absent when has_more is false. + request_id: + type: string + description: Platform-generated request ID for support correlation. + PlatformAgentVersionCreateRequest: + type: object + description: Complete agent to save and the name of the version. + additionalProperties: false + required: + - display_name + - agent + properties: + display_name: + type: string + minLength: 1 + maxLength: 255 + description: Name of the version. Leading and trailing whitespace is removed. + agent: + $ref: "#/components/schemas/PlatformAgentCreateRequest" + description: | + Complete agent to save in the version, in the same shape as Create agent. Send every field, not only the changed ones; omitted fields are not copied from the agent. For example, omitting `glean_search_config` saves the version with Glean Search off, and omitting `model.auto_upgrade` applies its default. The version keeps the agent's `use_agent_identity`. Sending `true` for an agent that does not use its own identity returns 400. + PlatformAgentVersionWithDefinition: + description: A saved version of an agent and the complete agent it saved. + allOf: + - $ref: "#/components/schemas/PlatformAgentVersion" + - type: object + required: + - agent + properties: + agent: + $ref: "#/components/schemas/PlatformAgent" + description: | + The agent as saved in this version. Audit fields are omitted; the version's creation time is on the version. + PlatformAgentVersionGetResponse: + type: object + description: A saved version of an agent. + additionalProperties: false + required: + - version + - request_id + properties: + version: + $ref: "#/components/schemas/PlatformAgentVersionWithDefinition" + description: The saved version. + request_id: + type: string + description: Platform-generated request ID for support correlation. PlatformChatInputMessage: type: object additionalProperties: false @@ -15003,7 +15510,7 @@ components: resolution_target: $ref: "#/components/schemas/PlatformRequestResolutionTarget" description: | - Stored approval breadth, only on approvals; older PERIOD approvals may omit it. + Stored approval breadth, only on approvals; older PERIOD approvals may omit it. AGENT ONGOING approvals, which raise the agent's own limit, always omit it. resolution_target_id: type: string description: | @@ -15020,8 +15527,31 @@ components: format: date-time description: Last stored update time; this is the resolution time for resolved requests. allOf: - - $ref: "#/components/schemas/PlatformRequestResolutionFields" - description: Shared resolution target and identifier pairings. + - description: Shared resolution pairings, or a stored AGENT ONGOING approval without a target. + oneOf: + - $ref: "#/components/schemas/PlatformRequestResolutionFields" + description: Shared resolution target and identifier pairings. + - description: A stored AGENT ONGOING approval raises the agent's own limit without a breadth. + required: + - entity_type + - scope + properties: + entity_type: + description: Agent request. + enum: + - AGENT + scope: + description: Ongoing approval. + enum: + - ONGOING + not: + anyOf: + - required: + - resolution_target + description: Detect a resolution target. + - required: + - resolution_target_id + description: Detect a resolution target identifier. - description: Status determines which approval fields are present. oneOf: - description: An approval always records its amount and scope. @@ -15435,7 +15965,8 @@ components: properties: results: type: array - description: The clients on this page, ordered by display_name and then by client_id. + description: | + The clients on this page, ordered by display_name and then by client_id. Only about the first 2 KB of a name is compared, less when client_id is long, so names that share that leading part are ordered by client_id. items: $ref: "#/components/schemas/PlatformOAuthClient" has_more: @@ -15523,7 +16054,7 @@ components: results: type: array description: | - The departments on this page, ordered by display_name and then by department_id. + The departments on this page, ordered by display_name and then by department_id. Only about the first 2 KB of a name is compared, less when department_id is long, so names that share that leading part are ordered by department_id. items: $ref: "#/components/schemas/PlatformDepartment" has_more: @@ -15632,7 +16163,7 @@ components: results: type: array description: | - The IdP groups on this page, ordered by display_name and then by idp_group_id. + The IdP groups on this page, ordered by display_name and then by idp_group_id. Only about the first 2 KB of a name is compared, less when idp_group_id is long, so names that share that leading part are ordered by idp_group_id. items: $ref: "#/components/schemas/PlatformIdpGroup" has_more: @@ -15842,7 +16373,8 @@ components: properties: results: type: array - description: The users on this page, ordered by display_name and then by user_id. + description: | + The users on this page, ordered by display_name and then by user_id. Only about the first 2 KB of a name is compared, less when user_id is long, so names that share that leading part are ordered by user_id. items: $ref: "#/components/schemas/PlatformUser" has_more: @@ -15924,7 +16456,8 @@ components: properties: results: type: array - description: The agents on this page, ordered by name and then by agent_id. + description: | + The agents on this page, ordered by name and then by agent_id. Only about the first 2 KB of a name is compared, less when agent_id is long, so names that share that leading part are ordered by agent_id. items: $ref: "#/components/schemas/PlatformAgent" has_more: diff --git a/.speakeasy/tests.arazzo.yaml b/.speakeasy/tests.arazzo.yaml index 3f1c25686..59a0940b7 100644 --- a/.speakeasy/tests.arazzo.yaml +++ b/.speakeasy/tests.arazzo.yaml @@ -158729,12 +158729,13 @@ workflows: contentType: application/json payload: name: HR Policy Agent + page_size: 100 successCriteria: - condition: $statusCode == 200 - condition: $response.header.Content-Type == application/json - context: $response.body condition: | - {"agents":[],"request_id":""} + {"agents":[],"has_more":true,"request_id":""} type: simple x-speakeasy-test-group: agents x-speakeasy-test-rebuild: true @@ -159816,6 +159817,7 @@ workflows: requestBody: contentType: application/json payload: + draft: false instructions: Answer employee questions about HR policies and benefits. name: HR Policy Agent successCriteria: @@ -159912,3 +159914,88 @@ workflows: type: simple x-speakeasy-test-group: client_chat x-speakeasy-test-rebuild: true + - workflowId: platform-agents-list-runs + steps: + - stepId: test + operationId: platform-agents-list-runs + parameters: + - name: agent_id + in: path + value: '{agent_id}' + - name: page_size + in: query + value: 50 + successCriteria: + - condition: $statusCode == 200 + - condition: $response.header.Content-Type == application/json + - context: $response.body + condition: | + {"results":[{"run_id":"","agent_id":"","state":"RUNNING","created_at":"2024-09-28T20:59:41.155Z"}],"has_more":false,"request_id":""} + type: simple + x-speakeasy-test-group: agents + x-speakeasy-test-rebuild: true + - workflowId: platform-agents-list-versions + steps: + - stepId: test + operationId: platform-agents-list-versions + parameters: + - name: agent_id + in: path + value: '{agent_id}' + - name: page_size + in: query + value: 20 + successCriteria: + - condition: $statusCode == 200 + - condition: $response.header.Content-Type == application/json + - context: $response.body + condition: | + {"results":[],"has_more":true,"request_id":""} + type: simple + x-speakeasy-test-group: agents + x-speakeasy-test-rebuild: true + - workflowId: platform-agents-create-version + steps: + - stepId: test + operationId: platform-agents-create-version + parameters: + - name: agent_id + in: path + value: '{agent_id}' + requestBody: + contentType: application/json + payload: + agent: + draft: false + instructions: Answer employee questions about HR policies and benefits. + name: HR Policy Agent + display_name: Caterina.Walsh + successCriteria: + - condition: $statusCode == 201 + - condition: $response.header.Content-Type == application/json + - context: $response.body + condition: | + {"version":{"version_id":"","display_name":"Imani_Lebsack","created_at":"2025-05-23T00:57:48.585Z","agent":{"name":"HR Policy Agent","agent_id":"ef33aecf52c142a6873adf76037b642e","capabilities":{},"subagents":[{"name":"HR Policy Agent"}]}},"request_id":""} + type: simple + x-speakeasy-test-group: agents + x-speakeasy-test-rebuild: true + - workflowId: platform-agents-get-version + steps: + - stepId: test + operationId: platform-agents-get-version + parameters: + - name: agent_id + in: path + value: '{agent_id}' + - name: version_id + in: path + value: '{version_id}' + successCriteria: + - condition: $statusCode == 200 + - condition: $response.header.Content-Type == application/json + - context: $response.body + condition: | + {"version":{"version_id":"","display_name":"Mauricio.Pouros72","created_at":"2025-04-07T11:45:00.644Z","agent":{"name":"HR Policy Agent","agent_id":"ef33aecf52c142a6873adf76037b642e","capabilities":{},"subagents":[{"name":"HR Policy Agent"}]}},"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 223588510..3b6597313 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.813.1 sources: Glean API: sourceNamespace: glean-api-specs - sourceRevisionDigest: sha256:9131f5e7e4df026356a1ea4c21ff018af9de5f7262878da2eeef4ed9b7cab02a - sourceBlobDigest: sha256:a2cbc5f3b13973c3bf3f9c191c68e5a66507d417b6f3a9f7b910e8d6e5dd463e + sourceRevisionDigest: sha256:fa9f8cbd7b67a758c0b334c6fb43eb149b982ea7721e744bc5376f23069ceecb + sourceBlobDigest: sha256:6536acba671d14534f874672473e35419ae67481066a5a576701c808efafe35f tags: - latest Glean Client API: @@ -16,10 +16,10 @@ targets: glean: source: Glean API sourceNamespace: glean-api-specs - sourceRevisionDigest: sha256:9131f5e7e4df026356a1ea4c21ff018af9de5f7262878da2eeef4ed9b7cab02a - sourceBlobDigest: sha256:a2cbc5f3b13973c3bf3f9c191c68e5a66507d417b6f3a9f7b910e8d6e5dd463e + sourceRevisionDigest: sha256:fa9f8cbd7b67a758c0b334c6fb43eb149b982ea7721e744bc5376f23069ceecb + sourceBlobDigest: sha256:6536acba671d14534f874672473e35419ae67481066a5a576701c808efafe35f codeSamplesNamespace: glean-api-specs-python-code-samples - codeSamplesRevisionDigest: sha256:c27b9ec36a1513cc5259f05b576572f3ef648e31a6aa464948ec088be72ad3e3 + codeSamplesRevisionDigest: sha256:5ccd6c7540d04da6b5ef69b333ef6eded6aac18c445893c6dd3ef23427b0c3a9 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index c29018cf0..c7180ddc8 100644 --- a/README.md +++ b/README.md @@ -276,7 +276,7 @@ with Glean( { "name": "HR Policy Agent", }, - ]) + ], draft=False) # Handle response print(res) @@ -341,10 +341,15 @@ For more information on obtaining the appropriate token type, please contact you * [update](docs/sdks/agents/README.md#update) - Update agent * [delete](docs/sdks/agents/README.md#delete) - Delete agent * [get_schemas](docs/sdks/agents/README.md#get_schemas) - Get agent schemas +* [list_runs](docs/sdks/agents/README.md#list_runs) - List agent runs * [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 * [respond_to_run](docs/sdks/agents/README.md#respond_to_run) - Respond to agent run approvals +* [list_versions](docs/sdks/agents/README.md#list_versions) - List agent versions +* [create_version](docs/sdks/agents/README.md#create_version) - Create agent version +* [get_version](docs/sdks/agents/README.md#get_version) - Get agent version +* [delete_version](docs/sdks/agents/README.md#delete_version) - Delete agent version * [create_run_stream](docs/sdks/agents/README.md#create_run_stream) - Create a streaming agent run ### [Anonymousauthtokens](docs/sdks/anonymousauthtokens/README.md) @@ -741,7 +746,7 @@ with Glean( { "name": "HR Policy Agent", }, - ], + ], draft=False, RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False)) # Handle response @@ -765,7 +770,7 @@ with Glean( { "name": "HR Policy Agent", }, - ]) + ], draft=False) # Handle response print(res) @@ -885,7 +890,7 @@ with Glean( { "name": "HR Policy Agent", }, - ]) + ], draft=False) # Handle response print(res) @@ -909,7 +914,7 @@ with Glean( { "name": "HR Policy Agent", }, - ]) + ], draft=False) # Handle response print(res) diff --git a/RELEASES.md b/RELEASES.md index 8fec7c98d..14f8fab78 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1128,4 +1128,14 @@ Based on: ### Generated - [python v0.18.2] . ### Releases -- [PyPI v0.18.2] https://pypi.org/project/glean-api-client/0.18.2 - . \ No newline at end of file +- [PyPI v0.18.2] https://pypi.org/project/glean-api-client/0.18.2 - . + +## 2026-12-03 08:34:24 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.813.1 (2.969.4) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.18.3] . +### Releases +- [PyPI v0.18.3] https://pypi.org/project/glean-api-client/0.18.3 - . \ No newline at end of file diff --git a/docs/models/platformagent.md b/docs/models/platformagent.md index 510c0f419..b638644e7 100644 --- a/docs/models/platformagent.md +++ b/docs/models/platformagent.md @@ -23,6 +23,7 @@ An agent available to the authenticated user. | `channels` | [Optional[models.PlatformAgentChannels]](../models/platformagentchannels.md) | :heavy_minus_sign: | Messaging channels the agent is deployed to. Requires `use_agent_identity`. | | | `subagents` | List[[models.PlatformSubagent](../models/platformsubagent.md)] | :heavy_minus_sign: | Subagents the agent dispatches work to. Subagents cannot contain subagents.
| | | `trigger` | [Optional[models.PlatformAgentTrigger]](../models/platformagenttrigger.md) | :heavy_minus_sign: | How the agent is invoked. Applies to top-level agents only. | | +| `is_draft` | *Optional[bool]* | :heavy_minus_sign: | Whether the agent is an unpublished draft that has never been published. Omitted for a published agent.
| | | `created_by` | [Optional[models.PlatformPersonReference]](../models/platformpersonreference.md) | :heavy_minus_sign: | A lightweight reference to a person, used where a payload merely points at someone. | | | `updated_by` | [Optional[models.PlatformPersonReference]](../models/platformpersonreference.md) | :heavy_minus_sign: | A lightweight reference to a person, used where a payload merely points at someone. | | | `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Time the agent was created. | | diff --git a/docs/models/platformagentcreaterequest.md b/docs/models/platformagentcreaterequest.md index aa9558517..ce07c1d7e 100644 --- a/docs/models/platformagentcreaterequest.md +++ b/docs/models/platformagentcreaterequest.md @@ -19,4 +19,5 @@ Complete agent definition. | `use_agent_identity` | *Optional[bool]* | :heavy_minus_sign: | Whether the agent acts with its own identity instead of the invoking user's. Cannot be changed after the agent is created.
| | | `channels` | [Optional[models.PlatformAgentChannels]](../models/platformagentchannels.md) | :heavy_minus_sign: | Messaging channels the agent is deployed to. Requires `use_agent_identity`. | | | `subagents` | List[[models.PlatformSubagent](../models/platformsubagent.md)] | :heavy_minus_sign: | Subagents the agent dispatches work to. Subagents cannot contain subagents, and their dependencies may only reference published skills.
| | -| `trigger` | [Optional[models.PlatformAgentTrigger]](../models/platformagenttrigger.md) | :heavy_minus_sign: | How the agent is invoked. Applies to top-level agents only. | | \ No newline at end of file +| `trigger` | [Optional[models.PlatformAgentTrigger]](../models/platformagenttrigger.md) | :heavy_minus_sign: | How the agent is invoked. Applies to top-level agents only. | | +| `draft` | *Optional[bool]* | :heavy_minus_sign: | Whether to save the agent as an unpublished draft instead of publishing it.
| | \ No newline at end of file diff --git a/docs/models/platformagentrunsummary.md b/docs/models/platformagentrunsummary.md new file mode 100644 index 000000000..d62e1d7bc --- /dev/null +++ b/docs/models/platformagentrunsummary.md @@ -0,0 +1,15 @@ +# PlatformAgentRunSummary + +Metadata of a persisted agent run, without its output or pending approvals. + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `run_id` | *str* | :heavy_check_mark: | ID of the run. Use it with the agent-scoped GET run endpoint. | +| `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. | +| `ended_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Timestamp when the run reached SUCCEEDED, FAILED, or CANCELLED. Omitted in other states. | +| `triggered_by` | [Optional[models.PlatformAgentRunTrigger]](../models/platformagentruntrigger.md) | :heavy_minus_sign: | What started an agent run. MANUAL is a user or API request, SCHEDULE is a recurring schedule, CONTENT_CHANGE is a change to indexed content, and CONTENT_SCHEDULE is a time relative to a content event such as a meeting.
| \ No newline at end of file diff --git a/docs/models/platformagentruntrigger.md b/docs/models/platformagentruntrigger.md new file mode 100644 index 000000000..de105d7ae --- /dev/null +++ b/docs/models/platformagentruntrigger.md @@ -0,0 +1,24 @@ +# PlatformAgentRunTrigger + +What started an agent run. MANUAL is a user or API request, SCHEDULE is a recurring schedule, CONTENT_CHANGE is a change to indexed content, and CONTENT_SCHEDULE is a time relative to a content event such as a meeting. + + +## Example Usage + +```python +from glean.api_client.models import PlatformAgentRunTrigger + +value = PlatformAgentRunTrigger.MANUAL + +# Open enum: unrecognized values are captured as UnrecognizedStr +``` + + +## Values + +| Name | Value | +| ------------------ | ------------------ | +| `MANUAL` | MANUAL | +| `SCHEDULE` | SCHEDULE | +| `CONTENT_CHANGE` | CONTENT_CHANGE | +| `CONTENT_SCHEDULE` | CONTENT_SCHEDULE | \ No newline at end of file diff --git a/docs/models/platformagentscreateversionrequest.md b/docs/models/platformagentscreateversionrequest.md new file mode 100644 index 000000000..3a9d18acc --- /dev/null +++ b/docs/models/platformagentscreateversionrequest.md @@ -0,0 +1,9 @@ +# PlatformAgentsCreateVersionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `agent_id` | *str* | :heavy_check_mark: | ID of the agent to save a version of. | {agent_id} | +| `platform_agent_version_create_request` | [models.PlatformAgentVersionCreateRequest](../models/platformagentversioncreaterequest.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/platformagentsdeleteversionrequest.md b/docs/models/platformagentsdeleteversionrequest.md new file mode 100644 index 000000000..14d98f585 --- /dev/null +++ b/docs/models/platformagentsdeleteversionrequest.md @@ -0,0 +1,9 @@ +# PlatformAgentsDeleteVersionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| `agent_id` | *str* | :heavy_check_mark: | ID of the agent. | {agent_id} | +| `version_id` | *str* | :heavy_check_mark: | Opaque ID of the agent version to delete, as returned by List agent versions. | {version_id} | \ No newline at end of file diff --git a/docs/models/platformagentsgetversionrequest.md b/docs/models/platformagentsgetversionrequest.md new file mode 100644 index 000000000..44f4a9751 --- /dev/null +++ b/docs/models/platformagentsgetversionrequest.md @@ -0,0 +1,9 @@ +# PlatformAgentsGetVersionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | +| `agent_id` | *str* | :heavy_check_mark: | ID of the agent. | {agent_id} | +| `version_id` | *str* | :heavy_check_mark: | Opaque ID of the agent version to retrieve, as returned by List agent versions. | {version_id} | \ No newline at end of file diff --git a/docs/models/platformagentslistrunsrequest.md b/docs/models/platformagentslistrunsrequest.md new file mode 100644 index 000000000..bf9f1871e --- /dev/null +++ b/docs/models/platformagentslistrunsrequest.md @@ -0,0 +1,10 @@ +# PlatformAgentsListRunsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `agent_id` | *str* | :heavy_check_mark: | ID of the agent whose runs should be listed. | {agent_id} | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | Maximum number of runs to return. Defaults to 50. Maximum is 100. | | +| `cursor` | *Optional[str]* | :heavy_minus_sign: | Opaque pagination cursor from a previous response. Send it with the same agent_id that the previous request used.
| | \ No newline at end of file diff --git a/docs/models/platformagentslistversionsrequest.md b/docs/models/platformagentslistversionsrequest.md new file mode 100644 index 000000000..01b6c40e7 --- /dev/null +++ b/docs/models/platformagentslistversionsrequest.md @@ -0,0 +1,10 @@ +# PlatformAgentsListVersionsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `agent_id` | *str* | :heavy_check_mark: | ID of the agent whose versions to list. | {agent_id} | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | Maximum number of versions to return. Defaults to 20. Maximum is 50. | | +| `cursor` | *Optional[str]* | :heavy_minus_sign: | Opaque pagination cursor returned as next_cursor by the previous page. | | \ No newline at end of file diff --git a/docs/models/platformagentssearchrequest.md b/docs/models/platformagentssearchrequest.md index 381dc6be5..ab886096a 100644 --- a/docs/models/platformagentssearchrequest.md +++ b/docs/models/platformagentssearchrequest.md @@ -5,4 +5,6 @@ | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -| `name` | *Optional[str]* | :heavy_minus_sign: | Case-insensitive substring to match against agent names. If omitted or empty, no name filter is applied. | HR Policy Agent | \ No newline at end of file +| `name` | *Optional[str]* | :heavy_minus_sign: | Case-insensitive substring to match against agent names. If omitted or empty, no name filter is applied. | HR Policy Agent | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | Maximum number of agents to return. Defaults to 100. Maximum is 100. | | +| `cursor` | *Optional[str]* | :heavy_minus_sign: | Opaque pagination cursor from a previous response. Send the same name that the previous request used.
| | \ No newline at end of file diff --git a/docs/models/platformagentssearchresponse.md b/docs/models/platformagentssearchresponse.md index 1c9618156..d1d509d4f 100644 --- a/docs/models/platformagentssearchresponse.md +++ b/docs/models/platformagentssearchresponse.md @@ -3,7 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -| `agents` | List[[models.PlatformAgent](../models/platformagent.md)] | :heavy_check_mark: | Agents matching the search request. | -| `request_id` | *str* | :heavy_check_mark: | Platform-generated request ID for support correlation. | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `agents` | List[[models.PlatformAgent](../models/platformagent.md)] | :heavy_check_mark: | Agents on this page that match the search request. | +| `has_more` | *bool* | :heavy_check_mark: | Whether more matching agents are available after this page. | +| `next_cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Opaque cursor for the next page; null or absent when has_more is false. | +| `request_id` | *str* | :heavy_check_mark: | Platform-generated request ID for support correlation. | \ No newline at end of file diff --git a/docs/models/platformagentupdaterequest.md b/docs/models/platformagentupdaterequest.md index 35f1f089a..e838aaace 100644 --- a/docs/models/platformagentupdaterequest.md +++ b/docs/models/platformagentupdaterequest.md @@ -19,4 +19,5 @@ Agent fields to change. At least one field is required. Each supplied field repl | `service_credentials` | List[[models.PlatformAgentServiceCredential](../models/platformagentservicecredential.md)] | :heavy_minus_sign: | Service credentials the agent uses to call tools. The supplied list replaces the entire saved list.
| | `channels` | [Optional[models.PlatformAgentChannels]](../models/platformagentchannels.md) | :heavy_minus_sign: | Messaging channels the agent is deployed to. Requires `use_agent_identity`. | | `subagents` | List[[models.PlatformSubagent](../models/platformsubagent.md)] | :heavy_minus_sign: | Subagents the agent dispatches work to. Subagents cannot contain subagents. The supplied list replaces the entire saved list, so saved subagents left out are removed. Keep a saved subagent's `subagent_id` to preserve it, and omit `subagent_id` to add a subagent.
| -| `trigger` | [Optional[models.PlatformAgentTrigger]](../models/platformagenttrigger.md) | :heavy_minus_sign: | How the agent is invoked. Applies to top-level agents only. | \ No newline at end of file +| `trigger` | [Optional[models.PlatformAgentTrigger]](../models/platformagenttrigger.md) | :heavy_minus_sign: | How the agent is invoked. Applies to top-level agents only. | +| `draft` | *Optional[bool]* | :heavy_minus_sign: | Whether the update is saved as an unpublished draft. Defaults to the agent's current state. `false` publishes a draft agent. `true` isn't allowed for a published agent.
| \ No newline at end of file diff --git a/docs/models/platformagentversion.md b/docs/models/platformagentversion.md new file mode 100644 index 000000000..e65dc3368 --- /dev/null +++ b/docs/models/platformagentversion.md @@ -0,0 +1,12 @@ +# PlatformAgentVersion + +A named, immutable snapshot of an agent. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `version_id` | *str* | :heavy_check_mark: | Opaque ID of the version, unique within the agent. It is not an ordinal; do not sort or compare IDs.
| +| `display_name` | *str* | :heavy_check_mark: | Name given to the version when it was created. | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Time the version was created. | \ No newline at end of file diff --git a/docs/models/platformagentversioncreaterequest.md b/docs/models/platformagentversioncreaterequest.md new file mode 100644 index 000000000..d2afde3c5 --- /dev/null +++ b/docs/models/platformagentversioncreaterequest.md @@ -0,0 +1,11 @@ +# PlatformAgentVersionCreateRequest + +Complete agent to save and the name of the version. + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `display_name` | *str* | :heavy_check_mark: | Name of the version. Leading and trailing whitespace is removed. | | +| `agent` | [models.PlatformAgentCreateRequest](../models/platformagentcreaterequest.md) | :heavy_check_mark: | Complete agent definition. | {
"name": "HR Policy Agent",
"instructions": "Answer employee questions about HR policies and benefits."
} | \ No newline at end of file diff --git a/docs/models/platformagentversiongetresponse.md b/docs/models/platformagentversiongetresponse.md new file mode 100644 index 000000000..f0a68595d --- /dev/null +++ b/docs/models/platformagentversiongetresponse.md @@ -0,0 +1,11 @@ +# PlatformAgentVersionGetResponse + +A saved version of an agent. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `version` | [models.PlatformAgentVersionWithDefinition](../models/platformagentversionwithdefinition.md) | :heavy_check_mark: | A saved version of an agent and the complete agent it saved. | +| `request_id` | *str* | :heavy_check_mark: | Platform-generated request ID for support correlation. | \ No newline at end of file diff --git a/docs/models/platformagentversionslistresponse.md b/docs/models/platformagentversionslistresponse.md new file mode 100644 index 000000000..930a789ea --- /dev/null +++ b/docs/models/platformagentversionslistresponse.md @@ -0,0 +1,13 @@ +# PlatformAgentVersionsListResponse + +One page of saved versions of an agent. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `results` | List[[models.PlatformAgentVersion](../models/platformagentversion.md)] | :heavy_check_mark: | Versions of the agent, newest first. | +| `has_more` | *bool* | :heavy_check_mark: | Whether more versions are available after this page. | +| `next_cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Opaque cursor for the next page; null or absent when has_more is false. | +| `request_id` | *str* | :heavy_check_mark: | Platform-generated request ID for support correlation. | \ No newline at end of file diff --git a/docs/models/platformagentversionwithdefinition.md b/docs/models/platformagentversionwithdefinition.md new file mode 100644 index 000000000..fdf7799e0 --- /dev/null +++ b/docs/models/platformagentversionwithdefinition.md @@ -0,0 +1,13 @@ +# PlatformAgentVersionWithDefinition + +A saved version of an agent and the complete agent it saved. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `version_id` | *str* | :heavy_check_mark: | Opaque ID of the version, unique within the agent. It is not an ordinal; do not sort or compare IDs.
| +| `display_name` | *str* | :heavy_check_mark: | Name given to the version when it was created. | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Time the version was created. | +| `agent` | [models.PlatformAgent](../models/platformagent.md) | :heavy_check_mark: | An agent available to the authenticated user. | \ No newline at end of file diff --git a/docs/models/platformlistadminagentsresponse.md b/docs/models/platformlistadminagentsresponse.md index 74158e879..579ed2643 100644 --- a/docs/models/platformlistadminagentsresponse.md +++ b/docs/models/platformlistadminagentsresponse.md @@ -5,9 +5,9 @@ One page of agents. ## Fields -| Field | Type | Required | Description | -| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | -| `results` | List[[models.PlatformAgent](../models/platformagent.md)] | :heavy_check_mark: | The agents on this page, ordered by name and then by agent_id. | -| `has_more` | *bool* | :heavy_check_mark: | Whether more agents are available after this page. | -| `next_cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Opaque cursor for the next page; null or absent when has_more is false. | -| `request_id` | *str* | :heavy_check_mark: | Request identifier for correlating this response. | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `results` | List[[models.PlatformAgent](../models/platformagent.md)] | :heavy_check_mark: | The agents on this page, ordered by name and then by agent_id. Only about the first 2 KB of a name is compared, less when agent_id is long, so names that share that leading part are ordered by agent_id.
| +| `has_more` | *bool* | :heavy_check_mark: | Whether more agents are available after this page. | +| `next_cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Opaque cursor for the next page; null or absent when has_more is false. | +| `request_id` | *str* | :heavy_check_mark: | Request identifier for correlating this response. | \ No newline at end of file diff --git a/docs/models/platformlistagentrunsresponse.md b/docs/models/platformlistagentrunsresponse.md new file mode 100644 index 000000000..54155fb5b --- /dev/null +++ b/docs/models/platformlistagentrunsresponse.md @@ -0,0 +1,13 @@ +# PlatformListAgentRunsResponse + +One page of the authenticated user's runs of an agent. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `results` | List[[models.PlatformAgentRunSummary](../models/platformagentrunsummary.md)] | :heavy_check_mark: | The runs on this page, newest first, ordered by created_at and then by run_id. | +| `has_more` | *bool* | :heavy_check_mark: | Whether more runs are available after this page. | +| `next_cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Opaque cursor for the next page; null or absent when has_more is false. | +| `request_id` | *str* | :heavy_check_mark: | Request identifier for correlating this response. | \ No newline at end of file diff --git a/docs/models/platformlistdepartmentsresponse.md b/docs/models/platformlistdepartmentsresponse.md index c363687e3..640ae9157 100644 --- a/docs/models/platformlistdepartmentsresponse.md +++ b/docs/models/platformlistdepartmentsresponse.md @@ -5,9 +5,9 @@ One page of departments. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | -| `results` | List[[models.PlatformDepartmentReference](../models/platformdepartmentreference.md)] | :heavy_check_mark: | The departments on this page, ordered by display_name and then by department_id.
| -| `has_more` | *bool* | :heavy_check_mark: | Whether more departments are available after this page. | -| `next_cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Opaque cursor for the next page; null or absent when has_more is false. | -| `request_id` | *str* | :heavy_check_mark: | Request identifier for correlating this response. | \ No newline at end of file +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `results` | List[[models.PlatformDepartmentReference](../models/platformdepartmentreference.md)] | :heavy_check_mark: | The departments on this page, ordered by display_name and then by department_id. Only about the first 2 KB of a name is compared, less when department_id is long, so names that share that leading part are ordered by department_id.
| +| `has_more` | *bool* | :heavy_check_mark: | Whether more departments are available after this page. | +| `next_cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Opaque cursor for the next page; null or absent when has_more is false. | +| `request_id` | *str* | :heavy_check_mark: | Request identifier for correlating this response. | \ No newline at end of file diff --git a/docs/models/platformlistidpgroupsresponse.md b/docs/models/platformlistidpgroupsresponse.md index c8bbd4b7a..c1ce7a4c6 100644 --- a/docs/models/platformlistidpgroupsresponse.md +++ b/docs/models/platformlistidpgroupsresponse.md @@ -5,9 +5,9 @@ One page of IdP groups. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | -| `results` | List[[models.PlatformIdpGroup](../models/platformidpgroup.md)] | :heavy_check_mark: | The IdP groups on this page, ordered by display_name and then by idp_group_id.
| -| `has_more` | *bool* | :heavy_check_mark: | Whether more IdP groups are available after this page. | -| `next_cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Opaque cursor for the next page; null or absent when has_more is false. | -| `request_id` | *str* | :heavy_check_mark: | Request identifier for correlating this response. | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `results` | List[[models.PlatformIdpGroup](../models/platformidpgroup.md)] | :heavy_check_mark: | The IdP groups on this page, ordered by display_name and then by idp_group_id. Only about the first 2 KB of a name is compared, less when idp_group_id is long, so names that share that leading part are ordered by idp_group_id.
| +| `has_more` | *bool* | :heavy_check_mark: | Whether more IdP groups are available after this page. | +| `next_cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Opaque cursor for the next page; null or absent when has_more is false. | +| `request_id` | *str* | :heavy_check_mark: | Request identifier for correlating this response. | \ No newline at end of file diff --git a/docs/models/platformlistoauthclientsresponse.md b/docs/models/platformlistoauthclientsresponse.md index 6296c58f1..32206bc50 100644 --- a/docs/models/platformlistoauthclientsresponse.md +++ b/docs/models/platformlistoauthclientsresponse.md @@ -5,9 +5,9 @@ One page of OAuth clients. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | -| `results` | List[[models.PlatformOAuthClient](../models/platformoauthclient.md)] | :heavy_check_mark: | The clients on this page, ordered by display_name and then by client_id. | -| `has_more` | *bool* | :heavy_check_mark: | Whether more clients are available after this page. | -| `next_cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Opaque cursor for the next page; null or absent when has_more is false. | -| `request_id` | *str* | :heavy_check_mark: | Request identifier for correlating this response. | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `results` | List[[models.PlatformOAuthClient](../models/platformoauthclient.md)] | :heavy_check_mark: | The clients on this page, ordered by display_name and then by client_id. Only about the first 2 KB of a name is compared, less when client_id is long, so names that share that leading part are ordered by client_id.
| +| `has_more` | *bool* | :heavy_check_mark: | Whether more clients are available after this page. | +| `next_cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Opaque cursor for the next page; null or absent when has_more is false. | +| `request_id` | *str* | :heavy_check_mark: | Request identifier for correlating this response. | \ No newline at end of file diff --git a/docs/models/platformlistusersresponse.md b/docs/models/platformlistusersresponse.md index a75d2c061..7104a5131 100644 --- a/docs/models/platformlistusersresponse.md +++ b/docs/models/platformlistusersresponse.md @@ -5,9 +5,9 @@ One page of users. ## Fields -| Field | Type | Required | Description | -| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | -| `results` | List[[models.PlatformUser](../models/platformuser.md)] | :heavy_check_mark: | The users on this page, ordered by display_name and then by user_id. | -| `has_more` | *bool* | :heavy_check_mark: | Whether more users are available after this page. | -| `next_cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Opaque cursor for the next page; null or absent when has_more is false. | -| `request_id` | *str* | :heavy_check_mark: | Request identifier for correlating this response. | \ No newline at end of file +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `results` | List[[models.PlatformUser](../models/platformuser.md)] | :heavy_check_mark: | The users on this page, ordered by display_name and then by user_id. Only about the first 2 KB of a name is compared, less when user_id is long, so names that share that leading part are ordered by user_id.
| +| `has_more` | *bool* | :heavy_check_mark: | Whether more users are available after this page. | +| `next_cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Opaque cursor for the next page; null or absent when has_more is false. | +| `request_id` | *str* | :heavy_check_mark: | Request identifier for correlating this response. | \ No newline at end of file diff --git a/docs/sdks/adminagents/README.md b/docs/sdks/adminagents/README.md index 51b0d1dcf..8df7d3716 100644 --- a/docs/sdks/adminagents/README.md +++ b/docs/sdks/adminagents/README.md @@ -8,7 +8,7 @@ ## list -List every agent in the workspace, ordered by name and then by agent_id. Each agent has the same shape that Get agent returns. Unlike agent search, the list does not depend on who an agent is shared with, so it includes private and disabled agents. Deleted agents are left out. Use the agent_id with other Platform APIs, for example as a usage limit target. The caller must be able to read all agents, administer agents, or read workspace billing. +List every agent in the workspace, ordered by name and then by agent_id. Only about the first 2 KB of a name is compared, less when agent_id is long, so names that share that leading part are ordered by agent_id. Each agent has the same shape that Get agent returns. Unlike agent search, the list does not depend on who an agent is shared with, so it includes private and disabled agents. Deleted agents are left out. Use the agent_id with other Platform APIs, for example as a usage limit target. The caller must be able to read all agents, administer agents, or read workspace billing. ### Example Usage diff --git a/docs/sdks/adminidpgroups/README.md b/docs/sdks/adminidpgroups/README.md index 0574fa567..c63e8c75d 100644 --- a/docs/sdks/adminidpgroups/README.md +++ b/docs/sdks/adminidpgroups/README.md @@ -9,7 +9,7 @@ ## list -List the identity provider (IdP) groups that Glean loads from the directory, ordered by display_name and then by idp_group_id. Use idp_group_id to name a group in other Platform APIs, such as the usage limit evaluation and limit increase request APIs. Usage limits apply only to IdP groups from the datasource instance in usage_settings.user_grouping.idp_group_provider_instance of the get usage settings response, and this API always lists that instance's groups. To list only those groups, pass that value in a provider_instance filter of the filters parameter, for example `filters=[{"field":"provider_instance","operator":"EQUALS","values":["okta"]}]`, URL-encoded as `filters=%5B%7B%22field%22%3A%22provider_instance%22%2C%22operator%22%3A%22EQUALS%22%2C%22values%22%3A%5B%22okta%22%5D%7D%5D`. Send a provider filter to list only one provider's groups, and a name filter to list only the groups whose display_name contains a value. Internal O365 ownership groups and SharePoint groups are left out. The caller must be able to read the workspace configuration or the workspace billing. +List the identity provider (IdP) groups that Glean loads from the directory, ordered by display_name and then by idp_group_id. Only about the first 2 KB of a name is compared, less when idp_group_id is long, so names that share that leading part are ordered by idp_group_id. Use idp_group_id to name a group in other Platform APIs, such as the usage limit evaluation and limit increase request APIs. Usage limits apply only to IdP groups from the datasource instance in usage_settings.user_grouping.idp_group_provider_instance of the get usage settings response, and this API always lists that instance's groups. To list only those groups, pass that value in a provider_instance filter of the filters parameter, for example `filters=[{"field":"provider_instance","operator":"EQUALS","values":["okta"]}]`, URL-encoded as `filters=%5B%7B%22field%22%3A%22provider_instance%22%2C%22operator%22%3A%22EQUALS%22%2C%22values%22%3A%5B%22okta%22%5D%7D%5D`. Send a provider filter to list only one provider's groups, and a name filter to list only the groups whose display_name contains a value. Internal O365 ownership groups and SharePoint groups are left out. The caller must be able to read the workspace configuration or the workspace billing. ### Example Usage diff --git a/docs/sdks/agents/README.md b/docs/sdks/agents/README.md index c5bc6c2c3..1425304f5 100644 --- a/docs/sdks/agents/README.md +++ b/docs/sdks/agents/README.md @@ -10,15 +10,20 @@ * [update](#update) - Update agent * [delete](#delete) - Delete agent * [get_schemas](#get_schemas) - Get agent schemas +* [list_runs](#list_runs) - List agent runs * [create_run](#create_run) - Create agent run * [get_run](#get_run) - Get agent run * [cancel_run](#cancel_run) - Cancel an agent run * [respond_to_run](#respond_to_run) - Respond to agent run approvals +* [list_versions](#list_versions) - List agent versions +* [create_version](#create_version) - Create agent version +* [get_version](#get_version) - Get agent version +* [delete_version](#delete_version) - Delete agent version * [create_run_stream](#create_run_stream) - Create a streaming agent run ## create -Create and publish an agent from its complete definition. +Create an agent from its complete definition. The agent is published unless `draft` is true. ### Example Usage @@ -37,7 +42,7 @@ with Glean( { "name": "HR Policy Agent", }, - ]) + ], draft=False) # Handle response print(res) @@ -61,6 +66,7 @@ with Glean( | `channels` | [Optional[models.PlatformAgentChannels]](../../models/platformagentchannels.md) | :heavy_minus_sign: | Messaging channels the agent is deployed to. Requires `use_agent_identity`. | | | `subagents` | List[[models.PlatformSubagent](../../models/platformsubagent.md)] | :heavy_minus_sign: | Subagents the agent dispatches work to. Subagents cannot contain subagents, and their dependencies may only reference published skills.
| | | `trigger` | [Optional[models.PlatformAgentTrigger]](../../models/platformagenttrigger.md) | :heavy_minus_sign: | How the agent is invoked. Applies to top-level agents only. | | +| `draft` | *Optional[bool]* | :heavy_minus_sign: | Whether to save the agent as an unpublished draft instead of publishing it.
| | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -77,7 +83,7 @@ with Glean( ## search -Search agents available to the authenticated user by agent name. +Search agents available to the authenticated user by agent name. Results come one page at a time. When has_more is true, send next_cursor as cursor, with the same name, to get the next page. ### Example Usage @@ -92,7 +98,7 @@ with Glean( api_token=os.getenv("GLEAN_API_TOKEN"), ) as glean: - res = glean.agents.search(name="HR Policy Agent") + res = glean.agents.search(name="HR Policy Agent", page_size=100, cursor="") # Handle response print(res) @@ -104,6 +110,8 @@ with Glean( | Parameter | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | | `name` | *Optional[str]* | :heavy_minus_sign: | Case-insensitive substring to match against agent names. If omitted or empty, no name filter is applied. | HR Policy Agent | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | Maximum number of agents to return. Defaults to 100. Maximum is 100. | | +| `cursor` | *Optional[str]* | :heavy_minus_sign: | Opaque pagination cursor from a previous response. Send the same name that the previous request used.
| | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -163,7 +171,7 @@ with Glean( ## update -Update and publish an agent. Supplied fields replace their saved values and omitted fields are kept. +Update an agent. Supplied fields replace their saved values, and omitted fields are kept. Updates to a published agent are published. Updates to a draft agent stay in its draft until `draft` is false. ### Example Usage @@ -206,6 +214,7 @@ with Glean( | `channels` | [Optional[models.PlatformAgentChannels]](../../models/platformagentchannels.md) | :heavy_minus_sign: | Messaging channels the agent is deployed to. Requires `use_agent_identity`. | | | `subagents` | List[[models.PlatformSubagent](../../models/platformsubagent.md)] | :heavy_minus_sign: | Subagents the agent dispatches work to. Subagents cannot contain subagents. The supplied list replaces the entire saved list, so saved subagents left out are removed. Keep a saved subagent's `subagent_id` to preserve it, and omit `subagent_id` to add a subagent.
| | | `trigger` | [Optional[models.PlatformAgentTrigger]](../../models/platformagenttrigger.md) | :heavy_minus_sign: | How the agent is invoked. Applies to top-level agents only. | | +| `draft` | *Optional[bool]* | :heavy_minus_sign: | Whether the update is saved as an unpublished draft. Defaults to the agent's current state. `false` publishes a draft agent. `true` isn't allowed for a published agent.
| | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -302,6 +311,51 @@ with Glean( | errors.PlatformProblemDetailError | 500, 503 | application/problem+json | | errors.GleanError | 4XX, 5XX | \*/\* | +## list_runs + +List the authenticated user's persisted runs of an agent, newest first. Each result holds run metadata only + + +### 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.list_runs(agent_id="{agent_id}", page_size=50) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `agent_id` | *str* | :heavy_check_mark: | ID of the agent whose runs should be listed. | {agent_id} | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | Maximum number of runs to return. Defaults to 50. Maximum is 100. | | +| `cursor` | *Optional[str]* | :heavy_minus_sign: | Opaque pagination cursor from a previous response. Send it with the same agent_id that the previous request used.
| | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[models.PlatformListAgentRunsResponse](../../models/platformlistagentrunsresponse.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 | \*/\* | + ## create_run Execute an agent run. By default, set `stream` to true to receive server-sent events; otherwise the response contains the final agent messages. Set `execution_mode` to `DURABLE` to persist a new run and return its initial snapshot with HTTP 201 without waiting for execution. Poll the agent-scoped GET run endpoint for progress. Durable execution continues after an HTTP disconnect, but is not automatically resumed after a QE restart or crash. An active turn becomes overdue more than 40 minutes after acceptance (a 30-minute execution timeout plus 10 minutes of grace). The next GET of the run marks the overdue turn FAILED without replay; there is no periodic sweep. Without a GET, the stored run can remain RUNNING. Failure does not prove that external tool work has stopped. Paused runs are not expired; an accepted approval continuation starts a fresh deadline. Each POST creates a new run; retrying a POST can create another execution. Submit pending approval decisions through the run responses endpoint, and cancellation can be requested through the run cancellations endpoint. A run tracks one workflow execution; automatic background-subagent wake turns are separate executions, not continuations tracked by this run ID. @@ -498,6 +552,182 @@ with Glean( | errors.PlatformProblemDetailError | 500, 503 | application/problem+json | | errors.GleanError | 4XX, 5XX | \*/\* | +## list_versions + +List saved versions of an agent, newest first. Requires permission to edit the agent. + + +### 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.list_versions(agent_id="{agent_id}", page_size=20) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `agent_id` | *str* | :heavy_check_mark: | ID of the agent whose versions to list. | {agent_id} | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | Maximum number of versions to return. Defaults to 20. Maximum is 50. | | +| `cursor` | *Optional[str]* | :heavy_minus_sign: | Opaque pagination cursor returned as next_cursor by the previous page. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[models.PlatformAgentVersionsListResponse](../../models/platformagentversionslistresponse.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 | \*/\* | + +## create_version + +Save a complete agent as a named version without publishing it. The agent's published definition is unchanged. When the agent already has 50 saved versions, the oldest one is deleted. Requires permission to edit the agent. + + +### 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.create_version(agent_id="{agent_id}", display_name="Stricter HR policy wording", agent={ + "name": "HR Policy Agent", + "instructions": "Answer only from the 2026 HR policy handbook.", + }) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `agent_id` | *str* | :heavy_check_mark: | ID of the agent to save a version of. | {agent_id} | +| `display_name` | *str* | :heavy_check_mark: | Name of the version. Leading and trailing whitespace is removed. | | +| `agent` | [models.PlatformAgentCreateRequest](../../models/platformagentcreaterequest.md) | :heavy_check_mark: | Complete agent definition. | {
"name": "HR Policy Agent",
"instructions": "Answer employee questions about HR policies and benefits."
} | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[models.PlatformAgentVersionGetResponse](../../models/platformagentversiongetresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.PlatformProblemDetailError | 400, 401, 403, 404, 408, 413, 429 | application/problem+json | +| errors.PlatformProblemDetailError | 500, 503 | application/problem+json | +| errors.GleanError | 4XX, 5XX | \*/\* | + +## get_version + +Retrieve a saved version of an agent, including the complete agent it saved. + + +### 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_version(agent_id="{agent_id}", version_id="{version_id}") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | +| `agent_id` | *str* | :heavy_check_mark: | ID of the agent. | {agent_id} | +| `version_id` | *str* | :heavy_check_mark: | Opaque ID of the agent version to retrieve, as returned by List agent versions. | {version_id} | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[models.PlatformAgentVersionGetResponse](../../models/platformagentversiongetresponse.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 | \*/\* | + +## delete_version + +Delete a saved version of an agent. The agent itself is unchanged. Requires permission to edit the agent. + + +### Example Usage + + +```python +from glean.api_client import Glean +import os + + +with Glean( + api_token=os.getenv("GLEAN_API_TOKEN"), +) as glean: + + glean.agents.delete_version(agent_id="{agent_id}", version_id="{version_id}") + + # Use the SDK ... + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| `agent_id` | *str* | :heavy_check_mark: | ID of the agent. | {agent_id} | +| `version_id` | *str* | :heavy_check_mark: | Opaque ID of the agent version to delete, as returned by List agent versions. | {version_id} | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### 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 | \*/\* | + ## create_run_stream SDK-only logical operation. HTTP clients must call the base path; the URL fragment is not sent. Execute an agent run as server-sent events. HTTP clients request this mode by setting `stream` to true in the JSON body. Streaming is not supported in DURABLE mode. diff --git a/docs/sdks/clients/README.md b/docs/sdks/clients/README.md index 3c679b018..038cc8aa5 100644 --- a/docs/sdks/clients/README.md +++ b/docs/sdks/clients/README.md @@ -9,7 +9,7 @@ ## list -List the static OAuth clients that admins created for this workspace, ordered by display_name and then by client_id. Dynamically registered clients and Glean's own clients, such as Glean Desktop, are not listed. Disabled clients are left out unless an is_enabled filter includes the value "false". Use filters to find clients by name, client_id, usage_client_id, LLM Gateway access, or supported app. To set a usage limit for a client, send its ai_gateway.usage_client_id, not its client_id, to the usage APIs. The caller needs admin read or billing read permission. +List the static OAuth clients that admins created for this workspace, ordered by display_name and then by client_id. Only about the first 2 KB of a name is compared, less when client_id is long, so names that share that leading part are ordered by client_id. Dynamically registered clients and Glean's own clients, such as Glean Desktop, are not listed. Disabled clients are left out unless an is_enabled filter includes the value "false". Use filters to find clients by name, client_id, usage_client_id, LLM Gateway access, or supported app. To set a usage limit for a client, send its ai_gateway.usage_client_id, not its client_id, to the usage APIs. The caller needs admin read or billing read permission. ### Example Usage diff --git a/docs/sdks/departments/README.md b/docs/sdks/departments/README.md index daa008d72..cd39e7785 100644 --- a/docs/sdks/departments/README.md +++ b/docs/sdks/departments/README.md @@ -9,7 +9,7 @@ ## list -List the departments in the Glean directory, ordered by display_name and then by department_id. The list includes every department that at least one user belongs to or that a usage limit names, so a caller can show the name of a department that a usage limit still names after its users leave it. Department names are exact, so names that differ only by case are different departments. Send a name filter to return only the departments whose display_name contains a value. +List the departments in the Glean directory, ordered by display_name and then by department_id. Only about the first 2 KB of a name is compared, less when department_id is long, so names that share that leading part are ordered by department_id. The list includes every department that at least one user belongs to or that a usage limit names, so a caller can show the name of a department that a usage limit still names after its users leave it. Department names are exact, so names that differ only by case are different departments. Send a name filter to return only the departments whose display_name contains a value. ### Example Usage diff --git a/docs/sdks/users/README.md b/docs/sdks/users/README.md index 5fd6a2c99..508999b44 100644 --- a/docs/sdks/users/README.md +++ b/docs/sdks/users/README.md @@ -9,7 +9,7 @@ ## list -List the users in the Glean directory, ordered by display_name and then by user_id. The list includes the same people as the Glean People directory. Filter by name, email, manager_id, or department_id to find specific users. Use the returned user_id values with other Platform APIs, for example as usage limit targets. +List the users in the Glean directory, ordered by display_name and then by user_id. Only about the first 2 KB of a name is compared, less when user_id is long, so names that share that leading part are ordered by user_id. The list includes the same people as the Glean People directory. Filter by name, email, manager_id, or department_id to find specific users. Use the returned user_id values with other Platform APIs, for example as usage limit targets. ### Example Usage diff --git a/pyproject.toml b/pyproject.toml index c72b37624..acb346d7e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "glean-api-client" -version = "0.18.2" +version = "0.18.3" 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 03f4b3e3b..fb1201e37 100644 --- a/src/glean/api_client/_version.py +++ b/src/glean/api_client/_version.py @@ -4,10 +4,10 @@ import importlib.metadata __title__: str = "glean-api-client" -__version__: str = "0.18.2" +__version__: str = "0.18.3" __openapi_doc_version__: str = "0.9.0" __gen_version__: str = "2.969.4" -__user_agent__: str = "speakeasy-sdk/python 0.18.2 2.969.4 0.9.0 glean-api-client" +__user_agent__: str = "speakeasy-sdk/python 0.18.3 2.969.4 0.9.0 glean-api-client" try: if __package__ is not None: diff --git a/src/glean/api_client/admin_agents.py b/src/glean/api_client/admin_agents.py index 6fd07dd6f..aea15e858 100644 --- a/src/glean/api_client/admin_agents.py +++ b/src/glean/api_client/admin_agents.py @@ -34,7 +34,7 @@ def list( ) -> models.PlatformListAdminAgentsResponse: r"""List all agents - List every agent in the workspace, ordered by name and then by agent_id. Each agent has the same shape that Get agent returns. Unlike agent search, the list does not depend on who an agent is shared with, so it includes private and disabled agents. Deleted agents are left out. Use the agent_id with other Platform APIs, for example as a usage limit target. The caller must be able to read all agents, administer agents, or read workspace billing. + List every agent in the workspace, ordered by name and then by agent_id. Only about the first 2 KB of a name is compared, less when agent_id is long, so names that share that leading part are ordered by agent_id. Each agent has the same shape that Get agent returns. Unlike agent search, the list does not depend on who an agent is shared with, so it includes private and disabled agents. Deleted agents are left out. Use the agent_id with other Platform APIs, for example as a usage limit target. The caller must be able to read all agents, administer agents, or read workspace billing. :param page_size: Maximum number of agents to return. Defaults to 50. Maximum is 100. @@ -162,7 +162,7 @@ async def list_async( ) -> models.PlatformListAdminAgentsResponse: r"""List all agents - List every agent in the workspace, ordered by name and then by agent_id. Each agent has the same shape that Get agent returns. Unlike agent search, the list does not depend on who an agent is shared with, so it includes private and disabled agents. Deleted agents are left out. Use the agent_id with other Platform APIs, for example as a usage limit target. The caller must be able to read all agents, administer agents, or read workspace billing. + List every agent in the workspace, ordered by name and then by agent_id. Only about the first 2 KB of a name is compared, less when agent_id is long, so names that share that leading part are ordered by agent_id. Each agent has the same shape that Get agent returns. Unlike agent search, the list does not depend on who an agent is shared with, so it includes private and disabled agents. Deleted agents are left out. Use the agent_id with other Platform APIs, for example as a usage limit target. The caller must be able to read all agents, administer agents, or read workspace billing. :param page_size: Maximum number of agents to return. Defaults to 50. Maximum is 100. diff --git a/src/glean/api_client/admin_idpgroups.py b/src/glean/api_client/admin_idpgroups.py index 5802968f9..df4d78a1a 100644 --- a/src/glean/api_client/admin_idpgroups.py +++ b/src/glean/api_client/admin_idpgroups.py @@ -32,7 +32,7 @@ def list( ) -> models.PlatformListIdpGroupsResponse: r"""List IdP groups - List the identity provider (IdP) groups that Glean loads from the directory, ordered by display_name and then by idp_group_id. Use idp_group_id to name a group in other Platform APIs, such as the usage limit evaluation and limit increase request APIs. Usage limits apply only to IdP groups from the datasource instance in usage_settings.user_grouping.idp_group_provider_instance of the get usage settings response, and this API always lists that instance's groups. To list only those groups, pass that value in a provider_instance filter of the filters parameter, for example `filters=[{\"field\":\"provider_instance\",\"operator\":\"EQUALS\",\"values\":[\"okta\"]}]`, URL-encoded as `filters=%5B%7B%22field%22%3A%22provider_instance%22%2C%22operator%22%3A%22EQUALS%22%2C%22values%22%3A%5B%22okta%22%5D%7D%5D`. Send a provider filter to list only one provider's groups, and a name filter to list only the groups whose display_name contains a value. Internal O365 ownership groups and SharePoint groups are left out. The caller must be able to read the workspace configuration or the workspace billing. + List the identity provider (IdP) groups that Glean loads from the directory, ordered by display_name and then by idp_group_id. Only about the first 2 KB of a name is compared, less when idp_group_id is long, so names that share that leading part are ordered by idp_group_id. Use idp_group_id to name a group in other Platform APIs, such as the usage limit evaluation and limit increase request APIs. Usage limits apply only to IdP groups from the datasource instance in usage_settings.user_grouping.idp_group_provider_instance of the get usage settings response, and this API always lists that instance's groups. To list only those groups, pass that value in a provider_instance filter of the filters parameter, for example `filters=[{\"field\":\"provider_instance\",\"operator\":\"EQUALS\",\"values\":[\"okta\"]}]`, URL-encoded as `filters=%5B%7B%22field%22%3A%22provider_instance%22%2C%22operator%22%3A%22EQUALS%22%2C%22values%22%3A%5B%22okta%22%5D%7D%5D`. Send a provider filter to list only one provider's groups, and a name filter to list only the groups whose display_name contains a value. Internal O365 ownership groups and SharePoint groups are left out. The caller must be able to read the workspace configuration or the workspace billing. :param page_size: Maximum number of IdP groups to return. Defaults to 50. Maximum is 100. @@ -158,7 +158,7 @@ async def list_async( ) -> models.PlatformListIdpGroupsResponse: r"""List IdP groups - List the identity provider (IdP) groups that Glean loads from the directory, ordered by display_name and then by idp_group_id. Use idp_group_id to name a group in other Platform APIs, such as the usage limit evaluation and limit increase request APIs. Usage limits apply only to IdP groups from the datasource instance in usage_settings.user_grouping.idp_group_provider_instance of the get usage settings response, and this API always lists that instance's groups. To list only those groups, pass that value in a provider_instance filter of the filters parameter, for example `filters=[{\"field\":\"provider_instance\",\"operator\":\"EQUALS\",\"values\":[\"okta\"]}]`, URL-encoded as `filters=%5B%7B%22field%22%3A%22provider_instance%22%2C%22operator%22%3A%22EQUALS%22%2C%22values%22%3A%5B%22okta%22%5D%7D%5D`. Send a provider filter to list only one provider's groups, and a name filter to list only the groups whose display_name contains a value. Internal O365 ownership groups and SharePoint groups are left out. The caller must be able to read the workspace configuration or the workspace billing. + List the identity provider (IdP) groups that Glean loads from the directory, ordered by display_name and then by idp_group_id. Only about the first 2 KB of a name is compared, less when idp_group_id is long, so names that share that leading part are ordered by idp_group_id. Use idp_group_id to name a group in other Platform APIs, such as the usage limit evaluation and limit increase request APIs. Usage limits apply only to IdP groups from the datasource instance in usage_settings.user_grouping.idp_group_provider_instance of the get usage settings response, and this API always lists that instance's groups. To list only those groups, pass that value in a provider_instance filter of the filters parameter, for example `filters=[{\"field\":\"provider_instance\",\"operator\":\"EQUALS\",\"values\":[\"okta\"]}]`, URL-encoded as `filters=%5B%7B%22field%22%3A%22provider_instance%22%2C%22operator%22%3A%22EQUALS%22%2C%22values%22%3A%5B%22okta%22%5D%7D%5D`. Send a provider filter to list only one provider's groups, and a name filter to list only the groups whose display_name contains a value. Internal O365 ownership groups and SharePoint groups are left out. The caller must be able to read the workspace configuration or the workspace billing. :param page_size: Maximum number of IdP groups to return. Defaults to 50. Maximum is 100. diff --git a/src/glean/api_client/agents.py b/src/glean/api_client/agents.py index 51f5d37e8..8c2722cf4 100644 --- a/src/glean/api_client/agents.py +++ b/src/glean/api_client/agents.py @@ -8,6 +8,7 @@ platform_agents_create_run_streamop as models_platform_agents_create_run_streamop, platform_agents_create_runop as models_platform_agents_create_runop, platformagentchannels as models_platformagentchannels, + platformagentcreaterequest as models_platformagentcreaterequest, platformagentdependency as models_platformagentdependency, platformagentgleansearchconfig as models_platformagentgleansearchconfig, platformagentllmmodel as models_platformagentllmmodel, @@ -93,6 +94,7 @@ def create( models_platformagenttrigger.PlatformAgentTriggerTypedDict, ] ] = None, + draft: Optional[bool] = False, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -100,7 +102,7 @@ def create( ) -> models.PlatformAgentGetResponse: r"""Create agent - Create and publish an agent from its complete definition. + Create an agent from its complete definition. The agent is published unless `draft` is true. :param name: Human-readable name. @@ -120,6 +122,8 @@ def create( :param subagents: Subagents the agent dispatches work to. Subagents cannot contain subagents, and their dependencies may only reference published skills. :param trigger: How the agent is invoked. Applies to top-level agents only. + :param draft: Whether to save the agent as an unpublished draft instead of publishing it. + :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 @@ -168,6 +172,7 @@ def create( trigger=utils.get_pydantic_model( trigger, Optional[models.PlatformAgentTrigger] ), + draft=draft, ) req = self._build_request( @@ -316,6 +321,7 @@ async def create_async( models_platformagenttrigger.PlatformAgentTriggerTypedDict, ] ] = None, + draft: Optional[bool] = False, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -323,7 +329,7 @@ async def create_async( ) -> models.PlatformAgentGetResponse: r"""Create agent - Create and publish an agent from its complete definition. + Create an agent from its complete definition. The agent is published unless `draft` is true. :param name: Human-readable name. @@ -343,6 +349,8 @@ async def create_async( :param subagents: Subagents the agent dispatches work to. Subagents cannot contain subagents, and their dependencies may only reference published skills. :param trigger: How the agent is invoked. Applies to top-level agents only. + :param draft: Whether to save the agent as an unpublished draft instead of publishing it. + :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 @@ -391,6 +399,7 @@ async def create_async( trigger=utils.get_pydantic_model( trigger, Optional[models.PlatformAgentTrigger] ), + draft=draft, ) req = self._build_request_async( @@ -476,6 +485,8 @@ def search( self, *, name: Optional[str] = None, + page_size: Optional[int] = 100, + cursor: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -483,10 +494,13 @@ def search( ) -> models.PlatformAgentsSearchResponse: r"""Search agents - Search agents available to the authenticated user by agent name. + Search agents available to the authenticated user by agent name. Results come one page at a time. When has_more is true, send next_cursor as cursor, with the same name, to get the next page. :param name: Case-insensitive substring to match against agent names. If omitted or empty, no name filter is applied. + :param page_size: Maximum number of agents to return. Defaults to 100. Maximum is 100. + :param cursor: Opaque pagination cursor from a previous response. Send the same name that the previous request used. + :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 @@ -504,6 +518,8 @@ def search( request = models.PlatformAgentsSearchRequest( name=name, + page_size=page_size, + cursor=cursor, ) req = self._build_request( @@ -591,6 +607,8 @@ async def search_async( self, *, name: Optional[str] = None, + page_size: Optional[int] = 100, + cursor: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -598,10 +616,13 @@ async def search_async( ) -> models.PlatformAgentsSearchResponse: r"""Search agents - Search agents available to the authenticated user by agent name. + Search agents available to the authenticated user by agent name. Results come one page at a time. When has_more is true, send next_cursor as cursor, with the same name, to get the next page. :param name: Case-insensitive substring to match against agent names. If omitted or empty, no name filter is applied. + :param page_size: Maximum number of agents to return. Defaults to 100. Maximum is 100. + :param cursor: Opaque pagination cursor from a previous response. Send the same name that the previous request used. + :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 @@ -619,6 +640,8 @@ async def search_async( request = models.PlatformAgentsSearchRequest( name=name, + page_size=page_size, + cursor=cursor, ) req = self._build_request_async( @@ -987,6 +1010,7 @@ def update( models_platformagenttrigger.PlatformAgentTriggerTypedDict, ] ] = None, + draft: Optional[bool] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -994,7 +1018,7 @@ def update( ) -> models.PlatformAgentGetResponse: r"""Update agent - Update and publish an agent. Supplied fields replace their saved values and omitted fields are kept. + Update an agent. Supplied fields replace their saved values, and omitted fields are kept. Updates to a published agent are published. Updates to a draft agent stay in its draft until `draft` is false. :param agent_id: The ID of the agent to update. @@ -1016,6 +1040,8 @@ def update( :param subagents: Subagents the agent dispatches work to. Subagents cannot contain subagents. The supplied list replaces the entire saved list, so saved subagents left out are removed. Keep a saved subagent's `subagent_id` to preserve it, and omit `subagent_id` to add a subagent. :param trigger: How the agent is invoked. Applies to top-level agents only. + :param draft: Whether the update is saved as an unpublished draft. Defaults to the agent's current state. `false` publishes a draft agent. `true` isn't allowed for a published agent. + :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 @@ -1066,6 +1092,7 @@ def update( trigger=utils.get_pydantic_model( trigger, Optional[models.PlatformAgentTrigger] ), + draft=draft, ), ) @@ -1219,6 +1246,7 @@ async def update_async( models_platformagenttrigger.PlatformAgentTriggerTypedDict, ] ] = None, + draft: Optional[bool] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -1226,7 +1254,7 @@ async def update_async( ) -> models.PlatformAgentGetResponse: r"""Update agent - Update and publish an agent. Supplied fields replace their saved values and omitted fields are kept. + Update an agent. Supplied fields replace their saved values, and omitted fields are kept. Updates to a published agent are published. Updates to a draft agent stay in its draft until `draft` is false. :param agent_id: The ID of the agent to update. @@ -1248,6 +1276,8 @@ async def update_async( :param subagents: Subagents the agent dispatches work to. Subagents cannot contain subagents. The supplied list replaces the entire saved list, so saved subagents left out are removed. Keep a saved subagent's `subagent_id` to preserve it, and omit `subagent_id` to add a subagent. :param trigger: How the agent is invoked. Applies to top-level agents only. + :param draft: Whether the update is saved as an unpublished draft. Defaults to the agent's current state. `false` publishes a draft agent. `true` isn't allowed for a published agent. + :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 @@ -1298,6 +1328,7 @@ async def update_async( trigger=utils.get_pydantic_model( trigger, Optional[models.PlatformAgentTrigger] ), + draft=draft, ), ) @@ -1830,6 +1861,242 @@ async def get_schemas_async( raise errors.GleanError("Unexpected response received", http_res) + def list_runs( + self, + *, + agent_id: str, + page_size: Optional[int] = 50, + cursor: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.PlatformListAgentRunsResponse: + r"""List agent runs + + List the authenticated user's persisted runs of an agent, newest first. Each result holds run metadata only + + + :param agent_id: ID of the agent whose runs should be listed. + :param page_size: Maximum number of runs to return. Defaults to 50. Maximum is 100. + :param cursor: Opaque pagination cursor from a previous response. Send it with the same agent_id that the previous request used. + + :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.PlatformAgentsListRunsRequest( + agent_id=agent_id, + page_size=page_size, + cursor=cursor, + ) + + req = self._build_request( + method="GET", + path="/api/agents/{agent_id}/runs", + 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-list-runs", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Agents"], + extensions={ + "x-glean-release": {"introduced": "2026-12-01", "stage": "beta"}, + "x-glean-scopes": { + "legacy": ["AGENTS"], + "platform": ["agents:run"], + }, + "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.PlatformListAgentRunsResponse, 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 list_runs_async( + self, + *, + agent_id: str, + page_size: Optional[int] = 50, + cursor: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.PlatformListAgentRunsResponse: + r"""List agent runs + + List the authenticated user's persisted runs of an agent, newest first. Each result holds run metadata only + + + :param agent_id: ID of the agent whose runs should be listed. + :param page_size: Maximum number of runs to return. Defaults to 50. Maximum is 100. + :param cursor: Opaque pagination cursor from a previous response. Send it with the same agent_id that the previous request used. + + :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.PlatformAgentsListRunsRequest( + agent_id=agent_id, + page_size=page_size, + cursor=cursor, + ) + + req = self._build_request_async( + method="GET", + path="/api/agents/{agent_id}/runs", + 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-list-runs", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Agents"], + extensions={ + "x-glean-release": {"introduced": "2026-12-01", "stage": "beta"}, + "x-glean-scopes": { + "legacy": ["AGENTS"], + "platform": ["agents:run"], + }, + "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.PlatformListAgentRunsResponse, 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 create_run( self, *, @@ -2870,6 +3137,956 @@ async def respond_to_run_async( raise errors.GleanError("Unexpected response received", http_res) + def list_versions( + self, + *, + agent_id: str, + page_size: Optional[int] = 20, + cursor: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.PlatformAgentVersionsListResponse: + r"""List agent versions + + List saved versions of an agent, newest first. Requires permission to edit the agent. + + + :param agent_id: ID of the agent whose versions to list. + :param page_size: Maximum number of versions to return. Defaults to 20. Maximum is 50. + :param cursor: Opaque pagination cursor returned as next_cursor by the previous page. + :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.PlatformAgentsListVersionsRequest( + agent_id=agent_id, + page_size=page_size, + cursor=cursor, + ) + + req = self._build_request( + method="GET", + path="/api/agents/{agent_id}/versions", + 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-list-versions", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Agents"], + extensions={ + "x-glean-release": {"introduced": "2026-11-26", "stage": "beta"}, + "x-glean-scopes": { + "legacy": ["AGENTS"], + "platform": ["agents:read"], + }, + "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.PlatformAgentVersionsListResponse, 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 list_versions_async( + self, + *, + agent_id: str, + page_size: Optional[int] = 20, + cursor: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.PlatformAgentVersionsListResponse: + r"""List agent versions + + List saved versions of an agent, newest first. Requires permission to edit the agent. + + + :param agent_id: ID of the agent whose versions to list. + :param page_size: Maximum number of versions to return. Defaults to 20. Maximum is 50. + :param cursor: Opaque pagination cursor returned as next_cursor by the previous page. + :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.PlatformAgentsListVersionsRequest( + agent_id=agent_id, + page_size=page_size, + cursor=cursor, + ) + + req = self._build_request_async( + method="GET", + path="/api/agents/{agent_id}/versions", + 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-list-versions", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Agents"], + extensions={ + "x-glean-release": {"introduced": "2026-11-26", "stage": "beta"}, + "x-glean-scopes": { + "legacy": ["AGENTS"], + "platform": ["agents:read"], + }, + "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.PlatformAgentVersionsListResponse, 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 create_version( + self, + *, + agent_id: str, + display_name: str, + agent: Union[ + models_platformagentcreaterequest.PlatformAgentCreateRequest, + models_platformagentcreaterequest.PlatformAgentCreateRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.PlatformAgentVersionGetResponse: + r"""Create agent version + + Save a complete agent as a named version without publishing it. The agent's published definition is unchanged. When the agent already has 50 saved versions, the oldest one is deleted. Requires permission to edit the agent. + + + :param agent_id: ID of the agent to save a version of. + :param display_name: Name of the version. Leading and trailing whitespace is removed. + :param agent: Complete agent definition. + :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.PlatformAgentsCreateVersionRequest( + agent_id=agent_id, + platform_agent_version_create_request=models.PlatformAgentVersionCreateRequest( + display_name=display_name, + agent=utils.get_pydantic_model( + agent, models.PlatformAgentCreateRequest + ), + ), + ) + + req = self._build_request( + method="POST", + path="/api/agents/{agent_id}/versions", + 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_version_create_request, + False, + False, + "json", + models.PlatformAgentVersionCreateRequest, + ), + 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-create-version", + 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-glean-release": {"introduced": "2026-11-26", "stage": "beta"}, + "x-glean-scopes": { + "legacy": ["AGENTS"], + "platform": ["agents:write"], + }, + "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, "201", "application/json"): + return unmarshal_json_response( + models.PlatformAgentVersionGetResponse, http_res + ) + if utils.match_response( + http_res, + ["400", "401", "403", "404", "408", "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 create_version_async( + self, + *, + agent_id: str, + display_name: str, + agent: Union[ + models_platformagentcreaterequest.PlatformAgentCreateRequest, + models_platformagentcreaterequest.PlatformAgentCreateRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.PlatformAgentVersionGetResponse: + r"""Create agent version + + Save a complete agent as a named version without publishing it. The agent's published definition is unchanged. When the agent already has 50 saved versions, the oldest one is deleted. Requires permission to edit the agent. + + + :param agent_id: ID of the agent to save a version of. + :param display_name: Name of the version. Leading and trailing whitespace is removed. + :param agent: Complete agent definition. + :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.PlatformAgentsCreateVersionRequest( + agent_id=agent_id, + platform_agent_version_create_request=models.PlatformAgentVersionCreateRequest( + display_name=display_name, + agent=utils.get_pydantic_model( + agent, models.PlatformAgentCreateRequest + ), + ), + ) + + req = self._build_request_async( + method="POST", + path="/api/agents/{agent_id}/versions", + 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_version_create_request, + False, + False, + "json", + models.PlatformAgentVersionCreateRequest, + ), + 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-create-version", + 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-glean-release": {"introduced": "2026-11-26", "stage": "beta"}, + "x-glean-scopes": { + "legacy": ["AGENTS"], + "platform": ["agents:write"], + }, + "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, "201", "application/json"): + return unmarshal_json_response( + models.PlatformAgentVersionGetResponse, http_res + ) + if utils.match_response( + http_res, + ["400", "401", "403", "404", "408", "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) + + def get_version( + self, + *, + agent_id: str, + version_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.PlatformAgentVersionGetResponse: + r"""Get agent version + + Retrieve a saved version of an agent, including the complete agent it saved. + + + :param agent_id: ID of the agent. + :param version_id: Opaque ID of the agent version to retrieve, as returned by List agent versions. + :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.PlatformAgentsGetVersionRequest( + agent_id=agent_id, + version_id=version_id, + ) + + req = self._build_request( + method="GET", + path="/api/agents/{agent_id}/versions/{version_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-version", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Agents"], + extensions={ + "x-glean-release": {"introduced": "2026-11-26", "stage": "beta"}, + "x-glean-scopes": { + "legacy": ["AGENTS"], + "platform": ["agents:read"], + }, + "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.PlatformAgentVersionGetResponse, 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_version_async( + self, + *, + agent_id: str, + version_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.PlatformAgentVersionGetResponse: + r"""Get agent version + + Retrieve a saved version of an agent, including the complete agent it saved. + + + :param agent_id: ID of the agent. + :param version_id: Opaque ID of the agent version to retrieve, as returned by List agent versions. + :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.PlatformAgentsGetVersionRequest( + agent_id=agent_id, + version_id=version_id, + ) + + req = self._build_request_async( + method="GET", + path="/api/agents/{agent_id}/versions/{version_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-version", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Agents"], + extensions={ + "x-glean-release": {"introduced": "2026-11-26", "stage": "beta"}, + "x-glean-scopes": { + "legacy": ["AGENTS"], + "platform": ["agents:read"], + }, + "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.PlatformAgentVersionGetResponse, 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 delete_version( + self, + *, + agent_id: str, + version_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Delete agent version + + Delete a saved version of an agent. The agent itself is unchanged. Requires permission to edit the agent. + + + :param agent_id: ID of the agent. + :param version_id: Opaque ID of the agent version to delete, as returned by List agent versions. + :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.PlatformAgentsDeleteVersionRequest( + agent_id=agent_id, + version_id=version_id, + ) + + req = self._build_request( + method="DELETE", + path="/api/agents/{agent_id}/versions/{version_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/problem+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-delete-version", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Agents"], + extensions={ + "x-glean-release": {"introduced": "2026-11-26", "stage": "beta"}, + "x-glean-scopes": { + "legacy": ["AGENTS"], + "platform": ["agents:write"], + }, + "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, "204", "*"): + return + 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 delete_version_async( + self, + *, + agent_id: str, + version_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Delete agent version + + Delete a saved version of an agent. The agent itself is unchanged. Requires permission to edit the agent. + + + :param agent_id: ID of the agent. + :param version_id: Opaque ID of the agent version to delete, as returned by List agent versions. + :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.PlatformAgentsDeleteVersionRequest( + agent_id=agent_id, + version_id=version_id, + ) + + req = self._build_request_async( + method="DELETE", + path="/api/agents/{agent_id}/versions/{version_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/problem+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-delete-version", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Agents"], + extensions={ + "x-glean-release": {"introduced": "2026-11-26", "stage": "beta"}, + "x-glean-scopes": { + "legacy": ["AGENTS"], + "platform": ["agents:write"], + }, + "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, "204", "*"): + return + 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 create_run_stream( self, *, diff --git a/src/glean/api_client/clients.py b/src/glean/api_client/clients.py index 11cc3ed79..8c3240fd1 100644 --- a/src/glean/api_client/clients.py +++ b/src/glean/api_client/clients.py @@ -34,7 +34,7 @@ def list( ) -> models.PlatformListOAuthClientsResponse: r"""List OAuth clients - List the static OAuth clients that admins created for this workspace, ordered by display_name and then by client_id. Dynamically registered clients and Glean's own clients, such as Glean Desktop, are not listed. Disabled clients are left out unless an is_enabled filter includes the value \"false\". Use filters to find clients by name, client_id, usage_client_id, LLM Gateway access, or supported app. To set a usage limit for a client, send its ai_gateway.usage_client_id, not its client_id, to the usage APIs. The caller needs admin read or billing read permission. + List the static OAuth clients that admins created for this workspace, ordered by display_name and then by client_id. Only about the first 2 KB of a name is compared, less when client_id is long, so names that share that leading part are ordered by client_id. Dynamically registered clients and Glean's own clients, such as Glean Desktop, are not listed. Disabled clients are left out unless an is_enabled filter includes the value \"false\". Use filters to find clients by name, client_id, usage_client_id, LLM Gateway access, or supported app. To set a usage limit for a client, send its ai_gateway.usage_client_id, not its client_id, to the usage APIs. The caller needs admin read or billing read permission. :param page_size: Maximum number of clients to return. Defaults to 50. Maximum is 100. @@ -162,7 +162,7 @@ async def list_async( ) -> models.PlatformListOAuthClientsResponse: r"""List OAuth clients - List the static OAuth clients that admins created for this workspace, ordered by display_name and then by client_id. Dynamically registered clients and Glean's own clients, such as Glean Desktop, are not listed. Disabled clients are left out unless an is_enabled filter includes the value \"false\". Use filters to find clients by name, client_id, usage_client_id, LLM Gateway access, or supported app. To set a usage limit for a client, send its ai_gateway.usage_client_id, not its client_id, to the usage APIs. The caller needs admin read or billing read permission. + List the static OAuth clients that admins created for this workspace, ordered by display_name and then by client_id. Only about the first 2 KB of a name is compared, less when client_id is long, so names that share that leading part are ordered by client_id. Dynamically registered clients and Glean's own clients, such as Glean Desktop, are not listed. Disabled clients are left out unless an is_enabled filter includes the value \"false\". Use filters to find clients by name, client_id, usage_client_id, LLM Gateway access, or supported app. To set a usage limit for a client, send its ai_gateway.usage_client_id, not its client_id, to the usage APIs. The caller needs admin read or billing read permission. :param page_size: Maximum number of clients to return. Defaults to 50. Maximum is 100. diff --git a/src/glean/api_client/departments.py b/src/glean/api_client/departments.py index b0f887461..62198cb82 100644 --- a/src/glean/api_client/departments.py +++ b/src/glean/api_client/departments.py @@ -34,7 +34,7 @@ def list( ) -> models.PlatformListDepartmentsResponse: r"""List departments - List the departments in the Glean directory, ordered by display_name and then by department_id. The list includes every department that at least one user belongs to or that a usage limit names, so a caller can show the name of a department that a usage limit still names after its users leave it. Department names are exact, so names that differ only by case are different departments. Send a name filter to return only the departments whose display_name contains a value. + List the departments in the Glean directory, ordered by display_name and then by department_id. Only about the first 2 KB of a name is compared, less when department_id is long, so names that share that leading part are ordered by department_id. The list includes every department that at least one user belongs to or that a usage limit names, so a caller can show the name of a department that a usage limit still names after its users leave it. Department names are exact, so names that differ only by case are different departments. Send a name filter to return only the departments whose display_name contains a value. :param page_size: Maximum number of departments to return. Defaults to 50. Maximum is 100. @@ -162,7 +162,7 @@ async def list_async( ) -> models.PlatformListDepartmentsResponse: r"""List departments - List the departments in the Glean directory, ordered by display_name and then by department_id. The list includes every department that at least one user belongs to or that a usage limit names, so a caller can show the name of a department that a usage limit still names after its users leave it. Department names are exact, so names that differ only by case are different departments. Send a name filter to return only the departments whose display_name contains a value. + List the departments in the Glean directory, ordered by display_name and then by department_id. Only about the first 2 KB of a name is compared, less when department_id is long, so names that share that leading part are ordered by department_id. The list includes every department that at least one user belongs to or that a usage limit names, so a caller can show the name of a department that a usage limit still names after its users leave it. Department names are exact, so names that differ only by case are different departments. Send a name filter to return only the departments whose display_name contains a value. :param page_size: Maximum number of departments to return. Defaults to 50. Maximum is 100. diff --git a/src/glean/api_client/models/__init__.py b/src/glean/api_client/models/__init__.py index 50b6c7b96..a2a8e5b6f 100644 --- a/src/glean/api_client/models/__init__.py +++ b/src/glean/api_client/models/__init__.py @@ -1337,6 +1337,14 @@ PlatformAgentsCreateRunResponse, PlatformAgentsCreateRunResponseTypedDict, ) + from .platform_agents_create_versionop import ( + PlatformAgentsCreateVersionRequest, + PlatformAgentsCreateVersionRequestTypedDict, + ) + from .platform_agents_delete_versionop import ( + PlatformAgentsDeleteVersionRequest, + PlatformAgentsDeleteVersionRequestTypedDict, + ) from .platform_agents_deleteop import ( PlatformAgentsDeleteRequest, PlatformAgentsDeleteRequestTypedDict, @@ -1349,10 +1357,22 @@ PlatformAgentsGetSchemasRequest, PlatformAgentsGetSchemasRequestTypedDict, ) + from .platform_agents_get_versionop import ( + PlatformAgentsGetVersionRequest, + PlatformAgentsGetVersionRequestTypedDict, + ) from .platform_agents_getop import ( PlatformAgentsGetRequest, PlatformAgentsGetRequestTypedDict, ) + from .platform_agents_list_runsop import ( + PlatformAgentsListRunsRequest, + PlatformAgentsListRunsRequestTypedDict, + ) + from .platform_agents_list_versionsop import ( + PlatformAgentsListVersionsRequest, + PlatformAgentsListVersionsRequestTypedDict, + ) from .platform_agents_updateop import ( PlatformAgentsUpdateRequest, PlatformAgentsUpdateRequestTypedDict, @@ -1616,11 +1636,16 @@ PlatformAgentRunStreamMessage, PlatformAgentRunStreamMessageTypedDict, ) + from .platformagentrunsummary import ( + PlatformAgentRunSummary, + PlatformAgentRunSummaryTypedDict, + ) from .platformagentruntoolapproval import ( PlatformAgentRunToolApproval, PlatformAgentRunToolApprovalType, PlatformAgentRunToolApprovalTypedDict, ) + from .platformagentruntrigger import PlatformAgentRunTrigger from .platformagentrunwaitresponse import ( PlatformAgentRunWaitResponse, PlatformAgentRunWaitResponseTypedDict, @@ -1675,6 +1700,26 @@ PlatformAgentUpdateRequest, PlatformAgentUpdateRequestTypedDict, ) + from .platformagentversion import ( + PlatformAgentVersion, + PlatformAgentVersionTypedDict, + ) + from .platformagentversioncreaterequest import ( + PlatformAgentVersionCreateRequest, + PlatformAgentVersionCreateRequestTypedDict, + ) + from .platformagentversiongetresponse import ( + PlatformAgentVersionGetResponse, + PlatformAgentVersionGetResponseTypedDict, + ) + from .platformagentversionslistresponse import ( + PlatformAgentVersionsListResponse, + PlatformAgentVersionsListResponseTypedDict, + ) + from .platformagentversionwithdefinition import ( + PlatformAgentVersionWithDefinition, + PlatformAgentVersionWithDefinitionTypedDict, + ) from .platformanonymousauthtoken import ( PlatformAnonymousAuthToken, PlatformAnonymousAuthTokenTypedDict, @@ -1926,6 +1971,10 @@ PlatformListAdminAgentsResponse, PlatformListAdminAgentsResponseTypedDict, ) + from .platformlistagentrunsresponse import ( + PlatformListAgentRunsResponse, + PlatformListAgentRunsResponseTypedDict, + ) from .platformlistdepartmentsresponse import ( PlatformListDepartmentsResponse, PlatformListDepartmentsResponseTypedDict, @@ -3748,9 +3797,12 @@ "PlatformAgentRunStreamEventTypedDict", "PlatformAgentRunStreamMessage", "PlatformAgentRunStreamMessageTypedDict", + "PlatformAgentRunSummary", + "PlatformAgentRunSummaryTypedDict", "PlatformAgentRunToolApproval", "PlatformAgentRunToolApprovalType", "PlatformAgentRunToolApprovalTypedDict", + "PlatformAgentRunTrigger", "PlatformAgentRunTypedDict", "PlatformAgentRunWaitResponse", "PlatformAgentRunWaitResponseTypedDict", @@ -3776,6 +3828,16 @@ "PlatformAgentTypedDict", "PlatformAgentUpdateRequest", "PlatformAgentUpdateRequestTypedDict", + "PlatformAgentVersion", + "PlatformAgentVersionCreateRequest", + "PlatformAgentVersionCreateRequestTypedDict", + "PlatformAgentVersionGetResponse", + "PlatformAgentVersionGetResponseTypedDict", + "PlatformAgentVersionTypedDict", + "PlatformAgentVersionWithDefinition", + "PlatformAgentVersionWithDefinitionTypedDict", + "PlatformAgentVersionsListResponse", + "PlatformAgentVersionsListResponseTypedDict", "PlatformAgentsCancelRunRequest", "PlatformAgentsCancelRunRequestTypedDict", "PlatformAgentsCreateRunExecutionMode", @@ -3792,14 +3854,24 @@ "PlatformAgentsCreateRunStreamRequestBody", "PlatformAgentsCreateRunStreamRequestBodyTypedDict", "PlatformAgentsCreateRunStreamRequestTypedDict", + "PlatformAgentsCreateVersionRequest", + "PlatformAgentsCreateVersionRequestTypedDict", "PlatformAgentsDeleteRequest", "PlatformAgentsDeleteRequestTypedDict", + "PlatformAgentsDeleteVersionRequest", + "PlatformAgentsDeleteVersionRequestTypedDict", "PlatformAgentsGetRequest", "PlatformAgentsGetRequestTypedDict", "PlatformAgentsGetRunRequest", "PlatformAgentsGetRunRequestTypedDict", "PlatformAgentsGetSchemasRequest", "PlatformAgentsGetSchemasRequestTypedDict", + "PlatformAgentsGetVersionRequest", + "PlatformAgentsGetVersionRequestTypedDict", + "PlatformAgentsListRunsRequest", + "PlatformAgentsListRunsRequestTypedDict", + "PlatformAgentsListVersionsRequest", + "PlatformAgentsListVersionsRequestTypedDict", "PlatformAgentsSearchRequest", "PlatformAgentsSearchRequestTypedDict", "PlatformAgentsSearchResponse", @@ -3975,6 +4047,8 @@ "PlatformIdpGroupTypedDict", "PlatformListAdminAgentsResponse", "PlatformListAdminAgentsResponseTypedDict", + "PlatformListAgentRunsResponse", + "PlatformListAgentRunsResponseTypedDict", "PlatformListDepartmentsResponse", "PlatformListDepartmentsResponseTypedDict", "PlatformListIdpGroupsResponse", @@ -5545,14 +5619,24 @@ "PlatformAgentsCreateRunRequestTypedDict": ".platform_agents_create_runop", "PlatformAgentsCreateRunResponse": ".platform_agents_create_runop", "PlatformAgentsCreateRunResponseTypedDict": ".platform_agents_create_runop", + "PlatformAgentsCreateVersionRequest": ".platform_agents_create_versionop", + "PlatformAgentsCreateVersionRequestTypedDict": ".platform_agents_create_versionop", + "PlatformAgentsDeleteVersionRequest": ".platform_agents_delete_versionop", + "PlatformAgentsDeleteVersionRequestTypedDict": ".platform_agents_delete_versionop", "PlatformAgentsDeleteRequest": ".platform_agents_deleteop", "PlatformAgentsDeleteRequestTypedDict": ".platform_agents_deleteop", "PlatformAgentsGetRunRequest": ".platform_agents_get_runop", "PlatformAgentsGetRunRequestTypedDict": ".platform_agents_get_runop", "PlatformAgentsGetSchemasRequest": ".platform_agents_get_schemasop", "PlatformAgentsGetSchemasRequestTypedDict": ".platform_agents_get_schemasop", + "PlatformAgentsGetVersionRequest": ".platform_agents_get_versionop", + "PlatformAgentsGetVersionRequestTypedDict": ".platform_agents_get_versionop", "PlatformAgentsGetRequest": ".platform_agents_getop", "PlatformAgentsGetRequestTypedDict": ".platform_agents_getop", + "PlatformAgentsListRunsRequest": ".platform_agents_list_runsop", + "PlatformAgentsListRunsRequestTypedDict": ".platform_agents_list_runsop", + "PlatformAgentsListVersionsRequest": ".platform_agents_list_versionsop", + "PlatformAgentsListVersionsRequestTypedDict": ".platform_agents_list_versionsop", "PlatformAgentsUpdateRequest": ".platform_agents_updateop", "PlatformAgentsUpdateRequestTypedDict": ".platform_agents_updateop", "PlatformChatCancelRequest": ".platform_chat_cancelop", @@ -5697,9 +5781,12 @@ "PlatformAgentRunStreamEventTypedDict": ".platformagentrunstreamevent", "PlatformAgentRunStreamMessage": ".platformagentrunstreammessage", "PlatformAgentRunStreamMessageTypedDict": ".platformagentrunstreammessage", + "PlatformAgentRunSummary": ".platformagentrunsummary", + "PlatformAgentRunSummaryTypedDict": ".platformagentrunsummary", "PlatformAgentRunToolApproval": ".platformagentruntoolapproval", "PlatformAgentRunToolApprovalType": ".platformagentruntoolapproval", "PlatformAgentRunToolApprovalTypedDict": ".platformagentruntoolapproval", + "PlatformAgentRunTrigger": ".platformagentruntrigger", "PlatformAgentRunWaitResponse": ".platformagentrunwaitresponse", "PlatformAgentRunWaitResponseTypedDict": ".platformagentrunwaitresponse", "PlatformAgentSchedule": ".platformagentschedule", @@ -5731,6 +5818,16 @@ "PlatformAgentTriggerTypedDict": ".platformagenttrigger", "PlatformAgentUpdateRequest": ".platformagentupdaterequest", "PlatformAgentUpdateRequestTypedDict": ".platformagentupdaterequest", + "PlatformAgentVersion": ".platformagentversion", + "PlatformAgentVersionTypedDict": ".platformagentversion", + "PlatformAgentVersionCreateRequest": ".platformagentversioncreaterequest", + "PlatformAgentVersionCreateRequestTypedDict": ".platformagentversioncreaterequest", + "PlatformAgentVersionGetResponse": ".platformagentversiongetresponse", + "PlatformAgentVersionGetResponseTypedDict": ".platformagentversiongetresponse", + "PlatformAgentVersionsListResponse": ".platformagentversionslistresponse", + "PlatformAgentVersionsListResponseTypedDict": ".platformagentversionslistresponse", + "PlatformAgentVersionWithDefinition": ".platformagentversionwithdefinition", + "PlatformAgentVersionWithDefinitionTypedDict": ".platformagentversionwithdefinition", "PlatformAnonymousAuthToken": ".platformanonymousauthtoken", "PlatformAnonymousAuthTokenTypedDict": ".platformanonymousauthtoken", "PlatformAuthenticationSuggestion": ".platformauthenticationsuggestion", @@ -5878,6 +5975,8 @@ "PlatformIdpGroupFilterTypedDict": ".platformidpgroupfilter", "PlatformListAdminAgentsResponse": ".platformlistadminagentsresponse", "PlatformListAdminAgentsResponseTypedDict": ".platformlistadminagentsresponse", + "PlatformListAgentRunsResponse": ".platformlistagentrunsresponse", + "PlatformListAgentRunsResponseTypedDict": ".platformlistagentrunsresponse", "PlatformListDepartmentsResponse": ".platformlistdepartmentsresponse", "PlatformListDepartmentsResponseTypedDict": ".platformlistdepartmentsresponse", "PlatformListIdpGroupsResponse": ".platformlistidpgroupsresponse", diff --git a/src/glean/api_client/models/platform_agents_create_versionop.py b/src/glean/api_client/models/platform_agents_create_versionop.py new file mode 100644 index 000000000..3ba8695f8 --- /dev/null +++ b/src/glean/api_client/models/platform_agents_create_versionop.py @@ -0,0 +1,29 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 18b603335077 + +from __future__ import annotations +from .platformagentversioncreaterequest import ( + PlatformAgentVersionCreateRequest, + PlatformAgentVersionCreateRequestTypedDict, +) +from glean.api_client.types import BaseModel +from glean.api_client.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing_extensions import Annotated, TypedDict + + +class PlatformAgentsCreateVersionRequestTypedDict(TypedDict): + agent_id: str + r"""ID of the agent to save a version of.""" + platform_agent_version_create_request: PlatformAgentVersionCreateRequestTypedDict + + +class PlatformAgentsCreateVersionRequest(BaseModel): + agent_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""ID of the agent to save a version of.""" + + platform_agent_version_create_request: Annotated[ + PlatformAgentVersionCreateRequest, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] diff --git a/src/glean/api_client/models/platform_agents_delete_versionop.py b/src/glean/api_client/models/platform_agents_delete_versionop.py new file mode 100644 index 000000000..983194cc1 --- /dev/null +++ b/src/glean/api_client/models/platform_agents_delete_versionop.py @@ -0,0 +1,26 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: f261148929ad + +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 PlatformAgentsDeleteVersionRequestTypedDict(TypedDict): + agent_id: str + r"""ID of the agent.""" + version_id: str + r"""Opaque ID of the agent version to delete, as returned by List agent versions.""" + + +class PlatformAgentsDeleteVersionRequest(BaseModel): + agent_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""ID of the agent.""" + + version_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""Opaque ID of the agent version to delete, as returned by List agent versions.""" diff --git a/src/glean/api_client/models/platform_agents_get_versionop.py b/src/glean/api_client/models/platform_agents_get_versionop.py new file mode 100644 index 000000000..3e05ebf95 --- /dev/null +++ b/src/glean/api_client/models/platform_agents_get_versionop.py @@ -0,0 +1,26 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: a8e1275acaae + +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 PlatformAgentsGetVersionRequestTypedDict(TypedDict): + agent_id: str + r"""ID of the agent.""" + version_id: str + r"""Opaque ID of the agent version to retrieve, as returned by List agent versions.""" + + +class PlatformAgentsGetVersionRequest(BaseModel): + agent_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""ID of the agent.""" + + version_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""Opaque ID of the agent version to retrieve, as returned by List agent versions.""" diff --git a/src/glean/api_client/models/platform_agents_list_runsop.py b/src/glean/api_client/models/platform_agents_list_runsop.py new file mode 100644 index 000000000..e7b0a162e --- /dev/null +++ b/src/glean/api_client/models/platform_agents_list_runsop.py @@ -0,0 +1,70 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 85a08c78f79a + +from __future__ import annotations +from glean.api_client.types import ( + BaseModel, + UNSET_SENTINEL, + current_exclude_none, + serialize_with_info, +) +from glean.api_client.types.basemodel import current_filtered_dump +from glean.api_client.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class PlatformAgentsListRunsRequestTypedDict(TypedDict): + agent_id: str + r"""ID of the agent whose runs should be listed.""" + page_size: NotRequired[int] + r"""Maximum number of runs to return. Defaults to 50. Maximum is 100.""" + cursor: NotRequired[str] + r"""Opaque pagination cursor from a previous response. Send it with the same agent_id that the previous request used. + + """ + + +class PlatformAgentsListRunsRequest(BaseModel): + agent_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""ID of the agent whose runs should be listed.""" + + page_size: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 50 + r"""Maximum number of runs to return. Defaults to 50. Maximum is 100.""" + + cursor: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Opaque pagination cursor from a previous response. Send it with the same agent_id that the previous request used. + + """ + + @model_serializer(mode="wrap") + def _serialize_model_with_info(self, handler, info): + return serialize_with_info(self.serialize_model, handler, info) + + def serialize_model(self, handler): + optional_fields = set(["page_size", "cursor"]) + exclude_none = current_exclude_none() + skip_filtered = exclude_none is False or current_filtered_dump() + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias if f.alias is not None else n + if k not in serialized and n not in serialized and skip_filtered: + continue + 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/platform_agents_list_versionsop.py b/src/glean/api_client/models/platform_agents_list_versionsop.py new file mode 100644 index 000000000..ff330ed5a --- /dev/null +++ b/src/glean/api_client/models/platform_agents_list_versionsop.py @@ -0,0 +1,66 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 6dcf9122b916 + +from __future__ import annotations +from glean.api_client.types import ( + BaseModel, + UNSET_SENTINEL, + current_exclude_none, + serialize_with_info, +) +from glean.api_client.types.basemodel import current_filtered_dump +from glean.api_client.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class PlatformAgentsListVersionsRequestTypedDict(TypedDict): + agent_id: str + r"""ID of the agent whose versions to list.""" + page_size: NotRequired[int] + r"""Maximum number of versions to return. Defaults to 20. Maximum is 50.""" + cursor: NotRequired[str] + r"""Opaque pagination cursor returned as next_cursor by the previous page.""" + + +class PlatformAgentsListVersionsRequest(BaseModel): + agent_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""ID of the agent whose versions to list.""" + + page_size: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 20 + r"""Maximum number of versions to return. Defaults to 20. Maximum is 50.""" + + cursor: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Opaque pagination cursor returned as next_cursor by the previous page.""" + + @model_serializer(mode="wrap") + def _serialize_model_with_info(self, handler, info): + return serialize_with_info(self.serialize_model, handler, info) + + def serialize_model(self, handler): + optional_fields = set(["page_size", "cursor"]) + exclude_none = current_exclude_none() + skip_filtered = exclude_none is False or current_filtered_dump() + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias if f.alias is not None else n + if k not in serialized and n not in serialized and skip_filtered: + continue + 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/platformagent.py b/src/glean/api_client/models/platformagent.py index e5645ffbd..c1e65b7a2 100644 --- a/src/glean/api_client/models/platformagent.py +++ b/src/glean/api_client/models/platformagent.py @@ -83,6 +83,10 @@ class PlatformAgentTypedDict(TypedDict): """ trigger: NotRequired[PlatformAgentTriggerTypedDict] r"""How the agent is invoked. Applies to top-level agents only.""" + is_draft: NotRequired[bool] + r"""Whether the agent is an unpublished draft that has never been published. Omitted for a published agent. + + """ created_by: NotRequired[PlatformPersonReferenceTypedDict] r"""A lightweight reference to a person, used where a payload merely points at someone.""" updated_by: NotRequired[PlatformPersonReferenceTypedDict] @@ -151,6 +155,11 @@ class PlatformAgent(BaseModel): trigger: Optional[PlatformAgentTrigger] = None r"""How the agent is invoked. Applies to top-level agents only.""" + is_draft: Optional[bool] = None + r"""Whether the agent is an unpublished draft that has never been published. Omitted for a published agent. + + """ + created_by: Optional[PlatformPersonReference] = None r"""A lightweight reference to a person, used where a payload merely points at someone.""" @@ -183,6 +192,7 @@ def serialize_model(self, handler): "channels", "subagents", "trigger", + "is_draft", "created_by", "updated_by", "created_at", diff --git a/src/glean/api_client/models/platformagentcreaterequest.py b/src/glean/api_client/models/platformagentcreaterequest.py index f7b2fb1d4..dc8a60f9e 100644 --- a/src/glean/api_client/models/platformagentcreaterequest.py +++ b/src/glean/api_client/models/platformagentcreaterequest.py @@ -69,6 +69,10 @@ class PlatformAgentCreateRequestTypedDict(TypedDict): """ trigger: NotRequired[PlatformAgentTriggerTypedDict] r"""How the agent is invoked. Applies to top-level agents only.""" + draft: NotRequired[bool] + r"""Whether to save the agent as an unpublished draft instead of publishing it. + + """ class PlatformAgentCreateRequest(BaseModel): @@ -121,6 +125,11 @@ class PlatformAgentCreateRequest(BaseModel): trigger: Optional[PlatformAgentTrigger] = None r"""How the agent is invoked. Applies to top-level agents only.""" + draft: Optional[bool] = False + r"""Whether to save the agent as an unpublished draft instead of publishing it. + + """ + @model_serializer(mode="wrap") def _serialize_model_with_info(self, handler, info): return serialize_with_info(self.serialize_model, handler, info) @@ -140,6 +149,7 @@ def serialize_model(self, handler): "channels", "subagents", "trigger", + "draft", ] ) exclude_none = current_exclude_none() diff --git a/src/glean/api_client/models/platformagentrunsummary.py b/src/glean/api_client/models/platformagentrunsummary.py new file mode 100644 index 000000000..2cfc8394c --- /dev/null +++ b/src/glean/api_client/models/platformagentrunsummary.py @@ -0,0 +1,102 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 7ff03d3add9c + +from __future__ import annotations +from .platformagentrunstate import PlatformAgentRunState +from .platformagentruntrigger import PlatformAgentRunTrigger +from datetime import datetime +from glean.api_client import models +from glean.api_client.types import ( + BaseModel, + UNSET_SENTINEL, + current_exclude_none, + serialize_with_info, +) +from glean.api_client.types.basemodel import current_filtered_dump +from pydantic import field_serializer, model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class PlatformAgentRunSummaryTypedDict(TypedDict): + r"""Metadata of a persisted agent run, without its output or pending approvals.""" + + run_id: str + r"""ID of the run. Use it with the agent-scoped GET run endpoint.""" + 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.""" + ended_at: NotRequired[datetime] + r"""Timestamp when the run reached SUCCEEDED, FAILED, or CANCELLED. Omitted in other states.""" + triggered_by: NotRequired[PlatformAgentRunTrigger] + r"""What started an agent run. MANUAL is a user or API request, SCHEDULE is a recurring schedule, CONTENT_CHANGE is a change to indexed content, and CONTENT_SCHEDULE is a time relative to a content event such as a meeting. + + """ + + +class PlatformAgentRunSummary(BaseModel): + r"""Metadata of a persisted agent run, without its output or pending approvals.""" + + run_id: str + r"""ID of the run. Use it with the agent-scoped GET run endpoint.""" + + 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.""" + + ended_at: Optional[datetime] = None + r"""Timestamp when the run reached SUCCEEDED, FAILED, or CANCELLED. Omitted in other states.""" + + triggered_by: Optional[PlatformAgentRunTrigger] = None + r"""What started an agent run. MANUAL is a user or API request, SCHEDULE is a recurring schedule, CONTENT_CHANGE is a change to indexed content, and CONTENT_SCHEDULE is a time relative to a content event such as a meeting. + + """ + + @field_serializer("state") + def serialize_state(self, value): + if isinstance(value, str): + try: + return models.PlatformAgentRunState(value) + except ValueError: + return value + return value + + @field_serializer("triggered_by") + def serialize_triggered_by(self, value): + if isinstance(value, str): + try: + return models.PlatformAgentRunTrigger(value) + except ValueError: + return value + return value + + @model_serializer(mode="wrap") + def _serialize_model_with_info(self, handler, info): + return serialize_with_info(self.serialize_model, handler, info) + + def serialize_model(self, handler): + optional_fields = set(["ended_at", "triggered_by"]) + exclude_none = current_exclude_none() + skip_filtered = exclude_none is False or current_filtered_dump() + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias if f.alias is not None else n + if k not in serialized and n not in serialized and skip_filtered: + continue + 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/platformagentruntrigger.py b/src/glean/api_client/models/platformagentruntrigger.py new file mode 100644 index 000000000..40e898a64 --- /dev/null +++ b/src/glean/api_client/models/platformagentruntrigger.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: dd1adfa0a700 + +from __future__ import annotations +from enum import Enum +from glean.api_client import utils + + +class PlatformAgentRunTrigger(str, Enum, metaclass=utils.OpenEnumMeta): + r"""What started an agent run. MANUAL is a user or API request, SCHEDULE is a recurring schedule, CONTENT_CHANGE is a change to indexed content, and CONTENT_SCHEDULE is a time relative to a content event such as a meeting.""" + + MANUAL = "MANUAL" + SCHEDULE = "SCHEDULE" + CONTENT_CHANGE = "CONTENT_CHANGE" + CONTENT_SCHEDULE = "CONTENT_SCHEDULE" diff --git a/src/glean/api_client/models/platformagentssearchrequest.py b/src/glean/api_client/models/platformagentssearchrequest.py index bf27e3f8d..ca68b949f 100644 --- a/src/glean/api_client/models/platformagentssearchrequest.py +++ b/src/glean/api_client/models/platformagentssearchrequest.py @@ -17,18 +17,32 @@ class PlatformAgentsSearchRequestTypedDict(TypedDict): name: NotRequired[str] r"""Case-insensitive substring to match against agent names. If omitted or empty, no name filter is applied.""" + page_size: NotRequired[int] + r"""Maximum number of agents to return. Defaults to 100. Maximum is 100.""" + cursor: NotRequired[str] + r"""Opaque pagination cursor from a previous response. Send the same name that the previous request used. + + """ class PlatformAgentsSearchRequest(BaseModel): name: Optional[str] = None r"""Case-insensitive substring to match against agent names. If omitted or empty, no name filter is applied.""" + page_size: Optional[int] = 100 + r"""Maximum number of agents to return. Defaults to 100. Maximum is 100.""" + + cursor: Optional[str] = None + r"""Opaque pagination cursor from a previous response. Send the same name that the previous request used. + + """ + @model_serializer(mode="wrap") def _serialize_model_with_info(self, handler, info): return serialize_with_info(self.serialize_model, handler, info) def serialize_model(self, handler): - optional_fields = set(["name"]) + optional_fields = set(["name", "page_size", "cursor"]) exclude_none = current_exclude_none() skip_filtered = exclude_none is False or current_filtered_dump() serialized = handler(self) diff --git a/src/glean/api_client/models/platformagentssearchresponse.py b/src/glean/api_client/models/platformagentssearchresponse.py index 317432d0f..f1cd7c8a0 100644 --- a/src/glean/api_client/models/platformagentssearchresponse.py +++ b/src/glean/api_client/models/platformagentssearchresponse.py @@ -3,21 +3,73 @@ from __future__ import annotations from .platformagent import PlatformAgent, PlatformAgentTypedDict -from glean.api_client.types import BaseModel +from glean.api_client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + current_exclude_none, + serialize_with_info, +) +from glean.api_client.types.basemodel import current_filtered_dump +from pydantic import model_serializer from typing import List -from typing_extensions import TypedDict +from typing_extensions import NotRequired, TypedDict class PlatformAgentsSearchResponseTypedDict(TypedDict): agents: List[PlatformAgentTypedDict] - r"""Agents matching the search request.""" + r"""Agents on this page that match the search request.""" + has_more: bool + r"""Whether more matching agents are available after this page.""" request_id: str r"""Platform-generated request ID for support correlation.""" + next_cursor: NotRequired[Nullable[str]] + r"""Opaque cursor for the next page; null or absent when has_more is false.""" class PlatformAgentsSearchResponse(BaseModel): agents: List[PlatformAgent] - r"""Agents matching the search request.""" + r"""Agents on this page that match the search request.""" + + has_more: bool + r"""Whether more matching agents are available after this page.""" request_id: str r"""Platform-generated request ID for support correlation.""" + + next_cursor: OptionalNullable[str] = UNSET + r"""Opaque cursor for the next page; null or absent when has_more is false.""" + + @model_serializer(mode="wrap") + def _serialize_model_with_info(self, handler, info): + return serialize_with_info(self.serialize_model, handler, info) + + def serialize_model(self, handler): + optional_fields = set(["next_cursor"]) + nullable_fields = set(["next_cursor"]) + exclude_none = current_exclude_none() + skip_filtered = exclude_none is False or current_filtered_dump() + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias if f.alias is not None else n + if k not in serialized and n not in serialized and skip_filtered: + continue + 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 + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/glean/api_client/models/platformagentupdaterequest.py b/src/glean/api_client/models/platformagentupdaterequest.py index 526ebbbba..89a65130d 100644 --- a/src/glean/api_client/models/platformagentupdaterequest.py +++ b/src/glean/api_client/models/platformagentupdaterequest.py @@ -74,6 +74,10 @@ class PlatformAgentUpdateRequestTypedDict(TypedDict): """ trigger: NotRequired[PlatformAgentTriggerTypedDict] r"""How the agent is invoked. Applies to top-level agents only.""" + draft: NotRequired[bool] + r"""Whether the update is saved as an unpublished draft. Defaults to the agent's current state. `false` publishes a draft agent. `true` isn't allowed for a published agent. + + """ class PlatformAgentUpdateRequest(BaseModel): @@ -127,6 +131,11 @@ class PlatformAgentUpdateRequest(BaseModel): trigger: Optional[PlatformAgentTrigger] = None r"""How the agent is invoked. Applies to top-level agents only.""" + draft: Optional[bool] = None + r"""Whether the update is saved as an unpublished draft. Defaults to the agent's current state. `false` publishes a draft agent. `true` isn't allowed for a published agent. + + """ + @model_serializer(mode="wrap") def _serialize_model_with_info(self, handler, info): return serialize_with_info(self.serialize_model, handler, info) @@ -146,6 +155,7 @@ def serialize_model(self, handler): "channels", "subagents", "trigger", + "draft", ] ) nullable_fields = set(["glean_search_config"]) diff --git a/src/glean/api_client/models/platformagentversion.py b/src/glean/api_client/models/platformagentversion.py new file mode 100644 index 000000000..b3ee3605e --- /dev/null +++ b/src/glean/api_client/models/platformagentversion.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 6abdefb53578 + +from __future__ import annotations +from datetime import datetime +from glean.api_client.types import BaseModel +from typing_extensions import TypedDict + + +class PlatformAgentVersionTypedDict(TypedDict): + r"""A named, immutable snapshot of an agent.""" + + version_id: str + r"""Opaque ID of the version, unique within the agent. It is not an ordinal; do not sort or compare IDs. + + """ + display_name: str + r"""Name given to the version when it was created.""" + created_at: datetime + r"""Time the version was created.""" + + +class PlatformAgentVersion(BaseModel): + r"""A named, immutable snapshot of an agent.""" + + version_id: str + r"""Opaque ID of the version, unique within the agent. It is not an ordinal; do not sort or compare IDs. + + """ + + display_name: str + r"""Name given to the version when it was created.""" + + created_at: datetime + r"""Time the version was created.""" diff --git a/src/glean/api_client/models/platformagentversioncreaterequest.py b/src/glean/api_client/models/platformagentversioncreaterequest.py new file mode 100644 index 000000000..327b8b874 --- /dev/null +++ b/src/glean/api_client/models/platformagentversioncreaterequest.py @@ -0,0 +1,29 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 182951dd3dde + +from __future__ import annotations +from .platformagentcreaterequest import ( + PlatformAgentCreateRequest, + PlatformAgentCreateRequestTypedDict, +) +from glean.api_client.types import BaseModel +from typing_extensions import TypedDict + + +class PlatformAgentVersionCreateRequestTypedDict(TypedDict): + r"""Complete agent to save and the name of the version.""" + + display_name: str + r"""Name of the version. Leading and trailing whitespace is removed.""" + agent: PlatformAgentCreateRequestTypedDict + r"""Complete agent definition.""" + + +class PlatformAgentVersionCreateRequest(BaseModel): + r"""Complete agent to save and the name of the version.""" + + display_name: str + r"""Name of the version. Leading and trailing whitespace is removed.""" + + agent: PlatformAgentCreateRequest + r"""Complete agent definition.""" diff --git a/src/glean/api_client/models/platformagentversiongetresponse.py b/src/glean/api_client/models/platformagentversiongetresponse.py new file mode 100644 index 000000000..4afc1d8b3 --- /dev/null +++ b/src/glean/api_client/models/platformagentversiongetresponse.py @@ -0,0 +1,29 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 4219503d0933 + +from __future__ import annotations +from .platformagentversionwithdefinition import ( + PlatformAgentVersionWithDefinition, + PlatformAgentVersionWithDefinitionTypedDict, +) +from glean.api_client.types import BaseModel +from typing_extensions import TypedDict + + +class PlatformAgentVersionGetResponseTypedDict(TypedDict): + r"""A saved version of an agent.""" + + version: PlatformAgentVersionWithDefinitionTypedDict + r"""A saved version of an agent and the complete agent it saved.""" + request_id: str + r"""Platform-generated request ID for support correlation.""" + + +class PlatformAgentVersionGetResponse(BaseModel): + r"""A saved version of an agent.""" + + version: PlatformAgentVersionWithDefinition + r"""A saved version of an agent and the complete agent it saved.""" + + request_id: str + r"""Platform-generated request ID for support correlation.""" diff --git a/src/glean/api_client/models/platformagentversionslistresponse.py b/src/glean/api_client/models/platformagentversionslistresponse.py new file mode 100644 index 000000000..4e7e0339c --- /dev/null +++ b/src/glean/api_client/models/platformagentversionslistresponse.py @@ -0,0 +1,79 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 9028190f6635 + +from __future__ import annotations +from .platformagentversion import PlatformAgentVersion, PlatformAgentVersionTypedDict +from glean.api_client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + current_exclude_none, + serialize_with_info, +) +from glean.api_client.types.basemodel import current_filtered_dump +from pydantic import model_serializer +from typing import List +from typing_extensions import NotRequired, TypedDict + + +class PlatformAgentVersionsListResponseTypedDict(TypedDict): + r"""One page of saved versions of an agent.""" + + results: List[PlatformAgentVersionTypedDict] + r"""Versions of the agent, newest first.""" + has_more: bool + r"""Whether more versions are available after this page.""" + request_id: str + r"""Platform-generated request ID for support correlation.""" + next_cursor: NotRequired[Nullable[str]] + r"""Opaque cursor for the next page; null or absent when has_more is false.""" + + +class PlatformAgentVersionsListResponse(BaseModel): + r"""One page of saved versions of an agent.""" + + results: List[PlatformAgentVersion] + r"""Versions of the agent, newest first.""" + + has_more: bool + r"""Whether more versions are available after this page.""" + + request_id: str + r"""Platform-generated request ID for support correlation.""" + + next_cursor: OptionalNullable[str] = UNSET + r"""Opaque cursor for the next page; null or absent when has_more is false.""" + + @model_serializer(mode="wrap") + def _serialize_model_with_info(self, handler, info): + return serialize_with_info(self.serialize_model, handler, info) + + def serialize_model(self, handler): + optional_fields = set(["next_cursor"]) + nullable_fields = set(["next_cursor"]) + exclude_none = current_exclude_none() + skip_filtered = exclude_none is False or current_filtered_dump() + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias if f.alias is not None else n + if k not in serialized and n not in serialized and skip_filtered: + continue + 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 + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/glean/api_client/models/platformagentversionwithdefinition.py b/src/glean/api_client/models/platformagentversionwithdefinition.py new file mode 100644 index 000000000..c39aed170 --- /dev/null +++ b/src/glean/api_client/models/platformagentversionwithdefinition.py @@ -0,0 +1,41 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 4a1614a98600 + +from __future__ import annotations +from .platformagent import PlatformAgent, PlatformAgentTypedDict +from datetime import datetime +from glean.api_client.types import BaseModel +from typing_extensions import TypedDict + + +class PlatformAgentVersionWithDefinitionTypedDict(TypedDict): + r"""A saved version of an agent and the complete agent it saved.""" + + version_id: str + r"""Opaque ID of the version, unique within the agent. It is not an ordinal; do not sort or compare IDs. + + """ + display_name: str + r"""Name given to the version when it was created.""" + created_at: datetime + r"""Time the version was created.""" + agent: PlatformAgentTypedDict + r"""An agent available to the authenticated user.""" + + +class PlatformAgentVersionWithDefinition(BaseModel): + r"""A saved version of an agent and the complete agent it saved.""" + + version_id: str + r"""Opaque ID of the version, unique within the agent. It is not an ordinal; do not sort or compare IDs. + + """ + + display_name: str + r"""Name given to the version when it was created.""" + + created_at: datetime + r"""Time the version was created.""" + + agent: PlatformAgent + r"""An agent available to the authenticated user.""" diff --git a/src/glean/api_client/models/platformlistadminagentsresponse.py b/src/glean/api_client/models/platformlistadminagentsresponse.py index 77c92a0ef..da24dab15 100644 --- a/src/glean/api_client/models/platformlistadminagentsresponse.py +++ b/src/glean/api_client/models/platformlistadminagentsresponse.py @@ -22,7 +22,9 @@ class PlatformListAdminAgentsResponseTypedDict(TypedDict): r"""One page of agents.""" results: List[PlatformAgentTypedDict] - r"""The agents on this page, ordered by name and then by agent_id.""" + r"""The agents on this page, ordered by name and then by agent_id. Only about the first 2 KB of a name is compared, less when agent_id is long, so names that share that leading part are ordered by agent_id. + + """ has_more: bool r"""Whether more agents are available after this page.""" request_id: str @@ -35,7 +37,9 @@ class PlatformListAdminAgentsResponse(BaseModel): r"""One page of agents.""" results: List[PlatformAgent] - r"""The agents on this page, ordered by name and then by agent_id.""" + r"""The agents on this page, ordered by name and then by agent_id. Only about the first 2 KB of a name is compared, less when agent_id is long, so names that share that leading part are ordered by agent_id. + + """ has_more: bool r"""Whether more agents are available after this page.""" diff --git a/src/glean/api_client/models/platformlistagentrunsresponse.py b/src/glean/api_client/models/platformlistagentrunsresponse.py new file mode 100644 index 000000000..b1146cfcd --- /dev/null +++ b/src/glean/api_client/models/platformlistagentrunsresponse.py @@ -0,0 +1,82 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 36136c76e2a2 + +from __future__ import annotations +from .platformagentrunsummary import ( + PlatformAgentRunSummary, + PlatformAgentRunSummaryTypedDict, +) +from glean.api_client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + current_exclude_none, + serialize_with_info, +) +from glean.api_client.types.basemodel import current_filtered_dump +from pydantic import model_serializer +from typing import List +from typing_extensions import NotRequired, TypedDict + + +class PlatformListAgentRunsResponseTypedDict(TypedDict): + r"""One page of the authenticated user's runs of an agent.""" + + results: List[PlatformAgentRunSummaryTypedDict] + r"""The runs on this page, newest first, ordered by created_at and then by run_id.""" + has_more: bool + r"""Whether more runs are available after this page.""" + request_id: str + r"""Request identifier for correlating this response.""" + next_cursor: NotRequired[Nullable[str]] + r"""Opaque cursor for the next page; null or absent when has_more is false.""" + + +class PlatformListAgentRunsResponse(BaseModel): + r"""One page of the authenticated user's runs of an agent.""" + + results: List[PlatformAgentRunSummary] + r"""The runs on this page, newest first, ordered by created_at and then by run_id.""" + + has_more: bool + r"""Whether more runs are available after this page.""" + + request_id: str + r"""Request identifier for correlating this response.""" + + next_cursor: OptionalNullable[str] = UNSET + r"""Opaque cursor for the next page; null or absent when has_more is false.""" + + @model_serializer(mode="wrap") + def _serialize_model_with_info(self, handler, info): + return serialize_with_info(self.serialize_model, handler, info) + + def serialize_model(self, handler): + optional_fields = set(["next_cursor"]) + nullable_fields = set(["next_cursor"]) + exclude_none = current_exclude_none() + skip_filtered = exclude_none is False or current_filtered_dump() + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias if f.alias is not None else n + if k not in serialized and n not in serialized and skip_filtered: + continue + 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 + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/glean/api_client/models/platformlistdepartmentsresponse.py b/src/glean/api_client/models/platformlistdepartmentsresponse.py index de00d93ac..54e88bf18 100644 --- a/src/glean/api_client/models/platformlistdepartmentsresponse.py +++ b/src/glean/api_client/models/platformlistdepartmentsresponse.py @@ -25,7 +25,7 @@ class PlatformListDepartmentsResponseTypedDict(TypedDict): r"""One page of departments.""" results: List[PlatformDepartmentReferenceTypedDict] - r"""The departments on this page, ordered by display_name and then by department_id. + r"""The departments on this page, ordered by display_name and then by department_id. Only about the first 2 KB of a name is compared, less when department_id is long, so names that share that leading part are ordered by department_id. """ has_more: bool @@ -40,7 +40,7 @@ class PlatformListDepartmentsResponse(BaseModel): r"""One page of departments.""" results: List[PlatformDepartmentReference] - r"""The departments on this page, ordered by display_name and then by department_id. + r"""The departments on this page, ordered by display_name and then by department_id. Only about the first 2 KB of a name is compared, less when department_id is long, so names that share that leading part are ordered by department_id. """ diff --git a/src/glean/api_client/models/platformlistidpgroupsresponse.py b/src/glean/api_client/models/platformlistidpgroupsresponse.py index 357000ad8..f36dc6d72 100644 --- a/src/glean/api_client/models/platformlistidpgroupsresponse.py +++ b/src/glean/api_client/models/platformlistidpgroupsresponse.py @@ -22,7 +22,7 @@ class PlatformListIdpGroupsResponseTypedDict(TypedDict): r"""One page of IdP groups.""" results: List[PlatformIdpGroupTypedDict] - r"""The IdP groups on this page, ordered by display_name and then by idp_group_id. + r"""The IdP groups on this page, ordered by display_name and then by idp_group_id. Only about the first 2 KB of a name is compared, less when idp_group_id is long, so names that share that leading part are ordered by idp_group_id. """ has_more: bool @@ -37,7 +37,7 @@ class PlatformListIdpGroupsResponse(BaseModel): r"""One page of IdP groups.""" results: List[PlatformIdpGroup] - r"""The IdP groups on this page, ordered by display_name and then by idp_group_id. + r"""The IdP groups on this page, ordered by display_name and then by idp_group_id. Only about the first 2 KB of a name is compared, less when idp_group_id is long, so names that share that leading part are ordered by idp_group_id. """ diff --git a/src/glean/api_client/models/platformlistoauthclientsresponse.py b/src/glean/api_client/models/platformlistoauthclientsresponse.py index dc8fd1921..89451272f 100644 --- a/src/glean/api_client/models/platformlistoauthclientsresponse.py +++ b/src/glean/api_client/models/platformlistoauthclientsresponse.py @@ -22,7 +22,9 @@ class PlatformListOAuthClientsResponseTypedDict(TypedDict): r"""One page of OAuth clients.""" results: List[PlatformOAuthClientTypedDict] - r"""The clients on this page, ordered by display_name and then by client_id.""" + r"""The clients on this page, ordered by display_name and then by client_id. Only about the first 2 KB of a name is compared, less when client_id is long, so names that share that leading part are ordered by client_id. + + """ has_more: bool r"""Whether more clients are available after this page.""" request_id: str @@ -35,7 +37,9 @@ class PlatformListOAuthClientsResponse(BaseModel): r"""One page of OAuth clients.""" results: List[PlatformOAuthClient] - r"""The clients on this page, ordered by display_name and then by client_id.""" + r"""The clients on this page, ordered by display_name and then by client_id. Only about the first 2 KB of a name is compared, less when client_id is long, so names that share that leading part are ordered by client_id. + + """ has_more: bool r"""Whether more clients are available after this page.""" diff --git a/src/glean/api_client/models/platformlistusersresponse.py b/src/glean/api_client/models/platformlistusersresponse.py index eaa6372fa..5b0c10d70 100644 --- a/src/glean/api_client/models/platformlistusersresponse.py +++ b/src/glean/api_client/models/platformlistusersresponse.py @@ -22,7 +22,9 @@ class PlatformListUsersResponseTypedDict(TypedDict): r"""One page of users.""" results: List[PlatformUserTypedDict] - r"""The users on this page, ordered by display_name and then by user_id.""" + r"""The users on this page, ordered by display_name and then by user_id. Only about the first 2 KB of a name is compared, less when user_id is long, so names that share that leading part are ordered by user_id. + + """ has_more: bool r"""Whether more users are available after this page.""" request_id: str @@ -35,7 +37,9 @@ class PlatformListUsersResponse(BaseModel): r"""One page of users.""" results: List[PlatformUser] - r"""The users on this page, ordered by display_name and then by user_id.""" + r"""The users on this page, ordered by display_name and then by user_id. Only about the first 2 KB of a name is compared, less when user_id is long, so names that share that leading part are ordered by user_id. + + """ has_more: bool r"""Whether more users are available after this page.""" diff --git a/src/glean/api_client/users.py b/src/glean/api_client/users.py index 2e13bdb51..718c662d3 100644 --- a/src/glean/api_client/users.py +++ b/src/glean/api_client/users.py @@ -36,7 +36,7 @@ def list( ) -> models.PlatformListUsersResponse: r"""List users - List the users in the Glean directory, ordered by display_name and then by user_id. The list includes the same people as the Glean People directory. Filter by name, email, manager_id, or department_id to find specific users. Use the returned user_id values with other Platform APIs, for example as usage limit targets. + List the users in the Glean directory, ordered by display_name and then by user_id. Only about the first 2 KB of a name is compared, less when user_id is long, so names that share that leading part are ordered by user_id. The list includes the same people as the Glean People directory. Filter by name, email, manager_id, or department_id to find specific users. Use the returned user_id values with other Platform APIs, for example as usage limit targets. :param page_size: Maximum number of users to return. Defaults to 50. Maximum is 100. @@ -168,7 +168,7 @@ async def list_async( ) -> models.PlatformListUsersResponse: r"""List users - List the users in the Glean directory, ordered by display_name and then by user_id. The list includes the same people as the Glean People directory. Filter by name, email, manager_id, or department_id to find specific users. Use the returned user_id values with other Platform APIs, for example as usage limit targets. + List the users in the Glean directory, ordered by display_name and then by user_id. Only about the first 2 KB of a name is compared, less when user_id is long, so names that share that leading part are ordered by user_id. The list includes the same people as the Glean People directory. Filter by name, email, manager_id, or department_id to find specific users. Use the returned user_id values with other Platform APIs, for example as usage limit targets. :param page_size: Maximum number of users to return. Defaults to 50. Maximum is 100. diff --git a/tests/mockserver/internal/handler/generated_handlers.go b/tests/mockserver/internal/handler/generated_handlers.go index 6b63ed70c..aab377c24 100644 --- a/tests/mockserver/internal/handler/generated_handlers.go +++ b/tests/mockserver/internal/handler/generated_handlers.go @@ -21,8 +21,11 @@ func GeneratedHandlers(ctx context.Context, dir *logging.HTTPFileDirectory, rt * NewGeneratedHandler(ctx, http.MethodGet, "/api/admin/oauth/clients", pathGetAPIAdminOauthClients(dir, rt)), NewGeneratedHandler(ctx, http.MethodGet, "/api/admin/oauth/clients/{client_id}", pathGetAPIAdminOauthClientsClientID(dir, rt)), NewGeneratedHandler(ctx, http.MethodGet, "/api/agents/{agent_id}", pathGetAPIAgentsAgentID(dir, rt)), + NewGeneratedHandler(ctx, http.MethodGet, "/api/agents/{agent_id}/runs", pathGetAPIAgentsAgentIDRuns(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/agents/{agent_id}/versions", pathGetAPIAgentsAgentIDVersions(dir, rt)), + NewGeneratedHandler(ctx, http.MethodGet, "/api/agents/{agent_id}/versions/{version_id}", pathGetAPIAgentsAgentIDVersionsVersionID(dir, rt)), NewGeneratedHandler(ctx, http.MethodGet, "/api/departments", pathGetAPIDepartments(dir, rt)), NewGeneratedHandler(ctx, http.MethodGet, "/api/departments/{department_id}", pathGetAPIDepartmentsDepartmentID(dir, rt)), NewGeneratedHandler(ctx, http.MethodGet, "/api/documents", pathGetAPIDocuments(dir, rt)), @@ -67,6 +70,7 @@ func GeneratedHandlers(ctx context.Context, dir *logging.HTTPFileDirectory, rt * NewGeneratedHandler(ctx, http.MethodPost, "/api/agents/{agent_id}/cancellations", pathPostAPIAgentsAgentIDCancellations(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/api/agents/{agent_id}/responses", pathPostAPIAgentsAgentIDResponses(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/api/agents/{agent_id}/runs", pathPostAPIAgentsAgentIDRuns(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/api/agents/{agent_id}/versions", pathPostAPIAgentsAgentIDVersions(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/api/anonymous-auth-tokens", pathPostAPIAnonymousAuthTokens(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/api/chat", pathPostAPIChat(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/api/chats/{chat_id}/cancellations", pathPostAPIChatsChatIDCancellations(dir, rt)), diff --git a/tests/mockserver/internal/handler/pathgetapiagentsagentidruns.go b/tests/mockserver/internal/handler/pathgetapiagentsagentidruns.go new file mode 100644 index 000000000..62d103411 --- /dev/null +++ b/tests/mockserver/internal/handler/pathgetapiagentsagentidruns.go @@ -0,0 +1,75 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: b1cbb05aedca + +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 pathGetAPIAgentsAgentIDRuns(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-list-runs[0]": + dir.HandlerFunc("platform-agents-list-runs", testPlatformAgentsListRunsPlatformAgentsListRuns0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPlatformAgentsListRunsPlatformAgentsListRuns0(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.PlatformListAgentRunsResponse = &components.PlatformListAgentRunsResponse{ + Results: []components.PlatformAgentRunSummary{ + components.PlatformAgentRunSummary{ + RunID: "", + AgentID: "", + State: components.PlatformAgentRunStateRunning, + CreatedAt: types.MustTimeFromString("2024-09-28T20:59:41.155Z"), + }, + }, + HasMore: false, + 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/pathgetapiagentsagentidversions.go b/tests/mockserver/internal/handler/pathgetapiagentsagentidversions.go new file mode 100644 index 000000000..a11718bed --- /dev/null +++ b/tests/mockserver/internal/handler/pathgetapiagentsagentidversions.go @@ -0,0 +1,67 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 32ede5f8fb46 + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathGetAPIAgentsAgentIDVersions(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-list-versions[0]": + dir.HandlerFunc("platform-agents-list-versions", testPlatformAgentsListVersionsPlatformAgentsListVersions0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPlatformAgentsListVersionsPlatformAgentsListVersions0(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.PlatformAgentVersionsListResponse = &components.PlatformAgentVersionsListResponse{ + Results: []components.PlatformAgentVersion{}, + HasMore: true, + 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/pathgetapiagentsagentidversionsversionid.go b/tests/mockserver/internal/handler/pathgetapiagentsagentidversionsversionid.go new file mode 100644 index 000000000..3e13daceb --- /dev/null +++ b/tests/mockserver/internal/handler/pathgetapiagentsagentidversionsversionid.go @@ -0,0 +1,81 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 4158beaca34a + +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 pathGetAPIAgentsAgentIDVersionsVersionID(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-version[0]": + dir.HandlerFunc("platform-agents-get-version", testPlatformAgentsGetVersionPlatformAgentsGetVersion0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPlatformAgentsGetVersionPlatformAgentsGetVersion0(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.PlatformAgentVersionGetResponse = &components.PlatformAgentVersionGetResponse{ + Version: components.PlatformAgentVersionWithDefinition{ + VersionID: "", + DisplayName: "Mauricio.Pouros72", + CreatedAt: types.MustTimeFromString("2025-04-07T11:45:00.644Z"), + Agent: components.PlatformAgent{ + Name: "HR Policy Agent", + AgentID: "ef33aecf52c142a6873adf76037b642e", + Capabilities: components.PlatformAgentCapabilities{}, + Subagents: []components.PlatformSubagent{ + components.PlatformSubagent{ + Name: "HR Policy Agent", + }, + }, + }, + }, + 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/pathpostapiagentsagentidversions.go b/tests/mockserver/internal/handler/pathpostapiagentsagentidversions.go new file mode 100644 index 000000000..9e5f2f2f8 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostapiagentsagentidversions.go @@ -0,0 +1,86 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 39ab6ef1c62c + +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 pathPostAPIAgentsAgentIDVersions(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "platform-agents-create-version[0]": + dir.HandlerFunc("platform-agents-create-version", testPlatformAgentsCreateVersionPlatformAgentsCreateVersion0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPlatformAgentsCreateVersionPlatformAgentsCreateVersion0(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.PlatformAgentVersionGetResponse = &components.PlatformAgentVersionGetResponse{ + Version: components.PlatformAgentVersionWithDefinition{ + VersionID: "", + DisplayName: "Imani_Lebsack", + CreatedAt: types.MustTimeFromString("2025-05-23T00:57:48.585Z"), + Agent: components.PlatformAgent{ + Name: "HR Policy Agent", + AgentID: "ef33aecf52c142a6873adf76037b642e", + Capabilities: components.PlatformAgentCapabilities{}, + Subagents: []components.PlatformSubagent{ + components.PlatformSubagent{ + Name: "HR Policy Agent", + }, + }, + }, + }, + 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.StatusCreated) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/handler/pathpostapiagentssearch.go b/tests/mockserver/internal/handler/pathpostapiagentssearch.go index 3414ce407..c7b8021c2 100644 --- a/tests/mockserver/internal/handler/pathpostapiagentssearch.go +++ b/tests/mockserver/internal/handler/pathpostapiagentssearch.go @@ -53,6 +53,7 @@ func testPlatformAgentsSearchPlatformAgentsSearch0(w http.ResponseWriter, req *h } var respBody *components.PlatformAgentsSearchResponse = &components.PlatformAgentsSearchResponse{ Agents: []components.PlatformAgent{}, + HasMore: true, RequestID: "", } respBodyBytes, err := utils.MarshalJSON(respBody, "", true) diff --git a/tests/mockserver/internal/sdk/models/components/platformagent.go b/tests/mockserver/internal/sdk/models/components/platformagent.go index 51dd21faf..281a16c8c 100644 --- a/tests/mockserver/internal/sdk/models/components/platformagent.go +++ b/tests/mockserver/internal/sdk/models/components/platformagent.go @@ -45,6 +45,9 @@ type PlatformAgent struct { Subagents []PlatformSubagent `json:"subagents,omitempty"` // How the agent is invoked. Applies to top-level agents only. Trigger *PlatformAgentTrigger `json:"trigger,omitempty"` + // Whether the agent is an unpublished draft that has never been published. Omitted for a published agent. + // + IsDraft *bool `json:"is_draft,omitempty"` // A lightweight reference to a person, used where a payload merely points at someone. CreatedBy *PlatformPersonReference `json:"created_by,omitempty"` // A lightweight reference to a person, used where a payload merely points at someone. @@ -178,6 +181,13 @@ func (o *PlatformAgent) GetTrigger() *PlatformAgentTrigger { return o.Trigger } +func (o *PlatformAgent) GetIsDraft() *bool { + if o == nil { + return nil + } + return o.IsDraft +} + func (o *PlatformAgent) GetCreatedBy() *PlatformPersonReference { if o == nil { return nil diff --git a/tests/mockserver/internal/sdk/models/components/platformagentcreaterequest.go b/tests/mockserver/internal/sdk/models/components/platformagentcreaterequest.go index cd9c2e977..aa31cd58d 100644 --- a/tests/mockserver/internal/sdk/models/components/platformagentcreaterequest.go +++ b/tests/mockserver/internal/sdk/models/components/platformagentcreaterequest.go @@ -3,6 +3,10 @@ package components +import ( + "mockserver/internal/sdk/utils" +) + // PlatformAgentCreateRequest - Complete agent definition. type PlatformAgentCreateRequest struct { // Human-readable name. @@ -35,6 +39,20 @@ type PlatformAgentCreateRequest struct { Subagents []PlatformSubagent `json:"subagents,omitempty"` // How the agent is invoked. Applies to top-level agents only. Trigger *PlatformAgentTrigger `json:"trigger,omitempty"` + // Whether to save the agent as an unpublished draft instead of publishing it. + // + Draft *bool `default:"false" json:"draft"` +} + +func (p PlatformAgentCreateRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PlatformAgentCreateRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, []string{"name"}); err != nil { + return err + } + return nil } func (o *PlatformAgentCreateRequest) GetName() string { @@ -127,3 +145,10 @@ func (o *PlatformAgentCreateRequest) GetTrigger() *PlatformAgentTrigger { } return o.Trigger } + +func (o *PlatformAgentCreateRequest) GetDraft() *bool { + if o == nil { + return nil + } + return o.Draft +} diff --git a/tests/mockserver/internal/sdk/models/components/platformagentrunsummary.go b/tests/mockserver/internal/sdk/models/components/platformagentrunsummary.go new file mode 100644 index 000000000..44363579e --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformagentrunsummary.go @@ -0,0 +1,79 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 46da1e5c2cd5 + +package components + +import ( + "mockserver/internal/sdk/utils" + "time" +) + +// PlatformAgentRunSummary - Metadata of a persisted agent run, without its output or pending approvals. +type PlatformAgentRunSummary struct { + // ID of the run. Use it with the agent-scoped GET run endpoint. + 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"` + // Timestamp when the run reached SUCCEEDED, FAILED, or CANCELLED. Omitted in other states. + EndedAt *time.Time `json:"ended_at,omitempty"` + // What started an agent run. MANUAL is a user or API request, SCHEDULE is a recurring schedule, CONTENT_CHANGE is a change to indexed content, and CONTENT_SCHEDULE is a time relative to a content event such as a meeting. + // + TriggeredBy *PlatformAgentRunTrigger `json:"triggered_by,omitempty"` +} + +func (p PlatformAgentRunSummary) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PlatformAgentRunSummary) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, []string{"run_id", "agent_id", "state", "created_at"}); err != nil { + return err + } + return nil +} + +func (o *PlatformAgentRunSummary) GetRunID() string { + if o == nil { + return "" + } + return o.RunID +} + +func (o *PlatformAgentRunSummary) GetAgentID() string { + if o == nil { + return "" + } + return o.AgentID +} + +func (o *PlatformAgentRunSummary) GetState() PlatformAgentRunState { + if o == nil { + return PlatformAgentRunState("") + } + return o.State +} + +func (o *PlatformAgentRunSummary) GetCreatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.CreatedAt +} + +func (o *PlatformAgentRunSummary) GetEndedAt() *time.Time { + if o == nil { + return nil + } + return o.EndedAt +} + +func (o *PlatformAgentRunSummary) GetTriggeredBy() *PlatformAgentRunTrigger { + if o == nil { + return nil + } + return o.TriggeredBy +} diff --git a/tests/mockserver/internal/sdk/models/components/platformagentruntrigger.go b/tests/mockserver/internal/sdk/models/components/platformagentruntrigger.go new file mode 100644 index 000000000..cf2b1b9fc --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformagentruntrigger.go @@ -0,0 +1,42 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 22c606adead4 + +package components + +import ( + "encoding/json" + "fmt" +) + +// PlatformAgentRunTrigger - What started an agent run. MANUAL is a user or API request, SCHEDULE is a recurring schedule, CONTENT_CHANGE is a change to indexed content, and CONTENT_SCHEDULE is a time relative to a content event such as a meeting. +type PlatformAgentRunTrigger string + +const ( + PlatformAgentRunTriggerManual PlatformAgentRunTrigger = "MANUAL" + PlatformAgentRunTriggerSchedule PlatformAgentRunTrigger = "SCHEDULE" + PlatformAgentRunTriggerContentChange PlatformAgentRunTrigger = "CONTENT_CHANGE" + PlatformAgentRunTriggerContentSchedule PlatformAgentRunTrigger = "CONTENT_SCHEDULE" +) + +func (e PlatformAgentRunTrigger) ToPointer() *PlatformAgentRunTrigger { + return &e +} +func (e *PlatformAgentRunTrigger) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "MANUAL": + fallthrough + case "SCHEDULE": + fallthrough + case "CONTENT_CHANGE": + fallthrough + case "CONTENT_SCHEDULE": + *e = PlatformAgentRunTrigger(v) + return nil + default: + return fmt.Errorf("invalid value for PlatformAgentRunTrigger: %v", v) + } +} diff --git a/tests/mockserver/internal/sdk/models/components/platformagentssearchrequest.go b/tests/mockserver/internal/sdk/models/components/platformagentssearchrequest.go index b1089d540..c37073b01 100644 --- a/tests/mockserver/internal/sdk/models/components/platformagentssearchrequest.go +++ b/tests/mockserver/internal/sdk/models/components/platformagentssearchrequest.go @@ -3,9 +3,29 @@ package components +import ( + "mockserver/internal/sdk/utils" +) + type PlatformAgentsSearchRequest struct { // Case-insensitive substring to match against agent names. If omitted or empty, no name filter is applied. Name *string `json:"name,omitempty"` + // Maximum number of agents to return. Defaults to 100. Maximum is 100. + PageSize *int64 `default:"100" json:"page_size"` + // Opaque pagination cursor from a previous response. Send the same name that the previous request used. + // + Cursor *string `json:"cursor,omitempty"` +} + +func (p PlatformAgentsSearchRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PlatformAgentsSearchRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, nil); err != nil { + return err + } + return nil } func (o *PlatformAgentsSearchRequest) GetName() *string { @@ -14,3 +34,17 @@ func (o *PlatformAgentsSearchRequest) GetName() *string { } return o.Name } + +func (o *PlatformAgentsSearchRequest) GetPageSize() *int64 { + if o == nil { + return nil + } + return o.PageSize +} + +func (o *PlatformAgentsSearchRequest) GetCursor() *string { + if o == nil { + return nil + } + return o.Cursor +} diff --git a/tests/mockserver/internal/sdk/models/components/platformagentssearchresponse.go b/tests/mockserver/internal/sdk/models/components/platformagentssearchresponse.go index 891f69638..6b8481d5c 100644 --- a/tests/mockserver/internal/sdk/models/components/platformagentssearchresponse.go +++ b/tests/mockserver/internal/sdk/models/components/platformagentssearchresponse.go @@ -3,9 +3,17 @@ package components +import ( + "mockserver/internal/sdk/optionalnullable" +) + type PlatformAgentsSearchResponse struct { - // Agents matching the search request. + // Agents on this page that match the search request. Agents []PlatformAgent `json:"agents"` + // Whether more matching agents are available after this page. + HasMore bool `json:"has_more"` + // Opaque cursor for the next page; null or absent when has_more is false. + NextCursor optionalnullable.OptionalNullable[string] `json:"next_cursor,omitempty"` // Platform-generated request ID for support correlation. RequestID string `json:"request_id"` } @@ -17,6 +25,20 @@ func (o *PlatformAgentsSearchResponse) GetAgents() []PlatformAgent { return o.Agents } +func (o *PlatformAgentsSearchResponse) GetHasMore() bool { + if o == nil { + return false + } + return o.HasMore +} + +func (o *PlatformAgentsSearchResponse) GetNextCursor() optionalnullable.OptionalNullable[string] { + if o == nil { + return nil + } + return o.NextCursor +} + func (o *PlatformAgentsSearchResponse) GetRequestID() string { if o == nil { return "" diff --git a/tests/mockserver/internal/sdk/models/components/platformagentupdaterequest.go b/tests/mockserver/internal/sdk/models/components/platformagentupdaterequest.go index 3cf44a122..2b07afdce 100644 --- a/tests/mockserver/internal/sdk/models/components/platformagentupdaterequest.go +++ b/tests/mockserver/internal/sdk/models/components/platformagentupdaterequest.go @@ -39,6 +39,9 @@ type PlatformAgentUpdateRequest struct { Subagents []PlatformSubagent `json:"subagents,omitempty"` // How the agent is invoked. Applies to top-level agents only. Trigger *PlatformAgentTrigger `json:"trigger,omitempty"` + // Whether the update is saved as an unpublished draft. Defaults to the agent's current state. `false` publishes a draft agent. `true` isn't allowed for a published agent. + // + Draft *bool `json:"draft,omitempty"` } func (o *PlatformAgentUpdateRequest) GetName() *string { @@ -124,3 +127,10 @@ func (o *PlatformAgentUpdateRequest) GetTrigger() *PlatformAgentTrigger { } return o.Trigger } + +func (o *PlatformAgentUpdateRequest) GetDraft() *bool { + if o == nil { + return nil + } + return o.Draft +} diff --git a/tests/mockserver/internal/sdk/models/components/platformagentversion.go b/tests/mockserver/internal/sdk/models/components/platformagentversion.go new file mode 100644 index 000000000..68f584db7 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformagentversion.go @@ -0,0 +1,52 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 9887566a9bd6 + +package components + +import ( + "mockserver/internal/sdk/utils" + "time" +) + +// PlatformAgentVersion - A named, immutable snapshot of an agent. +type PlatformAgentVersion struct { + // Opaque ID of the version, unique within the agent. It is not an ordinal; do not sort or compare IDs. + // + VersionID string `json:"version_id"` + // Name given to the version when it was created. + DisplayName string `json:"display_name"` + // Time the version was created. + CreatedAt time.Time `json:"created_at"` +} + +func (p PlatformAgentVersion) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PlatformAgentVersion) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, []string{"version_id", "display_name", "created_at"}); err != nil { + return err + } + return nil +} + +func (o *PlatformAgentVersion) GetVersionID() string { + if o == nil { + return "" + } + return o.VersionID +} + +func (o *PlatformAgentVersion) GetDisplayName() string { + if o == nil { + return "" + } + return o.DisplayName +} + +func (o *PlatformAgentVersion) GetCreatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.CreatedAt +} diff --git a/tests/mockserver/internal/sdk/models/components/platformagentversioncreaterequest.go b/tests/mockserver/internal/sdk/models/components/platformagentversioncreaterequest.go new file mode 100644 index 000000000..f2b3a7603 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformagentversioncreaterequest.go @@ -0,0 +1,26 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: a76dbb4d40e8 + +package components + +// PlatformAgentVersionCreateRequest - Complete agent to save and the name of the version. +type PlatformAgentVersionCreateRequest struct { + // Name of the version. Leading and trailing whitespace is removed. + DisplayName string `json:"display_name"` + // Complete agent definition. + Agent PlatformAgentCreateRequest `json:"agent"` +} + +func (o *PlatformAgentVersionCreateRequest) GetDisplayName() string { + if o == nil { + return "" + } + return o.DisplayName +} + +func (o *PlatformAgentVersionCreateRequest) GetAgent() PlatformAgentCreateRequest { + if o == nil { + return PlatformAgentCreateRequest{} + } + return o.Agent +} diff --git a/tests/mockserver/internal/sdk/models/components/platformagentversiongetresponse.go b/tests/mockserver/internal/sdk/models/components/platformagentversiongetresponse.go new file mode 100644 index 000000000..d00c1c041 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformagentversiongetresponse.go @@ -0,0 +1,26 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 3655950c7f44 + +package components + +// PlatformAgentVersionGetResponse - A saved version of an agent. +type PlatformAgentVersionGetResponse struct { + // A saved version of an agent and the complete agent it saved. + Version PlatformAgentVersionWithDefinition `json:"version"` + // Platform-generated request ID for support correlation. + RequestID string `json:"request_id"` +} + +func (o *PlatformAgentVersionGetResponse) GetVersion() PlatformAgentVersionWithDefinition { + if o == nil { + return PlatformAgentVersionWithDefinition{} + } + return o.Version +} + +func (o *PlatformAgentVersionGetResponse) GetRequestID() string { + if o == nil { + return "" + } + return o.RequestID +} diff --git a/tests/mockserver/internal/sdk/models/components/platformagentversionslistresponse.go b/tests/mockserver/internal/sdk/models/components/platformagentversionslistresponse.go new file mode 100644 index 000000000..ae107ffc9 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformagentversionslistresponse.go @@ -0,0 +1,48 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 84066baf4fe2 + +package components + +import ( + "mockserver/internal/sdk/optionalnullable" +) + +// PlatformAgentVersionsListResponse - One page of saved versions of an agent. +type PlatformAgentVersionsListResponse struct { + // Versions of the agent, newest first. + Results []PlatformAgentVersion `json:"results"` + // Whether more versions are available after this page. + HasMore bool `json:"has_more"` + // Opaque cursor for the next page; null or absent when has_more is false. + NextCursor optionalnullable.OptionalNullable[string] `json:"next_cursor,omitempty"` + // Platform-generated request ID for support correlation. + RequestID string `json:"request_id"` +} + +func (o *PlatformAgentVersionsListResponse) GetResults() []PlatformAgentVersion { + if o == nil { + return []PlatformAgentVersion{} + } + return o.Results +} + +func (o *PlatformAgentVersionsListResponse) GetHasMore() bool { + if o == nil { + return false + } + return o.HasMore +} + +func (o *PlatformAgentVersionsListResponse) GetNextCursor() optionalnullable.OptionalNullable[string] { + if o == nil { + return nil + } + return o.NextCursor +} + +func (o *PlatformAgentVersionsListResponse) GetRequestID() string { + if o == nil { + return "" + } + return o.RequestID +} diff --git a/tests/mockserver/internal/sdk/models/components/platformagentversionwithdefinition.go b/tests/mockserver/internal/sdk/models/components/platformagentversionwithdefinition.go new file mode 100644 index 000000000..de8a78c39 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformagentversionwithdefinition.go @@ -0,0 +1,61 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 33cc426ecf98 + +package components + +import ( + "mockserver/internal/sdk/utils" + "time" +) + +// PlatformAgentVersionWithDefinition - A saved version of an agent and the complete agent it saved. +type PlatformAgentVersionWithDefinition struct { + // Opaque ID of the version, unique within the agent. It is not an ordinal; do not sort or compare IDs. + // + VersionID string `json:"version_id"` + // Name given to the version when it was created. + DisplayName string `json:"display_name"` + // Time the version was created. + CreatedAt time.Time `json:"created_at"` + // An agent available to the authenticated user. + Agent PlatformAgent `json:"agent"` +} + +func (p PlatformAgentVersionWithDefinition) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PlatformAgentVersionWithDefinition) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, []string{"version_id", "display_name", "created_at", "agent"}); err != nil { + return err + } + return nil +} + +func (o *PlatformAgentVersionWithDefinition) GetVersionID() string { + if o == nil { + return "" + } + return o.VersionID +} + +func (o *PlatformAgentVersionWithDefinition) GetDisplayName() string { + if o == nil { + return "" + } + return o.DisplayName +} + +func (o *PlatformAgentVersionWithDefinition) GetCreatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.CreatedAt +} + +func (o *PlatformAgentVersionWithDefinition) GetAgent() PlatformAgent { + if o == nil { + return PlatformAgent{} + } + return o.Agent +} diff --git a/tests/mockserver/internal/sdk/models/components/platformlistadminagentsresponse.go b/tests/mockserver/internal/sdk/models/components/platformlistadminagentsresponse.go index c5ba2f2e8..5ede56728 100644 --- a/tests/mockserver/internal/sdk/models/components/platformlistadminagentsresponse.go +++ b/tests/mockserver/internal/sdk/models/components/platformlistadminagentsresponse.go @@ -9,7 +9,8 @@ import ( // PlatformListAdminAgentsResponse - One page of agents. type PlatformListAdminAgentsResponse struct { - // The agents on this page, ordered by name and then by agent_id. + // The agents on this page, ordered by name and then by agent_id. Only about the first 2 KB of a name is compared, less when agent_id is long, so names that share that leading part are ordered by agent_id. + // Results []PlatformAgent `json:"results"` // Whether more agents are available after this page. HasMore bool `json:"has_more"` diff --git a/tests/mockserver/internal/sdk/models/components/platformlistagentrunsresponse.go b/tests/mockserver/internal/sdk/models/components/platformlistagentrunsresponse.go new file mode 100644 index 000000000..ae144ba71 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformlistagentrunsresponse.go @@ -0,0 +1,48 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 524cf9827a91 + +package components + +import ( + "mockserver/internal/sdk/optionalnullable" +) + +// PlatformListAgentRunsResponse - One page of the authenticated user's runs of an agent. +type PlatformListAgentRunsResponse struct { + // The runs on this page, newest first, ordered by created_at and then by run_id. + Results []PlatformAgentRunSummary `json:"results"` + // Whether more runs are available after this page. + HasMore bool `json:"has_more"` + // Opaque cursor for the next page; null or absent when has_more is false. + NextCursor optionalnullable.OptionalNullable[string] `json:"next_cursor,omitempty"` + // Request identifier for correlating this response. + RequestID string `json:"request_id"` +} + +func (o *PlatformListAgentRunsResponse) GetResults() []PlatformAgentRunSummary { + if o == nil { + return []PlatformAgentRunSummary{} + } + return o.Results +} + +func (o *PlatformListAgentRunsResponse) GetHasMore() bool { + if o == nil { + return false + } + return o.HasMore +} + +func (o *PlatformListAgentRunsResponse) GetNextCursor() optionalnullable.OptionalNullable[string] { + if o == nil { + return nil + } + return o.NextCursor +} + +func (o *PlatformListAgentRunsResponse) GetRequestID() string { + if o == nil { + return "" + } + return o.RequestID +} diff --git a/tests/mockserver/internal/sdk/models/components/platformlistdepartmentsresponse.go b/tests/mockserver/internal/sdk/models/components/platformlistdepartmentsresponse.go index a00ff10bd..f92fc19cb 100644 --- a/tests/mockserver/internal/sdk/models/components/platformlistdepartmentsresponse.go +++ b/tests/mockserver/internal/sdk/models/components/platformlistdepartmentsresponse.go @@ -9,7 +9,7 @@ import ( // PlatformListDepartmentsResponse - One page of departments. type PlatformListDepartmentsResponse struct { - // The departments on this page, ordered by display_name and then by department_id. + // The departments on this page, ordered by display_name and then by department_id. Only about the first 2 KB of a name is compared, less when department_id is long, so names that share that leading part are ordered by department_id. // Results []PlatformDepartmentReference `json:"results"` // Whether more departments are available after this page. diff --git a/tests/mockserver/internal/sdk/models/components/platformlistidpgroupsresponse.go b/tests/mockserver/internal/sdk/models/components/platformlistidpgroupsresponse.go index 6c2cdf0e9..ec313b019 100644 --- a/tests/mockserver/internal/sdk/models/components/platformlistidpgroupsresponse.go +++ b/tests/mockserver/internal/sdk/models/components/platformlistidpgroupsresponse.go @@ -9,7 +9,7 @@ import ( // PlatformListIdpGroupsResponse - One page of IdP groups. type PlatformListIdpGroupsResponse struct { - // The IdP groups on this page, ordered by display_name and then by idp_group_id. + // The IdP groups on this page, ordered by display_name and then by idp_group_id. Only about the first 2 KB of a name is compared, less when idp_group_id is long, so names that share that leading part are ordered by idp_group_id. // Results []PlatformIdpGroup `json:"results"` // Whether more IdP groups are available after this page. diff --git a/tests/mockserver/internal/sdk/models/components/platformlistoauthclientsresponse.go b/tests/mockserver/internal/sdk/models/components/platformlistoauthclientsresponse.go index 2b393bcc0..31abc42b5 100644 --- a/tests/mockserver/internal/sdk/models/components/platformlistoauthclientsresponse.go +++ b/tests/mockserver/internal/sdk/models/components/platformlistoauthclientsresponse.go @@ -9,7 +9,8 @@ import ( // PlatformListOAuthClientsResponse - One page of OAuth clients. type PlatformListOAuthClientsResponse struct { - // The clients on this page, ordered by display_name and then by client_id. + // The clients on this page, ordered by display_name and then by client_id. Only about the first 2 KB of a name is compared, less when client_id is long, so names that share that leading part are ordered by client_id. + // Results []PlatformOAuthClient `json:"results"` // Whether more clients are available after this page. HasMore bool `json:"has_more"` diff --git a/tests/mockserver/internal/sdk/models/components/platformlistusersresponse.go b/tests/mockserver/internal/sdk/models/components/platformlistusersresponse.go index e3b40b307..3f409fb70 100644 --- a/tests/mockserver/internal/sdk/models/components/platformlistusersresponse.go +++ b/tests/mockserver/internal/sdk/models/components/platformlistusersresponse.go @@ -9,7 +9,8 @@ import ( // PlatformListUsersResponse - One page of users. type PlatformListUsersResponse struct { - // The users on this page, ordered by display_name and then by user_id. + // The users on this page, ordered by display_name and then by user_id. Only about the first 2 KB of a name is compared, less when user_id is long, so names that share that leading part are ordered by user_id. + // Results []PlatformUser `json:"results"` // Whether more users are available after this page. HasMore bool `json:"has_more"` diff --git a/tests/mockserver/internal/sdk/models/operations/platformagentscreate.go b/tests/mockserver/internal/sdk/models/operations/platformagentscreate.go index f2775424a..d2b009ecb 100644 --- a/tests/mockserver/internal/sdk/models/operations/platformagentscreate.go +++ b/tests/mockserver/internal/sdk/models/operations/platformagentscreate.go @@ -9,7 +9,7 @@ import ( type PlatformAgentsCreateResponse struct { HTTPMeta components.HTTPMetadata `json:"-"` - // Agent created and published. + // Agent created. PlatformAgentGetResponse *components.PlatformAgentGetResponse } diff --git a/tests/mockserver/internal/sdk/models/operations/platformagentscreateversion.go b/tests/mockserver/internal/sdk/models/operations/platformagentscreateversion.go new file mode 100644 index 000000000..a2e8f8f10 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/platformagentscreateversion.go @@ -0,0 +1,48 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 57a8c7967180 + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PlatformAgentsCreateVersionRequest struct { + // ID of the agent to save a version of. + AgentID string `pathParam:"style=simple,explode=false,name=agent_id"` + Body components.PlatformAgentVersionCreateRequest `request:"mediaType=application/json"` +} + +func (o *PlatformAgentsCreateVersionRequest) GetAgentID() string { + if o == nil { + return "" + } + return o.AgentID +} + +func (o *PlatformAgentsCreateVersionRequest) GetBody() components.PlatformAgentVersionCreateRequest { + if o == nil { + return components.PlatformAgentVersionCreateRequest{} + } + return o.Body +} + +type PlatformAgentsCreateVersionResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Agent version created. + PlatformAgentVersionGetResponse *components.PlatformAgentVersionGetResponse +} + +func (o *PlatformAgentsCreateVersionResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *PlatformAgentsCreateVersionResponse) GetPlatformAgentVersionGetResponse() *components.PlatformAgentVersionGetResponse { + if o == nil { + return nil + } + return o.PlatformAgentVersionGetResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/platformagentsdeleteversion.go b/tests/mockserver/internal/sdk/models/operations/platformagentsdeleteversion.go new file mode 100644 index 000000000..4285fb3b6 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/platformagentsdeleteversion.go @@ -0,0 +1,40 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: fd9e540eca55 + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PlatformAgentsDeleteVersionRequest struct { + // ID of the agent. + AgentID string `pathParam:"style=simple,explode=false,name=agent_id"` + // Opaque ID of the agent version to delete, as returned by List agent versions. + VersionID string `pathParam:"style=simple,explode=false,name=version_id"` +} + +func (o *PlatformAgentsDeleteVersionRequest) GetAgentID() string { + if o == nil { + return "" + } + return o.AgentID +} + +func (o *PlatformAgentsDeleteVersionRequest) GetVersionID() string { + if o == nil { + return "" + } + return o.VersionID +} + +type PlatformAgentsDeleteVersionResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` +} + +func (o *PlatformAgentsDeleteVersionResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} diff --git a/tests/mockserver/internal/sdk/models/operations/platformagentsgetversion.go b/tests/mockserver/internal/sdk/models/operations/platformagentsgetversion.go new file mode 100644 index 000000000..022e62567 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/platformagentsgetversion.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: e7fe93090f68 + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PlatformAgentsGetVersionRequest struct { + // ID of the agent. + AgentID string `pathParam:"style=simple,explode=false,name=agent_id"` + // Opaque ID of the agent version to retrieve, as returned by List agent versions. + VersionID string `pathParam:"style=simple,explode=false,name=version_id"` +} + +func (o *PlatformAgentsGetVersionRequest) GetAgentID() string { + if o == nil { + return "" + } + return o.AgentID +} + +func (o *PlatformAgentsGetVersionRequest) GetVersionID() string { + if o == nil { + return "" + } + return o.VersionID +} + +type PlatformAgentsGetVersionResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Successful response. + PlatformAgentVersionGetResponse *components.PlatformAgentVersionGetResponse +} + +func (o *PlatformAgentsGetVersionResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *PlatformAgentsGetVersionResponse) GetPlatformAgentVersionGetResponse() *components.PlatformAgentVersionGetResponse { + if o == nil { + return nil + } + return o.PlatformAgentVersionGetResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/platformagentslistruns.go b/tests/mockserver/internal/sdk/models/operations/platformagentslistruns.go new file mode 100644 index 000000000..ab4f6464c --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/platformagentslistruns.go @@ -0,0 +1,71 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: d6cb397f45f9 + +package operations + +import ( + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/utils" +) + +type PlatformAgentsListRunsRequest struct { + // ID of the agent whose runs should be listed. + AgentID string `pathParam:"style=simple,explode=false,name=agent_id"` + // Maximum number of runs to return. Defaults to 50. Maximum is 100. + PageSize *int64 `default:"50" queryParam:"style=form,explode=true,name=page_size"` + // Opaque pagination cursor from a previous response. Send it with the same agent_id that the previous request used. + // + Cursor *string `queryParam:"style=form,explode=true,name=cursor"` +} + +func (p PlatformAgentsListRunsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PlatformAgentsListRunsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, []string{"agent_id"}); err != nil { + return err + } + return nil +} + +func (o *PlatformAgentsListRunsRequest) GetAgentID() string { + if o == nil { + return "" + } + return o.AgentID +} + +func (o *PlatformAgentsListRunsRequest) GetPageSize() *int64 { + if o == nil { + return nil + } + return o.PageSize +} + +func (o *PlatformAgentsListRunsRequest) GetCursor() *string { + if o == nil { + return nil + } + return o.Cursor +} + +type PlatformAgentsListRunsResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Successful response. + PlatformListAgentRunsResponse *components.PlatformListAgentRunsResponse +} + +func (o *PlatformAgentsListRunsResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *PlatformAgentsListRunsResponse) GetPlatformListAgentRunsResponse() *components.PlatformListAgentRunsResponse { + if o == nil { + return nil + } + return o.PlatformListAgentRunsResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/platformagentslistversions.go b/tests/mockserver/internal/sdk/models/operations/platformagentslistversions.go new file mode 100644 index 000000000..bb0af5d4f --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/platformagentslistversions.go @@ -0,0 +1,70 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 9a0be9b4c525 + +package operations + +import ( + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/utils" +) + +type PlatformAgentsListVersionsRequest struct { + // ID of the agent whose versions to list. + AgentID string `pathParam:"style=simple,explode=false,name=agent_id"` + // Maximum number of versions to return. Defaults to 20. Maximum is 50. + PageSize *int64 `default:"20" queryParam:"style=form,explode=true,name=page_size"` + // Opaque pagination cursor returned as next_cursor by the previous page. + Cursor *string `queryParam:"style=form,explode=true,name=cursor"` +} + +func (p PlatformAgentsListVersionsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PlatformAgentsListVersionsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, []string{"agent_id"}); err != nil { + return err + } + return nil +} + +func (o *PlatformAgentsListVersionsRequest) GetAgentID() string { + if o == nil { + return "" + } + return o.AgentID +} + +func (o *PlatformAgentsListVersionsRequest) GetPageSize() *int64 { + if o == nil { + return nil + } + return o.PageSize +} + +func (o *PlatformAgentsListVersionsRequest) GetCursor() *string { + if o == nil { + return nil + } + return o.Cursor +} + +type PlatformAgentsListVersionsResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Successful response. + PlatformAgentVersionsListResponse *components.PlatformAgentVersionsListResponse +} + +func (o *PlatformAgentsListVersionsResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *PlatformAgentsListVersionsResponse) GetPlatformAgentVersionsListResponse() *components.PlatformAgentVersionsListResponse { + if o == nil { + return nil + } + return o.PlatformAgentVersionsListResponse +} diff --git a/tests/mockserver/internal/sdk/models/operations/platformagentsupdate.go b/tests/mockserver/internal/sdk/models/operations/platformagentsupdate.go index ed24f5f0e..010ccea0a 100644 --- a/tests/mockserver/internal/sdk/models/operations/platformagentsupdate.go +++ b/tests/mockserver/internal/sdk/models/operations/platformagentsupdate.go @@ -29,7 +29,7 @@ func (o *PlatformAgentsUpdateRequest) GetBody() components.PlatformAgentUpdateRe type PlatformAgentsUpdateResponse struct { HTTPMeta components.HTTPMetadata `json:"-"` - // Agent updated and published. + // Agent updated. PlatformAgentGetResponse *components.PlatformAgentGetResponse } diff --git a/tests/test_agents.py b/tests/test_agents.py index 5532cb18c..c8d8efca9 100644 --- a/tests/test_agents.py +++ b/tests/test_agents.py @@ -87,7 +87,7 @@ def test_agents_platform_agents_search(): ) as glean: assert glean is not None - res = glean.agents.search(name="HR Policy Agent") + res = glean.agents.search(name="HR Policy Agent", page_size=100, cursor="") assert res is not None @@ -216,6 +216,7 @@ def test_agents_platform_agents_create(): "name": "HR Policy Agent", }, ], + draft=False, ) assert res is not None @@ -240,3 +241,66 @@ def test_agents_platform_agents_update(): ], ) assert res is not None + + +def test_agents_platform_agents_list_runs(): + test_http_client = create_test_http_client("platform-agents-list-runs") + + 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.list_runs(agent_id="{agent_id}", page_size=50) + assert res is not None + + +def test_agents_platform_agents_list_versions(): + test_http_client = create_test_http_client("platform-agents-list-versions") + + 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.list_versions(agent_id="{agent_id}", page_size=20) + assert res is not None + + +def test_agents_platform_agents_create_version(): + test_http_client = create_test_http_client("platform-agents-create-version") + + 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.create_version( + agent_id="{agent_id}", + display_name="Caterina.Walsh", + agent={ + "name": "HR Policy Agent", + "instructions": "Answer employee questions about HR policies and benefits.", + }, + ) + assert res is not None + + +def test_agents_platform_agents_get_version(): + test_http_client = create_test_http_client("platform-agents-get-version") + + 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_version(agent_id="{agent_id}", version_id="{version_id}") + assert res is not None diff --git a/tests/test_summarize.py b/tests/test_summarize.py index 59a3def44..6ccab4117 100644 --- a/tests/test_summarize.py +++ b/tests/test_summarize.py @@ -19,11 +19,11 @@ def test_summarize_summarize(): res = glean.client.documents.summarize( document_specs=[ { - "ugc_type": models.DocumentSpecUgcType2.CHATS, - "ugc_id": "", + "url": "https://huge-gym.net/", }, { - "url": "https://heavy-castanet.name", + "ugc_type": models.DocumentSpecUgcType2.COLLECTIONS, + "ugc_id": "", }, ] )