From f850853d718bead290d1076419501d1c4078dcd1 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Fri, 13 Nov 2026 05:31:42 +0000 Subject: [PATCH 1/2] =?UTF-8?q?##=20Python=20SDK=20Changes:=20*=20`glean.c?= =?UTF-8?q?hat.create()`:=20=20=20*=20=20`request.text`=20**Removed**=20(B?= =?UTF-8?q?reaking=20=E2=9A=A0=EF=B8=8F)=20=20=20*=20=20`response.output[]?= =?UTF-8?q?.content[].structured=5Foutput`=20**Removed**=20(Breaking=20?= =?UTF-8?q?=E2=9A=A0=EF=B8=8F)=20*=20`glean.chat.create=5Fstream()`:=20=20?= =?UTF-8?q?=20*=20=20`request.text`=20**Removed**=20(Breaking=20=E2=9A=A0?= =?UTF-8?q?=EF=B8=8F)=20=20=20*=20=20`response.[].union(RESPONSE=5FCOMPLET?= =?UTF-8?q?ED).data.response.output[].content[].structured=5Foutput`=20**R?= =?UTF-8?q?emoved**=20(Breaking=20=E2=9A=A0=EF=B8=8F)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .speakeasy/gen.lock | 141 ++++++------------ .speakeasy/gen.yaml | 2 +- .speakeasy/glean-merged-spec.yaml | 83 +---------- .speakeasy/tests.arazzo.yaml | 17 +-- .speakeasy/workflow.lock | 10 +- README.md | 25 +--- RELEASES.md | 12 +- docs/models/platformchatcreateformat.md | 20 --- docs/models/platformchatcreaterequest.md | 13 +- docs/models/platformchatcreatestreamformat.md | 20 --- .../models/platformchatcreatestreamrequest.md | 13 +- docs/models/platformchatcreatestreamtext.md | 11 -- docs/models/platformchatcreatetext.md | 11 -- docs/models/platformchatjsonschemaformat.md | 14 -- .../platformchatjsonschemaformattype.md | 18 --- docs/models/platformchatoutputtextcontent.md | 11 +- docs/models/platformchattextformat.md | 10 -- docs/models/platformchattextformattype.md | 18 --- docs/models/structuredoutput.md | 10 -- docs/sdks/chatsdk/README.md | 76 ++-------- pyproject.toml | 2 +- src/glean/api_client/_version.py | 4 +- src/glean/api_client/chat_sdk.py | 38 ----- src/glean/api_client/models/__init__.py | 52 ------- .../models/platform_chat_create_streamop.py | 91 +---------- .../models/platform_chat_createop.py | 91 +---------- .../models/platformchatjsonschemaformat.py | 88 ----------- .../models/platformchatoutputtextcontent.py | 33 +--- .../models/platformchattextformat.py | 26 ---- .../handler/pathpostrestapiv1getchat.go | 4 +- .../platformchatjsonschemaformat.go | 94 ------------ .../platformchatoutputtextcontent.go | 32 +--- .../components/platformchattextformat.go | 57 ------- .../models/operations/platformchatcreate.go | 125 ---------------- .../operations/platformchatcreatestream.go | 125 ---------------- tests/test_chat_sdk.py | 27 +--- tests/test_messages.py | 2 +- tests/test_summarize.py | 7 +- 38 files changed, 123 insertions(+), 1310 deletions(-) delete mode 100644 docs/models/platformchatcreateformat.md delete mode 100644 docs/models/platformchatcreatestreamformat.md delete mode 100644 docs/models/platformchatcreatestreamtext.md delete mode 100644 docs/models/platformchatcreatetext.md delete mode 100644 docs/models/platformchatjsonschemaformat.md delete mode 100644 docs/models/platformchatjsonschemaformattype.md delete mode 100644 docs/models/platformchattextformat.md delete mode 100644 docs/models/platformchattextformattype.md delete mode 100644 docs/models/structuredoutput.md delete mode 100644 src/glean/api_client/models/platformchatjsonschemaformat.py delete mode 100644 src/glean/api_client/models/platformchattextformat.py delete mode 100644 tests/mockserver/internal/sdk/models/components/platformchatjsonschemaformat.go delete mode 100644 tests/mockserver/internal/sdk/models/components/platformchattextformat.go diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 78217f78..e82dbd6b 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: de30adaa45770c1a3dd4fee14b4cc346 + docChecksum: 7db0ead9bec260217a64b6c0e4af16af docVersion: 0.9.0 speakeasyVersion: 1.808.1 generationVersion: 2.960.8 - releaseVersion: 0.17.21 - configChecksum: 8b7b0e067cb1656303a9aee28978f0d6 + releaseVersion: 0.17.22 + configChecksum: 03c050fa75fe3af2cf8e8db8785450c7 repoURL: https://github.com/gleanwork/api-client-python.git installationURL: https://github.com/gleanwork/api-client-python.git published: true persistentEdits: - generation_id: 9c460740-b2af-437d-a8e5-fa70e03c1d38 - pristine_commit_hash: c7aea59ae01d2f731334aaaa934a6416598a070b - pristine_tree_hash: 98ec66bc2e7d74024cde4db8612a238cfc55c571 + generation_id: c0db4c77-e6b3-408d-bb6b-1b5a136263f1 + pristine_commit_hash: 996c61281cc8e953e846ac385b5e014c2ffd181e + pristine_tree_hash: 0ad6f0c1713b5b6552685bd2d12264afa63b8fc3 features: python: acceptHeaders: 3.0.0 @@ -2464,38 +2464,22 @@ trackedFiles: id: f52ac98c71f7 last_write_checksum: sha1:08119b0731b552212f11f6f657a933cd06d9daec pristine_git_object: 8bed3e0696e7a1665d1fc1ef77e883aa51affcb1 - docs/models/platformchatcreateformat.md: - id: 53f6779cbcc1 - last_write_checksum: sha1:d2b68def8f3f46964b40e23908b228dae2655976 - pristine_git_object: 25911073b669c1dd17a2c5eaf013ce2b4e5a658d docs/models/platformchatcreateinput.md: id: b5ef80519bcf last_write_checksum: sha1:923de319896bc8dbb4af15eae03baae730fd3042 pristine_git_object: 9ee0df259532723cb625e145c48c0daf7d7a0d8e docs/models/platformchatcreaterequest.md: id: cd33a9dfda85 - last_write_checksum: sha1:f91b8d077e108c2443046cd352c0e0b61088c20f - pristine_git_object: a100754d2fdfb6f0f3e2b5d3159821af7940a599 - docs/models/platformchatcreatestreamformat.md: - id: ccb1551a8c8e - last_write_checksum: sha1:57dfe924da40ac64e9f79e0c71581f77d6df3928 - pristine_git_object: cc3cd2a27c473e4f1cefd06b11d62422ff99a2ca + last_write_checksum: sha1:0e26aaf39478d21d6bcf3730943323ff34b2a710 + pristine_git_object: 82808d05f9f69e0885883471aac9783c67801d62 docs/models/platformchatcreatestreaminput.md: id: 8db5acf6cc48 last_write_checksum: sha1:26e70a3ce28592c6059c62370d882f66f28e1387 pristine_git_object: 250ba3f9e5482057896cf121968d834590649a3f docs/models/platformchatcreatestreamrequest.md: id: 2f7f30973ec2 - last_write_checksum: sha1:c1446ea9c05c4dfd89c358f5dcca1239a0fa7872 - pristine_git_object: aec04e2f76921921e815343430d1092e1c59bcbc - docs/models/platformchatcreatestreamtext.md: - id: a52a018a9526 - last_write_checksum: sha1:3e9e6bae9fefd9b98013439548d486e4beb2f239 - pristine_git_object: 7430aa9b3f62d0ba505d24f7d5d103f992182964 - docs/models/platformchatcreatetext.md: - id: 12feab50ab5f - last_write_checksum: sha1:4f98b57804261f0fc9731fab7b4d4050539d333b - pristine_git_object: c478436a86c79fa8d90a49a78fdef9b7b8d562d0 + last_write_checksum: sha1:6e27a56cbd02cb01db44a93d1758245221c2897d + pristine_git_object: 484d017f9d5e02aeae6539c1a354644b4c1b9436 docs/models/platformchatcustomentitysource.md: id: 6e12deaeb23d last_write_checksum: sha1:b8ef7e1c92d45a3a3329a88b57361ba9553f28b3 @@ -2552,14 +2536,6 @@ trackedFiles: id: 0b46bce28b93 last_write_checksum: sha1:f48e66526e0a2167b36ca51042ccd0df50b1c59c pristine_git_object: cdf92876978850841d258d07db48586891089897 - docs/models/platformchatjsonschemaformat.md: - id: 29557ecc1f88 - last_write_checksum: sha1:b197e839c292086859672655aec3ad11fc4b0225 - pristine_git_object: 3e3ca482c1a6e8e541186a2c11ed9357173dec8f - docs/models/platformchatjsonschemaformattype.md: - id: e4b29294992e - last_write_checksum: sha1:39db49a6c9769940dfedd5c91242023fc29d9f9c - pristine_git_object: 392a76942323c44d896f2234f90aa09765f265c5 docs/models/platformchatoutputmessage.md: id: d236a3fe09a2 last_write_checksum: sha1:be7029860368e4db9a914916e2e2617f233f24aa @@ -2574,8 +2550,8 @@ trackedFiles: pristine_git_object: c14068505b05003de4e946a3418828950b15479a docs/models/platformchatoutputtextcontent.md: id: fd2f6a03da55 - last_write_checksum: sha1:816d395dc42172fdb4095d8dae2d444d9d7aa2f4 - pristine_git_object: 36632e3d967a901c9b5b1b79eb2281194f13c947 + last_write_checksum: sha1:c72902588f7531a39f1783e29433709cfe157a7a + pristine_git_object: 1ea074b5e646042d60c921c8d3351e31bc0ccde2 docs/models/platformchatoutputtextcontenttype.md: id: 2eca715382a5 last_write_checksum: sha1:89991c8d41e18cda29836b95477f9d6fc9919f58 @@ -2668,14 +2644,6 @@ trackedFiles: id: c6a5277b7a47 last_write_checksum: sha1:71c8bed820b7b848be51e3bff787a8de38f69e5a pristine_git_object: d878152e2e4f6647625177367828b3089c1b7688 - docs/models/platformchattextformat.md: - id: a4833ce90d4b - last_write_checksum: sha1:42528858a22ad1cca3768b7288f087a2537a7935 - pristine_git_object: 12f678b7a178b7302a0b88a3def5841eeb36d950 - docs/models/platformchattextformattype.md: - id: 9e6fcfac780d - last_write_checksum: sha1:2798b71f71f95463c94a66dd13fb46ed2c771030 - pristine_git_object: 9dca496f3bd03eecee4196bf3bc511881540242f docs/models/platformchatupdaterequest.md: id: a5dae222a93b last_write_checksum: sha1:34245e45937fd8109b22e9f4e6ee68b17df00d59 @@ -3764,10 +3732,6 @@ trackedFiles: id: 794ea7f6265f last_write_checksum: sha1:7bee77ab7e9a46141d09a5a5980d3136ae34ac10 pristine_git_object: 9da32f0e7841e87099fbe94de2e2e025f62070c2 - docs/models/structuredoutput.md: - id: f2e447188759 - last_write_checksum: sha1:0fefd8718435f3a6ea2372819a35db97ec6927a3 - pristine_git_object: 45e8ab02d1f563d01c5045ae21340c61bd259a2d docs/models/structuredresult.md: id: 64daefd6d356 last_write_checksum: sha1:ae2a47158f5495406f756eabceab6bb523faabf3 @@ -4202,8 +4166,8 @@ trackedFiles: pristine_git_object: 7a32df2aaa86d449b50aa15dc7bd474076ca50c7 docs/sdks/chatsdk/README.md: id: 83b4ee321663 - last_write_checksum: sha1:15bcb7c627ccfcf0e9f2dd91a31162c7eec3e24b - pristine_git_object: 17bb210c07581298cf12b4ecde5c6f35cd2887e2 + last_write_checksum: sha1:5aedc870e49bd088f1242031f30b9d24fe477810 + pristine_git_object: 8d09405e888b87183d310981641b95b56ded4b54 docs/sdks/clientactivity/README.md: id: a309613986a5 last_write_checksum: sha1:d5807da8dd2a67bc3b4fe60ed32c057e0e3969d1 @@ -4354,8 +4318,8 @@ trackedFiles: pristine_git_object: 79e388be87446ab6a4064b372bad0e8376d0cb5e pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:904b56067548cc123897bcbb78d8a1b1d7b250bc - pristine_git_object: f1cfff38c1f92f6215d337ba120b8eb3b05f3d1f + last_write_checksum: sha1:ff1ceb73761bec861be29a607f6065f8bf2ee76b + pristine_git_object: 5c29efd83f7213ff002729387541796178e1f3d3 scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:c2c83f71dea61eb50c9e05da83b16d18b4da8794 @@ -4382,8 +4346,8 @@ trackedFiles: pristine_git_object: 55f23c1feabfedeb7e8cd5bea8b910f0ae0b77d9 src/glean/api_client/_version.py: id: 0ce22b26136b - last_write_checksum: sha1:c701d4165261b90fc16d8508f6e8b930a7395223 - pristine_git_object: a5a33c340b66dcfa2d0c36e7e2afc1c89b9f26c8 + last_write_checksum: sha1:712deb63e9ba8856e0c48c8205a210122161618f + pristine_git_object: f1ac4b054a285d6b9b5ec9bede847e0be77a6151 src/glean/api_client/admin.py: id: 583cfae82adf last_write_checksum: sha1:3c462f418d2b32a90c92f88121867a73295b0c6c @@ -4414,8 +4378,8 @@ trackedFiles: pristine_git_object: bf7b1b3b25ce6530403b0dd9f60599d236c780ce src/glean/api_client/chat_sdk.py: id: f2f30e13ca42 - last_write_checksum: sha1:8fdb0ef4c29c4b1c5c85dbee1c46d5f679c1435c - pristine_git_object: 427b775456514d6e9c55e30eca4b5ac0dbec4a76 + last_write_checksum: sha1:11d3e0df09df7294186ecf51ab9d1e349ec01c0e + pristine_git_object: 27377b0c168c9a232c8b1c1b31e7b064a64a43c6 src/glean/api_client/client.py: id: c0c188098f10 last_write_checksum: sha1:bfadba5dfdc64280fd9c7bdbf96a0651e5db429f @@ -4590,8 +4554,8 @@ trackedFiles: pristine_git_object: b140b656b788bb0deb8a974420783b338f0521e2 src/glean/api_client/models/__init__.py: id: d5f6ea5efcbe - last_write_checksum: sha1:f8959db0f9a4a09eb23b54e9d9b337cafe9ae1be - pristine_git_object: 7e50e3beea7b1c3580487865a52e465058170e4f + last_write_checksum: sha1:f3721e5c48040f1f8d253b4bfb7d8515798511a0 + pristine_git_object: 1f55fb2312489bb9d7a6d2bf7144e872d2b4635b src/glean/api_client/models/accessrequestpermissiondeniedresponse_error.py: id: 22a2fa0d5899 last_write_checksum: sha1:f7dd6f906a4dd7433992f77395f9fb491fa5ac5c @@ -6358,12 +6322,12 @@ trackedFiles: pristine_git_object: 880c65c1e74dd49543d650516f29141c6cdd486d src/glean/api_client/models/platform_chat_create_streamop.py: id: 6950e1c0b047 - last_write_checksum: sha1:f9e4d2c3e9f8649b1c7c73ee654b514933eb191d - pristine_git_object: d6108f8648cf71018155d86edcab967d866ff7e5 + last_write_checksum: sha1:2ed68379d99dcfb99723e83f5028c0379dc56f4a + pristine_git_object: b027a9810e0991d6981c818338a763c8289dd93f src/glean/api_client/models/platform_chat_createop.py: id: 6f911817c878 - last_write_checksum: sha1:77a9e4bb9c351ddb1e49bc86752f7db615157997 - pristine_git_object: f665f10e4bd415bf9b40ee3d24c9858164a56ff4 + last_write_checksum: sha1:70c7b597ffaa287b3a1743bd5e237da6170a9996 + pristine_git_object: cf6715233a3dd62c006b23ad8a30064d17ce66a3 src/glean/api_client/models/platform_chat_updateop.py: id: 58966e27d7e7 last_write_checksum: sha1:2d6cfc9569deaa7fb12df7d3fdff40620b774e50 @@ -6604,18 +6568,14 @@ trackedFiles: id: e32871fda394 last_write_checksum: sha1:1ddb82a8dcac6a1943b99fb2cdfb2c464e8eab07 pristine_git_object: 9d21d2a18e6de246b38312c05fafc8698635ac6a - src/glean/api_client/models/platformchatjsonschemaformat.py: - id: 322d59bf877b - last_write_checksum: sha1:56a2b8cacc110e4a4166147ca49720040c8aa7b2 - pristine_git_object: 678b1637b906a85fa76209f612e3c2aadae672a6 src/glean/api_client/models/platformchatoutputmessage.py: id: 15c8512d3810 last_write_checksum: sha1:1f0846a6e9bf7c2a1b9f5ea870cb0c4f6896c449 pristine_git_object: 9082277a0bb6b75d23c5fef7eead2aa13d8147cf src/glean/api_client/models/platformchatoutputtextcontent.py: id: 91b9987e8b98 - last_write_checksum: sha1:f25ce61d99c20e52066551ae852831a7baa176ca - pristine_git_object: 95f2197811610de058a96b12fe13bd3a747e3330 + last_write_checksum: sha1:853911b43b1405aea913b8d99b48fccffd421daa + pristine_git_object: 3d7372ecacba4d3dc8eeb86fd4409152ad3f1bd2 src/glean/api_client/models/platformchatpersonsource.py: id: 617b816c747b last_write_checksum: sha1:66cb394dca359b95b1d5f0245f0d1aacfb86640c @@ -6676,10 +6636,6 @@ trackedFiles: id: aa2699dde615 last_write_checksum: sha1:84a982e5b6011ebd58188738adb5d0be0e144567 pristine_git_object: bb83bfdd35e6f1bbdf2e5107059e76b06aab032b - src/glean/api_client/models/platformchattextformat.py: - id: 4436e4437556 - last_write_checksum: sha1:ecc4be5d35513e1210ebe1b1e0bc3e05994392c0 - pristine_git_object: aa54c4dc3c2b0ee6258485830b0686c67dde1024 src/glean/api_client/models/platformchatupdaterequest.py: id: 72fe79f34479 last_write_checksum: sha1:b4d3549817741a90d00cbde47e32a72e82e91fa3 @@ -8506,8 +8462,8 @@ trackedFiles: pristine_git_object: abb763ddc8504b28c0cb6fdf8d25237d46e21bab tests/mockserver/internal/handler/pathpostrestapiv1getchat.go: id: a0ec7bafa599 - last_write_checksum: sha1:2267292ba8173cf8df70ddbc6ac02ff3439cb879 - pristine_git_object: 8740195860b6c08e036caae19aab8e7374350960 + last_write_checksum: sha1:b48e2313407814ee4f8ed181b8e5299a84960c44 + pristine_git_object: 96d4127e0455272a9842e2d1954e5fcefa3278cc tests/mockserver/internal/handler/pathpostrestapiv1getchatapplication.go: id: 7d101c69d4bc last_write_checksum: sha1:7b81898137fdb3a89b4dcfa318b9b5b92e8860c0 @@ -10228,18 +10184,14 @@ trackedFiles: id: 56818bc51e4c last_write_checksum: sha1:42af3af208da28f93f0f2201e3daa8b46a7e1dba pristine_git_object: 97c1e067fb5ecb6b2f97606419d967243488f520 - tests/mockserver/internal/sdk/models/components/platformchatjsonschemaformat.go: - id: cc1306c208a9 - last_write_checksum: sha1:527ce820f2fb0f577db45b4e8606a75e30972a35 - pristine_git_object: c4d9b0045f3e0a8916c241e2eb5c74ad087d369e tests/mockserver/internal/sdk/models/components/platformchatoutputmessage.go: id: 7ca1fc5cc683 last_write_checksum: sha1:bf719da0350fbfafdb9b2459c45ec90fdeff26be pristine_git_object: e8c6012073e865db79260a12e8b831b0bdc61be0 tests/mockserver/internal/sdk/models/components/platformchatoutputtextcontent.go: id: b5d5f31f9886 - last_write_checksum: sha1:fea1f3e8d5792e1a177da5c0daa1d9a345327a4a - pristine_git_object: 098822c3050a5e4b1f4491cfd5a79b4abc982653 + last_write_checksum: sha1:54300f2566d258c2125b840e17a7697051c02dfa + pristine_git_object: f3be4768043133e7909aca58d1c7f863c74bcecf tests/mockserver/internal/sdk/models/components/platformchatpersonsource.go: id: b44852860bd9 last_write_checksum: sha1:ae83c0e9521f08d5818d9aa5cff33ca7233239a7 @@ -10300,10 +10252,6 @@ trackedFiles: id: cb4b807c5c50 last_write_checksum: sha1:6cc1fb47210182778dd6dd3a302a118d8c23b73a pristine_git_object: 8aeae90099849c9ecb918ad377780b2d6e8a7b0c - tests/mockserver/internal/sdk/models/components/platformchattextformat.go: - id: 14602a472dd8 - last_write_checksum: sha1:826eb39a034b76967e29dfe3f70f4bec9e0e8135 - pristine_git_object: 2549e7933847138506f468b7a25b926e41956ed5 tests/mockserver/internal/sdk/models/components/platformchatupdaterequest.go: id: 9f1fca4acef9 last_write_checksum: sha1:068603139dc99bb02e1d2622339d2ea91da9a504 @@ -11726,12 +11674,12 @@ trackedFiles: pristine_git_object: cdbc9f550e7d2339b0946fe4783a3b79a851f39d tests/mockserver/internal/sdk/models/operations/platformchatcreate.go: id: 38da4ead08a1 - last_write_checksum: sha1:132487da1ca61b58f81bd20d939ffedd7109bb3f - pristine_git_object: 58f6721f458a1908990afc4e4fd18729ac8cfbd4 + last_write_checksum: sha1:19b0801c6aea2f64707c910040ce0abe0abf0007 + pristine_git_object: c9dbd053cf81d79d52e8f61733224a1b98bbf3c1 tests/mockserver/internal/sdk/models/operations/platformchatcreatestream.go: id: 32e8d932ca7e - last_write_checksum: sha1:1a6315bfac761b2d944e618ecfd6f1cb188b5184 - pristine_git_object: 72e44e52569b6b6fb2337c2652105791315952bf + last_write_checksum: sha1:828c8e37232571f5737fed9c01bcbde3dc856068 + pristine_git_object: d94a54b7ed3d227a61ab2b41f443a8aca9adf755 tests/mockserver/internal/sdk/models/operations/platformchatupdate.go: id: 22d1a2eec7e3 last_write_checksum: sha1:f37fe98a94f1dc2f0a044f6ed776ff2f4c6e0996 @@ -12242,8 +12190,8 @@ trackedFiles: pristine_git_object: d2b02f269ac418b9a9240772f28ab1bd3cfa4997 tests/test_chat_sdk.py: id: d6e6d5c5a1b2 - last_write_checksum: sha1:51e2c3ff1fa90ac015d66a2a774d353daa498f4a - pristine_git_object: 36e625c2989821a0bb140c8722fe3a99eed9c846 + last_write_checksum: sha1:c8d44c74922b645a941e0507927bc68afbe7be1b + pristine_git_object: f8a75b6655c2b5ea33604a68bb5883265cd7e90b tests/test_client.py: id: 6b61d4b06ccc last_write_checksum: sha1:df970d19cdb9f9e057722699dc73965b6f9b1758 @@ -12342,8 +12290,8 @@ trackedFiles: pristine_git_object: 6cc8aeec3c52329d389081db0a27f10f53f214b9 tests/test_messages.py: id: be23089b1f8b - last_write_checksum: sha1:2404e23964ef6a1f5ddc900402b34e597d2d9617 - pristine_git_object: 132005ec7d1e35f805b6a8c28e07e043bce22f0a + last_write_checksum: sha1:5db8087e85104ab50b362638150fa1f6686a3c30 + pristine_git_object: c0fd29dab7d365ef9d78c0c291b925e6b9fd7298 tests/test_people.py: id: 37c243940039 last_write_checksum: sha1:2b78b1c5ea17f267895188b1b48ff9fe2bc19f17 @@ -12370,8 +12318,8 @@ trackedFiles: pristine_git_object: 1c854370da050c261cb2cbcf9cc16829f5d8e78c tests/test_summarize.py: id: a255d8a6f627 - last_write_checksum: sha1:8f1ca2be59f1c913c8b60bc931be12743f5456dc - pristine_git_object: 5401883ff0180af3a47608b1d8984f520e6d240d + last_write_checksum: sha1:27f1c7a6c3acd199a3ed350b4bfc8a09c48a96bd + pristine_git_object: 9efa5c1d63d430a96553b99c2e2c987c64941690 tests/test_tools.py: id: 70889bdf7321 last_write_checksum: sha1:e9e37efd6a65d805c02d70d548df9c87dd062b0e @@ -13545,7 +13493,7 @@ examples: platform-chat-create: speakeasy-default-platform-chat-create: requestBody: - application/json: {"input": "Summarize our parental leave policy as JSON.", "stream": false, "store": true, "text": {"format": {"type": "JSON_SCHEMA", "name": "policy_summary", "schema": {"type": "object", "properties": {"eligible_employees": {"type": "string"}, "duration_weeks": {"type": "integer"}}, "required": ["eligible_employees", "duration_weeks"]}, "strict": true}}} + application/json: {"input": "Summarize our parental leave policy.", "stream": false, "store": true} responses: "200": application/json: {"id": "", "object": "RESPONSE", "created_at": "2026-05-19T05:32:52.505Z", "status": "COMPLETED", "output": [{"type": "MESSAGE", "role": "ASSISTANT", "content": [{"type": "OUTPUT_TEXT", "text": ""}]}], "store": false, "request_id": ""} @@ -13780,7 +13728,7 @@ examples: platform-chat-create-stream: speakeasy-default-platform-chat-create-stream: requestBody: - application/json: {"input": "Summarize our parental leave policy as JSON.", "stream": true, "store": true, "text": {"format": {"type": "JSON_SCHEMA", "name": "policy_summary", "schema": {"type": "object", "properties": {"eligible_employees": {"type": "string"}, "duration_weeks": {"type": "integer"}}, "required": ["eligible_employees", "duration_weeks"]}, "strict": true}}} + application/json: {"input": "Summarize our parental leave policy.", "stream": true, "store": true} responses: "400": application/problem+json: {"type": "https://developers.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developers.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} @@ -14233,6 +14181,7 @@ generatedTests: platform-documents-get-by-url: "2026-11-09T19:56:00Z" platform-documents-get: "2026-11-09T19:56:00Z" platform-documents-batch: "2026-11-09T19:56:00Z" +releaseNotes: "## Python SDK Changes:\n* `glean.chat.create()`: \n * `request.text` **Removed** (Breaking ⚠️)\n * `response.output[].content[].structured_output` **Removed** (Breaking ⚠️)\n* `glean.chat.create_stream()`: \n * `request.text` **Removed** (Breaking ⚠️)\n * `response.[].union(RESPONSE_COMPLETED).data.response.output[].content[].structured_output` **Removed** (Breaking ⚠️)\n" generatedFiles: - .devcontainer/README.md - .devcontainer/devcontainer.json diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 7bcdd043..6d1e1d76 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -35,7 +35,7 @@ generation: generateNewTests: true skipResponseBodyAssertions: true python: - version: 0.17.21 + version: 0.17.22 additionalDependencies: dev: {} main: diff --git a/.speakeasy/glean-merged-spec.yaml b/.speakeasy/glean-merged-spec.yaml index 58ef91e2..a8ede817 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: 77999be6fb7bac7ce1b740a5f554037282298b5d - x-open-api-commit-sha: ea654b06c64649ac0076b89cdcea6e0792daec11 + x-source-commit-sha: d0dbc7b464c50db93861cf4f3c0d374c0c8b1a39 + x-open-api-commit-sha: aafc9eb0a47add94983a44ca92a52f31e24ea7ed 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. @@ -9840,72 +9840,13 @@ components: content: type: string minLength: 1 - PlatformChatTextFormat: - type: object - additionalProperties: false - description: Unconstrained plain-text assistant output. - required: - - type - properties: - type: - type: string - description: Discriminator. Must be TEXT. - enum: - - TEXT - PlatformChatJsonSchemaFormat: - type: object - additionalProperties: false - description: Constrains the assistant response to a caller-supplied JSON Schema. - required: - - type - - name - - schema - properties: - type: - type: string - description: Discriminator. Must be JSON_SCHEMA. - enum: - - JSON_SCHEMA - name: - type: string - minLength: 1 - maxLength: 64 - description: A stable identifier for the schema. - description: - type: string - maxLength: 1024 - description: An optional human-readable description of the schema. - schema: - type: object - additionalProperties: true - description: A JSON Schema object describing the desired output shape. - strict: - type: boolean - default: true - description: | - When true, the provider validates the response against the schema. Unsupported by some providers; defaults to true. PlatformChatCreateRequest: type: object additionalProperties: false required: - input example: - input: Summarize our parental leave policy as JSON. - text: - format: - type: JSON_SCHEMA - name: policy_summary - schema: - type: object - properties: - eligible_employees: - type: string - duration_weeks: - type: integer - required: - - eligible_employees - - duration_weeks - strict: true + input: Summarize our parental leave policy. properties: input: description: | @@ -9932,18 +9873,6 @@ components: minLength: 1 description: | Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`. - text: - type: object - additionalProperties: false - description: | - Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. - properties: - format: - description: | - Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. - oneOf: - - $ref: "#/components/schemas/PlatformChatTextFormat" - - $ref: "#/components/schemas/PlatformChatJsonSchemaFormat" PlatformChatStreamResponseId: type: string minLength: 1 @@ -9963,12 +9892,6 @@ components: - OUTPUT_TEXT text: type: string - structured_output: - type: - - object - - "null" - description: | - Parsed and validated JSON object when structured output was requested. Present only when the request included `text.format.type: JSON_SCHEMA`. annotations: type: array items: diff --git a/.speakeasy/tests.arazzo.yaml b/.speakeasy/tests.arazzo.yaml index 57315162..7de95fbe 100644 --- a/.speakeasy/tests.arazzo.yaml +++ b/.speakeasy/tests.arazzo.yaml @@ -159057,24 +159057,9 @@ workflows: requestBody: contentType: application/json payload: - input: Summarize our parental leave policy as JSON. + input: Summarize our parental leave policy. store: true stream: false - text: - format: - name: policy_summary - schema: - properties: - duration_weeks: - type: integer - eligible_employees: - type: string - required: - - eligible_employees - - duration_weeks - type: object - strict: true - type: JSON_SCHEMA successCriteria: - condition: $statusCode == 200 - condition: $response.header.Content-Type == application/json diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 3a37942c..eda6c2df 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.808.1 sources: Glean API: sourceNamespace: glean-api-specs - sourceRevisionDigest: sha256:509e25a8ae0bbaf6e23c95c58de651349216086a13278a3792b2e3f8be68fc6b - sourceBlobDigest: sha256:15ce4e757fd8eb3c2a3857cb15740c718b57c969342223ccc0de7437748a8609 + sourceRevisionDigest: sha256:944e067962243f50e69e5d92bc4f12480dcfe9ef75cb4ad0894367e1c0c6dbd0 + sourceBlobDigest: sha256:a801af72fad0680a940fa6819af3d54251e473e961254ab1f0a918332f725cd5 tags: - latest Glean Client API: @@ -16,10 +16,10 @@ targets: glean: source: Glean API sourceNamespace: glean-api-specs - sourceRevisionDigest: sha256:509e25a8ae0bbaf6e23c95c58de651349216086a13278a3792b2e3f8be68fc6b - sourceBlobDigest: sha256:15ce4e757fd8eb3c2a3857cb15740c718b57c969342223ccc0de7437748a8609 + sourceRevisionDigest: sha256:944e067962243f50e69e5d92bc4f12480dcfe9ef75cb4ad0894367e1c0c6dbd0 + sourceBlobDigest: sha256:a801af72fad0680a940fa6819af3d54251e473e961254ab1f0a918332f725cd5 codeSamplesNamespace: glean-api-specs-python-code-samples - codeSamplesRevisionDigest: sha256:5de9ed3291b25ba50b857aa18d4dca14272ee47e2ce880201d3f3def4d0c5b63 + codeSamplesRevisionDigest: sha256:2994fe38335b43341a5248e1694efe9cc1902a4788b861c3f2768e78927baa9e workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index d8c81a5a..c105f90f 100644 --- a/README.md +++ b/README.md @@ -640,7 +640,7 @@ The stream is also a [Context Manager][context-manager] and can be used with the underlying connection when the context is exited. ```python -from glean.api_client import Glean, models +from glean.api_client import Glean import os @@ -648,28 +648,7 @@ with Glean( api_token=os.getenv("GLEAN_API_TOKEN"), ) as glean: - res = glean.chat.create_stream(input="Summarize our parental leave policy as JSON.", store=True, text={ - "format_": { - "type": models.PlatformChatJSONSchemaFormatType.JSON_SCHEMA, - "name": "policy_summary", - "schema_": { - "type": "object", - "properties": { - "eligible_employees": { - "type": "string", - }, - "duration_weeks": { - "type": "integer", - }, - }, - "required": [ - "eligible_employees", - "duration_weeks", - ], - }, - "strict": True, - }, - }) + res = glean.chat.create_stream(input="Summarize our parental leave policy.", store=True) with res as event_stream: for event in event_stream: diff --git a/RELEASES.md b/RELEASES.md index 19ec2bbf..76c32e9f 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1068,4 +1068,14 @@ Based on: ### Generated - [python v0.17.21] . ### Releases -- [PyPI v0.17.21] https://pypi.org/project/glean-api-client/0.17.21 - . \ No newline at end of file +- [PyPI v0.17.21] https://pypi.org/project/glean-api-client/0.17.21 - . + +## 2026-11-13 05:28:49 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.808.1 (2.960.8) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.17.22] . +### Releases +- [PyPI v0.17.22] https://pypi.org/project/glean-api-client/0.17.22 - . \ No newline at end of file diff --git a/docs/models/platformchatcreateformat.md b/docs/models/platformchatcreateformat.md deleted file mode 100644 index 25911073..00000000 --- a/docs/models/platformchatcreateformat.md +++ /dev/null @@ -1,20 +0,0 @@ -# PlatformChatCreateFormat - -Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. - - - -## Supported Types - -### `models.PlatformChatTextFormat` - -```python -value: models.PlatformChatTextFormat = /* values here */ -``` - -### `models.PlatformChatJSONSchemaFormat` - -```python -value: models.PlatformChatJSONSchemaFormat = /* values here */ -``` - diff --git a/docs/models/platformchatcreaterequest.md b/docs/models/platformchatcreaterequest.md index a100754d..82808d05 100644 --- a/docs/models/platformchatcreaterequest.md +++ b/docs/models/platformchatcreaterequest.md @@ -3,10 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `input` | [models.PlatformChatCreateInput](../models/platformchatcreateinput.md) | :heavy_check_mark: | Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`.
| -| `stream` | *Optional[Literal[False]]* | :heavy_minus_sign: | N/A | -| `store` | *Optional[bool]* | :heavy_minus_sign: | When true (default), persist the interaction and return a `conversation_id`. When false, run ephemerally with no persistence.
| -| `conversation_id` | *Optional[str]* | :heavy_minus_sign: | Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`.
| -| `text` | [Optional[models.PlatformChatCreateText]](../models/platformchatcreatetext.md) | :heavy_minus_sign: | Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true.
| \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | +| `input` | [models.PlatformChatCreateInput](../models/platformchatcreateinput.md) | :heavy_check_mark: | Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`.
| +| `stream` | *Optional[Literal[False]]* | :heavy_minus_sign: | N/A | +| `store` | *Optional[bool]* | :heavy_minus_sign: | When true (default), persist the interaction and return a `conversation_id`. When false, run ephemerally with no persistence.
| +| `conversation_id` | *Optional[str]* | :heavy_minus_sign: | Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`.
| \ No newline at end of file diff --git a/docs/models/platformchatcreatestreamformat.md b/docs/models/platformchatcreatestreamformat.md deleted file mode 100644 index cc3cd2a2..00000000 --- a/docs/models/platformchatcreatestreamformat.md +++ /dev/null @@ -1,20 +0,0 @@ -# PlatformChatCreateStreamFormat - -Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. - - - -## Supported Types - -### `models.PlatformChatTextFormat` - -```python -value: models.PlatformChatTextFormat = /* values here */ -``` - -### `models.PlatformChatJSONSchemaFormat` - -```python -value: models.PlatformChatJSONSchemaFormat = /* values here */ -``` - diff --git a/docs/models/platformchatcreatestreamrequest.md b/docs/models/platformchatcreatestreamrequest.md index aec04e2f..484d017f 100644 --- a/docs/models/platformchatcreatestreamrequest.md +++ b/docs/models/platformchatcreatestreamrequest.md @@ -3,10 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `input` | [models.PlatformChatCreateStreamInput](../models/platformchatcreatestreaminput.md) | :heavy_check_mark: | Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`.
| -| `stream` | *Optional[Literal[True]]* | :heavy_minus_sign: | N/A | -| `store` | *Optional[bool]* | :heavy_minus_sign: | When true (default), persist the interaction and return a `conversation_id`. When false, run ephemerally with no persistence.
| -| `conversation_id` | *Optional[str]* | :heavy_minus_sign: | Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`.
| -| `text` | [Optional[models.PlatformChatCreateStreamText]](../models/platformchatcreatestreamtext.md) | :heavy_minus_sign: | Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true.
| \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | +| `input` | [models.PlatformChatCreateStreamInput](../models/platformchatcreatestreaminput.md) | :heavy_check_mark: | Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`.
| +| `stream` | *Optional[Literal[True]]* | :heavy_minus_sign: | N/A | +| `store` | *Optional[bool]* | :heavy_minus_sign: | When true (default), persist the interaction and return a `conversation_id`. When false, run ephemerally with no persistence.
| +| `conversation_id` | *Optional[str]* | :heavy_minus_sign: | Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`.
| \ No newline at end of file diff --git a/docs/models/platformchatcreatestreamtext.md b/docs/models/platformchatcreatestreamtext.md deleted file mode 100644 index 7430aa9b..00000000 --- a/docs/models/platformchatcreatestreamtext.md +++ /dev/null @@ -1,11 +0,0 @@ -# PlatformChatCreateStreamText - -Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. - - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | -| `format_` | [Optional[models.PlatformChatCreateStreamFormat]](../models/platformchatcreatestreamformat.md) | :heavy_minus_sign: | Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema.
| \ No newline at end of file diff --git a/docs/models/platformchatcreatetext.md b/docs/models/platformchatcreatetext.md deleted file mode 100644 index c478436a..00000000 --- a/docs/models/platformchatcreatetext.md +++ /dev/null @@ -1,11 +0,0 @@ -# PlatformChatCreateText - -Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. - - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | -| `format_` | [Optional[models.PlatformChatCreateFormat]](../models/platformchatcreateformat.md) | :heavy_minus_sign: | Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema.
| \ No newline at end of file diff --git a/docs/models/platformchatjsonschemaformat.md b/docs/models/platformchatjsonschemaformat.md deleted file mode 100644 index 3e3ca482..00000000 --- a/docs/models/platformchatjsonschemaformat.md +++ /dev/null @@ -1,14 +0,0 @@ -# PlatformChatJSONSchemaFormat - -Constrains the assistant response to a caller-supplied JSON Schema. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -| `type` | [models.PlatformChatJSONSchemaFormatType](../models/platformchatjsonschemaformattype.md) | :heavy_check_mark: | Discriminator. Must be JSON_SCHEMA. | -| `name` | *str* | :heavy_check_mark: | A stable identifier for the schema. | -| `description` | *Optional[str]* | :heavy_minus_sign: | An optional human-readable description of the schema. | -| `schema_` | Dict[str, *Any*] | :heavy_check_mark: | A JSON Schema object describing the desired output shape. | -| `strict` | *Optional[bool]* | :heavy_minus_sign: | When true, the provider validates the response against the schema. Unsupported by some providers; defaults to true.
| \ No newline at end of file diff --git a/docs/models/platformchatjsonschemaformattype.md b/docs/models/platformchatjsonschemaformattype.md deleted file mode 100644 index 392a7694..00000000 --- a/docs/models/platformchatjsonschemaformattype.md +++ /dev/null @@ -1,18 +0,0 @@ -# PlatformChatJSONSchemaFormatType - -Discriminator. Must be JSON_SCHEMA. - -## Example Usage - -```python -from glean.api_client.models import PlatformChatJSONSchemaFormatType - -value = PlatformChatJSONSchemaFormatType.JSON_SCHEMA -``` - - -## Values - -| Name | Value | -| ------------- | ------------- | -| `JSON_SCHEMA` | JSON_SCHEMA | \ No newline at end of file diff --git a/docs/models/platformchatoutputtextcontent.md b/docs/models/platformchatoutputtextcontent.md index 36632e3d..1ea074b5 100644 --- a/docs/models/platformchatoutputtextcontent.md +++ b/docs/models/platformchatoutputtextcontent.md @@ -3,9 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | -| `type` | [models.PlatformChatOutputTextContentType](../models/platformchatoutputtextcontenttype.md) | :heavy_check_mark: | N/A | -| `text` | *str* | :heavy_check_mark: | N/A | -| `structured_output` | [OptionalNullable[models.StructuredOutput]](../models/structuredoutput.md) | :heavy_minus_sign: | Parsed and validated JSON object when structured output was requested. Present only when the request included `text.format.type: JSON_SCHEMA`.
| -| `annotations` | List[[models.PlatformChatCitationAnnotation](../models/platformchatcitationannotation.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `type` | [models.PlatformChatOutputTextContentType](../models/platformchatoutputtextcontenttype.md) | :heavy_check_mark: | N/A | +| `text` | *str* | :heavy_check_mark: | N/A | +| `annotations` | List[[models.PlatformChatCitationAnnotation](../models/platformchatcitationannotation.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/platformchattextformat.md b/docs/models/platformchattextformat.md deleted file mode 100644 index 12f678b7..00000000 --- a/docs/models/platformchattextformat.md +++ /dev/null @@ -1,10 +0,0 @@ -# PlatformChatTextFormat - -Unconstrained plain-text assistant output. - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `type` | [models.PlatformChatTextFormatType](../models/platformchattextformattype.md) | :heavy_check_mark: | Discriminator. Must be TEXT. | \ No newline at end of file diff --git a/docs/models/platformchattextformattype.md b/docs/models/platformchattextformattype.md deleted file mode 100644 index 9dca496f..00000000 --- a/docs/models/platformchattextformattype.md +++ /dev/null @@ -1,18 +0,0 @@ -# PlatformChatTextFormatType - -Discriminator. Must be TEXT. - -## Example Usage - -```python -from glean.api_client.models import PlatformChatTextFormatType - -value = PlatformChatTextFormatType.TEXT -``` - - -## Values - -| Name | Value | -| ------ | ------ | -| `TEXT` | TEXT | \ No newline at end of file diff --git a/docs/models/structuredoutput.md b/docs/models/structuredoutput.md deleted file mode 100644 index 45e8ab02..00000000 --- a/docs/models/structuredoutput.md +++ /dev/null @@ -1,10 +0,0 @@ -# StructuredOutput - -Parsed and validated JSON object when structured output was requested. Present only when the request included `text.format.type: JSON_SCHEMA`. - - - -## Fields - -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/sdks/chatsdk/README.md b/docs/sdks/chatsdk/README.md index 17bb210c..8d09405e 100644 --- a/docs/sdks/chatsdk/README.md +++ b/docs/sdks/chatsdk/README.md @@ -17,7 +17,7 @@ Run an assistant turn. The default response is JSON. HTTP clients request server ```python -from glean.api_client import Glean, models +from glean.api_client import Glean import os @@ -25,28 +25,7 @@ with Glean( api_token=os.getenv("GLEAN_API_TOKEN"), ) as glean: - res = glean.chat.create(input="Summarize our parental leave policy as JSON.", store=True, text={ - "format_": { - "type": models.PlatformChatJSONSchemaFormatType.JSON_SCHEMA, - "name": "policy_summary", - "schema_": { - "type": "object", - "properties": { - "eligible_employees": { - "type": "string", - }, - "duration_weeks": { - "type": "integer", - }, - }, - "required": [ - "eligible_employees", - "duration_weeks", - ], - }, - "strict": True, - }, - }) + res = glean.chat.create(input="Summarize our parental leave policy.", store=True) # Handle response print(res) @@ -55,13 +34,12 @@ with Glean( ### Parameters -| Parameter | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `input` | [models.PlatformChatCreateInput](../../models/platformchatcreateinput.md) | :heavy_check_mark: | Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`.
| -| `store` | *Optional[bool]* | :heavy_minus_sign: | When true (default), persist the interaction and return a `conversation_id`. When false, run ephemerally with no persistence.
| -| `conversation_id` | *Optional[str]* | :heavy_minus_sign: | Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`.
| -| `text` | [Optional[models.PlatformChatCreateText]](../../models/platformchatcreatetext.md) | :heavy_minus_sign: | Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true.
| -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | +| `input` | [models.PlatformChatCreateInput](../../models/platformchatcreateinput.md) | :heavy_check_mark: | Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`.
| +| `store` | *Optional[bool]* | :heavy_minus_sign: | When true (default), persist the interaction and return a `conversation_id`. When false, run ephemerally with no persistence.
| +| `conversation_id` | *Optional[str]* | :heavy_minus_sign: | Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`.
| +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response @@ -127,7 +105,7 @@ SDK-only logical operation. HTTP clients must call the base path; the URL fragme ```python -from glean.api_client import Glean, models +from glean.api_client import Glean import os @@ -135,28 +113,7 @@ with Glean( api_token=os.getenv("GLEAN_API_TOKEN"), ) as glean: - res = glean.chat.create_stream(input="Summarize our parental leave policy as JSON.", store=True, text={ - "format_": { - "type": models.PlatformChatJSONSchemaFormatType.JSON_SCHEMA, - "name": "policy_summary", - "schema_": { - "type": "object", - "properties": { - "eligible_employees": { - "type": "string", - }, - "duration_weeks": { - "type": "integer", - }, - }, - "required": [ - "eligible_employees", - "duration_weeks", - ], - }, - "strict": True, - }, - }) + res = glean.chat.create_stream(input="Summarize our parental leave policy.", store=True) with res as event_stream: for event in event_stream: @@ -167,13 +124,12 @@ with Glean( ### Parameters -| Parameter | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `input` | [models.PlatformChatCreateStreamInput](../../models/platformchatcreatestreaminput.md) | :heavy_check_mark: | Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`.
| -| `store` | *Optional[bool]* | :heavy_minus_sign: | When true (default), persist the interaction and return a `conversation_id`. When false, run ephemerally with no persistence.
| -| `conversation_id` | *Optional[str]* | :heavy_minus_sign: | Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`.
| -| `text` | [Optional[models.PlatformChatCreateStreamText]](../../models/platformchatcreatestreamtext.md) | :heavy_minus_sign: | Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true.
| -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | +| `input` | [models.PlatformChatCreateStreamInput](../../models/platformchatcreatestreaminput.md) | :heavy_check_mark: | Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`.
| +| `store` | *Optional[bool]* | :heavy_minus_sign: | When true (default), persist the interaction and return a `conversation_id`. When false, run ephemerally with no persistence.
| +| `conversation_id` | *Optional[str]* | :heavy_minus_sign: | Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`.
| +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response diff --git a/pyproject.toml b/pyproject.toml index f1cfff38..5c29efd8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "glean-api-client" -version = "0.17.21" +version = "0.17.22" 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 a5a33c34..f1ac4b05 100644 --- a/src/glean/api_client/_version.py +++ b/src/glean/api_client/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "glean-api-client" -__version__: str = "0.17.21" +__version__: str = "0.17.22" __openapi_doc_version__: str = "0.9.0" __gen_version__: str = "2.960.8" -__user_agent__: str = "speakeasy-sdk/python 0.17.21 2.960.8 0.9.0 glean-api-client" +__user_agent__: str = "speakeasy-sdk/python 0.17.22 2.960.8 0.9.0 glean-api-client" try: if __package__ is not None: diff --git a/src/glean/api_client/chat_sdk.py b/src/glean/api_client/chat_sdk.py index 427b7754..27377b0c 100644 --- a/src/glean/api_client/chat_sdk.py +++ b/src/glean/api_client/chat_sdk.py @@ -18,9 +18,6 @@ def create( ], store: Optional[bool] = True, conversation_id: Optional[str] = None, - text: Optional[ - Union[models.PlatformChatCreateText, models.PlatformChatCreateTextTypedDict] - ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -37,8 +34,6 @@ def create( :param conversation_id: Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`. - :param text: Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. - :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -58,9 +53,6 @@ def create( input=utils.get_pydantic_model(input, models.PlatformChatCreateInput), store=store, conversation_id=conversation_id, - text=utils.get_pydantic_model( - text, Optional[models.PlatformChatCreateText] - ), ) req = self._build_request( @@ -148,9 +140,6 @@ async def create_async( ], store: Optional[bool] = True, conversation_id: Optional[str] = None, - text: Optional[ - Union[models.PlatformChatCreateText, models.PlatformChatCreateTextTypedDict] - ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -167,8 +156,6 @@ async def create_async( :param conversation_id: Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`. - :param text: Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. - :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -188,9 +175,6 @@ async def create_async( input=utils.get_pydantic_model(input, models.PlatformChatCreateInput), store=store, conversation_id=conversation_id, - text=utils.get_pydantic_model( - text, Optional[models.PlatformChatCreateText] - ), ) req = self._build_request_async( @@ -513,12 +497,6 @@ def create_stream( ], store: Optional[bool] = True, conversation_id: Optional[str] = None, - text: Optional[ - Union[ - models.PlatformChatCreateStreamText, - models.PlatformChatCreateStreamTextTypedDict, - ] - ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -535,8 +513,6 @@ def create_stream( :param conversation_id: Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`. - :param text: Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. - :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -556,9 +532,6 @@ def create_stream( input=utils.get_pydantic_model(input, models.PlatformChatCreateStreamInput), store=store, conversation_id=conversation_id, - text=utils.get_pydantic_model( - text, Optional[models.PlatformChatCreateStreamText] - ), ) req = self._build_request( @@ -659,12 +632,6 @@ async def create_stream_async( ], store: Optional[bool] = True, conversation_id: Optional[str] = None, - text: Optional[ - Union[ - models.PlatformChatCreateStreamText, - models.PlatformChatCreateStreamTextTypedDict, - ] - ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -681,8 +648,6 @@ async def create_stream_async( :param conversation_id: Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`. - :param text: Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. - :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -702,9 +667,6 @@ async def create_stream_async( input=utils.get_pydantic_model(input, models.PlatformChatCreateStreamInput), store=store, conversation_id=conversation_id, - text=utils.get_pydantic_model( - text, Optional[models.PlatformChatCreateStreamText] - ), ) req = self._build_request_async( diff --git a/src/glean/api_client/models/__init__.py b/src/glean/api_client/models/__init__.py index 7e50e3be..1f55fb23 100644 --- a/src/glean/api_client/models/__init__.py +++ b/src/glean/api_client/models/__init__.py @@ -1332,24 +1332,16 @@ PlatformAgentsGetRequestTypedDict, ) from .platform_chat_create_streamop import ( - PlatformChatCreateStreamFormat, - PlatformChatCreateStreamFormatTypedDict, PlatformChatCreateStreamInput, PlatformChatCreateStreamInputTypedDict, PlatformChatCreateStreamRequest, PlatformChatCreateStreamRequestTypedDict, - PlatformChatCreateStreamText, - PlatformChatCreateStreamTextTypedDict, ) from .platform_chat_createop import ( - PlatformChatCreateFormat, - PlatformChatCreateFormatTypedDict, PlatformChatCreateInput, PlatformChatCreateInputTypedDict, PlatformChatCreateRequest, PlatformChatCreateRequestTypedDict, - PlatformChatCreateText, - PlatformChatCreateTextTypedDict, ) from .platform_chat_updateop import ( PlatformChatUpdateRequestRequest, @@ -1600,11 +1592,6 @@ PlatformChatInputMessageRole, PlatformChatInputMessageTypedDict, ) - from .platformchatjsonschemaformat import ( - PlatformChatJSONSchemaFormat, - PlatformChatJSONSchemaFormatType, - PlatformChatJSONSchemaFormatTypedDict, - ) from .platformchatoutputmessage import ( PlatformChatOutputMessage, PlatformChatOutputMessageRole, @@ -1615,8 +1602,6 @@ PlatformChatOutputTextContent, PlatformChatOutputTextContentType, PlatformChatOutputTextContentTypedDict, - StructuredOutput, - StructuredOutputTypedDict, ) from .platformchatpersonsource import ( PlatformChatPersonSource, @@ -1685,11 +1670,6 @@ PlatformChatStreamResponseFailedServerSentEvent, PlatformChatStreamResponseFailedServerSentEventTypedDict, ) - from .platformchattextformat import ( - PlatformChatTextFormat, - PlatformChatTextFormatType, - PlatformChatTextFormatTypedDict, - ) from .platformchatupdaterequest import ( PlatformChatUpdateRequest, PlatformChatUpdateRequestTypedDict, @@ -3604,22 +3584,14 @@ "PlatformChatCompletedResponseObject", "PlatformChatCompletedResponseStatus", "PlatformChatCompletedResponseTypedDict", - "PlatformChatCreateFormat", - "PlatformChatCreateFormatTypedDict", "PlatformChatCreateInput", "PlatformChatCreateInputTypedDict", "PlatformChatCreateRequest", "PlatformChatCreateRequestTypedDict", - "PlatformChatCreateStreamFormat", - "PlatformChatCreateStreamFormatTypedDict", "PlatformChatCreateStreamInput", "PlatformChatCreateStreamInputTypedDict", "PlatformChatCreateStreamRequest", "PlatformChatCreateStreamRequestTypedDict", - "PlatformChatCreateStreamText", - "PlatformChatCreateStreamTextTypedDict", - "PlatformChatCreateText", - "PlatformChatCreateTextTypedDict", "PlatformChatCustomEntitySource", "PlatformChatCustomEntitySourceType", "PlatformChatCustomEntitySourceTypedDict", @@ -3641,9 +3613,6 @@ "PlatformChatInputMessage", "PlatformChatInputMessageRole", "PlatformChatInputMessageTypedDict", - "PlatformChatJSONSchemaFormat", - "PlatformChatJSONSchemaFormatType", - "PlatformChatJSONSchemaFormatTypedDict", "PlatformChatOutputMessage", "PlatformChatOutputMessageRole", "PlatformChatOutputMessageType", @@ -3688,9 +3657,6 @@ "PlatformChatStreamResponseFailedServerSentEventTypedDict", "PlatformChatStreamResponseFailedType", "PlatformChatStreamResponseFailedTypedDict", - "PlatformChatTextFormat", - "PlatformChatTextFormatType", - "PlatformChatTextFormatTypedDict", "PlatformChatTypedDict", "PlatformChatUpdateRequest", "PlatformChatUpdateRequestRequest", @@ -4187,8 +4153,6 @@ "StructuredLinkTypedDict", "StructuredLocation", "StructuredLocationTypedDict", - "StructuredOutput", - "StructuredOutputTypedDict", "StructuredResult", "StructuredResultSource", "StructuredResultTypedDict", @@ -5317,22 +5281,14 @@ "PlatformAgentsGetSchemasRequestTypedDict": ".platform_agents_get_schemasop", "PlatformAgentsGetRequest": ".platform_agents_getop", "PlatformAgentsGetRequestTypedDict": ".platform_agents_getop", - "PlatformChatCreateStreamFormat": ".platform_chat_create_streamop", - "PlatformChatCreateStreamFormatTypedDict": ".platform_chat_create_streamop", "PlatformChatCreateStreamInput": ".platform_chat_create_streamop", "PlatformChatCreateStreamInputTypedDict": ".platform_chat_create_streamop", "PlatformChatCreateStreamRequest": ".platform_chat_create_streamop", "PlatformChatCreateStreamRequestTypedDict": ".platform_chat_create_streamop", - "PlatformChatCreateStreamText": ".platform_chat_create_streamop", - "PlatformChatCreateStreamTextTypedDict": ".platform_chat_create_streamop", - "PlatformChatCreateFormat": ".platform_chat_createop", - "PlatformChatCreateFormatTypedDict": ".platform_chat_createop", "PlatformChatCreateInput": ".platform_chat_createop", "PlatformChatCreateInputTypedDict": ".platform_chat_createop", "PlatformChatCreateRequest": ".platform_chat_createop", "PlatformChatCreateRequestTypedDict": ".platform_chat_createop", - "PlatformChatCreateText": ".platform_chat_createop", - "PlatformChatCreateTextTypedDict": ".platform_chat_createop", "PlatformChatUpdateRequestRequest": ".platform_chat_updateop", "PlatformChatUpdateRequestRequestTypedDict": ".platform_chat_updateop", "PlatformDepartmentsGetRequest": ".platform_departments_getop", @@ -5475,9 +5431,6 @@ "PlatformChatInputMessage": ".platformchatinputmessage", "PlatformChatInputMessageRole": ".platformchatinputmessage", "PlatformChatInputMessageTypedDict": ".platformchatinputmessage", - "PlatformChatJSONSchemaFormat": ".platformchatjsonschemaformat", - "PlatformChatJSONSchemaFormatType": ".platformchatjsonschemaformat", - "PlatformChatJSONSchemaFormatTypedDict": ".platformchatjsonschemaformat", "PlatformChatOutputMessage": ".platformchatoutputmessage", "PlatformChatOutputMessageRole": ".platformchatoutputmessage", "PlatformChatOutputMessageType": ".platformchatoutputmessage", @@ -5485,8 +5438,6 @@ "PlatformChatOutputTextContent": ".platformchatoutputtextcontent", "PlatformChatOutputTextContentType": ".platformchatoutputtextcontent", "PlatformChatOutputTextContentTypedDict": ".platformchatoutputtextcontent", - "StructuredOutput": ".platformchatoutputtextcontent", - "StructuredOutputTypedDict": ".platformchatoutputtextcontent", "PlatformChatPersonSource": ".platformchatpersonsource", "PlatformChatPersonSourceType": ".platformchatpersonsource", "PlatformChatPersonSourceTypedDict": ".platformchatpersonsource", @@ -5524,9 +5475,6 @@ "PlatformChatStreamResponseFailedTypedDict": ".platformchatstreamresponsefailed", "PlatformChatStreamResponseFailedServerSentEvent": ".platformchatstreamresponsefailedserversentevent", "PlatformChatStreamResponseFailedServerSentEventTypedDict": ".platformchatstreamresponsefailedserversentevent", - "PlatformChatTextFormat": ".platformchattextformat", - "PlatformChatTextFormatType": ".platformchattextformat", - "PlatformChatTextFormatTypedDict": ".platformchattextformat", "PlatformChatUpdateRequest": ".platformchatupdaterequest", "PlatformChatUpdateRequestTypedDict": ".platformchatupdaterequest", "PlatformChatUpdateResponse": ".platformchatupdateresponse", diff --git a/src/glean/api_client/models/platform_chat_create_streamop.py b/src/glean/api_client/models/platform_chat_create_streamop.py index d6108f86..b027a981 100644 --- a/src/glean/api_client/models/platform_chat_create_streamop.py +++ b/src/glean/api_client/models/platform_chat_create_streamop.py @@ -5,14 +5,6 @@ PlatformChatInputMessage, PlatformChatInputMessageTypedDict, ) -from .platformchatjsonschemaformat import ( - PlatformChatJSONSchemaFormat, - PlatformChatJSONSchemaFormatTypedDict, -) -from .platformchattextformat import ( - PlatformChatTextFormat, - PlatformChatTextFormatTypedDict, -) from glean.api_client.types import ( BaseModel, UNSET_SENTINEL, @@ -20,9 +12,9 @@ serialize_with_info, ) from glean.api_client.types.basemodel import current_filtered_dump -from glean.api_client.utils import get_discriminator, validate_const +from glean.api_client.utils import validate_const import pydantic -from pydantic import Discriminator, Tag, model_serializer +from pydantic import model_serializer from pydantic.functional_validators import AfterValidator from typing import List, Literal, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -45,70 +37,6 @@ """ -PlatformChatCreateStreamFormatTypedDict = TypeAliasType( - "PlatformChatCreateStreamFormatTypedDict", - Union[PlatformChatTextFormatTypedDict, PlatformChatJSONSchemaFormatTypedDict], -) -r"""Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. - -""" - - -PlatformChatCreateStreamFormat = Annotated[ - Union[ - Annotated[PlatformChatTextFormat, Tag("TEXT")], - Annotated[PlatformChatJSONSchemaFormat, Tag("JSON_SCHEMA")], - ], - Discriminator(lambda m: get_discriminator(m, "type", "type")), -] -r"""Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. - -""" - - -class PlatformChatCreateStreamTextTypedDict(TypedDict): - r"""Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true.""" - - format_: NotRequired[PlatformChatCreateStreamFormatTypedDict] - r"""Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. - - """ - - -class PlatformChatCreateStreamText(BaseModel): - r"""Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true.""" - - format_: Annotated[ - Optional[PlatformChatCreateStreamFormat], pydantic.Field(alias="format") - ] = None - r"""Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. - - """ - - @model_serializer(mode="wrap") - def _serialize_model_with_info(self, handler, info): - return serialize_with_info(self.serialize_model, handler, info) - - def serialize_model(self, handler): - optional_fields = set(["format"]) - 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 - - class PlatformChatCreateStreamRequestTypedDict(TypedDict): input: PlatformChatCreateStreamInputTypedDict r"""Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`. @@ -123,10 +51,6 @@ class PlatformChatCreateStreamRequestTypedDict(TypedDict): r"""Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`. """ - text: NotRequired[PlatformChatCreateStreamTextTypedDict] - r"""Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. - - """ class PlatformChatCreateStreamRequest(BaseModel): @@ -150,17 +74,12 @@ class PlatformChatCreateStreamRequest(BaseModel): """ - text: Optional[PlatformChatCreateStreamText] = None - r"""Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. - - """ - @model_serializer(mode="wrap") def _serialize_model_with_info(self, handler, info): return serialize_with_info(self.serialize_model, handler, info) def serialize_model(self, handler): - optional_fields = set(["stream", "store", "conversation_id", "text"]) + optional_fields = set(["stream", "store", "conversation_id"]) exclude_none = current_exclude_none() skip_filtered = exclude_none is False or current_filtered_dump() serialized = handler(self) @@ -179,10 +98,6 @@ def serialize_model(self, handler): return m -try: - PlatformChatCreateStreamText.model_rebuild() -except NameError: - pass try: PlatformChatCreateStreamRequest.model_rebuild() except NameError: diff --git a/src/glean/api_client/models/platform_chat_createop.py b/src/glean/api_client/models/platform_chat_createop.py index f665f10e..cf671523 100644 --- a/src/glean/api_client/models/platform_chat_createop.py +++ b/src/glean/api_client/models/platform_chat_createop.py @@ -5,14 +5,6 @@ PlatformChatInputMessage, PlatformChatInputMessageTypedDict, ) -from .platformchatjsonschemaformat import ( - PlatformChatJSONSchemaFormat, - PlatformChatJSONSchemaFormatTypedDict, -) -from .platformchattextformat import ( - PlatformChatTextFormat, - PlatformChatTextFormatTypedDict, -) from glean.api_client.types import ( BaseModel, UNSET_SENTINEL, @@ -20,9 +12,9 @@ serialize_with_info, ) from glean.api_client.types.basemodel import current_filtered_dump -from glean.api_client.utils import get_discriminator, validate_const +from glean.api_client.utils import validate_const import pydantic -from pydantic import Discriminator, Tag, model_serializer +from pydantic import model_serializer from pydantic.functional_validators import AfterValidator from typing import List, Literal, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -45,70 +37,6 @@ """ -PlatformChatCreateFormatTypedDict = TypeAliasType( - "PlatformChatCreateFormatTypedDict", - Union[PlatformChatTextFormatTypedDict, PlatformChatJSONSchemaFormatTypedDict], -) -r"""Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. - -""" - - -PlatformChatCreateFormat = Annotated[ - Union[ - Annotated[PlatformChatTextFormat, Tag("TEXT")], - Annotated[PlatformChatJSONSchemaFormat, Tag("JSON_SCHEMA")], - ], - Discriminator(lambda m: get_discriminator(m, "type", "type")), -] -r"""Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. - -""" - - -class PlatformChatCreateTextTypedDict(TypedDict): - r"""Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true.""" - - format_: NotRequired[PlatformChatCreateFormatTypedDict] - r"""Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. - - """ - - -class PlatformChatCreateText(BaseModel): - r"""Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true.""" - - format_: Annotated[ - Optional[PlatformChatCreateFormat], pydantic.Field(alias="format") - ] = None - r"""Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. - - """ - - @model_serializer(mode="wrap") - def _serialize_model_with_info(self, handler, info): - return serialize_with_info(self.serialize_model, handler, info) - - def serialize_model(self, handler): - optional_fields = set(["format"]) - 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 - - class PlatformChatCreateRequestTypedDict(TypedDict): input: PlatformChatCreateInputTypedDict r"""Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`. @@ -123,10 +51,6 @@ class PlatformChatCreateRequestTypedDict(TypedDict): r"""Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`. """ - text: NotRequired[PlatformChatCreateTextTypedDict] - r"""Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. - - """ class PlatformChatCreateRequest(BaseModel): @@ -150,17 +74,12 @@ class PlatformChatCreateRequest(BaseModel): """ - text: Optional[PlatformChatCreateText] = None - r"""Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. - - """ - @model_serializer(mode="wrap") def _serialize_model_with_info(self, handler, info): return serialize_with_info(self.serialize_model, handler, info) def serialize_model(self, handler): - optional_fields = set(["stream", "store", "conversation_id", "text"]) + optional_fields = set(["stream", "store", "conversation_id"]) exclude_none = current_exclude_none() skip_filtered = exclude_none is False or current_filtered_dump() serialized = handler(self) @@ -179,10 +98,6 @@ def serialize_model(self, handler): return m -try: - PlatformChatCreateText.model_rebuild() -except NameError: - pass try: PlatformChatCreateRequest.model_rebuild() except NameError: diff --git a/src/glean/api_client/models/platformchatjsonschemaformat.py b/src/glean/api_client/models/platformchatjsonschemaformat.py deleted file mode 100644 index 678b1637..00000000 --- a/src/glean/api_client/models/platformchatjsonschemaformat.py +++ /dev/null @@ -1,88 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from enum import Enum -from glean.api_client.types import ( - BaseModel, - UNSET_SENTINEL, - current_exclude_none, - serialize_with_info, -) -from glean.api_client.types.basemodel import current_filtered_dump -import pydantic -from pydantic import model_serializer -from typing import Any, Dict, Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class PlatformChatJSONSchemaFormatType(str, Enum): - r"""Discriminator. Must be JSON_SCHEMA.""" - - JSON_SCHEMA = "JSON_SCHEMA" - - -class PlatformChatJSONSchemaFormatTypedDict(TypedDict): - r"""Constrains the assistant response to a caller-supplied JSON Schema.""" - - type: PlatformChatJSONSchemaFormatType - r"""Discriminator. Must be JSON_SCHEMA.""" - name: str - r"""A stable identifier for the schema.""" - schema_: Dict[str, Any] - r"""A JSON Schema object describing the desired output shape.""" - description: NotRequired[str] - r"""An optional human-readable description of the schema.""" - strict: NotRequired[bool] - r"""When true, the provider validates the response against the schema. Unsupported by some providers; defaults to true. - - """ - - -class PlatformChatJSONSchemaFormat(BaseModel): - r"""Constrains the assistant response to a caller-supplied JSON Schema.""" - - type: PlatformChatJSONSchemaFormatType - r"""Discriminator. Must be JSON_SCHEMA.""" - - name: str - r"""A stable identifier for the schema.""" - - schema_: Annotated[Dict[str, Any], pydantic.Field(alias="schema")] - r"""A JSON Schema object describing the desired output shape.""" - - description: Optional[str] = None - r"""An optional human-readable description of the schema.""" - - strict: Optional[bool] = True - r"""When true, the provider validates the response against the schema. Unsupported by some providers; defaults to true. - - """ - - @model_serializer(mode="wrap") - def _serialize_model_with_info(self, handler, info): - return serialize_with_info(self.serialize_model, handler, info) - - def serialize_model(self, handler): - optional_fields = set(["description", "strict"]) - 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 - - -try: - PlatformChatJSONSchemaFormat.model_rebuild() -except NameError: - pass diff --git a/src/glean/api_client/models/platformchatoutputtextcontent.py b/src/glean/api_client/models/platformchatoutputtextcontent.py index 95f21978..3d7372ec 100644 --- a/src/glean/api_client/models/platformchatoutputtextcontent.py +++ b/src/glean/api_client/models/platformchatoutputtextcontent.py @@ -8,9 +8,6 @@ from enum import Enum from glean.api_client.types import ( BaseModel, - Nullable, - OptionalNullable, - UNSET, UNSET_SENTINEL, current_exclude_none, serialize_with_info, @@ -25,21 +22,9 @@ class PlatformChatOutputTextContentType(str, Enum): OUTPUT_TEXT = "OUTPUT_TEXT" -class StructuredOutputTypedDict(TypedDict): - r"""Parsed and validated JSON object when structured output was requested. Present only when the request included `text.format.type: JSON_SCHEMA`.""" - - -class StructuredOutput(BaseModel): - r"""Parsed and validated JSON object when structured output was requested. Present only when the request included `text.format.type: JSON_SCHEMA`.""" - - class PlatformChatOutputTextContentTypedDict(TypedDict): type: PlatformChatOutputTextContentType text: str - structured_output: NotRequired[Nullable[StructuredOutputTypedDict]] - r"""Parsed and validated JSON object when structured output was requested. Present only when the request included `text.format.type: JSON_SCHEMA`. - - """ annotations: NotRequired[List[PlatformChatCitationAnnotationTypedDict]] @@ -48,11 +33,6 @@ class PlatformChatOutputTextContent(BaseModel): text: str - structured_output: OptionalNullable[StructuredOutput] = UNSET - r"""Parsed and validated JSON object when structured output was requested. Present only when the request included `text.format.type: JSON_SCHEMA`. - - """ - annotations: Optional[List[PlatformChatCitationAnnotation]] = None @model_serializer(mode="wrap") @@ -60,8 +40,7 @@ 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(["structured_output", "annotations"]) - nullable_fields = set(["structured_output"]) + optional_fields = set(["annotations"]) exclude_none = current_exclude_none() skip_filtered = exclude_none is False or current_filtered_dump() serialized = handler(self) @@ -72,17 +51,9 @@ def serialize_model(self, handler): 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 - ): + if val is not None or k not in optional_fields: m[k] = val return m diff --git a/src/glean/api_client/models/platformchattextformat.py b/src/glean/api_client/models/platformchattextformat.py deleted file mode 100644 index aa54c4dc..00000000 --- a/src/glean/api_client/models/platformchattextformat.py +++ /dev/null @@ -1,26 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from enum import Enum -from glean.api_client.types import BaseModel -from typing_extensions import TypedDict - - -class PlatformChatTextFormatType(str, Enum): - r"""Discriminator. Must be TEXT.""" - - TEXT = "TEXT" - - -class PlatformChatTextFormatTypedDict(TypedDict): - r"""Unconstrained plain-text assistant output.""" - - type: PlatformChatTextFormatType - r"""Discriminator. Must be TEXT.""" - - -class PlatformChatTextFormat(BaseModel): - r"""Unconstrained plain-text assistant output.""" - - type: PlatformChatTextFormatType - r"""Discriminator. Must be TEXT.""" diff --git a/tests/mockserver/internal/handler/pathpostrestapiv1getchat.go b/tests/mockserver/internal/handler/pathpostrestapiv1getchat.go index 87401958..96d4127e 100644 --- a/tests/mockserver/internal/handler/pathpostrestapiv1getchat.go +++ b/tests/mockserver/internal/handler/pathpostrestapiv1getchat.go @@ -628,8 +628,8 @@ func testGetchatGetchat0(w http.ResponseWriter, req *http.Request) { Roles: []components.UserRoleSpecification{}, SourceDocumentSpec: types.Pointer(components.CreateDocumentSpecUnionDocumentSpec3( components.DocumentSpec3{ - UgcType: components.DocumentSpecUgcType1Shortcuts, - ContentID: 602763, + UgcType: components.DocumentSpecUgcType1Announcements, + ContentID: 848009, }, )), SourceType: components.AnswerSourceTypeAssistant.ToPointer(), diff --git a/tests/mockserver/internal/sdk/models/components/platformchatjsonschemaformat.go b/tests/mockserver/internal/sdk/models/components/platformchatjsonschemaformat.go deleted file mode 100644 index c4d9b004..00000000 --- a/tests/mockserver/internal/sdk/models/components/platformchatjsonschemaformat.go +++ /dev/null @@ -1,94 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" -) - -// PlatformChatJSONSchemaFormatType - Discriminator. Must be JSON_SCHEMA. -type PlatformChatJSONSchemaFormatType string - -const ( - PlatformChatJSONSchemaFormatTypeJSONSchema PlatformChatJSONSchemaFormatType = "JSON_SCHEMA" -) - -func (e PlatformChatJSONSchemaFormatType) ToPointer() *PlatformChatJSONSchemaFormatType { - return &e -} -func (e *PlatformChatJSONSchemaFormatType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "JSON_SCHEMA": - *e = PlatformChatJSONSchemaFormatType(v) - return nil - default: - return fmt.Errorf("invalid value for PlatformChatJSONSchemaFormatType: %v", v) - } -} - -// PlatformChatJSONSchemaFormat - Constrains the assistant response to a caller-supplied JSON Schema. -type PlatformChatJSONSchemaFormat struct { - // Discriminator. Must be JSON_SCHEMA. - Type PlatformChatJSONSchemaFormatType `json:"type"` - // A stable identifier for the schema. - Name string `json:"name"` - // An optional human-readable description of the schema. - Description *string `json:"description,omitempty"` - // A JSON Schema object describing the desired output shape. - Schema map[string]any `json:"schema"` - // When true, the provider validates the response against the schema. Unsupported by some providers; defaults to true. - // - Strict *bool `default:"true" json:"strict"` -} - -func (p PlatformChatJSONSchemaFormat) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(p, "", false) -} - -func (p *PlatformChatJSONSchemaFormat) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &p, "", false, []string{"type", "name", "schema"}); err != nil { - return err - } - return nil -} - -func (o *PlatformChatJSONSchemaFormat) GetType() PlatformChatJSONSchemaFormatType { - if o == nil { - return PlatformChatJSONSchemaFormatType("") - } - return o.Type -} - -func (o *PlatformChatJSONSchemaFormat) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -func (o *PlatformChatJSONSchemaFormat) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *PlatformChatJSONSchemaFormat) GetSchema() map[string]any { - if o == nil { - return map[string]any{} - } - return o.Schema -} - -func (o *PlatformChatJSONSchemaFormat) GetStrict() *bool { - if o == nil { - return nil - } - return o.Strict -} diff --git a/tests/mockserver/internal/sdk/models/components/platformchatoutputtextcontent.go b/tests/mockserver/internal/sdk/models/components/platformchatoutputtextcontent.go index 098822c3..f3be4768 100644 --- a/tests/mockserver/internal/sdk/models/components/platformchatoutputtextcontent.go +++ b/tests/mockserver/internal/sdk/models/components/platformchatoutputtextcontent.go @@ -5,7 +5,6 @@ package components import ( "encoding/json" "fmt" - "mockserver/internal/sdk/optionalnullable" "mockserver/internal/sdk/utils" ) @@ -32,28 +31,10 @@ func (e *PlatformChatOutputTextContentType) UnmarshalJSON(data []byte) error { } } -// StructuredOutput - Parsed and validated JSON object when structured output was requested. Present only when the request included `text.format.type: JSON_SCHEMA`. -type StructuredOutput struct { -} - -func (s StructuredOutput) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(s, "", false) -} - -func (s *StructuredOutput) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { - return err - } - return nil -} - type PlatformChatOutputTextContent struct { - Type PlatformChatOutputTextContentType `json:"type"` - Text string `json:"text"` - // Parsed and validated JSON object when structured output was requested. Present only when the request included `text.format.type: JSON_SCHEMA`. - // - StructuredOutput optionalnullable.OptionalNullable[StructuredOutput] `json:"structured_output,omitempty"` - Annotations []PlatformChatCitationAnnotation `json:"annotations,omitempty"` + Type PlatformChatOutputTextContentType `json:"type"` + Text string `json:"text"` + Annotations []PlatformChatCitationAnnotation `json:"annotations,omitempty"` } func (p PlatformChatOutputTextContent) MarshalJSON() ([]byte, error) { @@ -81,13 +62,6 @@ func (o *PlatformChatOutputTextContent) GetText() string { return o.Text } -func (o *PlatformChatOutputTextContent) GetStructuredOutput() optionalnullable.OptionalNullable[StructuredOutput] { - if o == nil { - return nil - } - return o.StructuredOutput -} - func (o *PlatformChatOutputTextContent) GetAnnotations() []PlatformChatCitationAnnotation { if o == nil { return nil diff --git a/tests/mockserver/internal/sdk/models/components/platformchattextformat.go b/tests/mockserver/internal/sdk/models/components/platformchattextformat.go deleted file mode 100644 index 2549e793..00000000 --- a/tests/mockserver/internal/sdk/models/components/platformchattextformat.go +++ /dev/null @@ -1,57 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" -) - -// PlatformChatTextFormatType - Discriminator. Must be TEXT. -type PlatformChatTextFormatType string - -const ( - PlatformChatTextFormatTypeText PlatformChatTextFormatType = "TEXT" -) - -func (e PlatformChatTextFormatType) ToPointer() *PlatformChatTextFormatType { - return &e -} -func (e *PlatformChatTextFormatType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "TEXT": - *e = PlatformChatTextFormatType(v) - return nil - default: - return fmt.Errorf("invalid value for PlatformChatTextFormatType: %v", v) - } -} - -// PlatformChatTextFormat - Unconstrained plain-text assistant output. -type PlatformChatTextFormat struct { - // Discriminator. Must be TEXT. - Type PlatformChatTextFormatType `json:"type"` -} - -func (p PlatformChatTextFormat) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(p, "", false) -} - -func (p *PlatformChatTextFormat) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &p, "", false, []string{"type"}); err != nil { - return err - } - return nil -} - -func (o *PlatformChatTextFormat) GetType() PlatformChatTextFormatType { - if o == nil { - return PlatformChatTextFormatType("") - } - return o.Type -} diff --git a/tests/mockserver/internal/sdk/models/operations/platformchatcreate.go b/tests/mockserver/internal/sdk/models/operations/platformchatcreate.go index 58f6721f..c9dbd053 100644 --- a/tests/mockserver/internal/sdk/models/operations/platformchatcreate.go +++ b/tests/mockserver/internal/sdk/models/operations/platformchatcreate.go @@ -3,7 +3,6 @@ package operations import ( - "encoding/json" "errors" "fmt" "mockserver/internal/sdk/models/components" @@ -75,120 +74,6 @@ func (u PlatformChatCreateInput) MarshalJSON() ([]byte, error) { return nil, errors.New("could not marshal union type PlatformChatCreateInput: all fields are null") } -type PlatformChatCreateFormatType string - -const ( - PlatformChatCreateFormatTypeText PlatformChatCreateFormatType = "TEXT" - PlatformChatCreateFormatTypeJSONSchema PlatformChatCreateFormatType = "JSON_SCHEMA" -) - -// PlatformChatCreateFormat - Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. -type PlatformChatCreateFormat struct { - PlatformChatTextFormat *components.PlatformChatTextFormat `queryParam:"inline"` - PlatformChatJSONSchemaFormat *components.PlatformChatJSONSchemaFormat `queryParam:"inline"` - - Type PlatformChatCreateFormatType -} - -func CreatePlatformChatCreateFormatText(text components.PlatformChatTextFormat) PlatformChatCreateFormat { - typ := PlatformChatCreateFormatTypeText - - typStr := components.PlatformChatTextFormatType(typ) - text.Type = typStr - - return PlatformChatCreateFormat{ - PlatformChatTextFormat: &text, - Type: typ, - } -} - -func CreatePlatformChatCreateFormatJSONSchema(jsonSchema components.PlatformChatJSONSchemaFormat) PlatformChatCreateFormat { - typ := PlatformChatCreateFormatTypeJSONSchema - - typStr := components.PlatformChatJSONSchemaFormatType(typ) - jsonSchema.Type = typStr - - return PlatformChatCreateFormat{ - PlatformChatJSONSchemaFormat: &jsonSchema, - Type: typ, - } -} - -func (u *PlatformChatCreateFormat) UnmarshalJSON(data []byte) error { - - type discriminator struct { - Type string `json:"type"` - } - - dis := new(discriminator) - if err := json.Unmarshal(data, &dis); err != nil { - return fmt.Errorf("could not unmarshal discriminator: %w", err) - } - - switch dis.Type { - case "TEXT": - platformChatTextFormat := new(components.PlatformChatTextFormat) - if err := utils.UnmarshalJSON(data, &platformChatTextFormat, "", true, nil); err != nil { - return fmt.Errorf("could not unmarshal `%s` into expected (Type == TEXT) type components.PlatformChatTextFormat within PlatformChatCreateFormat: %w", string(data), err) - } - - u.PlatformChatTextFormat = platformChatTextFormat - u.Type = PlatformChatCreateFormatTypeText - return nil - case "JSON_SCHEMA": - platformChatJSONSchemaFormat := new(components.PlatformChatJSONSchemaFormat) - if err := utils.UnmarshalJSON(data, &platformChatJSONSchemaFormat, "", true, nil); err != nil { - return fmt.Errorf("could not unmarshal `%s` into expected (Type == JSON_SCHEMA) type components.PlatformChatJSONSchemaFormat within PlatformChatCreateFormat: %w", string(data), err) - } - - u.PlatformChatJSONSchemaFormat = platformChatJSONSchemaFormat - u.Type = PlatformChatCreateFormatTypeJSONSchema - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for PlatformChatCreateFormat", string(data)) -} - -func (u PlatformChatCreateFormat) MarshalJSON() ([]byte, error) { - if u.PlatformChatTextFormat != nil { - return utils.MarshalJSON(u.PlatformChatTextFormat, "", true) - } - - if u.PlatformChatJSONSchemaFormat != nil { - return utils.MarshalJSON(u.PlatformChatJSONSchemaFormat, "", true) - } - - return nil, errors.New("could not marshal union type PlatformChatCreateFormat: all fields are null") -} - -// PlatformChatCreateText - Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. -type PlatformChatCreateText struct { - // Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. - // - Format *PlatformChatCreateFormat `json:"format,omitempty"` -} - -func (o *PlatformChatCreateText) GetFormat() *PlatformChatCreateFormat { - if o == nil { - return nil - } - return o.Format -} - -func (o *PlatformChatCreateText) GetFormatText() *components.PlatformChatTextFormat { - if v := o.GetFormat(); v != nil { - return v.PlatformChatTextFormat - } - return nil -} - -func (o *PlatformChatCreateText) GetFormatJSONSchema() *components.PlatformChatJSONSchemaFormat { - if v := o.GetFormat(); v != nil { - return v.PlatformChatJSONSchemaFormat - } - return nil -} - type PlatformChatCreateRequest struct { // Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`. // @@ -200,9 +85,6 @@ type PlatformChatCreateRequest struct { // Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`. // ConversationID *string `json:"conversation_id,omitempty"` - // Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. - // - Text *PlatformChatCreateText `json:"text,omitempty"` } func (p PlatformChatCreateRequest) MarshalJSON() ([]byte, error) { @@ -241,13 +123,6 @@ func (o *PlatformChatCreateRequest) GetConversationID() *string { return o.ConversationID } -func (o *PlatformChatCreateRequest) GetText() *PlatformChatCreateText { - if o == nil { - return nil - } - return o.Text -} - type PlatformChatCreateResponse struct { HTTPMeta components.HTTPMetadata `json:"-"` // Successful response. diff --git a/tests/mockserver/internal/sdk/models/operations/platformchatcreatestream.go b/tests/mockserver/internal/sdk/models/operations/platformchatcreatestream.go index 72e44e52..d94a54b7 100644 --- a/tests/mockserver/internal/sdk/models/operations/platformchatcreatestream.go +++ b/tests/mockserver/internal/sdk/models/operations/platformchatcreatestream.go @@ -3,7 +3,6 @@ package operations import ( - "encoding/json" "errors" "fmt" "mockserver/internal/sdk/models/components" @@ -76,120 +75,6 @@ func (u PlatformChatCreateStreamInput) MarshalJSON() ([]byte, error) { return nil, errors.New("could not marshal union type PlatformChatCreateStreamInput: all fields are null") } -type PlatformChatCreateStreamFormatType string - -const ( - PlatformChatCreateStreamFormatTypeText PlatformChatCreateStreamFormatType = "TEXT" - PlatformChatCreateStreamFormatTypeJSONSchema PlatformChatCreateStreamFormatType = "JSON_SCHEMA" -) - -// PlatformChatCreateStreamFormat - Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. -type PlatformChatCreateStreamFormat struct { - PlatformChatTextFormat *components.PlatformChatTextFormat `queryParam:"inline"` - PlatformChatJSONSchemaFormat *components.PlatformChatJSONSchemaFormat `queryParam:"inline"` - - Type PlatformChatCreateStreamFormatType -} - -func CreatePlatformChatCreateStreamFormatText(text components.PlatformChatTextFormat) PlatformChatCreateStreamFormat { - typ := PlatformChatCreateStreamFormatTypeText - - typStr := components.PlatformChatTextFormatType(typ) - text.Type = typStr - - return PlatformChatCreateStreamFormat{ - PlatformChatTextFormat: &text, - Type: typ, - } -} - -func CreatePlatformChatCreateStreamFormatJSONSchema(jsonSchema components.PlatformChatJSONSchemaFormat) PlatformChatCreateStreamFormat { - typ := PlatformChatCreateStreamFormatTypeJSONSchema - - typStr := components.PlatformChatJSONSchemaFormatType(typ) - jsonSchema.Type = typStr - - return PlatformChatCreateStreamFormat{ - PlatformChatJSONSchemaFormat: &jsonSchema, - Type: typ, - } -} - -func (u *PlatformChatCreateStreamFormat) UnmarshalJSON(data []byte) error { - - type discriminator struct { - Type string `json:"type"` - } - - dis := new(discriminator) - if err := json.Unmarshal(data, &dis); err != nil { - return fmt.Errorf("could not unmarshal discriminator: %w", err) - } - - switch dis.Type { - case "TEXT": - platformChatTextFormat := new(components.PlatformChatTextFormat) - if err := utils.UnmarshalJSON(data, &platformChatTextFormat, "", true, nil); err != nil { - return fmt.Errorf("could not unmarshal `%s` into expected (Type == TEXT) type components.PlatformChatTextFormat within PlatformChatCreateStreamFormat: %w", string(data), err) - } - - u.PlatformChatTextFormat = platformChatTextFormat - u.Type = PlatformChatCreateStreamFormatTypeText - return nil - case "JSON_SCHEMA": - platformChatJSONSchemaFormat := new(components.PlatformChatJSONSchemaFormat) - if err := utils.UnmarshalJSON(data, &platformChatJSONSchemaFormat, "", true, nil); err != nil { - return fmt.Errorf("could not unmarshal `%s` into expected (Type == JSON_SCHEMA) type components.PlatformChatJSONSchemaFormat within PlatformChatCreateStreamFormat: %w", string(data), err) - } - - u.PlatformChatJSONSchemaFormat = platformChatJSONSchemaFormat - u.Type = PlatformChatCreateStreamFormatTypeJSONSchema - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for PlatformChatCreateStreamFormat", string(data)) -} - -func (u PlatformChatCreateStreamFormat) MarshalJSON() ([]byte, error) { - if u.PlatformChatTextFormat != nil { - return utils.MarshalJSON(u.PlatformChatTextFormat, "", true) - } - - if u.PlatformChatJSONSchemaFormat != nil { - return utils.MarshalJSON(u.PlatformChatJSONSchemaFormat, "", true) - } - - return nil, errors.New("could not marshal union type PlatformChatCreateStreamFormat: all fields are null") -} - -// PlatformChatCreateStreamText - Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. -type PlatformChatCreateStreamText struct { - // Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. - // - Format *PlatformChatCreateStreamFormat `json:"format,omitempty"` -} - -func (o *PlatformChatCreateStreamText) GetFormat() *PlatformChatCreateStreamFormat { - if o == nil { - return nil - } - return o.Format -} - -func (o *PlatformChatCreateStreamText) GetFormatText() *components.PlatformChatTextFormat { - if v := o.GetFormat(); v != nil { - return v.PlatformChatTextFormat - } - return nil -} - -func (o *PlatformChatCreateStreamText) GetFormatJSONSchema() *components.PlatformChatJSONSchemaFormat { - if v := o.GetFormat(); v != nil { - return v.PlatformChatJSONSchemaFormat - } - return nil -} - type PlatformChatCreateStreamRequest struct { // Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`. // @@ -201,9 +86,6 @@ type PlatformChatCreateStreamRequest struct { // Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`. // ConversationID *string `json:"conversation_id,omitempty"` - // Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. - // - Text *PlatformChatCreateStreamText `json:"text,omitempty"` } func (p PlatformChatCreateStreamRequest) MarshalJSON() ([]byte, error) { @@ -242,13 +124,6 @@ func (o *PlatformChatCreateStreamRequest) GetConversationID() *string { return o.ConversationID } -func (o *PlatformChatCreateStreamRequest) GetText() *PlatformChatCreateStreamText { - if o == nil { - return nil - } - return o.Text -} - type PlatformChatCreateStreamResponse struct { HTTPMeta components.HTTPMetadata `json:"-"` // Successful response. diff --git a/tests/test_chat_sdk.py b/tests/test_chat_sdk.py index 36e625c2..f8a75b66 100644 --- a/tests/test_chat_sdk.py +++ b/tests/test_chat_sdk.py @@ -1,6 +1,6 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" -from glean.api_client import Glean, models +from glean.api_client import Glean import os from tests.test_client import create_test_http_client @@ -16,30 +16,7 @@ def test_chat_sdk_platform_chat_create(): assert glean is not None res = glean.chat.create( - input="Summarize our parental leave policy as JSON.", - store=True, - text={ - "format_": { - "type": models.PlatformChatJSONSchemaFormatType.JSON_SCHEMA, - "name": "policy_summary", - "schema_": { - "properties": { - "duration_weeks": { - "type": "integer", - }, - "eligible_employees": { - "type": "string", - }, - }, - "required": [ - "eligible_employees", - "duration_weeks", - ], - "type": "object", - }, - "strict": True, - }, - }, + input="Summarize our parental leave policy.", store=True ) assert res is not None diff --git a/tests/test_messages.py b/tests/test_messages.py index 132005ec..c0fd29da 100644 --- a/tests/test_messages.py +++ b/tests/test_messages.py @@ -18,7 +18,7 @@ def test_messages_messages(): res = glean.client.messages.retrieve( id_type=models.IDType.CONVERSATION_ID, id="", - datasource=models.Datasource.FACEBOOKWORKPLACE, + datasource=models.Datasource.SLACK, timestamp_millis=558834, ) assert res is not None diff --git a/tests/test_summarize.py b/tests/test_summarize.py index 5401883f..9efa5c1d 100644 --- a/tests/test_summarize.py +++ b/tests/test_summarize.py @@ -1,6 +1,6 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" -from glean.api_client import Glean, models +from glean.api_client import Glean import os from tests.test_client import create_test_http_client @@ -18,11 +18,10 @@ def test_summarize_summarize(): res = glean.client.documents.summarize( document_specs=[ { - "id": "", + "url": "https://intelligent-lyre.net", }, { - "ugc_type": models.DocumentSpecUgcType1.COLLECTIONS, - "content_id": 583083, + "url": "https://intelligent-lyre.net", }, ] ) From 0ed9615bb0ab1eefd18408a2f5c1abcb96661705 Mon Sep 17 00:00:00 2001 From: "speakeasy-github[bot]" <128539517+speakeasy-github[bot]@users.noreply.github.com> Date: Fri, 13 Nov 2026 05:31:48 +0000 Subject: [PATCH 2/2] empty commit to trigger [run-tests] workflow