diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 5bc7a595..5ef6619e 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,19 @@ lockVersion: 2.0.0 id: 0359d4fe-2923-46fc-aaca-cf70b48dcfa1 management: - docChecksum: 6c50d3df7af689ff921a7b236aa524a5 + docChecksum: d6e9b5d31ada1f8279238ac182b9677c docVersion: 0.9.0 - speakeasyVersion: 1.797.0 - generationVersion: 2.937.18 - releaseVersion: 0.17.15 - configChecksum: 7d5bbd39fb08e49e70ad72c0bbbc14be + speakeasyVersion: 1.798.0 + generationVersion: 2.938.0 + releaseVersion: 0.17.16 + configChecksum: 4df177d5580a2b2fa11274c36fce730d repoURL: https://github.com/gleanwork/api-client-java.git installationURL: https://github.com/gleanwork/api-client-java published: true persistentEdits: - generation_id: be47c9bd-cd73-4460-9fe4-fe3c02b8e593 - pristine_commit_hash: d0243b869bfb8c9499a5cdb073df6747066957f8 - pristine_tree_hash: a38c783f530506fab706dbae927c56e5050669b3 + generation_id: 93b82884-44c6-409b-9238-788be62a368d + pristine_commit_hash: 66acc68d0fae5f901f806eac0b5d83f5ada27115 + pristine_tree_hash: d62f53df798ad22f0ddb330c12984cf275603319 features: java: acceptHeaders: 2.81.2 @@ -1208,6 +1208,10 @@ trackedFiles: id: 3aa359a59de3 last_write_checksum: sha1:6862108822e276a39bc2eeaf1b3b2a481b06fb3c pristine_git_object: 92014ebd54aa0169a3c382028be03a6e48ce964e + docs/models/components/ExecutionMode.md: + id: 4c13ba03f08b + last_write_checksum: sha1:6caaa4810ff824ffdb0ec5c6554e4e8c425d29d7 + pristine_git_object: 81878711a38f1a8fdde54ab21355f678847ff291 docs/models/components/ExportInfo.md: id: c7996087902c last_write_checksum: sha1:552eeb2963d9780400fd0e59050e0fce3e028f3a @@ -1274,8 +1278,8 @@ trackedFiles: pristine_git_object: b9cce921992bf7d948b7a2e3e4360ca2e3b81654 docs/models/components/FeedRequestCategory.md: id: afe4d7d42b83 - last_write_checksum: sha1:d3fd11d4312b045a0f1e7bcb4cd73e6d80ac3f83 - pristine_git_object: a29ec27489853b57cfd437a4ae2fd8f4cad6c9ae + last_write_checksum: sha1:c591805473c5f293e82cb2e682e19971a2933200 + pristine_git_object: 317646095611228c58fe86967aa2a9fdaedf92f9 docs/models/components/FeedRequestOptions.md: id: 75fd500a75b1 last_write_checksum: sha1:448af6f7a5d161d4e2f856a6bfdb5da3bd7a9c68 @@ -1290,8 +1294,8 @@ trackedFiles: pristine_git_object: e2be0f14f31929e0ec4ac503cb4846e8ca95aa0a docs/models/components/FeedResultCategory.md: id: de8a61d55051 - last_write_checksum: sha1:94a72acc89078136c9f6828d4d1c423c01ecce23 - pristine_git_object: 798398235fbf03f5803db785c72132f53b6124fd + last_write_checksum: sha1:ea1cd4ee7724edc0a73bb1d22904061dd2170bea + pristine_git_object: 4a6370d03c5b2259aa06297cb778294ed4e6aa92 docs/models/components/Feedback.md: id: 73b99e5606f2 last_write_checksum: sha1:20ae2315c831db0791ccd9a9d396dbb2811dbd15 @@ -1642,8 +1646,8 @@ trackedFiles: pristine_git_object: 6b510a78c77f21964ba458f12c424b73c955021f docs/models/components/JustificationType.md: id: 4f9697992386 - last_write_checksum: sha1:dcac500dc69ae6b2c56c8296f863b09941b34969 - pristine_git_object: 4b3008964d2067b831238070aca7a14d33f54ded + last_write_checksum: sha1:33d7c678ab81178a4f94991854e5383f7487958a + pristine_git_object: 3ae642a7d131f4d4c2654b95be91034afce95d71 docs/models/components/KnowledgeType.md: id: 652b79486bf3 last_write_checksum: sha1:350f41b8184a84215ebbab80a83079e093a54b40 @@ -1958,8 +1962,28 @@ trackedFiles: pristine_git_object: 7a328523cc01d9cd1859054bbb0117cf5dba87bf docs/models/components/PlatformAgentRunCreateRequest.md: id: 89bdce59e86c - last_write_checksum: sha1:d282553774a6c1e20448f518fa1c3b792889b176 - pristine_git_object: 1bfb95110ab299fb0aff261ad41bd029fc1cd3ee + last_write_checksum: sha1:4d4a2881b1d2ab1161cb4a2af41ddab85788925d + pristine_git_object: 8d4d7159d1aa27b3c74ce4bc87dddb68e06a8085 + docs/models/components/PlatformAgentRunError.md: + id: 6ee0519921e1 + last_write_checksum: sha1:fc72f6222348705375f23bcfb2e0d96aedc4b6bf + pristine_git_object: b4c62d596c5bcb4627dba91c8a5fff08a06529ea + docs/models/components/PlatformAgentRunResponse.md: + id: 56c42e51b47a + last_write_checksum: sha1:746ba20f3c56bfdd44b0d4b9be841357180d60d4 + pristine_git_object: 1d01da487a7d23dd30cc6d33dd86c23cd41cce8f + docs/models/components/PlatformAgentRunState.md: + id: fbab5878860b + last_write_checksum: sha1:c16e449bc36f444fc7f4e4bcfaec1f807b8eab5d + pristine_git_object: 6450774b57af41748cab614e219e5c7e16bea727 + docs/models/components/PlatformAgentRunToolApproval.md: + id: f9a871d28f94 + last_write_checksum: sha1:f10af90286a4d9c59a13fa96c73e122a719fbd16 + pristine_git_object: c65e48035437d4c9526b246b9a292a0a3eb7d540 + docs/models/components/PlatformAgentRunToolApprovalType.md: + id: df763d567771 + last_write_checksum: sha1:5368d77f93a92c08015102381fae59aa6c182bbe + pristine_git_object: abf718e9d11b5e4b99ab573005996a167d8d30c3 docs/models/components/PlatformAgentRunWaitResponse.md: id: d3616cea607b last_write_checksum: sha1:5e15de71c76558a14c4fe69b46c6a8f0dbd59c82 @@ -2064,6 +2088,14 @@ trackedFiles: id: a1fa73c5e9ee last_write_checksum: sha1:cdeb632a959158f47dd5c83b885222948b5c00df pristine_git_object: 19c27383f55b277297a14231503f7b5b6fd18e14 + docs/models/components/PlatformChatJsonSchemaFormat.md: + id: fe5cb5fc2c49 + last_write_checksum: sha1:b5d628867a504d0706da5c318745a122aa3a37e4 + pristine_git_object: 118bf4fc19d14eaaf46d7dd77f5c59852bb4219d + docs/models/components/PlatformChatJsonSchemaFormatType.md: + id: 4a87a939a9e5 + last_write_checksum: sha1:5b6fea0a04aa8e3f0589ee7fa252c608f6895653 + pristine_git_object: 0c632bb1208c35834a472683ced4817497fa4dd1 docs/models/components/PlatformChatOutputMessage.md: id: 02357c3f3fe9 last_write_checksum: sha1:4944b5271e6031405e1d66fa9e2b4684edb58d37 @@ -2078,8 +2110,8 @@ trackedFiles: pristine_git_object: aa3ecd267f4c0998ad26cd30ca5b3198440e49f8 docs/models/components/PlatformChatOutputTextContent.md: id: 47a9370ffd32 - last_write_checksum: sha1:aa920f472b22671db5dc9ae495596665d8ab42cc - pristine_git_object: 915538bf25a1b309b080921498bb0b7c2fc93f05 + last_write_checksum: sha1:411145e4fbe0912601c62e279829edcbc0666f45 + pristine_git_object: 41ab4bcaca51ea16544641b3822d91555ebd1f45 docs/models/components/PlatformChatOutputTextContentType.md: id: 9570f09d46ec last_write_checksum: sha1:3f75395a011965bb00747c97dce15d8ee34b153c @@ -2172,6 +2204,14 @@ trackedFiles: id: cbf41c44e2e8 last_write_checksum: sha1:26e76466423be47aeeebbabf765eacfc9b21d651 pristine_git_object: 1e072b0c4c5e431a413448eff2dd8fe986d60e48 + docs/models/components/PlatformChatTextFormat.md: + id: ce01603931ee + last_write_checksum: sha1:6fde0d28fa2b44c3cedbfd3f9cfacbf607270a3e + pristine_git_object: 0eaabe2375163613266419bbab3c749efd50480c + docs/models/components/PlatformChatTextFormatType.md: + id: e3b0c7e7c9f5 + last_write_checksum: sha1:5f62a9f9e46773d559ed51cc1b1260d840f3af74 + pristine_git_object: c73b20f31be3667436ec372452422505a1a9d422 docs/models/components/PlatformContentScheduleWebhookEvent.md: id: 56a5266ec1e3 last_write_checksum: sha1:7875fe331731f6808d2670d25b1831cc9628fe65 @@ -2188,6 +2228,10 @@ trackedFiles: id: ff0bff0cd9ae last_write_checksum: sha1:671468f9e99dc677dc22d2030e7e2f33efa3e8b9 pristine_git_object: 951d7b46496d9865a544e899b3f490e3b6364ea6 + docs/models/components/PlatformDurableAgentRun.md: + id: 1b6d2b140826 + last_write_checksum: sha1:9a0ebcde7b6e3c6909c6510cc292bbce81f24959 + pristine_git_object: df37e8010ab7b554aa6d9a330925a2068e288e36 docs/models/components/PlatformFilter.md: id: f6050e7256d6 last_write_checksum: sha1:21cba128fb2f3d491e3d67e115610afe41628559 @@ -2828,6 +2872,10 @@ trackedFiles: id: 72fda227d869 last_write_checksum: sha1:c88d0412cde34bd585b718b7a3d3fbe018d38732 pristine_git_object: c8c4f6e3872702d52e9c0885c1a18853a4da5086 + docs/models/components/StructuredOutput.md: + id: e605df82da82 + last_write_checksum: sha1:0fefd8718435f3a6ea2372819a35db97ec6927a3 + pristine_git_object: 45e8ab02d1f563d01c5045ae21340c61bd259a2d docs/models/components/StructuredResult.md: id: 41fbc7bf1743 last_write_checksum: sha1:f02e60ae933b1afe33268591c495699ba44abb57 @@ -3854,8 +3902,8 @@ trackedFiles: pristine_git_object: 868221df65b45b1fdba382ac8859d718619d4b8f docs/models/operations/PlatformAgentsCreateRunResponse.md: id: 8d49f44f776a - last_write_checksum: sha1:87760fd7793a4f9bf8b1a8bd8b230a19350b887b - pristine_git_object: d930b7edda3e254cf157e1f7f81d73488cc035be + last_write_checksum: sha1:d07bdeceb9aac85dbebc1d471f14a65dade0ac0d + pristine_git_object: 5b01736502f19582103eed73975230e4714e6855 docs/models/operations/PlatformAgentsGetRequest.md: id: 15a2b0951ad2 last_write_checksum: sha1:915336e7dfbc561b436fc65aa37af9d2dc0d8812 @@ -3864,6 +3912,14 @@ trackedFiles: id: 953ffea39d06 last_write_checksum: sha1:60e681dcf7ffc582d4654a34cb89068614056018 pristine_git_object: bbf6b68c0bd0afcd38cd3351bb3ed4c866d2af74 + docs/models/operations/PlatformAgentsGetRunRequest.md: + id: 99016561c806 + last_write_checksum: sha1:2588c70ec767d0e26306258af09af2909af21ad7 + pristine_git_object: 11f4dc5954f4ce16483cefbc668fa864e708b902 + docs/models/operations/PlatformAgentsGetRunResponse.md: + id: ba3265565edb + last_write_checksum: sha1:0c43e9b1016cc30059d860ce7025bf20b1bd164b + pristine_git_object: e7b2a70f75eee07f8449e1f010dc70a0a3fb5d84 docs/models/operations/PlatformAgentsGetSchemasRequest.md: id: 98489c68fae0 last_write_checksum: sha1:7e3a7be0fee53a5e35da9fd6ac1ca23b90b658fa @@ -3876,30 +3932,46 @@ trackedFiles: id: 69c6ba109512 last_write_checksum: sha1:439f70aa6d30b622e8bb20c6ef8c2a8ce800a459 pristine_git_object: e1d4afd47a1e924bf6c174452f04c361350c4ad2 + docs/models/operations/PlatformChatCreateFormat.md: + id: 7a0706bfc8e9 + last_write_checksum: sha1:5db2e745f39e66c08d80e01cb140cb25694ffec7 + pristine_git_object: cf5aad0a6c3257763d8a134831ea4d23ece4e6f6 docs/models/operations/PlatformChatCreateInput.md: id: f4793f35c9b2 last_write_checksum: sha1:33cf87c678b2c6ceacb722f66e13dcc2482fb3b4 pristine_git_object: eb733534ae775f35501834b2719906c02f811bf7 docs/models/operations/PlatformChatCreateRequest.md: id: 4fd6bd954008 - last_write_checksum: sha1:d77984c4da6afc6d5bd186781f4054d470067d3a - pristine_git_object: be17d27e83a4c342ab05ee8a802c030025dabc71 + last_write_checksum: sha1:88e01a59d670e61f473b81055627fc7b66a001f9 + pristine_git_object: 2664e353952a03dc82bb807302c10b5d801ad884 docs/models/operations/PlatformChatCreateResponse.md: id: 92f81c654e6d last_write_checksum: sha1:56ac3cdd9f162b2ce64e515268a3c342ac48ca7d pristine_git_object: 4271bbe51ad86f9a79a87705c7d3af98423ac7a0 + docs/models/operations/PlatformChatCreateStreamFormat.md: + id: 05fbf440c637 + last_write_checksum: sha1:1f3ad3a7a1fae0292cf3bb6ce3e9ccadfb6d071e + pristine_git_object: 09ee0a652a2dbecaf4176e7d646d86087db16ddc docs/models/operations/PlatformChatCreateStreamInput.md: id: 15a0936103b6 last_write_checksum: sha1:231d3eac4352e9590f8c8637b049ef401c891eca pristine_git_object: 1e95b3c5cfd4ddda44a99bdc3f21f4b731945bb1 docs/models/operations/PlatformChatCreateStreamRequest.md: id: 5549db932a83 - last_write_checksum: sha1:7739999d24c9dae4254a3a78911eeb7387f9817c - pristine_git_object: 049d00d8c7ccf11524043851969ca27a42ecce0e + last_write_checksum: sha1:f6962d0aa26d3fb410a05726f91cef131d3060c5 + pristine_git_object: fe33185ba0a344e58ee6f22c979736e4f55c0f95 docs/models/operations/PlatformChatCreateStreamResponse.md: id: 3c3852ec4a32 last_write_checksum: sha1:7fb6b5ae80a36a8ef1e90981bb7bf89b5ab12353 pristine_git_object: 22deb773dd42b16317fe454cac68b37de69bf554 + docs/models/operations/PlatformChatCreateStreamText.md: + id: c32f6f310e1c + last_write_checksum: sha1:1f22c8c6953b0150880a3112d95be2b2f1e33c7a + pristine_git_object: b8ba959b870f1913485f404e9f718db0a82ad083 + docs/models/operations/PlatformChatCreateText.md: + id: 92735187ce31 + last_write_checksum: sha1:fa78660628504fb86a7c881718354e8cc7bf6b68 + pristine_git_object: 93494ad43b8895bbe9f5d8d6149d5e71980a6aaf docs/models/operations/PlatformSearchFiltersRequest.md: id: 1a4008095fc4 last_write_checksum: sha1:cd7c15a3f2da10917713db2b6bcf26e046df624c @@ -4398,8 +4470,8 @@ trackedFiles: pristine_git_object: f3ecb5fda2b888721a48e50acb4e541bcc09a757 docs/sdks/agents/README.md: id: 5965d8232fd8 - last_write_checksum: sha1:67ad3cd0386e38577de7d06d0dbf694c4b42a921 - pristine_git_object: 19baddbcf6cf848967a6849085f484c43ccb1471 + last_write_checksum: sha1:ec49d03ce98f716c1ddd1864ed94886b53f94b8b + pristine_git_object: b622d03fde990cc6e638e4b224c9645f441855f5 docs/sdks/announcements/README.md: id: 3d2e130a217c last_write_checksum: sha1:d518fe37c613bdef6f738b2e1ef52918bc782324 @@ -4410,8 +4482,8 @@ trackedFiles: pristine_git_object: 6603db8c8828357d67059a746ee541aee6c45301 docs/sdks/chat/README.md: id: 393193527c2c - last_write_checksum: sha1:34a46232136c6d0312324fed711180e553d99b10 - pristine_git_object: d01c60900e89c0d9f9a13f27fd6a5bfda08eda4e + last_write_checksum: sha1:369754a1214701631a65dbf057aab0d2c5a2ffa6 + pristine_git_object: 04466c2aa1251ce50d6d094f769b834143df0316 docs/sdks/clientagents/README.md: id: 8e00e6d6b64e last_write_checksum: sha1:c5de500134b52fdbbd20be11cadbb827e707730b @@ -4534,8 +4606,8 @@ trackedFiles: pristine_git_object: 3decbce5bd40edbe278c1c5d2dbf585808e51d9a gradle.properties: id: 2afbb999f001 - last_write_checksum: sha1:2621acc9405ffdc88fc38090f9849990dac30e74 - pristine_git_object: b0d873123c2d0020652660883be028b509b2f915 + last_write_checksum: sha1:c3f88643a75e191cfec2a04d0860dffb10521611 + pristine_git_object: d30755751f2eb6335352ea9025d95716c157ca7d gradle/wrapper/gradle-wrapper.jar: id: ec27dae6e852 last_write_checksum: sha1:f725fb1467084142d74fd7cd8eab691ab3442611 @@ -4566,8 +4638,8 @@ trackedFiles: pristine_git_object: df42bc238520dfa6a790833984bfc1e386b3510e src/main/java/com/glean/api_client/glean_api_client/Agents.java: id: 69615daff4b4 - last_write_checksum: sha1:15af95a8d92a86e889479f2975395720f2796916 - pristine_git_object: 4e1b4489f3e3a56f864ed2d5c47076fe3e9d6e81 + last_write_checksum: sha1:8116eff81b3fdfee8d2d53a8a7c8a40f4832c265 + pristine_git_object: bb8c4e3264a6e525b12c3fe421fb5a4397347621 src/main/java/com/glean/api_client/glean_api_client/Announcements.java: id: 23fcf3ba5c75 last_write_checksum: sha1:41a393ad53e8dedc383c224a3b789e80f936b114 @@ -4582,8 +4654,8 @@ trackedFiles: pristine_git_object: c4b4a844fc24a20d724ee016bc00cfb0125c28f9 src/main/java/com/glean/api_client/glean_api_client/AsyncAgents.java: id: 5fb5adf2262c - last_write_checksum: sha1:bc5ca9739f9dc607ab158b291fa7eb1ddab79f27 - pristine_git_object: 3c6ac1b2a03e5789044754dc9b607f631c562093 + last_write_checksum: sha1:b55555c6ea57d115c55231304c8414cf083cf246 + pristine_git_object: 34a95e8f70f7147de076478dfeaa61cb5ba4e369 src/main/java/com/glean/api_client/glean_api_client/AsyncAnnouncements.java: id: a4630e10d992 last_write_checksum: sha1:7c3ded3cbef281f4de46835f65ca4348af14137c @@ -4858,8 +4930,8 @@ trackedFiles: pristine_git_object: ffae914775eb41ff311371f62504344a59d090fd src/main/java/com/glean/api_client/glean_api_client/SDKConfiguration.java: id: d5fcc61f5992 - last_write_checksum: sha1:f2445ec59a1e56951093a5d86e3cf41c0ddf6aff - pristine_git_object: 8f2376566251438e57c6c3d30a9be9afc00d3544 + last_write_checksum: sha1:d90c1b928f397a492de5df8d4ca3b5dbf608cb95 + pristine_git_object: 45d78f5bca77e0e17cce8325e902decb2a0fae06 src/main/java/com/glean/api_client/glean_api_client/Search.java: id: f22d94b920b5 last_write_checksum: sha1:14e024607aebae4b1197445ad31984898c4735a3 @@ -6052,6 +6124,10 @@ trackedFiles: id: b13552825ce8 last_write_checksum: sha1:63cdbdffb1469461328b8d39b8c16ed5bbf4927f pristine_git_object: f5c5415d94c401942addb01237deaef031d274bb + src/main/java/com/glean/api_client/glean_api_client/models/components/ExecutionMode.java: + id: ae8d86f895da + last_write_checksum: sha1:fe6ed243818c7699912e8d5913413d7a4f1f7f21 + pristine_git_object: 8a66d66f77771b7947c2e0e6fd8b4c5228f407e5 src/main/java/com/glean/api_client/glean_api_client/models/components/ExportInfo.java: id: ba6d21a1125d last_write_checksum: sha1:729f5fec5027fd39bf80321d5abc043f98854d29 @@ -6118,8 +6194,8 @@ trackedFiles: pristine_git_object: da07bc2b22a0c18ddaaeb554bf70ddf655b607cc src/main/java/com/glean/api_client/glean_api_client/models/components/FeedRequestCategory.java: id: 57e4db8e0360 - last_write_checksum: sha1:5f2853edad2c61b006d4067dbb9da1267e3689f7 - pristine_git_object: 5b1b7df22ba8f13327eee5ab2543df6bc0d7f54b + last_write_checksum: sha1:b7bc6fd0a07edb3462cd645a7e4ab0f2cc7f20a0 + pristine_git_object: b0617dcda8d8d46a9ee3b179932894e7107ae9ab src/main/java/com/glean/api_client/glean_api_client/models/components/FeedRequestOptions.java: id: 0961449ce7b9 last_write_checksum: sha1:1becd935e511806b12ea1aedebd9da174d807ad6 @@ -6134,8 +6210,8 @@ trackedFiles: pristine_git_object: a98919d195d9f2194e768609de43d6aeb1039043 src/main/java/com/glean/api_client/glean_api_client/models/components/FeedResultCategory.java: id: d5f852e61d61 - last_write_checksum: sha1:5644fd24cb9f950f3f6affaf69a2bd4bb7c4eef5 - pristine_git_object: 8e3231a6da4a1548807111a978b7b84184f4a113 + last_write_checksum: sha1:6af6a01f28d84f87befd51b09ac45792003ada30 + pristine_git_object: dda36bcfe890bb2b9914c9af4fd8759f03ce952d src/main/java/com/glean/api_client/glean_api_client/models/components/Feedback.java: id: f7178cc3b4f0 last_write_checksum: sha1:266cacdd3f7c698ffdbd56a505d8fda10170c444 @@ -6486,8 +6562,8 @@ trackedFiles: pristine_git_object: c899f9ae9db4ad2809eefacd5404be80f606c822 src/main/java/com/glean/api_client/glean_api_client/models/components/JustificationType.java: id: 4e704d02ecd5 - last_write_checksum: sha1:2474efc265d57e098a46354a227a966903750ad3 - pristine_git_object: b2959846bfdc7fa3661708c164822fcf514423c6 + last_write_checksum: sha1:2cfc989e2867d382307a922a2b61e81030a0466b + pristine_git_object: 16803019c550752fa81df21777453f5712343357 src/main/java/com/glean/api_client/glean_api_client/models/components/KnowledgeType.java: id: 86321f7dd6fe last_write_checksum: sha1:85872bd4390e4a048c4995b1427bec8b2fe88664 @@ -6802,8 +6878,28 @@ trackedFiles: pristine_git_object: 2fd4ec65b93f2d488b9f0a92e26641f2cd171865 src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformAgentRunCreateRequest.java: id: 1643eb434b69 - last_write_checksum: sha1:39e739a3a8dd3cdec077069cf67171aa963d49f4 - pristine_git_object: 79e274c9bffeca2f22fd0a1526daa0479c307f90 + last_write_checksum: sha1:4539785c3a80ac500c7f7cbdee234a3a4a2a6f8d + pristine_git_object: 268b6c0dc3c2aee3c0563339b1f9a7d3788364a1 + src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformAgentRunError.java: + id: a4c9d9b1e122 + last_write_checksum: sha1:2af2fbd7a09b39ca33afe2889f57a0d08492ef5c + pristine_git_object: 89a07178cbf547a2514ebf5d93d24e3ea09e8edd + src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformAgentRunResponse.java: + id: 46d12aeccad4 + last_write_checksum: sha1:5d2ba4d6c20569ae86c6dcbbe09d900559f88080 + pristine_git_object: c943ed01ee28498719c9dd88c6a9768b7020cf94 + src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformAgentRunState.java: + id: 38e2a6fbf682 + last_write_checksum: sha1:62b91276b15838854837afd0b569522c18c0bd19 + pristine_git_object: 54d704d00c0cb3af0b219853786b7fa0d4417cb9 + src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformAgentRunToolApproval.java: + id: 86dc21c48b40 + last_write_checksum: sha1:c9ddd0cbce9cc69c794e552302794bf794382995 + pristine_git_object: 64845be8ac2d103eabfaab147cc71db11f26daa3 + src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformAgentRunToolApprovalType.java: + id: 6331b78ff935 + last_write_checksum: sha1:07b521fac605a9b8f9d773b5405d567ca4eaa579 + pristine_git_object: e161a9cd5041ad5a2114419585f3376a205b70c0 src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformAgentRunWaitResponse.java: id: 587a8637439b last_write_checksum: sha1:f4c7d055b25d4ad3e375d263690a804ff52ff04f @@ -6912,6 +7008,14 @@ trackedFiles: id: 79d671fea9aa last_write_checksum: sha1:a0a460698f52359c4f8c029d50eb6631114860bc pristine_git_object: 74a248a1497695e2aecfab5907f0991c7f051f50 + src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformChatJsonSchemaFormat.java: + id: 997af7f13051 + last_write_checksum: sha1:9a4795b87fddb5d6996edb630a0ac77d53ec73c6 + pristine_git_object: 79c8123bf5e2241dba24b9e7951b5475ff939077 + src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformChatJsonSchemaFormatType.java: + id: f039aaef0596 + last_write_checksum: sha1:24c71b538a5090fe413a53d99dd96f9d9a2f0cf1 + pristine_git_object: 25aa7970eab9c77687b306a68c2767ebf8d81ef0 src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformChatOutputMessage.java: id: bc251074af4b last_write_checksum: sha1:e652a47b0e3741015154d72b5b8686fe337d6c8f @@ -6926,8 +7030,8 @@ trackedFiles: pristine_git_object: 6127a9fa518d39b1d427470deeaed19fb9d0872f src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformChatOutputTextContent.java: id: a322812aaabe - last_write_checksum: sha1:1cf874fed72b2a4ea77a557283266aba97698629 - pristine_git_object: 2a634a45e5c3eba768cf36b92a2aae6e42e3ff2f + last_write_checksum: sha1:94547e4896868ab41e88bb6ead8eef1ac11e1c34 + pristine_git_object: b42476a3d0916e02d131107bd98b82610aeeff13 src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformChatOutputTextContentType.java: id: f0b0e0085fe8 last_write_checksum: sha1:7b41b321fe2d21d411a279b7dbed9ce0625ce606 @@ -7024,6 +7128,14 @@ trackedFiles: id: 4a00a656a0ae last_write_checksum: sha1:94a0567b5fbf5c54d101ffc1dc670697f41ca827 pristine_git_object: c32a10d66ca7106e697bc71df86d73e28bd60d5f + src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformChatTextFormat.java: + id: 9e6818d67d72 + last_write_checksum: sha1:8437b41069720a95822eabbc53522724f6be46ed + pristine_git_object: d1cbefedf45458999cf2a4e7ced112377d948e8c + src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformChatTextFormatType.java: + id: 087c3185f5d6 + last_write_checksum: sha1:b3d25575a0b01dcbf259e90237558166920d3526 + pristine_git_object: 2e80698ee520279e86fb00935e0a7b504796e9f6 src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformContentScheduleWebhookEvent.java: id: accfef1744f3 last_write_checksum: sha1:82c5fffcdd7644aa04332e0ec8811c3dc003d67f @@ -7040,6 +7152,10 @@ trackedFiles: id: "866095924462" last_write_checksum: sha1:f7bbb471ff5e1e2e05118bb09ed401690a787bf3 pristine_git_object: 78db5f5fd119d8458b29760264176b858e2cfacf + src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformDurableAgentRun.java: + id: 57d40099c909 + last_write_checksum: sha1:0d767ce0f4a2845b55ac8b7005e6d36096263420 + pristine_git_object: 75e5eb1b18e96e57e26ee2831e6dc0f52b33aff3 src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformFilter.java: id: 79535f6079d1 last_write_checksum: sha1:601d5992786e38bee76bff1cce4cddb5906f158a @@ -7684,6 +7800,10 @@ trackedFiles: id: f881d067e151 last_write_checksum: sha1:b94151801d113ad646eca6ff50c9c2e002e0c48b pristine_git_object: 290f7e66af4d20fd31e561304bdbd5f2e2b52c07 + src/main/java/com/glean/api_client/glean_api_client/models/components/StructuredOutput.java: + id: e550fa39395c + last_write_checksum: sha1:cf5ffaeb812dc425f3910b5f61b2042db163f604 + pristine_git_object: 4615d0df9b095bb1670a01d6b3f5ab57fdbd2387 src/main/java/com/glean/api_client/glean_api_client/models/components/StructuredResult.java: id: 07f7a7e0cb13 last_write_checksum: sha1:7fc068406bb0675bf9e5d876ca6c6c07bc3afe19 @@ -9066,8 +9186,8 @@ trackedFiles: pristine_git_object: 13bdc02d267bd92822fc9b5b04bd1cdb9628b45a src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformAgentsCreateRunResponse.java: id: 943b97d76c0d - last_write_checksum: sha1:4ea4bee44dc43de77a1aac5d9b2bd0b4f1a78909 - pristine_git_object: ab23ff5a782b0b3f16a7376892d3a6d911c19617 + last_write_checksum: sha1:7efbd8c65c448d1b6110719e1135ff4d59d7c390 + pristine_git_object: 7f95b7323d86903068338bd04b8e5b944e839f16 src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformAgentsGetRequest.java: id: 8efd7ef6596a last_write_checksum: sha1:25c63fad755d4f29bdd422db3d6179d2e5c50a23 @@ -9080,6 +9200,18 @@ trackedFiles: id: 95441ff92c65 last_write_checksum: sha1:72d8f5a3f64ee454e34bf405a2b6374086bfd748 pristine_git_object: 46b90cec431237bdd4d060d337041e376580e7b6 + src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformAgentsGetRunRequest.java: + id: d27cc187d9b9 + last_write_checksum: sha1:e2ee47e59ee98ca142f4fb9510b0ae13f45be3ae + pristine_git_object: 272a67c17d38733c47606173becabf97a70a26b9 + src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformAgentsGetRunRequestBuilder.java: + id: 21d281006552 + last_write_checksum: sha1:1618b35250ff21cb6085fbc349842272701eb480 + pristine_git_object: 1aacf04ef465bee64e42e7e657837540ad1bfaa1 + src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformAgentsGetRunResponse.java: + id: 1c0b30f47f38 + last_write_checksum: sha1:c5e4935f4117f67542da6b560c91bbd0cf4f425d + pristine_git_object: a05978616a5616c3e3d2e5821818b1510e37aa2d src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformAgentsGetSchemasRequest.java: id: 952911a98a12 last_write_checksum: sha1:58ea5dbfc41b3648f3bca90e214f68f110ef142e @@ -9100,14 +9232,18 @@ trackedFiles: id: 797a95edf650 last_write_checksum: sha1:ad6856a23785be496390782be312b0b004a974a2 pristine_git_object: f6403da16588dde87d9315b9438ebc1d4d4abe14 + src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformChatCreateFormat.java: + id: 218173a41a84 + last_write_checksum: sha1:a90656dba60b82038f1c9d679effffaab7d4c7d3 + pristine_git_object: 13219c62159023d393def33ec3f7297c58de8f72 src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformChatCreateInput.java: id: 072a93c9bac5 last_write_checksum: sha1:e5208612f33edf72b94d2448454cec65ca576c75 pristine_git_object: b49d59212c5d34379fd0566e49b864de9e9aa718 src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformChatCreateRequest.java: id: 4fe284ab93e7 - last_write_checksum: sha1:fd650c3ae25923b2ea88ac215d44b219526e41c8 - pristine_git_object: 9c4580b9c52aae14fb7517f0b2333a23ff3d2f10 + last_write_checksum: sha1:c0bd00c7aa20e1e7f91e1397ec62fa7579309e3b + pristine_git_object: e90fab797d87da522e342bd1d40055c65aadc0ed src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformChatCreateRequestBuilder.java: id: 46e42c43e442 last_write_checksum: sha1:02bffb26ba72f3c59919f44fe4ab752e86fc604a @@ -9116,14 +9252,18 @@ trackedFiles: id: f62b3419fe3c last_write_checksum: sha1:6de36958cfa738bcac3bedfc0741064009bf6ccd pristine_git_object: 5bb145a7934481d841bf38b12861261c91c7b4f4 + src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformChatCreateStreamFormat.java: + id: e8841adf1bf7 + last_write_checksum: sha1:3223940a2e4f42dd6ea669a9767bebc4b98b00b0 + pristine_git_object: 769fb54456c5c5ece84288d1423cf35680d6d9c9 src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformChatCreateStreamInput.java: id: 8a4a972f0c2e last_write_checksum: sha1:827d22981f2d5e85dd4db9f9b309ad7cbd32da3d pristine_git_object: 564eea2ba1fc8dde5671ced8deb4f0f3e948ff00 src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformChatCreateStreamRequest.java: id: 51c993a3bf3f - last_write_checksum: sha1:04cc404ea3161d8a66b4b3990eae8a613f2a8e02 - pristine_git_object: 09b4e1c04405a1b6652a79c06f155b576164fac7 + last_write_checksum: sha1:967a7dd797258d677a302db80f05e36adf36e611 + pristine_git_object: e3a81c970a2b2103d0ec299230f66df80dcb4c67 src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformChatCreateStreamRequestBuilder.java: id: 233231117d7f last_write_checksum: sha1:634a373809839540722e964158c1135186dd7893 @@ -9132,6 +9272,14 @@ trackedFiles: id: 1a1bc5fe1d2b last_write_checksum: sha1:9f5a459234437b9660c375235a9ef342fa5e723f pristine_git_object: 5f63f2908f4bf5952a9a74bbdd63f1ebca048551 + src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformChatCreateStreamText.java: + id: 560d92f7b2cf + last_write_checksum: sha1:eb41eab2ac8b877d506d28e95152bf35384ca1ad + pristine_git_object: 43f2c2295885522d5080693fe403d4478db79fef + src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformChatCreateText.java: + id: 5776d6c0225d + last_write_checksum: sha1:1909f0dbb4f2b92925a2f6f3877169f05916ecdc + pristine_git_object: 43ae3a50ec474e0ae7b2faaea92d53f024924c38 src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformSearchFiltersRequest.java: id: fbf5c5a7d902 last_write_checksum: sha1:28a9be6e4a226c76371f91ad6e0bd7d9b138e340 @@ -10594,8 +10742,8 @@ trackedFiles: pristine_git_object: cdecf5e5bdbe2bce86726fd395f4f681a9a63a19 src/main/java/com/glean/api_client/glean_api_client/models/operations/async/PlatformAgentsCreateRunResponse.java: id: 6cdc74da1e86 - last_write_checksum: sha1:0781b7da3eb8a5b60a4d860662187296098b5404 - pristine_git_object: 63583da70291d3990da458f330328181a0ca1b85 + last_write_checksum: sha1:4fd5c9127b17786852593e5476e56255da4dbdd1 + pristine_git_object: 789a9a02433b4ed70af56a190cab1f4b08037c35 src/main/java/com/glean/api_client/glean_api_client/models/operations/async/PlatformAgentsGetRequestBuilder.java: id: 28cb9c5ee783 last_write_checksum: sha1:d9672627d1d71a354aaa1b25cad5df47f8a2c0c2 @@ -10604,6 +10752,14 @@ trackedFiles: id: ef08df192853 last_write_checksum: sha1:a082dd082675b567817dce50546ec17dd1fdf991 pristine_git_object: e815085470b637b592382658b6ac990ee742a70e + src/main/java/com/glean/api_client/glean_api_client/models/operations/async/PlatformAgentsGetRunRequestBuilder.java: + id: 0f25cb1208ab + last_write_checksum: sha1:91c458b8d222f1d2a8c230edbf5cc397a026c738 + pristine_git_object: 8cc26a6a0a431d1149a9f0739585c8187b05ad91 + src/main/java/com/glean/api_client/glean_api_client/models/operations/async/PlatformAgentsGetRunResponse.java: + id: 114fe1c036ad + last_write_checksum: sha1:dd365d1990a83854e2154a08bbd6beb8bd66c882 + pristine_git_object: a4cb548fb50fac242ba3a7965d5ec947328da5b5 src/main/java/com/glean/api_client/glean_api_client/models/operations/async/PlatformAgentsGetSchemasRequestBuilder.java: id: 103de89bdb55 last_write_checksum: sha1:d6953ecae45cf01032276f4eacc0be6ee7481cfd @@ -11610,12 +11766,16 @@ trackedFiles: pristine_git_object: febd45ffaac9f3f51f12f255fec3fdc9ab3a63d2 src/main/java/com/glean/api_client/glean_api_client/operations/PlatformAgentsCreateRun.java: id: 85c8e88f4285 - last_write_checksum: sha1:7e5d1cdbf50a56d4510fb033ec8de1181ba1a817 - pristine_git_object: 10c2121feb855c136426094ce641aea7e2d8562a + last_write_checksum: sha1:0f01ca74a8e08affc287a6e0db1f6bb2a3777dba + pristine_git_object: 729137ec0cf84d74dd72ae9bbf2932627e037774 src/main/java/com/glean/api_client/glean_api_client/operations/PlatformAgentsGet.java: id: 4a9693c7c21d last_write_checksum: sha1:149b39f35a336a8c141e1941509f9db278fd667b pristine_git_object: f73a2260c2e3e797ac7a10caf04cdf9a90f0bcfe + src/main/java/com/glean/api_client/glean_api_client/operations/PlatformAgentsGetRun.java: + id: f71fadfc6b46 + last_write_checksum: sha1:6fcb27d8cb7250888f08993795d9ae5fb557bf90 + pristine_git_object: 6654a065796c9e50f35199be38289f25b389e3ed src/main/java/com/glean/api_client/glean_api_client/operations/PlatformAgentsGetSchemas.java: id: 79b3ee998a38 last_write_checksum: sha1:2ecffd2b998f3d980e9640803f9e0fe2a53e7695 @@ -13205,7 +13365,7 @@ examples: path: agent_id: "" requestBody: - application/json: {"messages": [{"role": "USER", "content": [{"text": "What is our parental leave policy?", "type": "text"}]}], "stream": false} + application/json: {"messages": [{"role": "USER", "content": [{"text": "What is our parental leave policy?", "type": "text"}]}], "stream": false, "execution_mode": "REQUEST_BOUND"} responses: "200": application/json: {"run": {"agent_id": "", "messages": [{"role": "USER", "content": []}], "status": "error"}, "messages": [{"role": "USER", "content": []}], "request_id": ""} @@ -13216,6 +13376,8 @@ examples: application/problem+json: {"type": "https://developer.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developer.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} "422": application/problem+json: {"type": "https://developers.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developers.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}], "authentication_suggestions": []} + "201": + application/json: {"run": {"run_id": "", "agent_id": "", "state": "REQUIRES_INPUT", "created_at": "2025-06-25T09:13:22.201Z", "updated_at": "2024-01-10T17:12:38.186Z", "pending_interactions": []}, "request_id": ""} platform-search: speakeasy-default-platform-search: requestBody: @@ -13370,7 +13532,7 @@ examples: platform-chat-create: speakeasy-default-platform-chat-create: requestBody: - application/json: {"input": "What is our parental leave policy?", "stream": false, "store": true} + application/json: {"input": "Summarize our parental leave policy as JSON.", "stream": false, "store": true, "text": {"format": {"type": "JSON_SCHEMA", "name": "policy_summary", "schema": {"type": "object", "properties": {"eligible_employees": {"type": "string"}, "duration_weeks": {"type": "integer"}}, "required": ["eligible_employees", "duration_weeks"]}, "strict": true}}} responses: "200": application/json: {"id": "", "object": "RESPONSE", "created_at": "2026-05-19T05:32:52.505Z", "status": "COMPLETED", "output": [{"type": "MESSAGE", "role": "ASSISTANT", "content": [{"type": "OUTPUT_TEXT", "text": ""}]}], "store": false, "request_id": ""} @@ -13597,12 +13759,25 @@ examples: platform-chat-create-stream: speakeasy-default-platform-chat-create-stream: requestBody: - application/json: {"input": "What is our parental leave policy?", "stream": true, "store": true} + application/json: {"input": "Summarize our parental leave policy as JSON.", "stream": true, "store": true, "text": {"format": {"type": "JSON_SCHEMA", "name": "policy_summary", "schema": {"type": "object", "properties": {"eligible_employees": {"type": "string"}, "duration_weeks": {"type": "integer"}}, "required": ["eligible_employees", "duration_weeks"]}, "strict": true}}} responses: "400": application/problem+json: {"type": "https://developers.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developers.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} "500": application/problem+json: {"type": "https://developers.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developers.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} + platform-agents-get-run: + speakeasy-default-platform-agents-get-run: + parameters: + path: + agent_id: "{agent_id}" + run_id: "{run_id}" + responses: + "200": + application/json: {"run": {"run_id": "", "agent_id": "", "state": "CANCELLING", "created_at": "2025-02-20T06:37:06.101Z", "updated_at": "2025-06-13T07:24:18.599Z", "pending_interactions": []}, "request_id": ""} + "400": + application/problem+json: {"type": "https://developers.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developers.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} + "500": + application/problem+json: {"type": "https://developers.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developers.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} examplesVersion: 1.0.2 generatedTests: activity: "2025-06-09T18:03:44Z" @@ -13745,7 +13920,7 @@ generatedTests: get_/rest/api/v1/tools/list: "2025-06-09T18:03:44Z" post_/rest/api/v1/tools/call: "2025-06-09T18:03:44Z" listpolicies: "2025-06-09T18:03:44Z" -releaseNotes: "## Java SDK Changes:\n* `glean.agents.createRun()`: `response.run.messages[].content[].annotations` **Added**\n* `glean.client.agents.import()`: `request.importAgentRequest` **Changed**\n* `glean.client.agents.run()`: `response.run.messages[].content[].annotations` **Added**\n* `glean.client.search.retrieveFeed()`: \n * `request.feedRequest.categories[]` **Changed**\n * `response.results[]` **Changed**\n" +releaseNotes: "## Java SDK Changes:\n* `glean.agents.createRun()`: \n * `request.platformAgentRunCreateRequest.executionMode` **Added**\n * `response.status[201]` **Added** (Breaking ⚠️)\n* `glean.agents.getRun()`: **Added**\n* `glean.chat.create()`: \n * `request.text` **Added**\n * `response.output[].content[].structuredOutput` **Added**\n* `glean.client.search.retrieveFeed()`: \n * `request.feedRequest.categories[]` **Changed**\n * `response.results[]` **Changed**\n" generatedFiles: - .gitattributes - USAGE.md diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index b724d432..2549b679 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -30,7 +30,7 @@ generation: generateNewTests: false skipResponseBodyAssertions: false java: - version: 0.17.15 + version: 0.17.16 additionalDependencies: [] additionalPlugins: [] artifactID: glean-api-client diff --git a/.speakeasy/glean-merged-spec.yaml b/.speakeasy/glean-merged-spec.yaml index 7ee55ac5..4b11d616 100644 --- a/.speakeasy/glean-merged-spec.yaml +++ b/.speakeasy/glean-merged-spec.yaml @@ -2,8 +2,8 @@ openapi: 3.1.0 info: version: "0.9.0" title: Glean API - x-source-commit-sha: 5f1d873383438dc574c1075f9476915610e56875 - x-open-api-commit-sha: 6a8c8e16bbbca13a130766a72f307fb373b8256a + x-source-commit-sha: 8f42e777806876b3b03e36e55819028289be3f93 + x-open-api-commit-sha: d5ffe37692ede6640ab35274e0ee5aad842dfa03 description: | # Introduction In addition to the data sources that Glean has built-in support for, Glean also provides a REST API that enables customers to put arbitrary content in the search index. This is useful, for example, for doing permissions-aware search over content in internal tools that reside on-prem as well as for searching over applications that Glean does not currently support first class. In addition these APIs allow the customer to push organization data (people info, organization structure etc) into Glean. @@ -179,7 +179,7 @@ paths: - Agents summary: Create agent run description: | - Execute an agent run. Set `stream` to true to receive server-sent events; otherwise the response contains the final agent messages. + Execute an agent run. By default, set `stream` to true to receive server-sent events; otherwise the response contains the final agent messages. Set `execution_mode` to `DURABLE` to persist a new run and return its initial snapshot with HTTP 201 without waiting for execution. Poll the agent-scoped GET run endpoint for progress. Durable execution continues after an HTTP disconnect, but is not automatically resumed after a QE restart or crash. An active turn becomes overdue more than 40 minutes after acceptance (a 30-minute execution timeout plus 10 minutes of grace). The next GET of the run marks the overdue turn FAILED without replay; there is no periodic sweep. Without a GET, the stored run can remain RUNNING. Failure does not prove that external tool work has stopped. Paused runs are not expired. Each POST creates a new run; retrying a POST can create another execution. A run tracks one workflow execution; automatic background-subagent wake turns are separate executions, not continuations tracked by this run ID. operationId: platform-agents-create-run x-visibility: Public x-codegen-request-body-name: payload @@ -214,7 +214,6 @@ paths: id: 1 event: message data: {"messages":[{"role":"GLEAN_AI","content":[{"text":"Hello","type":"text"}]}]} - id: 2 event: message data: {"messages":[{"role":"GLEAN_AI","content":[{"text":", I can help with HR policy questions.","type":"text"}]}]} @@ -222,6 +221,13 @@ paths: id: 3 event: run.failed data: {"error":{"type":"https://developers.glean.com/errors/spend-limit-exceeded","title":"Spend Limit Exceeded","status":403,"detail":"You've reached the monthly limit set by your admin.","code":"spend_limit_exceeded","request_id":"req_123","documentation_url":"https://developers.glean.com/errors/spend-limit-exceeded"}} + "201": + description: | + Durable run persisted and started. The snapshot is immediately retrievable through GET /api/agents/{agent_id}/runs/{run_id}. Execution failures appear in the run state. + content: + application/json: + schema: + $ref: "#/components/schemas/PlatformAgentRunResponse" "400": $ref: "#/components/responses/PlatformBadRequest" "401": @@ -252,6 +258,61 @@ paths: x-speakeasy-name-override: createRun security: - APIToken: [] + /api/agents/{agent_id}/runs/{run_id}: + get: + tags: + - Agents + summary: Get agent run + description: | + Retrieve a persisted workflow execution owned by the authenticated user. The run must belong to the specified agent, and the user must still have access to that agent. Unknown runs, runs owned by another user, and mismatched agent/run identifiers return 404. Requires the agents.run scope. Executions without a persisted workflow record are not available through this endpoint. + operationId: platform-agents-get-run + x-visibility: Public + parameters: + - in: path + name: agent_id + description: ID of the agent that owns the run. + required: true + example: "{agent_id}" + schema: + type: string + minLength: 1 + maxLength: 256 + - in: path + name: run_id + description: ID of the durable run to retrieve. + required: true + example: "{run_id}" + schema: + type: string + minLength: 1 + maxLength: 256 + responses: + "200": + description: Current persisted run snapshot. A failed execution is still a successful retrieval. + content: + application/json: + schema: + $ref: "#/components/schemas/PlatformAgentRunResponse" + "400": + $ref: "#/components/responses/PlatformBadRequest" + "401": + $ref: "#/components/responses/PlatformUnauthorized" + "403": + $ref: "#/components/responses/PlatformForbidden" + "404": + $ref: "#/components/responses/PlatformNotFound" + "408": + $ref: "#/components/responses/PlatformRequestTimeout" + "429": + $ref: "#/components/responses/PlatformTooManyRequests" + "500": + $ref: "#/components/responses/PlatformInternalServerError" + "503": + $ref: "#/components/responses/PlatformServiceUnavailable" + x-speakeasy-group: agents + x-speakeasy-name-override: getRun + security: + - APIToken: [] /api/chat: post: tags: @@ -7351,8 +7412,16 @@ components: additionalProperties: true stream: type: boolean - description: Whether to stream the run response as server-sent events. + description: Whether to stream the run response as server-sent events. Not supported in DURABLE mode. default: false + execution_mode: + type: string + enum: + - REQUEST_BOUND + - DURABLE + default: REQUEST_BOUND + description: | + REQUEST_BOUND preserves the existing wait/stream behavior. DURABLE starts a fresh, persisted execution with a 30-minute execution timeout and returns immediately. DURABLE requires stream to be false or omitted and does not accept metadata.chat_session_id. It does not bypass tool approval requirements or provide automatic QE-crash resumption. Expiry is read-triggered: the next GET of the run marks an active turn FAILED if more than 40 minutes have passed since the turn was accepted. There is no periodic sweep, so the stored run can remain RUNNING until it is read. Expiry never replays execution or expires approval-paused runs, and failure does not prove that external tool work has stopped. PlatformAgentRunCreate: type: object required: @@ -7404,6 +7473,124 @@ components: request_id: type: string description: Platform-generated request ID for support correlation. + PlatformAgentRunState: + type: string + enum: + - QUEUED + - RUNNING + - REQUIRES_INPUT + - SUCCEEDED + - FAILED + - CANCELLING + - CANCELLED + - EXPIRED + description: State of the persisted workflow execution. REQUIRES_INPUT is nonterminal. + PlatformAgentRunToolApproval: + type: object + description: Pending approval for a specific persisted tool invocation and its arguments. + required: + - interaction_id + - type + - display_name + - description + - arguments + properties: + interaction_id: + type: string + description: Identifies this specific invocation approval, not the tool definition. + type: + type: string + enum: + - TOOL_APPROVAL + description: Interaction type identifying a tool execution approval request. + tool_id: + type: string + description: Platform tool identifier when recorded. Omitted for requests without one, such as some MCP tools. + display_name: + type: string + description: Display name of the tool requesting approval. + description: + type: string + description: Description of the tool associated with this approval request. + arguments: + type: object + additionalProperties: true + description: Arguments from the persisted approval request. Older platform tools use flattened parameters. + expires_at: + type: string + format: date-time + description: Approval deadline, when one is set. Omitted when the approval has no expiration. + PlatformAgentRunError: + type: object + description: Caller-safe details of an agent run execution failure. + required: + - code + - message + properties: + code: + type: string + description: Machine-readable execution failure code. + message: + type: string + description: Caller-safe execution failure description. + PlatformDurableAgentRun: + type: object + description: Agent run state, pending tool approvals, and output available independently of the creation request. + required: + - run_id + - agent_id + - state + - created_at + - updated_at + - pending_interactions + properties: + run_id: + type: string + description: ID of the run, preserved across approval continuations. + agent_id: + type: string + description: ID of the agent that owns the run. + state: + $ref: "#/components/schemas/PlatformAgentRunState" + description: Current lifecycle state of the run. + created_at: + type: string + format: date-time + description: Timestamp when the run was first persisted. + updated_at: + type: string + format: date-time + description: | + Latest persisted activity timestamp across the execution and its messages, including checkpoint messages. This is not a worker heartbeat or an exact state-transition timestamp. + expires_at: + type: string + format: date-time + description: Execution deadline, when one is set. Not the run history retention deadline. + pending_interactions: + type: array + description: Unanswered tool approvals when the run is in REQUIRES_INPUT. Empty in other states. + items: + $ref: "#/components/schemas/PlatformAgentRunToolApproval" + output: + type: object + additionalProperties: true + description: Accumulated text-only agent output under the messages key, when available. + error: + $ref: "#/components/schemas/PlatformAgentRunError" + description: Caller-safe failure details when the run is in FAILED. + PlatformAgentRunResponse: + type: object + description: Persisted agent run snapshot with a request ID for support correlation. + required: + - run + - request_id + properties: + run: + $ref: "#/components/schemas/PlatformDurableAgentRun" + description: Current persisted snapshot of the requested agent run. + request_id: + type: string + description: Platform-generated request ID for support correlation. PlatformAuthenticationSuggestion: type: object description: One tool the caller must authorize before the agent can run. @@ -7444,13 +7631,72 @@ components: content: type: string minLength: 1 + PlatformChatTextFormat: + type: object + additionalProperties: false + description: Unconstrained plain-text assistant output. + required: + - type + properties: + type: + type: string + description: Discriminator. Must be TEXT. + enum: + - TEXT + PlatformChatJsonSchemaFormat: + type: object + additionalProperties: false + description: Constrains the assistant response to a caller-supplied JSON Schema. + required: + - type + - name + - schema + properties: + type: + type: string + description: Discriminator. Must be JSON_SCHEMA. + enum: + - JSON_SCHEMA + name: + type: string + minLength: 1 + maxLength: 64 + description: A stable identifier for the schema. + description: + type: string + maxLength: 1024 + description: An optional human-readable description of the schema. + schema: + type: object + additionalProperties: true + description: A JSON Schema object describing the desired output shape. + strict: + type: boolean + default: true + description: | + When true, the provider validates the response against the schema. Unsupported by some providers; defaults to true. PlatformChatCreateRequest: type: object additionalProperties: false required: - input example: - input: What is our parental leave policy? + input: Summarize our parental leave policy as JSON. + text: + format: + type: JSON_SCHEMA + name: policy_summary + schema: + type: object + properties: + eligible_employees: + type: string + duration_weeks: + type: integer + required: + - eligible_employees + - duration_weeks + strict: true properties: input: description: | @@ -7477,6 +7723,18 @@ components: minLength: 1 description: | Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`. + text: + type: object + additionalProperties: false + description: | + Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. + properties: + format: + description: | + Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. + oneOf: + - $ref: "#/components/schemas/PlatformChatTextFormat" + - $ref: "#/components/schemas/PlatformChatJsonSchemaFormat" PlatformChatStreamResponseId: type: string minLength: 1 @@ -7496,6 +7754,12 @@ components: - OUTPUT_TEXT text: type: string + structured_output: + type: + - object + - "null" + description: | + Parsed and validated JSON object when structured output was requested. Present only when the request included `text.format.type: JSON_SCHEMA`. annotations: type: array items: @@ -16128,6 +16392,8 @@ components: - EDIT_DOC - CHAT_TO_ARTIFACT - SHARE_ARTIFACT + - CREATE_AGENT + - MANAGER_INVITE description: Categories of content requested. An allowlist gives flexibility to request content separately or together. requestOptions: $ref: '#/components/schemas/FeedRequestOptions' @@ -16603,6 +16869,8 @@ components: - EDIT_DOC - CHAT_TO_ARTIFACT - SHARE_ARTIFACT + - CREATE_AGENT + - MANAGER_INVITE description: Type of the justification. justification: type: string @@ -16701,6 +16969,8 @@ components: - EDIT_DOC - CHAT_TO_ARTIFACT - SHARE_ARTIFACT + - CREATE_AGENT + - MANAGER_INVITE description: Category of the result, one of the requested categories in incoming request. primaryEntry: $ref: '#/components/schemas/FeedEntry' diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 5310ad51..6cf05962 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.797.0 +speakeasyVersion: 1.798.0 sources: Glean API: sourceNamespace: glean-api-specs - sourceRevisionDigest: sha256:1f470e422d6b202bf6bb80cc2e4b73077b7dab6d476cda804245fc0402ea42f1 - sourceBlobDigest: sha256:8919e7ffe50c1ca78844cd89c216e8ab3c54a8e0003bd5072e7fe3cd35fb192c + sourceRevisionDigest: sha256:88d2bf2cb0dc64862b19d8b94fbe1b0fcd48e1c0bbb599eee2652a14f9360947 + sourceBlobDigest: sha256:e1969f660ed944921bc964277ca42738783d270c3536417f4a83b83438fefa22 tags: - latest Glean-OAS: @@ -17,10 +17,10 @@ targets: glean: source: Glean API sourceNamespace: glean-api-specs - sourceRevisionDigest: sha256:1f470e422d6b202bf6bb80cc2e4b73077b7dab6d476cda804245fc0402ea42f1 - sourceBlobDigest: sha256:8919e7ffe50c1ca78844cd89c216e8ab3c54a8e0003bd5072e7fe3cd35fb192c + sourceRevisionDigest: sha256:88d2bf2cb0dc64862b19d8b94fbe1b0fcd48e1c0bbb599eee2652a14f9360947 + sourceBlobDigest: sha256:e1969f660ed944921bc964277ca42738783d270c3536417f4a83b83438fefa22 codeSamplesNamespace: glean-api-specs-java-code-samples - codeSamplesRevisionDigest: sha256:672971bb7999c5935c7c05862d256a02965ae632671643f46cf49e75dd3c9b01 + codeSamplesRevisionDigest: sha256:c5a8382d0a018e5a4944b5d33789d27037566bda79e8b94de4d2e56d5c3bfe2b workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 2be055d3..8c7baf66 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ The samples below show how a published SDK artifact is used: Gradle: ```groovy -implementation 'com.glean.api-client:glean-api-client:0.17.15' +implementation 'com.glean.api-client:glean-api-client:0.17.16' ``` Maven: @@ -76,7 +76,7 @@ Maven: com.glean.api-client glean-api-client - 0.17.15 + 0.17.16 ``` @@ -374,6 +374,7 @@ For more information on obtaining the appropriate token type, please contact you * [get](docs/sdks/agents/README.md#get) - Get agent * [getSchemas](docs/sdks/agents/README.md#getschemas) - Get agent schemas * [createRun](docs/sdks/agents/README.md#createrun) - Create agent run +* [getRun](docs/sdks/agents/README.md#getrun) - Get agent run ### [Chat](docs/sdks/chat/README.md) @@ -658,11 +659,13 @@ underlying connection. package hello.world; import com.glean.api_client.glean_api_client.Glean; -import com.glean.api_client.glean_api_client.models.components.PlatformChatStreamEventServerSentEvent; +import com.glean.api_client.glean_api_client.models.components.*; import com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException; import com.glean.api_client.glean_api_client.models.operations.*; import com.glean.api_client.glean_api_client.utils.EventStream; import java.lang.Exception; +import java.util.List; +import java.util.Map; import java.util.stream.Stream; public class Application { @@ -674,7 +677,23 @@ public class Application { .build(); PlatformChatCreateStreamRequest req = PlatformChatCreateStreamRequest.builder() - .input(PlatformChatCreateStreamInput.of("What is our parental leave policy?")) + .input(PlatformChatCreateStreamInput.of("Summarize our parental leave policy as JSON.")) + .text(PlatformChatCreateStreamText.builder() + .format(PlatformChatCreateStreamFormat.of(PlatformChatJsonSchemaFormat.builder() + .type(PlatformChatJsonSchemaFormatType.JSON_SCHEMA) + .name("policy_summary") + .schema(Map.ofEntries( + Map.entry("type", "object"), + Map.entry("properties", Map.ofEntries( + Map.entry("eligible_employees", Map.ofEntries( + Map.entry("type", "string"))), + Map.entry("duration_weeks", Map.ofEntries( + Map.entry("type", "integer"))))), + Map.entry("required", List.of( + "eligible_employees", + "duration_weeks")))) + .build())) + .build()) .build(); PlatformChatCreateStreamResponse res = sdk.chat().createStream() @@ -703,11 +722,12 @@ package hello.world; import com.glean.api_client.glean_api_client.AsyncGlean; import com.glean.api_client.glean_api_client.Glean; -import com.glean.api_client.glean_api_client.models.components.PlatformChatStreamEventServerSentEvent; -import com.glean.api_client.glean_api_client.models.operations.PlatformChatCreateStreamInput; -import com.glean.api_client.glean_api_client.models.operations.PlatformChatCreateStreamRequest; +import com.glean.api_client.glean_api_client.models.components.*; +import com.glean.api_client.glean_api_client.models.operations.*; import com.glean.api_client.glean_api_client.models.operations.async.PlatformChatCreateStreamResponse; import com.glean.api_client.glean_api_client.utils.reactive.EventStream; +import java.util.List; +import java.util.Map; import reactor.core.publisher.Flux; public class Application { @@ -720,7 +740,23 @@ public class Application { .async(); PlatformChatCreateStreamRequest req = PlatformChatCreateStreamRequest.builder() - .input(PlatformChatCreateStreamInput.of("What is our parental leave policy?")) + .input(PlatformChatCreateStreamInput.of("Summarize our parental leave policy as JSON.")) + .text(PlatformChatCreateStreamText.builder() + .format(PlatformChatCreateStreamFormat.of(PlatformChatJsonSchemaFormat.builder() + .type(PlatformChatJsonSchemaFormatType.JSON_SCHEMA) + .name("policy_summary") + .schema(Map.ofEntries( + Map.entry("type", "object"), + Map.entry("properties", Map.ofEntries( + Map.entry("eligible_employees", Map.ofEntries( + Map.entry("type", "string"))), + Map.entry("duration_weeks", Map.ofEntries( + Map.entry("type", "integer"))))), + Map.entry("required", List.of( + "eligible_employees", + "duration_weeks")))) + .build())) + .build()) .build(); EventStream res = sdk.chat().createStream() @@ -847,14 +883,14 @@ public class Application { many more subclasses in the JDK platform). **Inherit from [`GleanError`](./src/main/java/models/errors/GleanError.java)**: -* [`com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException`](./src/main/java/models/errors/com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException.java): Error response following RFC 9457, extended with `code` and `documentation_url` for machine-readable classification and self-service remediation. Applicable to 32 of 167 methods.* -* [`com.glean.api_client.glean_api_client.models.errors.ErrorResponse`](./src/main/java/models/errors/com.glean.api_client.glean_api_client.models.errors.ErrorResponse.java): Error response returned for failed requests. Applicable to 10 of 167 methods.* -* [`com.glean.api_client.glean_api_client.models.errors.ErrorInfoResponse`](./src/main/java/models/errors/com.glean.api_client.glean_api_client.models.errors.ErrorInfoResponse.java): Error response for custom metadata operations. Applicable to 6 of 167 methods.* -* [`com.glean.api_client.glean_api_client.models.errors.CollectionError`](./src/main/java/models/errors/com.glean.api_client.glean_api_client.models.errors.CollectionError.java): Semantic error. Status code `422`. Applicable to 3 of 167 methods.* -* [`com.glean.api_client.glean_api_client.models.errors.GleanDataError`](./src/main/java/models/errors/com.glean.api_client.glean_api_client.models.errors.GleanDataError.java): Forbidden. Applicable to 2 of 167 methods.* -* [`com.glean.api_client.glean_api_client.models.errors.UnauthorizedAgentToolsError`](./src/main/java/models/errors/com.glean.api_client.glean_api_client.models.errors.UnauthorizedAgentToolsError.java): Returned when the agent has tools the caller must authorize before the run can start. Each entry in `authenticationSuggestions` names one such tool; POST its `serverId` to `/tool-servers/{serverId}/auth` with `returnUrl` in the request body to obtain an `authorizationUrl` to redirect the end user to, then retry the run once OAuth completes. Status code `422`. Applicable to 2 of 167 methods.* -* [`com.glean.api_client.glean_api_client.models.errors.AccessRequestPermissionDeniedResponseException`](./src/main/java/models/errors/com.glean.api_client.glean_api_client.models.errors.AccessRequestPermissionDeniedResponseException.java): Forbidden. Status code `403`. Applicable to 1 of 167 methods.* -* [`com.glean.api_client.glean_api_client.models.errors.PlatformUnauthorizedAgentToolsProblemException`](./src/main/java/models/errors/com.glean.api_client.glean_api_client.models.errors.PlatformUnauthorizedAgentToolsProblemException.java): Problem detail extended with `authentication_suggestions` naming each tool the caller must authorize. Status code `422`. Applicable to 1 of 167 methods.* +* [`com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException`](./src/main/java/models/errors/com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException.java): Error response following RFC 9457, extended with `code` and `documentation_url` for machine-readable classification and self-service remediation. Applicable to 33 of 168 methods.* +* [`com.glean.api_client.glean_api_client.models.errors.ErrorResponse`](./src/main/java/models/errors/com.glean.api_client.glean_api_client.models.errors.ErrorResponse.java): Error response returned for failed requests. Applicable to 10 of 168 methods.* +* [`com.glean.api_client.glean_api_client.models.errors.ErrorInfoResponse`](./src/main/java/models/errors/com.glean.api_client.glean_api_client.models.errors.ErrorInfoResponse.java): Error response for custom metadata operations. Applicable to 6 of 168 methods.* +* [`com.glean.api_client.glean_api_client.models.errors.CollectionError`](./src/main/java/models/errors/com.glean.api_client.glean_api_client.models.errors.CollectionError.java): Semantic error. Status code `422`. Applicable to 3 of 168 methods.* +* [`com.glean.api_client.glean_api_client.models.errors.GleanDataError`](./src/main/java/models/errors/com.glean.api_client.glean_api_client.models.errors.GleanDataError.java): Forbidden. Applicable to 2 of 168 methods.* +* [`com.glean.api_client.glean_api_client.models.errors.UnauthorizedAgentToolsError`](./src/main/java/models/errors/com.glean.api_client.glean_api_client.models.errors.UnauthorizedAgentToolsError.java): Returned when the agent has tools the caller must authorize before the run can start. Each entry in `authenticationSuggestions` names one such tool; POST its `serverId` to `/tool-servers/{serverId}/auth` with `returnUrl` in the request body to obtain an `authorizationUrl` to redirect the end user to, then retry the run once OAuth completes. Status code `422`. Applicable to 2 of 168 methods.* +* [`com.glean.api_client.glean_api_client.models.errors.AccessRequestPermissionDeniedResponseException`](./src/main/java/models/errors/com.glean.api_client.glean_api_client.models.errors.AccessRequestPermissionDeniedResponseException.java): Forbidden. Status code `403`. Applicable to 1 of 168 methods.* +* [`com.glean.api_client.glean_api_client.models.errors.PlatformUnauthorizedAgentToolsProblemException`](./src/main/java/models/errors/com.glean.api_client.glean_api_client.models.errors.PlatformUnauthorizedAgentToolsProblemException.java): Problem detail extended with `authentication_suggestions` naming each tool the caller must authorize. Status code `422`. Applicable to 1 of 168 methods.* diff --git a/RELEASES.md b/RELEASES.md index a0c63fa5..87e5f0f1 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1008,4 +1008,14 @@ Based on: ### Generated - [java v0.17.15] . ### Releases -- [Maven Central v0.17.15] https://central.sonatype.com/artifact/com.glean.api-client/glean-api-client/0.17.15 - . \ No newline at end of file +- [Maven Central v0.17.15] https://central.sonatype.com/artifact/com.glean.api-client/glean-api-client/0.17.15 - . + +## 2026-09-22 19:02:39 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.798.0 (2.938.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [java v0.17.16] . +### Releases +- [Maven Central v0.17.16] https://central.sonatype.com/artifact/com.glean.api-client/glean-api-client/0.17.16 - . \ No newline at end of file diff --git a/docs/models/components/ExecutionMode.md b/docs/models/components/ExecutionMode.md new file mode 100644 index 00000000..81878711 --- /dev/null +++ b/docs/models/components/ExecutionMode.md @@ -0,0 +1,20 @@ +# ExecutionMode + +REQUEST_BOUND preserves the existing wait/stream behavior. DURABLE starts a fresh, persisted execution with a 30-minute execution timeout and returns immediately. DURABLE requires stream to be false or omitted and does not accept metadata.chat_session_id. It does not bypass tool approval requirements or provide automatic QE-crash resumption. Expiry is read-triggered: the next GET of the run marks an active turn FAILED if more than 40 minutes have passed since the turn was accepted. There is no periodic sweep, so the stored run can remain RUNNING until it is read. Expiry never replays execution or expires approval-paused runs, and failure does not prove that external tool work has stopped. + + +## Example Usage + +```java +import com.glean.api_client.glean_api_client.models.components.ExecutionMode; + +ExecutionMode value = ExecutionMode.REQUEST_BOUND; +``` + + +## Values + +| Name | Value | +| --------------- | --------------- | +| `REQUEST_BOUND` | REQUEST_BOUND | +| `DURABLE` | DURABLE | \ No newline at end of file diff --git a/docs/models/components/FeedRequestCategory.md b/docs/models/components/FeedRequestCategory.md index a29ec274..31764609 100644 --- a/docs/models/components/FeedRequestCategory.md +++ b/docs/models/components/FeedRequestCategory.md @@ -64,4 +64,6 @@ FeedRequestCategory value = FeedRequestCategory.DOCUMENT_SUGGESTION; | `ARTIFACT_CREATION` | ARTIFACT_CREATION | | `EDIT_DOC` | EDIT_DOC | | `CHAT_TO_ARTIFACT` | CHAT_TO_ARTIFACT | -| `SHARE_ARTIFACT` | SHARE_ARTIFACT | \ No newline at end of file +| `SHARE_ARTIFACT` | SHARE_ARTIFACT | +| `CREATE_AGENT` | CREATE_AGENT | +| `MANAGER_INVITE` | MANAGER_INVITE | \ No newline at end of file diff --git a/docs/models/components/FeedResultCategory.md b/docs/models/components/FeedResultCategory.md index 79839823..4a6370d0 100644 --- a/docs/models/components/FeedResultCategory.md +++ b/docs/models/components/FeedResultCategory.md @@ -69,4 +69,6 @@ FeedResultCategory custom = FeedResultCategory.of("custom_value"); | `ARTIFACT_CREATION` | ARTIFACT_CREATION | | `EDIT_DOC` | EDIT_DOC | | `CHAT_TO_ARTIFACT` | CHAT_TO_ARTIFACT | -| `SHARE_ARTIFACT` | SHARE_ARTIFACT | \ No newline at end of file +| `SHARE_ARTIFACT` | SHARE_ARTIFACT | +| `CREATE_AGENT` | CREATE_AGENT | +| `MANAGER_INVITE` | MANAGER_INVITE | \ No newline at end of file diff --git a/docs/models/components/JustificationType.md b/docs/models/components/JustificationType.md index 4b300896..3ae642a7 100644 --- a/docs/models/components/JustificationType.md +++ b/docs/models/components/JustificationType.md @@ -83,4 +83,6 @@ JustificationType custom = JustificationType.of("custom_value"); | `ARTIFACT_CREATION` | ARTIFACT_CREATION | | `EDIT_DOC` | EDIT_DOC | | `CHAT_TO_ARTIFACT` | CHAT_TO_ARTIFACT | -| `SHARE_ARTIFACT` | SHARE_ARTIFACT | \ No newline at end of file +| `SHARE_ARTIFACT` | SHARE_ARTIFACT | +| `CREATE_AGENT` | CREATE_AGENT | +| `MANAGER_INVITE` | MANAGER_INVITE | \ No newline at end of file diff --git a/docs/models/components/PlatformAgentRunCreateRequest.md b/docs/models/components/PlatformAgentRunCreateRequest.md index 1bfb9511..8d4d7159 100644 --- a/docs/models/components/PlatformAgentRunCreateRequest.md +++ b/docs/models/components/PlatformAgentRunCreateRequest.md @@ -6,9 +6,10 @@ Request to run an agent. A request MUST supply either `messages` (a non-empty co ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `input` | Map\ | :heavy_minus_sign: | Input fields for an input-form triggered agent. | -| `messages` | List\<[PlatformMessageInput](../../models/components/PlatformMessageInput.md)> | :heavy_minus_sign: | Messages to pass to the agent. When provided, the array MUST contain at least one message and each message MUST specify a valid `role` and non-empty `content`.
| -| `metadata` | Map\ | :heavy_minus_sign: | Metadata to pass to the agent. | -| `stream` | *Optional\* | :heavy_minus_sign: | Whether to stream the run response as server-sent events. | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `input` | Map\ | :heavy_minus_sign: | Input fields for an input-form triggered agent. | +| `messages` | List\<[PlatformMessageInput](../../models/components/PlatformMessageInput.md)> | :heavy_minus_sign: | Messages to pass to the agent. When provided, the array MUST contain at least one message and each message MUST specify a valid `role` and non-empty `content`.
| +| `metadata` | Map\ | :heavy_minus_sign: | Metadata to pass to the agent. | +| `stream` | *Optional\* | :heavy_minus_sign: | Whether to stream the run response as server-sent events. Not supported in DURABLE mode. | +| `executionMode` | [Optional\](../../models/components/ExecutionMode.md) | :heavy_minus_sign: | REQUEST_BOUND preserves the existing wait/stream behavior. DURABLE starts a fresh, persisted execution with a 30-minute execution timeout and returns immediately. DURABLE requires stream to be false or omitted and does not accept metadata.chat_session_id. It does not bypass tool approval requirements or provide automatic QE-crash resumption. Expiry is read-triggered: the next GET of the run marks an active turn FAILED if more than 40 minutes have passed since the turn was accepted. There is no periodic sweep, so the stored run can remain RUNNING until it is read. Expiry never replays execution or expires approval-paused runs, and failure does not prove that external tool work has stopped.
| \ No newline at end of file diff --git a/docs/models/components/PlatformAgentRunError.md b/docs/models/components/PlatformAgentRunError.md new file mode 100644 index 00000000..b4c62d59 --- /dev/null +++ b/docs/models/components/PlatformAgentRunError.md @@ -0,0 +1,11 @@ +# PlatformAgentRunError + +Caller-safe details of an agent run execution failure. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `code` | *String* | :heavy_check_mark: | Machine-readable execution failure code. | +| `message` | *String* | :heavy_check_mark: | Caller-safe execution failure description. | \ No newline at end of file diff --git a/docs/models/components/PlatformAgentRunResponse.md b/docs/models/components/PlatformAgentRunResponse.md new file mode 100644 index 00000000..1d01da48 --- /dev/null +++ b/docs/models/components/PlatformAgentRunResponse.md @@ -0,0 +1,11 @@ +# PlatformAgentRunResponse + +Persisted agent run snapshot with a request ID for support correlation. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `run` | [PlatformDurableAgentRun](../../models/components/PlatformDurableAgentRun.md) | :heavy_check_mark: | Agent run state, pending tool approvals, and output available independently of the creation request. | +| `requestId` | *String* | :heavy_check_mark: | Platform-generated request ID for support correlation. | \ No newline at end of file diff --git a/docs/models/components/PlatformAgentRunState.md b/docs/models/components/PlatformAgentRunState.md new file mode 100644 index 00000000..6450774b --- /dev/null +++ b/docs/models/components/PlatformAgentRunState.md @@ -0,0 +1,28 @@ +# PlatformAgentRunState + +State of the persisted workflow execution. REQUIRES_INPUT is nonterminal. + +## Example Usage + +```java +import com.glean.api_client.glean_api_client.models.components.PlatformAgentRunState; + +PlatformAgentRunState value = PlatformAgentRunState.QUEUED; + +// Open enum: use .of() to create instances from custom string values +PlatformAgentRunState custom = PlatformAgentRunState.of("custom_value"); +``` + + +## Values + +| Name | Value | +| ---------------- | ---------------- | +| `QUEUED` | QUEUED | +| `RUNNING` | RUNNING | +| `REQUIRES_INPUT` | REQUIRES_INPUT | +| `SUCCEEDED` | SUCCEEDED | +| `FAILED` | FAILED | +| `CANCELLING` | CANCELLING | +| `CANCELLED` | CANCELLED | +| `EXPIRED` | EXPIRED | \ No newline at end of file diff --git a/docs/models/components/PlatformAgentRunToolApproval.md b/docs/models/components/PlatformAgentRunToolApproval.md new file mode 100644 index 00000000..c65e4803 --- /dev/null +++ b/docs/models/components/PlatformAgentRunToolApproval.md @@ -0,0 +1,16 @@ +# PlatformAgentRunToolApproval + +Pending approval for a specific persisted tool invocation and its arguments. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `interactionId` | *String* | :heavy_check_mark: | Identifies this specific invocation approval, not the tool definition. | +| `type` | [PlatformAgentRunToolApprovalType](../../models/components/PlatformAgentRunToolApprovalType.md) | :heavy_check_mark: | Interaction type identifying a tool execution approval request. | +| `toolId` | *Optional\* | :heavy_minus_sign: | Platform tool identifier when recorded. Omitted for requests without one, such as some MCP tools. | +| `displayName` | *String* | :heavy_check_mark: | Display name of the tool requesting approval. | +| `description` | *String* | :heavy_check_mark: | Description of the tool associated with this approval request. | +| `arguments` | Map\ | :heavy_check_mark: | Arguments from the persisted approval request. Older platform tools use flattened parameters. | +| `expiresAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_minus_sign: | Approval deadline, when one is set. Omitted when the approval has no expiration. | \ No newline at end of file diff --git a/docs/models/components/PlatformAgentRunToolApprovalType.md b/docs/models/components/PlatformAgentRunToolApprovalType.md new file mode 100644 index 00000000..abf718e9 --- /dev/null +++ b/docs/models/components/PlatformAgentRunToolApprovalType.md @@ -0,0 +1,18 @@ +# PlatformAgentRunToolApprovalType + +Interaction type identifying a tool execution approval request. + +## Example Usage + +```java +import com.glean.api_client.glean_api_client.models.components.PlatformAgentRunToolApprovalType; + +PlatformAgentRunToolApprovalType value = PlatformAgentRunToolApprovalType.TOOL_APPROVAL; +``` + + +## Values + +| Name | Value | +| --------------- | --------------- | +| `TOOL_APPROVAL` | TOOL_APPROVAL | \ No newline at end of file diff --git a/docs/models/components/PlatformChatJsonSchemaFormat.md b/docs/models/components/PlatformChatJsonSchemaFormat.md new file mode 100644 index 00000000..118bf4fc --- /dev/null +++ b/docs/models/components/PlatformChatJsonSchemaFormat.md @@ -0,0 +1,14 @@ +# PlatformChatJsonSchemaFormat + +Constrains the assistant response to a caller-supplied JSON Schema. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `type` | [PlatformChatJsonSchemaFormatType](../../models/components/PlatformChatJsonSchemaFormatType.md) | :heavy_check_mark: | Discriminator. Must be JSON_SCHEMA. | +| `name` | *String* | :heavy_check_mark: | A stable identifier for the schema. | +| `description` | *Optional\* | :heavy_minus_sign: | An optional human-readable description of the schema. | +| `schema` | Map\ | :heavy_check_mark: | A JSON Schema object describing the desired output shape. | +| `strict` | *Optional\* | :heavy_minus_sign: | When true, the provider validates the response against the schema. Unsupported by some providers; defaults to true.
| \ No newline at end of file diff --git a/docs/models/components/PlatformChatJsonSchemaFormatType.md b/docs/models/components/PlatformChatJsonSchemaFormatType.md new file mode 100644 index 00000000..0c632bb1 --- /dev/null +++ b/docs/models/components/PlatformChatJsonSchemaFormatType.md @@ -0,0 +1,18 @@ +# PlatformChatJsonSchemaFormatType + +Discriminator. Must be JSON_SCHEMA. + +## Example Usage + +```java +import com.glean.api_client.glean_api_client.models.components.PlatformChatJsonSchemaFormatType; + +PlatformChatJsonSchemaFormatType value = PlatformChatJsonSchemaFormatType.JSON_SCHEMA; +``` + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `JSON_SCHEMA` | JSON_SCHEMA | \ No newline at end of file diff --git a/docs/models/components/PlatformChatOutputTextContent.md b/docs/models/components/PlatformChatOutputTextContent.md index 915538bf..41ab4bca 100644 --- a/docs/models/components/PlatformChatOutputTextContent.md +++ b/docs/models/components/PlatformChatOutputTextContent.md @@ -3,8 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -| `type` | [PlatformChatOutputTextContentType](../../models/components/PlatformChatOutputTextContentType.md) | :heavy_check_mark: | N/A | -| `text` | *String* | :heavy_check_mark: | N/A | -| `annotations` | List\<[PlatformChatCitationAnnotation](../../models/components/PlatformChatCitationAnnotation.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | +| `type` | [PlatformChatOutputTextContentType](../../models/components/PlatformChatOutputTextContentType.md) | :heavy_check_mark: | N/A | +| `text` | *String* | :heavy_check_mark: | N/A | +| `structuredOutput` | [JsonNullable\](../../models/components/StructuredOutput.md) | :heavy_minus_sign: | Parsed and validated JSON object when structured output was requested. Present only when the request included `text.format.type: JSON_SCHEMA`.
| +| `annotations` | List\<[PlatformChatCitationAnnotation](../../models/components/PlatformChatCitationAnnotation.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/PlatformChatTextFormat.md b/docs/models/components/PlatformChatTextFormat.md new file mode 100644 index 00000000..0eaabe23 --- /dev/null +++ b/docs/models/components/PlatformChatTextFormat.md @@ -0,0 +1,10 @@ +# PlatformChatTextFormat + +Unconstrained plain-text assistant output. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | +| `type` | [PlatformChatTextFormatType](../../models/components/PlatformChatTextFormatType.md) | :heavy_check_mark: | Discriminator. Must be TEXT. | \ No newline at end of file diff --git a/docs/models/components/PlatformChatTextFormatType.md b/docs/models/components/PlatformChatTextFormatType.md new file mode 100644 index 00000000..c73b20f3 --- /dev/null +++ b/docs/models/components/PlatformChatTextFormatType.md @@ -0,0 +1,18 @@ +# PlatformChatTextFormatType + +Discriminator. Must be TEXT. + +## Example Usage + +```java +import com.glean.api_client.glean_api_client.models.components.PlatformChatTextFormatType; + +PlatformChatTextFormatType value = PlatformChatTextFormatType.TEXT; +``` + + +## Values + +| Name | Value | +| ------ | ------ | +| `TEXT` | TEXT | \ No newline at end of file diff --git a/docs/models/components/PlatformDurableAgentRun.md b/docs/models/components/PlatformDurableAgentRun.md new file mode 100644 index 00000000..df37e801 --- /dev/null +++ b/docs/models/components/PlatformDurableAgentRun.md @@ -0,0 +1,18 @@ +# PlatformDurableAgentRun + +Agent run state, pending tool approvals, and output available independently of the creation request. + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `runId` | *String* | :heavy_check_mark: | ID of the run, preserved across approval continuations. | +| `agentId` | *String* | :heavy_check_mark: | ID of the agent that owns the run. | +| `state` | [PlatformAgentRunState](../../models/components/PlatformAgentRunState.md) | :heavy_check_mark: | State of the persisted workflow execution. REQUIRES_INPUT is nonterminal. | +| `createdAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_check_mark: | Timestamp when the run was first persisted. | +| `updatedAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_check_mark: | Latest persisted activity timestamp across the execution and its messages, including checkpoint messages. This is not a worker heartbeat or an exact state-transition timestamp.
| +| `expiresAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_minus_sign: | Execution deadline, when one is set. Not the run history retention deadline. | +| `pendingInteractions` | List\<[PlatformAgentRunToolApproval](../../models/components/PlatformAgentRunToolApproval.md)> | :heavy_check_mark: | Unanswered tool approvals when the run is in REQUIRES_INPUT. Empty in other states. | +| `output` | Map\ | :heavy_minus_sign: | Accumulated text-only agent output under the messages key, when available. | +| `error` | [Optional\](../../models/components/PlatformAgentRunError.md) | :heavy_minus_sign: | Caller-safe details of an agent run execution failure. | \ No newline at end of file diff --git a/docs/models/components/StructuredOutput.md b/docs/models/components/StructuredOutput.md new file mode 100644 index 00000000..45e8ab02 --- /dev/null +++ b/docs/models/components/StructuredOutput.md @@ -0,0 +1,10 @@ +# StructuredOutput + +Parsed and validated JSON object when structured output was requested. Present only when the request included `text.format.type: JSON_SCHEMA`. + + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/PlatformAgentsCreateRunResponse.md b/docs/models/operations/PlatformAgentsCreateRunResponse.md index d930b7ed..5b017365 100644 --- a/docs/models/operations/PlatformAgentsCreateRunResponse.md +++ b/docs/models/operations/PlatformAgentsCreateRunResponse.md @@ -3,10 +3,11 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `platformAgentRunWaitResponse` | [Optional\](../../models/components/PlatformAgentRunWaitResponse.md) | :heavy_minus_sign: | Successful response. | -| `res` | *Optional\* | :heavy_minus_sign: | Successful response. | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `platformAgentRunWaitResponse` | [Optional\](../../models/components/PlatformAgentRunWaitResponse.md) | :heavy_minus_sign: | Successful response. | +| `res` | *Optional\* | :heavy_minus_sign: | Successful response. | +| `platformAgentRunResponse` | [Optional\](../../models/components/PlatformAgentRunResponse.md) | :heavy_minus_sign: | Durable run persisted and started. The snapshot is immediately retrievable through GET /api/agents/{agent_id}/runs/{run_id}. Execution failures appear in the run state.
| \ No newline at end of file diff --git a/docs/models/operations/PlatformAgentsGetRunRequest.md b/docs/models/operations/PlatformAgentsGetRunRequest.md new file mode 100644 index 00000000..11f4dc59 --- /dev/null +++ b/docs/models/operations/PlatformAgentsGetRunRequest.md @@ -0,0 +1,9 @@ +# PlatformAgentsGetRunRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | +| `agentId` | *String* | :heavy_check_mark: | ID of the agent that owns the run. | {agent_id} | +| `runId` | *String* | :heavy_check_mark: | ID of the durable run to retrieve. | {run_id} | \ No newline at end of file diff --git a/docs/models/operations/PlatformAgentsGetRunResponse.md b/docs/models/operations/PlatformAgentsGetRunResponse.md new file mode 100644 index 00000000..e7b2a70f --- /dev/null +++ b/docs/models/operations/PlatformAgentsGetRunResponse.md @@ -0,0 +1,11 @@ +# PlatformAgentsGetRunResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `platformAgentRunResponse` | [Optional\](../../models/components/PlatformAgentRunResponse.md) | :heavy_minus_sign: | Current persisted run snapshot. A failed execution is still a successful retrieval. | \ No newline at end of file diff --git a/docs/models/operations/PlatformChatCreateFormat.md b/docs/models/operations/PlatformChatCreateFormat.md new file mode 100644 index 00000000..cf5aad0a --- /dev/null +++ b/docs/models/operations/PlatformChatCreateFormat.md @@ -0,0 +1,5 @@ +# PlatformChatCreateFormat + +Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. + + diff --git a/docs/models/operations/PlatformChatCreateRequest.md b/docs/models/operations/PlatformChatCreateRequest.md index be17d27e..2664e353 100644 --- a/docs/models/operations/PlatformChatCreateRequest.md +++ b/docs/models/operations/PlatformChatCreateRequest.md @@ -3,9 +3,10 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | -| `input` | [PlatformChatCreateInput](../../models/operations/PlatformChatCreateInput.md) | :heavy_check_mark: | Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`.
| -| `stream` | *Optional\* | :heavy_minus_sign: | N/A | -| `store` | *Optional\* | :heavy_minus_sign: | When true (default), persist the interaction and return a `conversation_id`. When false, run ephemerally with no persistence.
| -| `conversationId` | *Optional\* | :heavy_minus_sign: | Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`.
| \ No newline at end of file +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `input` | [PlatformChatCreateInput](../../models/operations/PlatformChatCreateInput.md) | :heavy_check_mark: | Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`.
| +| `stream` | *Optional\* | :heavy_minus_sign: | N/A | +| `store` | *Optional\* | :heavy_minus_sign: | When true (default), persist the interaction and return a `conversation_id`. When false, run ephemerally with no persistence.
| +| `conversationId` | *Optional\* | :heavy_minus_sign: | Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`.
| +| `text` | [Optional\](../../models/operations/PlatformChatCreateText.md) | :heavy_minus_sign: | Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true.
| \ No newline at end of file diff --git a/docs/models/operations/PlatformChatCreateStreamFormat.md b/docs/models/operations/PlatformChatCreateStreamFormat.md new file mode 100644 index 00000000..09ee0a65 --- /dev/null +++ b/docs/models/operations/PlatformChatCreateStreamFormat.md @@ -0,0 +1,5 @@ +# PlatformChatCreateStreamFormat + +Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. + + diff --git a/docs/models/operations/PlatformChatCreateStreamRequest.md b/docs/models/operations/PlatformChatCreateStreamRequest.md index 049d00d8..fe33185b 100644 --- a/docs/models/operations/PlatformChatCreateStreamRequest.md +++ b/docs/models/operations/PlatformChatCreateStreamRequest.md @@ -3,9 +3,10 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | -| `input` | [PlatformChatCreateStreamInput](../../models/operations/PlatformChatCreateStreamInput.md) | :heavy_check_mark: | Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`.
| -| `stream` | *Optional\* | :heavy_minus_sign: | N/A | -| `store` | *Optional\* | :heavy_minus_sign: | When true (default), persist the interaction and return a `conversation_id`. When false, run ephemerally with no persistence.
| -| `conversationId` | *Optional\* | :heavy_minus_sign: | Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`.
| \ No newline at end of file +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `input` | [PlatformChatCreateStreamInput](../../models/operations/PlatformChatCreateStreamInput.md) | :heavy_check_mark: | Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`.
| +| `stream` | *Optional\* | :heavy_minus_sign: | N/A | +| `store` | *Optional\* | :heavy_minus_sign: | When true (default), persist the interaction and return a `conversation_id`. When false, run ephemerally with no persistence.
| +| `conversationId` | *Optional\* | :heavy_minus_sign: | Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`.
| +| `text` | [Optional\](../../models/operations/PlatformChatCreateStreamText.md) | :heavy_minus_sign: | Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true.
| \ No newline at end of file diff --git a/docs/models/operations/PlatformChatCreateStreamText.md b/docs/models/operations/PlatformChatCreateStreamText.md new file mode 100644 index 00000000..b8ba959b --- /dev/null +++ b/docs/models/operations/PlatformChatCreateStreamText.md @@ -0,0 +1,11 @@ +# PlatformChatCreateStreamText + +Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. + + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | +| `format` | [Optional\](../../models/operations/PlatformChatCreateStreamFormat.md) | :heavy_minus_sign: | Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema.
| \ No newline at end of file diff --git a/docs/models/operations/PlatformChatCreateText.md b/docs/models/operations/PlatformChatCreateText.md new file mode 100644 index 00000000..93494ad4 --- /dev/null +++ b/docs/models/operations/PlatformChatCreateText.md @@ -0,0 +1,11 @@ +# PlatformChatCreateText + +Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. + + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | +| `format` | [Optional\](../../models/operations/PlatformChatCreateFormat.md) | :heavy_minus_sign: | Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema.
| \ No newline at end of file diff --git a/docs/sdks/agents/README.md b/docs/sdks/agents/README.md index 19baddbc..b622d03f 100644 --- a/docs/sdks/agents/README.md +++ b/docs/sdks/agents/README.md @@ -8,6 +8,7 @@ * [get](#get) - Get agent * [getSchemas](#getschemas) - Get agent schemas * [createRun](#createrun) - Create agent run +* [getRun](#getrun) - Get agent run ## search @@ -177,7 +178,7 @@ public class Application { ## createRun -Execute an agent run. Set `stream` to true to receive server-sent events; otherwise the response contains the final agent messages. +Execute an agent run. By default, set `stream` to true to receive server-sent events; otherwise the response contains the final agent messages. Set `execution_mode` to `DURABLE` to persist a new run and return its initial snapshot with HTTP 201 without waiting for execution. Poll the agent-scoped GET run endpoint for progress. Durable execution continues after an HTTP disconnect, but is not automatically resumed after a QE restart or crash. An active turn becomes overdue more than 40 minutes after acceptance (a 30-minute execution timeout plus 10 minutes of grace). The next GET of the run marks the overdue turn FAILED without replay; there is no periodic sweep. Without a GET, the stored run can remain RUNNING. Failure does not prove that external tool work has stopped. Paused runs are not expired. Each POST creates a new run; retrying a POST can create another execution. A run tracks one workflow execution; automatic background-subagent wake turns are separate executions, not continuations tracked by this run ID. ### Example Usage @@ -242,4 +243,59 @@ public class Application { | models/errors/PlatformUnauthorizedAgentToolsProblemException | 422 | application/problem+json | | models/errors/PlatformProblemDetailException | 400, 401, 403, 404, 408, 409, 413, 429 | application/problem+json | | models/errors/PlatformProblemDetailException | 500, 503 | application/problem+json | -| models/errors/APIException | 4XX, 5XX | \*/\* | \ No newline at end of file +| models/errors/APIException | 4XX, 5XX | \*/\* | + +## getRun + +Retrieve a persisted workflow execution owned by the authenticated user. The run must belong to the specified agent, and the user must still have access to that agent. Unknown runs, runs owned by another user, and mismatched agent/run identifiers return 404. Requires the agents.run scope. Executions without a persisted workflow record are not available through this endpoint. + + +### Example Usage + + +```java +package hello.world; + +import com.glean.api_client.glean_api_client.Glean; +import com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException; +import com.glean.api_client.glean_api_client.models.operations.PlatformAgentsGetRunResponse; +import java.lang.Exception; + +public class Application { + + public static void main(String[] args) throws PlatformProblemDetailException, Exception { + + Glean sdk = Glean.builder() + .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", "")) + .build(); + + PlatformAgentsGetRunResponse res = sdk.agents().getRun() + .agentId("{agent_id}") + .runId("{run_id}") + .call(); + + if (res.platformAgentRunResponse().isPresent()) { + System.out.println(res.platformAgentRunResponse().get()); + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | +| `agentId` | *String* | :heavy_check_mark: | ID of the agent that owns the run. | {agent_id} | +| `runId` | *String* | :heavy_check_mark: | ID of the durable run to retrieve. | {run_id} | + +### Response + +**[PlatformAgentsGetRunResponse](../../models/operations/PlatformAgentsGetRunResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| models/errors/PlatformProblemDetailException | 400, 401, 403, 404, 408, 429 | application/problem+json | +| models/errors/PlatformProblemDetailException | 500, 503 | application/problem+json | +| models/errors/APIException | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/chat/README.md b/docs/sdks/chat/README.md index d01c6090..04466c2a 100644 --- a/docs/sdks/chat/README.md +++ b/docs/sdks/chat/README.md @@ -19,9 +19,13 @@ Run an assistant turn. The default response is JSON. HTTP clients request server package hello.world; import com.glean.api_client.glean_api_client.Glean; +import com.glean.api_client.glean_api_client.models.components.PlatformChatJsonSchemaFormat; +import com.glean.api_client.glean_api_client.models.components.PlatformChatJsonSchemaFormatType; import com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException; import com.glean.api_client.glean_api_client.models.operations.*; import java.lang.Exception; +import java.util.List; +import java.util.Map; public class Application { @@ -32,7 +36,23 @@ public class Application { .build(); PlatformChatCreateRequest req = PlatformChatCreateRequest.builder() - .input(PlatformChatCreateInput.of("What is our parental leave policy?")) + .input(PlatformChatCreateInput.of("Summarize our parental leave policy as JSON.")) + .text(PlatformChatCreateText.builder() + .format(PlatformChatCreateFormat.of(PlatformChatJsonSchemaFormat.builder() + .type(PlatformChatJsonSchemaFormatType.JSON_SCHEMA) + .name("policy_summary") + .schema(Map.ofEntries( + Map.entry("type", "object"), + Map.entry("properties", Map.ofEntries( + Map.entry("eligible_employees", Map.ofEntries( + Map.entry("type", "string"))), + Map.entry("duration_weeks", Map.ofEntries( + Map.entry("type", "integer"))))), + Map.entry("required", List.of( + "eligible_employees", + "duration_weeks")))) + .build())) + .build()) .build(); PlatformChatCreateResponse res = sdk.chat().create() @@ -76,11 +96,13 @@ SDK-only logical operation. HTTP clients must call the base path; the URL fragme package hello.world; import com.glean.api_client.glean_api_client.Glean; -import com.glean.api_client.glean_api_client.models.components.PlatformChatStreamEventServerSentEvent; +import com.glean.api_client.glean_api_client.models.components.*; import com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException; import com.glean.api_client.glean_api_client.models.operations.*; import com.glean.api_client.glean_api_client.utils.EventStream; import java.lang.Exception; +import java.util.List; +import java.util.Map; import java.util.stream.Stream; public class Application { @@ -92,7 +114,23 @@ public class Application { .build(); PlatformChatCreateStreamRequest req = PlatformChatCreateStreamRequest.builder() - .input(PlatformChatCreateStreamInput.of("What is our parental leave policy?")) + .input(PlatformChatCreateStreamInput.of("Summarize our parental leave policy as JSON.")) + .text(PlatformChatCreateStreamText.builder() + .format(PlatformChatCreateStreamFormat.of(PlatformChatJsonSchemaFormat.builder() + .type(PlatformChatJsonSchemaFormatType.JSON_SCHEMA) + .name("policy_summary") + .schema(Map.ofEntries( + Map.entry("type", "object"), + Map.entry("properties", Map.ofEntries( + Map.entry("eligible_employees", Map.ofEntries( + Map.entry("type", "string"))), + Map.entry("duration_weeks", Map.ofEntries( + Map.entry("type", "integer"))))), + Map.entry("required", List.of( + "eligible_employees", + "duration_weeks")))) + .build())) + .build()) .build(); PlatformChatCreateStreamResponse res = sdk.chat().createStream() diff --git a/gradle.properties b/gradle.properties index b0d87312..d3075575 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ groupId=com.glean.api-client artifactId=glean-api-client -version=0.17.15 +version=0.17.16 org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g diff --git a/src/main/java/com/glean/api_client/glean_api_client/Agents.java b/src/main/java/com/glean/api_client/glean_api_client/Agents.java index 4e1b4489..bb8c4e32 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/Agents.java +++ b/src/main/java/com/glean/api_client/glean_api_client/Agents.java @@ -14,6 +14,9 @@ import com.glean.api_client.glean_api_client.models.operations.PlatformAgentsGetRequest; import com.glean.api_client.glean_api_client.models.operations.PlatformAgentsGetRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.PlatformAgentsGetResponse; +import com.glean.api_client.glean_api_client.models.operations.PlatformAgentsGetRunRequest; +import com.glean.api_client.glean_api_client.models.operations.PlatformAgentsGetRunRequestBuilder; +import com.glean.api_client.glean_api_client.models.operations.PlatformAgentsGetRunResponse; import com.glean.api_client.glean_api_client.models.operations.PlatformAgentsGetSchemasRequest; import com.glean.api_client.glean_api_client.models.operations.PlatformAgentsGetSchemasRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.PlatformAgentsGetSchemasResponse; @@ -21,6 +24,7 @@ import com.glean.api_client.glean_api_client.models.operations.PlatformAgentsSearchResponse; import com.glean.api_client.glean_api_client.operations.PlatformAgentsCreateRun; import com.glean.api_client.glean_api_client.operations.PlatformAgentsGet; +import com.glean.api_client.glean_api_client.operations.PlatformAgentsGetRun; import com.glean.api_client.glean_api_client.operations.PlatformAgentsGetSchemas; import com.glean.api_client.glean_api_client.operations.PlatformAgentsSearch; import com.glean.api_client.glean_api_client.utils.Headers; @@ -154,8 +158,22 @@ public PlatformAgentsGetSchemasResponse getSchemas(String agentId, OptionalExecute an agent run. Set `stream` to true to receive server-sent events; otherwise the response - * contains the final agent messages. + *

Execute an agent run. By default, set `stream` to true to receive server-sent events; otherwise the + * response contains the final agent messages. Set `execution_mode` to `DURABLE` to persist a new run + * and return its initial snapshot with HTTP 201 without waiting for execution. + * + *

Poll the agent-scoped GET run endpoint for progress. Durable execution continues after an HTTP + * disconnect, but is not automatically resumed after a QE restart or crash. An active turn becomes + * overdue more than 40 minutes after acceptance (a 30-minute execution timeout plus 10 minutes of + * grace). + * + *

The next GET of the run marks the overdue turn FAILED without replay; there is no periodic sweep. + * Without a GET, the stored run can remain RUNNING. Failure does not prove that external tool work has + * stopped. + * + *

Paused runs are not expired. Each POST creates a new run; retrying a POST can create another + * execution. A run tracks one workflow execution; automatic background-subagent wake turns are + * separate executions, not continuations tracked by this run ID. * * @return The call builder */ @@ -166,8 +184,22 @@ public PlatformAgentsCreateRunRequestBuilder createRun() { /** * Create agent run * - *

Execute an agent run. Set `stream` to true to receive server-sent events; otherwise the response - * contains the final agent messages. + *

Execute an agent run. By default, set `stream` to true to receive server-sent events; otherwise the + * response contains the final agent messages. Set `execution_mode` to `DURABLE` to persist a new run + * and return its initial snapshot with HTTP 201 without waiting for execution. + * + *

Poll the agent-scoped GET run endpoint for progress. Durable execution continues after an HTTP + * disconnect, but is not automatically resumed after a QE restart or crash. An active turn becomes + * overdue more than 40 minutes after acceptance (a 30-minute execution timeout plus 10 minutes of + * grace). + * + *

The next GET of the run marks the overdue turn FAILED without replay; there is no periodic sweep. + * Without a GET, the stored run can remain RUNNING. Failure does not prove that external tool work has + * stopped. + * + *

Paused runs are not expired. Each POST creates a new run; retrying a POST can create another + * execution. A run tracks one workflow execution; automatic background-subagent wake turns are + * separate executions, not continuations tracked by this run ID. * * @param agentId ID of the agent to run. * @param platformAgentRunCreateRequest Request to run an agent. A request MUST supply either `messages` (a non-empty conversation) or `input` (for input-form triggered agents). @@ -187,4 +219,47 @@ public PlatformAgentsCreateRunResponse createRun(String agentId, PlatformAgentRu return operation.handleResponse(operation.doRequest(request)); } + /** + * Get agent run + * + *

Retrieve a persisted workflow execution owned by the authenticated user. The run must belong to the + * specified agent, and the user must still have access to that agent. Unknown runs, runs owned by + * another user, and mismatched agent/run identifiers return 404. + * + *

Requires the agents.run scope. Executions without a persisted workflow record are not available + * through this endpoint. + * + * @return The call builder + */ + public PlatformAgentsGetRunRequestBuilder getRun() { + return new PlatformAgentsGetRunRequestBuilder(sdkConfiguration); + } + + /** + * Get agent run + * + *

Retrieve a persisted workflow execution owned by the authenticated user. The run must belong to the + * specified agent, and the user must still have access to that agent. Unknown runs, runs owned by + * another user, and mismatched agent/run identifiers return 404. + * + *

Requires the agents.run scope. Executions without a persisted workflow record are not available + * through this endpoint. + * + * @param agentId ID of the agent that owns the run. + * @param runId ID of the durable run to retrieve. + * @return The response from the API call + * @throws RuntimeException subclass if the API call fails + */ + public PlatformAgentsGetRunResponse getRun(String agentId, String runId) { + PlatformAgentsGetRunRequest request = + PlatformAgentsGetRunRequest + .builder() + .agentId(agentId) + .runId(runId) + .build(); + RequestOperation operation + = new PlatformAgentsGetRun.Sync(sdkConfiguration, _headers); + return operation.handleResponse(operation.doRequest(request)); + } + } diff --git a/src/main/java/com/glean/api_client/glean_api_client/AsyncAgents.java b/src/main/java/com/glean/api_client/glean_api_client/AsyncAgents.java index 3c6ac1b2..34a95e8f 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/AsyncAgents.java +++ b/src/main/java/com/glean/api_client/glean_api_client/AsyncAgents.java @@ -10,17 +10,21 @@ import com.glean.api_client.glean_api_client.models.components.PlatformAgentsSearchRequest; import com.glean.api_client.glean_api_client.models.operations.PlatformAgentsCreateRunRequest; import com.glean.api_client.glean_api_client.models.operations.PlatformAgentsGetRequest; +import com.glean.api_client.glean_api_client.models.operations.PlatformAgentsGetRunRequest; import com.glean.api_client.glean_api_client.models.operations.PlatformAgentsGetSchemasRequest; import com.glean.api_client.glean_api_client.models.operations.async.PlatformAgentsCreateRunRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.async.PlatformAgentsCreateRunResponse; import com.glean.api_client.glean_api_client.models.operations.async.PlatformAgentsGetRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.async.PlatformAgentsGetResponse; +import com.glean.api_client.glean_api_client.models.operations.async.PlatformAgentsGetRunRequestBuilder; +import com.glean.api_client.glean_api_client.models.operations.async.PlatformAgentsGetRunResponse; import com.glean.api_client.glean_api_client.models.operations.async.PlatformAgentsGetSchemasRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.async.PlatformAgentsGetSchemasResponse; import com.glean.api_client.glean_api_client.models.operations.async.PlatformAgentsSearchRequestBuilder; import com.glean.api_client.glean_api_client.models.operations.async.PlatformAgentsSearchResponse; import com.glean.api_client.glean_api_client.operations.PlatformAgentsCreateRun; import com.glean.api_client.glean_api_client.operations.PlatformAgentsGet; +import com.glean.api_client.glean_api_client.operations.PlatformAgentsGetRun; import com.glean.api_client.glean_api_client.operations.PlatformAgentsGetSchemas; import com.glean.api_client.glean_api_client.operations.PlatformAgentsSearch; import com.glean.api_client.glean_api_client.utils.Headers; @@ -158,8 +162,22 @@ public CompletableFuture getSchemas(String age /** * Create agent run * - *

Execute an agent run. Set `stream` to true to receive server-sent events; otherwise the response - * contains the final agent messages. + *

Execute an agent run. By default, set `stream` to true to receive server-sent events; otherwise the + * response contains the final agent messages. Set `execution_mode` to `DURABLE` to persist a new run + * and return its initial snapshot with HTTP 201 without waiting for execution. + * + *

Poll the agent-scoped GET run endpoint for progress. Durable execution continues after an HTTP + * disconnect, but is not automatically resumed after a QE restart or crash. An active turn becomes + * overdue more than 40 minutes after acceptance (a 30-minute execution timeout plus 10 minutes of + * grace). + * + *

The next GET of the run marks the overdue turn FAILED without replay; there is no periodic sweep. + * Without a GET, the stored run can remain RUNNING. Failure does not prove that external tool work has + * stopped. + * + *

Paused runs are not expired. Each POST creates a new run; retrying a POST can create another + * execution. A run tracks one workflow execution; automatic background-subagent wake turns are + * separate executions, not continuations tracked by this run ID. * * @return The async call builder */ @@ -170,8 +188,22 @@ public PlatformAgentsCreateRunRequestBuilder createRun() { /** * Create agent run * - *

Execute an agent run. Set `stream` to true to receive server-sent events; otherwise the response - * contains the final agent messages. + *

Execute an agent run. By default, set `stream` to true to receive server-sent events; otherwise the + * response contains the final agent messages. Set `execution_mode` to `DURABLE` to persist a new run + * and return its initial snapshot with HTTP 201 without waiting for execution. + * + *

Poll the agent-scoped GET run endpoint for progress. Durable execution continues after an HTTP + * disconnect, but is not automatically resumed after a QE restart or crash. An active turn becomes + * overdue more than 40 minutes after acceptance (a 30-minute execution timeout plus 10 minutes of + * grace). + * + *

The next GET of the run marks the overdue turn FAILED without replay; there is no periodic sweep. + * Without a GET, the stored run can remain RUNNING. Failure does not prove that external tool work has + * stopped. + * + *

Paused runs are not expired. Each POST creates a new run; retrying a POST can create another + * execution. A run tracks one workflow execution; automatic background-subagent wake turns are + * separate executions, not continuations tracked by this run ID. * * @param agentId ID of the agent to run. * @param platformAgentRunCreateRequest Request to run an agent. A request MUST supply either `messages` (a non-empty conversation) or `input` (for input-form triggered agents). @@ -191,4 +223,48 @@ public CompletableFuture createRun(String agent .thenCompose(operation::handleResponse); } + + /** + * Get agent run + * + *

Retrieve a persisted workflow execution owned by the authenticated user. The run must belong to the + * specified agent, and the user must still have access to that agent. Unknown runs, runs owned by + * another user, and mismatched agent/run identifiers return 404. + * + *

Requires the agents.run scope. Executions without a persisted workflow record are not available + * through this endpoint. + * + * @return The async call builder + */ + public PlatformAgentsGetRunRequestBuilder getRun() { + return new PlatformAgentsGetRunRequestBuilder(sdkConfiguration); + } + + /** + * Get agent run + * + *

Retrieve a persisted workflow execution owned by the authenticated user. The run must belong to the + * specified agent, and the user must still have access to that agent. Unknown runs, runs owned by + * another user, and mismatched agent/run identifiers return 404. + * + *

Requires the agents.run scope. Executions without a persisted workflow record are not available + * through this endpoint. + * + * @param agentId ID of the agent that owns the run. + * @param runId ID of the durable run to retrieve. + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture getRun(String agentId, String runId) { + PlatformAgentsGetRunRequest request = + PlatformAgentsGetRunRequest + .builder() + .agentId(agentId) + .runId(runId) + .build(); + AsyncRequestOperation operation + = new PlatformAgentsGetRun.Async(sdkConfiguration, _headers); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + } diff --git a/src/main/java/com/glean/api_client/glean_api_client/SDKConfiguration.java b/src/main/java/com/glean/api_client/glean_api_client/SDKConfiguration.java index 8f237656..45d78f5b 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/SDKConfiguration.java +++ b/src/main/java/com/glean/api_client/glean_api_client/SDKConfiguration.java @@ -25,8 +25,8 @@ public class SDKConfiguration { private static final String LANGUAGE = "java"; public static final String OPENAPI_DOC_VERSION = "0.9.0"; - public static final String SDK_VERSION = "0.17.15"; - public static final String GEN_VERSION = "2.937.18"; + public static final String SDK_VERSION = "0.17.16"; + public static final String GEN_VERSION = "2.938.0"; private static final String BASE_PACKAGE = "com.glean.api_client.glean_api_client"; public static final String USER_AGENT = String.format("speakeasy-sdk/%s %s %s %s %s", diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/ExecutionMode.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/ExecutionMode.java new file mode 100644 index 00000000..8a66d66f --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/ExecutionMode.java @@ -0,0 +1,51 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: ae8d86f895da + */ +package com.glean.api_client.glean_api_client.models.components; + +import com.fasterxml.jackson.annotation.JsonValue; +import java.lang.String; +import java.util.Objects; +import java.util.Optional; + +/** + * ExecutionMode + * + *

REQUEST_BOUND preserves the existing wait/stream behavior. DURABLE starts a fresh, persisted + * execution with a 30-minute execution timeout and returns immediately. DURABLE requires stream to be + * false or omitted and does not accept metadata.chat_session_id. + * + *

It does not bypass tool approval requirements or provide automatic QE-crash resumption. Expiry is + * read-triggered: the next GET of the run marks an active turn FAILED if more than 40 minutes have + * passed since the turn was accepted. There is no periodic sweep, so the stored run can remain RUNNING + * until it is read. + * + *

Expiry never replays execution or expires approval-paused runs, and failure does not prove that + * external tool work has stopped. + */ +public enum ExecutionMode { + REQUEST_BOUND("REQUEST_BOUND"), + DURABLE("DURABLE"); + + @JsonValue + private final String value; + + ExecutionMode(String value) { + this.value = value; + } + + public String value() { + return value; + } + + public static Optional fromValue(String value) { + for (ExecutionMode o: ExecutionMode.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } +} + diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedRequestCategory.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedRequestCategory.java index 5b1b7df2..b0617dcd 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedRequestCategory.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedRequestCategory.java @@ -61,7 +61,9 @@ public enum FeedRequestCategory { ARTIFACT_CREATION("ARTIFACT_CREATION"), EDIT_DOC("EDIT_DOC"), CHAT_TO_ARTIFACT("CHAT_TO_ARTIFACT"), - SHARE_ARTIFACT("SHARE_ARTIFACT"); + SHARE_ARTIFACT("SHARE_ARTIFACT"), + CREATE_AGENT("CREATE_AGENT"), + MANAGER_INVITE("MANAGER_INVITE"); @JsonValue private final String value; diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedResultCategory.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedResultCategory.java index 8e3231a6..dda36bcf 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedResultCategory.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/FeedResultCategory.java @@ -78,6 +78,8 @@ public class FeedResultCategory { public static final FeedResultCategory EDIT_DOC = new FeedResultCategory("EDIT_DOC"); public static final FeedResultCategory CHAT_TO_ARTIFACT = new FeedResultCategory("CHAT_TO_ARTIFACT"); public static final FeedResultCategory SHARE_ARTIFACT = new FeedResultCategory("SHARE_ARTIFACT"); + public static final FeedResultCategory CREATE_AGENT = new FeedResultCategory("CREATE_AGENT"); + public static final FeedResultCategory MANAGER_INVITE = new FeedResultCategory("MANAGER_INVITE"); // This map will grow whenever a Color gets created with a new // unrecognized value (a potential memory leak if the user is not @@ -203,6 +205,8 @@ private static final Map createValuesMap() { map.put("EDIT_DOC", EDIT_DOC); map.put("CHAT_TO_ARTIFACT", CHAT_TO_ARTIFACT); map.put("SHARE_ARTIFACT", SHARE_ARTIFACT); + map.put("CREATE_AGENT", CREATE_AGENT); + map.put("MANAGER_INVITE", MANAGER_INVITE); return map; } @@ -260,6 +264,8 @@ private static final Map createEnumsMap() { map.put("EDIT_DOC", FeedResultCategoryEnum.EDIT_DOC); map.put("CHAT_TO_ARTIFACT", FeedResultCategoryEnum.CHAT_TO_ARTIFACT); map.put("SHARE_ARTIFACT", FeedResultCategoryEnum.SHARE_ARTIFACT); + map.put("CREATE_AGENT", FeedResultCategoryEnum.CREATE_AGENT); + map.put("MANAGER_INVITE", FeedResultCategoryEnum.MANAGER_INVITE); return map; } @@ -317,7 +323,9 @@ public enum FeedResultCategoryEnum { ARTIFACT_CREATION("ARTIFACT_CREATION"), EDIT_DOC("EDIT_DOC"), CHAT_TO_ARTIFACT("CHAT_TO_ARTIFACT"), - SHARE_ARTIFACT("SHARE_ARTIFACT"),; + SHARE_ARTIFACT("SHARE_ARTIFACT"), + CREATE_AGENT("CREATE_AGENT"), + MANAGER_INVITE("MANAGER_INVITE"),; private final String value; diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/JustificationType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/JustificationType.java index b2959846..16803019 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/JustificationType.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/JustificationType.java @@ -92,6 +92,8 @@ public class JustificationType { public static final JustificationType EDIT_DOC = new JustificationType("EDIT_DOC"); public static final JustificationType CHAT_TO_ARTIFACT = new JustificationType("CHAT_TO_ARTIFACT"); public static final JustificationType SHARE_ARTIFACT = new JustificationType("SHARE_ARTIFACT"); + public static final JustificationType CREATE_AGENT = new JustificationType("CREATE_AGENT"); + public static final JustificationType MANAGER_INVITE = new JustificationType("MANAGER_INVITE"); // This map will grow whenever a Color gets created with a new // unrecognized value (a potential memory leak if the user is not @@ -231,6 +233,8 @@ private static final Map createValuesMap() { map.put("EDIT_DOC", EDIT_DOC); map.put("CHAT_TO_ARTIFACT", CHAT_TO_ARTIFACT); map.put("SHARE_ARTIFACT", SHARE_ARTIFACT); + map.put("CREATE_AGENT", CREATE_AGENT); + map.put("MANAGER_INVITE", MANAGER_INVITE); return map; } @@ -302,6 +306,8 @@ private static final Map createEnumsMap() { map.put("EDIT_DOC", JustificationTypeEnum.EDIT_DOC); map.put("CHAT_TO_ARTIFACT", JustificationTypeEnum.CHAT_TO_ARTIFACT); map.put("SHARE_ARTIFACT", JustificationTypeEnum.SHARE_ARTIFACT); + map.put("CREATE_AGENT", JustificationTypeEnum.CREATE_AGENT); + map.put("MANAGER_INVITE", JustificationTypeEnum.MANAGER_INVITE); return map; } @@ -373,7 +379,9 @@ public enum JustificationTypeEnum { ARTIFACT_CREATION("ARTIFACT_CREATION"), EDIT_DOC("EDIT_DOC"), CHAT_TO_ARTIFACT("CHAT_TO_ARTIFACT"), - SHARE_ARTIFACT("SHARE_ARTIFACT"),; + SHARE_ARTIFACT("SHARE_ARTIFACT"), + CREATE_AGENT("CREATE_AGENT"), + MANAGER_INVITE("MANAGER_INVITE"),; private final String value; diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformAgentRunCreateRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformAgentRunCreateRequest.java index 79e274c9..268b6c0d 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformAgentRunCreateRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformAgentRunCreateRequest.java @@ -51,31 +51,51 @@ public class PlatformAgentRunCreateRequest { private Optional> metadata; /** - * Whether to stream the run response as server-sent events. + * Whether to stream the run response as server-sent events. Not supported in DURABLE mode. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("stream") private Optional stream; + /** + * REQUEST_BOUND preserves the existing wait/stream behavior. DURABLE starts a fresh, persisted + * execution with a 30-minute execution timeout and returns immediately. DURABLE requires stream to be + * false or omitted and does not accept metadata.chat_session_id. + * + *

It does not bypass tool approval requirements or provide automatic QE-crash resumption. Expiry is + * read-triggered: the next GET of the run marks an active turn FAILED if more than 40 minutes have + * passed since the turn was accepted. There is no periodic sweep, so the stored run can remain RUNNING + * until it is read. + * + *

Expiry never replays execution or expires approval-paused runs, and failure does not prove that + * external tool work has stopped. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("execution_mode") + private Optional executionMode; + @JsonCreator public PlatformAgentRunCreateRequest( @JsonProperty("input") Optional> input, @JsonProperty("messages") Optional> messages, @JsonProperty("metadata") Optional> metadata, - @JsonProperty("stream") Optional stream) { + @JsonProperty("stream") Optional stream, + @JsonProperty("execution_mode") Optional executionMode) { Utils.checkNotNull(input, "input"); Utils.checkNotNull(messages, "messages"); Utils.checkNotNull(metadata, "metadata"); Utils.checkNotNull(stream, "stream"); + Utils.checkNotNull(executionMode, "executionMode"); this.input = input; this.messages = messages; this.metadata = metadata; this.stream = stream; + this.executionMode = executionMode; } public PlatformAgentRunCreateRequest() { this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty()); + Optional.empty(), Optional.empty()); } /** @@ -107,13 +127,32 @@ public Optional> metadata() { } /** - * Whether to stream the run response as server-sent events. + * Whether to stream the run response as server-sent events. Not supported in DURABLE mode. */ @JsonIgnore public Optional stream() { return stream; } + /** + * REQUEST_BOUND preserves the existing wait/stream behavior. DURABLE starts a fresh, persisted + * execution with a 30-minute execution timeout and returns immediately. DURABLE requires stream to be + * false or omitted and does not accept metadata.chat_session_id. + * + *

It does not bypass tool approval requirements or provide automatic QE-crash resumption. Expiry is + * read-triggered: the next GET of the run marks an active turn FAILED if more than 40 minutes have + * passed since the turn was accepted. There is no periodic sweep, so the stored run can remain RUNNING + * until it is read. + * + *

Expiry never replays execution or expires approval-paused runs, and failure does not prove that + * external tool work has stopped. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional executionMode() { + return (Optional) executionMode; + } + public static Builder builder() { return new Builder(); } @@ -179,7 +218,7 @@ public PlatformAgentRunCreateRequest withMetadata(Optional stream) { Utils.checkNotNull(stream, "stream"); @@ -197,6 +236,45 @@ public PlatformAgentRunCreateRequest withStream(Optional stream) { return this; } + /** + * REQUEST_BOUND preserves the existing wait/stream behavior. DURABLE starts a fresh, persisted + * execution with a 30-minute execution timeout and returns immediately. DURABLE requires stream to be + * false or omitted and does not accept metadata.chat_session_id. + * + *

It does not bypass tool approval requirements or provide automatic QE-crash resumption. Expiry is + * read-triggered: the next GET of the run marks an active turn FAILED if more than 40 minutes have + * passed since the turn was accepted. There is no periodic sweep, so the stored run can remain RUNNING + * until it is read. + * + *

Expiry never replays execution or expires approval-paused runs, and failure does not prove that + * external tool work has stopped. + */ + public PlatformAgentRunCreateRequest withExecutionMode(ExecutionMode executionMode) { + Utils.checkNotNull(executionMode, "executionMode"); + this.executionMode = Optional.ofNullable(executionMode); + return this; + } + + + /** + * REQUEST_BOUND preserves the existing wait/stream behavior. DURABLE starts a fresh, persisted + * execution with a 30-minute execution timeout and returns immediately. DURABLE requires stream to be + * false or omitted and does not accept metadata.chat_session_id. + * + *

It does not bypass tool approval requirements or provide automatic QE-crash resumption. Expiry is + * read-triggered: the next GET of the run marks an active turn FAILED if more than 40 minutes have + * passed since the turn was accepted. There is no periodic sweep, so the stored run can remain RUNNING + * until it is read. + * + *

Expiry never replays execution or expires approval-paused runs, and failure does not prove that + * external tool work has stopped. + */ + public PlatformAgentRunCreateRequest withExecutionMode(Optional executionMode) { + Utils.checkNotNull(executionMode, "executionMode"); + this.executionMode = executionMode; + return this; + } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -210,14 +288,15 @@ public boolean equals(java.lang.Object o) { Utils.enhancedDeepEquals(this.input, other.input) && Utils.enhancedDeepEquals(this.messages, other.messages) && Utils.enhancedDeepEquals(this.metadata, other.metadata) && - Utils.enhancedDeepEquals(this.stream, other.stream); + Utils.enhancedDeepEquals(this.stream, other.stream) && + Utils.enhancedDeepEquals(this.executionMode, other.executionMode); } @Override public int hashCode() { return Utils.enhancedHash( input, messages, metadata, - stream); + stream, executionMode); } @Override @@ -226,7 +305,8 @@ public String toString() { "input", input, "messages", messages, "metadata", metadata, - "stream", stream); + "stream", stream, + "executionMode", executionMode); } @SuppressWarnings("UnusedReturnValue") @@ -240,6 +320,8 @@ public final static class Builder { private Optional stream; + private Optional executionMode; + private Builder() { // force use of static builder() method } @@ -305,7 +387,7 @@ public Builder metadata(Optional> metadata) { /** - * Whether to stream the run response as server-sent events. + * Whether to stream the run response as server-sent events. Not supported in DURABLE mode. */ public Builder stream(boolean stream) { Utils.checkNotNull(stream, "stream"); @@ -314,7 +396,7 @@ public Builder stream(boolean stream) { } /** - * Whether to stream the run response as server-sent events. + * Whether to stream the run response as server-sent events. Not supported in DURABLE mode. */ public Builder stream(Optional stream) { Utils.checkNotNull(stream, "stream"); @@ -322,14 +404,56 @@ public Builder stream(Optional stream) { return this; } + + /** + * REQUEST_BOUND preserves the existing wait/stream behavior. DURABLE starts a fresh, persisted + * execution with a 30-minute execution timeout and returns immediately. DURABLE requires stream to be + * false or omitted and does not accept metadata.chat_session_id. + * + *

It does not bypass tool approval requirements or provide automatic QE-crash resumption. Expiry is + * read-triggered: the next GET of the run marks an active turn FAILED if more than 40 minutes have + * passed since the turn was accepted. There is no periodic sweep, so the stored run can remain RUNNING + * until it is read. + * + *

Expiry never replays execution or expires approval-paused runs, and failure does not prove that + * external tool work has stopped. + */ + public Builder executionMode(ExecutionMode executionMode) { + Utils.checkNotNull(executionMode, "executionMode"); + this.executionMode = Optional.ofNullable(executionMode); + return this; + } + + /** + * REQUEST_BOUND preserves the existing wait/stream behavior. DURABLE starts a fresh, persisted + * execution with a 30-minute execution timeout and returns immediately. DURABLE requires stream to be + * false or omitted and does not accept metadata.chat_session_id. + * + *

It does not bypass tool approval requirements or provide automatic QE-crash resumption. Expiry is + * read-triggered: the next GET of the run marks an active turn FAILED if more than 40 minutes have + * passed since the turn was accepted. There is no periodic sweep, so the stored run can remain RUNNING + * until it is read. + * + *

Expiry never replays execution or expires approval-paused runs, and failure does not prove that + * external tool work has stopped. + */ + public Builder executionMode(Optional executionMode) { + Utils.checkNotNull(executionMode, "executionMode"); + this.executionMode = executionMode; + return this; + } + public PlatformAgentRunCreateRequest build() { if (stream == null) { stream = _SINGLETON_VALUE_Stream.value(); } + if (executionMode == null) { + executionMode = _SINGLETON_VALUE_ExecutionMode.value(); + } return new PlatformAgentRunCreateRequest( input, messages, metadata, - stream); + stream, executionMode); } @@ -338,5 +462,11 @@ public PlatformAgentRunCreateRequest build() { "stream", "false", new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_ExecutionMode = + new LazySingletonValue<>( + "execution_mode", + "\"REQUEST_BOUND\"", + new TypeReference>() {}); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformAgentRunError.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformAgentRunError.java new file mode 100644 index 00000000..89a07178 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformAgentRunError.java @@ -0,0 +1,146 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: a4c9d9b1e122 + */ +package com.glean.api_client.glean_api_client.models.components; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.lang.Override; +import java.lang.String; + +/** + * PlatformAgentRunError + * + *

Caller-safe details of an agent run execution failure. + */ +public class PlatformAgentRunError { + /** + * Machine-readable execution failure code. + */ + @JsonProperty("code") + private String code; + + /** + * Caller-safe execution failure description. + */ + @JsonProperty("message") + private String message; + + @JsonCreator + public PlatformAgentRunError( + @JsonProperty("code") String code, + @JsonProperty("message") String message) { + Utils.checkNotNull(code, "code"); + Utils.checkNotNull(message, "message"); + this.code = code; + this.message = message; + } + + /** + * Machine-readable execution failure code. + */ + @JsonIgnore + public String code() { + return code; + } + + /** + * Caller-safe execution failure description. + */ + @JsonIgnore + public String message() { + return message; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * Machine-readable execution failure code. + */ + public PlatformAgentRunError withCode(String code) { + Utils.checkNotNull(code, "code"); + this.code = code; + return this; + } + + /** + * Caller-safe execution failure description. + */ + public PlatformAgentRunError withMessage(String message) { + Utils.checkNotNull(message, "message"); + this.message = message; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformAgentRunError other = (PlatformAgentRunError) o; + return + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + code, message); + } + + @Override + public String toString() { + return Utils.toString(PlatformAgentRunError.class, + "code", code, + "message", message); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String code; + + private String message; + + private Builder() { + // force use of static builder() method + } + + + /** + * Machine-readable execution failure code. + */ + public Builder code(String code) { + Utils.checkNotNull(code, "code"); + this.code = code; + return this; + } + + + /** + * Caller-safe execution failure description. + */ + public Builder message(String message) { + Utils.checkNotNull(message, "message"); + this.message = message; + return this; + } + + public PlatformAgentRunError build() { + + return new PlatformAgentRunError( + code, message); + } + + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformAgentRunResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformAgentRunResponse.java new file mode 100644 index 00000000..c943ed01 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformAgentRunResponse.java @@ -0,0 +1,146 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 46d12aeccad4 + */ +package com.glean.api_client.glean_api_client.models.components; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.lang.Override; +import java.lang.String; + +/** + * PlatformAgentRunResponse + * + *

Persisted agent run snapshot with a request ID for support correlation. + */ +public class PlatformAgentRunResponse { + /** + * Agent run state, pending tool approvals, and output available independently of the creation request. + */ + @JsonProperty("run") + private PlatformDurableAgentRun run; + + /** + * Platform-generated request ID for support correlation. + */ + @JsonProperty("request_id") + private String requestId; + + @JsonCreator + public PlatformAgentRunResponse( + @JsonProperty("run") PlatformDurableAgentRun run, + @JsonProperty("request_id") String requestId) { + Utils.checkNotNull(run, "run"); + Utils.checkNotNull(requestId, "requestId"); + this.run = run; + this.requestId = requestId; + } + + /** + * Agent run state, pending tool approvals, and output available independently of the creation request. + */ + @JsonIgnore + public PlatformDurableAgentRun run() { + return run; + } + + /** + * Platform-generated request ID for support correlation. + */ + @JsonIgnore + public String requestId() { + return requestId; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * Agent run state, pending tool approvals, and output available independently of the creation request. + */ + public PlatformAgentRunResponse withRun(PlatformDurableAgentRun run) { + Utils.checkNotNull(run, "run"); + this.run = run; + return this; + } + + /** + * Platform-generated request ID for support correlation. + */ + public PlatformAgentRunResponse withRequestId(String requestId) { + Utils.checkNotNull(requestId, "requestId"); + this.requestId = requestId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformAgentRunResponse other = (PlatformAgentRunResponse) o; + return + Utils.enhancedDeepEquals(this.run, other.run) && + Utils.enhancedDeepEquals(this.requestId, other.requestId); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + run, requestId); + } + + @Override + public String toString() { + return Utils.toString(PlatformAgentRunResponse.class, + "run", run, + "requestId", requestId); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private PlatformDurableAgentRun run; + + private String requestId; + + private Builder() { + // force use of static builder() method + } + + + /** + * Agent run state, pending tool approvals, and output available independently of the creation request. + */ + public Builder run(PlatformDurableAgentRun run) { + Utils.checkNotNull(run, "run"); + this.run = run; + return this; + } + + + /** + * Platform-generated request ID for support correlation. + */ + public Builder requestId(String requestId) { + Utils.checkNotNull(requestId, "requestId"); + this.requestId = requestId; + return this; + } + + public PlatformAgentRunResponse build() { + + return new PlatformAgentRunResponse( + run, requestId); + } + + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformAgentRunState.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformAgentRunState.java new file mode 100644 index 00000000..54d704d0 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformAgentRunState.java @@ -0,0 +1,157 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 38e2a6fbf682 + */ +package com.glean.api_client.glean_api_client.models.components; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.lang.Override; +import java.lang.String; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +/** + * Wrapper for an "open" enum that can handle unknown values from API responses + * without runtime errors. Instances are immutable singletons with reference equality. + * Use {@code asEnum()} for switch expressions. + */ +/** + * PlatformAgentRunState + * + *

State of the persisted workflow execution. REQUIRES_INPUT is nonterminal. + */ +public class PlatformAgentRunState { + + public static final PlatformAgentRunState QUEUED = new PlatformAgentRunState("QUEUED"); + public static final PlatformAgentRunState RUNNING = new PlatformAgentRunState("RUNNING"); + public static final PlatformAgentRunState REQUIRES_INPUT = new PlatformAgentRunState("REQUIRES_INPUT"); + public static final PlatformAgentRunState SUCCEEDED = new PlatformAgentRunState("SUCCEEDED"); + public static final PlatformAgentRunState FAILED = new PlatformAgentRunState("FAILED"); + public static final PlatformAgentRunState CANCELLING = new PlatformAgentRunState("CANCELLING"); + public static final PlatformAgentRunState CANCELLED = new PlatformAgentRunState("CANCELLED"); + public static final PlatformAgentRunState EXPIRED = new PlatformAgentRunState("EXPIRED"); + + // This map will grow whenever a Color gets created with a new + // unrecognized value (a potential memory leak if the user is not + // careful). Keep this field lower case to avoid clashing with + // generated member names which will always be upper cased (Java + // convention) + private static final Map values = createValuesMap(); + private static final Map enums = createEnumsMap(); + + private final String value; + + private PlatformAgentRunState(String value) { + this.value = value; + } + + /** + * Returns a PlatformAgentRunState with the given value. For a specific value the + * returned object will always be a singleton so reference equality + * is satisfied when the values are the same. + * + * @param value value to be wrapped as PlatformAgentRunState + */ + @JsonCreator + public static PlatformAgentRunState of(String value) { + synchronized (PlatformAgentRunState.class) { + return values.computeIfAbsent(value, v -> new PlatformAgentRunState(v)); + } + } + + @JsonValue + public String value() { + return value; + } + + public Optional asEnum() { + return Optional.ofNullable(enums.getOrDefault(value, null)); + } + + public boolean isKnown() { + return asEnum().isPresent(); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public boolean equals(java.lang.Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + PlatformAgentRunState other = (PlatformAgentRunState) obj; + return Objects.equals(value, other.value); + } + + @Override + public String toString() { + return "PlatformAgentRunState [value=" + value + "]"; + } + + // return an array just like an enum + public static PlatformAgentRunState[] values() { + synchronized (PlatformAgentRunState.class) { + return values.values().toArray(new PlatformAgentRunState[] {}); + } + } + + private static final Map createValuesMap() { + Map map = new LinkedHashMap<>(); + map.put("QUEUED", QUEUED); + map.put("RUNNING", RUNNING); + map.put("REQUIRES_INPUT", REQUIRES_INPUT); + map.put("SUCCEEDED", SUCCEEDED); + map.put("FAILED", FAILED); + map.put("CANCELLING", CANCELLING); + map.put("CANCELLED", CANCELLED); + map.put("EXPIRED", EXPIRED); + return map; + } + + private static final Map createEnumsMap() { + Map map = new HashMap<>(); + map.put("QUEUED", PlatformAgentRunStateEnum.QUEUED); + map.put("RUNNING", PlatformAgentRunStateEnum.RUNNING); + map.put("REQUIRES_INPUT", PlatformAgentRunStateEnum.REQUIRES_INPUT); + map.put("SUCCEEDED", PlatformAgentRunStateEnum.SUCCEEDED); + map.put("FAILED", PlatformAgentRunStateEnum.FAILED); + map.put("CANCELLING", PlatformAgentRunStateEnum.CANCELLING); + map.put("CANCELLED", PlatformAgentRunStateEnum.CANCELLED); + map.put("EXPIRED", PlatformAgentRunStateEnum.EXPIRED); + return map; + } + + + public enum PlatformAgentRunStateEnum { + + QUEUED("QUEUED"), + RUNNING("RUNNING"), + REQUIRES_INPUT("REQUIRES_INPUT"), + SUCCEEDED("SUCCEEDED"), + FAILED("FAILED"), + CANCELLING("CANCELLING"), + CANCELLED("CANCELLED"), + EXPIRED("EXPIRED"),; + + private final String value; + + private PlatformAgentRunStateEnum(String value) { + this.value = value; + } + + public String value() { + return value; + } + } +} + diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformAgentRunToolApproval.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformAgentRunToolApproval.java new file mode 100644 index 00000000..64845be8 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformAgentRunToolApproval.java @@ -0,0 +1,408 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 86dc21c48b40 + */ +package com.glean.api_client.glean_api_client.models.components; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.time.OffsetDateTime; +import java.util.Map; +import java.util.Optional; + +/** + * PlatformAgentRunToolApproval + * + *

Pending approval for a specific persisted tool invocation and its arguments. + */ +public class PlatformAgentRunToolApproval { + /** + * Identifies this specific invocation approval, not the tool definition. + */ + @JsonProperty("interaction_id") + private String interactionId; + + /** + * Interaction type identifying a tool execution approval request. + */ + @JsonProperty("type") + private PlatformAgentRunToolApprovalType type; + + /** + * Platform tool identifier when recorded. Omitted for requests without one, such as some MCP tools. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("tool_id") + private Optional toolId; + + /** + * Display name of the tool requesting approval. + */ + @JsonProperty("display_name") + private String displayName; + + /** + * Description of the tool associated with this approval request. + */ + @JsonProperty("description") + private String description; + + /** + * Arguments from the persisted approval request. Older platform tools use flattened parameters. + */ + @JsonProperty("arguments") + private Map arguments; + + /** + * Approval deadline, when one is set. Omitted when the approval has no expiration. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("expires_at") + private Optional expiresAt; + + @JsonCreator + public PlatformAgentRunToolApproval( + @JsonProperty("interaction_id") String interactionId, + @JsonProperty("type") PlatformAgentRunToolApprovalType type, + @JsonProperty("tool_id") Optional toolId, + @JsonProperty("display_name") String displayName, + @JsonProperty("description") String description, + @JsonProperty("arguments") Map arguments, + @JsonProperty("expires_at") Optional expiresAt) { + Utils.checkNotNull(interactionId, "interactionId"); + Utils.checkNotNull(type, "type"); + Utils.checkNotNull(toolId, "toolId"); + Utils.checkNotNull(displayName, "displayName"); + Utils.checkNotNull(description, "description"); + arguments = Utils.emptyMapIfNull(arguments); + Utils.checkNotNull(arguments, "arguments"); + Utils.checkNotNull(expiresAt, "expiresAt"); + this.interactionId = interactionId; + this.type = type; + this.toolId = toolId; + this.displayName = displayName; + this.description = description; + this.arguments = arguments; + this.expiresAt = expiresAt; + } + + public PlatformAgentRunToolApproval( + String interactionId, + PlatformAgentRunToolApprovalType type, + String displayName, + String description, + Map arguments) { + this(interactionId, type, Optional.empty(), + displayName, description, arguments, + Optional.empty()); + } + + /** + * Identifies this specific invocation approval, not the tool definition. + */ + @JsonIgnore + public String interactionId() { + return interactionId; + } + + /** + * Interaction type identifying a tool execution approval request. + */ + @JsonIgnore + public PlatformAgentRunToolApprovalType type() { + return type; + } + + /** + * Platform tool identifier when recorded. Omitted for requests without one, such as some MCP tools. + */ + @JsonIgnore + public Optional toolId() { + return toolId; + } + + /** + * Display name of the tool requesting approval. + */ + @JsonIgnore + public String displayName() { + return displayName; + } + + /** + * Description of the tool associated with this approval request. + */ + @JsonIgnore + public String description() { + return description; + } + + /** + * Arguments from the persisted approval request. Older platform tools use flattened parameters. + */ + @JsonIgnore + public Map arguments() { + return arguments; + } + + /** + * Approval deadline, when one is set. Omitted when the approval has no expiration. + */ + @JsonIgnore + public Optional expiresAt() { + return expiresAt; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * Identifies this specific invocation approval, not the tool definition. + */ + public PlatformAgentRunToolApproval withInteractionId(String interactionId) { + Utils.checkNotNull(interactionId, "interactionId"); + this.interactionId = interactionId; + return this; + } + + /** + * Interaction type identifying a tool execution approval request. + */ + public PlatformAgentRunToolApproval withType(PlatformAgentRunToolApprovalType type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + /** + * Platform tool identifier when recorded. Omitted for requests without one, such as some MCP tools. + */ + public PlatformAgentRunToolApproval withToolId(String toolId) { + Utils.checkNotNull(toolId, "toolId"); + this.toolId = Optional.ofNullable(toolId); + return this; + } + + + /** + * Platform tool identifier when recorded. Omitted for requests without one, such as some MCP tools. + */ + public PlatformAgentRunToolApproval withToolId(Optional toolId) { + Utils.checkNotNull(toolId, "toolId"); + this.toolId = toolId; + return this; + } + + /** + * Display name of the tool requesting approval. + */ + public PlatformAgentRunToolApproval withDisplayName(String displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = displayName; + return this; + } + + /** + * Description of the tool associated with this approval request. + */ + public PlatformAgentRunToolApproval withDescription(String description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * Arguments from the persisted approval request. Older platform tools use flattened parameters. + */ + public PlatformAgentRunToolApproval withArguments(Map arguments) { + Utils.checkNotNull(arguments, "arguments"); + this.arguments = arguments; + return this; + } + + /** + * Approval deadline, when one is set. Omitted when the approval has no expiration. + */ + public PlatformAgentRunToolApproval withExpiresAt(OffsetDateTime expiresAt) { + Utils.checkNotNull(expiresAt, "expiresAt"); + this.expiresAt = Optional.ofNullable(expiresAt); + return this; + } + + + /** + * Approval deadline, when one is set. Omitted when the approval has no expiration. + */ + public PlatformAgentRunToolApproval withExpiresAt(Optional expiresAt) { + Utils.checkNotNull(expiresAt, "expiresAt"); + this.expiresAt = expiresAt; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformAgentRunToolApproval other = (PlatformAgentRunToolApproval) o; + return + Utils.enhancedDeepEquals(this.interactionId, other.interactionId) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.toolId, other.toolId) && + Utils.enhancedDeepEquals(this.displayName, other.displayName) && + Utils.enhancedDeepEquals(this.description, other.description) && + Utils.enhancedDeepEquals(this.arguments, other.arguments) && + Utils.enhancedDeepEquals(this.expiresAt, other.expiresAt); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + interactionId, type, toolId, + displayName, description, arguments, + expiresAt); + } + + @Override + public String toString() { + return Utils.toString(PlatformAgentRunToolApproval.class, + "interactionId", interactionId, + "type", type, + "toolId", toolId, + "displayName", displayName, + "description", description, + "arguments", arguments, + "expiresAt", expiresAt); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String interactionId; + + private PlatformAgentRunToolApprovalType type; + + private Optional toolId = Optional.empty(); + + private String displayName; + + private String description; + + private Map arguments; + + private Optional expiresAt = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * Identifies this specific invocation approval, not the tool definition. + */ + public Builder interactionId(String interactionId) { + Utils.checkNotNull(interactionId, "interactionId"); + this.interactionId = interactionId; + return this; + } + + + /** + * Interaction type identifying a tool execution approval request. + */ + public Builder type(PlatformAgentRunToolApprovalType type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + + /** + * Platform tool identifier when recorded. Omitted for requests without one, such as some MCP tools. + */ + public Builder toolId(String toolId) { + Utils.checkNotNull(toolId, "toolId"); + this.toolId = Optional.ofNullable(toolId); + return this; + } + + /** + * Platform tool identifier when recorded. Omitted for requests without one, such as some MCP tools. + */ + public Builder toolId(Optional toolId) { + Utils.checkNotNull(toolId, "toolId"); + this.toolId = toolId; + return this; + } + + + /** + * Display name of the tool requesting approval. + */ + public Builder displayName(String displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = displayName; + return this; + } + + + /** + * Description of the tool associated with this approval request. + */ + public Builder description(String description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + + /** + * Arguments from the persisted approval request. Older platform tools use flattened parameters. + */ + public Builder arguments(Map arguments) { + Utils.checkNotNull(arguments, "arguments"); + this.arguments = arguments; + return this; + } + + + /** + * Approval deadline, when one is set. Omitted when the approval has no expiration. + */ + public Builder expiresAt(OffsetDateTime expiresAt) { + Utils.checkNotNull(expiresAt, "expiresAt"); + this.expiresAt = Optional.ofNullable(expiresAt); + return this; + } + + /** + * Approval deadline, when one is set. Omitted when the approval has no expiration. + */ + public Builder expiresAt(Optional expiresAt) { + Utils.checkNotNull(expiresAt, "expiresAt"); + this.expiresAt = expiresAt; + return this; + } + + public PlatformAgentRunToolApproval build() { + + return new PlatformAgentRunToolApproval( + interactionId, type, toolId, + displayName, description, arguments, + expiresAt); + } + + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformAgentRunToolApprovalType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformAgentRunToolApprovalType.java new file mode 100644 index 00000000..e161a9cd --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformAgentRunToolApprovalType.java @@ -0,0 +1,129 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 6331b78ff935 + */ +package com.glean.api_client.glean_api_client.models.components; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.lang.Override; +import java.lang.String; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +/** + * Wrapper for an "open" enum that can handle unknown values from API responses + * without runtime errors. Instances are immutable singletons with reference equality. + * Use {@code asEnum()} for switch expressions. + */ +/** + * PlatformAgentRunToolApprovalType + * + *

Interaction type identifying a tool execution approval request. + */ +public class PlatformAgentRunToolApprovalType { + + public static final PlatformAgentRunToolApprovalType TOOL_APPROVAL = new PlatformAgentRunToolApprovalType("TOOL_APPROVAL"); + + // This map will grow whenever a Color gets created with a new + // unrecognized value (a potential memory leak if the user is not + // careful). Keep this field lower case to avoid clashing with + // generated member names which will always be upper cased (Java + // convention) + private static final Map values = createValuesMap(); + private static final Map enums = createEnumsMap(); + + private final String value; + + private PlatformAgentRunToolApprovalType(String value) { + this.value = value; + } + + /** + * Returns a PlatformAgentRunToolApprovalType with the given value. For a specific value the + * returned object will always be a singleton so reference equality + * is satisfied when the values are the same. + * + * @param value value to be wrapped as PlatformAgentRunToolApprovalType + */ + @JsonCreator + public static PlatformAgentRunToolApprovalType of(String value) { + synchronized (PlatformAgentRunToolApprovalType.class) { + return values.computeIfAbsent(value, v -> new PlatformAgentRunToolApprovalType(v)); + } + } + + @JsonValue + public String value() { + return value; + } + + public Optional asEnum() { + return Optional.ofNullable(enums.getOrDefault(value, null)); + } + + public boolean isKnown() { + return asEnum().isPresent(); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public boolean equals(java.lang.Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + PlatformAgentRunToolApprovalType other = (PlatformAgentRunToolApprovalType) obj; + return Objects.equals(value, other.value); + } + + @Override + public String toString() { + return "PlatformAgentRunToolApprovalType [value=" + value + "]"; + } + + // return an array just like an enum + public static PlatformAgentRunToolApprovalType[] values() { + synchronized (PlatformAgentRunToolApprovalType.class) { + return values.values().toArray(new PlatformAgentRunToolApprovalType[] {}); + } + } + + private static final Map createValuesMap() { + Map map = new LinkedHashMap<>(); + map.put("TOOL_APPROVAL", TOOL_APPROVAL); + return map; + } + + private static final Map createEnumsMap() { + Map map = new HashMap<>(); + map.put("TOOL_APPROVAL", PlatformAgentRunToolApprovalTypeEnum.TOOL_APPROVAL); + return map; + } + + + public enum PlatformAgentRunToolApprovalTypeEnum { + + TOOL_APPROVAL("TOOL_APPROVAL"),; + + private final String value; + + private PlatformAgentRunToolApprovalTypeEnum(String value) { + this.value = value; + } + + public String value() { + return value; + } + } +} + diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformChatJsonSchemaFormat.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformChatJsonSchemaFormat.java new file mode 100644 index 00000000..79c8123b --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformChatJsonSchemaFormat.java @@ -0,0 +1,340 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 997af7f13051 + */ +package com.glean.api_client.glean_api_client.models.components; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.utils.LazySingletonValue; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.lang.Boolean; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import java.util.Optional; + +/** + * PlatformChatJsonSchemaFormat + * + *

Constrains the assistant response to a caller-supplied JSON Schema. + */ +public class PlatformChatJsonSchemaFormat { + /** + * Discriminator. Must be JSON_SCHEMA. + */ + @JsonProperty("type") + private PlatformChatJsonSchemaFormatType type; + + /** + * A stable identifier for the schema. + */ + @JsonProperty("name") + private String name; + + /** + * An optional human-readable description of the schema. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("description") + private Optional description; + + /** + * A JSON Schema object describing the desired output shape. + */ + @JsonProperty("schema") + private Map schema; + + /** + * When true, the provider validates the response against the schema. Unsupported by some providers; + * defaults to true. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("strict") + private Optional strict; + + @JsonCreator + public PlatformChatJsonSchemaFormat( + @JsonProperty("type") PlatformChatJsonSchemaFormatType type, + @JsonProperty("name") String name, + @JsonProperty("description") Optional description, + @JsonProperty("schema") Map schema, + @JsonProperty("strict") Optional strict) { + Utils.checkNotNull(type, "type"); + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(description, "description"); + schema = Utils.emptyMapIfNull(schema); + Utils.checkNotNull(schema, "schema"); + Utils.checkNotNull(strict, "strict"); + this.type = type; + this.name = name; + this.description = description; + this.schema = schema; + this.strict = strict; + } + + public PlatformChatJsonSchemaFormat( + PlatformChatJsonSchemaFormatType type, + String name, + Map schema) { + this(type, name, Optional.empty(), + schema, Optional.empty()); + } + + /** + * Discriminator. Must be JSON_SCHEMA. + */ + @JsonIgnore + public PlatformChatJsonSchemaFormatType type() { + return type; + } + + /** + * A stable identifier for the schema. + */ + @JsonIgnore + public String name() { + return name; + } + + /** + * An optional human-readable description of the schema. + */ + @JsonIgnore + public Optional description() { + return description; + } + + /** + * A JSON Schema object describing the desired output shape. + */ + @JsonIgnore + public Map schema() { + return schema; + } + + /** + * When true, the provider validates the response against the schema. Unsupported by some providers; + * defaults to true. + */ + @JsonIgnore + public Optional strict() { + return strict; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * Discriminator. Must be JSON_SCHEMA. + */ + public PlatformChatJsonSchemaFormat withType(PlatformChatJsonSchemaFormatType type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + /** + * A stable identifier for the schema. + */ + public PlatformChatJsonSchemaFormat withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * An optional human-readable description of the schema. + */ + public PlatformChatJsonSchemaFormat withDescription(String description) { + Utils.checkNotNull(description, "description"); + this.description = Optional.ofNullable(description); + return this; + } + + + /** + * An optional human-readable description of the schema. + */ + public PlatformChatJsonSchemaFormat withDescription(Optional description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * A JSON Schema object describing the desired output shape. + */ + public PlatformChatJsonSchemaFormat withSchema(Map schema) { + Utils.checkNotNull(schema, "schema"); + this.schema = schema; + return this; + } + + /** + * When true, the provider validates the response against the schema. Unsupported by some providers; + * defaults to true. + */ + public PlatformChatJsonSchemaFormat withStrict(boolean strict) { + Utils.checkNotNull(strict, "strict"); + this.strict = Optional.ofNullable(strict); + return this; + } + + + /** + * When true, the provider validates the response against the schema. Unsupported by some providers; + * defaults to true. + */ + public PlatformChatJsonSchemaFormat withStrict(Optional strict) { + Utils.checkNotNull(strict, "strict"); + this.strict = strict; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformChatJsonSchemaFormat other = (PlatformChatJsonSchemaFormat) o; + return + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.description, other.description) && + Utils.enhancedDeepEquals(this.schema, other.schema) && + Utils.enhancedDeepEquals(this.strict, other.strict); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + type, name, description, + schema, strict); + } + + @Override + public String toString() { + return Utils.toString(PlatformChatJsonSchemaFormat.class, + "type", type, + "name", name, + "description", description, + "schema", schema, + "strict", strict); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private PlatformChatJsonSchemaFormatType type; + + private String name; + + private Optional description = Optional.empty(); + + private Map schema; + + private Optional strict; + + private Builder() { + // force use of static builder() method + } + + + /** + * Discriminator. Must be JSON_SCHEMA. + */ + public Builder type(PlatformChatJsonSchemaFormatType type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + + /** + * A stable identifier for the schema. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + + /** + * An optional human-readable description of the schema. + */ + public Builder description(String description) { + Utils.checkNotNull(description, "description"); + this.description = Optional.ofNullable(description); + return this; + } + + /** + * An optional human-readable description of the schema. + */ + public Builder description(Optional description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + + /** + * A JSON Schema object describing the desired output shape. + */ + public Builder schema(Map schema) { + Utils.checkNotNull(schema, "schema"); + this.schema = schema; + return this; + } + + + /** + * When true, the provider validates the response against the schema. Unsupported by some providers; + * defaults to true. + */ + public Builder strict(boolean strict) { + Utils.checkNotNull(strict, "strict"); + this.strict = Optional.ofNullable(strict); + return this; + } + + /** + * When true, the provider validates the response against the schema. Unsupported by some providers; + * defaults to true. + */ + public Builder strict(Optional strict) { + Utils.checkNotNull(strict, "strict"); + this.strict = strict; + return this; + } + + public PlatformChatJsonSchemaFormat build() { + if (strict == null) { + strict = _SINGLETON_VALUE_Strict.value(); + } + + return new PlatformChatJsonSchemaFormat( + type, name, description, + schema, strict); + } + + + private static final LazySingletonValue> _SINGLETON_VALUE_Strict = + new LazySingletonValue<>( + "strict", + "true", + new TypeReference>() {}); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformChatJsonSchemaFormatType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformChatJsonSchemaFormatType.java new file mode 100644 index 00000000..25aa7970 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformChatJsonSchemaFormatType.java @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: f039aaef0596 + */ +package com.glean.api_client.glean_api_client.models.components; + +import com.fasterxml.jackson.annotation.JsonValue; +import java.lang.String; +import java.util.Objects; +import java.util.Optional; + +/** + * PlatformChatJsonSchemaFormatType + * + *

Discriminator. Must be JSON_SCHEMA. + */ +public enum PlatformChatJsonSchemaFormatType { + JSON_SCHEMA("JSON_SCHEMA"); + + @JsonValue + private final String value; + + PlatformChatJsonSchemaFormatType(String value) { + this.value = value; + } + + public String value() { + return value; + } + + public static Optional fromValue(String value) { + for (PlatformChatJsonSchemaFormatType o: PlatformChatJsonSchemaFormatType.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } +} + diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformChatOutputTextContent.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformChatOutputTextContent.java index 2a634a45..b42476a3 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformChatOutputTextContent.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformChatOutputTextContent.java @@ -15,6 +15,7 @@ import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; public class PlatformChatOutputTextContent { @@ -26,6 +27,14 @@ public class PlatformChatOutputTextContent { @JsonProperty("text") private String text; + /** + * Parsed and validated JSON object when structured output was requested. Present only when the request + * included `text.format.type: JSON_SCHEMA`. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("structured_output") + private JsonNullable structuredOutput; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("annotations") @@ -35,19 +44,23 @@ public class PlatformChatOutputTextContent { public PlatformChatOutputTextContent( @JsonProperty("type") PlatformChatOutputTextContentType type, @JsonProperty("text") String text, + @JsonProperty("structured_output") JsonNullable structuredOutput, @JsonProperty("annotations") Optional> annotations) { Utils.checkNotNull(type, "type"); Utils.checkNotNull(text, "text"); + Utils.checkNotNull(structuredOutput, "structuredOutput"); Utils.checkNotNull(annotations, "annotations"); this.type = type; this.text = text; + this.structuredOutput = structuredOutput; this.annotations = annotations; } public PlatformChatOutputTextContent( PlatformChatOutputTextContentType type, String text) { - this(type, text, Optional.empty()); + this(type, text, JsonNullable.undefined(), + Optional.empty()); } @JsonIgnore @@ -60,6 +73,16 @@ public String text() { return text; } + /** + * Parsed and validated JSON object when structured output was requested. Present only when the request + * included `text.format.type: JSON_SCHEMA`. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable structuredOutput() { + return (JsonNullable) structuredOutput; + } + @SuppressWarnings("unchecked") @JsonIgnore public Optional> annotations() { @@ -83,6 +106,26 @@ public PlatformChatOutputTextContent withText(String text) { return this; } + /** + * Parsed and validated JSON object when structured output was requested. Present only when the request + * included `text.format.type: JSON_SCHEMA`. + */ + public PlatformChatOutputTextContent withStructuredOutput(StructuredOutput structuredOutput) { + Utils.checkNotNull(structuredOutput, "structuredOutput"); + this.structuredOutput = JsonNullable.of(structuredOutput); + return this; + } + + /** + * Parsed and validated JSON object when structured output was requested. Present only when the request + * included `text.format.type: JSON_SCHEMA`. + */ + public PlatformChatOutputTextContent withStructuredOutput(JsonNullable structuredOutput) { + Utils.checkNotNull(structuredOutput, "structuredOutput"); + this.structuredOutput = structuredOutput; + return this; + } + public PlatformChatOutputTextContent withAnnotations(List annotations) { Utils.checkNotNull(annotations, "annotations"); this.annotations = Optional.ofNullable(annotations); @@ -108,13 +151,15 @@ public boolean equals(java.lang.Object o) { return Utils.enhancedDeepEquals(this.type, other.type) && Utils.enhancedDeepEquals(this.text, other.text) && + Utils.enhancedDeepEquals(this.structuredOutput, other.structuredOutput) && Utils.enhancedDeepEquals(this.annotations, other.annotations); } @Override public int hashCode() { return Utils.enhancedHash( - type, text, annotations); + type, text, structuredOutput, + annotations); } @Override @@ -122,6 +167,7 @@ public String toString() { return Utils.toString(PlatformChatOutputTextContent.class, "type", type, "text", text, + "structuredOutput", structuredOutput, "annotations", annotations); } @@ -132,6 +178,8 @@ public final static class Builder { private String text; + private JsonNullable structuredOutput = JsonNullable.undefined(); + private Optional> annotations = Optional.empty(); private Builder() { @@ -153,6 +201,27 @@ public Builder text(String text) { } + /** + * Parsed and validated JSON object when structured output was requested. Present only when the request + * included `text.format.type: JSON_SCHEMA`. + */ + public Builder structuredOutput(StructuredOutput structuredOutput) { + Utils.checkNotNull(structuredOutput, "structuredOutput"); + this.structuredOutput = JsonNullable.of(structuredOutput); + return this; + } + + /** + * Parsed and validated JSON object when structured output was requested. Present only when the request + * included `text.format.type: JSON_SCHEMA`. + */ + public Builder structuredOutput(JsonNullable structuredOutput) { + Utils.checkNotNull(structuredOutput, "structuredOutput"); + this.structuredOutput = structuredOutput; + return this; + } + + public Builder annotations(List annotations) { Utils.checkNotNull(annotations, "annotations"); this.annotations = Optional.ofNullable(annotations); @@ -168,7 +237,8 @@ public Builder annotations(OptionalUnconstrained plain-text assistant output. + */ +public class PlatformChatTextFormat { + /** + * Discriminator. Must be TEXT. + */ + @JsonProperty("type") + private PlatformChatTextFormatType type; + + @JsonCreator + public PlatformChatTextFormat( + @JsonProperty("type") PlatformChatTextFormatType type) { + Utils.checkNotNull(type, "type"); + this.type = type; + } + + /** + * Discriminator. Must be TEXT. + */ + @JsonIgnore + public PlatformChatTextFormatType type() { + return type; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * Discriminator. Must be TEXT. + */ + public PlatformChatTextFormat withType(PlatformChatTextFormatType type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformChatTextFormat other = (PlatformChatTextFormat) o; + return + Utils.enhancedDeepEquals(this.type, other.type); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + type); + } + + @Override + public String toString() { + return Utils.toString(PlatformChatTextFormat.class, + "type", type); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private PlatformChatTextFormatType type; + + private Builder() { + // force use of static builder() method + } + + + /** + * Discriminator. Must be TEXT. + */ + public Builder type(PlatformChatTextFormatType type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public PlatformChatTextFormat build() { + + return new PlatformChatTextFormat( + type); + } + + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformChatTextFormatType.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformChatTextFormatType.java new file mode 100644 index 00000000..2e80698e --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformChatTextFormatType.java @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 087c3185f5d6 + */ +package com.glean.api_client.glean_api_client.models.components; + +import com.fasterxml.jackson.annotation.JsonValue; +import java.lang.String; +import java.util.Objects; +import java.util.Optional; + +/** + * PlatformChatTextFormatType + * + *

Discriminator. Must be TEXT. + */ +public enum PlatformChatTextFormatType { + TEXT("TEXT"); + + @JsonValue + private final String value; + + PlatformChatTextFormatType(String value) { + this.value = value; + } + + public String value() { + return value; + } + + public static Optional fromValue(String value) { + for (PlatformChatTextFormatType o: PlatformChatTextFormatType.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } +} + diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformDurableAgentRun.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformDurableAgentRun.java new file mode 100644 index 00000000..75e5eb1b --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/PlatformDurableAgentRun.java @@ -0,0 +1,516 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 57d40099c909 + */ +package com.glean.api_client.glean_api_client.models.components; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +/** + * PlatformDurableAgentRun + * + *

Agent run state, pending tool approvals, and output available independently of the creation request. + */ +public class PlatformDurableAgentRun { + /** + * ID of the run, preserved across approval continuations. + */ + @JsonProperty("run_id") + private String runId; + + /** + * ID of the agent that owns the run. + */ + @JsonProperty("agent_id") + private String agentId; + + /** + * State of the persisted workflow execution. REQUIRES_INPUT is nonterminal. + */ + @JsonProperty("state") + private PlatformAgentRunState state; + + /** + * Timestamp when the run was first persisted. + */ + @JsonProperty("created_at") + private OffsetDateTime createdAt; + + /** + * Latest persisted activity timestamp across the execution and its messages, including checkpoint + * messages. This is not a worker heartbeat or an exact state-transition timestamp. + */ + @JsonProperty("updated_at") + private OffsetDateTime updatedAt; + + /** + * Execution deadline, when one is set. Not the run history retention deadline. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("expires_at") + private Optional expiresAt; + + /** + * Unanswered tool approvals when the run is in REQUIRES_INPUT. Empty in other states. + */ + @JsonProperty("pending_interactions") + private List pendingInteractions; + + /** + * Accumulated text-only agent output under the messages key, when available. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("output") + private Optional> output; + + /** + * Caller-safe details of an agent run execution failure. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("error") + private Optional error; + + @JsonCreator + public PlatformDurableAgentRun( + @JsonProperty("run_id") String runId, + @JsonProperty("agent_id") String agentId, + @JsonProperty("state") PlatformAgentRunState state, + @JsonProperty("created_at") OffsetDateTime createdAt, + @JsonProperty("updated_at") OffsetDateTime updatedAt, + @JsonProperty("expires_at") Optional expiresAt, + @JsonProperty("pending_interactions") List pendingInteractions, + @JsonProperty("output") Optional> output, + @JsonProperty("error") Optional error) { + Utils.checkNotNull(runId, "runId"); + Utils.checkNotNull(agentId, "agentId"); + Utils.checkNotNull(state, "state"); + Utils.checkNotNull(createdAt, "createdAt"); + Utils.checkNotNull(updatedAt, "updatedAt"); + Utils.checkNotNull(expiresAt, "expiresAt"); + Utils.checkNotNull(pendingInteractions, "pendingInteractions"); + Utils.checkNotNull(output, "output"); + Utils.checkNotNull(error, "error"); + this.runId = runId; + this.agentId = agentId; + this.state = state; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.expiresAt = expiresAt; + this.pendingInteractions = pendingInteractions; + this.output = output; + this.error = error; + } + + public PlatformDurableAgentRun( + String runId, + String agentId, + PlatformAgentRunState state, + OffsetDateTime createdAt, + OffsetDateTime updatedAt, + List pendingInteractions) { + this(runId, agentId, state, + createdAt, updatedAt, Optional.empty(), + pendingInteractions, Optional.empty(), Optional.empty()); + } + + /** + * ID of the run, preserved across approval continuations. + */ + @JsonIgnore + public String runId() { + return runId; + } + + /** + * ID of the agent that owns the run. + */ + @JsonIgnore + public String agentId() { + return agentId; + } + + /** + * State of the persisted workflow execution. REQUIRES_INPUT is nonterminal. + */ + @JsonIgnore + public PlatformAgentRunState state() { + return state; + } + + /** + * Timestamp when the run was first persisted. + */ + @JsonIgnore + public OffsetDateTime createdAt() { + return createdAt; + } + + /** + * Latest persisted activity timestamp across the execution and its messages, including checkpoint + * messages. This is not a worker heartbeat or an exact state-transition timestamp. + */ + @JsonIgnore + public OffsetDateTime updatedAt() { + return updatedAt; + } + + /** + * Execution deadline, when one is set. Not the run history retention deadline. + */ + @JsonIgnore + public Optional expiresAt() { + return expiresAt; + } + + /** + * Unanswered tool approvals when the run is in REQUIRES_INPUT. Empty in other states. + */ + @JsonIgnore + public List pendingInteractions() { + return pendingInteractions; + } + + /** + * Accumulated text-only agent output under the messages key, when available. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> output() { + return (Optional>) output; + } + + /** + * Caller-safe details of an agent run execution failure. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional error() { + return (Optional) error; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * ID of the run, preserved across approval continuations. + */ + public PlatformDurableAgentRun withRunId(String runId) { + Utils.checkNotNull(runId, "runId"); + this.runId = runId; + return this; + } + + /** + * ID of the agent that owns the run. + */ + public PlatformDurableAgentRun withAgentId(String agentId) { + Utils.checkNotNull(agentId, "agentId"); + this.agentId = agentId; + return this; + } + + /** + * State of the persisted workflow execution. REQUIRES_INPUT is nonterminal. + */ + public PlatformDurableAgentRun withState(PlatformAgentRunState state) { + Utils.checkNotNull(state, "state"); + this.state = state; + return this; + } + + /** + * Timestamp when the run was first persisted. + */ + public PlatformDurableAgentRun withCreatedAt(OffsetDateTime createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * Latest persisted activity timestamp across the execution and its messages, including checkpoint + * messages. This is not a worker heartbeat or an exact state-transition timestamp. + */ + public PlatformDurableAgentRun withUpdatedAt(OffsetDateTime updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + /** + * Execution deadline, when one is set. Not the run history retention deadline. + */ + public PlatformDurableAgentRun withExpiresAt(OffsetDateTime expiresAt) { + Utils.checkNotNull(expiresAt, "expiresAt"); + this.expiresAt = Optional.ofNullable(expiresAt); + return this; + } + + + /** + * Execution deadline, when one is set. Not the run history retention deadline. + */ + public PlatformDurableAgentRun withExpiresAt(Optional expiresAt) { + Utils.checkNotNull(expiresAt, "expiresAt"); + this.expiresAt = expiresAt; + return this; + } + + /** + * Unanswered tool approvals when the run is in REQUIRES_INPUT. Empty in other states. + */ + public PlatformDurableAgentRun withPendingInteractions(List pendingInteractions) { + Utils.checkNotNull(pendingInteractions, "pendingInteractions"); + this.pendingInteractions = pendingInteractions; + return this; + } + + /** + * Accumulated text-only agent output under the messages key, when available. + */ + public PlatformDurableAgentRun withOutput(Map output) { + Utils.checkNotNull(output, "output"); + this.output = Optional.ofNullable(output); + return this; + } + + + /** + * Accumulated text-only agent output under the messages key, when available. + */ + public PlatformDurableAgentRun withOutput(Optional> output) { + Utils.checkNotNull(output, "output"); + this.output = output; + return this; + } + + /** + * Caller-safe details of an agent run execution failure. + */ + public PlatformDurableAgentRun withError(PlatformAgentRunError error) { + Utils.checkNotNull(error, "error"); + this.error = Optional.ofNullable(error); + return this; + } + + + /** + * Caller-safe details of an agent run execution failure. + */ + public PlatformDurableAgentRun withError(Optional error) { + Utils.checkNotNull(error, "error"); + this.error = error; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformDurableAgentRun other = (PlatformDurableAgentRun) o; + return + Utils.enhancedDeepEquals(this.runId, other.runId) && + Utils.enhancedDeepEquals(this.agentId, other.agentId) && + Utils.enhancedDeepEquals(this.state, other.state) && + Utils.enhancedDeepEquals(this.createdAt, other.createdAt) && + Utils.enhancedDeepEquals(this.updatedAt, other.updatedAt) && + Utils.enhancedDeepEquals(this.expiresAt, other.expiresAt) && + Utils.enhancedDeepEquals(this.pendingInteractions, other.pendingInteractions) && + Utils.enhancedDeepEquals(this.output, other.output) && + Utils.enhancedDeepEquals(this.error, other.error); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + runId, agentId, state, + createdAt, updatedAt, expiresAt, + pendingInteractions, output, error); + } + + @Override + public String toString() { + return Utils.toString(PlatformDurableAgentRun.class, + "runId", runId, + "agentId", agentId, + "state", state, + "createdAt", createdAt, + "updatedAt", updatedAt, + "expiresAt", expiresAt, + "pendingInteractions", pendingInteractions, + "output", output, + "error", error); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String runId; + + private String agentId; + + private PlatformAgentRunState state; + + private OffsetDateTime createdAt; + + private OffsetDateTime updatedAt; + + private Optional expiresAt = Optional.empty(); + + private List pendingInteractions; + + private Optional> output = Optional.empty(); + + private Optional error = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * ID of the run, preserved across approval continuations. + */ + public Builder runId(String runId) { + Utils.checkNotNull(runId, "runId"); + this.runId = runId; + return this; + } + + + /** + * ID of the agent that owns the run. + */ + public Builder agentId(String agentId) { + Utils.checkNotNull(agentId, "agentId"); + this.agentId = agentId; + return this; + } + + + /** + * State of the persisted workflow execution. REQUIRES_INPUT is nonterminal. + */ + public Builder state(PlatformAgentRunState state) { + Utils.checkNotNull(state, "state"); + this.state = state; + return this; + } + + + /** + * Timestamp when the run was first persisted. + */ + public Builder createdAt(OffsetDateTime createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + + /** + * Latest persisted activity timestamp across the execution and its messages, including checkpoint + * messages. This is not a worker heartbeat or an exact state-transition timestamp. + */ + public Builder updatedAt(OffsetDateTime updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + + /** + * Execution deadline, when one is set. Not the run history retention deadline. + */ + public Builder expiresAt(OffsetDateTime expiresAt) { + Utils.checkNotNull(expiresAt, "expiresAt"); + this.expiresAt = Optional.ofNullable(expiresAt); + return this; + } + + /** + * Execution deadline, when one is set. Not the run history retention deadline. + */ + public Builder expiresAt(Optional expiresAt) { + Utils.checkNotNull(expiresAt, "expiresAt"); + this.expiresAt = expiresAt; + return this; + } + + + /** + * Unanswered tool approvals when the run is in REQUIRES_INPUT. Empty in other states. + */ + public Builder pendingInteractions(List pendingInteractions) { + Utils.checkNotNull(pendingInteractions, "pendingInteractions"); + this.pendingInteractions = pendingInteractions; + return this; + } + + + /** + * Accumulated text-only agent output under the messages key, when available. + */ + public Builder output(Map output) { + Utils.checkNotNull(output, "output"); + this.output = Optional.ofNullable(output); + return this; + } + + /** + * Accumulated text-only agent output under the messages key, when available. + */ + public Builder output(Optional> output) { + Utils.checkNotNull(output, "output"); + this.output = output; + return this; + } + + + /** + * Caller-safe details of an agent run execution failure. + */ + public Builder error(PlatformAgentRunError error) { + Utils.checkNotNull(error, "error"); + this.error = Optional.ofNullable(error); + return this; + } + + /** + * Caller-safe details of an agent run execution failure. + */ + public Builder error(Optional error) { + Utils.checkNotNull(error, "error"); + this.error = error; + return this; + } + + public PlatformDurableAgentRun build() { + + return new PlatformDurableAgentRun( + runId, agentId, state, + createdAt, updatedAt, expiresAt, + pendingInteractions, output, error); + } + + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/components/StructuredOutput.java b/src/main/java/com/glean/api_client/glean_api_client/models/components/StructuredOutput.java new file mode 100644 index 00000000..4615d0df --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/models/components/StructuredOutput.java @@ -0,0 +1,64 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: e550fa39395c + */ +package com.glean.api_client.glean_api_client.models.components; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.lang.Override; +import java.lang.String; + +/** + * StructuredOutput + * + *

Parsed and validated JSON object when structured output was requested. Present only when the request + * included `text.format.type: JSON_SCHEMA`. + */ +public class StructuredOutput { + @JsonCreator + public StructuredOutput() { + } + + public static Builder builder() { + return new Builder(); + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + ); + } + + @Override + public String toString() { + return Utils.toString(StructuredOutput.class); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Builder() { + // force use of static builder() method + } + + public StructuredOutput build() { + + return new StructuredOutput( + ); + } + + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformAgentsCreateRunResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformAgentsCreateRunResponse.java index ab23ff5a..7f95b732 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformAgentsCreateRunResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformAgentsCreateRunResponse.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.glean.api_client.glean_api_client.models.components.PlatformAgentRunResponse; import com.glean.api_client.glean_api_client.models.components.PlatformAgentRunWaitResponse; import com.glean.api_client.glean_api_client.utils.Response; import com.glean.api_client.glean_api_client.utils.Utils; @@ -44,23 +45,32 @@ public class PlatformAgentsCreateRunResponse implements Response { */ private Optional res; + /** + * Durable run persisted and started. The snapshot is immediately retrievable through GET + * /api/agents/{agent_id}/runs/{run_id}. Execution failures appear in the run state. + */ + private Optional platformAgentRunResponse; + @JsonCreator public PlatformAgentsCreateRunResponse( String contentType, int statusCode, HttpResponse rawResponse, Optional platformAgentRunWaitResponse, - Optional res) { + Optional res, + Optional platformAgentRunResponse) { Utils.checkNotNull(contentType, "contentType"); Utils.checkNotNull(statusCode, "statusCode"); Utils.checkNotNull(rawResponse, "rawResponse"); Utils.checkNotNull(platformAgentRunWaitResponse, "platformAgentRunWaitResponse"); Utils.checkNotNull(res, "res"); + Utils.checkNotNull(platformAgentRunResponse, "platformAgentRunResponse"); this.contentType = contentType; this.statusCode = statusCode; this.rawResponse = rawResponse; this.platformAgentRunWaitResponse = platformAgentRunWaitResponse; this.res = res; + this.platformAgentRunResponse = platformAgentRunResponse; } public PlatformAgentsCreateRunResponse( @@ -68,7 +78,7 @@ public PlatformAgentsCreateRunResponse( int statusCode, HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + Optional.empty(), Optional.empty(), Optional.empty()); } /** @@ -112,6 +122,16 @@ public Optional res() { return res; } + /** + * Durable run persisted and started. The snapshot is immediately retrievable through GET + * /api/agents/{agent_id}/runs/{run_id}. Execution failures appear in the run state. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional platformAgentRunResponse() { + return (Optional) platformAgentRunResponse; + } + public static Builder builder() { return new Builder(); } @@ -182,6 +202,27 @@ public PlatformAgentsCreateRunResponse withRes(Optional res) { return this; } + /** + * Durable run persisted and started. The snapshot is immediately retrievable through GET + * /api/agents/{agent_id}/runs/{run_id}. Execution failures appear in the run state. + */ + public PlatformAgentsCreateRunResponse withPlatformAgentRunResponse(PlatformAgentRunResponse platformAgentRunResponse) { + Utils.checkNotNull(platformAgentRunResponse, "platformAgentRunResponse"); + this.platformAgentRunResponse = Optional.ofNullable(platformAgentRunResponse); + return this; + } + + + /** + * Durable run persisted and started. The snapshot is immediately retrievable through GET + * /api/agents/{agent_id}/runs/{run_id}. Execution failures appear in the run state. + */ + public PlatformAgentsCreateRunResponse withPlatformAgentRunResponse(Optional platformAgentRunResponse) { + Utils.checkNotNull(platformAgentRunResponse, "platformAgentRunResponse"); + this.platformAgentRunResponse = platformAgentRunResponse; + return this; + } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -196,14 +237,15 @@ public boolean equals(java.lang.Object o) { Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && Utils.enhancedDeepEquals(this.platformAgentRunWaitResponse, other.platformAgentRunWaitResponse) && - Utils.enhancedDeepEquals(this.res, other.res); + Utils.enhancedDeepEquals(this.res, other.res) && + Utils.enhancedDeepEquals(this.platformAgentRunResponse, other.platformAgentRunResponse); } @Override public int hashCode() { return Utils.enhancedHash( contentType, statusCode, rawResponse, - platformAgentRunWaitResponse, res); + platformAgentRunWaitResponse, res, platformAgentRunResponse); } @Override @@ -213,7 +255,8 @@ public String toString() { "statusCode", statusCode, "rawResponse", rawResponse, "platformAgentRunWaitResponse", platformAgentRunWaitResponse, - "res", res); + "res", res, + "platformAgentRunResponse", platformAgentRunResponse); } @SuppressWarnings("UnusedReturnValue") @@ -229,6 +272,8 @@ public final static class Builder { private Optional res = Optional.empty(); + private Optional platformAgentRunResponse = Optional.empty(); + private Builder() { // force use of static builder() method } @@ -301,11 +346,32 @@ public Builder res(Optional res) { return this; } + + /** + * Durable run persisted and started. The snapshot is immediately retrievable through GET + * /api/agents/{agent_id}/runs/{run_id}. Execution failures appear in the run state. + */ + public Builder platformAgentRunResponse(PlatformAgentRunResponse platformAgentRunResponse) { + Utils.checkNotNull(platformAgentRunResponse, "platformAgentRunResponse"); + this.platformAgentRunResponse = Optional.ofNullable(platformAgentRunResponse); + return this; + } + + /** + * Durable run persisted and started. The snapshot is immediately retrievable through GET + * /api/agents/{agent_id}/runs/{run_id}. Execution failures appear in the run state. + */ + public Builder platformAgentRunResponse(Optional platformAgentRunResponse) { + Utils.checkNotNull(platformAgentRunResponse, "platformAgentRunResponse"); + this.platformAgentRunResponse = platformAgentRunResponse; + return this; + } + public PlatformAgentsCreateRunResponse build() { return new PlatformAgentsCreateRunResponse( contentType, statusCode, rawResponse, - platformAgentRunWaitResponse, res); + platformAgentRunWaitResponse, res, platformAgentRunResponse); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformAgentsGetRunRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformAgentsGetRunRequest.java new file mode 100644 index 00000000..272a67c1 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformAgentsGetRunRequest.java @@ -0,0 +1,142 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: d27cc187d9b9 + */ +package com.glean.api_client.glean_api_client.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.glean.api_client.glean_api_client.utils.SpeakeasyMetadata; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.lang.Override; +import java.lang.String; + + +public class PlatformAgentsGetRunRequest { + /** + * ID of the agent that owns the run. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=agent_id") + private String agentId; + + /** + * ID of the durable run to retrieve. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=run_id") + private String runId; + + @JsonCreator + public PlatformAgentsGetRunRequest( + String agentId, + String runId) { + Utils.checkNotNull(agentId, "agentId"); + Utils.checkNotNull(runId, "runId"); + this.agentId = agentId; + this.runId = runId; + } + + /** + * ID of the agent that owns the run. + */ + @JsonIgnore + public String agentId() { + return agentId; + } + + /** + * ID of the durable run to retrieve. + */ + @JsonIgnore + public String runId() { + return runId; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * ID of the agent that owns the run. + */ + public PlatformAgentsGetRunRequest withAgentId(String agentId) { + Utils.checkNotNull(agentId, "agentId"); + this.agentId = agentId; + return this; + } + + /** + * ID of the durable run to retrieve. + */ + public PlatformAgentsGetRunRequest withRunId(String runId) { + Utils.checkNotNull(runId, "runId"); + this.runId = runId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformAgentsGetRunRequest other = (PlatformAgentsGetRunRequest) o; + return + Utils.enhancedDeepEquals(this.agentId, other.agentId) && + Utils.enhancedDeepEquals(this.runId, other.runId); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + agentId, runId); + } + + @Override + public String toString() { + return Utils.toString(PlatformAgentsGetRunRequest.class, + "agentId", agentId, + "runId", runId); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String agentId; + + private String runId; + + private Builder() { + // force use of static builder() method + } + + + /** + * ID of the agent that owns the run. + */ + public Builder agentId(String agentId) { + Utils.checkNotNull(agentId, "agentId"); + this.agentId = agentId; + return this; + } + + + /** + * ID of the durable run to retrieve. + */ + public Builder runId(String runId) { + Utils.checkNotNull(runId, "runId"); + this.runId = runId; + return this; + } + + public PlatformAgentsGetRunRequest build() { + + return new PlatformAgentsGetRunRequest( + agentId, runId); + } + + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformAgentsGetRunRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformAgentsGetRunRequestBuilder.java new file mode 100644 index 00000000..1aacf04e --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformAgentsGetRunRequestBuilder.java @@ -0,0 +1,55 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 21d281006552 + */ +package com.glean.api_client.glean_api_client.models.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.operations.PlatformAgentsGetRun; +import com.glean.api_client.glean_api_client.utils.Headers; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.lang.String; + +public class PlatformAgentsGetRunRequestBuilder { + + private String agentId; + private String runId; + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public PlatformAgentsGetRunRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public PlatformAgentsGetRunRequestBuilder agentId(String agentId) { + Utils.checkNotNull(agentId, "agentId"); + this.agentId = agentId; + return this; + } + + public PlatformAgentsGetRunRequestBuilder runId(String runId) { + Utils.checkNotNull(runId, "runId"); + this.runId = runId; + return this; + } + + + private PlatformAgentsGetRunRequest buildRequest() { + + PlatformAgentsGetRunRequest request = new PlatformAgentsGetRunRequest(agentId, + runId); + + return request; + } + + public PlatformAgentsGetRunResponse call() { + + RequestOperation operation + = new PlatformAgentsGetRun.Sync(sdkConfiguration, _headers); + PlatformAgentsGetRunRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformAgentsGetRunResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformAgentsGetRunResponse.java new file mode 100644 index 00000000..a0597861 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformAgentsGetRunResponse.java @@ -0,0 +1,254 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 1c0b30f47f38 + */ +package com.glean.api_client.glean_api_client.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.glean.api_client.glean_api_client.models.components.PlatformAgentRunResponse; +import com.glean.api_client.glean_api_client.utils.Response; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PlatformAgentsGetRunResponse implements Response { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Current persisted run snapshot. A failed execution is still a successful retrieval. + */ + private Optional platformAgentRunResponse; + + @JsonCreator + public PlatformAgentsGetRunResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional platformAgentRunResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(platformAgentRunResponse, "platformAgentRunResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.platformAgentRunResponse = platformAgentRunResponse; + } + + public PlatformAgentsGetRunResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Current persisted run snapshot. A failed execution is still a successful retrieval. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional platformAgentRunResponse() { + return (Optional) platformAgentRunResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public PlatformAgentsGetRunResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public PlatformAgentsGetRunResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public PlatformAgentsGetRunResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Current persisted run snapshot. A failed execution is still a successful retrieval. + */ + public PlatformAgentsGetRunResponse withPlatformAgentRunResponse(PlatformAgentRunResponse platformAgentRunResponse) { + Utils.checkNotNull(platformAgentRunResponse, "platformAgentRunResponse"); + this.platformAgentRunResponse = Optional.ofNullable(platformAgentRunResponse); + return this; + } + + + /** + * Current persisted run snapshot. A failed execution is still a successful retrieval. + */ + public PlatformAgentsGetRunResponse withPlatformAgentRunResponse(Optional platformAgentRunResponse) { + Utils.checkNotNull(platformAgentRunResponse, "platformAgentRunResponse"); + this.platformAgentRunResponse = platformAgentRunResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformAgentsGetRunResponse other = (PlatformAgentsGetRunResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.platformAgentRunResponse, other.platformAgentRunResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + platformAgentRunResponse); + } + + @Override + public String toString() { + return Utils.toString(PlatformAgentsGetRunResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "platformAgentRunResponse", platformAgentRunResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional platformAgentRunResponse = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * Current persisted run snapshot. A failed execution is still a successful retrieval. + */ + public Builder platformAgentRunResponse(PlatformAgentRunResponse platformAgentRunResponse) { + Utils.checkNotNull(platformAgentRunResponse, "platformAgentRunResponse"); + this.platformAgentRunResponse = Optional.ofNullable(platformAgentRunResponse); + return this; + } + + /** + * Current persisted run snapshot. A failed execution is still a successful retrieval. + */ + public Builder platformAgentRunResponse(Optional platformAgentRunResponse) { + Utils.checkNotNull(platformAgentRunResponse, "platformAgentRunResponse"); + this.platformAgentRunResponse = platformAgentRunResponse; + return this; + } + + public PlatformAgentsGetRunResponse build() { + + return new PlatformAgentsGetRunResponse( + contentType, statusCode, rawResponse, + platformAgentRunResponse); + } + + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformChatCreateFormat.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformChatCreateFormat.java new file mode 100644 index 00000000..13219c62 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformChatCreateFormat.java @@ -0,0 +1,103 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 218173a41a84 + */ +package com.glean.api_client.glean_api_client.models.operations; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.glean.api_client.glean_api_client.models.components.PlatformChatJsonSchemaFormat; +import com.glean.api_client.glean_api_client.models.components.PlatformChatTextFormat; +import com.glean.api_client.glean_api_client.utils.OneOfDeserializer; +import com.glean.api_client.glean_api_client.utils.TypedObject; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils.TypeReferenceWithShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; + +/** + * PlatformChatCreateFormat + * + *

Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to + * the supplied schema. + */ +@JsonDeserialize(using = PlatformChatCreateFormat._Deserializer.class) +public class PlatformChatCreateFormat { + + @JsonValue + private final TypedObject value; + + private PlatformChatCreateFormat(TypedObject value) { + this.value = value; + } + + public static PlatformChatCreateFormat of(PlatformChatTextFormat value) { + Utils.checkNotNull(value, "value"); + return new PlatformChatCreateFormat(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference<>(){})); + } + + public static PlatformChatCreateFormat of(PlatformChatJsonSchemaFormat value) { + Utils.checkNotNull(value, "value"); + return new PlatformChatCreateFormat(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference<>(){})); + } + + /** + * Returns an instance of one of these types: + *

    + *
  • {@code com.glean.api_client.glean_api_client.models.components.PlatformChatTextFormat}
  • + *
  • {@code com.glean.api_client.glean_api_client.models.components.PlatformChatJsonSchemaFormat}
  • + *
+ * + *

Use {@code instanceof} to determine what type is returned. For example: + * + *

+     * if (obj.value() instanceof String) {
+     *     String answer = (String) obj.value();
+     *     System.out.println("answer=" + answer);
+     * }
+     * 
+ * + * @return value of oneOf type + **/ + public java.lang.Object value() { + return value.value(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformChatCreateFormat other = (PlatformChatCreateFormat) o; + return Utils.enhancedDeepEquals(this.value.value(), other.value.value()); + } + + @Override + public int hashCode() { + return Utils.enhancedHash(value.value()); + } + + @SuppressWarnings("serial") + public static final class _Deserializer extends OneOfDeserializer { + + public _Deserializer() { + super(PlatformChatCreateFormat.class, false, + TypeReferenceWithShape.of(new TypeReference() {}, JsonShape.DEFAULT), + TypeReferenceWithShape.of(new TypeReference() {}, JsonShape.DEFAULT)); + } + } + + @Override + public String toString() { + return Utils.toString(PlatformChatCreateFormat.class, + "value", value); + } + +} + diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformChatCreateRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformChatCreateRequest.java index 9c4580b9..e90fab79 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformChatCreateRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformChatCreateRequest.java @@ -15,6 +15,7 @@ import java.lang.Boolean; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import java.util.Optional; @@ -47,23 +48,36 @@ public class PlatformChatCreateRequest { @JsonProperty("conversation_id") private Optional conversationId; + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("text") + private Optional text; + @JsonCreator public PlatformChatCreateRequest( @JsonProperty("input") PlatformChatCreateInput input, @JsonProperty("store") Optional store, - @JsonProperty("conversation_id") Optional conversationId) { + @JsonProperty("conversation_id") Optional conversationId, + @JsonProperty("text") Optional text) { Utils.checkNotNull(input, "input"); Utils.checkNotNull(store, "store"); Utils.checkNotNull(conversationId, "conversationId"); + Utils.checkNotNull(text, "text"); this.input = input; this.stream = Builder._SINGLETON_VALUE_Stream.value(); this.store = store; this.conversationId = conversationId; + this.text = text; } public PlatformChatCreateRequest( PlatformChatCreateInput input) { - this(input, Optional.empty(), Optional.empty()); + this(input, Optional.empty(), Optional.empty(), + Optional.empty()); } /** @@ -98,6 +112,17 @@ public Optional conversationId() { return conversationId; } + /** + * 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. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional text() { + return (Optional) text; + } + public static Builder builder() { return new Builder(); } @@ -155,6 +180,29 @@ public PlatformChatCreateRequest withConversationId(Optional conversatio return this; } + /** + * 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. + */ + public PlatformChatCreateRequest withText(PlatformChatCreateText text) { + Utils.checkNotNull(text, "text"); + this.text = Optional.ofNullable(text); + return this; + } + + + /** + * 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. + */ + public PlatformChatCreateRequest withText(Optional text) { + Utils.checkNotNull(text, "text"); + this.text = text; + return this; + } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -168,14 +216,15 @@ public boolean equals(java.lang.Object o) { Utils.enhancedDeepEquals(this.input, other.input) && Utils.enhancedDeepEquals(this.stream, other.stream) && Utils.enhancedDeepEquals(this.store, other.store) && - Utils.enhancedDeepEquals(this.conversationId, other.conversationId); + Utils.enhancedDeepEquals(this.conversationId, other.conversationId) && + Utils.enhancedDeepEquals(this.text, other.text); } @Override public int hashCode() { return Utils.enhancedHash( input, stream, store, - conversationId); + conversationId, text); } @Override @@ -184,7 +233,8 @@ public String toString() { "input", input, "stream", stream, "store", store, - "conversationId", conversationId); + "conversationId", conversationId, + "text", text); } @SuppressWarnings("UnusedReturnValue") @@ -196,6 +246,8 @@ public final static class Builder { private Optional conversationId = Optional.empty(); + private Optional text = Optional.empty(); + private Builder() { // force use of static builder() method } @@ -253,13 +305,37 @@ public Builder conversationId(Optional conversationId) { return this; } + + /** + * 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. + */ + public Builder text(PlatformChatCreateText text) { + Utils.checkNotNull(text, "text"); + this.text = Optional.ofNullable(text); + return this; + } + + /** + * 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. + */ + public Builder text(Optional text) { + Utils.checkNotNull(text, "text"); + this.text = text; + return this; + } + public PlatformChatCreateRequest build() { if (store == null) { store = _SINGLETON_VALUE_Store.value(); } return new PlatformChatCreateRequest( - input, store, conversationId); + input, store, conversationId, + text); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformChatCreateStreamFormat.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformChatCreateStreamFormat.java new file mode 100644 index 00000000..769fb544 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformChatCreateStreamFormat.java @@ -0,0 +1,103 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: e8841adf1bf7 + */ +package com.glean.api_client.glean_api_client.models.operations; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.glean.api_client.glean_api_client.models.components.PlatformChatJsonSchemaFormat; +import com.glean.api_client.glean_api_client.models.components.PlatformChatTextFormat; +import com.glean.api_client.glean_api_client.utils.OneOfDeserializer; +import com.glean.api_client.glean_api_client.utils.TypedObject; +import com.glean.api_client.glean_api_client.utils.Utils.JsonShape; +import com.glean.api_client.glean_api_client.utils.Utils.TypeReferenceWithShape; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; + +/** + * PlatformChatCreateStreamFormat + * + *

Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to + * the supplied schema. + */ +@JsonDeserialize(using = PlatformChatCreateStreamFormat._Deserializer.class) +public class PlatformChatCreateStreamFormat { + + @JsonValue + private final TypedObject value; + + private PlatformChatCreateStreamFormat(TypedObject value) { + this.value = value; + } + + public static PlatformChatCreateStreamFormat of(PlatformChatTextFormat value) { + Utils.checkNotNull(value, "value"); + return new PlatformChatCreateStreamFormat(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference<>(){})); + } + + public static PlatformChatCreateStreamFormat of(PlatformChatJsonSchemaFormat value) { + Utils.checkNotNull(value, "value"); + return new PlatformChatCreateStreamFormat(TypedObject.of(value, JsonShape.DEFAULT, new TypeReference<>(){})); + } + + /** + * Returns an instance of one of these types: + *

    + *
  • {@code com.glean.api_client.glean_api_client.models.components.PlatformChatTextFormat}
  • + *
  • {@code com.glean.api_client.glean_api_client.models.components.PlatformChatJsonSchemaFormat}
  • + *
+ * + *

Use {@code instanceof} to determine what type is returned. For example: + * + *

+     * if (obj.value() instanceof String) {
+     *     String answer = (String) obj.value();
+     *     System.out.println("answer=" + answer);
+     * }
+     * 
+ * + * @return value of oneOf type + **/ + public java.lang.Object value() { + return value.value(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformChatCreateStreamFormat other = (PlatformChatCreateStreamFormat) o; + return Utils.enhancedDeepEquals(this.value.value(), other.value.value()); + } + + @Override + public int hashCode() { + return Utils.enhancedHash(value.value()); + } + + @SuppressWarnings("serial") + public static final class _Deserializer extends OneOfDeserializer { + + public _Deserializer() { + super(PlatformChatCreateStreamFormat.class, false, + TypeReferenceWithShape.of(new TypeReference() {}, JsonShape.DEFAULT), + TypeReferenceWithShape.of(new TypeReference() {}, JsonShape.DEFAULT)); + } + } + + @Override + public String toString() { + return Utils.toString(PlatformChatCreateStreamFormat.class, + "value", value); + } + +} + diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformChatCreateStreamRequest.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformChatCreateStreamRequest.java index 09b4e1c0..e3a81c97 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformChatCreateStreamRequest.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformChatCreateStreamRequest.java @@ -15,6 +15,7 @@ import java.lang.Boolean; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; import java.util.Optional; @@ -47,23 +48,36 @@ public class PlatformChatCreateStreamRequest { @JsonProperty("conversation_id") private Optional conversationId; + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("text") + private Optional text; + @JsonCreator public PlatformChatCreateStreamRequest( @JsonProperty("input") PlatformChatCreateStreamInput input, @JsonProperty("store") Optional store, - @JsonProperty("conversation_id") Optional conversationId) { + @JsonProperty("conversation_id") Optional conversationId, + @JsonProperty("text") Optional text) { Utils.checkNotNull(input, "input"); Utils.checkNotNull(store, "store"); Utils.checkNotNull(conversationId, "conversationId"); + Utils.checkNotNull(text, "text"); this.input = input; this.stream = Builder._SINGLETON_VALUE_Stream.value(); this.store = store; this.conversationId = conversationId; + this.text = text; } public PlatformChatCreateStreamRequest( PlatformChatCreateStreamInput input) { - this(input, Optional.empty(), Optional.empty()); + this(input, Optional.empty(), Optional.empty(), + Optional.empty()); } /** @@ -98,6 +112,17 @@ public Optional conversationId() { return conversationId; } + /** + * 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. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional text() { + return (Optional) text; + } + public static Builder builder() { return new Builder(); } @@ -155,6 +180,29 @@ public PlatformChatCreateStreamRequest withConversationId(Optional conve return this; } + /** + * 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. + */ + public PlatformChatCreateStreamRequest withText(PlatformChatCreateStreamText text) { + Utils.checkNotNull(text, "text"); + this.text = Optional.ofNullable(text); + return this; + } + + + /** + * 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. + */ + public PlatformChatCreateStreamRequest withText(Optional text) { + Utils.checkNotNull(text, "text"); + this.text = text; + return this; + } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -168,14 +216,15 @@ public boolean equals(java.lang.Object o) { Utils.enhancedDeepEquals(this.input, other.input) && Utils.enhancedDeepEquals(this.stream, other.stream) && Utils.enhancedDeepEquals(this.store, other.store) && - Utils.enhancedDeepEquals(this.conversationId, other.conversationId); + Utils.enhancedDeepEquals(this.conversationId, other.conversationId) && + Utils.enhancedDeepEquals(this.text, other.text); } @Override public int hashCode() { return Utils.enhancedHash( input, stream, store, - conversationId); + conversationId, text); } @Override @@ -184,7 +233,8 @@ public String toString() { "input", input, "stream", stream, "store", store, - "conversationId", conversationId); + "conversationId", conversationId, + "text", text); } @SuppressWarnings("UnusedReturnValue") @@ -196,6 +246,8 @@ public final static class Builder { private Optional conversationId = Optional.empty(); + private Optional text = Optional.empty(); + private Builder() { // force use of static builder() method } @@ -253,13 +305,37 @@ public Builder conversationId(Optional conversationId) { return this; } + + /** + * 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. + */ + public Builder text(PlatformChatCreateStreamText text) { + Utils.checkNotNull(text, "text"); + this.text = Optional.ofNullable(text); + return this; + } + + /** + * 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. + */ + public Builder text(Optional text) { + Utils.checkNotNull(text, "text"); + this.text = text; + return this; + } + public PlatformChatCreateStreamRequest build() { if (store == null) { store = _SINGLETON_VALUE_Store.value(); } return new PlatformChatCreateStreamRequest( - input, store, conversationId); + input, store, conversationId, + text); } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformChatCreateStreamText.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformChatCreateStreamText.java new file mode 100644 index 00000000..43f2c229 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformChatCreateStreamText.java @@ -0,0 +1,143 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 560d92f7b2cf + */ +package com.glean.api_client.glean_api_client.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Optional; + +/** + * 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. + */ +public class PlatformChatCreateStreamText { + /** + * Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to + * the supplied schema. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("format") + private Optional format; + + @JsonCreator + public PlatformChatCreateStreamText( + @JsonProperty("format") Optional format) { + Utils.checkNotNull(format, "format"); + this.format = format; + } + + public PlatformChatCreateStreamText() { + this(Optional.empty()); + } + + /** + * Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to + * the supplied schema. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional format() { + return (Optional) format; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to + * the supplied schema. + */ + public PlatformChatCreateStreamText withFormat(PlatformChatCreateStreamFormat format) { + Utils.checkNotNull(format, "format"); + this.format = Optional.ofNullable(format); + return this; + } + + + /** + * Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to + * the supplied schema. + */ + public PlatformChatCreateStreamText withFormat(Optional format) { + Utils.checkNotNull(format, "format"); + this.format = format; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformChatCreateStreamText other = (PlatformChatCreateStreamText) o; + return + Utils.enhancedDeepEquals(this.format, other.format); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + format); + } + + @Override + public String toString() { + return Utils.toString(PlatformChatCreateStreamText.class, + "format", format); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional format = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to + * the supplied schema. + */ + public Builder format(PlatformChatCreateStreamFormat format) { + Utils.checkNotNull(format, "format"); + this.format = Optional.ofNullable(format); + return this; + } + + /** + * Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to + * the supplied schema. + */ + public Builder format(Optional format) { + Utils.checkNotNull(format, "format"); + this.format = format; + return this; + } + + public PlatformChatCreateStreamText build() { + + return new PlatformChatCreateStreamText( + format); + } + + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformChatCreateText.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformChatCreateText.java new file mode 100644 index 00000000..43ae3a50 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/PlatformChatCreateText.java @@ -0,0 +1,143 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 5776d6c0225d + */ +package com.glean.api_client.glean_api_client.models.operations; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Optional; + +/** + * 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. + */ +public class PlatformChatCreateText { + /** + * Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to + * the supplied schema. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("format") + private Optional format; + + @JsonCreator + public PlatformChatCreateText( + @JsonProperty("format") Optional format) { + Utils.checkNotNull(format, "format"); + this.format = format; + } + + public PlatformChatCreateText() { + this(Optional.empty()); + } + + /** + * Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to + * the supplied schema. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional format() { + return (Optional) format; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to + * the supplied schema. + */ + public PlatformChatCreateText withFormat(PlatformChatCreateFormat format) { + Utils.checkNotNull(format, "format"); + this.format = Optional.ofNullable(format); + return this; + } + + + /** + * Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to + * the supplied schema. + */ + public PlatformChatCreateText withFormat(Optional format) { + Utils.checkNotNull(format, "format"); + this.format = format; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformChatCreateText other = (PlatformChatCreateText) o; + return + Utils.enhancedDeepEquals(this.format, other.format); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + format); + } + + @Override + public String toString() { + return Utils.toString(PlatformChatCreateText.class, + "format", format); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional format = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to + * the supplied schema. + */ + public Builder format(PlatformChatCreateFormat format) { + Utils.checkNotNull(format, "format"); + this.format = Optional.ofNullable(format); + return this; + } + + /** + * Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to + * the supplied schema. + */ + public Builder format(Optional format) { + Utils.checkNotNull(format, "format"); + this.format = format; + return this; + } + + public PlatformChatCreateText build() { + + return new PlatformChatCreateText( + format); + } + + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/async/PlatformAgentsCreateRunResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/async/PlatformAgentsCreateRunResponse.java index 63583da7..789a9a02 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/models/operations/async/PlatformAgentsCreateRunResponse.java +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/async/PlatformAgentsCreateRunResponse.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.glean.api_client.glean_api_client.models.components.PlatformAgentRunResponse; import com.glean.api_client.glean_api_client.models.components.PlatformAgentRunWaitResponse; import com.glean.api_client.glean_api_client.utils.AsyncResponse; import com.glean.api_client.glean_api_client.utils.Blob; @@ -44,23 +45,32 @@ public class PlatformAgentsCreateRunResponse implements AsyncResponse { */ private Optional res; + /** + * Durable run persisted and started. The snapshot is immediately retrievable through GET + * /api/agents/{agent_id}/runs/{run_id}. Execution failures appear in the run state. + */ + private Optional platformAgentRunResponse; + @JsonCreator public PlatformAgentsCreateRunResponse( String contentType, int statusCode, HttpResponse rawResponse, Optional platformAgentRunWaitResponse, - Optional res) { + Optional res, + Optional platformAgentRunResponse) { Utils.checkNotNull(contentType, "contentType"); Utils.checkNotNull(statusCode, "statusCode"); Utils.checkNotNull(rawResponse, "rawResponse"); Utils.checkNotNull(platformAgentRunWaitResponse, "platformAgentRunWaitResponse"); Utils.checkNotNull(res, "res"); + Utils.checkNotNull(platformAgentRunResponse, "platformAgentRunResponse"); this.contentType = contentType; this.statusCode = statusCode; this.rawResponse = rawResponse; this.platformAgentRunWaitResponse = platformAgentRunWaitResponse; this.res = res; + this.platformAgentRunResponse = platformAgentRunResponse; } public PlatformAgentsCreateRunResponse( @@ -68,7 +78,7 @@ public PlatformAgentsCreateRunResponse( int statusCode, HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + Optional.empty(), Optional.empty(), Optional.empty()); } /** @@ -112,6 +122,16 @@ public Optional res() { return res; } + /** + * Durable run persisted and started. The snapshot is immediately retrievable through GET + * /api/agents/{agent_id}/runs/{run_id}. Execution failures appear in the run state. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional platformAgentRunResponse() { + return (Optional) platformAgentRunResponse; + } + public static Builder builder() { return new Builder(); } @@ -182,6 +202,27 @@ public PlatformAgentsCreateRunResponse withRes(Optional res) { return this; } + /** + * Durable run persisted and started. The snapshot is immediately retrievable through GET + * /api/agents/{agent_id}/runs/{run_id}. Execution failures appear in the run state. + */ + public PlatformAgentsCreateRunResponse withPlatformAgentRunResponse(PlatformAgentRunResponse platformAgentRunResponse) { + Utils.checkNotNull(platformAgentRunResponse, "platformAgentRunResponse"); + this.platformAgentRunResponse = Optional.ofNullable(platformAgentRunResponse); + return this; + } + + + /** + * Durable run persisted and started. The snapshot is immediately retrievable through GET + * /api/agents/{agent_id}/runs/{run_id}. Execution failures appear in the run state. + */ + public PlatformAgentsCreateRunResponse withPlatformAgentRunResponse(Optional platformAgentRunResponse) { + Utils.checkNotNull(platformAgentRunResponse, "platformAgentRunResponse"); + this.platformAgentRunResponse = platformAgentRunResponse; + return this; + } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -196,14 +237,15 @@ public boolean equals(java.lang.Object o) { Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && Utils.enhancedDeepEquals(this.platformAgentRunWaitResponse, other.platformAgentRunWaitResponse) && - Utils.enhancedDeepEquals(this.res, other.res); + Utils.enhancedDeepEquals(this.res, other.res) && + Utils.enhancedDeepEquals(this.platformAgentRunResponse, other.platformAgentRunResponse); } @Override public int hashCode() { return Utils.enhancedHash( contentType, statusCode, rawResponse, - platformAgentRunWaitResponse, res); + platformAgentRunWaitResponse, res, platformAgentRunResponse); } @Override @@ -213,7 +255,8 @@ public String toString() { "statusCode", statusCode, "rawResponse", rawResponse, "platformAgentRunWaitResponse", platformAgentRunWaitResponse, - "res", res); + "res", res, + "platformAgentRunResponse", platformAgentRunResponse); } @SuppressWarnings("UnusedReturnValue") @@ -229,6 +272,8 @@ public final static class Builder { private Optional res = Optional.empty(); + private Optional platformAgentRunResponse = Optional.empty(); + private Builder() { // force use of static builder() method } @@ -301,11 +346,32 @@ public Builder res(Optional res) { return this; } + + /** + * Durable run persisted and started. The snapshot is immediately retrievable through GET + * /api/agents/{agent_id}/runs/{run_id}. Execution failures appear in the run state. + */ + public Builder platformAgentRunResponse(PlatformAgentRunResponse platformAgentRunResponse) { + Utils.checkNotNull(platformAgentRunResponse, "platformAgentRunResponse"); + this.platformAgentRunResponse = Optional.ofNullable(platformAgentRunResponse); + return this; + } + + /** + * Durable run persisted and started. The snapshot is immediately retrievable through GET + * /api/agents/{agent_id}/runs/{run_id}. Execution failures appear in the run state. + */ + public Builder platformAgentRunResponse(Optional platformAgentRunResponse) { + Utils.checkNotNull(platformAgentRunResponse, "platformAgentRunResponse"); + this.platformAgentRunResponse = platformAgentRunResponse; + return this; + } + public PlatformAgentsCreateRunResponse build() { return new PlatformAgentsCreateRunResponse( contentType, statusCode, rawResponse, - platformAgentRunWaitResponse, res); + platformAgentRunWaitResponse, res, platformAgentRunResponse); } } diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/async/PlatformAgentsGetRunRequestBuilder.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/async/PlatformAgentsGetRunRequestBuilder.java new file mode 100644 index 00000000..8cc26a6a --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/async/PlatformAgentsGetRunRequestBuilder.java @@ -0,0 +1,58 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 0f25cb1208ab + */ +package com.glean.api_client.glean_api_client.models.operations.async; + +import static com.glean.api_client.glean_api_client.operations.Operations.AsyncRequestOperation; + +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.models.operations.PlatformAgentsGetRunRequest; +import com.glean.api_client.glean_api_client.operations.PlatformAgentsGetRun; +import com.glean.api_client.glean_api_client.utils.Headers; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.lang.String; +import java.util.concurrent.CompletableFuture; + +public class PlatformAgentsGetRunRequestBuilder { + + private String agentId; + private String runId; + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public PlatformAgentsGetRunRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public PlatformAgentsGetRunRequestBuilder agentId(String agentId) { + Utils.checkNotNull(agentId, "agentId"); + this.agentId = agentId; + return this; + } + + public PlatformAgentsGetRunRequestBuilder runId(String runId) { + Utils.checkNotNull(runId, "runId"); + this.runId = runId; + return this; + } + + + private PlatformAgentsGetRunRequest buildRequest() { + + PlatformAgentsGetRunRequest request = new PlatformAgentsGetRunRequest(agentId, + runId); + + return request; + } + + public CompletableFuture call() { + + AsyncRequestOperation operation + = new PlatformAgentsGetRun.Async(sdkConfiguration, _headers); + PlatformAgentsGetRunRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/models/operations/async/PlatformAgentsGetRunResponse.java b/src/main/java/com/glean/api_client/glean_api_client/models/operations/async/PlatformAgentsGetRunResponse.java new file mode 100644 index 00000000..a4cb548f --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/models/operations/async/PlatformAgentsGetRunResponse.java @@ -0,0 +1,254 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 114fe1c036ad + */ +package com.glean.api_client.glean_api_client.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.glean.api_client.glean_api_client.models.components.PlatformAgentRunResponse; +import com.glean.api_client.glean_api_client.utils.AsyncResponse; +import com.glean.api_client.glean_api_client.utils.Blob; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PlatformAgentsGetRunResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Current persisted run snapshot. A failed execution is still a successful retrieval. + */ + private Optional platformAgentRunResponse; + + @JsonCreator + public PlatformAgentsGetRunResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional platformAgentRunResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(platformAgentRunResponse, "platformAgentRunResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.platformAgentRunResponse = platformAgentRunResponse; + } + + public PlatformAgentsGetRunResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Current persisted run snapshot. A failed execution is still a successful retrieval. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional platformAgentRunResponse() { + return (Optional) platformAgentRunResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public PlatformAgentsGetRunResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public PlatformAgentsGetRunResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public PlatformAgentsGetRunResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Current persisted run snapshot. A failed execution is still a successful retrieval. + */ + public PlatformAgentsGetRunResponse withPlatformAgentRunResponse(PlatformAgentRunResponse platformAgentRunResponse) { + Utils.checkNotNull(platformAgentRunResponse, "platformAgentRunResponse"); + this.platformAgentRunResponse = Optional.ofNullable(platformAgentRunResponse); + return this; + } + + + /** + * Current persisted run snapshot. A failed execution is still a successful retrieval. + */ + public PlatformAgentsGetRunResponse withPlatformAgentRunResponse(Optional platformAgentRunResponse) { + Utils.checkNotNull(platformAgentRunResponse, "platformAgentRunResponse"); + this.platformAgentRunResponse = platformAgentRunResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformAgentsGetRunResponse other = (PlatformAgentsGetRunResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.platformAgentRunResponse, other.platformAgentRunResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + platformAgentRunResponse); + } + + @Override + public String toString() { + return Utils.toString(PlatformAgentsGetRunResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "platformAgentRunResponse", platformAgentRunResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional platformAgentRunResponse = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * Current persisted run snapshot. A failed execution is still a successful retrieval. + */ + public Builder platformAgentRunResponse(PlatformAgentRunResponse platformAgentRunResponse) { + Utils.checkNotNull(platformAgentRunResponse, "platformAgentRunResponse"); + this.platformAgentRunResponse = Optional.ofNullable(platformAgentRunResponse); + return this; + } + + /** + * Current persisted run snapshot. A failed execution is still a successful retrieval. + */ + public Builder platformAgentRunResponse(Optional platformAgentRunResponse) { + Utils.checkNotNull(platformAgentRunResponse, "platformAgentRunResponse"); + this.platformAgentRunResponse = platformAgentRunResponse; + return this; + } + + public PlatformAgentsGetRunResponse build() { + + return new PlatformAgentsGetRunResponse( + contentType, statusCode, rawResponse, + platformAgentRunResponse); + } + + } +} diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PlatformAgentsCreateRun.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PlatformAgentsCreateRun.java index 10c2121f..729137ec 100644 --- a/src/main/java/com/glean/api_client/glean_api_client/operations/PlatformAgentsCreateRun.java +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PlatformAgentsCreateRun.java @@ -11,6 +11,7 @@ import com.fasterxml.jackson.core.type.TypeReference; import com.glean.api_client.glean_api_client.SDKConfiguration; import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.PlatformAgentRunResponse; import com.glean.api_client.glean_api_client.models.components.PlatformAgentRunWaitResponse; import com.glean.api_client.glean_api_client.models.errors.APIException; import com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException; @@ -186,6 +187,13 @@ public PlatformAgentsCreateRunResponse handleResponse(HttpResponse throw APIException.from("Unexpected content-type received: " + contentType, response); } } + if (Utils.statusCodeMatches(response.statusCode(), "201")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withPlatformAgentRunResponse(Utils.unmarshal(response, new TypeReference() {})); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } if (Utils.statusCodeMatches(response.statusCode(), "422")) { if (Utils.contentTypeMatches(contentType, "application/problem+json")) { throw PlatformUnauthorizedAgentToolsProblemException.from(response); @@ -288,6 +296,14 @@ public CompletableFuture() {}) + .thenApply(res::withPlatformAgentRunResponse); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } if (Utils.statusCodeMatches(response.statusCode(), "422")) { if (Utils.contentTypeMatches(contentType, "application/problem+json")) { return PlatformUnauthorizedAgentToolsProblemException.fromAsync(response) diff --git a/src/main/java/com/glean/api_client/glean_api_client/operations/PlatformAgentsGetRun.java b/src/main/java/com/glean/api_client/glean_api_client/operations/PlatformAgentsGetRun.java new file mode 100644 index 00000000..6654a065 --- /dev/null +++ b/src/main/java/com/glean/api_client/glean_api_client/operations/PlatformAgentsGetRun.java @@ -0,0 +1,277 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: f71fadfc6b46 + */ +package com.glean.api_client.glean_api_client.operations; + +import static com.glean.api_client.glean_api_client.operations.Operations.RequestOperation; +import static com.glean.api_client.glean_api_client.utils.Exceptions.unchecked; +import static com.glean.api_client.glean_api_client.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.glean.api_client.glean_api_client.SDKConfiguration; +import com.glean.api_client.glean_api_client.SecuritySource; +import com.glean.api_client.glean_api_client.models.components.PlatformAgentRunResponse; +import com.glean.api_client.glean_api_client.models.errors.APIException; +import com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException; +import com.glean.api_client.glean_api_client.models.operations.PlatformAgentsGetRunRequest; +import com.glean.api_client.glean_api_client.models.operations.PlatformAgentsGetRunResponse; +import com.glean.api_client.glean_api_client.utils.Blob; +import com.glean.api_client.glean_api_client.utils.HTTPClient; +import com.glean.api_client.glean_api_client.utils.HTTPRequest; +import com.glean.api_client.glean_api_client.utils.Headers; +import com.glean.api_client.glean_api_client.utils.Hook.AfterErrorContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.AfterSuccessContextImpl; +import com.glean.api_client.glean_api_client.utils.Hook.BeforeRequestContextImpl; +import com.glean.api_client.glean_api_client.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class PlatformAgentsGetRun { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + final Headers _headers; + + public Base(SDKConfiguration sdkConfiguration, Headers _headers) { + this.sdkConfiguration = sdkConfiguration; + this._headers =_headers; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "platform-agents-get-run", + java.util.Optional.empty(), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "platform-agents-get-run", + java.util.Optional.empty(), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "platform-agents-get-run", + java.util.Optional.empty(), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/api/agents/{agent_id}/runs/{run_id}", + request, null); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + _headers.forEach((k, list) -> list.forEach(v -> req.addHeader(k, v))); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration, Headers _headers) { + super(sdkConfiguration, _headers); + } + + private HttpRequest onBuildRequest(PlatformAgentsGetRunRequest request) throws Exception { + HttpRequest req = buildRequest(request, PlatformAgentsGetRunRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(PlatformAgentsGetRunRequest request) { + HttpRequest r = unchecked(() -> onBuildRequest(request)).get(); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = unchecked(() -> onError(null, e)).get(); + } + + return httpRes; + } + + + @Override + public PlatformAgentsGetRunResponse handleResponse(HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PlatformAgentsGetRunResponse.Builder resBuilder = + PlatformAgentsGetRunResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PlatformAgentsGetRunResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withPlatformAgentRunResponse(Utils.unmarshal(response, new TypeReference() {})); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "403", "404", "408", "429")) { + if (Utils.contentTypeMatches(contentType, "application/problem+json")) { + throw PlatformProblemDetailException.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "500", "503")) { + if (Utils.contentTypeMatches(contentType, "application/problem+json")) { + throw PlatformProblemDetailException.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw APIException.from("API error occurred", response); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw APIException.from("API error occurred", response); + } + throw APIException.from("Unexpected status code received: " + response.statusCode(), response); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration, Headers _headers) { + super(sdkConfiguration, _headers); + } + + private CompletableFuture onBuildRequest(PlatformAgentsGetRunRequest request) throws Exception { + HttpRequest req = buildRequest(request, PlatformAgentsGetRunRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(PlatformAgentsGetRunRequest request) { + return unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + com.glean.api_client.glean_api_client.models.operations.async.PlatformAgentsGetRunResponse.Builder resBuilder = + com.glean.api_client.glean_api_client.models.operations.async.PlatformAgentsGetRunResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + com.glean.api_client.glean_api_client.models.operations.async.PlatformAgentsGetRunResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withPlatformAgentRunResponse); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "403", "404", "408", "429")) { + if (Utils.contentTypeMatches(contentType, "application/problem+json")) { + return PlatformProblemDetailException.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "500", "503")) { + if (Utils.contentTypeMatches(contentType, "application/problem+json")) { + return PlatformProblemDetailException.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +}