diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 78217f78..f7edf290 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: 01a90b01e893a4ce756427c8d9283253 docVersion: 0.9.0 - speakeasyVersion: 1.808.1 - generationVersion: 2.960.8 - releaseVersion: 0.17.21 - configChecksum: 8b7b0e067cb1656303a9aee28978f0d6 + speakeasyVersion: 1.809.0 + generationVersion: 2.961.1 + 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: f15a1613-3568-4db6-9913-ba4262e54ac4 + pristine_commit_hash: 426fee4dcb102053ec3ebe276f1e1d3afae693b7 + pristine_tree_hash: 416612eceee4678950928f1f96db039308f6539c features: python: acceptHeaders: 3.0.0 @@ -22,7 +22,7 @@ features: callbacks: 2.0.0 configurableModuleName: 0.2.0 constsAndDefaults: 1.0.8 - core: 6.1.14 + core: 6.1.15 defaultEnabledRetries: 0.2.0 deprecations: 3.0.2 devContainers: 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 @@ -2740,6 +2708,10 @@ trackedFiles: id: 3a6464744337 last_write_checksum: sha1:edb2eec75d654d6cdc40d7b84fba0d267e575065 pristine_git_object: 3829848e491fd4bf05ef6d7bbc0695ef25002d11 + docs/models/platformdocumentreference.md: + id: 5f049b42748d + last_write_checksum: sha1:c8e500e5034bb58f303072846f236baee72c6640 + pristine_git_object: 93d5cdeab436544f22f3caa375a8d3acac67d95a docs/models/platformdocumentsbatchrequest.md: id: 09737916458e last_write_checksum: sha1:90ac6d7745ea0616563fc1724d019a8f249bd679 @@ -2924,6 +2896,18 @@ trackedFiles: id: 0fe3fed8d508 last_write_checksum: sha1:8f0ae4b5184abebeda23cbd2348fd8808e5f9f62 pristine_git_object: c37af26a911e31beee67109e7772c26de46f3a17 + docs/models/platformsearchenumerationinclude.md: + id: 7cb057ee602b + last_write_checksum: sha1:72ef9dc8d93aef3a2ba115157972b2f95bba631c + pristine_git_object: bced8b4a639918f104ce6e73090c9f14c486e561 + docs/models/platformsearchenumerationrequest.md: + id: 7255fed49b41 + last_write_checksum: sha1:69d295262e368ea6520afee73a7e6a8f86b8ef86 + pristine_git_object: 85bb7ea66538372a6e5bc94070cd238e8612ad44 + docs/models/platformsearchenumerationresponse.md: + id: c65068eb3bac + last_write_checksum: sha1:dbf03a38111df00d42f9b407e982e4e9d853adfc + pristine_git_object: 3c79d022d967128daa7def992939ba06be049635 docs/models/platformsearchfiltersrequest.md: id: 8bbc53cc30ee last_write_checksum: sha1:e72c60e81d9b005abde6716e7036d8937aad2615 @@ -3234,8 +3218,8 @@ trackedFiles: pristine_git_object: b576bda6a9b1cd7bd2fc8821fd1d84fb23739652 docs/models/platformtriggereventreason.md: id: d3b45140acfa - last_write_checksum: sha1:ec27be43f70dcf3f494785719d6ee261c273e40e - pristine_git_object: 7c2dab2376cb2c90d4d090179d44d0eb01f0f03e + last_write_checksum: sha1:98f7761f2b159a1b9394223d2902f16d2a1bde61 + pristine_git_object: 0a2c9d6e685f48c1b194bb3db5dcd36477d1c2df docs/models/platformtriggereventsearchrequest.md: id: 29860dfa66e9 last_write_checksum: sha1:dd92227615d8d7aa8908fbe20c5e1e4897f68fbd @@ -3764,10 +3748,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 +4182,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 @@ -4318,8 +4298,8 @@ trackedFiles: pristine_git_object: 6dae1cb2e68a7b2f8bcf338543f8a5a222830a13 docs/sdks/search/README.md: id: 5c534716244c - last_write_checksum: sha1:022e913d9c00b87af808f366156b31a6f3a23b0b - pristine_git_object: 816c6349ca6c0222e83d4bc0399a8479c9c726dc + last_write_checksum: sha1:5429a2147b3b4a68a46b6811a0b6483403695cec + pristine_git_object: d1aa1757de4f5860300a19d6ae853b6a41efce9c docs/sdks/skills/README.md: id: 3a14a5c90791 last_write_checksum: sha1:9e6769748ecd96d412e3fea2367d2749d24753f5 @@ -4354,8 +4334,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 +4362,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:3fd6da8ffa9f388f98a28833d52257537c043444 + pristine_git_object: df53044112d78cf818c95f57ec7cc85daddc867c src/glean/api_client/admin.py: id: 583cfae82adf last_write_checksum: sha1:3c462f418d2b32a90c92f88121867a73295b0c6c @@ -4414,8 +4394,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 +4570,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:b375559484c01b03309e772b0d9bd8e3d2e91c9f + pristine_git_object: 3693ca1bc4447b3b745508274971c89757ad13fd src/glean/api_client/models/accessrequestpermissiondeniedresponse_error.py: id: 22a2fa0d5899 last_write_checksum: sha1:f7dd6f906a4dd7433992f77395f9fb491fa5ac5c @@ -6358,12 +6338,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 +6584,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 +6652,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 @@ -6728,6 +6700,10 @@ trackedFiles: id: 0a0ce32c810e last_write_checksum: sha1:c4f17e0ec93a6ccea3a6d43f69f3a334dbf4a9ab pristine_git_object: 1d08732c2202e4c727ba2858e9758a5d4f2c87ec + src/glean/api_client/models/platformdocumentreference.py: + id: d55f7b56a802 + last_write_checksum: sha1:807a7b49e268972afd8f9fc6e89e76678e7330d5 + pristine_git_object: b5f21f2b8540aed0480f2a6afbc3a2b9b2038a27 src/glean/api_client/models/platformdocumentsbatchrequest.py: id: 57885313154d last_write_checksum: sha1:f9724bf72f716be89770900b2435e132d32f299a @@ -6892,6 +6868,18 @@ trackedFiles: id: 65de4ed5c1b3 last_write_checksum: sha1:2916fc096e4cfe89375626f2a945b4785ad2ade7 pristine_git_object: 88ce5a1715908f6528fd68563f08aff1ff59ce6a + src/glean/api_client/models/platformsearchenumerationinclude.py: + id: a2077a23e376 + last_write_checksum: sha1:71068aeef9a21f2a9b1883f9d295448dbb252b3c + pristine_git_object: ebcdb647eb9d950315368093642624a82ff3eccd + src/glean/api_client/models/platformsearchenumerationrequest.py: + id: e550d00ad0b9 + last_write_checksum: sha1:cc30f2dd5e06e51934107760ae92a5f38509609b + pristine_git_object: 6053594cec51150ffc11861562f8d655c2825718 + src/glean/api_client/models/platformsearchenumerationresponse.py: + id: 2cf782f15ab7 + last_write_checksum: sha1:196e98e57a93ba1b265bfa3fad159965aae38edb + pristine_git_object: 3f9321422693867e9a064d2b6f41dd06f23bcc73 src/glean/api_client/models/platformsearchfiltersresponse.py: id: 743edd99f7aa last_write_checksum: sha1:9c6e81390c3f1665bc2d26c2e3c5face283f759d @@ -7098,8 +7086,8 @@ trackedFiles: pristine_git_object: 816d5babd8dff44296255e09ef674223e6cab07e src/glean/api_client/models/platformtriggereventreason.py: id: 1fa4b52d7d21 - last_write_checksum: sha1:399dead62673a5b90788563edbd8f5f36baec3ab - pristine_git_object: 8a0756fd25a9533a1b54551b1ccecbcc2be6a78c + last_write_checksum: sha1:260a53cef6c352e4fcfedbac1b2c5d99d0413373 + pristine_git_object: 8bb10d8140e4a11108388d34c998201034e54c1e src/glean/api_client/models/platformtriggereventsearchrequest.py: id: a12d9a25b03f last_write_checksum: sha1:83115e8fe70680f6e3f4dc15a4ee38b3b88608b5 @@ -7842,8 +7830,8 @@ trackedFiles: pristine_git_object: 22e0a4eab0ef8e54dcfd986084d01c14a56f47a6 src/glean/api_client/search.py: id: a3b404a8b402 - last_write_checksum: sha1:b2c68f6baaabeaf0e14fd6e77dbde9bb80802696 - pristine_git_object: 7150efbff6e08314d6f576f8c0c38235d0e41db5 + last_write_checksum: sha1:d36143ac4120f0ecc22e1fe524a7d0d2cc994d6d + pristine_git_object: a2fdfcbab238d70351cdd3b8dea25dfaf9fa7178 src/glean/api_client/skills.py: id: 79f3c37e1b5a last_write_checksum: sha1:a9f6ddb1d28b6428e95bbe4c842e30a75f2b197b @@ -7862,8 +7850,8 @@ trackedFiles: pristine_git_object: 3a43a78ab719ec504ec95c050c984c843407d366 src/glean/api_client/types/base64fileinput.py: id: 83c3e0b80185 - last_write_checksum: sha1:1522687ae3398374c35710cad993a6e82b5ab99d - pristine_git_object: 862566fe2b1db830276b390e136e65090e5963d2 + last_write_checksum: sha1:94a99b9b1b7ab6d3fd8fb2e52385a50b4a2ff333 + pristine_git_object: de42346d429a62ce8d39b04be6ee568c9d37e619 src/glean/api_client/types/basemodel.py: id: 436a12e02484 last_write_checksum: sha1:99c644208e340c4974b94bbe6d52019c80fedb97 @@ -8010,8 +7998,8 @@ trackedFiles: pristine_git_object: 929558ef2e1165f7e09da6d0a64f016c90971655 tests/mockserver/internal/handler/generated_handlers.go: id: 61ac4f7cce9e - last_write_checksum: sha1:9b4637a979a61dabdc65e81ae71068c54a97ec4c - pristine_git_object: 75f142bb7cdeedab3d92bdb85c68fc6693d94e7a + last_write_checksum: sha1:82b6fc55b4750de9daea2f5a47738ab3df43a094 + pristine_git_object: 10cb3da083d847ee748d0a76caacc5f1a3beb08f tests/mockserver/internal/handler/pathdeleterestapiindexcustommetadataschemagroupname.go: id: 979e4583765b last_write_checksum: sha1:b1d4edb259d907c7a88b634bf16f0cf152321693 @@ -8340,6 +8328,10 @@ trackedFiles: id: 53e6a34b5b4b last_write_checksum: sha1:5c878b42ee0ffe08f9ad98c3e1f1c9c20ce4d21a pristine_git_object: 1e3fe6a9bed655ba32d7c59fe577f41beac69da8 + tests/mockserver/internal/handler/pathpostapisearchenumeration.go: + id: 67082f434e1a + last_write_checksum: sha1:498a79199ca09e8822326a7c0a503bf64e4d5851 + pristine_git_object: 8434a2e3fa8ed39ee5e80accb6b18fa4f2a0642c tests/mockserver/internal/handler/pathpostapiskills.go: id: 8ed490cc6d95 last_write_checksum: sha1:baf2227d6bd2c85e94842170a811ed97ec2e2b5c @@ -10228,18 +10220,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 +10288,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 @@ -10352,6 +10336,10 @@ trackedFiles: id: 069550e90b62 last_write_checksum: sha1:122dd8b1f581cd4afc74aa66ebd40482ef6f8bf6 pristine_git_object: 3eec0b1a224a0957a1bd736990f5c3ab50491041 + tests/mockserver/internal/sdk/models/components/platformdocumentreference.go: + id: a4be70b2ac95 + last_write_checksum: sha1:f796641c9358ecab9a9d48d2b867621ae9ce3f25 + pristine_git_object: 8d5ee032af16e685ba1db9e4d3a47307a5731619 tests/mockserver/internal/sdk/models/components/platformdocumentsbatchrequest.go: id: 9037807c5a98 last_write_checksum: sha1:727bc02cec152b7c3d5b939a4334ea1b7d732405 @@ -10516,6 +10504,18 @@ trackedFiles: id: dd777258615b last_write_checksum: sha1:0aa6e9a8d84b38bb403af1bb505adc2666c03c5e pristine_git_object: 1588f7394695e92cf3cd2b4a620d7c239f179815 + tests/mockserver/internal/sdk/models/components/platformsearchenumerationinclude.go: + id: 24497ab12dde + last_write_checksum: sha1:a56244a9def88eb48ab13e03761555e69c603bf0 + pristine_git_object: e944cdb02de2b6177253b5118fdf80526ceef786 + tests/mockserver/internal/sdk/models/components/platformsearchenumerationrequest.go: + id: 8a9eb0db18c3 + last_write_checksum: sha1:bb43060068d5be70facc0176eb162b6d1df219fb + pristine_git_object: a5fd5eaf5e4ad844969ceecc566936c3a9003bd2 + tests/mockserver/internal/sdk/models/components/platformsearchenumerationresponse.go: + id: 163130806d65 + last_write_checksum: sha1:7e45670b21e5c4d4213902e83d944fafe99efc02 + pristine_git_object: f2ecd205bc3ca5b2e7d92d84ef9491b15439fb4d tests/mockserver/internal/sdk/models/components/platformsearchfiltersresponse.go: id: c6e01fb5cff1 last_write_checksum: sha1:94caa146dcfafb521d396d19e5358da8c598faab @@ -10722,8 +10722,8 @@ trackedFiles: pristine_git_object: 30f4d2fcf79274a8c8d20ec7d7882bd53c47ee37 tests/mockserver/internal/sdk/models/components/platformtriggereventreason.go: id: a9f89c6ff900 - last_write_checksum: sha1:6863ef539458101a3e098e149564b4b32911202a - pristine_git_object: 04bb19d6cb9b523ea51a8661e23e58975bcedb01 + last_write_checksum: sha1:7a4306ebbf1be5c9bfa7f4f847ed9e7e9bb350a0 + pristine_git_object: b40a25c5345b759a4650516e6dc95a0f06ceda2b tests/mockserver/internal/sdk/models/components/platformtriggereventsearchrequest.go: id: 9cc3d3ae7054 last_write_checksum: sha1:7634063252a61e46a0f2de39d39ae1865b44cb7d @@ -11726,12 +11726,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 @@ -11760,6 +11760,10 @@ trackedFiles: id: d990791ac101 last_write_checksum: sha1:9da9b49850375b74bf6296fcec336ba9ad1e1eea pristine_git_object: 381c8530dfb959419e47dee10c46cfdd5846f611 + tests/mockserver/internal/sdk/models/operations/platformsearchenumeration.go: + id: e1aa6765ff1d + last_write_checksum: sha1:2fe9178766a7764ee8cf4c3d88de9d8d481e6265 + pristine_git_object: 4b5ba7fe7a18912ff655d60271fa463d3edd1933 tests/mockserver/internal/sdk/models/operations/platformsearchfilters.go: id: 3f6c4119e4bd last_write_checksum: sha1:e0836460229365773a66a5b310ba886d5fbdf202 @@ -12242,8 +12246,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 +12346,8 @@ trackedFiles: pristine_git_object: 6cc8aeec3c52329d389081db0a27f10f53f214b9 tests/test_messages.py: id: be23089b1f8b - last_write_checksum: sha1:2404e23964ef6a1f5ddc900402b34e597d2d9617 - pristine_git_object: 132005ec7d1e35f805b6a8c28e07e043bce22f0a + last_write_checksum: sha1:b7415512608102fa07b1990a350a7da66946fe46 + pristine_git_object: 636f01d348f30db3ee81985044634511b615af16 tests/test_people.py: id: 37c243940039 last_write_checksum: sha1:2b78b1c5ea17f267895188b1b48ff9fe2bc19f17 @@ -12362,16 +12366,16 @@ trackedFiles: pristine_git_object: 3fa82f944c8693f534f71d96c489225c3f65cb5d tests/test_search.py: id: dd86606b335f - last_write_checksum: sha1:6917a63c00528086e8db15fd48e573fbf09e37ae - pristine_git_object: d0a8bd281e331739b23473d92b80408666d63066 + last_write_checksum: sha1:919bdabee66eeaedf6ecaf8354eedb5f7c4f2a3a + pristine_git_object: 401f18888fd24c25a0d9e6ee5d79dc695773fe99 tests/test_skills.py: id: ac5db26bd6b1 last_write_checksum: sha1:c01d9e86a9686459777a922246762675ffd9a41a pristine_git_object: 1c854370da050c261cb2cbcf9cc16829f5d8e78c tests/test_summarize.py: id: a255d8a6f627 - last_write_checksum: sha1:8f1ca2be59f1c913c8b60bc931be12743f5456dc - pristine_git_object: 5401883ff0180af3a47608b1d8984f520e6d240d + last_write_checksum: sha1:927e079ca08e811f8396e062d73d30e74201c7f3 + pristine_git_object: fd2baddb17f4be22555bd1ddf5fd50e82285a042 tests/test_tools.py: id: 70889bdf7321 last_write_checksum: sha1:e9e37efd6a65d805c02d70d548df9c87dd062b0e @@ -13545,7 +13549,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 +13784,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"}]} @@ -14015,6 +14019,17 @@ examples: application/problem+json: {"type": "https://developers.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developers.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} "500": application/problem+json: {"type": "https://developers.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developers.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} + platform-search-enumeration: + speakeasy-default-platform-search-enumeration: + requestBody: + application/json: {"query": "amoxicillin", "datasources": ["gdrive"], "page_size": 500} + responses: + "200": + application/json: {"results": [], "has_more": false, "next_cursor": null, "request_id": ""} + "400": + application/problem+json: {"type": "https://developers.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developers.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} + "500": + application/problem+json: {"type": "https://developers.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developers.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} examplesVersion: 1.0.2 generatedTests: activity: "2025-04-28T22:05:12+01:00" @@ -14233,6 +14248,8 @@ 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" + platform-search-enumeration: "2026-11-16T11:51:20Z" +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* `glean.search.enumerate()`: **Added**\n* `glean.triggers.search_events()`: `response.results[].reason` **Changed**\n* `glean.triggers.search_preset_events()`: `response.results[].reason` **Changed**\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..c2f3e3ce 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: 74225def94ec0e1d0281e9ed827c93f85ccb2152 + x-open-api-commit-sha: d781217a7cfce20ac740646c1b7242f059d850cb 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. @@ -1496,6 +1496,63 @@ paths: x-speakeasy-name-override: listFilters security: - APIToken: [] + /api/search/enumeration: + post: + tags: + - Search + summary: Enumerate matching documents + description: | + Walk every indexed document that matches a selection and that the caller is permitted to see. Returns document references with minimal metadata and never bodies; request `SNIPPETS` via `include` for query-relevant excerpts, and hydrate full documents with `POST /api/documents/batch`. Unlike `POST /api/search`, `query` is optional: omit it to enumerate by `datasources`, `filters`, and `time_range` alone. Results are ordered for completeness, not relevance. + Follow `next_cursor` until `has_more` is `false`, regardless of page size. This is a live scan, not a snapshot: concurrent index changes can cause duplicates or omissions. Deduplicate by `document_id`. + A page is either complete at its cursor position or an error. A shard or datasource failure returns HTTP 503 and the same cursor stays valid for retry; this endpoint never returns a partial page. A cursor reused with a different selection returns HTTP 400 `invalid_cursor`. + operationId: platform-search-enumeration + x-glean-scopes: + legacy: + - SEARCH + platform: + - search:query + x-visibility: Public + x-glean-experimental: + id: 9ce7bb73-1e30-460a-a917-cae09ac3a3ea + introduced: "2026-11-02" + x-codegen-request-body-name: payload + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/PlatformSearchEnumerationRequest" + responses: + "200": + description: Successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/PlatformSearchEnumerationResponse" + "400": + $ref: "#/components/responses/PlatformBadRequest" + "401": + $ref: "#/components/responses/PlatformUnauthorized" + "403": + $ref: "#/components/responses/PlatformForbidden" + "404": + $ref: "#/components/responses/PlatformNotFound" + "408": + $ref: "#/components/responses/PlatformRequestTimeout" + "413": + $ref: "#/components/responses/PlatformRequestTooLarge" + "422": + $ref: "#/components/responses/PlatformUnprocessableEntity" + "429": + $ref: "#/components/responses/PlatformTooManyRequests" + "500": + $ref: "#/components/responses/PlatformInternalServerError" + "503": + $ref: "#/components/responses/PlatformServiceUnavailable" + x-speakeasy-group: search + x-speakeasy-name-override: enumerate + security: + - APIToken: [] /api/admin/usage/settings: get: tags: @@ -9840,72 +9897,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 +9930,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 +9949,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: @@ -11144,6 +11124,158 @@ components: type: string minLength: 1 description: Platform-generated request ID for support correlation. + PlatformSearchEnumerationInclude: + type: string + description: Optional document reference projection. + enum: + - SNIPPETS + x-enumDescriptions: + SNIPPETS: Add snippets, query-relevant plain-text excerpts from the document body. Only produced when `query` is present; a scope-only scan has nothing to excerpt. + x-speakeasy-enum-descriptions: + SNIPPETS: Add snippets, query-relevant plain-text excerpts from the document body. Only produced when `query` is present; a scope-only scan has nothing to excerpt. + PlatformSearchEnumerationRequest: + type: object + additionalProperties: false + description: | + Selection to enumerate. At least one of `datasources`, `query`, or `filters` must be set. + example: + query: amoxicillin + datasources: + - gdrive + page_size: 500 + properties: + query: + type: string + minLength: 1 + description: | + The search query string. Supports inline operators such as `from:jane type:document app:confluence`. Inline operators are AND'd with structured `filters`. + datasources: + type: array + minItems: 1 + items: + type: string + minLength: 1 + description: | + Restrict results to specific datasource identifiers returned by `GET /api/search/filters`. Scopes by datasource type and may include results from multiple instances of that type. Omit to enumerate across all visible datasources matching `query` or `filters`. + filters: + type: array + minItems: 1 + items: + $ref: "#/components/schemas/PlatformFilter" + description: | + Structured filters applied to search results. Multiple values within a filter with `EQUALS` are OR'd; separate filters are AND'd. Conflicting constraints on the same field (for example, `type:document` in `query` and `type:spreadsheet` in a filter) return an empty result set. See `Filter.field` for built-in field names and operators. Other nonblank field names are accepted as custom filters without validation; behavior depends on your connected sources. + time_range: + $ref: "#/components/schemas/PlatformTimeRange" + page_size: + type: integer + minimum: 1 + maximum: 1000 + default: 100 + description: Number of results to return per page. + cursor: + type: + - string + - "null" + description: | + Opaque pagination token from a previous response's `next_cursor` field. Omit on the first request. Cursors do not expire and are valid only for the original selection. + include: + type: array + minItems: 1 + uniqueItems: true + items: + $ref: "#/components/schemas/PlatformSearchEnumerationInclude" + description: | + Optional field groups to add to each document reference. Each value only adds fields; it does not change which documents are returned. + PlatformDocumentReference: + type: object + additionalProperties: false + required: + - document_id + - url + - title + - datasource + properties: + document_id: + type: string + minLength: 1 + description: | + Indexed Glean store ID. Stable identity for deduplication and the selector accepted by `POST /api/documents/batch`. + example: doc_123 + url: + type: string + format: uri + minLength: 1 + description: Canonical URL of the result. + example: https://docs.google.com/spreadsheets/d/abc + title: + type: string + minLength: 1 + description: Display title. For a conversation, this is a title built from the participants, such as "Alice and Bob", including when the indexed title is the message body. When the result has no title, the server returns Untitled. + example: Amoxicillin inventory + datasource: + type: string + minLength: 1 + description: The datasource this result originates from. + example: gdrive + document_type: + type: + - string + - "null" + minLength: 1 + description: The document type within the datasource. + example: spreadsheet + creator: + $ref: "#/components/schemas/PlatformPersonReference" + owner: + $ref: "#/components/schemas/PlatformPersonReference" + updated_at: + type: + - string + - "null" + format: date-time + description: When the result was last modified. + created_at: + type: + - string + - "null" + format: date-time + description: When the result was created. + snippets: + type: array + items: + type: string + minLength: 1 + description: | + Query-relevant plain-text excerpts from the document body. Present only when the request's `include` contains `SNIPPETS` and `query` is set. + example: + - Amoxicillin 500mg inventory was last counted on... + PlatformSearchEnumerationResponse: + type: object + additionalProperties: false + required: + - results + - has_more + - next_cursor + - request_id + properties: + results: + type: array + items: + $ref: "#/components/schemas/PlatformDocumentReference" + description: Document references at this cursor position. + has_more: + type: boolean + description: Indicates whether additional pages of results are available. + next_cursor: + type: + - string + - "null" + description: | + Opaque token to pass as `cursor` in the next request. Null exactly when `has_more` is false. + request_id: + type: string + minLength: 1 + description: Platform-generated request ID for support correlation. PlatformPerMemberSettings: type: object additionalProperties: false @@ -14288,6 +14420,8 @@ components: - CONVERTED_TO_DRAFT - WEBHOOK_UPDATED - WEBHOOK_CREATED + - CLOSED + - COMMENT_ADDED x-enumDescriptions: CREATED: The document was created. UPDATED: The document was updated. @@ -14303,6 +14437,8 @@ components: CONVERTED_TO_DRAFT: The item was converted back to a draft. WEBHOOK_UPDATED: The source system sent a webhook update. WEBHOOK_CREATED: The source system sent a webhook creation event. + CLOSED: The item was closed. + COMMENT_ADDED: A comment was added to the item. x-speakeasy-enum-descriptions: CREATED: The document was created. UPDATED: The document was updated. @@ -14318,6 +14454,8 @@ components: CONVERTED_TO_DRAFT: The item was converted back to a draft. WEBHOOK_UPDATED: The source system sent a webhook update. WEBHOOK_CREATED: The source system sent a webhook creation event. + CLOSED: The item was closed. + COMMENT_ADDED: A comment was added to the item. PlatformTriggerEvent: type: object required: diff --git a/.speakeasy/tests.arazzo.yaml b/.speakeasy/tests.arazzo.yaml index 57315162..a60a5d53 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 @@ -159804,3 +159789,23 @@ workflows: type: simple x-speakeasy-test-group: documents_SDK x-speakeasy-test-rebuild: true + - workflowId: platform-search-enumeration + steps: + - stepId: test + operationId: platform-search-enumeration + requestBody: + contentType: application/json + payload: + datasources: + - gdrive + page_size: 500 + query: amoxicillin + successCriteria: + - condition: $statusCode == 200 + - condition: $response.header.Content-Type == application/json + - context: $response.body + condition: | + {"results":[],"has_more":false,"next_cursor":null,"request_id":""} + type: simple + x-speakeasy-test-group: search + x-speakeasy-test-rebuild: true diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 3a37942c..c19c90c9 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.808.1 +speakeasyVersion: 1.809.0 sources: Glean API: sourceNamespace: glean-api-specs - sourceRevisionDigest: sha256:509e25a8ae0bbaf6e23c95c58de651349216086a13278a3792b2e3f8be68fc6b - sourceBlobDigest: sha256:15ce4e757fd8eb3c2a3857cb15740c718b57c969342223ccc0de7437748a8609 + sourceRevisionDigest: sha256:872476237575ccc7e2720d7a31a66fc38ec7c561cfd2e33459cf33e1a45d9949 + sourceBlobDigest: sha256:7d5c308c3a1ba3c2dc2486a0006d48995e1618f3be0673c7e9422fd5eb582f2a 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:872476237575ccc7e2720d7a31a66fc38ec7c561cfd2e33459cf33e1a45d9949 + sourceBlobDigest: sha256:7d5c308c3a1ba3c2dc2486a0006d48995e1618f3be0673c7e9422fd5eb582f2a codeSamplesNamespace: glean-api-specs-python-code-samples - codeSamplesRevisionDigest: sha256:5de9ed3291b25ba50b857aa18d4dca14272ee47e2ce880201d3f3def4d0c5b63 + codeSamplesRevisionDigest: sha256:ffc712fe412658c8fdeb938c2853c881d293687b11c52d0a9ff1330648383f14 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index d8c81a5a..65307840 100644 --- a/README.md +++ b/README.md @@ -587,6 +587,7 @@ For more information on obtaining the appropriate token type, please contact you * [query](docs/sdks/search/README.md#query) - Search * [list_filters](docs/sdks/search/README.md#list_filters) - List search filters +* [enumerate](docs/sdks/search/README.md#enumerate) - Enumerate matching documents ### [Skills](docs/sdks/skills/README.md) @@ -640,7 +641,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 +649,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..23ee23a1 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-16 11:50:19 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.809.0 (2.961.1) 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/platformdocumentreference.md b/docs/models/platformdocumentreference.md new file mode 100644 index 00000000..93d5cdea --- /dev/null +++ b/docs/models/platformdocumentreference.md @@ -0,0 +1,17 @@ +# PlatformDocumentReference + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `document_id` | *str* | :heavy_check_mark: | Indexed Glean store ID. Stable identity for deduplication and the selector accepted by `POST /api/documents/batch`.
| doc_123 | +| `url` | *str* | :heavy_check_mark: | Canonical URL of the result. | https://docs.google.com/spreadsheets/d/abc | +| `title` | *str* | :heavy_check_mark: | Display title. For a conversation, this is a title built from the participants, such as "Alice and Bob", including when the indexed title is the message body. When the result has no title, the server returns Untitled. | Amoxicillin inventory | +| `datasource` | *str* | :heavy_check_mark: | The datasource this result originates from. | gdrive | +| `document_type` | *OptionalNullable[str]* | :heavy_minus_sign: | The document type within the datasource. | spreadsheet | +| `creator` | [Optional[models.PlatformPersonReference]](../models/platformpersonreference.md) | :heavy_minus_sign: | A lightweight reference to a person, used where a payload merely points at someone. | | +| `owner` | [Optional[models.PlatformPersonReference]](../models/platformpersonreference.md) | :heavy_minus_sign: | A lightweight reference to a person, used where a payload merely points at someone. | | +| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | When the result was last modified. | | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | When the result was created. | | +| `snippets` | List[*str*] | :heavy_minus_sign: | Query-relevant plain-text excerpts from the document body. Present only when the request's `include` contains `SNIPPETS` and `query` is set.
| [
"Amoxicillin 500mg inventory was last counted on..."
] | \ No newline at end of file diff --git a/docs/models/platformsearchenumerationinclude.md b/docs/models/platformsearchenumerationinclude.md new file mode 100644 index 00000000..bced8b4a --- /dev/null +++ b/docs/models/platformsearchenumerationinclude.md @@ -0,0 +1,18 @@ +# PlatformSearchEnumerationInclude + +Optional document reference projection. + +## Example Usage + +```python +from glean.api_client.models import PlatformSearchEnumerationInclude + +value = PlatformSearchEnumerationInclude.SNIPPETS +``` + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `SNIPPETS` | SNIPPETS | \ No newline at end of file diff --git a/docs/models/platformsearchenumerationrequest.md b/docs/models/platformsearchenumerationrequest.md new file mode 100644 index 00000000..85bb7ea6 --- /dev/null +++ b/docs/models/platformsearchenumerationrequest.md @@ -0,0 +1,17 @@ +# PlatformSearchEnumerationRequest + +Selection to enumerate. At least one of `datasources`, `query`, or `filters` must be set. + + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `query` | *Optional[str]* | :heavy_minus_sign: | The search query string. Supports inline operators such as `from:jane type:document app:confluence`. Inline operators are AND'd with structured `filters`.
| +| `datasources` | List[*str*] | :heavy_minus_sign: | Restrict results to specific datasource identifiers returned by `GET /api/search/filters`. Scopes by datasource type and may include results from multiple instances of that type. Omit to enumerate across all visible datasources matching `query` or `filters`.
| +| `filters` | List[[models.PlatformFilter](../models/platformfilter.md)] | :heavy_minus_sign: | Structured filters applied to search results. Multiple values within a filter with `EQUALS` are OR'd; separate filters are AND'd. Conflicting constraints on the same field (for example, `type:document` in `query` and `type:spreadsheet` in a filter) return an empty result set. See `Filter.field` for built-in field names and operators. Other nonblank field names are accepted as custom filters without validation; behavior depends on your connected sources.
| +| `time_range` | [Optional[models.PlatformTimeRange]](../models/platformtimerange.md) | :heavy_minus_sign: | Filter results to those last updated within this range. | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of results to return per page. | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Opaque pagination token from a previous response's `next_cursor` field. Omit on the first request. Cursors do not expire and are valid only for the original selection.
| +| `include` | List[[models.PlatformSearchEnumerationInclude](../models/platformsearchenumerationinclude.md)] | :heavy_minus_sign: | Optional field groups to add to each document reference. Each value only adds fields; it does not change which documents are returned.
| \ No newline at end of file diff --git a/docs/models/platformsearchenumerationresponse.md b/docs/models/platformsearchenumerationresponse.md new file mode 100644 index 00000000..3c79d022 --- /dev/null +++ b/docs/models/platformsearchenumerationresponse.md @@ -0,0 +1,11 @@ +# PlatformSearchEnumerationResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `results` | List[[models.PlatformDocumentReference](../models/platformdocumentreference.md)] | :heavy_check_mark: | Document references at this cursor position. | +| `has_more` | *bool* | :heavy_check_mark: | Indicates whether additional pages of results are available. | +| `next_cursor` | *Nullable[str]* | :heavy_check_mark: | Opaque token to pass as `cursor` in the next request. Null exactly when `has_more` is false.
| +| `request_id` | *str* | :heavy_check_mark: | Platform-generated request ID for support correlation. | \ No newline at end of file diff --git a/docs/models/platformtriggereventreason.md b/docs/models/platformtriggereventreason.md index 7c2dab23..0a2c9d6e 100644 --- a/docs/models/platformtriggereventreason.md +++ b/docs/models/platformtriggereventreason.md @@ -30,4 +30,6 @@ value = PlatformTriggerEventReason.CREATED | `READY_FOR_REVIEW` | READY_FOR_REVIEW | | `CONVERTED_TO_DRAFT` | CONVERTED_TO_DRAFT | | `WEBHOOK_UPDATED` | WEBHOOK_UPDATED | -| `WEBHOOK_CREATED` | WEBHOOK_CREATED | \ No newline at end of file +| `WEBHOOK_CREATED` | WEBHOOK_CREATED | +| `CLOSED` | CLOSED | +| `COMMENT_ADDED` | COMMENT_ADDED | \ 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/docs/sdks/search/README.md b/docs/sdks/search/README.md index 816c6349..d1aa1757 100644 --- a/docs/sdks/search/README.md +++ b/docs/sdks/search/README.md @@ -6,6 +6,7 @@ * [query](#query) - Search * [list_filters](#list_filters) - List search filters +* [enumerate](#enumerate) - Enumerate matching documents ## query @@ -107,4 +108,65 @@ with Glean( | --------------------------------- | --------------------------------- | --------------------------------- | | errors.PlatformProblemDetailError | 400, 401, 403, 404, 408, 429 | application/problem+json | | errors.PlatformProblemDetailError | 500, 503 | application/problem+json | -| errors.GleanError | 4XX, 5XX | \*/\* | \ No newline at end of file +| errors.GleanError | 4XX, 5XX | \*/\* | + +## enumerate + +Walk every indexed document that matches a selection and that the caller is permitted to see. Returns document references with minimal metadata and never bodies; request `SNIPPETS` via `include` for query-relevant excerpts, and hydrate full documents with `POST /api/documents/batch`. Unlike `POST /api/search`, `query` is optional: omit it to enumerate by `datasources`, `filters`, and `time_range` alone. Results are ordered for completeness, not relevance. +Follow `next_cursor` until `has_more` is `false`, regardless of page size. This is a live scan, not a snapshot: concurrent index changes can cause duplicates or omissions. Deduplicate by `document_id`. +A page is either complete at its cursor position or an error. A shard or datasource failure returns HTTP 503 and the same cursor stays valid for retry; this endpoint never returns a partial page. A cursor reused with a different selection returns HTTP 400 `invalid_cursor`. + + +### Example Usage + + +```python +from glean.api_client import Glean +import os + + +with Glean( + api_token=os.getenv("GLEAN_API_TOKEN"), +) as glean: + + res = glean.search.enumerate(query="amoxicillin", datasources=[ + "gdrive", + ], filters=[ + { + "field": "type", + "values": [ + "spreadsheet", + "presentation", + ], + }, + ], page_size=500) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `query` | *Optional[str]* | :heavy_minus_sign: | The search query string. Supports inline operators such as `from:jane type:document app:confluence`. Inline operators are AND'd with structured `filters`.
| +| `datasources` | List[*str*] | :heavy_minus_sign: | Restrict results to specific datasource identifiers returned by `GET /api/search/filters`. Scopes by datasource type and may include results from multiple instances of that type. Omit to enumerate across all visible datasources matching `query` or `filters`.
| +| `filters` | List[[models.PlatformFilter](../../models/platformfilter.md)] | :heavy_minus_sign: | Structured filters applied to search results. Multiple values within a filter with `EQUALS` are OR'd; separate filters are AND'd. Conflicting constraints on the same field (for example, `type:document` in `query` and `type:spreadsheet` in a filter) return an empty result set. See `Filter.field` for built-in field names and operators. Other nonblank field names are accepted as custom filters without validation; behavior depends on your connected sources.
| +| `time_range` | [Optional[models.PlatformTimeRange]](../../models/platformtimerange.md) | :heavy_minus_sign: | Filter results to those last updated within this range. | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of results to return per page. | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Opaque pagination token from a previous response's `next_cursor` field. Omit on the first request. Cursors do not expire and are valid only for the original selection.
| +| `include` | List[[models.PlatformSearchEnumerationInclude](../../models/platformsearchenumerationinclude.md)] | :heavy_minus_sign: | Optional field groups to add to each document reference. Each value only adds fields; it does not change which documents are returned.
| +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.PlatformSearchEnumerationResponse](../../models/platformsearchenumerationresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.PlatformProblemDetailError | 400, 401, 403, 404, 408, 413, 422, 429 | application/problem+json | +| errors.PlatformProblemDetailError | 500, 503 | application/problem+json | +| errors.GleanError | 4XX, 5XX | \*/\* | \ No newline at end of file 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..df530441 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" +__gen_version__: str = "2.961.1" +__user_agent__: str = "speakeasy-sdk/python 0.17.22 2.961.1 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..3693ca1b 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, @@ -1730,6 +1710,10 @@ PlatformDocumentGetResponseTypedDict, ) from .platformdocumentinclude import PlatformDocumentInclude + from .platformdocumentreference import ( + PlatformDocumentReference, + PlatformDocumentReferenceTypedDict, + ) from .platformdocumentsbatchrequest import ( PlatformDocumentsBatchRequest, PlatformDocumentsBatchRequestDocumentSpec, @@ -1858,6 +1842,15 @@ PlatformProblemDetailErrorTypedDict, ) from .platformresult import PlatformResult, PlatformResultTypedDict + from .platformsearchenumerationinclude import PlatformSearchEnumerationInclude + from .platformsearchenumerationrequest import ( + PlatformSearchEnumerationRequest, + PlatformSearchEnumerationRequestTypedDict, + ) + from .platformsearchenumerationresponse import ( + PlatformSearchEnumerationResponse, + PlatformSearchEnumerationResponseTypedDict, + ) from .platformsearchfiltersresponse import ( PlatformSearchFiltersResponse, PlatformSearchFiltersResponseTypedDict, @@ -3604,22 +3597,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 +3626,6 @@ "PlatformChatInputMessage", "PlatformChatInputMessageRole", "PlatformChatInputMessageTypedDict", - "PlatformChatJSONSchemaFormat", - "PlatformChatJSONSchemaFormatType", - "PlatformChatJSONSchemaFormatTypedDict", "PlatformChatOutputMessage", "PlatformChatOutputMessageRole", "PlatformChatOutputMessageType", @@ -3688,9 +3670,6 @@ "PlatformChatStreamResponseFailedServerSentEventTypedDict", "PlatformChatStreamResponseFailedType", "PlatformChatStreamResponseFailedTypedDict", - "PlatformChatTextFormat", - "PlatformChatTextFormatType", - "PlatformChatTextFormatTypedDict", "PlatformChatTypedDict", "PlatformChatUpdateRequest", "PlatformChatUpdateRequestRequest", @@ -3720,6 +3699,8 @@ "PlatformDocumentGetResponse", "PlatformDocumentGetResponseTypedDict", "PlatformDocumentInclude", + "PlatformDocumentReference", + "PlatformDocumentReferenceTypedDict", "PlatformDocumentTypedDict", "PlatformDocumentsBatchRequest", "PlatformDocumentsBatchRequestDocumentSpec", @@ -3802,6 +3783,11 @@ "PlatformProblemDetailTypedDict", "PlatformResult", "PlatformResultTypedDict", + "PlatformSearchEnumerationInclude", + "PlatformSearchEnumerationRequest", + "PlatformSearchEnumerationRequestTypedDict", + "PlatformSearchEnumerationResponse", + "PlatformSearchEnumerationResponseTypedDict", "PlatformSearchFiltersRequest", "PlatformSearchFiltersRequestTypedDict", "PlatformSearchFiltersResponse", @@ -4187,8 +4173,6 @@ "StructuredLinkTypedDict", "StructuredLocation", "StructuredLocationTypedDict", - "StructuredOutput", - "StructuredOutputTypedDict", "StructuredResult", "StructuredResultSource", "StructuredResultTypedDict", @@ -5317,22 +5301,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 +5451,6 @@ "PlatformChatInputMessage": ".platformchatinputmessage", "PlatformChatInputMessageRole": ".platformchatinputmessage", "PlatformChatInputMessageTypedDict": ".platformchatinputmessage", - "PlatformChatJSONSchemaFormat": ".platformchatjsonschemaformat", - "PlatformChatJSONSchemaFormatType": ".platformchatjsonschemaformat", - "PlatformChatJSONSchemaFormatTypedDict": ".platformchatjsonschemaformat", "PlatformChatOutputMessage": ".platformchatoutputmessage", "PlatformChatOutputMessageRole": ".platformchatoutputmessage", "PlatformChatOutputMessageType": ".platformchatoutputmessage", @@ -5485,8 +5458,6 @@ "PlatformChatOutputTextContent": ".platformchatoutputtextcontent", "PlatformChatOutputTextContentType": ".platformchatoutputtextcontent", "PlatformChatOutputTextContentTypedDict": ".platformchatoutputtextcontent", - "StructuredOutput": ".platformchatoutputtextcontent", - "StructuredOutputTypedDict": ".platformchatoutputtextcontent", "PlatformChatPersonSource": ".platformchatpersonsource", "PlatformChatPersonSourceType": ".platformchatpersonsource", "PlatformChatPersonSourceTypedDict": ".platformchatpersonsource", @@ -5524,9 +5495,6 @@ "PlatformChatStreamResponseFailedTypedDict": ".platformchatstreamresponsefailed", "PlatformChatStreamResponseFailedServerSentEvent": ".platformchatstreamresponsefailedserversentevent", "PlatformChatStreamResponseFailedServerSentEventTypedDict": ".platformchatstreamresponsefailedserversentevent", - "PlatformChatTextFormat": ".platformchattextformat", - "PlatformChatTextFormatType": ".platformchattextformat", - "PlatformChatTextFormatTypedDict": ".platformchattextformat", "PlatformChatUpdateRequest": ".platformchatupdaterequest", "PlatformChatUpdateRequestTypedDict": ".platformchatupdaterequest", "PlatformChatUpdateResponse": ".platformchatupdateresponse", @@ -5550,6 +5518,8 @@ "PlatformDocumentGetResponse": ".platformdocumentgetresponse", "PlatformDocumentGetResponseTypedDict": ".platformdocumentgetresponse", "PlatformDocumentInclude": ".platformdocumentinclude", + "PlatformDocumentReference": ".platformdocumentreference", + "PlatformDocumentReferenceTypedDict": ".platformdocumentreference", "PlatformDocumentsBatchRequest": ".platformdocumentsbatchrequest", "PlatformDocumentsBatchRequestDocumentSpec": ".platformdocumentsbatchrequest", "PlatformDocumentsBatchRequestDocumentSpecTypedDict": ".platformdocumentsbatchrequest", @@ -5627,6 +5597,11 @@ "PlatformProblemDetailErrorTypedDict": ".platformproblemdetailerror", "PlatformResult": ".platformresult", "PlatformResultTypedDict": ".platformresult", + "PlatformSearchEnumerationInclude": ".platformsearchenumerationinclude", + "PlatformSearchEnumerationRequest": ".platformsearchenumerationrequest", + "PlatformSearchEnumerationRequestTypedDict": ".platformsearchenumerationrequest", + "PlatformSearchEnumerationResponse": ".platformsearchenumerationresponse", + "PlatformSearchEnumerationResponseTypedDict": ".platformsearchenumerationresponse", "PlatformSearchFiltersResponse": ".platformsearchfiltersresponse", "PlatformSearchFiltersResponseTypedDict": ".platformsearchfiltersresponse", "PlatformSearchRequest": ".platformsearchrequest", 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/src/glean/api_client/models/platformdocumentreference.py b/src/glean/api_client/models/platformdocumentreference.py new file mode 100644 index 00000000..b5f21f2b --- /dev/null +++ b/src/glean/api_client/models/platformdocumentreference.py @@ -0,0 +1,125 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .platformpersonreference import ( + PlatformPersonReference, + PlatformPersonReferenceTypedDict, +) +from datetime import datetime +from glean.api_client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + current_exclude_none, + serialize_with_info, +) +from glean.api_client.types.basemodel import current_filtered_dump +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class PlatformDocumentReferenceTypedDict(TypedDict): + document_id: str + r"""Indexed Glean store ID. Stable identity for deduplication and the selector accepted by `POST /api/documents/batch`. + + """ + url: str + r"""Canonical URL of the result.""" + title: str + r"""Display title. For a conversation, this is a title built from the participants, such as \"Alice and Bob\", including when the indexed title is the message body. When the result has no title, the server returns Untitled.""" + datasource: str + r"""The datasource this result originates from.""" + document_type: NotRequired[Nullable[str]] + r"""The document type within the datasource.""" + creator: NotRequired[PlatformPersonReferenceTypedDict] + r"""A lightweight reference to a person, used where a payload merely points at someone.""" + owner: NotRequired[PlatformPersonReferenceTypedDict] + r"""A lightweight reference to a person, used where a payload merely points at someone.""" + updated_at: NotRequired[Nullable[datetime]] + r"""When the result was last modified.""" + created_at: NotRequired[Nullable[datetime]] + r"""When the result was created.""" + snippets: NotRequired[List[str]] + r"""Query-relevant plain-text excerpts from the document body. Present only when the request's `include` contains `SNIPPETS` and `query` is set. + + """ + + +class PlatformDocumentReference(BaseModel): + document_id: str + r"""Indexed Glean store ID. Stable identity for deduplication and the selector accepted by `POST /api/documents/batch`. + + """ + + url: str + r"""Canonical URL of the result.""" + + title: str + r"""Display title. For a conversation, this is a title built from the participants, such as \"Alice and Bob\", including when the indexed title is the message body. When the result has no title, the server returns Untitled.""" + + datasource: str + r"""The datasource this result originates from.""" + + document_type: OptionalNullable[str] = UNSET + r"""The document type within the datasource.""" + + creator: Optional[PlatformPersonReference] = None + r"""A lightweight reference to a person, used where a payload merely points at someone.""" + + owner: Optional[PlatformPersonReference] = None + r"""A lightweight reference to a person, used where a payload merely points at someone.""" + + updated_at: OptionalNullable[datetime] = UNSET + r"""When the result was last modified.""" + + created_at: OptionalNullable[datetime] = UNSET + r"""When the result was created.""" + + snippets: Optional[List[str]] = None + r"""Query-relevant plain-text excerpts from the document body. Present only when the request's `include` contains `SNIPPETS` and `query` is set. + + """ + + @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( + [ + "document_type", + "creator", + "owner", + "updated_at", + "created_at", + "snippets", + ] + ) + nullable_fields = set(["document_type", "updated_at", "created_at"]) + exclude_none = current_exclude_none() + skip_filtered = exclude_none is False or current_filtered_dump() + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias if f.alias is not None else n + if k not in serialized and n not in serialized and skip_filtered: + continue + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/glean/api_client/models/platformsearchenumerationinclude.py b/src/glean/api_client/models/platformsearchenumerationinclude.py new file mode 100644 index 00000000..ebcdb647 --- /dev/null +++ b/src/glean/api_client/models/platformsearchenumerationinclude.py @@ -0,0 +1,11 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class PlatformSearchEnumerationInclude(str, Enum): + r"""Optional document reference projection.""" + + # Add snippets, query-relevant plain-text excerpts from the document body. Only produced when `query` is present; a scope-only scan has nothing to excerpt. + SNIPPETS = "SNIPPETS" diff --git a/src/glean/api_client/models/platformsearchenumerationrequest.py b/src/glean/api_client/models/platformsearchenumerationrequest.py new file mode 100644 index 00000000..6053594c --- /dev/null +++ b/src/glean/api_client/models/platformsearchenumerationrequest.py @@ -0,0 +1,125 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .platformfilter import PlatformFilter, PlatformFilterTypedDict +from .platformsearchenumerationinclude import PlatformSearchEnumerationInclude +from .platformtimerange import PlatformTimeRange, PlatformTimeRangeTypedDict +from glean.api_client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + current_exclude_none, + serialize_with_info, +) +from glean.api_client.types.basemodel import current_filtered_dump +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class PlatformSearchEnumerationRequestTypedDict(TypedDict): + r"""Selection to enumerate. At least one of `datasources`, `query`, or `filters` must be set.""" + + query: NotRequired[str] + r"""The search query string. Supports inline operators such as `from:jane type:document app:confluence`. Inline operators are AND'd with structured `filters`. + + """ + datasources: NotRequired[List[str]] + r"""Restrict results to specific datasource identifiers returned by `GET /api/search/filters`. Scopes by datasource type and may include results from multiple instances of that type. Omit to enumerate across all visible datasources matching `query` or `filters`. + + """ + filters: NotRequired[List[PlatformFilterTypedDict]] + r"""Structured filters applied to search results. Multiple values within a filter with `EQUALS` are OR'd; separate filters are AND'd. Conflicting constraints on the same field (for example, `type:document` in `query` and `type:spreadsheet` in a filter) return an empty result set. See `Filter.field` for built-in field names and operators. Other nonblank field names are accepted as custom filters without validation; behavior depends on your connected sources. + + """ + time_range: NotRequired[PlatformTimeRangeTypedDict] + r"""Filter results to those last updated within this range.""" + page_size: NotRequired[int] + r"""Number of results to return per page.""" + cursor: NotRequired[Nullable[str]] + r"""Opaque pagination token from a previous response's `next_cursor` field. Omit on the first request. Cursors do not expire and are valid only for the original selection. + + """ + include: NotRequired[List[PlatformSearchEnumerationInclude]] + r"""Optional field groups to add to each document reference. Each value only adds fields; it does not change which documents are returned. + + """ + + +class PlatformSearchEnumerationRequest(BaseModel): + r"""Selection to enumerate. At least one of `datasources`, `query`, or `filters` must be set.""" + + query: Optional[str] = None + r"""The search query string. Supports inline operators such as `from:jane type:document app:confluence`. Inline operators are AND'd with structured `filters`. + + """ + + datasources: Optional[List[str]] = None + r"""Restrict results to specific datasource identifiers returned by `GET /api/search/filters`. Scopes by datasource type and may include results from multiple instances of that type. Omit to enumerate across all visible datasources matching `query` or `filters`. + + """ + + filters: Optional[List[PlatformFilter]] = None + r"""Structured filters applied to search results. Multiple values within a filter with `EQUALS` are OR'd; separate filters are AND'd. Conflicting constraints on the same field (for example, `type:document` in `query` and `type:spreadsheet` in a filter) return an empty result set. See `Filter.field` for built-in field names and operators. Other nonblank field names are accepted as custom filters without validation; behavior depends on your connected sources. + + """ + + time_range: Optional[PlatformTimeRange] = None + r"""Filter results to those last updated within this range.""" + + page_size: Optional[int] = 100 + r"""Number of results to return per page.""" + + cursor: OptionalNullable[str] = UNSET + r"""Opaque pagination token from a previous response's `next_cursor` field. Omit on the first request. Cursors do not expire and are valid only for the original selection. + + """ + + include: Optional[List[PlatformSearchEnumerationInclude]] = None + r"""Optional field groups to add to each document reference. Each value only adds fields; it does not change which documents are returned. + + """ + + @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( + [ + "query", + "datasources", + "filters", + "time_range", + "page_size", + "cursor", + "include", + ] + ) + nullable_fields = set(["cursor"]) + exclude_none = current_exclude_none() + skip_filtered = exclude_none is False or current_filtered_dump() + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias if f.alias is not None else n + if k not in serialized and n not in serialized and skip_filtered: + continue + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/glean/api_client/models/platformsearchenumerationresponse.py b/src/glean/api_client/models/platformsearchenumerationresponse.py new file mode 100644 index 00000000..3f932142 --- /dev/null +++ b/src/glean/api_client/models/platformsearchenumerationresponse.py @@ -0,0 +1,68 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .platformdocumentreference import ( + PlatformDocumentReference, + PlatformDocumentReferenceTypedDict, +) +from glean.api_client.types import ( + BaseModel, + Nullable, + UNSET_SENTINEL, + current_exclude_none, + serialize_with_info, +) +from glean.api_client.types.basemodel import current_filtered_dump +from pydantic import model_serializer +from typing import List +from typing_extensions import TypedDict + + +class PlatformSearchEnumerationResponseTypedDict(TypedDict): + results: List[PlatformDocumentReferenceTypedDict] + r"""Document references at this cursor position.""" + has_more: bool + r"""Indicates whether additional pages of results are available.""" + next_cursor: Nullable[str] + r"""Opaque token to pass as `cursor` in the next request. Null exactly when `has_more` is false. + + """ + request_id: str + r"""Platform-generated request ID for support correlation.""" + + +class PlatformSearchEnumerationResponse(BaseModel): + results: List[PlatformDocumentReference] + r"""Document references at this cursor position.""" + + has_more: bool + r"""Indicates whether additional pages of results are available.""" + + next_cursor: Nullable[str] + r"""Opaque token to pass as `cursor` in the next request. Null exactly when `has_more` is false. + + """ + + request_id: str + r"""Platform-generated request ID for support correlation.""" + + @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): + 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: + m[k] = val + + return m diff --git a/src/glean/api_client/models/platformtriggereventreason.py b/src/glean/api_client/models/platformtriggereventreason.py index 8a0756fd..8bb10d81 100644 --- a/src/glean/api_client/models/platformtriggereventreason.py +++ b/src/glean/api_client/models/platformtriggereventreason.py @@ -36,3 +36,7 @@ class PlatformTriggerEventReason(str, Enum, metaclass=utils.OpenEnumMeta): WEBHOOK_UPDATED = "WEBHOOK_UPDATED" # The source system sent a webhook creation event. WEBHOOK_CREATED = "WEBHOOK_CREATED" + # The item was closed. + CLOSED = "CLOSED" + # A comment was added to the item. + COMMENT_ADDED = "COMMENT_ADDED" diff --git a/src/glean/api_client/search.py b/src/glean/api_client/search.py index 7150efbf..a2fdfcba 100644 --- a/src/glean/api_client/search.py +++ b/src/glean/api_client/search.py @@ -533,3 +533,315 @@ async def list_filters_async( raise errors.GleanError("API error occurred", http_res, http_res_text) raise errors.GleanError("Unexpected response received", http_res) + + def enumerate( + self, + *, + query: Optional[str] = None, + datasources: Optional[Iterable[str]] = None, + filters: Optional[ + Union[ + Iterable[models.PlatformFilter], + Iterable[models.PlatformFilterTypedDict], + ] + ] = None, + time_range: Optional[ + Union[models.PlatformTimeRange, models.PlatformTimeRangeTypedDict] + ] = None, + page_size: Optional[int] = 100, + cursor: OptionalNullable[str] = UNSET, + include: Optional[Iterable[models.PlatformSearchEnumerationInclude]] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.PlatformSearchEnumerationResponse: + r"""Enumerate matching documents + + Walk every indexed document that matches a selection and that the caller is permitted to see. Returns document references with minimal metadata and never bodies; request `SNIPPETS` via `include` for query-relevant excerpts, and hydrate full documents with `POST /api/documents/batch`. Unlike `POST /api/search`, `query` is optional: omit it to enumerate by `datasources`, `filters`, and `time_range` alone. Results are ordered for completeness, not relevance. + Follow `next_cursor` until `has_more` is `false`, regardless of page size. This is a live scan, not a snapshot: concurrent index changes can cause duplicates or omissions. Deduplicate by `document_id`. + A page is either complete at its cursor position or an error. A shard or datasource failure returns HTTP 503 and the same cursor stays valid for retry; this endpoint never returns a partial page. A cursor reused with a different selection returns HTTP 400 `invalid_cursor`. + + + :param query: The search query string. Supports inline operators such as `from:jane type:document app:confluence`. Inline operators are AND'd with structured `filters`. + + :param datasources: Restrict results to specific datasource identifiers returned by `GET /api/search/filters`. Scopes by datasource type and may include results from multiple instances of that type. Omit to enumerate across all visible datasources matching `query` or `filters`. + + :param filters: Structured filters applied to search results. Multiple values within a filter with `EQUALS` are OR'd; separate filters are AND'd. Conflicting constraints on the same field (for example, `type:document` in `query` and `type:spreadsheet` in a filter) return an empty result set. See `Filter.field` for built-in field names and operators. Other nonblank field names are accepted as custom filters without validation; behavior depends on your connected sources. + + :param time_range: Filter results to those last updated within this range. + :param page_size: Number of results to return per page. + :param cursor: Opaque pagination token from a previous response's `next_cursor` field. Omit on the first request. Cursors do not expire and are valid only for the original selection. + + :param include: Optional field groups to add to each document reference. Each value only adds fields; it does not change which documents are returned. + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.PlatformSearchEnumerationRequest( + query=query, + datasources=utils.unmarshal(datasources, Optional[List[str]]), + filters=utils.get_pydantic_model( + filters, Optional[List[models.PlatformFilter]] + ), + time_range=utils.get_pydantic_model( + time_range, Optional[models.PlatformTimeRange] + ), + page_size=page_size, + cursor=cursor, + include=utils.unmarshal( + include, Optional[List[models.PlatformSearchEnumerationInclude]] + ), + ) + + req = self._build_request( + method="POST", + path="/api/search/enumeration", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.PlatformSearchEnumerationRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="platform-search-enumeration", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Search"], + extensions={ + "x-codegen-request-body-name": "payload", + "x-glean-experimental": { + "id": "9ce7bb73-1e30-460a-a917-cae09ac3a3ea", + "introduced": "2026-11-02", + }, + "x-glean-scopes": { + "legacy": ["SEARCH"], + "platform": ["search:query"], + }, + "x-visibility": "Public", + }, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.PlatformSearchEnumerationResponse, http_res + ) + if utils.match_response( + http_res, + ["400", "401", "403", "404", "408", "413", "422", "429"], + "application/problem+json", + ): + response_data = unmarshal_json_response( + errors.PlatformProblemDetailErrorData, http_res + ) + raise errors.PlatformProblemDetailError(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/problem+json"): + response_data = unmarshal_json_response( + errors.PlatformProblemDetailErrorData, http_res + ) + raise errors.PlatformProblemDetailError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) + + async def enumerate_async( + self, + *, + query: Optional[str] = None, + datasources: Optional[Iterable[str]] = None, + filters: Optional[ + Union[ + Iterable[models.PlatformFilter], + Iterable[models.PlatformFilterTypedDict], + ] + ] = None, + time_range: Optional[ + Union[models.PlatformTimeRange, models.PlatformTimeRangeTypedDict] + ] = None, + page_size: Optional[int] = 100, + cursor: OptionalNullable[str] = UNSET, + include: Optional[Iterable[models.PlatformSearchEnumerationInclude]] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.PlatformSearchEnumerationResponse: + r"""Enumerate matching documents + + Walk every indexed document that matches a selection and that the caller is permitted to see. Returns document references with minimal metadata and never bodies; request `SNIPPETS` via `include` for query-relevant excerpts, and hydrate full documents with `POST /api/documents/batch`. Unlike `POST /api/search`, `query` is optional: omit it to enumerate by `datasources`, `filters`, and `time_range` alone. Results are ordered for completeness, not relevance. + Follow `next_cursor` until `has_more` is `false`, regardless of page size. This is a live scan, not a snapshot: concurrent index changes can cause duplicates or omissions. Deduplicate by `document_id`. + A page is either complete at its cursor position or an error. A shard or datasource failure returns HTTP 503 and the same cursor stays valid for retry; this endpoint never returns a partial page. A cursor reused with a different selection returns HTTP 400 `invalid_cursor`. + + + :param query: The search query string. Supports inline operators such as `from:jane type:document app:confluence`. Inline operators are AND'd with structured `filters`. + + :param datasources: Restrict results to specific datasource identifiers returned by `GET /api/search/filters`. Scopes by datasource type and may include results from multiple instances of that type. Omit to enumerate across all visible datasources matching `query` or `filters`. + + :param filters: Structured filters applied to search results. Multiple values within a filter with `EQUALS` are OR'd; separate filters are AND'd. Conflicting constraints on the same field (for example, `type:document` in `query` and `type:spreadsheet` in a filter) return an empty result set. See `Filter.field` for built-in field names and operators. Other nonblank field names are accepted as custom filters without validation; behavior depends on your connected sources. + + :param time_range: Filter results to those last updated within this range. + :param page_size: Number of results to return per page. + :param cursor: Opaque pagination token from a previous response's `next_cursor` field. Omit on the first request. Cursors do not expire and are valid only for the original selection. + + :param include: Optional field groups to add to each document reference. Each value only adds fields; it does not change which documents are returned. + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.PlatformSearchEnumerationRequest( + query=query, + datasources=utils.unmarshal(datasources, Optional[List[str]]), + filters=utils.get_pydantic_model( + filters, Optional[List[models.PlatformFilter]] + ), + time_range=utils.get_pydantic_model( + time_range, Optional[models.PlatformTimeRange] + ), + page_size=page_size, + cursor=cursor, + include=utils.unmarshal( + include, Optional[List[models.PlatformSearchEnumerationInclude]] + ), + ) + + req = self._build_request_async( + method="POST", + path="/api/search/enumeration", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.PlatformSearchEnumerationRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="platform-search-enumeration", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + tags=["Search"], + extensions={ + "x-codegen-request-body-name": "payload", + "x-glean-experimental": { + "id": "9ce7bb73-1e30-460a-a917-cae09ac3a3ea", + "introduced": "2026-11-02", + }, + "x-glean-scopes": { + "legacy": ["SEARCH"], + "platform": ["search:query"], + }, + "x-visibility": "Public", + }, + ), + request=req, + is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.PlatformSearchEnumerationResponse, http_res + ) + if utils.match_response( + http_res, + ["400", "401", "403", "404", "408", "413", "422", "429"], + "application/problem+json", + ): + response_data = unmarshal_json_response( + errors.PlatformProblemDetailErrorData, http_res + ) + raise errors.PlatformProblemDetailError(response_data, http_res) + if utils.match_response(http_res, ["500", "503"], "application/problem+json"): + response_data = unmarshal_json_response( + errors.PlatformProblemDetailErrorData, http_res + ) + raise errors.PlatformProblemDetailError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.GleanError("API error occurred", http_res, http_res_text) + + raise errors.GleanError("Unexpected response received", http_res) diff --git a/src/glean/api_client/types/base64fileinput.py b/src/glean/api_client/types/base64fileinput.py index 862566fe..de42346d 100644 --- a/src/glean/api_client/types/base64fileinput.py +++ b/src/glean/api_client/types/base64fileinput.py @@ -11,30 +11,52 @@ from typing_extensions import Annotated -Base64FileInput = Union[IO[bytes], PathLike[str]] +Base64FileInput = Union[bytes, bytearray, memoryview, IO[bytes], PathLike[str]] + +_BYTE_FORMATS = ("B", "b", "c") + + +# Must stay a str subclass, returned only for bytes-like input: pydantic scores it as a strict +# but non-exact str match, so an exact `bytes` member of the same union wins for `bytes` input. +class _EncodedBase64(str): + pass + + +def _encode_binary(binary: Union[bytes, bytearray, memoryview]) -> str: + if isinstance(binary, memoryview): + if binary.format.lstrip("@=<>!") not in _BYTE_FORMATS: + raise ValueError( + f"Base64FileInput expected a memoryview of bytes; got item format {binary.format!r}" + ) + if not binary.c_contiguous: + binary = bytes(binary) + return base64.b64encode(binary).decode("ascii") def encode_base64_file_input(value: Any) -> Any: - """Convert PathLike or IO[bytes] inputs to a base64 string. All standard binary streams - that inherit from io.IOBase are handled. Other values pass through. + """Convert raw bytes-like, PathLike or IO[bytes] inputs to a base64 string. All standard + binary streams that inherit from io.IOBase are handled. Bytes-like values are always + treated as raw content and encoded; str values pass through as already-encoded base64. + Other values pass through. """ - if isinstance(value, (PathLike, io.IOBase)): - if isinstance(value, PathLike): - with open(value, "rb") as fh: - binary = fh.read() - else: - # Restore position after reading: pydantic may validate the same stream more than once. - position = value.tell() if value.seekable() else None - binary = value.read() - if position is not None: - value.seek(position) - if isinstance(binary, str): - binary = binary.encode() - if not isinstance(binary, (bytes, bytearray)): + if isinstance(value, PathLike): + with open(value, "rb") as fh: + return _encode_binary(fh.read()) + if isinstance(value, io.IOBase): + # Restore position after reading: pydantic may validate the same stream more than once. + position = value.tell() if value.seekable() else None + binary = value.read() + if position is not None: + value.seek(position) + if isinstance(binary, str): + binary = binary.encode() + if not isinstance(binary, (bytes, bytearray, memoryview)): raise TypeError( f"Base64FileInput expected binary IO returning bytes; got {type(binary).__name__}" ) - return base64.b64encode(binary).decode("ascii") + return _encode_binary(binary) + if isinstance(value, (bytes, bytearray, memoryview)): + return _EncodedBase64(_encode_binary(value)) return value diff --git a/tests/mockserver/internal/handler/generated_handlers.go b/tests/mockserver/internal/handler/generated_handlers.go index 75f142bb..10cb3da0 100644 --- a/tests/mockserver/internal/handler/generated_handlers.go +++ b/tests/mockserver/internal/handler/generated_handlers.go @@ -94,6 +94,7 @@ func GeneratedHandlers(ctx context.Context, dir *logging.HTTPFileDirectory, rt * NewGeneratedHandler(ctx, http.MethodPost, "/api/index/v1/rotatetoken", pathPostAPIIndexV1Rotatetoken(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/api/index/v1/updatepermissions", pathPostAPIIndexV1Updatepermissions(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/api/search", pathPostAPISearch(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/api/search/enumeration", pathPostAPISearchEnumeration(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/api/skills", pathPostAPISkills(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/api/skills/import", pathPostAPISkillsImport(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/api/skills/sources/preview", pathPostAPISkillsSourcesPreview(dir, rt)), diff --git a/tests/mockserver/internal/handler/pathpostapisearchenumeration.go b/tests/mockserver/internal/handler/pathpostapisearchenumeration.go new file mode 100644 index 00000000..8434a2e3 --- /dev/null +++ b/tests/mockserver/internal/handler/pathpostapisearchenumeration.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostAPISearchEnumeration(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "platform-search-enumeration[0]": + dir.HandlerFunc("platform-search-enumeration", testPlatformSearchEnumerationPlatformSearchEnumeration0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPlatformSearchEnumerationPlatformSearchEnumeration0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.PlatformSearchEnumerationResponse = &components.PlatformSearchEnumerationResponse{ + Results: []components.PlatformDocumentReference{}, + HasMore: false, + NextCursor: nil, + RequestID: "", + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/tests/mockserver/internal/sdk/models/components/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/components/platformdocumentreference.go b/tests/mockserver/internal/sdk/models/components/platformdocumentreference.go new file mode 100644 index 00000000..8d5ee032 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformdocumentreference.go @@ -0,0 +1,115 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "mockserver/internal/sdk/optionalnullable" + "mockserver/internal/sdk/utils" + "time" +) + +type PlatformDocumentReference struct { + // Indexed Glean store ID. Stable identity for deduplication and the selector accepted by `POST /api/documents/batch`. + // + DocumentID string `json:"document_id"` + // Canonical URL of the result. + URL string `json:"url"` + // Display title. For a conversation, this is a title built from the participants, such as "Alice and Bob", including when the indexed title is the message body. When the result has no title, the server returns Untitled. + Title string `json:"title"` + // The datasource this result originates from. + Datasource string `json:"datasource"` + // The document type within the datasource. + DocumentType optionalnullable.OptionalNullable[string] `json:"document_type,omitempty"` + // A lightweight reference to a person, used where a payload merely points at someone. + Creator *PlatformPersonReference `json:"creator,omitempty"` + // A lightweight reference to a person, used where a payload merely points at someone. + Owner *PlatformPersonReference `json:"owner,omitempty"` + // When the result was last modified. + UpdatedAt optionalnullable.OptionalNullable[time.Time] `json:"updated_at,omitempty"` + // When the result was created. + CreatedAt optionalnullable.OptionalNullable[time.Time] `json:"created_at,omitempty"` + // Query-relevant plain-text excerpts from the document body. Present only when the request's `include` contains `SNIPPETS` and `query` is set. + // + Snippets []string `json:"snippets,omitempty"` +} + +func (p PlatformDocumentReference) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PlatformDocumentReference) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, []string{"document_id", "url", "title", "datasource"}); err != nil { + return err + } + return nil +} + +func (o *PlatformDocumentReference) GetDocumentID() string { + if o == nil { + return "" + } + return o.DocumentID +} + +func (o *PlatformDocumentReference) GetURL() string { + if o == nil { + return "" + } + return o.URL +} + +func (o *PlatformDocumentReference) GetTitle() string { + if o == nil { + return "" + } + return o.Title +} + +func (o *PlatformDocumentReference) GetDatasource() string { + if o == nil { + return "" + } + return o.Datasource +} + +func (o *PlatformDocumentReference) GetDocumentType() optionalnullable.OptionalNullable[string] { + if o == nil { + return nil + } + return o.DocumentType +} + +func (o *PlatformDocumentReference) GetCreator() *PlatformPersonReference { + if o == nil { + return nil + } + return o.Creator +} + +func (o *PlatformDocumentReference) GetOwner() *PlatformPersonReference { + if o == nil { + return nil + } + return o.Owner +} + +func (o *PlatformDocumentReference) GetUpdatedAt() optionalnullable.OptionalNullable[time.Time] { + if o == nil { + return nil + } + return o.UpdatedAt +} + +func (o *PlatformDocumentReference) GetCreatedAt() optionalnullable.OptionalNullable[time.Time] { + if o == nil { + return nil + } + return o.CreatedAt +} + +func (o *PlatformDocumentReference) GetSnippets() []string { + if o == nil { + return nil + } + return o.Snippets +} diff --git a/tests/mockserver/internal/sdk/models/components/platformsearchenumerationinclude.go b/tests/mockserver/internal/sdk/models/components/platformsearchenumerationinclude.go new file mode 100644 index 00000000..e944cdb0 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformsearchenumerationinclude.go @@ -0,0 +1,32 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// PlatformSearchEnumerationInclude - Optional document reference projection. +type PlatformSearchEnumerationInclude string + +const ( + PlatformSearchEnumerationIncludeSnippets PlatformSearchEnumerationInclude = "SNIPPETS" +) + +func (e PlatformSearchEnumerationInclude) ToPointer() *PlatformSearchEnumerationInclude { + return &e +} +func (e *PlatformSearchEnumerationInclude) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "SNIPPETS": + *e = PlatformSearchEnumerationInclude(v) + return nil + default: + return fmt.Errorf("invalid value for PlatformSearchEnumerationInclude: %v", v) + } +} diff --git a/tests/mockserver/internal/sdk/models/components/platformsearchenumerationrequest.go b/tests/mockserver/internal/sdk/models/components/platformsearchenumerationrequest.go new file mode 100644 index 00000000..a5fd5eaf --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformsearchenumerationrequest.go @@ -0,0 +1,91 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "mockserver/internal/sdk/optionalnullable" + "mockserver/internal/sdk/utils" +) + +// PlatformSearchEnumerationRequest - Selection to enumerate. At least one of `datasources`, `query`, or `filters` must be set. +type PlatformSearchEnumerationRequest struct { + // The search query string. Supports inline operators such as `from:jane type:document app:confluence`. Inline operators are AND'd with structured `filters`. + // + Query *string `json:"query,omitempty"` + // Restrict results to specific datasource identifiers returned by `GET /api/search/filters`. Scopes by datasource type and may include results from multiple instances of that type. Omit to enumerate across all visible datasources matching `query` or `filters`. + // + Datasources []string `json:"datasources,omitempty"` + // Structured filters applied to search results. Multiple values within a filter with `EQUALS` are OR'd; separate filters are AND'd. Conflicting constraints on the same field (for example, `type:document` in `query` and `type:spreadsheet` in a filter) return an empty result set. See `Filter.field` for built-in field names and operators. Other nonblank field names are accepted as custom filters without validation; behavior depends on your connected sources. + // + Filters []PlatformFilter `json:"filters,omitempty"` + // Filter results to those last updated within this range. + TimeRange *PlatformTimeRange `json:"time_range,omitempty"` + // Number of results to return per page. + PageSize *int64 `default:"100" json:"page_size"` + // Opaque pagination token from a previous response's `next_cursor` field. Omit on the first request. Cursors do not expire and are valid only for the original selection. + // + Cursor optionalnullable.OptionalNullable[string] `json:"cursor,omitempty"` + // Optional field groups to add to each document reference. Each value only adds fields; it does not change which documents are returned. + // + Include []PlatformSearchEnumerationInclude `json:"include,omitempty"` +} + +func (p PlatformSearchEnumerationRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PlatformSearchEnumerationRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *PlatformSearchEnumerationRequest) GetQuery() *string { + if o == nil { + return nil + } + return o.Query +} + +func (o *PlatformSearchEnumerationRequest) GetDatasources() []string { + if o == nil { + return nil + } + return o.Datasources +} + +func (o *PlatformSearchEnumerationRequest) GetFilters() []PlatformFilter { + if o == nil { + return nil + } + return o.Filters +} + +func (o *PlatformSearchEnumerationRequest) GetTimeRange() *PlatformTimeRange { + if o == nil { + return nil + } + return o.TimeRange +} + +func (o *PlatformSearchEnumerationRequest) GetPageSize() *int64 { + if o == nil { + return nil + } + return o.PageSize +} + +func (o *PlatformSearchEnumerationRequest) GetCursor() optionalnullable.OptionalNullable[string] { + if o == nil { + return nil + } + return o.Cursor +} + +func (o *PlatformSearchEnumerationRequest) GetInclude() []PlatformSearchEnumerationInclude { + if o == nil { + return nil + } + return o.Include +} diff --git a/tests/mockserver/internal/sdk/models/components/platformsearchenumerationresponse.go b/tests/mockserver/internal/sdk/models/components/platformsearchenumerationresponse.go new file mode 100644 index 00000000..f2ecd205 --- /dev/null +++ b/tests/mockserver/internal/sdk/models/components/platformsearchenumerationresponse.go @@ -0,0 +1,43 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type PlatformSearchEnumerationResponse struct { + // Document references at this cursor position. + Results []PlatformDocumentReference `json:"results"` + // Indicates whether additional pages of results are available. + HasMore bool `json:"has_more"` + // Opaque token to pass as `cursor` in the next request. Null exactly when `has_more` is false. + // + NextCursor *string `json:"next_cursor"` + // Platform-generated request ID for support correlation. + RequestID string `json:"request_id"` +} + +func (o *PlatformSearchEnumerationResponse) GetResults() []PlatformDocumentReference { + if o == nil { + return []PlatformDocumentReference{} + } + return o.Results +} + +func (o *PlatformSearchEnumerationResponse) GetHasMore() bool { + if o == nil { + return false + } + return o.HasMore +} + +func (o *PlatformSearchEnumerationResponse) GetNextCursor() *string { + if o == nil { + return nil + } + return o.NextCursor +} + +func (o *PlatformSearchEnumerationResponse) GetRequestID() string { + if o == nil { + return "" + } + return o.RequestID +} diff --git a/tests/mockserver/internal/sdk/models/components/platformtriggereventreason.go b/tests/mockserver/internal/sdk/models/components/platformtriggereventreason.go index 04bb19d6..b40a25c5 100644 --- a/tests/mockserver/internal/sdk/models/components/platformtriggereventreason.go +++ b/tests/mockserver/internal/sdk/models/components/platformtriggereventreason.go @@ -25,6 +25,8 @@ const ( PlatformTriggerEventReasonConvertedToDraft PlatformTriggerEventReason = "CONVERTED_TO_DRAFT" PlatformTriggerEventReasonWebhookUpdated PlatformTriggerEventReason = "WEBHOOK_UPDATED" PlatformTriggerEventReasonWebhookCreated PlatformTriggerEventReason = "WEBHOOK_CREATED" + PlatformTriggerEventReasonClosed PlatformTriggerEventReason = "CLOSED" + PlatformTriggerEventReasonCommentAdded PlatformTriggerEventReason = "COMMENT_ADDED" ) func (e PlatformTriggerEventReason) ToPointer() *PlatformTriggerEventReason { @@ -63,6 +65,10 @@ func (e *PlatformTriggerEventReason) UnmarshalJSON(data []byte) error { case "WEBHOOK_UPDATED": fallthrough case "WEBHOOK_CREATED": + fallthrough + case "CLOSED": + fallthrough + case "COMMENT_ADDED": *e = PlatformTriggerEventReason(v) return nil default: 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/mockserver/internal/sdk/models/operations/platformsearchenumeration.go b/tests/mockserver/internal/sdk/models/operations/platformsearchenumeration.go new file mode 100644 index 00000000..4b5ba7fe --- /dev/null +++ b/tests/mockserver/internal/sdk/models/operations/platformsearchenumeration.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PlatformSearchEnumerationResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Successful response. + PlatformSearchEnumerationResponse *components.PlatformSearchEnumerationResponse +} + +func (o *PlatformSearchEnumerationResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *PlatformSearchEnumerationResponse) GetPlatformSearchEnumerationResponse() *components.PlatformSearchEnumerationResponse { + if o == nil { + return nil + } + return o.PlatformSearchEnumerationResponse +} 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..636f01d3 100644 --- a/tests/test_messages.py +++ b/tests/test_messages.py @@ -18,7 +18,7 @@ def test_messages_messages(): res = glean.client.messages.retrieve( id_type=models.IDType.CONVERSATION_ID, id="", - datasource=models.Datasource.FACEBOOKWORKPLACE, + datasource=models.Datasource.GCHAT, timestamp_millis=558834, ) assert res is not None diff --git a/tests/test_search.py b/tests/test_search.py index d0a8bd28..401f1888 100644 --- a/tests/test_search.py +++ b/tests/test_search.py @@ -2258,3 +2258,32 @@ def test_search_platform_search_filters(): res = glean.search.list_filters() assert res is not None + + +def test_search_platform_search_enumeration(): + test_http_client = create_test_http_client("platform-search-enumeration") + + with Glean( + server_url=os.getenv("TEST_SERVER_URL", "http://localhost:18080"), + client=test_http_client, + api_token=os.getenv("GLEAN_API_TOKEN", "value"), + ) as glean: + assert glean is not None + + res = glean.search.enumerate( + query="amoxicillin", + datasources=[ + "gdrive", + ], + filters=[ + { + "field": "type", + "values": [ + "spreadsheet", + "presentation", + ], + }, + ], + page_size=500, + ) + assert res is not None diff --git a/tests/test_summarize.py b/tests/test_summarize.py index 5401883f..fd2baddb 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://judicious-squid.info", }, { - "ugc_type": models.DocumentSpecUgcType1.COLLECTIONS, - "content_id": 583083, + "id": "", }, ] )