From 486f323639c58efe48b3cb9f4b51d7ef542d97e4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 6 Nov 2026 12:01:20 +0100 Subject: [PATCH 01/40] ci: bump linear/linear-release-action from 0.18.1 to 0.18.2 (#261) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2788ce0..72e30fc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -138,7 +138,7 @@ jobs: if: ${{ steps.key.outputs.present == 'true' }} with: fetch-depth: 0 # the sync scans history back to the last recorded release - - uses: linear/linear-release-action@30f9ae77461ec29f07fffe0c52edd1909bfbb6f5 # v0.18.1 + - uses: linear/linear-release-action@dd4fc407f860b9460d2cf0b3fb1edd8985cf443f # v0.18.2 if: ${{ steps.key.outputs.present == 'true' }} with: access_key: ${{ secrets.LINEAR_ACCESS_KEY }} From efe0cfd4f769afe258aee37628d345b8e7a7f725 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 6 Nov 2026 12:01:41 +0100 Subject: [PATCH 02/40] chore(deps): bump mypy from 2.4.0 to 2.4.1 (#263) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- uv.lock | 108 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/uv.lock b/uv.lock index 29f3dd9..48f6b70 100644 --- a/uv.lock +++ b/uv.lock @@ -2368,7 +2368,7 @@ wheels = [ [[package]] name = "mypy" -version = "2.4.0" +version = "2.4.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "ast-serialize" }, @@ -2378,59 +2378,59 @@ dependencies = [ { name = "tomli", marker = "python_full_version < '3.11'" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/34/4e/64300736cf0a0373a27b94a91b664ee7382e36f77b0621bae6381da3e180/mypy-2.4.0.tar.gz", hash = "sha256:77bdaebd452f43fcfc4cc3ba94352a3ea537cd01e3f2d0879f48673d2ec00d6e", size = 4064425, upload-time = "2026-10-01T20:40:39.229Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/5c/0a/78c9ac93933e2ecd51d807021f78c03ffe98640f33951a8be159f5fd55bc/mypy-2.4.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ffda5244fd1ad71a1e54405e35f50d09b80c3978efa120f58bd1252ae32c62d2", size = 14408618, upload-time = "2026-10-01T20:39:46.766Z" }, - { url = "https://files.pythonhosted.org/packages/aa/4f/5f5f4429fd5a4218ce6268164a66afeed75c7e2ce5522a4d163faaa5fe85/mypy-2.4.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:615b03922d40e186fd1df73156473db0ba525c639bb4fd1cf28e1694879c9b23", size = 14552749, upload-time = "2026-10-01T20:40:08.325Z" }, - { url = "https://files.pythonhosted.org/packages/54/78/fa1c319cd51db7a6027b46117460d5a361c6bba0c0f0f0670a2dab8ce2a5/mypy-2.4.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:13fa24f439c0e48a290a3922fa14ccd22f2762bae99d2142931b3e40a9055080", size = 15505846, upload-time = "2026-10-01T20:39:15.475Z" }, - { url = "https://files.pythonhosted.org/packages/e2/5a/14c02690776fb04e9fa60b81173cb9ae6315e0745fad3813b303737f2f0c/mypy-2.4.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:3adef556a19eb3b630bf86a79c29d7da3d61e541472d0d897ca01b171c0abf8f", size = 15823059, upload-time = "2026-10-01T20:39:35.429Z" }, - { url = "https://files.pythonhosted.org/packages/76/d8/d29afa819f8cb765018d6e2773e390a41ea4592f75abe417135969646857/mypy-2.4.0-cp310-cp310-win_amd64.whl", hash = "sha256:1dc0f64b0a92ae27a49d2175f0bacfa56e15bdc5b420cf92e0c1f79292219cbb", size = 11312927, upload-time = "2026-10-01T20:39:28.509Z" }, - { url = "https://files.pythonhosted.org/packages/bc/c8/966dec4d80303855d824e6bf67fe1da812d88adfe4d75e24d8545dab4826/mypy-2.4.0-cp310-cp310-win_arm64.whl", hash = "sha256:4a378fc15fb33e321f04652c166ce73eeb8833a97c3d218132844e938cd93220", size = 10879252, upload-time = "2026-10-01T20:38:41.545Z" }, - { url = "https://files.pythonhosted.org/packages/26/67/e53965e67d23d48e78dd603aa7525a8d77e7818c23954cc217ccde5cd5c0/mypy-2.4.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:5d20e6c7c35fcbf2a0ebdd0eaeacfbc243009dfd33ab7822d54e213912e6dbbd", size = 14315745, upload-time = "2026-10-01T20:39:25.03Z" }, - { url = "https://files.pythonhosted.org/packages/b1/5d/a588ccd57625822d8484d7aff4e9c70f88d042a91c2ec84324a2bc14b3f3/mypy-2.4.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3011537be6cf1de4511c0255a324362a812b58184bbe61e15f59c8b31033bd74", size = 14465652, upload-time = "2026-10-01T20:38:57.19Z" }, - { url = "https://files.pythonhosted.org/packages/05/af/b4978a5566cb829ca563dc08e3ad8d944f116078786ad54ba3dff2bcb64d/mypy-2.4.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a96b07a49b7b1d025ce59c1b3acbcf24bead9a83da4523c4a6bde1bb94e7a0e1", size = 15419180, upload-time = "2026-10-01T20:40:27.808Z" }, - { url = "https://files.pythonhosted.org/packages/b2/8c/52c71f31c54d0a749d832cc73b933c6e38c52d9b270d5503e031c73723dc/mypy-2.4.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:7c4f8f8d1d1c0e2832d8ee7113dd08f6df6c7aad9e863fcbed9f25832be0b8c4", size = 15669212, upload-time = "2026-10-01T20:39:20.443Z" }, - { url = "https://files.pythonhosted.org/packages/e8/55/ba63121494404fd7d3787ec176ccd02820d6ec125ac4e7c4c0b79f2cc6c7/mypy-2.4.0-cp311-cp311-win_amd64.whl", hash = "sha256:ba05652540bf12828e52abae807b024b09ca144ff4f75e2450a81d69c376425b", size = 11299572, upload-time = "2026-10-01T20:40:03.627Z" }, - { url = "https://files.pythonhosted.org/packages/9c/9c/385c81b5c0d3a2917f077c4da660d0493f9521ccfd4b058e33b860f72d02/mypy-2.4.0-cp311-cp311-win_arm64.whl", hash = "sha256:6306086b87cf7f8a29aa618d9fd9bffb56c59247166b9660fdb54d86d7714ecd", size = 10869751, upload-time = "2026-10-01T20:40:25.483Z" }, - { url = "https://files.pythonhosted.org/packages/68/ed/e5d7cf4017e74a1c1e1c4058ce8f614fc1e3e7606564f47166e22bfc9f95/mypy-2.4.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:e05ff2925d8b37ad26c80c1b9dc43ae5d455da2df1e23c24c095a6425917c57e", size = 14378593, upload-time = "2026-10-01T20:38:48.222Z" }, - { url = "https://files.pythonhosted.org/packages/30/7d/12d994886a922f0f1997becc9c6625198d61eeb5962558a886af7dd38d54/mypy-2.4.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:29243242cf72582b65f9582ad9e56e8cb281566ed3519f4cd70bb8b9f2977e90", size = 14464697, upload-time = "2026-10-01T20:39:11.059Z" }, - { url = "https://files.pythonhosted.org/packages/f3/9e/bcc9af755425ad17790bf11d73c2ea7592914cf309ee1340997670f9d57a/mypy-2.4.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:29eb0b9427a6b11b992e452f6cceb8af724f4dceb47e779d0b35e405e996ea5e", size = 15552257, upload-time = "2026-10-01T20:39:56.269Z" }, - { url = "https://files.pythonhosted.org/packages/af/0c/3343fc4525d6f00d75ad17a93a9f052d5163641cb8911840d4a12cb59ff2/mypy-2.4.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e3ebe2f72a2a1156065a9851570ffbf50c0a93cdccadef9c6e05c508a4fd10b1", size = 15800443, upload-time = "2026-10-01T20:38:54.815Z" }, - { url = "https://files.pythonhosted.org/packages/8f/0e/69aac6b8159da7c53e6115a2be1bf48e85503402cadbf506dd708e8b2ad7/mypy-2.4.0-cp312-cp312-win_amd64.whl", hash = "sha256:236e0d68f6941992b0811128e652590f590db444ab29ad8f1324765b9298b946", size = 11381574, upload-time = "2026-10-01T20:39:49.406Z" }, - { url = "https://files.pythonhosted.org/packages/6e/d3/d32ce4feb5993eec09d2024bef16cedc9b93701b1446b86092f08b24491b/mypy-2.4.0-cp312-cp312-win_arm64.whl", hash = "sha256:82d0f94c8587ccb472622ee7795280aaa38a06640d5f45b3f16909d6dd86a989", size = 10944729, upload-time = "2026-10-01T20:40:15.203Z" }, - { url = "https://files.pythonhosted.org/packages/44/f2/eb15183c97c69d7cbfac990a6efd33a19ecfd97dab9e714c742fa78a784f/mypy-2.4.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:7da85fbcff6dac1abcc636707bed38b45598131fb7a605d9719c70b5cc733af8", size = 14213395, upload-time = "2026-10-01T20:40:21.178Z" }, - { url = "https://files.pythonhosted.org/packages/8c/b5/ba91b6ff65e4d6b6ff53b2b3b3ac5f1babf0c7c27d0b43a0196b1c967926/mypy-2.4.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4209da39d85cf240f762af622d8180fcdfcb4727d021f44ade62d613a1a43324", size = 14373009, upload-time = "2026-10-01T20:39:58.86Z" }, - { url = "https://files.pythonhosted.org/packages/d5/c4/484275efc935c0003e55e4e8a33e4b8e99528ee956c12256ece4708f903f/mypy-2.4.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6be721bd4bd57576193653b75b4af3461c9d0bf7dd8b528f782e9be210dc75bb", size = 15465557, upload-time = "2026-10-01T20:39:01.794Z" }, - { url = "https://files.pythonhosted.org/packages/50/30/66eb6fdd0875e3c9025a02f0bb0ea2e524b74274b658c37fde0068c4939d/mypy-2.4.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:e1fde197ae65be856a034a91b70ed747a16562ca69577785f06c661548424bf1", size = 15728673, upload-time = "2026-10-01T20:38:43.724Z" }, - { url = "https://files.pythonhosted.org/packages/58/bc/2aa98fd7f49c42dba8e9c065886fadffdd00f3c654cff3f2a7103a797ac8/mypy-2.4.0-cp313-cp313-win_amd64.whl", hash = "sha256:295ecf2e57542cd836ca537486951289678c8c7d1ee6ad74ebe29b2168a003cf", size = 11389803, upload-time = "2026-10-01T20:39:37.547Z" }, - { url = "https://files.pythonhosted.org/packages/49/41/17b60df2d946792ef6af43b89351f5c9ddabc69053206b2304945572a744/mypy-2.4.0-cp313-cp313-win_arm64.whl", hash = "sha256:bc378bdad4e9f12b5bd96466083d1e71acf00594ec9c7b2bdb5e02816f77f303", size = 10951060, upload-time = "2026-10-01T20:39:04.015Z" }, - { url = "https://files.pythonhosted.org/packages/e0/66/924be0b653372ed31ad5c48e26044cc00840e591943a56e61621cf05b60e/mypy-2.4.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:058165f564ccf559c68c70fec2091fca5891110480210c22594635e3f6683437", size = 14234230, upload-time = "2026-10-01T20:39:44.535Z" }, - { url = "https://files.pythonhosted.org/packages/56/39/c4f176880a4177123576de6cec6309feea8f42fca2bf2f6584e88054f656/mypy-2.4.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9fa247e02b505a45a2775f69df38d360d197e3790bc60f717595db9eda358b6e", size = 14392944, upload-time = "2026-10-01T20:40:05.78Z" }, - { url = "https://files.pythonhosted.org/packages/bc/1c/26e16977e25ef2494a74f8ffc872a76ec2c3aa43c3156057cbdf88f352c5/mypy-2.4.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:20e9a5cd875837520c43db98dea0b6d0c2197833d95c30127d8f570fb9b1f00b", size = 15441463, upload-time = "2026-10-01T20:40:32.412Z" }, - { url = "https://files.pythonhosted.org/packages/31/9c/9e4b049f0ecefbfd6817ca2a16eea55dd74a07950268edc6cffd29ccfe98/mypy-2.4.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:9f03a7828cca2b0adcd6662aee8f2711ff8830e1027641fdea3ab0b787483566", size = 15705406, upload-time = "2026-10-01T20:40:34.844Z" }, - { url = "https://files.pythonhosted.org/packages/4a/5e/e861b5f6c5ef9ee6cd24683aed1edecf82a26dbd536049f9b7850b586267/mypy-2.4.0-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:9279488933040b638c0ab739084c0ca100efeea6db581bf5d7628d8e89de53fe", size = 7897523, upload-time = "2026-10-01T20:39:39.861Z" }, - { url = "https://files.pythonhosted.org/packages/3a/87/61ffee58b25a956532a6006fae84918a2de849ed25f397492b2e815fe7b3/mypy-2.4.0-cp314-cp314-win_amd64.whl", hash = "sha256:2106b55105ba5ea9be4f53a24517fc5fa927ff1585edc9bc1a975abb72caef89", size = 11576345, upload-time = "2026-10-01T20:39:41.553Z" }, - { url = "https://files.pythonhosted.org/packages/a1/88/a331c20698971c2ce8d1c30f317fd61b5be13a85b1f053e12dfa22ac6568/mypy-2.4.0-cp314-cp314-win_arm64.whl", hash = "sha256:528c8744b8b5e3ecb8774f86af38d2376216816e9908317ad055f3c9c2d74799", size = 11172062, upload-time = "2026-10-01T20:38:59.534Z" }, - { url = "https://files.pythonhosted.org/packages/47/c0/4f7daa73270dced8e86c6f4a911c68082d03a84e6c1ec9bd916028d66131/mypy-2.4.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:0bb95cf34899e4619c61ab0a8667804e139e580b30d5df12af2102dfe44d0c97", size = 15711208, upload-time = "2026-10-01T20:39:30.597Z" }, - { url = "https://files.pythonhosted.org/packages/2f/05/f1afa303c678be24cf7a266d38fb24b3de4599a024c2f9ba0d5905a3efa3/mypy-2.4.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:86d616fe84c6eab8026f8c50ab5bcb90db780d2ccd233d971e34e92bede9b359", size = 15935442, upload-time = "2026-10-01T20:39:22.781Z" }, - { url = "https://files.pythonhosted.org/packages/9d/d6/6a1a45459b63716e0d035f4892a926d3054f0a8cbfa02551d228a9946083/mypy-2.4.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a3f86fd1313dd69d013e265f1fdcd12ea7a9d606f9875b2a3db946cd334555f3", size = 17240044, upload-time = "2026-10-01T20:39:32.95Z" }, - { url = "https://files.pythonhosted.org/packages/87/85/ae33bee66c13f98d421964d87bf0888be941063bc75c1204a4cf142cf1cc/mypy-2.4.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:720434d48542ecfe84d32d287b727569d3fc8f5769acd39051130e490a5c295c", size = 17545856, upload-time = "2026-10-01T20:39:08.827Z" }, - { url = "https://files.pythonhosted.org/packages/df/de/eeff209b65c3e267818d79333bb9f058da6e4e73761461bd94748a2eb628/mypy-2.4.0-cp314-cp314t-win_amd64.whl", hash = "sha256:a6e851b82c0661f69f1630fc16172c68787a6a9cf0991e7c6437d60976cdcd76", size = 12369342, upload-time = "2026-10-01T20:40:10.516Z" }, - { url = "https://files.pythonhosted.org/packages/2b/43/e62d8d5c1dd737aa248968302ff7d6eabf997c3301773ed8bcb64932ca77/mypy-2.4.0-cp314-cp314t-win_arm64.whl", hash = "sha256:3bd0e340f0ebe65c548210f53be3fd8192e83964760caf0c28bef368e68b0d37", size = 11849099, upload-time = "2026-10-01T20:39:51.834Z" }, - { url = "https://files.pythonhosted.org/packages/2e/5f/335b8980055118dc131355155883fb676bb2161a0d97e08658e479c776fb/mypy-2.4.0-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:afa89837d9be67e0cadfa33bca3bb7efdda98c3b07e74dc3b635ebfb1c8a926a", size = 14241302, upload-time = "2026-10-01T20:39:13.227Z" }, - { url = "https://files.pythonhosted.org/packages/18/37/1482fdc49332b145828912b15f16eee0c4ca70a8bce0f6514ece79b14680/mypy-2.4.0-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:fb443e81057896132d3642d6be219e6efd158691ac7883e3ba8fcb469865f05d", size = 14408200, upload-time = "2026-10-01T20:38:52.576Z" }, - { url = "https://files.pythonhosted.org/packages/04/09/dce2e8f6c1b31053c430ef6963f6f7a38ccb49b90c5e01e37ed0129b7d5a/mypy-2.4.0-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7f38f57d344f8b6accb40e01c3d83cfc590498231724d16c07ffb7940f157818", size = 15444409, upload-time = "2026-10-01T20:39:18.1Z" }, - { url = "https://files.pythonhosted.org/packages/43/c5/91b68306da4cd280cb15be35dbb5ffc343cabd67c4b121b6625bf2d13177/mypy-2.4.0-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:e76172710bd4e5eeae061abfd68347e5264632e02778be61784671ae3a2132f5", size = 15731186, upload-time = "2026-10-01T20:40:23.426Z" }, - { url = "https://files.pythonhosted.org/packages/64/71/2d0340182a8f27352fb1e25531355951108b506097c433937e9eec452ffd/mypy-2.4.0-cp315-cp315-pyemscripten_2026_5_wasm32.whl", hash = "sha256:f83353e47ab520bf6fd4df8f5897d9fe081211f2fbc4b7d37736a3e3c166cbcf", size = 7897838, upload-time = "2026-10-01T20:38:50.779Z" }, - { url = "https://files.pythonhosted.org/packages/3e/08/32703c117e134c02efa2a82705bb40cee91eaedea10b6530e20eba651b1f/mypy-2.4.0-cp315-cp315-win_amd64.whl", hash = "sha256:970b221ed5842213d98e3c480c08f795ace4b1f81fb21e1b126bd0476bce1c34", size = 11575700, upload-time = "2026-10-01T20:39:53.982Z" }, - { url = "https://files.pythonhosted.org/packages/ab/08/08bb269feafdaad031046ee2d771528a64467e6a180f962afc28c4a3ccd8/mypy-2.4.0-cp315-cp315-win_arm64.whl", hash = "sha256:502b94b0b331f7dafe32fd6b151797ddbb4f32385b362e722c783a025e5954a3", size = 11172908, upload-time = "2026-10-01T20:40:12.91Z" }, - { url = "https://files.pythonhosted.org/packages/fb/3f/c5c92626006ca92c7686adfbece47fc6a0daa0e54753952a9ad13ce0561c/mypy-2.4.0-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:c9de622fd397495695d0598ddc789222bfcfec9d7c9ec3a1e385c855e3bc5e01", size = 15705970, upload-time = "2026-10-01T20:40:17.79Z" }, - { url = "https://files.pythonhosted.org/packages/10/f3/863365f7997a76a5a1dd42d7902ab05afa4124e8419089cbca1ce2554db1/mypy-2.4.0-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9f459f0b4f0596d9d51fe7716b404b35287b99e77da98a7af90a65dd5fd61141", size = 15942234, upload-time = "2026-10-01T20:40:37.243Z" }, - { url = "https://files.pythonhosted.org/packages/f6/30/2f45b1f425a2c95dbe1a3f4d076bfd42b76e9615dba5906230703b14e4eb/mypy-2.4.0-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f9b028548b3af480e2b1ed8df14ccaac86f99c9f600d1580770ab7ba3dcd40f0", size = 17218364, upload-time = "2026-10-01T20:39:06.497Z" }, - { url = "https://files.pythonhosted.org/packages/43/8b/5b2bbfc69e84800b78fa2dba16d995b003f93b573558e412c5490d6e6c37/mypy-2.4.0-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:cb734b2668c1f40d07ce093bbeb4407e9527c67901627b0e1679825be3f09975", size = 17557934, upload-time = "2026-10-01T20:38:46.077Z" }, - { url = "https://files.pythonhosted.org/packages/df/c0/1a5dc601c22041a7bbfe1ff71cf097fbbd4fb49930867c6789baf5102106/mypy-2.4.0-cp315-cp315t-win_amd64.whl", hash = "sha256:172e30b8fea631fe310f0c665477f52d9ea40bb4e99e0c81dc30118563b13710", size = 12350955, upload-time = "2026-10-01T20:40:01.52Z" }, - { url = "https://files.pythonhosted.org/packages/1c/bc/697e9e26fc2a86c094ad67ee1e419971b7f01ded66ee66231b09e9f3e12e/mypy-2.4.0-cp315-cp315t-win_arm64.whl", hash = "sha256:5786ef987b3767e51aaa53f20aec104c0252b42ecda7aef8e8b4cbae279b05c5", size = 11842738, upload-time = "2026-10-01T20:40:30.026Z" }, - { url = "https://files.pythonhosted.org/packages/81/12/46ae8670c98a3cd0286ca5645c2f918f8f6be65edfed81b916010619f668/mypy-2.4.0-py3-none-any.whl", hash = "sha256:d01c5d26a352acc6d5cf3128225477e1e8465e8d3029d4c345807fbf7f3cf093", size = 2800734, upload-time = "2026-10-01T20:39:26.837Z" }, +sdist = { url = "https://files.pythonhosted.org/packages/4a/3c/78ecece71ee4b5445389a4ccd11627cfb9c69e4de554d11060171f376305/mypy-2.4.1.tar.gz", hash = "sha256:63b590965691e540a335fa74dadf31a7069142f6b72e234689bbd244edf55623", size = 4066728, upload-time = "2026-10-28T19:23:13.286Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/43/73/a216580781d8de91bf4ee5865d29da862301e72badc03cb5b7781431fa04/mypy-2.4.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:2b4e0aa029ad0c1d42cc494daf86d1e0efd15dab4db7bd096ece29e8a9689c6a", size = 14410964, upload-time = "2026-10-28T19:22:56.488Z" }, + { url = "https://files.pythonhosted.org/packages/6e/aa/1c0599d5b0e0d09d6a7b8207cffab5c921a939f019ae44e17f2298b0fb37/mypy-2.4.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c535efcb91f7e66f41b9bd2b5dbd78900a7609ce88f4c020d668e4c82d082b0b", size = 14554488, upload-time = "2026-10-28T19:21:24.159Z" }, + { url = "https://files.pythonhosted.org/packages/81/b0/678facc6c830ea6533362a08746009d2f93f38c556963d4e57817a30275f/mypy-2.4.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0724cf95fabc87ca4a2d5b7f276b43f51afce8a3804bde704490b008e377e50b", size = 15507914, upload-time = "2026-10-28T19:22:08.243Z" }, + { url = "https://files.pythonhosted.org/packages/e6/bd/d1a660f556441009b3daec4a1066e62436599e3cb3dd0c4ddbbb84f4500c/mypy-2.4.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:0f0a8b8f5dee799195a3f2670a5b2617ac7193d3563f52dbef42ad6770c6a9db", size = 15824767, upload-time = "2026-10-28T19:21:51.664Z" }, + { url = "https://files.pythonhosted.org/packages/3e/05/63fc2233abe01021f57b101b8213fbf5ec2faca057d40a349413800a9ac4/mypy-2.4.1-cp310-cp310-win_amd64.whl", hash = "sha256:d4c343b2a720741a016d720b255e75581a50e2bede61d53250484e18562a1d64", size = 11314324, upload-time = "2026-10-28T19:22:31.876Z" }, + { url = "https://files.pythonhosted.org/packages/08/24/09fe0d2c1046508cb7cb669859fbba2ef74e4fcd13f2ddf1e9babfcfaafd/mypy-2.4.1-cp310-cp310-win_arm64.whl", hash = "sha256:8e437811ebd26d3e6258efb562a711b385c139be597dffed5e735c801d15c77f", size = 10881179, upload-time = "2026-10-28T19:23:09.193Z" }, + { url = "https://files.pythonhosted.org/packages/4b/8b/2bc7f489528db504221ad7eff6b3f83979ee57d066103c72a85d09046a30/mypy-2.4.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:79a1e79199e980fb41f219cb3d4746d25c64b0b623840d3ed57df1cdc13a6502", size = 14321495, upload-time = "2026-10-28T19:21:16.612Z" }, + { url = "https://files.pythonhosted.org/packages/18/9a/b2f037b4982dce33645296e4394b031ade60f697f468761fa3ea8e2f8ece/mypy-2.4.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4e18d0da3898b3bcd16192f15a206e7b8b8dd0f4a0b3e51aa5bd5c2afe749e2c", size = 14467468, upload-time = "2026-10-28T19:22:10.629Z" }, + { url = "https://files.pythonhosted.org/packages/c4/5a/379f9bfa18bf3f8d43668fbd9ae4f2922dd027a559c461ca9d41cde1d32e/mypy-2.4.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b69a15fc2e75858d6b15e91ed3a0dcff1a533265183b64734138791fe0f49aa5", size = 15421496, upload-time = "2026-10-28T19:22:48.005Z" }, + { url = "https://files.pythonhosted.org/packages/83/50/3bde18a2824ec296432cebe01752ccd0ab8a2ad784abe4390040d019b3bf/mypy-2.4.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:70971cc0bcb1d3f03d2eb68fa430a6481ccc03558dc001d9534d7e5fa274c392", size = 15670425, upload-time = "2026-10-28T19:21:57.026Z" }, + { url = "https://files.pythonhosted.org/packages/6a/36/8b722b88c325d317354de7d10d8fb9d4dc0f958433e873a91fc4ed21a06e/mypy-2.4.1-cp311-cp311-win_amd64.whl", hash = "sha256:6f7225951a277dd0d6add900731d487174b7d24ac133c09d670ed63b4d8cb90d", size = 11300972, upload-time = "2026-10-28T19:21:48.724Z" }, + { url = "https://files.pythonhosted.org/packages/c2/d6/fb2bab1245658d68af8abfe776362a780c621fe0f364f2c7b53039a945ee/mypy-2.4.1-cp311-cp311-win_arm64.whl", hash = "sha256:be4c03f33c55500191df2ed4a9b5e7edbdd1fff067fe361a5a9b1b5d3262da6e", size = 10873349, upload-time = "2026-10-28T19:21:32.104Z" }, + { url = "https://files.pythonhosted.org/packages/c0/1a/0be9dc6af5e0e04128f18a5e36b4ca44bfb0085857d37aa6a7de1ac2b0cb/mypy-2.4.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:d63737426a048a27705a4eedb828669f4bc0873612a1b46b0b9fe892b2ebaaaf", size = 14381321, upload-time = "2026-10-28T19:21:54.223Z" }, + { url = "https://files.pythonhosted.org/packages/0d/a6/7907e36711a8a8c703f961f076fab61793383694140bd1fd87589f3f68d4/mypy-2.4.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:7344869cad05f073b8cae2826774fa0161e3eb2f5c685b76813574008d77d750", size = 14466373, upload-time = "2026-10-28T19:22:25.211Z" }, + { url = "https://files.pythonhosted.org/packages/5d/b8/7313212b29de570c25c9859d7c8e4ef2251a6d34338a1e20031d94297721/mypy-2.4.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a20ff6cd2af7a670c64f089bfa5fbcebe8ff3bf896c5e6ac7c9862c7960e4494", size = 15553666, upload-time = "2026-10-28T19:22:36.511Z" }, + { url = "https://files.pythonhosted.org/packages/23/8f/92966b6082ff49da9142e1e527eb9af4359a9a61632a1cfc313da96b37fe/mypy-2.4.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:9ed1195502cca32be5ef756b1693477f4991db2f2e34eaa90cc4ad6bea4f9531", size = 15802641, upload-time = "2026-10-28T19:21:13.421Z" }, + { url = "https://files.pythonhosted.org/packages/b6/b4/874f6fd54b005020ad63e2cf7a59b178d16a771d478849b29b842cb0cf14/mypy-2.4.1-cp312-cp312-win_amd64.whl", hash = "sha256:4c194c5d878130fca1ae662dfb1feb6274afbab0b40032c80147377e0ea803d5", size = 11383067, upload-time = "2026-10-28T19:22:03.516Z" }, + { url = "https://files.pythonhosted.org/packages/b0/41/5ae8e6528c2faa96e4a921a999d2c7ac7c565bee184b4282bf62ffa76b5d/mypy-2.4.1-cp312-cp312-win_arm64.whl", hash = "sha256:71eda06e5bae51976ce869fda429159c9cec678bd02f25bb197f0265c8f991be", size = 10946882, upload-time = "2026-10-28T19:21:39.51Z" }, + { url = "https://files.pythonhosted.org/packages/6a/65/cd19bc06b67d2df4828220245fd98569ba40fac00c60ba48bef1817d8ac3/mypy-2.4.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:3f1613bfe6726169a5680ec3dad5fe1f6d96285c12aded51ad432eadedd39d45", size = 14214179, upload-time = "2026-10-28T19:22:27.49Z" }, + { url = "https://files.pythonhosted.org/packages/c9/db/4d54ca4f49a0113d0c956980272aefdc6eec5458f7a72b350785b9ef2249/mypy-2.4.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:680ba5d9f0e3fe0c746b3d14df15f2a718e4bc308a1145616a1ea691ce7c354b", size = 14376217, upload-time = "2026-10-28T19:21:08.019Z" }, + { url = "https://files.pythonhosted.org/packages/a2/45/089b4724b85f0f408941be5298f817ee89181c1ce031a73d60ebb150c2c7/mypy-2.4.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1fb70621535c22fd4b1a0450d37ed1d6c5eb39656a1cebfb189084c12de54ba7", size = 15467623, upload-time = "2026-10-28T19:21:21.555Z" }, + { url = "https://files.pythonhosted.org/packages/27/4c/15edbc64b0b1412bfe94c74192b3b56554ab642b85a31bb06cef6313101f/mypy-2.4.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:4af5ad558033bf71a44a1be149ed61633522824f84c1b6bc2445d3fe2d2a5296", size = 15729867, upload-time = "2026-10-28T19:21:37.557Z" }, + { url = "https://files.pythonhosted.org/packages/76/5b/7d160fb685994b65b0ca86d352f3afb5424f96a9e6914719f7b861fb6701/mypy-2.4.1-cp313-cp313-win_amd64.whl", hash = "sha256:acdd82cb3a2eb10720e87706a128d75785d005a8c47e36a4973221524f41fc56", size = 11390802, upload-time = "2026-10-28T19:22:18.081Z" }, + { url = "https://files.pythonhosted.org/packages/9a/ea/453d27f8d531f57c5f14aa73094eaa48e3fb77f680bdede2045cb64fa58b/mypy-2.4.1-cp313-cp313-win_arm64.whl", hash = "sha256:133886ef1a7a8cf673df55d865e41580c6c46aa9b8e31e1325dfe315c038f745", size = 10950427, upload-time = "2026-10-28T19:22:59.003Z" }, + { url = "https://files.pythonhosted.org/packages/7d/75/282d43d6fea7be984ac63e75ffd8eee146ba2f3b077bb1ca5bf3f973e0c4/mypy-2.4.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:c45485061ba08f700acc12cfc8b177e6997e6bc353605babfc0abb081e079456", size = 14233251, upload-time = "2026-10-28T19:22:44.977Z" }, + { url = "https://files.pythonhosted.org/packages/ac/a8/9021263cc7e761451c7d8131bdfab3c0a5c2d67aa2d694670019e1ab86a7/mypy-2.4.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:727890a32f1858c09549eb55a8b234fe990d460450b28f03e8213ef925f1247c", size = 14394953, upload-time = "2026-10-28T19:21:29.492Z" }, + { url = "https://files.pythonhosted.org/packages/16/10/4192a5cea09ebbc41c534f57bd0d8f0fb42a8e810632cda6e37f072c59fd/mypy-2.4.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:beb254fec368c4e7f7f82a5f310c6470b893ec88a90b66426da971c6826b0453", size = 15442824, upload-time = "2026-10-28T19:22:42.068Z" }, + { url = "https://files.pythonhosted.org/packages/99/e6/d3b0a7474aa4f696594a47a218b6796d9c4346fc81ed288904278cddd9bd/mypy-2.4.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:ec416d5d2ae689e681f5727e328723f18d8b5dc8c903a146b7851dc5727aad8a", size = 15717227, upload-time = "2026-10-28T19:22:54.026Z" }, + { url = "https://files.pythonhosted.org/packages/48/6a/2ec530dacd4f77ca50d0fa05b854098f2d75e5d18c587d2612b44f10d68c/mypy-2.4.1-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:0e95ad0bec03ced9a73b42514208abd24c789e67f0e1eba476e276dd7a2dea3a", size = 7898637, upload-time = "2026-10-28T19:21:41.709Z" }, + { url = "https://files.pythonhosted.org/packages/cc/56/de9d7bad12e3868d5f1f4279aed20b1b568b2c5e166f2d3a05b211dca0b1/mypy-2.4.1-cp314-cp314-win_amd64.whl", hash = "sha256:51f742d4154824837ca6e92aa81f00eec222700a3c337bd258e5562a3880d75a", size = 11576656, upload-time = "2026-10-28T19:22:13.232Z" }, + { url = "https://files.pythonhosted.org/packages/b8/12/4fa9883b9b59e5c96ff62845ad019dc47786031c45d67eaccf452cffffd8/mypy-2.4.1-cp314-cp314-win_arm64.whl", hash = "sha256:f44dd4c5ab22df21206dd926c98381ebdbf5bfd696df37dd38ded2d23143fcb6", size = 11174403, upload-time = "2026-10-28T19:23:01.346Z" }, + { url = "https://files.pythonhosted.org/packages/3f/f2/827e356fc4f74c60b8da42663336e035b49d948a3c11224b0fc7543086b1/mypy-2.4.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:2875280687e64740e6ddcef43bd4c5852ad45ff34549740f6aea3f0373870b93", size = 15713427, upload-time = "2026-10-28T19:21:26.757Z" }, + { url = "https://files.pythonhosted.org/packages/a2/fa/e58a4fcae1d238189eac758036c0921992a86e3e6209190efd96d61fc5d4/mypy-2.4.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ea0714d2bccaf6d010c970e1d3ba2c9c2add79d2030aad2ef03167d788948276", size = 15938481, upload-time = "2026-10-28T19:22:34.371Z" }, + { url = "https://files.pythonhosted.org/packages/a1/54/a20f881801b88900923f2be1541a4b438ad0f0883e03836641fdc3d7adf4/mypy-2.4.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:63c6ff0e7ea546943001a91639c9f0c64b60d239268fa5d29e4a6c87f82c2373", size = 17243006, upload-time = "2026-10-28T19:22:39.425Z" }, + { url = "https://files.pythonhosted.org/packages/de/1c/ff84a6133a6e89c390bff6b25d9bad6598e7891b205f4b30b496906d636d/mypy-2.4.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:a5b5da107dc2c93fb0a22f7a45dbaea5dc131afc7056b5468d78e819f9a138e6", size = 17557728, upload-time = "2026-10-28T19:21:43.607Z" }, + { url = "https://files.pythonhosted.org/packages/15/4a/effa47d39b8fadf679c08e7c78559e523f9769a42a75662d2d15b2b9cdd6/mypy-2.4.1-cp314-cp314t-win_amd64.whl", hash = "sha256:c3a4d0c47053cc90035dd3a2c321112b593ad42935d0cbfd747288e1564fa8ca", size = 12370826, upload-time = "2026-10-28T19:22:29.779Z" }, + { url = "https://files.pythonhosted.org/packages/46/9f/b214ececb1a97fbb61ab3dfd48ae3cffd92ae2c148af4c9dc94c6c56772b/mypy-2.4.1-cp314-cp314t-win_arm64.whl", hash = "sha256:0c5bf267645351887b72903fd2f5fbddcf85234e0e6c4ad94e2fcfb4f0c3f971", size = 11851083, upload-time = "2026-10-28T19:23:11.288Z" }, + { url = "https://files.pythonhosted.org/packages/57/5b/e44a2edb0b25a9f1429de770e1d0238af23302671dd40c77ac5efeb0c559/mypy-2.4.1-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:db599d03e7d60d15f2e0a11665c18bc52a88699fcab990fdf8cecd5be8ac801c", size = 14243144, upload-time = "2026-10-28T19:21:10.975Z" }, + { url = "https://files.pythonhosted.org/packages/59/d4/5c99dc3a28e11d2f0fcbb02df63d2d3e574dedc0f9f69d50901df305a7a6/mypy-2.4.1-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c6c7210e40dd423af7d65cbe428b5906d11dc60659337bdae4e5fdf02ce32ed7", size = 14409316, upload-time = "2026-10-28T19:22:15.515Z" }, + { url = "https://files.pythonhosted.org/packages/c3/c9/3108b38f4c30eabd80194f5d9771a87e27196c5e0ddb5bf4b99c6ed1e97e/mypy-2.4.1-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a2d4a51db92059eecc2c33b2a5194b28585ebfd917292c015fe87a77dbff6cd2", size = 15445573, upload-time = "2026-10-28T19:22:05.635Z" }, + { url = "https://files.pythonhosted.org/packages/dd/12/84a53eceaf11c46dfd7931fb6b8902d01fb33787d3a991e81c461458150b/mypy-2.4.1-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:01b7718552d017f88d1151f3cc9d6556d778a90bd58060a2c3d87d070f9099fb", size = 15732989, upload-time = "2026-10-28T19:23:06.512Z" }, + { url = "https://files.pythonhosted.org/packages/65/ba/bf017dc2abdf83b2f74e29c43834b7af67dc1f1b20202f02dae60b4781a0/mypy-2.4.1-cp315-cp315-pyemscripten_2026_5_wasm32.whl", hash = "sha256:3467b1d13000812ab85dc2a3834b9379ec77798ca1bcabe434e23fb21fead692", size = 7898932, upload-time = "2026-10-28T19:21:59.366Z" }, + { url = "https://files.pythonhosted.org/packages/76/05/0c22b1f0390120a8592d31209cb6b9f932b6a0b426fe643e550de15139e3/mypy-2.4.1-cp315-cp315-win_amd64.whl", hash = "sha256:080cf64a60b90a73435542feecf4171904cc5710658165b40c6869115d4aa100", size = 11577577, upload-time = "2026-10-28T19:22:01.302Z" }, + { url = "https://files.pythonhosted.org/packages/73/fb/ac01e173629697ddac2f11e51efd10347d673f9a7311b03f4aba710ebccd/mypy-2.4.1-cp315-cp315-win_arm64.whl", hash = "sha256:f9118a3f50de264b614861bb11814833a742138ac3c8e2e49a860b6977fb2704", size = 11173540, upload-time = "2026-10-28T19:21:46.444Z" }, + { url = "https://files.pythonhosted.org/packages/5b/e4/b9b9c8eb09e70927ee65b1456cfed35710b6e4ff0b07f364ceaf2202307c/mypy-2.4.1-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:9d7dafd56179d296651df9e1844b91c9517c379398f017a2a435d077a28943c1", size = 15706623, upload-time = "2026-10-28T19:22:20.528Z" }, + { url = "https://files.pythonhosted.org/packages/26/74/1ceb1ca884add0565e618d013dd24333039100dc0fcc42661561f2e1cae5/mypy-2.4.1-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d923cec43316f0e6736b8298fd00abeaaf348a091c20e7296b3aebceecb63eca", size = 15944095, upload-time = "2026-10-28T19:21:04.779Z" }, + { url = "https://files.pythonhosted.org/packages/2b/68/27bcf9b4efa22733b6050485ae37845b94c9b8851abe4fc60632d905c32d/mypy-2.4.1-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d6e081b466e88d4343adffe11aff0f02df34b5b9070b4b700053a0b7294c0be1", size = 17223065, upload-time = "2026-10-28T19:23:03.724Z" }, + { url = "https://files.pythonhosted.org/packages/1a/a3/ed5724b317bf585c29f3c8be2792e97d45925d65a9c8af40ceeb267072e6/mypy-2.4.1-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:70196470ac300f444a302a738541101893c2c57804078b33690286a7899149e9", size = 17560589, upload-time = "2026-10-28T19:21:34.539Z" }, + { url = "https://files.pythonhosted.org/packages/42/2f/005185e6ab4752fd6cc2d1a6d1421fe21979770afe2490c00c555f34a913/mypy-2.4.1-cp315-cp315t-win_amd64.whl", hash = "sha256:de95648e0a6d46fa9929b956ed2c87c5dc9933d4d59945e6390e9d753c74e7c1", size = 12353324, upload-time = "2026-10-28T19:22:51.481Z" }, + { url = "https://files.pythonhosted.org/packages/a1/d6/20420cc9c780087139662534d128c2f3274361f8bb7e9cf0d5495a846ed5/mypy-2.4.1-cp315-cp315t-win_arm64.whl", hash = "sha256:ef8d5be90032261197ac388d945d8ff4f476c95880798a1911760af64ddfe71f", size = 11845599, upload-time = "2026-10-28T19:22:23.136Z" }, + { url = "https://files.pythonhosted.org/packages/21/5c/6e8010f8f2c4ad817364592d4b3883633417269b913fc9d5174fdeb7e565/mypy-2.4.1-py3-none-any.whl", hash = "sha256:1784648d6ec8c2b5465e3f26241b845a0b3cb4e56c993c64abe16989e7698999", size = 2801286, upload-time = "2026-10-28T19:21:19.516Z" }, ] [[package]] From 9b5ac560f714a0054fd1835b8804f5af1e7c366f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 6 Nov 2026 12:13:04 +0100 Subject: [PATCH 03/40] chore(deps): bump ruff from 0.17.2 to 0.17.3 (#264) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- uv.lock | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/uv.lock b/uv.lock index 48f6b70..01003d7 100644 --- a/uv.lock +++ b/uv.lock @@ -4240,27 +4240,27 @@ wheels = [ [[package]] name = "ruff" -version = "0.17.2" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/ae/58/690cf56da80c8f2c8bf12042b6017beac2c34fe961f65420bcb3fb7fac38/ruff-0.17.2.tar.gz", hash = "sha256:84d632402d14c23b488f941db23712d6736a013225162062d34558c3f3c780eb", size = 5333400, upload-time = "2026-10-22T18:38:00.181Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/98/b8/8b6d69c57e8fe1cc6af1aa7493b72a1a5b5a8afe34694e302025441729d4/ruff-0.17.2-py3-none-linux_armv6l.whl", hash = "sha256:96a65e755d8dba094707fb23ab602111d9a31ec2835b3a6992a1914a8fcb211e", size = 10183857, upload-time = "2026-10-22T18:37:14.956Z" }, - { url = "https://files.pythonhosted.org/packages/e8/61/12cc2ff7b2fa90a268ce1e2162c23aaf76e601d22623f6a31b0eeaa764b0/ruff-0.17.2-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:39c5b55c960515cdb32be16e69efb5734c589c06a0eb38a22694524a336b889d", size = 10210904, upload-time = "2026-10-22T18:37:17.985Z" }, - { url = "https://files.pythonhosted.org/packages/e8/7c/b8850a8e4ad29f64a827dd6c6902db4a9aa538fb2b9eef4e26084001a3bb/ruff-0.17.2-py3-none-macosx_11_0_arm64.whl", hash = "sha256:92a80d2f44584dabb0189b3a6c393e37e525e04942838482010575cb81945be7", size = 9408439, upload-time = "2026-10-22T18:37:20.964Z" }, - { url = "https://files.pythonhosted.org/packages/b7/b6/6a64fae86ca5e5e29d5adc311e5481de726cedf9aee607435a16c31c442a/ruff-0.17.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b7d0906677d89bbf3cf73cde64b5bbe2ab35df3ae43e49ee2627301e91265bac", size = 10047078, upload-time = "2026-10-22T18:37:23.717Z" }, - { url = "https://files.pythonhosted.org/packages/10/19/23d376547715175aa1bd46df48df6aacc7c6439d9daf19cac15975180aa5/ruff-0.17.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:7cfd783590edf2b77317882631900f6a13ea2e8eacefe6ebf2370d2715299160", size = 9990478, upload-time = "2026-10-22T18:37:26.584Z" }, - { url = "https://files.pythonhosted.org/packages/93/6c/34cda32cbe13adac5c6b291a307a5570d8ebd37c0c86339f0fe628e55632/ruff-0.17.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:122258f6ecde0e0dd1bb60b24263c3edde4338caf723fca711cc729f9bfd414a", size = 10673624, upload-time = "2026-10-22T18:37:29.767Z" }, - { url = "https://files.pythonhosted.org/packages/bf/10/5d762a4dbc851d8bb47863cf3a28a61bf31c804d393b70d891fac899f5d1/ruff-0.17.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7f8fba429d6ac4128ab29cfb8fa6240d2fa671d04adf7f84d3b22fc7b6b6bea4", size = 11351797, upload-time = "2026-10-22T18:37:32.535Z" }, - { url = "https://files.pythonhosted.org/packages/3f/04/a0e92a81faf5c81c1c98d4374c8401734ccf2b8cca7d0170cb0fec08c6e2/ruff-0.17.2-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:583bd67bb9e7061dd09bc46a0a884bae2bbd214dbcd48e509813612619683869", size = 10949414, upload-time = "2026-10-22T18:37:35.501Z" }, - { url = "https://files.pythonhosted.org/packages/c3/d8/59894cf630d2d86882457a2a6a0a1533410c5c805bfbac6f6eb4b5aef69d/ruff-0.17.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c60f93fec7142dba5b8f487f94bf2f6231dae24dc11e4c48648347c8b0720004", size = 10528000, upload-time = "2026-10-22T18:37:37.88Z" }, - { url = "https://files.pythonhosted.org/packages/ab/95/d6e30c51e851d37e10762ad91fa1e76ddaad998589b5667962a3cfbc9edd/ruff-0.17.2-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:c555a877f8f41447e318101cfefea9bf12dfa9f82eedf90c376e57e069f917d0", size = 10571779, upload-time = "2026-10-22T18:37:40.444Z" }, - { url = "https://files.pythonhosted.org/packages/f4/5a/a7e1d74fb464250137d3d4eca645d323536533b672004d04ee0e46e0caf3/ruff-0.17.2-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:ba405cbd5ec7bda1f555d5e52be1fd68d02608d4d95d24591bdac92cfacb579f", size = 10051707, upload-time = "2026-10-22T18:37:42.812Z" }, - { url = "https://files.pythonhosted.org/packages/6e/f2/02fca29ca7999380f0350a7212fe755c11ab9c22d61327356cce8decdbc6/ruff-0.17.2-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:8c21b4ab24485358f17291a4f8dc5399b834e963b8efedd920fe4fdb02081bb4", size = 9998227, upload-time = "2026-10-22T18:37:45.224Z" }, - { url = "https://files.pythonhosted.org/packages/d1/00/55aa604a093dfdc1526e570fae0bb7d37a2221c7b4728d5f080b2add16ba/ruff-0.17.2-py3-none-musllinux_1_2_i686.whl", hash = "sha256:5875a16b0de70b43cb81eabea5ae5e8f5d1b2fd1b5e6ed07f80cfe5019d0bd5a", size = 10377692, upload-time = "2026-10-22T18:37:47.704Z" }, - { url = "https://files.pythonhosted.org/packages/e4/5a/a7a640f47bb906ec8fa233ea84319d503e6dee02b59e3901bd312ebd1f9b/ruff-0.17.2-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:2d086be452eed686aa51271ecf2cbe5037956517cc6ee39a17b4489ac12f8bbe", size = 10790587, upload-time = "2026-10-22T18:37:50.191Z" }, - { url = "https://files.pythonhosted.org/packages/2c/d4/c3b74e1b4808438ea7f14bb914478025e2d51261f60774a54a0fa222ec46/ruff-0.17.2-py3-none-win32.whl", hash = "sha256:6bce7d1f5165701ae18f5df85c65afe78cddfa6c5fb4b9bdb0014d60388f3edd", size = 9870537, upload-time = "2026-10-22T18:37:52.486Z" }, - { url = "https://files.pythonhosted.org/packages/1c/9a/c7da96c2c96d20704cf9027f7a5121da272a8c05f1d1531ba949e3b3df04/ruff-0.17.2-py3-none-win_amd64.whl", hash = "sha256:1b59d447f197bef9ef48a22ba1a6016137753c6099e9bac9c36eb566e422424c", size = 10282826, upload-time = "2026-10-22T18:37:55.2Z" }, - { url = "https://files.pythonhosted.org/packages/81/60/a3604c79cb02777b6cb84da894104021986f06c4bc41375102cc95049a32/ruff-0.17.2-py3-none-win_arm64.whl", hash = "sha256:195ad918027f817c119310ca89a42d347887dfc28934aaa869325e9c5dc9d962", size = 9827036, upload-time = "2026-10-22T18:37:58.031Z" }, +version = "0.17.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/59/73/81f140c4edd9cc323de5478e6bbd3bbcfae9a82692df1a258de8cec6a6d2/ruff-0.17.3.tar.gz", hash = "sha256:a57049c8addb3662073859bb55a7ad35aa54f8a7c9ed268911d1333c5aadaaa9", size = 5339444, upload-time = "2026-10-27T00:34:05.914Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/9e/8c/083365310c4e79c842f25bf5a842facbd9b0c0ec336f96dffa5074fe723d/ruff-0.17.3-py3-none-linux_armv6l.whl", hash = "sha256:ab86b84cd9d05e56d329742c0cabdcbe2d1d56c98f4a04aab9b5b66196febfb4", size = 10216522, upload-time = "2026-10-27T00:33:29.822Z" }, + { url = "https://files.pythonhosted.org/packages/72/26/4b2edf31cfebe9605d8f6ed8f1d6f376d3a53d4c9a123e62661c64c440f0/ruff-0.17.3-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:e407b4a6852853a9a2cdce96963e94ad9775578bb44e7561a0f2829f3cc04b11", size = 10217786, upload-time = "2026-10-27T00:33:33.949Z" }, + { url = "https://files.pythonhosted.org/packages/a2/7e/537aba4b7f54397a374d2f6a6fc93e9c8015e18553f31a4a7b7dbced48b5/ruff-0.17.3-py3-none-macosx_11_0_arm64.whl", hash = "sha256:b75cc113b3aca388933d8296b667b1ac401a80317ea3074c9b0a66541199da29", size = 9440362, upload-time = "2026-10-27T00:33:35.784Z" }, + { url = "https://files.pythonhosted.org/packages/3d/66/283e39734f66c8a5ebaa93c22eb7b7515779a0b1d5a5c0ad20e05c0edb41/ruff-0.17.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ab5fa7ed5ce18554ea69d850ad162cbaa0c85fc47c08d83a569f806681c9a6ad", size = 10094281, upload-time = "2026-10-27T00:33:38.216Z" }, + { url = "https://files.pythonhosted.org/packages/21/4c/1ffc768497bd025a32c72152771e40c0b99bddc5cc6e4f50c7949a395346/ruff-0.17.3-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c673c170e27834d1262e3a9c1e97bdc9b9c3b180c63d89173ce69747232474c1", size = 10022543, upload-time = "2026-10-27T00:33:40.181Z" }, + { url = "https://files.pythonhosted.org/packages/73/c3/f90db547301080fcb82c92abf914c8bd57b89911d9b65a6c4cc6b52d0635/ruff-0.17.3-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6a754c0341bc9ca151b7b335988b3263921c08859f84ca219b70cee825571b6f", size = 10683921, upload-time = "2026-10-27T00:33:42.182Z" }, + { url = "https://files.pythonhosted.org/packages/e5/98/92d4a8a26c6c96cf1a5b34dd59036d8a71e52d650aab065c58867e964e63/ruff-0.17.3-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4590b9d86c0b1543ebb09094254e191cd43fe8edaf330baa035aab03da251532", size = 11373408, upload-time = "2026-10-27T00:33:44.19Z" }, + { url = "https://files.pythonhosted.org/packages/43/02/1f24d2e3064c9753926deeb901afa57777b37ee46799b09ddd7aee6e5145/ruff-0.17.3-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:bbde18beccd98c29a227c63c99022e3443b99258e08326df6425dfe0443705ef", size = 10977469, upload-time = "2026-10-27T00:33:46.179Z" }, + { url = "https://files.pythonhosted.org/packages/f0/20/fecedea2209f574ab92033b344e01a7f0c2dc76c6d6d19a14c9f8141173f/ruff-0.17.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7fa4b0f931cdbcb8a52044f370a3eb429fb42eb88807b0e800fcaa98dd42b24e", size = 10577491, upload-time = "2026-10-27T00:33:48.233Z" }, + { url = "https://files.pythonhosted.org/packages/33/36/b93fdf0bc6f84f0cd487aadfb0354deb40013669ea35ac3d26855de1e959/ruff-0.17.3-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:39405f341deec934b4289634324ad695f72df2970f9121582872eaf5b722f0f5", size = 10608748, upload-time = "2026-10-27T00:33:50.284Z" }, + { url = "https://files.pythonhosted.org/packages/5d/b7/7d3f5f14145daead1efb0b9a8289ed1daa100f419d60774375951723ce00/ruff-0.17.3-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:68074094f55ca3d29ab19491f640282f7a84061c4c7977aa5094b968ca457e9a", size = 10075057, upload-time = "2026-10-27T00:33:52.074Z" }, + { url = "https://files.pythonhosted.org/packages/b0/ed/93ff7a5909ee56e2bd4b982deae9e0efb2724417874a90c9e41ad66c6dd7/ruff-0.17.3-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:27bb571ac78fef178fe5118d2827df95c2aae74a48fff2b15f6acd03af5ff5bb", size = 10022431, upload-time = "2026-10-27T00:33:54.061Z" }, + { url = "https://files.pythonhosted.org/packages/9b/07/a83b9eeec8c1c3c0e4eda15f06c3a91001bfd2687ea2f07b750719bf9712/ruff-0.17.3-py3-none-musllinux_1_2_i686.whl", hash = "sha256:029c37cbd3de48ca37aa12117bead2d065f15da17d66bf84e0d4274013705db2", size = 10394903, upload-time = "2026-10-27T00:33:56.158Z" }, + { url = "https://files.pythonhosted.org/packages/af/b2/05c39857c2526fcbebe46ad93a8dc97424656dfef14d3ef933abe1ffd331/ruff-0.17.3-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:692fdb46d0fd9c71e380947dc5fc72f2c3f881073bc1f739e4579376231affbe", size = 10799780, upload-time = "2026-10-27T00:33:58.204Z" }, + { url = "https://files.pythonhosted.org/packages/ec/d9/47171a16739eb7a353936b31c20cf54340531e68c9af7d72fd7a784e235d/ruff-0.17.3-py3-none-win32.whl", hash = "sha256:46539cb031b01fd29ae0a02142483c46640b233ee12bb1c1b690bffa1555d5ca", size = 9908481, upload-time = "2026-10-27T00:34:00.087Z" }, + { url = "https://files.pythonhosted.org/packages/d0/a0/f08c1631bfd81faa6a90eaf70c37c786c11bed2046302b56bb506c25e1a0/ruff-0.17.3-py3-none-win_amd64.whl", hash = "sha256:56b8ffb3f3b3cbccb8b76b71b38261b7ed982ef5d20f5b447b1b61a7f4949b24", size = 10341333, upload-time = "2026-10-27T00:34:02.099Z" }, + { url = "https://files.pythonhosted.org/packages/99/d5/4ad4ed31413c301430918e70d3d38ae6f097af0766cb9ab8c9d502b2a4d6/ruff-0.17.3-py3-none-win_arm64.whl", hash = "sha256:81fce74bcd6be0e9da7c67c7553fd0f1f12964a2052cd728ef917b937a5ca1d9", size = 9854332, upload-time = "2026-10-27T00:34:03.847Z" }, ] [[package]] From afdeddfac1736bfdb81ee16b811da153d01c9b5c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 6 Nov 2026 12:13:19 +0100 Subject: [PATCH 04/40] ci: bump astral-sh/setup-uv from 10.3.2 to 10.3.3 (#262) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 12 ++++++------ .github/workflows/release.yml | 2 +- .github/workflows/upstream-stopgaps.yml | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 90e3abe..eed03cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2 + - uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3 with: enable-cache: true - run: uv sync --locked --group dev @@ -34,7 +34,7 @@ jobs: python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2 + - uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3 with: enable-cache: true python-version: ${{ matrix.python-version }} @@ -58,7 +58,7 @@ jobs: RIUS_EXPECT_MCP_MAJOR: "1" steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2 + - uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3 with: enable-cache: true - run: uv sync --locked --group dev @@ -80,7 +80,7 @@ jobs: RIUS_EXPECT_OPENAI_MAJOR: "3" steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2 + - uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3 with: enable-cache: true - run: uv sync --locked --group dev @@ -111,7 +111,7 @@ jobs: --with setuptools<81 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2 + - uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3 with: enable-cache: true python-version: "3.10" @@ -129,7 +129,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2 + - uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3 with: enable-cache: true - run: uv sync --locked --group dev --all-extras diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 72e30fc..58e8ac2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -34,7 +34,7 @@ jobs: contents: read steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2 + - uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3 with: enable-cache: true - run: uv sync --locked --group dev diff --git a/.github/workflows/upstream-stopgaps.yml b/.github/workflows/upstream-stopgaps.yml index 38afb19..355edfc 100644 --- a/.github/workflows/upstream-stopgaps.yml +++ b/.github/workflows/upstream-stopgaps.yml @@ -58,7 +58,7 @@ jobs: timeout-minutes: 15 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2 + - uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3 with: enable-cache: true # Re-resolve only the instrumentors and the libraries they hook From 8897659f3d95ec9f30323b3465da5509b17f1cb5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 6 Nov 2026 12:14:36 +0100 Subject: [PATCH 05/40] chore(deps): bump litellm from 1.106.2 to 1.106.6 (#265) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- uv.lock | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/uv.lock b/uv.lock index 01003d7..5c6b270 100644 --- a/uv.lock +++ b/uv.lock @@ -371,30 +371,30 @@ wheels = [ [[package]] name = "boto3" -version = "1.43.112" +version = "1.43.123" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "botocore" }, { name = "jmespath" }, { name = "s3transfer" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/c8/83/bf66a8c094d11db78a6cc19d835460af7b470640df0d0a3a108e1f3cefcd/boto3-1.43.112.tar.gz", hash = "sha256:599548a8c8e93cf0223bcb35b615c82f29d30295e992b94863cfbb2405ee33e5", size = 112667, upload-time = "2026-10-12T19:26:59.963Z" } +sdist = { url = "https://files.pythonhosted.org/packages/fc/8a/64b46f075149f9160da44aa7e1052dd18431b9ad4435beb0cfb02cc48624/boto3-1.43.123.tar.gz", hash = "sha256:055fabb990c5d2f31fce4ca569255bd640cdd11a3ca68c9ecad35f4f8a5b83b5", size = 112638, upload-time = "2026-10-30T19:18:50.085Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/c1/33/88d5fa546f2b1ec726cfa1b3f9316a28a3c416f44572abc734a0d5f3c2bc/boto3-1.43.112-py3-none-any.whl", hash = "sha256:add1216791e16c4f737676a0f5d6d2fa6240eef61619c6c44df9eeeaf88f24ff", size = 140041, upload-time = "2026-10-12T19:26:58.514Z" }, + { url = "https://files.pythonhosted.org/packages/96/b2/a7986c327f80aa6f1544f4cb8f2fa7da4e1fccd472379a21cad0508b8a0e/boto3-1.43.123-py3-none-any.whl", hash = "sha256:d18d66e1e13faa0c25d0b1b8c5ce946e29fb5fc0b6456b655a93a678ff4cc313", size = 140044, upload-time = "2026-10-30T19:18:47.734Z" }, ] [[package]] name = "botocore" -version = "1.43.112" +version = "1.43.123" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "jmespath" }, { name = "python-dateutil" }, { name = "urllib3" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/0e/49/58187bfb510831e4cdafd7ced8e2a748097da81e8b9799d93f8d6ebf9f61/botocore-1.43.112.tar.gz", hash = "sha256:9ce0d70e09fabbb3a2e1126d3ec79ed67d14c88bb3f064e62ab2881d5eaf3c7b", size = 16351533, upload-time = "2026-10-12T19:26:55.249Z" } +sdist = { url = "https://files.pythonhosted.org/packages/e0/de/011fc2a47fb066c47064b122498d2fd21f55bc90ea514acbddc37ca0f8c1/botocore-1.43.123.tar.gz", hash = "sha256:80948cb9b1cdf1a1a25809089a42e3a1bc4af0258d198222db6e97dcc660dd0c", size = 16486269, upload-time = "2026-10-30T19:18:44.609Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/4a/a7/dd4c7cf9cde38db5cd5a295434e25415d814536704fe084ec7ee73e5658b/botocore-1.43.112-py3-none-any.whl", hash = "sha256:1e67a3dcf4a308c695d880b65463a492a971d5b28761b49add92f71e4322130f", size = 16052210, upload-time = "2026-10-12T19:26:50.658Z" }, + { url = "https://files.pythonhosted.org/packages/db/96/4f2dffd304425c07160ab2c12cb13322d852fd956fe9d4386228c93f02ea/botocore-1.43.123-py3-none-any.whl", hash = "sha256:e30580f9c1282c321529238ff8ff75066096a2adbd0a293c8ae592c21d1733a3", size = 16185987, upload-time = "2026-10-30T19:18:39.794Z" }, ] [[package]] @@ -1869,12 +1869,13 @@ wheels = [ [[package]] name = "litellm" -version = "1.106.2" +version = "1.106.6" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "aiohttp" }, { name = "async-timeout", marker = "python_full_version < '3.11'" }, { name = "boto3" }, + { name = "certifi" }, { name = "click" }, { name = "fastuuid" }, { name = "filelock" }, @@ -1893,15 +1894,15 @@ dependencies = [ { name = "tokenizers" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/54/4b/0f42182e4a3f957e8b5d8bdc2522779092da973bef7a3492c8e6a3409764/litellm-1.106.2.tar.gz", hash = "sha256:9f0e770cb007c8c6e78917ad7b5c4f059f7bdc4a3606f854831780ea53fd9e2d", size = 21431422, upload-time = "2026-10-21T10:44:51.337Z" } +sdist = { url = "https://files.pythonhosted.org/packages/96/6f/fb4af3dc4224807fedbecb24c8c4eec53115ed99325ef74a5fe30a76c9d1/litellm-1.106.6.tar.gz", hash = "sha256:8bf6d33b5ca32a5fc6858784b64c82e7f3bfab462d571d7d0def5596c3e1acc3", size = 21195118, upload-time = "2026-10-28T22:49:16.207Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/0f/47/1038af80d9831972fae8712a890c30252f51c514c092d83e0f1330bb1fa1/litellm-1.106.2-cp310-abi3-macosx_10_12_x86_64.whl", hash = "sha256:bf6f13445bb59d8d02131bbc1fb57161d1ae629bec65dc66f9add4c09fb6994a", size = 36283395, upload-time = "2026-10-21T10:44:22.902Z" }, - { url = "https://files.pythonhosted.org/packages/51/fc/15e44b2a222dfda71e0aff107fccfb49b06a4695fae0eb6867aff84f7e1d/litellm-1.106.2-cp310-abi3-macosx_11_0_arm64.whl", hash = "sha256:cc778d01ed65a8dd57d5211d581ec237e06df239a09c3d573ace33e0feea76c9", size = 35263059, upload-time = "2026-10-21T10:44:32.664Z" }, - { url = "https://files.pythonhosted.org/packages/cf/a8/f21d7fd8f7ffa6ebacefbedfb6268430e2b55ce9b2f33a36ac0295ccd500/litellm-1.106.2-cp310-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:34bfdc26c2c075726eda59ec0675e2a8a67b6e59a03980def7ef7651b849141a", size = 35827639, upload-time = "2026-10-21T10:44:35.553Z" }, - { url = "https://files.pythonhosted.org/packages/6b/30/4a38c22181ef7169b6c044b8294f2e5b06236aeeccfbe57c2f0e85a51bfe/litellm-1.106.2-cp310-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:cb1a2a1e55a4a8350ae2167525dc0d06f59b078cd685fb3e0f5419f02da5420e", size = 36789555, upload-time = "2026-10-21T10:44:38.879Z" }, - { url = "https://files.pythonhosted.org/packages/a0/76/e7ca210ad574f5321c162f2b27f8674c260e0857323a9991c4d3765ce8f1/litellm-1.106.2-cp310-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:ce18971e2bb2aa58ef8efae1cd12da1248e1c2e5ae3cf5903bfb9d563bb34d9d", size = 35914468, upload-time = "2026-10-21T10:44:42.268Z" }, - { url = "https://files.pythonhosted.org/packages/22/03/95518dfb58e29c45ab40a7bc3d1d76509d09011172c380145fc9e900a214/litellm-1.106.2-cp310-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:32e567ee53c812e36f79158ec280c8850973f84a9e5fdef50d31ca09306d148c", size = 36901860, upload-time = "2026-10-21T10:44:45.807Z" }, - { url = "https://files.pythonhosted.org/packages/48/7a/a17de89184b5365980c3eb7d58176ae5a7e34538e56b942c833ff7f523b9/litellm-1.106.2-cp310-abi3-win_amd64.whl", hash = "sha256:836ab19110504ad7ba71d8ce73af6b9d1cf1dc6ffda2b49ebc1a51e348f754bc", size = 37619702, upload-time = "2026-10-21T10:44:48.564Z" }, + { url = "https://files.pythonhosted.org/packages/db/34/d513c9c1d55a5369faf23c0d4d1089399d9dceaf543698f4a9e8ab2ddf9f/litellm-1.106.6-cp310-abi3-macosx_10_12_x86_64.whl", hash = "sha256:ac74f9ff9faae1a424dc7be873b80ccf1cea1681a9f4dac03bac068ae3a8d8b0", size = 36044285, upload-time = "2026-10-28T22:48:55.249Z" }, + { url = "https://files.pythonhosted.org/packages/be/b6/af2c107abce20f6670a3df02736419ccbe89b79e38fa1eb1f40b23793932/litellm-1.106.6-cp310-abi3-macosx_11_0_arm64.whl", hash = "sha256:f3398d8c21ac9fe851f1788a2d811af7f369fb485d775a25a9b3f517b0b3e88b", size = 35046170, upload-time = "2026-10-28T22:48:58.571Z" }, + { url = "https://files.pythonhosted.org/packages/72/fc/238b004817ffaf6549571b2cdfc9c5f72d3db97aa54525fb12d3c38ccba9/litellm-1.106.6-cp310-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:af0b6f4a3df53194b74188a972f103f41ee5ed86afeefc7d9a1ea40156cc0f2e", size = 35561287, upload-time = "2026-10-28T22:49:01.299Z" }, + { url = "https://files.pythonhosted.org/packages/ef/c9/490d712bf9512131106c03cd6566fa0a1f9c0bdc54c19f3250aa72e77d74/litellm-1.106.6-cp310-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:ec3cae6c87971657c9ae905b6d23aef456e979c8848f22bbc5096a31e1a1da4d", size = 36554063, upload-time = "2026-10-28T22:49:04.483Z" }, + { url = "https://files.pythonhosted.org/packages/3c/68/09fe44229fc980bdc4b799dc7ef85ba9d918e440f21094c966342209c7d7/litellm-1.106.6-cp310-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:a51f2a7317ab9cb1ef01a93c619f3c7ff69fe1fe13a59b409d0130748b5d8af9", size = 35724862, upload-time = "2026-10-28T22:49:07.595Z" }, + { url = "https://files.pythonhosted.org/packages/e0/b9/80ef424a6aa86e5a9aeff5e7a71d1060fea56914f0e2d8916340fee29289/litellm-1.106.6-cp310-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:a2876545a652de5070fa5905849b479cee977680b0616b603a6ab21fd5599524", size = 36622070, upload-time = "2026-10-28T22:49:10.542Z" }, + { url = "https://files.pythonhosted.org/packages/4a/41/8c5076437a5a56cf8e788eafe9ca36b649375bb14811d2401e6520acba86/litellm-1.106.6-cp310-abi3-win_amd64.whl", hash = "sha256:42ce43ffb0161c9a844e8b0cd02a8796d0423b11d84fe304bff925378ca55085", size = 37383305, upload-time = "2026-10-28T22:49:13.624Z" }, ] [[package]] From 60ca6a69a7342f04ad5797c2ff8d104b7bcab1be Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 6 Nov 2026 12:14:52 +0100 Subject: [PATCH 06/40] chore(deps): bump openinference-instrumentation-llama-index from 4.6.0 to 4.6.1 (#266) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- uv.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/uv.lock b/uv.lock index 5c6b270..4d8912d 100644 --- a/uv.lock +++ b/uv.lock @@ -2830,7 +2830,7 @@ wheels = [ [[package]] name = "openinference-instrumentation-llama-index" -version = "4.6.0" +version = "4.6.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "openinference-instrumentation" }, @@ -2841,9 +2841,9 @@ dependencies = [ { name = "typing-extensions" }, { name = "wrapt" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/9d/3a/2b5330b48924bcf68a4cea14e48519741ffb4f8752be718b7ea918e56c13/openinference_instrumentation_llama_index-4.6.0.tar.gz", hash = "sha256:f14c6bb5abe2871179b813f029ff726c0b4c5a777ad57786628082e13e9cc8a5", size = 72871, upload-time = "2026-10-09T18:29:09.626Z" } +sdist = { url = "https://files.pythonhosted.org/packages/40/3d/9f9f64a6319ce9d2a08de957e0fcdb2a0a5a62b10c9444157b631bd1fa29/openinference_instrumentation_llama_index-4.6.1.tar.gz", hash = "sha256:f7f789b0cf230f1a3c078e6f93b669e4e43ebef2f12fce2eb073f0c9e8a06536", size = 74375, upload-time = "2026-10-23T20:49:56.276Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/63/b8/5fa7f5da20df6f77fba834e92683cbaf0ffa5a47c9f2bc66aa7baf1557fa/openinference_instrumentation_llama_index-4.6.0-py3-none-any.whl", hash = "sha256:802c5e36cc0de320137bb80a1331fb8d598d7cfa328d2bd6839cf99e8fee66b7", size = 32956, upload-time = "2026-10-09T18:29:08.299Z" }, + { url = "https://files.pythonhosted.org/packages/9e/5b/50959cf6afaf636251541c8fab89af359a4988afac7ce18db8a575557454/openinference_instrumentation_llama_index-4.6.1-py3-none-any.whl", hash = "sha256:0d25de31462a4cac8a169c385bfd631ae0155baf0c5c942edefbf57d53ef9d78", size = 32871, upload-time = "2026-10-23T20:49:54.801Z" }, ] [[package]] From ebee042bef31142f72151a5839569c4d8d023546 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 6 Nov 2026 12:15:24 +0100 Subject: [PATCH 07/40] chore(deps): bump openinference-instrumentation-anthropic from 3.0.3 to 3.1.0 (#267) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- uv.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/uv.lock b/uv.lock index 4d8912d..4f4aa51 100644 --- a/uv.lock +++ b/uv.lock @@ -2777,7 +2777,7 @@ wheels = [ [[package]] name = "openinference-instrumentation-anthropic" -version = "3.0.3" +version = "3.1.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "openinference-instrumentation" }, @@ -2788,9 +2788,9 @@ dependencies = [ { name = "typing-extensions" }, { name = "wrapt" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/14/f4/b25dd37b61cd9942d1f738d79e1661526c81b0a0ded3e3af0fc5b81fab66/openinference_instrumentation_anthropic-3.0.3.tar.gz", hash = "sha256:f0c866eac8b900451a806bfb2c8d2ebb248e15557ee4357d75a36c7bdce287c8", size = 18056, upload-time = "2026-10-10T06:23:47.348Z" } +sdist = { url = "https://files.pythonhosted.org/packages/e1/d2/52fb3fe4eb1ae11f03ee5228d3ce05c713ecd3d8cf0e15e3c2b8046b7817/openinference_instrumentation_anthropic-3.1.0.tar.gz", hash = "sha256:8c40c9dfd1d965e9ca0c2b8c021c86da21491f26ac8ab002764fa5948426bfe8", size = 26769, upload-time = "2026-10-23T20:49:51.47Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/2e/d8/b4b76f630767bdb44a379c5df114fd5ecb5f9e815a68a7866af5b848eac4/openinference_instrumentation_anthropic-3.0.3-py3-none-any.whl", hash = "sha256:15b79dd35c5b84479c9e968f6557181ddb71f5261feb630555889c04a72323d9", size = 21625, upload-time = "2026-10-10T06:23:46.16Z" }, + { url = "https://files.pythonhosted.org/packages/82/e5/aff049d02cee0a0e999ab069274407d3264d52c3f73fc24e41300447c222/openinference_instrumentation_anthropic-3.1.0-py3-none-any.whl", hash = "sha256:be6cb36f30b38a8e3588c927ce609e98272746496352ae8f8c9c664b2f6dc37d", size = 31500, upload-time = "2026-10-23T20:49:49.86Z" }, ] [[package]] From fa036c1d79b3569fdf6a5f58ac6fa98cb9cadffb Mon Sep 17 00:00:00 2001 From: Pablo <39369995+PabloPardoGarcia@users.noreply.github.com> Date: Fri, 6 Nov 2026 12:34:34 +0100 Subject: [PATCH 08/40] fix: cover langchain 0.1.82 and llama-index 4.7.2 in the span-context stopgaps (#268) --- src/rius/langchain_span_context.py | 2 +- src/rius/llama_index_span_context.py | 2 +- tests/test_langchain_span_context.py | 3 ++- tests/test_llama_index_span_context.py | 14 +++++++------- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/rius/langchain_span_context.py b/src/rius/langchain_span_context.py index 694494a..619bdb6 100644 --- a/src/rius/langchain_span_context.py +++ b/src/rius/langchain_span_context.py @@ -63,7 +63,7 @@ #: The instrumentor releases whose tracer internals were read and found as #: this module expects. A later release may have reshaped them; it is left #: alone. -VERIFIED_VERSIONS = ("0.1.67", "0.1.81") +VERIFIED_VERSIONS = ("0.1.67", "0.1.82") #: The instrumentor's tracer the hooks look spans up in. Set by install(). _tracer: Any = None diff --git a/src/rius/llama_index_span_context.py b/src/rius/llama_index_span_context.py index 45feed3..8c99aea 100644 --- a/src/rius/llama_index_span_context.py +++ b/src/rius/llama_index_span_context.py @@ -95,7 +95,7 @@ #: The instrumentor releases whose span handling was read and found as this #: module expects. A later release may have reshaped it; it is left alone. -VERIFIED_VERSIONS = ("4.4.3", "4.7.0") +VERIFIED_VERSIONS = ("4.4.3", "4.7.2") #: The methods whose result is a stream that makes the provider request later. _STREAM_METHODS = ("stream_chat", "stream_complete", "astream_chat", "astream_complete") diff --git a/tests/test_langchain_span_context.py b/tests/test_langchain_span_context.py index d5a53d9..635d778 100644 --- a/tests/test_langchain_span_context.py +++ b/tests/test_langchain_span_context.py @@ -499,7 +499,8 @@ def test_uninstall_restores_the_hooked_classes(openai_answers: None) -> None: (VERIFIED_VERSIONS[1], True), ("0.1.66", False), ("0.1.81", True), - ("0.1.82", False), + ("0.1.82", True), + ("0.1.83", False), ("0.2.0", False), ], ) diff --git a/tests/test_llama_index_span_context.py b/tests/test_llama_index_span_context.py index 2d2d7be..5440190 100644 --- a/tests/test_llama_index_span_context.py +++ b/tests/test_llama_index_span_context.py @@ -643,19 +643,19 @@ def test_uninstall_restores_everything(openai_answers: Answers) -> None: (VERIFIED_VERSIONS[0], True), (VERIFIED_VERSIONS[1], True), ("4.4.2", False), - ("4.7.1", False), + ("4.7.3", False), ("5.0.0", False), ("4.5.0", True), - ("4.6.1", True), + ("4.7.1", True), ("4.7", True), # A pre-release comes before its release, a post-release after it. - ("4.7.0rc1", True), - ("4.7.0.dev0", True), + ("4.7.2rc1", True), + ("4.7.2.dev0", True), ("4.4.3rc1", False), ("4.4.3.post1", True), - ("4.7.0.post1", False), - ("4.7.0post1", False), - ("4.7.0+local", False), + ("4.7.2.post1", False), + ("4.7.2post1", False), + ("4.7.2+local", False), ("not-a-version", False), ], ) From cc123960a6ccab7b59a87d989eaf90eff5979b1d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 6 Nov 2026 13:13:32 +0100 Subject: [PATCH 09/40] chore(main): release 1.5.6 (#258) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ src/rius/__init__.py | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 5792c21..7a75471 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.5.5" + ".": "1.5.6" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 360af8e..09b579b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [1.5.6](https://github.com/glassflow/rius-sdk-python/compare/v1.5.5...v1.5.6) (2026-11-06) + + +### Bug Fixes + +* cover langchain 0.1.81 and llama-index 4.7.0 in the span-context stopgaps (RIUS-1732) ([#257](https://github.com/glassflow/rius-sdk-python/issues/257)) ([ac2e872](https://github.com/glassflow/rius-sdk-python/commit/ac2e87282f65bce9f3e5ce9c0b502c105dd4e88f)) +* cover langchain 0.1.82 and llama-index 4.7.2 in the span-context stopgaps ([#268](https://github.com/glassflow/rius-sdk-python/issues/268)) ([fa036c1](https://github.com/glassflow/rius-sdk-python/commit/fa036c1d79b3569fdf6a5f58ac6fa98cb9cadffb)) + ## [1.5.5](https://github.com/glassflow/rius-sdk-python/compare/v1.5.4...v1.5.5) (2026-10-27) diff --git a/src/rius/__init__.py b/src/rius/__init__.py index 72a920e..396b0a3 100644 --- a/src/rius/__init__.py +++ b/src/rius/__init__.py @@ -1,6 +1,6 @@ """GlassFlow SDK: OpenTelemetry-native tracing for AI agents and LLM apps.""" -__version__ = "1.5.5" # x-release-please-version +__version__ = "1.5.6" # x-release-please-version from .client import GlassflowClient, build_span_exporter, get_tracer, init, register_workspace from .compaction import mark_compaction From fa24f527049787df8ab8c8305bfbca31fd0345b3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Nov 2026 10:34:06 +0100 Subject: [PATCH 10/40] chore(deps): bump opentelemetry-exporter-otlp-proto-http from 1.45.1 to 1.45.2 (#270) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- uv.lock | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/uv.lock b/uv.lock index 4f4aa51..904d50e 100644 --- a/uv.lock +++ b/uv.lock @@ -2876,26 +2876,26 @@ wheels = [ [[package]] name = "opentelemetry-api" -version = "1.45.1" +version = "1.45.2" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/2e/02/6e0ae9cc61bd3169d401077b507b3ebc344745171e1051ab430be012dcd9/opentelemetry_api-1.45.1.tar.gz", hash = "sha256:aa38ed19bcc084ba42782a73255b3582283eced7ad6dddbd6695189e69adfb75", size = 72804, upload-time = "2026-10-06T17:32:58.133Z" } +sdist = { url = "https://files.pythonhosted.org/packages/19/14/cf3a6b6448849656e1e5f4e2101f3988dc6789724050096aba1bc5ccf592/opentelemetry_api-1.45.2.tar.gz", hash = "sha256:d7b0008e21e5fd61cbe7a7f34ca3b6905a78ab677d9bc395e299359c75cda6b4", size = 73277, upload-time = "2026-10-29T17:29:37.888Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/1e/41/f7dcf80b81ee8e71c1a2b59f14208bc723edbd89ed027a73b175abf6348e/opentelemetry_api-1.45.1-py3-none-any.whl", hash = "sha256:b31553efa588ae44bc306f863c785c5333a9ecc091248c6ee68b4b6c87fdedfb", size = 60256, upload-time = "2026-10-06T17:32:33.506Z" }, + { url = "https://files.pythonhosted.org/packages/a9/2d/610db864d7513158cebb8f36cc88e67e73bd6c7aa1905ef18d89e1281c81/opentelemetry_api-1.45.2-py3-none-any.whl", hash = "sha256:2cbd737377e710ee740d261c94e93fa0f08e6d037c18f17513cc0a2d94479a34", size = 60335, upload-time = "2026-10-29T17:29:06.955Z" }, ] [[package]] name = "opentelemetry-exporter-http-transport" -version = "0.66b1" +version = "0.66b2" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "opentelemetry-api" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/62/0c/e3ebdb4b507f66afcc905e6885a4946969bd75b45988492643356fbbdc63/opentelemetry_exporter_http_transport-0.66b1.tar.gz", hash = "sha256:443080203bf52586ce0b2ad901e8951c61833eab1aa539ae6f1f16fe9e8e7952", size = 11693, upload-time = "2026-10-06T17:32:59.65Z" } +sdist = { url = "https://files.pythonhosted.org/packages/a6/e6/dbeb3e217418071656232a4028c791060d219f218cef1249b664049d12c0/opentelemetry_exporter_http_transport-0.66b2.tar.gz", hash = "sha256:66d6ed810a515432c8891da9a834464332fd70badeca45bdeeae81b4280c903b", size = 11693, upload-time = "2026-10-29T17:29:39.444Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/04/69/6af86ff66492b481c6a4c05dcfd68beb47ed8ba046440a26a2aac76b95c7/opentelemetry_exporter_http_transport-0.66b1-py3-none-any.whl", hash = "sha256:2f95404bdee7f9d2d529c7de56c7bd86d014d774d8fbf137810e0167f8a492bf", size = 12155, upload-time = "2026-10-06T17:32:35.454Z" }, + { url = "https://files.pythonhosted.org/packages/a1/b2/c622a101f31c0e6670b82f4264c4e77c161bce415bc6fc158fda0b82e218/opentelemetry_exporter_http_transport-0.66b2-py3-none-any.whl", hash = "sha256:fd5f5b490c099acda1cd7b909d5e8981436bf18cc8c6098d302d114c271720e9", size = 12154, upload-time = "2026-10-29T17:29:10.244Z" }, ] [package.optional-dependencies] @@ -2905,31 +2905,31 @@ requests = [ [[package]] name = "opentelemetry-exporter-otlp-common" -version = "0.66b1" +version = "0.66b2" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "opentelemetry-sdk" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/cb/19/41de712173f43057e4532d42ece7d0c6d4210d353e5752433cb14987643f/opentelemetry_exporter_otlp_common-0.66b1.tar.gz", hash = "sha256:6b1403487a2185ac1feb45fd5546fdf8630ce71c36bcefaadf51e2130e9e23f9", size = 14325, upload-time = "2026-10-06T17:33:01.725Z" } +sdist = { url = "https://files.pythonhosted.org/packages/5a/3c/3f2cc8c42bde2620e65024d71e2eb025f7bd0821bb363b52bcc5a3260dbd/opentelemetry_exporter_otlp_common-0.66b2.tar.gz", hash = "sha256:06f5a9b88638e310efa1f1d206cdf6b75393e112aba4e174a963416192bd1028", size = 14325, upload-time = "2026-10-29T17:29:41.701Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/fc/39/8c23d67665c762aa51840fa06f86e902e8f6f1693bc8d7e3d98cd6e2f753/opentelemetry_exporter_otlp_common-0.66b1-py3-none-any.whl", hash = "sha256:00ff8592c3a7cb729ff3fdc7ffa12372c243bdf2163e80c180994d0c7bd83ee9", size = 12385, upload-time = "2026-10-06T17:32:38.177Z" }, + { url = "https://files.pythonhosted.org/packages/a8/47/b3049e30b339c82e3c7ec1fc692185a5d5a3ba65a94c570bb39b2c0b8424/opentelemetry_exporter_otlp_common-0.66b2-py3-none-any.whl", hash = "sha256:ace86efb75489f925f1ef809856ae5f0c7db534e4afdc624530222228b1236a5", size = 12385, upload-time = "2026-10-29T17:29:13.667Z" }, ] [[package]] name = "opentelemetry-exporter-otlp-proto-common" -version = "1.45.1" +version = "1.45.2" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "opentelemetry-proto" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/c1/8e/65e85e5137991a3c493b11682151d198638a5bc1dd4b4c5f67e013c57d7c/opentelemetry_exporter_otlp_proto_common-1.45.1.tar.gz", hash = "sha256:2e4adcc3a67bcf57804fc49514f0ef64974ca7590aa3491da389852b4a0628f6", size = 18873, upload-time = "2026-10-06T17:33:04.471Z" } +sdist = { url = "https://files.pythonhosted.org/packages/69/58/239c98b36d9ea317098769957043c251703636a26189c884fba46c1dad84/opentelemetry_exporter_otlp_proto_common-1.45.2.tar.gz", hash = "sha256:f1f2806f3f28ce7938033823e50934fcd91595a39de38e69a28a51e19f40fc6d", size = 18873, upload-time = "2026-10-29T17:29:44.496Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/84/aa/92f225d353904e7f70b8b3e3c1b02db0cf56f744c2e83c581dc372e78873/opentelemetry_exporter_otlp_proto_common-1.45.1-py3-none-any.whl", hash = "sha256:2f446183ae7047b036226f1d846c41a834b0e8755ad13b51a51dd38952eb466c", size = 15393, upload-time = "2026-10-06T17:32:41.911Z" }, + { url = "https://files.pythonhosted.org/packages/e6/d6/0f30d38120a949aef70528f845bf539f80df62abb4b8e62fdf69c2b6df5a/opentelemetry_exporter_otlp_proto_common-1.45.2-py3-none-any.whl", hash = "sha256:af483b24217028892f017096731b794b196b785025d2e6808874720fd0b05a80", size = 15392, upload-time = "2026-10-29T17:29:17.913Z" }, ] [[package]] name = "opentelemetry-exporter-otlp-proto-http" -version = "1.45.1" +version = "1.45.2" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "googleapis-common-protos" }, @@ -2942,14 +2942,14 @@ dependencies = [ { name = "requests" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/1b/17/26487707ea4caa97b17e6e4b5fa72133a53512ffa2f5cf7a49ef284b29cb/opentelemetry_exporter_otlp_proto_http-1.45.1.tar.gz", hash = "sha256:45c218405ce3fd879596924b1874bf9a8f6880206d61065c5a912c8e5c297fb7", size = 28839, upload-time = "2026-10-06T17:33:05.713Z" } +sdist = { url = "https://files.pythonhosted.org/packages/db/07/b7b01ecb69d02f540e679a9e36f7413d081f225bbbed4469d212ada10bb7/opentelemetry_exporter_otlp_proto_http-1.45.2.tar.gz", hash = "sha256:5984a3fb46bc4628e4e2b85d4a6e72637e03962aae6cf372791137768a4ad939", size = 28843, upload-time = "2026-10-29T17:29:46.15Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/aa/1f/517eaa0187ba106a9da97160ce2add3a371812681dc440930b267f714e42/opentelemetry_exporter_otlp_proto_http-1.45.1-py3-none-any.whl", hash = "sha256:24a97cf3753c7fb52fad44a696e452ff371686339e2acf3309e2eda3d0230700", size = 22180, upload-time = "2026-10-06T17:32:43.946Z" }, + { url = "https://files.pythonhosted.org/packages/32/65/f64d7d2450217e2989714e1dee15e19bf79a77a313387abac0cac77bc10e/opentelemetry_exporter_otlp_proto_http-1.45.2-py3-none-any.whl", hash = "sha256:6e4d025138829d0ee57946930c2ccad6491ad4d92a958e9c7eea69278fe60cfc", size = 22180, upload-time = "2026-10-29T17:29:20.154Z" }, ] [[package]] name = "opentelemetry-instrumentation" -version = "0.66b1" +version = "0.66b2" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "opentelemetry-api" }, @@ -2957,48 +2957,48 @@ dependencies = [ { name = "packaging" }, { name = "wrapt" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/a5/03/89e47ff8d52a4f83b343e6eb9ef1698ff45357216e5b6b2b21e0da5c5c7d/opentelemetry_instrumentation-0.66b1.tar.gz", hash = "sha256:e79a510f7d87c72d95e964ddb42193a0d9a75668c027d980eab032ea1322a5ce", size = 43308, upload-time = "2026-10-06T17:36:10.703Z" } +sdist = { url = "https://files.pythonhosted.org/packages/76/b9/46a136199fa6928eecefec8418867a460d94f01c608a85d22bd2ed4e8d48/opentelemetry_instrumentation-0.66b2.tar.gz", hash = "sha256:02b094150e53b76f5906d75e628dbb3833bbc6e62fa109b5c7ba0c081865e923", size = 43305, upload-time = "2026-10-29T17:38:11.618Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/da/b2/d1413681ff43e13ac9860df27e1226d3199ab0b97b352ceea41abcc660a5/opentelemetry_instrumentation-0.66b1-py3-none-any.whl", hash = "sha256:4c4aa14dc9a24a02325a9d4c42c4d0208dbb1374c2b1b8fe6c9392d59f3e1008", size = 36904, upload-time = "2026-10-06T17:35:11.663Z" }, + { url = "https://files.pythonhosted.org/packages/3b/41/014d40e2b08a5d9d9058ed4967ad992657c203ce0c292ded97364ee7b82a/opentelemetry_instrumentation-0.66b2-py3-none-any.whl", hash = "sha256:fa9ccfdab147a14af8107d19ef0a7b5015675273c5adced7a1fc38f28b42ec4c", size = 36902, upload-time = "2026-10-29T17:37:06.994Z" }, ] [[package]] name = "opentelemetry-proto" -version = "1.45.1" +version = "1.45.2" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "protobuf" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/4b/7f/15f014fb195da6c2dbb6c71399b8e76824878718e94de6454038488eed28/opentelemetry_proto-1.45.1.tar.gz", hash = "sha256:79e0fb95e4616691a469439238aa9224d75779b3e108e895d1aa125ab29ca77c", size = 46488, upload-time = "2026-10-06T17:33:11.49Z" } +sdist = { url = "https://files.pythonhosted.org/packages/24/9c/1aa4ce60e9bc72af20dc49c92cc0566825092d92b3d6a277439fb5fb7c01/opentelemetry_proto-1.45.2.tar.gz", hash = "sha256:bd8d23cf770605b0af9b7be2071d26a464fea289d35429abfd2a66226114ad64", size = 46486, upload-time = "2026-10-29T17:29:53.007Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/ab/9a/42ec8180a769516ae757e893b69736826efceac7332553915b4528a91c6d/opentelemetry_proto-1.45.1-py3-none-any.whl", hash = "sha256:f38e2a8413053c180cd3d2637fbb279673ec2f6a6e09c995aafa2f452c52b46e", size = 72488, upload-time = "2026-10-06T17:32:53.057Z" }, + { url = "https://files.pythonhosted.org/packages/7e/0d/a0b8f2b9efe2ec1abdf639d3696db9b1563ebeb11d91aac08ba7341e9122/opentelemetry_proto-1.45.2-py3-none-any.whl", hash = "sha256:03a7ca1b43f89fd5b965d5975902bb2515c0c86e2428b456836e9a6149c6235a", size = 72484, upload-time = "2026-10-29T17:29:31.403Z" }, ] [[package]] name = "opentelemetry-sdk" -version = "1.45.1" +version = "1.45.2" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "opentelemetry-api" }, { name = "opentelemetry-semantic-conventions" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/a1/79/7392e21a1c8f0c61d90b223e31c7e48cb9d452e91a6b820ad24cca5f23c4/opentelemetry_sdk-1.45.1.tar.gz", hash = "sha256:63d24a6ca645019a631e6a51999c73e93adcac1196ca640b8ae78a7cc4762bf3", size = 218324, upload-time = "2026-10-06T17:33:13.26Z" } +sdist = { url = "https://files.pythonhosted.org/packages/7b/1a/74a21d4d6969fb8b432ac397e66112a8167a6deb267ea4559dbaf2fe91ef/opentelemetry_sdk-1.45.2.tar.gz", hash = "sha256:7eec4de13dd21ff3a1670dcb0e02079e692736f94d733dfdce5af461d884248d", size = 221705, upload-time = "2026-10-29T17:29:54.685Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/95/3c/87c42b4bd6dd297536f04cd9383d212ac557ecd49f2cbdcd46da1c9ef5c8/opentelemetry_sdk-1.45.1-py3-none-any.whl", hash = "sha256:c604c11dc429810812348989115fa44bd558772a3d7442afc43d024f2c250ca4", size = 140063, upload-time = "2026-10-06T17:32:55.04Z" }, + { url = "https://files.pythonhosted.org/packages/9f/a5/9a3b793ef48245f2336a16beb2324c2397dbb3f987cd68942f77cca06156/opentelemetry_sdk-1.45.2-py3-none-any.whl", hash = "sha256:ff974ea70ee4f1d51e2ec152db37c2b626c7bf82bb3f7d86114fd8704e7199c6", size = 141756, upload-time = "2026-10-29T17:29:33.722Z" }, ] [[package]] name = "opentelemetry-semantic-conventions" -version = "0.66b1" +version = "0.66b2" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "opentelemetry-api" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/46/e4/dbbfb2a010c4db2224a5114638acede6fe563d33cc20fb1752cebcbe6298/opentelemetry_semantic_conventions-0.66b1.tar.gz", hash = "sha256:497ca63bf383723411e8eaf60c8779e9877633c936bb641080adab59d0eb6ec8", size = 150250, upload-time = "2026-10-06T17:33:14.073Z" } +sdist = { url = "https://files.pythonhosted.org/packages/37/3f/50f95972b50e8e353f5b9342034c9cd17730f1956f009ce6a3fbbd89f9ce/opentelemetry_semantic_conventions-0.66b2.tar.gz", hash = "sha256:7da5f1a5dc4383eb66711d4d3d3e71824d9403ac1559fea021cc103c1a4c4976", size = 150246, upload-time = "2026-10-29T17:29:55.682Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/bc/14/67f8aa798857f8cf686f515bf93d9bb877ce952ddc8efae0fa25b45ce0d6/opentelemetry_semantic_conventions-0.66b1-py3-none-any.whl", hash = "sha256:d4cddeb4315490b35213f55e2bdc9ac54bb1e4d318927475bed62b35545e581b", size = 206279, upload-time = "2026-10-06T17:32:56.103Z" }, + { url = "https://files.pythonhosted.org/packages/67/bd/6bf33ed31521c565931c037e9e81bac47c1acb000e850c6e24220e2a0c00/opentelemetry_semantic_conventions-0.66b2-py3-none-any.whl", hash = "sha256:4cbe61e5f9275d57ab31708446e7938ef4291ebbe6a7fca6f7a629c5acae87d8", size = 206280, upload-time = "2026-10-29T17:29:35.062Z" }, ] [[package]] From 8143b18818d444e822c70cd646206de22d63909f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Nov 2026 10:34:51 +0100 Subject: [PATCH 11/40] chore(deps): bump langchain-openai from 1.7.2 to 1.7.4 (#271) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- uv.lock | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/uv.lock b/uv.lock index 904d50e..d1f6df8 100644 --- a/uv.lock +++ b/uv.lock @@ -1665,9 +1665,10 @@ wheels = [ [[package]] name = "langchain-core" -version = "1.7.0" +version = "1.7.6" source = { registry = "https://pypi.org/simple" } dependencies = [ + { name = "certifi" }, { name = "httpx" }, { name = "jsonpatch" }, { name = "langchain-protocol" }, @@ -1679,14 +1680,14 @@ dependencies = [ { name = "typing-extensions" }, { name = "uuid-utils" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/64/cb/77d1dabe57d0dc0f96f65cba321366c341627295d1c09eefa58549e34391/langchain_core-1.7.0.tar.gz", hash = "sha256:c34e53358b103cd73f43c63f5f46f9b5c6c3467efdffcdf134892b89020494e4", size = 1020046, upload-time = "2026-10-22T17:47:21.554Z" } +sdist = { url = "https://files.pythonhosted.org/packages/1e/13/eef86ab444e9e797bb0e41f583904510fb36416571f6fbb93b9255e1e125/langchain_core-1.7.6.tar.gz", hash = "sha256:0833781e3a8e6fe83073c8412c21180a0545d5ccdf3437889951caf9589ece6c", size = 1037637, upload-time = "2026-11-05T00:21:56.343Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/b3/d8/ed130e91cee0525cb47d185b98a5a6ffd6a8b660a100fbee43d887e745d6/langchain_core-1.7.0-py3-none-any.whl", hash = "sha256:e82b24d7ac51fc74874baa29d6b3c0b8234880d4f3d897f8ff57fb80dfd9b07d", size = 574676, upload-time = "2026-10-22T17:47:19.749Z" }, + { url = "https://files.pythonhosted.org/packages/9d/a2/34c24dfc27ebd5002580deffe82975c507bb96af2540849aaa02c66027af/langchain_core-1.7.6-py3-none-any.whl", hash = "sha256:f61908be526fbeb5da8cc1ffd9d24bce3b50cf45b3a2f1737c1a7a2958046ce6", size = 580547, upload-time = "2026-11-05T00:21:54.883Z" }, ] [[package]] name = "langchain-openai" -version = "1.7.2" +version = "1.7.4" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "certifi" }, @@ -1694,9 +1695,9 @@ dependencies = [ { name = "openai" }, { name = "tiktoken" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/da/ca/b64799a9f2ee688aa6c238f5230b20d150b19cc5892bdcb6faf2b59866f1/langchain_openai-1.7.2.tar.gz", hash = "sha256:e1fcbc7a96f7c8c94679d61639a979bba88f27889c0a68dfa225b8057345328d", size = 3405949, upload-time = "2026-10-14T13:50:59.956Z" } +sdist = { url = "https://files.pythonhosted.org/packages/71/3c/10adfa3dcf1e7b93230b406a4c1db51cea59122a3eb70fed8109487beace/langchain_openai-1.7.4.tar.gz", hash = "sha256:8fd90e41588526d990f32262447adf8e130d7ce28ed66cefa315e64cc9dd12ce", size = 3410755, upload-time = "2026-11-04T16:55:37.274Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/39/5d/8c4888a21087e4cd1c32965613a1a17cfc8e90e41ba5205c3dad302f3410/langchain_openai-1.7.2-py3-none-any.whl", hash = "sha256:9be7980edf355ca2dd595b795a5125836ccf04515ef9377228913246156e59f5", size = 146367, upload-time = "2026-10-14T13:50:58.697Z" }, + { url = "https://files.pythonhosted.org/packages/46/c1/09d01a810d5f65f2f5f21231b6699e6efc241797790e18aba56c14aa754b/langchain_openai-1.7.4-py3-none-any.whl", hash = "sha256:aaee93369765bac7ebf640aab62f8ae16df403ed982737ae51f88f6a24a151ab", size = 146880, upload-time = "2026-11-04T16:55:35.897Z" }, ] [[package]] From d084f3914425e238b76b81287d1b5064a50d95ed Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Nov 2026 10:35:21 +0100 Subject: [PATCH 12/40] chore(deps): bump openinference-instrumentation-anthropic from 3.1.0 to 3.3.0 (#272) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- uv.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/uv.lock b/uv.lock index d1f6df8..72ad84d 100644 --- a/uv.lock +++ b/uv.lock @@ -2778,7 +2778,7 @@ wheels = [ [[package]] name = "openinference-instrumentation-anthropic" -version = "3.1.0" +version = "3.3.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "openinference-instrumentation" }, @@ -2789,9 +2789,9 @@ dependencies = [ { name = "typing-extensions" }, { name = "wrapt" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/e1/d2/52fb3fe4eb1ae11f03ee5228d3ce05c713ecd3d8cf0e15e3c2b8046b7817/openinference_instrumentation_anthropic-3.1.0.tar.gz", hash = "sha256:8c40c9dfd1d965e9ca0c2b8c021c86da21491f26ac8ab002764fa5948426bfe8", size = 26769, upload-time = "2026-10-23T20:49:51.47Z" } +sdist = { url = "https://files.pythonhosted.org/packages/12/78/4154149960378f4dcda4f7bd3873b397757539ff83452f24b412408e1e1e/openinference_instrumentation_anthropic-3.3.0.tar.gz", hash = "sha256:d8a10c64f621e020ec976a310cba6ce8e73e6c06397210b8aa83552a8dfddfa9", size = 29583, upload-time = "2026-10-31T04:07:27.544Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/82/e5/aff049d02cee0a0e999ab069274407d3264d52c3f73fc24e41300447c222/openinference_instrumentation_anthropic-3.1.0-py3-none-any.whl", hash = "sha256:be6cb36f30b38a8e3588c927ce609e98272746496352ae8f8c9c664b2f6dc37d", size = 31500, upload-time = "2026-10-23T20:49:49.86Z" }, + { url = "https://files.pythonhosted.org/packages/38/3c/75f244f86acdeb9cd9ecd053f722152ede8f1980292622cf98bb3ac3c458/openinference_instrumentation_anthropic-3.3.0-py3-none-any.whl", hash = "sha256:09f8dc7c64d07a7685802272642e13e20da37867380086ebbdc579748d4885f7", size = 34591, upload-time = "2026-10-31T04:07:26.288Z" }, ] [[package]] @@ -2868,11 +2868,11 @@ wheels = [ [[package]] name = "openinference-semantic-conventions" -version = "0.1.41" +version = "0.1.43" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/53/be/e1fe52e3ae242695101144e058edfdd8e412a58ce04e2e2b410268683b05/openinference_semantic_conventions-0.1.41.tar.gz", hash = "sha256:78d4ffd9d1f2f89cb4bd58a0afe5a460475ce3d76a4d993f50fb0ce8bf4129a3", size = 15789, upload-time = "2026-10-01T18:22:33.408Z" } +sdist = { url = "https://files.pythonhosted.org/packages/7e/dc/b3def81b3e243571ac4a96d41f44945f3c2c999c2a9c822b272ed4667e47/openinference_semantic_conventions-0.1.43.tar.gz", hash = "sha256:c12b213e8cbaa74c8fbf021d2959e244aceb39b5cefeb2c2cd8316235f2a905b", size = 16212, upload-time = "2026-10-29T22:13:22.01Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/74/fa/a5197690b860f8a5b43e56aba4a34e0b42db6548b45dd6ceda9ab8980c63/openinference_semantic_conventions-0.1.41-py3-none-any.whl", hash = "sha256:4c55f59427436da842c7aae871965399ef92b8909b41e02c076e1092b4c12e51", size = 12678, upload-time = "2026-10-01T18:22:32.275Z" }, + { url = "https://files.pythonhosted.org/packages/9f/11/02848572db2e9986f271853175cba2026d8ae46359d69d90deb19027f49f/openinference_semantic_conventions-0.1.43-py3-none-any.whl", hash = "sha256:058cf01935df390775605a87df07840dbd80ac1a92800a329c169b0d633f64ce", size = 12974, upload-time = "2026-10-29T22:13:20.246Z" }, ] [[package]] From 56c6e758a4ad045eb5a39b179a871b81b58ad515 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Nov 2026 10:35:51 +0100 Subject: [PATCH 13/40] chore(deps): bump opentelemetry-api from 1.45.1 to 1.45.2 (#273) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> From 4eb2dd36bcaa07efb24d14f1acb96b71d5038817 Mon Sep 17 00:00:00 2001 From: Pablo <39369995+PabloPardoGarcia@users.noreply.github.com> Date: Mon, 9 Nov 2026 10:56:09 +0100 Subject: [PATCH 14/40] test: count abandoned-stream usage per call, not across calls (#275) --- tests/test_llama_index_span_context.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/test_llama_index_span_context.py b/tests/test_llama_index_span_context.py index 5440190..a6ef9c9 100644 --- a/tests/test_llama_index_span_context.py +++ b/tests/test_llama_index_span_context.py @@ -357,9 +357,8 @@ def _usage_records(spans: list[ReadableSpan]) -> int: def test_an_abandoned_stream_never_counts_its_usage_twice(exported: Exported) -> None: # Abandoned after every chunk it yields, so the provider stream has sent # its usage but was never read to its end. The LlamaIndex span ends with - # no usage; the openai instrumentor ends its span only on the provider - # stream's end, so the call's usage is counted at most once (today: not - # at all, since that span never ends). + # no usage; only the openai instrumentor's span may carry the call's + # usage, so each call's usage is counted at most once. def abandon() -> None: stream = _llm().stream_chat(MESSAGES) for _ in range(5): @@ -378,7 +377,10 @@ async def aabandon() -> None: spans = exported.spans() outer = [s for s in spans if s.name in ("OpenAI.stream_chat", "OpenAI.astream_chat")] assert len(outer) == 2 - assert _usage_records(spans) <= 1 + for call in outer: + trace = [s for s in spans if s.context.trace_id == call.context.trace_id] + assert _usage_records(trace) <= 1 + assert _usage_records(spans) <= len(outer) assert _usage_records(outer) == 0 From 96a56b0a0a487c5b3df53b1cae19eb8eb4a83ad4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Nov 2026 12:00:36 +0100 Subject: [PATCH 15/40] chore(deps): bump openinference-instrumentation-openai from 0.1.65 to 0.1.69 (#274) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- uv.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/uv.lock b/uv.lock index 72ad84d..54fad50 100644 --- a/uv.lock +++ b/uv.lock @@ -2849,7 +2849,7 @@ wheels = [ [[package]] name = "openinference-instrumentation-openai" -version = "0.1.65" +version = "0.1.69" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "anyio" }, @@ -2861,9 +2861,9 @@ dependencies = [ { name = "typing-extensions" }, { name = "wrapt" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/bc/83/cb4fa924d602ddf47e495cfb776cb3c697955ca5d0363ed3dce565701bab/openinference_instrumentation_openai-0.1.65.tar.gz", hash = "sha256:86a83a656277165cc012c42e7bbc0569b7cf97b50081e11bd50cbd41f5c632de", size = 29859, upload-time = "2026-10-09T18:29:06.725Z" } +sdist = { url = "https://files.pythonhosted.org/packages/01/fe/208b6a11cd868c39e79b0973e9bcb596f87525c388be6b0e50ed079ca93c/openinference_instrumentation_openai-0.1.69.tar.gz", hash = "sha256:6020a7617ce5efa5c43ff59a11322570cf3d6906fc0d9dd3913e533179af0575", size = 30944, upload-time = "2026-10-31T04:07:25.806Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/10/ce/003b9366e7f01eb0b8373156a31c92c71ef44289d27e963e09ca7c581686/openinference_instrumentation_openai-0.1.65-py3-none-any.whl", hash = "sha256:aa29ae89aecfed1a705b3b91c8d631fc7cd2f136b31eafb3229d9cf464bf83f0", size = 37952, upload-time = "2026-10-09T18:29:05.017Z" }, + { url = "https://files.pythonhosted.org/packages/39/25/d6de19f9375f9f15723fde2eef19c54ef5a103f94c4afcf44c1a95d5374d/openinference_instrumentation_openai-0.1.69-py3-none-any.whl", hash = "sha256:c11f823ea99320732bc578d50c697c7d6b36cddfa14927e69b601a2eb3e8485b", size = 38614, upload-time = "2026-10-31T04:07:24.503Z" }, ] [[package]] From bd240cb4512cd10cc8f6b083616c222052fec3c9 Mon Sep 17 00:00:00 2001 From: Bahareh Darbandi Date: Thu, 12 Nov 2026 13:45:14 +0100 Subject: [PATCH 16/40] chore: identical-argument scenario for the hints harness (RIUS-1727) `--scenario identical` repeats search_docs with the same query, each call a TOOL span with its arguments captured, sequential and successful, while the run stays open: the loop CF-01's real detector needs. The scenario turns partial spans on, since the writer only addresses a run whose root is stored while open. MODEL=scripted replaces the model with a fixed script and no API call: it searches until a hint arrives, then looks the page up and answers, or gives up after --hold seconds. Its model calls are LLM spans with the conversation captured (none with --no-transcript), so the measurement can hold them against the tool spans. For the measurement's coverage checks: --session and --runs (a session keeps its arm across runs), --duplicate-export (every batch twice), --late-after/ --late-by (batches held back), --regular (a polling loop). Each run prints its own summary line, with its session and trace id. --- spike/hints/agent.py | 397 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 342 insertions(+), 55 deletions(-) diff --git a/spike/hints/agent.py b/spike/hints/agent.py index c027527..a20b02e 100644 --- a/spike/hints/agent.py +++ b/spike/hints/agent.py @@ -22,17 +22,42 @@ the instance's pending hints and skips the writer's compare-and-set, which is fine for a test instance and nothing else. -The queries change from search to search, so this loop does not meet CF-01's -identical-arguments condition; a real detector run needs a variant that -repeats the same call. +The default scenario changes its query from search to search, so it does not +meet CF-01's identical-arguments condition. ``--scenario identical`` is the +variant the real detector needs (RIUS-1727): search_docs is called again and +again with the same query, each call a TOOL span with its arguments captured, +sequential and successful, while the run stays open. Run it against a real +stack (receiver, sink, alert-manager with the tool_loop rule and the hint +writer), with no ``--auto-hint``: the hint then comes from the real detector +and writer. + + RIUS_ENDPOINT=... RIUS_API_KEY=... MODEL=scripted \ + uv run python spike/hints/agent.py --scenario identical --session s-1 --hold 120 + +``MODEL=scripted`` replaces the model with a fixed script and makes no API +call: it searches until a hint arrives, then looks the page up and answers; +with no hint it searches until ``--hold`` seconds after its first call and +gives up. Its model calls are LLM spans with the conversation captured (or, +with ``--no-transcript``, none), as an instrumented provider records them. +Scripted runs validate transport, detection, assignment and the measurement +report; they say nothing about whether a model follows a hint. + +Telemetry faults, for the measurement's coverage checks: ``--duplicate-export`` +sends every batch twice (an exporter retry after a lost response); +``--late-after A --late-by B`` holds every batch exported from A seconds after +start for B seconds (late telemetry). ``--runs N`` runs N runs one after the +other in the same session, so a session keeps its arm across runs. + +Hints need the run's root stored while it is open, so the scenario turns +partial spans on; with them off the writer finds no open run to address. The last line printed is a JSON summary, for collecting repeated runs. It is printed for every run, including one that failed, with its outcome (answer, max_turns, refusal or error) and whether the answer was correct. Env: RIUS_ENDPOINT, RIUS_API_KEY, RIUS_HINT_WORKSPACE, ANTHROPIC_API_KEY, -MODEL (default claude-opus-5-5), EFFORT (default low), HINT_VARIANT (slug, -tool or vague; default slug). +MODEL (default claude-opus-5-5; ``scripted`` for no model), EFFORT (default +low), HINT_VARIANT (slug, tool or vague; default slug). """ from __future__ import annotations @@ -42,16 +67,24 @@ import logging import os import subprocess +import threading import time import urllib.request +from collections.abc import Sequence +from contextlib import nullcontext +from dataclasses import dataclass, field from datetime import datetime, timedelta, timezone +from itertools import cycle from typing import Any import anthropic from opentelemetry import trace +from opentelemetry.sdk.trace import ReadableSpan +from opentelemetry.sdk.trace.export import SpanExporter, SpanExportResult import rius from rius import SpanKind +from rius.client import build_span_exporter MODEL = os.environ.get("MODEL", "claude-opus-5-5") EFFORT = os.environ.get("EFFORT", "low") @@ -85,6 +118,19 @@ "so if a search finds nothing, rephrase the query and search again." ) +# The identical-arguments scenario: the same query every time, as an agent +# does that retries a call it believes is only slow to warm up. +IDENTICAL_QUERY = "webhook retry policy" +SYSTEM_IDENTICAL = ( + "You answer questions about our payments platform from the internal docs. " + f"Use search_docs with the query {IDENTICAL_QUERY!r}. The search index is warming up: " + "if it returns nothing, run exactly the same search again." +) +# The scripted model's pause before each call, in seconds. Irregular, so the +# loop is no polling; --regular uses a fixed pause, which is. +IRREGULAR_GAPS_S = (2.0, 5.5, 3.0, 8.0, 4.0, 6.5, 2.5, 7.0) +REGULAR_GAP_S = 5.0 + TOOLS: list[dict[str, Any]] = [ { "name": "search_docs", @@ -118,8 +164,8 @@ } -def run_tool(name: str, args: dict[str, Any]) -> str: - time.sleep(TOOL_LATENCY_S) # keeps the run long enough for heartbeats to land +def run_tool(name: str, args: dict[str, Any], latency: float = TOOL_LATENCY_S) -> str: + time.sleep(latency) # keeps the run long enough for heartbeats to land if name == "search_docs": return json.dumps({"results": [], "total": 0}) # the silent failure if name == "lookup_index": @@ -191,16 +237,227 @@ def log(msg: str) -> None: print(f"{time.strftime('%H:%M:%S')} {msg}", flush=True) +class DuplicatingExporter(SpanExporter): + """Sends every batch twice, as an exporter retry after a lost response does.""" + + def __init__(self, inner: SpanExporter) -> None: + self._inner = inner + + def export(self, spans: Sequence[ReadableSpan]) -> SpanExportResult: + first = self._inner.export(spans) + self._inner.export(spans) + return first + + def shutdown(self) -> None: + self._inner.shutdown() + + def force_flush(self, timeout_millis: int = 30_000) -> bool: + return self._inner.force_flush(timeout_millis) + + +class LateExporter(SpanExporter): + """Holds every batch exported from ``after`` seconds on for ``by`` seconds.""" + + def __init__(self, inner: SpanExporter, after: float, by: float) -> None: + self._inner, self._by = inner, by + self._from = time.monotonic() + after + self._held: list[tuple[float, Sequence[ReadableSpan]]] = [] + self._lock = threading.Lock() + self._stop = threading.Event() + self._thread = threading.Thread(target=self._flush_due, daemon=True) + self._thread.start() + + def export(self, spans: Sequence[ReadableSpan]) -> SpanExportResult: + now = time.monotonic() + if now < self._from: + return self._inner.export(spans) + with self._lock: + self._held.append((now + self._by, list(spans))) + return SpanExportResult.SUCCESS + + def _flush_due(self, force: bool = False) -> None: + while True: + with self._lock: + due = [b for b in self._held if force or b[0] <= time.monotonic()] + self._held = [b for b in self._held if b not in due] + for _, batch in due: + self._inner.export(batch) + if force or self._stop.wait(1.0): + return + + def shutdown(self) -> None: + # Exit waits for the held batches: late, not lost. + with self._lock: + wait = max((at for at, _ in self._held), default=0.0) - time.monotonic() + if wait > 0: + log(f"[export] waiting {wait:.0f}s for held batches") + time.sleep(wait) + self._stop.set() + self._flush_due(force=True) + self._inner.shutdown() + + def force_flush(self, timeout_millis: int = 30_000) -> bool: + return self._inner.force_flush(timeout_millis) + + +@dataclass +class Block: + type: str + text: str = "" + id: str = "" + name: str = "" + input: dict[str, Any] = field(default_factory=dict) + + +@dataclass +class Reply: + stop_reason: str + content: list[Block] + + +class ScriptedModel: + """The identical scenario's model, with no API call. + + It searches with the same query until a hint is in the conversation, then + looks the page up and answers; with no hint, it gives up ``hold`` seconds + after its first call. + """ + + def __init__(self, hold: float) -> None: + self._hold, self._n = hold, 0 + self._first_call: float | None = None + + def reply(self, messages: list[dict[str, Any]]) -> Reply: + self._n += 1 + hinted = any(m["role"] == "system" for m in messages) + looked_up = any( + b.name == "lookup_index" + for m in messages + if m["role"] == "assistant" + for b in m["content"] + ) + if looked_up: + return Reply( + "end_turn", [Block("text", text="Failed webhooks are retried up to 7 times.")] + ) + if hinted: + return Reply( + "tool_use", + [ + Block( + "tool_use", + id=f"call_{self._n}", + name="lookup_index", + input={"topic": "payments/webhooks"}, + ) + ], + ) + now = time.monotonic() + if self._first_call is None: + self._first_call = now + if now - self._first_call >= self._hold: + return Reply("end_turn", [Block("text", text="I could not find it in the docs.")]) + return Reply( + "tool_use", + [ + Block( + "tool_use", + id=f"call_{self._n}", + name="search_docs", + input={"query": IDENTICAL_QUERY}, + ) + ], + ) + + +def as_messages(messages: list[dict[str, Any]]) -> list[dict[str, Any]]: + """The conversation as OpenAI-style messages, the shape the SDK records.""" + out: list[dict[str, Any]] = [] + for m in messages: + content = m["content"] + if isinstance(content, str): + out.append({"role": m["role"], "content": content}) + continue + if m["role"] == "assistant": + out.append(reply_message(content)) + continue + for r in content: # tool results + out.append({"role": "tool", "tool_call_id": r["tool_use_id"], "content": r["content"]}) + return out + + +def reply_message(content: list[Any]) -> dict[str, Any]: + message: dict[str, Any] = { + "role": "assistant", + "content": " ".join(b.text for b in content if b.type == "text"), + } + calls = [ + { + "id": b.id, + "type": "function", + "function": {"name": b.name, "arguments": json.dumps(b.input)}, + } + for b in content + if b.type == "tool_use" + ] + if calls: + message["tool_calls"] = calls + return message + + def main() -> None: parser = argparse.ArgumentParser() parser.add_argument("--auto-hint", type=int, metavar="N", default=0) + parser.add_argument("--scenario", choices=("search", "identical"), default="search") + parser.add_argument("--session", help="session id every run is scoped to") + parser.add_argument("--runs", type=int, default=1, help="runs, one after the other") + parser.add_argument( + "--hold", type=float, default=120.0, help="scripted: seconds an unhinted run keeps calling" + ) + parser.add_argument("--regular", action="store_true", help="scripted: fixed pause (polling)") + parser.add_argument( + "--no-transcript", action="store_true", help="scripted: capture no messages" + ) + parser.add_argument("--duplicate-export", action="store_true") + parser.add_argument("--late-after", type=float, default=0.0) + parser.add_argument("--late-by", type=float, default=0.0) opts = parser.parse_args() + scripted = MODEL == "scripted" + if scripted and opts.scenario != "identical": + parser.error("MODEL=scripted plays the identical scenario only") logging.basicConfig(level=logging.WARNING, format="%(asctime)s %(name)s %(message)s") logging.getLogger("rius").setLevel(logging.INFO) - rius.init(agent_name="docs-agent", heartbeat_interval=5, hints=True) + exporter: SpanExporter | None = None + if opts.duplicate_export or opts.late_by: + exporter = build_span_exporter(rius.resolve_config()) + if opts.duplicate_export: + exporter = DuplicatingExporter(exporter) + if opts.late_by: + exporter = LateExporter(exporter, opts.late_after, opts.late_by) + sdk = rius.init( + agent_name="docs-agent", + heartbeat_interval=5, + hints=True, + partial_spans=opts.scenario == "identical" or None, + span_exporter=exporter, + ) - client = anthropic.Anthropic() + summaries = [] + with rius.session(opts.session) if opts.session else nullcontext(): + for run in range(1, opts.runs + 1): + summaries.append(run_once(opts, run, scripted)) + sdk.flush() + for summary in summaries: + print(json.dumps(summary), flush=True) + + +def run_once(opts: argparse.Namespace, run: int, scripted: bool) -> dict[str, Any]: + client = None if scripted else anthropic.Anthropic() + model = ScriptedModel(opts.hold) if scripted else None + gaps = iter(cycle((REGULAR_GAP_S,) if opts.regular else IRREGULAR_GAPS_S)) + system = SYSTEM_IDENTICAL if opts.scenario == "identical" else SYSTEM + max_turns = 200 if scripted else MAX_TURNS messages: list[dict[str, Any]] = [ {"role": "user", "content": "How many times are failed payment webhooks retried?"} ] @@ -210,13 +467,15 @@ def main() -> None: queued_at: int | None = None searches_at_queue: int | None = None queue_error: str | None = None + trace_id = "" # answer, max_turns, refusal or error; correct says whether the answer has # the retry count from the docs page. outcome, answer, turn = "max_turns", "", 0 try: with rius.start_as_current_span("docs-agent", kind=SpanKind.AGENT, agent_name="docs-agent"): - for turn in range(1, MAX_TURNS + 1): + trace_id = current_trace_id() + for turn in range(1, max_turns + 1): # drain_hints() records rius.hint.delivered on the run's root span. for hint in rius.drain_hints(): # The hint is an operator note, not user input: the @@ -225,41 +484,52 @@ def main() -> None: messages.append({"role": "system", "content": hint.text}) hint_ids.append(hint.id) hinted_at = hinted_at or turn - log(f"[turn {turn}] hint {hint.id} injected: {hint.text}") - - response = client.beta.messages.create( - model=MODEL, - max_tokens=16000, - system=SYSTEM, - tools=TOOLS, # type: ignore[arg-type] - messages=messages, # type: ignore[arg-type] - output_config={"effort": EFFORT}, # type: ignore[typeddict-item] - betas=["server-side-fallback-2026-07-01"], - fallbacks="default", - ) + log(f"[run {run} turn {turn}] hint {hint.id} injected: {hint.text}") + + if model is not None: + response: Any = scripted_call(model, messages, opts.no_transcript) + else: + response = client.beta.messages.create( # type: ignore[union-attr] + model=MODEL, + max_tokens=16000, + system=system, + tools=TOOLS, # type: ignore[arg-type] + messages=messages, # type: ignore[arg-type] + output_config={"effort": EFFORT}, # type: ignore[typeddict-item] + betas=["server-side-fallback-2026-07-01"], + fallbacks="default", + ) if response.stop_reason == "refusal": - log(f"[turn {turn}] refusal: {response.stop_details}") + log(f"[run {run} turn {turn}] refusal: {response.stop_details}") outcome = "refusal" break messages.append({"role": "assistant", "content": response.content}) tool_uses = [b for b in response.content if b.type == "tool_use"] if response.stop_reason != "tool_use" or not tool_uses: answer = " ".join(b.text for b in response.content if b.type == "text") - log(f"[turn {turn}] final answer: {answer}") + log(f"[run {run} turn {turn}] final answer: {answer}") outcome = "answer" break results = [] for block in tool_uses: args = dict(block.input) # type: ignore[arg-type] - log(f"[turn {turn}] {block.name}({json.dumps(args)})") + log(f"[run {run} turn {turn}] {block.name}({json.dumps(args)})") calls.append((turn, block.name)) + # One TOOL span per call, its arguments captured: what + # the tool_loop detector groups calls by. + with rius.start_as_current_span( + block.name, + kind=SpanKind.TOOL, + input=args, + tool_name=block.name, + tool_call_id=block.id, + ) as span: + latency = next(gaps) if scripted else TOOL_LATENCY_S + result = run_tool(block.name, args, latency) + span.set_output(result) results.append( - { - "type": "tool_result", - "tool_use_id": block.id, - "content": run_tool(block.name, args), - } + {"type": "tool_result", "tool_use_id": block.id, "content": result} ) messages.append({"role": "user", "content": results}) @@ -276,31 +546,48 @@ def main() -> None: log(f"[detector] could not queue the hint: {queue_error}") except Exception as exc: # noqa: BLE001 — every run ends with a summary line outcome = "error" - log(f"[turn {turn}] run failed: {type(exc).__name__}: {exc}") - finally: - searches = [t for t, n in calls if n == "search_docs"] - summary = { - "model": MODEL, - "effort": EFFORT, - "variant": HINT_VARIANT if opts.auto_hint else None, - "outcome": outcome, - "correct": outcome == "answer" and "7" in answer, - "turns": turn, - "queued_at_turn": queued_at, - "search_docs_at_queue": searches_at_queue, - "queue_error": queue_error, - "hint_ids": hint_ids, - "hinted_at_turn": hinted_at, - "search_docs_total": len(searches), - "search_docs_before_hint": ( - sum(1 for t in searches if t < hinted_at) if hinted_at else None - ), - "search_docs_after_hint": ( - sum(1 for t in searches if t >= hinted_at) if hinted_at else None - ), - "first_lookup_index_turn": next((t for t, n in calls if n == "lookup_index"), None), - } - print(json.dumps(summary), flush=True) + log(f"[run {run} turn {turn}] run failed: {type(exc).__name__}: {exc}") + searches = [t for t, n in calls if n == "search_docs"] + return { + "model": MODEL, + "effort": None if scripted else EFFORT, + "scenario": opts.scenario, + "session": opts.session, + "run": run, + "trace_id": trace_id, + "variant": HINT_VARIANT if opts.auto_hint else None, + "outcome": outcome, + "correct": outcome == "answer" and "7" in answer, + "turns": turn, + "queued_at_turn": queued_at, + "search_docs_at_queue": searches_at_queue, + "queue_error": queue_error, + "hint_ids": hint_ids, + "hinted_at_turn": hinted_at, + "search_docs_total": len(searches), + "search_docs_before_hint": ( + sum(1 for t in searches if t < hinted_at) if hinted_at else None + ), + "search_docs_after_hint": ( + sum(1 for t in searches if t >= hinted_at) if hinted_at else None + ), + "first_lookup_index_turn": next((t for t, n in calls if n == "lookup_index"), None), + } + + +def scripted_call( + model: ScriptedModel, messages: list[dict[str, Any]], no_transcript: bool +) -> Reply: + """One scripted model call, recorded as an LLM span.""" + with rius.start_as_current_generation( + "chat scripted", model="scripted", provider="scripted" + ) as generation: + if not no_transcript: + generation.set_input(as_messages(messages)) + response = model.reply(messages) + if not no_transcript: + generation.set_output([reply_message(response.content)]) + return response if __name__ == "__main__": From 09d2ca071fb2e648ef69a651688501566c59f4f9 Mon Sep 17 00:00:00 2001 From: Bahareh Darbandi Date: Thu, 12 Nov 2026 14:13:27 +0100 Subject: [PATCH 17/40] chore: the hints harness sets each run's answer as its root output The measurement tells a run that ended with an answer from one that ended without by the root span's output; without it every harness run read as ended_no_output. --- spike/hints/agent.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/spike/hints/agent.py b/spike/hints/agent.py index a20b02e..0cc1b9d 100644 --- a/spike/hints/agent.py +++ b/spike/hints/agent.py @@ -473,7 +473,9 @@ def run_once(opts: argparse.Namespace, run: int, scripted: bool) -> dict[str, An outcome, answer, turn = "max_turns", "", 0 try: - with rius.start_as_current_span("docs-agent", kind=SpanKind.AGENT, agent_name="docs-agent"): + with rius.start_as_current_span( + "docs-agent", kind=SpanKind.AGENT, agent_name="docs-agent" + ) as run_span: trace_id = current_trace_id() for turn in range(1, max_turns + 1): # drain_hints() records rius.hint.delivered on the run's root span. @@ -509,6 +511,9 @@ def run_once(opts: argparse.Namespace, run: int, scripted: bool) -> dict[str, An answer = " ".join(b.text for b in response.content if b.type == "text") log(f"[run {run} turn {turn}] final answer: {answer}") outcome = "answer" + # The run's output on its root: what tells a run that + # ended with an answer from one that ended without. + run_span.set_output(answer) break results = [] From bcace1f6ef87c1c8554a15ddfa67559894ddcaed Mon Sep 17 00:00:00 2001 From: Bahareh Darbandi Date: Thu, 12 Nov 2026 15:07:03 +0100 Subject: [PATCH 18/40] chore: hints harness tasks that never ask the model to repeat a call (RIUS-1850) spike/hints/tasks.py adds three tasks with a known answer and a fixed success criterion, each with a tool flaw a real integration has and a second tool that leads to the answer: - orders: the order listing's cursor never advances (page 2 hands back its own token); the monthly summary has the answer (4 orders, 1280.50). - refund: the refund status is stuck on processing; the processor's event history shows it was rejected (card expired). - docs: search returns nothing for any query; the legacy index has the page (7 retries). A model usually rephrases, so this shows how often a natural loop does not meet CF-01. The prompts say nothing about retrying. `identical` moves into the same table, unchanged, and stays the pipeline check: its prompt does ask for the repeat. MODEL=stub serves a task's script as the Messages API on localhost, so the real Anthropic client and its instrumentation record the LLM spans a paid run would, at no cost. The scripted model now plays any task. Every task turns partial spans on (the writer needs the open root stored), and --auto-hint counts the task's own loop tool. Summaries carry tool call counts per tool, and --max-turns bounds a real model's run. --- spike/hints/agent.py | 180 ++++++++++++++++++------------ spike/hints/tasks.py | 253 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 366 insertions(+), 67 deletions(-) create mode 100644 spike/hints/tasks.py diff --git a/spike/hints/agent.py b/spike/hints/agent.py index 0cc1b9d..88cb49f 100644 --- a/spike/hints/agent.py +++ b/spike/hints/agent.py @@ -48,7 +48,7 @@ start for B seconds (late telemetry). ``--runs N`` runs N runs one after the other in the same session, so a session keeps its arm across runs. -Hints need the run's root stored while it is open, so the scenario turns +Hints need the run's root stored while it is open, so every task turns partial spans on; with them off the writer finds no open run to address. The last line printed is a JSON summary, for collecting repeated runs. It is @@ -74,6 +74,7 @@ from contextlib import nullcontext from dataclasses import dataclass, field from datetime import datetime, timedelta, timezone +from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer from itertools import cycle from typing import Any @@ -81,6 +82,7 @@ from opentelemetry import trace from opentelemetry.sdk.trace import ReadableSpan from opentelemetry.sdk.trace.export import SpanExporter, SpanExportResult +from tasks import TASKS, WEBHOOK_QUESTION, Task import rius from rius import SpanKind @@ -118,14 +120,6 @@ "so if a search finds nothing, rephrase the query and search again." ) -# The identical-arguments scenario: the same query every time, as an agent -# does that retries a call it believes is only slow to warm up. -IDENTICAL_QUERY = "webhook retry policy" -SYSTEM_IDENTICAL = ( - "You answer questions about our payments platform from the internal docs. " - f"Use search_docs with the query {IDENTICAL_QUERY!r}. The search index is warming up: " - "if it returns nothing, run exactly the same search again." -) # The scripted model's pause before each call, in seconds. Irregular, so the # loop is no polling; --regular uses a fixed pause, which is. IRREGULAR_GAPS_S = (2.0, 5.5, 3.0, 8.0, 4.0, 6.5, 2.5, 7.0) @@ -316,58 +310,95 @@ class Reply: class ScriptedModel: - """The identical scenario's model, with no API call. + """A task's fixed script in place of a model, with no API call. - It searches with the same query until a hint is in the conversation, then - looks the page up and answers; with no hint, it gives up ``hold`` seconds - after its first call. + It makes the task's opening calls, then repeats its loop call until a hint + is in the conversation, then makes the resolving call and answers; with + no hint it gives up ``hold`` seconds after the run's first call. It reads + the conversation the way a model gets it, so the same script serves the + in-process model (MODEL=scripted) and the stub API (MODEL=stub). """ - def __init__(self, hold: float) -> None: - self._hold, self._n = hold, 0 + def __init__(self, task: Task, hold: float) -> None: + self._task, self._hold, self._n = task, hold, 0 self._first_call: float | None = None - def reply(self, messages: list[dict[str, Any]]) -> Reply: + def reply(self, messages: list[Any]) -> Reply: self._n += 1 - hinted = any(m["role"] == "system" for m in messages) - looked_up = any( - b.name == "lookup_index" + if len(messages) == 1: # a new run + self._first_call = None + calls = [ + _field(b, "name") for m in messages - if m["role"] == "assistant" - for b in m["content"] - ) - if looked_up: - return Reply( - "end_turn", [Block("text", text="Failed webhooks are retried up to 7 times.")] - ) + if _field(m, "role") == "assistant" and isinstance(_field(m, "content"), list) + for b in _field(m, "content") + if _field(b, "type") == "tool_use" + ] + hinted = any(_field(m, "role") == "system" for m in messages) + t = self._task + if t.resolve[0] in calls: + return Reply("end_turn", [Block("text", text=t.answer)]) + if len(calls) < len(t.opening): + return self._call(t.opening[len(calls)]) if hinted: - return Reply( - "tool_use", - [ - Block( - "tool_use", - id=f"call_{self._n}", - name="lookup_index", - input={"topic": "payments/webhooks"}, - ) - ], - ) + return self._call(t.resolve) now = time.monotonic() if self._first_call is None: self._first_call = now if now - self._first_call >= self._hold: - return Reply("end_turn", [Block("text", text="I could not find it in the docs.")]) - return Reply( - "tool_use", - [ - Block( - "tool_use", - id=f"call_{self._n}", - name="search_docs", - input={"query": IDENTICAL_QUERY}, - ) - ], - ) + return Reply("end_turn", [Block("text", text=t.give_up)]) + return self._call(t.loop) + + def _call(self, call: tuple[str, dict[str, Any]]) -> Reply: + name, args = call + return Reply("tool_use", [Block("tool_use", id=f"call_{self._n}", name=name, input=args)]) + + +def _field(item: Any, key: str) -> Any: + return item.get(key) if isinstance(item, dict) else getattr(item, key, None) + + +def start_stub(model: ScriptedModel) -> str: + """Serve the script as the Messages API on localhost; returns its base URL. + + The real Anthropic client and its instrumentation run against it, so the + LLM spans are the ones a paid run records, at no cost. + """ + + class Handler(BaseHTTPRequestHandler): + def do_POST(self) -> None: # noqa: N802 — http.server's name + body = json.loads(self.rfile.read(int(self.headers["Content-Length"]))) + reply = model.reply(body["messages"]) + content = [ + {"type": "text", "text": b.text} + if b.type == "text" + else {"type": "tool_use", "id": b.id, "name": b.name, "input": b.input} + for b in reply.content + ] + out = json.dumps( + { + "id": f"msg_stub_{time.monotonic_ns()}", + "type": "message", + "role": "assistant", + "model": body.get("model", "stub"), + "content": content, + "stop_reason": reply.stop_reason, + "stop_sequence": None, + "usage": {"input_tokens": len(json.dumps(body)) // 4, "output_tokens": 40}, + } + ).encode() + self.send_response(200) + self.send_header("Content-Type", "application/json") + self.send_header("Content-Length", str(len(out))) + self.end_headers() + self.wfile.write(out) + + def log_message(self, *args: Any) -> None: + pass + + server = ThreadingHTTPServer(("127.0.0.1", 0), Handler) + threading.Thread(target=server.serve_forever, daemon=True).start() + return f"http://127.0.0.1:{server.server_address[1]}" def as_messages(messages: list[dict[str, Any]]) -> list[dict[str, Any]]: @@ -408,13 +439,14 @@ def reply_message(content: list[Any]) -> dict[str, Any]: def main() -> None: parser = argparse.ArgumentParser() parser.add_argument("--auto-hint", type=int, metavar="N", default=0) - parser.add_argument("--scenario", choices=("search", "identical"), default="search") + parser.add_argument("--scenario", choices=("search", *TASKS), default="search") parser.add_argument("--session", help="session id every run is scoped to") parser.add_argument("--runs", type=int, default=1, help="runs, one after the other") parser.add_argument( - "--hold", type=float, default=120.0, help="scripted: seconds an unhinted run keeps calling" + "--hold", type=float, default=120.0, help="scripted/stub: seconds an unhinted run loops" ) - parser.add_argument("--regular", action="store_true", help="scripted: fixed pause (polling)") + parser.add_argument("--regular", action="store_true", help="scripted/stub: fixed pauses") + parser.add_argument("--max-turns", type=int, default=MAX_TURNS, help="a real model's turns") parser.add_argument( "--no-transcript", action="store_true", help="scripted: capture no messages" ) @@ -422,9 +454,9 @@ def main() -> None: parser.add_argument("--late-after", type=float, default=0.0) parser.add_argument("--late-by", type=float, default=0.0) opts = parser.parse_args() - scripted = MODEL == "scripted" - if scripted and opts.scenario != "identical": - parser.error("MODEL=scripted plays the identical scenario only") + scripted = MODEL in ("scripted", "stub") + if scripted and opts.scenario == "search": + parser.error(f"MODEL={MODEL} plays a task, not the search scenario") logging.basicConfig(level=logging.WARNING, format="%(asctime)s %(name)s %(message)s") logging.getLogger("rius").setLevel(logging.INFO) @@ -439,7 +471,7 @@ def main() -> None: agent_name="docs-agent", heartbeat_interval=5, hints=True, - partial_spans=opts.scenario == "identical" or None, + partial_spans=opts.scenario in TASKS or None, span_exporter=exporter, ) @@ -453,14 +485,20 @@ def main() -> None: def run_once(opts: argparse.Namespace, run: int, scripted: bool) -> dict[str, Any]: - client = None if scripted else anthropic.Anthropic() - model = ScriptedModel(opts.hold) if scripted else None + task = TASKS.get(opts.scenario) + system = task.system if task else SYSTEM + tools = task.tools if task else TOOLS + question = task.question if task else WEBHOOK_QUESTION + model = ScriptedModel(task, opts.hold) if scripted and task else None + client = None + if MODEL == "stub": + client = anthropic.Anthropic(base_url=start_stub(model), api_key="stub") # type: ignore[arg-type] + model = None + elif not scripted: + client = anthropic.Anthropic() gaps = iter(cycle((REGULAR_GAP_S,) if opts.regular else IRREGULAR_GAPS_S)) - system = SYSTEM_IDENTICAL if opts.scenario == "identical" else SYSTEM - max_turns = 200 if scripted else MAX_TURNS - messages: list[dict[str, Any]] = [ - {"role": "user", "content": "How many times are failed payment webhooks retried?"} - ] + max_turns = 200 if scripted else opts.max_turns + messages: list[dict[str, Any]] = [{"role": "user", "content": question}] calls: list[tuple[int, str]] = [] # (turn, tool name) hint_ids: list[str] = [] hinted_at: int | None = None @@ -495,7 +533,7 @@ def run_once(opts: argparse.Namespace, run: int, scripted: bool) -> dict[str, An model=MODEL, max_tokens=16000, system=system, - tools=TOOLS, # type: ignore[arg-type] + tools=tools, # type: ignore[arg-type] messages=messages, # type: ignore[arg-type] output_config={"effort": EFFORT}, # type: ignore[typeddict-item] betas=["server-side-fallback-2026-07-01"], @@ -531,14 +569,19 @@ def run_once(opts: argparse.Namespace, run: int, scripted: bool) -> dict[str, An tool_call_id=block.id, ) as span: latency = next(gaps) if scripted else TOOL_LATENCY_S - result = run_tool(block.name, args, latency) + if task: + time.sleep(latency) + result = task.run(block.name, args) + else: + result = run_tool(block.name, args, latency) span.set_output(result) results.append( {"type": "tool_result", "tool_use_id": block.id, "content": result} ) messages.append({"role": "user", "content": results}) - empty = sum(1 for _, name in calls if name == "search_docs") + looped = task.loop[0] if task else "search_docs" + empty = sum(1 for _, name in calls if name == looped) if opts.auto_hint and queued_at is None and empty >= opts.auto_hint: # The hint reaches the model a ping or more later, after # more searches: queued_at_turn and search_docs_before_hint @@ -562,7 +605,10 @@ def run_once(opts: argparse.Namespace, run: int, scripted: bool) -> dict[str, An "trace_id": trace_id, "variant": HINT_VARIANT if opts.auto_hint else None, "outcome": outcome, - "correct": outcome == "answer" and "7" in answer, + "correct": outcome == "answer" and (task.correct(answer) if task else "7" in answer), + "calls": { + name: sum(1 for _, n in calls if n == name) for name in sorted({n for _, n in calls}) + }, "turns": turn, "queued_at_turn": queued_at, "search_docs_at_queue": searches_at_queue, diff --git a/spike/hints/tasks.py b/spike/hints/tasks.py new file mode 100644 index 0000000..09b1054 --- /dev/null +++ b/spike/hints/tasks.py @@ -0,0 +1,253 @@ +"""Tasks for the hints harness, each with a known answer. + +``identical`` is the pipeline check: its prompt tells the model to repeat the +same search, so a loop is guaranteed and says nothing about real agents. The +other tasks never ask for a repeat. Each gives the model a tool with a flaw a +real integration has, which an agent may or may not loop on, and a second +tool that leads to the answer: + +* ``orders``: the order listing's cursor never advances, so the next page is + always the same page. The monthly summary has the answer. +* ``refund``: the refund status is stuck on ``processing``. The processor's + event history shows it was rejected. +* ``docs``: full-text search returns nothing for any query. The legacy index + has the page. A model usually rephrases, so most loops here are not + identical calls: this task shows how often a natural loop does NOT meet + CF-01. + +``correct`` is each task's success criterion, checked on the final answer. +``loop``, ``resolve`` and the answers drive the scripted model (MODEL=scripted +or MODEL=stub); a real model gets only ``system``, ``question`` and ``tools``. +""" + +from __future__ import annotations + +import json +from collections.abc import Callable +from dataclasses import dataclass, field +from typing import Any + +Call = tuple[str, dict[str, Any]] + + +@dataclass(frozen=True) +class Task: + name: str + system: str + question: str + tools: list[dict[str, Any]] + run: Callable[[str, dict[str, Any]], str] + correct: Callable[[str], bool] + # The scripted model: the opening calls, then ``loop`` until a hint + # arrives or it gives up, then ``resolve`` and ``answer``. + loop: Call + resolve: Call + answer: str + give_up: str + opening: list[Call] = field(default_factory=list) + + +def _tool(name: str, description: str, **props: dict[str, Any]) -> dict[str, Any]: + required = [k for k, v in props.items() if not v.pop("optional", False)] + return { + "name": name, + "description": description, + "input_schema": { + "type": "object", + "properties": props, + "required": required, + "additionalProperties": False, + }, + } + + +SUPPORT = ( + "You are a support assistant for an online store. Use the tools to look up " + "what you need, then answer the support agent's question. Be concise." +) + +# --- docs (and the identical pipeline check) ------------------------------- + +DOCS_TOOLS = [ + _tool( + "search_docs", + "Full-text search over the internal documentation.", + query={"type": "string"}, + ), + _tool( + "lookup_index", + "Fetch a page from the legacy docs index by exact topic slug, such as 'billing/invoices'.", + topic={"type": "string"}, + ), +] +WEBHOOK_PAGE = ( + "Webhooks: failed deliveries are retried up to 7 times with exponential backoff, " + "starting at 30 seconds." +) + + +def _docs(name: str, args: dict[str, Any]) -> str: + if name == "search_docs": + return json.dumps({"results": [], "total": 0}) + if name == "lookup_index": + if args["topic"].strip("/ ").lower() == "payments/webhooks": + return WEBHOOK_PAGE + return json.dumps({"error": f"no page for topic {args['topic']!r}"}) + return json.dumps({"error": f"unknown tool {name}"}) + + +IDENTICAL_QUERY = "webhook retry policy" +WEBHOOK_QUESTION = "How many times are failed payment webhooks retried?" + +# --- orders ---------------------------------------------------------------- + +ORDERS = { + None: { + "orders": [ + {"id": "O-5512", "date": "2026-10-28", "total": "420.00"}, + {"id": "O-5379", "date": "2026-10-19", "total": "315.50"}, + ], + "next_page_token": "pg_2", + }, + # The cursor bug: page 2 hands back its own token. + "pg_2": { + "orders": [ + {"id": "O-5260", "date": "2026-10-11", "total": "299.00"}, + {"id": "O-5101", "date": "2026-10-02", "total": "246.00"}, + ], + "next_page_token": "pg_2", + }, +} + + +def _orders(name: str, args: dict[str, Any]) -> str: + if args.get("customer_id") != "C-1042": + return json.dumps({"error": "customer not found"}) + if name == "list_orders": + page = ORDERS.get(args.get("page_token")) + return json.dumps(page) if page else json.dumps({"error": "invalid page_token"}) + if name == "get_customer_summary": + if args.get("month") != "2026-10": + return json.dumps({"month": args.get("month"), "order_count": 0, "total": "0.00"}) + return json.dumps({"month": "2026-10", "order_count": 4, "total": "1280.50"}) + return json.dumps({"error": f"unknown tool {name}"}) + + +# --- refund ---------------------------------------------------------------- + + +def _refund(name: str, args: dict[str, Any]) -> str: + if args.get("refund_id") != "R-7731": + return json.dumps({"error": "refund not found"}) + if name == "get_refund_status": + return json.dumps( + {"refund_id": "R-7731", "status": "processing", "last_updated": "2026-11-03T09:12:00Z"} + ) + if name == "get_refund_events": + return json.dumps( + { + "refund_id": "R-7731", + "events": [ + {"at": "2026-11-03T09:11:58Z", "type": "created", "amount": "89.90"}, + {"at": "2026-11-03T09:12:00Z", "type": "submitted_to_processor"}, + {"at": "2026-11-04T06:40:12Z", "type": "rejected", "reason": "card_expired"}, + ], + } + ) + return json.dumps({"error": f"unknown tool {name}"}) + + +def _has(answer: str, *words: str) -> bool: + a = answer.lower().replace(",", "") + return all(w in a for w in words) + + +TASKS: dict[str, Task] = { + "identical": Task( + name="identical", + system=( + "You answer questions about our payments platform from the internal docs. " + f"Use search_docs with the query {IDENTICAL_QUERY!r}. The search index is " + "warming up: if it returns nothing, run exactly the same search again." + ), + question=WEBHOOK_QUESTION, + tools=DOCS_TOOLS, + run=_docs, + correct=lambda a: "7" in a, + loop=("search_docs", {"query": IDENTICAL_QUERY}), + resolve=("lookup_index", {"topic": "payments/webhooks"}), + answer="Failed webhooks are retried up to 7 times.", + give_up="I could not find it in the docs.", + ), + "docs": Task( + name="docs", + system=( + "You answer questions about our payments platform from the internal docs. " + "Use the tools to find the answer. Be concise." + ), + question=WEBHOOK_QUESTION, + tools=DOCS_TOOLS, + run=_docs, + correct=lambda a: "7" in a, + loop=("search_docs", {"query": "webhook retries"}), + resolve=("lookup_index", {"topic": "payments/webhooks"}), + answer="Failed webhooks are retried up to 7 times.", + give_up="I could not find it in the docs.", + ), + "orders": Task( + name="orders", + system=SUPPORT, + question=( + "How many orders did customer C-1042 place in October 2026, and what was " + "their total value?" + ), + tools=[ + _tool( + "list_orders", + "List a customer's orders, newest first, one page at a time. Pass the " + "next_page_token of a page to get the page after it.", + customer_id={"type": "string"}, + page_token={"type": "string", "optional": True}, + ), + _tool( + "get_customer_summary", + "A customer's totals for one month (YYYY-MM): order count and value.", + customer_id={"type": "string"}, + month={"type": "string"}, + ), + ], + run=_orders, + correct=lambda a: _has(a, "4") and _has(a, "1280.50"), + opening=[("list_orders", {"customer_id": "C-1042"})], + loop=("list_orders", {"customer_id": "C-1042", "page_token": "pg_2"}), + resolve=("get_customer_summary", {"customer_id": "C-1042", "month": "2026-10"}), + answer="4 orders in October 2026, totalling $1,280.50.", + give_up="I could not get the full order list.", + ), + "refund": Task( + name="refund", + system=SUPPORT, + question=( + "A customer asks whether refund R-7731 has gone through. Find out, and tell " + "me what to reply." + ), + tools=[ + _tool( + "get_refund_status", + "The current status of a refund.", + refund_id={"type": "string"}, + ), + _tool( + "get_refund_events", + "A refund's event history, as reported by the payment processor.", + refund_id={"type": "string"}, + ), + ], + run=_refund, + correct=lambda a: _has(a, "reject") or _has(a, "expired"), + loop=("get_refund_status", {"refund_id": "R-7731"}), + resolve=("get_refund_events", {"refund_id": "R-7731"}), + answer="It was rejected: the card has expired. Ask the customer for another card.", + give_up="The refund is still processing.", + ), +} From 51662144a47936d28e5c111ed48f93805a1eb79d Mon Sep 17 00:00:00 2001 From: Bahareh Darbandi Date: Thu, 12 Nov 2026 15:48:25 +0100 Subject: [PATCH 19/40] chore: hints harness summaries carry the model calls' token usage input_tokens (uncached and cache writes), cache_read_tokens and output_tokens per run, so a paid trial reports what it spent. --- spike/hints/agent.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spike/hints/agent.py b/spike/hints/agent.py index 88cb49f..00a62a5 100644 --- a/spike/hints/agent.py +++ b/spike/hints/agent.py @@ -506,6 +506,7 @@ def run_once(opts: argparse.Namespace, run: int, scripted: bool) -> dict[str, An searches_at_queue: int | None = None queue_error: str | None = None trace_id = "" + input_tokens = cache_read_tokens = output_tokens = 0 # answer, max_turns, refusal or error; correct says whether the answer has # the retry count from the docs page. outcome, answer, turn = "max_turns", "", 0 @@ -539,6 +540,13 @@ def run_once(opts: argparse.Namespace, run: int, scripted: bool) -> dict[str, An betas=["server-side-fallback-2026-07-01"], fallbacks="default", ) + usage = getattr(response, "usage", None) + if usage is not None: + input_tokens += (usage.input_tokens or 0) + ( + getattr(usage, "cache_creation_input_tokens", 0) or 0 + ) + cache_read_tokens += getattr(usage, "cache_read_input_tokens", 0) or 0 + output_tokens += usage.output_tokens or 0 if response.stop_reason == "refusal": log(f"[run {run} turn {turn}] refusal: {response.stop_details}") outcome = "refusal" From 125ffca0bada33e6bce5333ce25ffd2d1bf2cb9f Mon Sep 17 00:00:00 2001 From: Bahareh Darbandi Date: Thu, 12 Nov 2026 15:49:29 +0100 Subject: [PATCH 20/40] chore: put the token counts in the hints harness summary line --- spike/hints/agent.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spike/hints/agent.py b/spike/hints/agent.py index 00a62a5..28ddf04 100644 --- a/spike/hints/agent.py +++ b/spike/hints/agent.py @@ -614,6 +614,9 @@ def run_once(opts: argparse.Namespace, run: int, scripted: bool) -> dict[str, An "variant": HINT_VARIANT if opts.auto_hint else None, "outcome": outcome, "correct": outcome == "answer" and (task.correct(answer) if task else "7" in answer), + "input_tokens": input_tokens, + "cache_read_tokens": cache_read_tokens, + "output_tokens": output_tokens, "calls": { name: sum(1 for _, n in calls if n == name) for name in sorted({n for _, n in calls}) }, From 643f536d364e95fb0aec4ca1810223026ddfb132 Mon Sep 17 00:00:00 2001 From: Bahareh Darbandi Date: Thu, 12 Nov 2026 16:13:12 +0100 Subject: [PATCH 21/40] chore: deterministic hints harness faults for the measurement's negative checks For the scripted and stub models: --loop-calls N gives up after N loop calls and --idle S keeps the run open S seconds before answering, so a loop can stop while its run is still open. --drop-call K never exports the K-th span of the loop tool, nor its snapshot (a lost call). --fail-first K and --fail-every K give loop calls an error status (retries, which exclude_retries leaves out). --no-hints starts the SDK without hints, so a treatment decision is never handed over. --- spike/hints/agent.py | 85 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 78 insertions(+), 7 deletions(-) diff --git a/spike/hints/agent.py b/spike/hints/agent.py index 28ddf04..f853d08 100644 --- a/spike/hints/agent.py +++ b/spike/hints/agent.py @@ -294,6 +294,32 @@ def force_flush(self, timeout_millis: int = 30_000) -> bool: return self._inner.force_flush(timeout_millis) +class DroppingExporter(SpanExporter): + """Never exports the k-th span of a tool, nor any snapshot of it: a lost call.""" + + def __init__(self, inner: SpanExporter, tool: str, k: int) -> None: + self._inner, self._tool, self._k = inner, tool, k + self._seen: list[int] = [] + + def export(self, spans: Sequence[ReadableSpan]) -> SpanExportResult: + kept = [] + for span in spans: + if span.name == self._tool and span.context is not None: + sid = span.context.span_id + if sid not in self._seen: + self._seen.append(sid) + if self._seen.index(sid) + 1 == self._k: + continue + kept.append(span) + return self._inner.export(kept) if kept else SpanExportResult.SUCCESS + + def shutdown(self) -> None: + self._inner.shutdown() + + def force_flush(self, timeout_millis: int = 30_000) -> bool: + return self._inner.force_flush(timeout_millis) + + @dataclass class Block: type: str @@ -319,21 +345,26 @@ class ScriptedModel: in-process model (MODEL=scripted) and the stub API (MODEL=stub). """ - def __init__(self, task: Task, hold: float) -> None: + def __init__(self, task: Task, hold: float, loop_calls: int = 0, idle: float = 0.0) -> None: self._task, self._hold, self._n = task, hold, 0 + self._loop_calls, self._idle = loop_calls, idle self._first_call: float | None = None def reply(self, messages: list[Any]) -> Reply: self._n += 1 if len(messages) == 1: # a new run self._first_call = None - calls = [ - _field(b, "name") + uses = [ + b for m in messages if _field(m, "role") == "assistant" and isinstance(_field(m, "content"), list) for b in _field(m, "content") if _field(b, "type") == "tool_use" ] + calls = [_field(b, "name") for b in uses] + looped = sum( + 1 for b in uses[len(self._task.opening) :] if _field(b, "name") == self._task.loop[0] + ) hinted = any(_field(m, "role") == "system" for m in messages) t = self._task if t.resolve[0] in calls: @@ -345,7 +376,12 @@ def reply(self, messages: list[Any]) -> Reply: now = time.monotonic() if self._first_call is None: self._first_call = now - if now - self._first_call >= self._hold: + if now - self._first_call >= self._hold or ( + self._loop_calls and looped >= self._loop_calls + ): + # The run stays open while it "thinks": a loop that stops is + # not a run that ends at once. + time.sleep(self._idle) return Reply("end_turn", [Block("text", text=t.give_up)]) return self._call(t.loop) @@ -453,6 +489,21 @@ def main() -> None: parser.add_argument("--duplicate-export", action="store_true") parser.add_argument("--late-after", type=float, default=0.0) parser.add_argument("--late-by", type=float, default=0.0) + parser.add_argument( + "--loop-calls", + type=int, + default=0, + help="scripted/stub: give up after this many loop calls", + ) + parser.add_argument( + "--idle", type=float, default=0.0, help="scripted/stub: seconds the run stays open after" + ) + parser.add_argument( + "--drop-call", type=int, default=0, help="never export the K-th loop-tool span (lost)" + ) + parser.add_argument("--fail-first", type=int, default=0, help="the first K loop calls error") + parser.add_argument("--fail-every", type=int, default=0, help="every K-th loop call errors") + parser.add_argument("--no-hints", action="store_true", help="the SDK does not take hints") opts = parser.parse_args() scripted = MODEL in ("scripted", "stub") if scripted and opts.scenario == "search": @@ -461,8 +512,13 @@ def main() -> None: logging.basicConfig(level=logging.WARNING, format="%(asctime)s %(name)s %(message)s") logging.getLogger("rius").setLevel(logging.INFO) exporter: SpanExporter | None = None - if opts.duplicate_export or opts.late_by: + task = TASKS.get(opts.scenario) + if opts.duplicate_export or opts.late_by or opts.drop_call: exporter = build_span_exporter(rius.resolve_config()) + if opts.drop_call: + exporter = DroppingExporter( + exporter, task.loop[0] if task else "search_docs", opts.drop_call + ) if opts.duplicate_export: exporter = DuplicatingExporter(exporter) if opts.late_by: @@ -470,7 +526,7 @@ def main() -> None: sdk = rius.init( agent_name="docs-agent", heartbeat_interval=5, - hints=True, + hints=not opts.no_hints, partial_spans=opts.scenario in TASKS or None, span_exporter=exporter, ) @@ -489,7 +545,9 @@ def run_once(opts: argparse.Namespace, run: int, scripted: bool) -> dict[str, An system = task.system if task else SYSTEM tools = task.tools if task else TOOLS question = task.question if task else WEBHOOK_QUESTION - model = ScriptedModel(task, opts.hold) if scripted and task else None + model = ( + ScriptedModel(task, opts.hold, opts.loop_calls, opts.idle) if scripted and task else None + ) client = None if MODEL == "stub": client = anthropic.Anthropic(base_url=start_stub(model), api_key="stub") # type: ignore[arg-type] @@ -507,6 +565,7 @@ def run_once(opts: argparse.Namespace, run: int, scripted: bool) -> dict[str, An queue_error: str | None = None trace_id = "" input_tokens = cache_read_tokens = output_tokens = 0 + loop_n, failed = 0, False # answer, max_turns, refusal or error; correct says whether the answer has # the retry count from the docs page. outcome, answer, turn = "max_turns", "", 0 @@ -579,10 +638,22 @@ def run_once(opts: argparse.Namespace, run: int, scripted: bool) -> dict[str, An latency = next(gaps) if scripted else TOOL_LATENCY_S if task: time.sleep(latency) + if (block.name, args) == task.loop: + loop_n += 1 + if (opts.fail_first and loop_n <= opts.fail_first) or ( + opts.fail_every and loop_n % opts.fail_every == 0 + ): + failed = True result = task.run(block.name, args) else: result = run_tool(block.name, args, latency) span.set_output(result) + if failed: + # An error status on the span: a retry, which + # exclude_retries leaves out of the loop. + span.record_exception(TimeoutError("upstream timeout")) + result = json.dumps({"error": "upstream timeout"}) + failed = False results.append( {"type": "tool_result", "tool_use_id": block.id, "content": result} ) From 19d4eaf87c3d2f6800469899f4f097d5506f8554 Mon Sep 17 00:00:00 2001 From: Pablo <39369995+PabloPardoGarcia@users.noreply.github.com> Date: Mon, 16 Nov 2026 09:33:45 +0100 Subject: [PATCH 22/40] fix: cover langchain 0.1.86 and llama-index 4.7.6 in the span-context stopgaps (#282) --- src/rius/langchain_span_context.py | 2 +- src/rius/llama_index_span_context.py | 2 +- tests/test_langchain_span_context.py | 5 +++-- tests/test_llama_index_span_context.py | 14 +++++++------- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/rius/langchain_span_context.py b/src/rius/langchain_span_context.py index 619bdb6..4b2b803 100644 --- a/src/rius/langchain_span_context.py +++ b/src/rius/langchain_span_context.py @@ -63,7 +63,7 @@ #: The instrumentor releases whose tracer internals were read and found as #: this module expects. A later release may have reshaped them; it is left #: alone. -VERIFIED_VERSIONS = ("0.1.67", "0.1.82") +VERIFIED_VERSIONS = ("0.1.67", "0.1.86") #: The instrumentor's tracer the hooks look spans up in. Set by install(). _tracer: Any = None diff --git a/src/rius/llama_index_span_context.py b/src/rius/llama_index_span_context.py index 8c99aea..7cda030 100644 --- a/src/rius/llama_index_span_context.py +++ b/src/rius/llama_index_span_context.py @@ -95,7 +95,7 @@ #: The instrumentor releases whose span handling was read and found as this #: module expects. A later release may have reshaped it; it is left alone. -VERIFIED_VERSIONS = ("4.4.3", "4.7.2") +VERIFIED_VERSIONS = ("4.4.3", "4.7.6") #: The methods whose result is a stream that makes the provider request later. _STREAM_METHODS = ("stream_chat", "stream_complete", "astream_chat", "astream_complete") diff --git a/tests/test_langchain_span_context.py b/tests/test_langchain_span_context.py index 635d778..220b8c7 100644 --- a/tests/test_langchain_span_context.py +++ b/tests/test_langchain_span_context.py @@ -499,8 +499,9 @@ def test_uninstall_restores_the_hooked_classes(openai_answers: None) -> None: (VERIFIED_VERSIONS[1], True), ("0.1.66", False), ("0.1.81", True), - ("0.1.82", True), - ("0.1.83", False), + ("0.1.85", True), + ("0.1.86", True), + ("0.1.87", False), ("0.2.0", False), ], ) diff --git a/tests/test_llama_index_span_context.py b/tests/test_llama_index_span_context.py index a6ef9c9..41555ef 100644 --- a/tests/test_llama_index_span_context.py +++ b/tests/test_llama_index_span_context.py @@ -645,19 +645,19 @@ def test_uninstall_restores_everything(openai_answers: Answers) -> None: (VERIFIED_VERSIONS[0], True), (VERIFIED_VERSIONS[1], True), ("4.4.2", False), - ("4.7.3", False), + ("4.7.7", False), ("5.0.0", False), ("4.5.0", True), - ("4.7.1", True), + ("4.7.5", True), ("4.7", True), # A pre-release comes before its release, a post-release after it. - ("4.7.2rc1", True), - ("4.7.2.dev0", True), + ("4.7.6rc1", True), + ("4.7.6.dev0", True), ("4.4.3rc1", False), ("4.4.3.post1", True), - ("4.7.2.post1", False), - ("4.7.2post1", False), - ("4.7.2+local", False), + ("4.7.6.post1", False), + ("4.7.6post1", False), + ("4.7.6+local", False), ("not-a-version", False), ], ) From 3e1be849fc534a9a40e4fc466b249f8a1c1a5932 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Nov 2026 09:41:03 +0100 Subject: [PATCH 23/40] chore(deps): bump pytest from 9.1.1 to 9.2.0 (#277) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- uv.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/uv.lock b/uv.lock index 54fad50..117184d 100644 --- a/uv.lock +++ b/uv.lock @@ -3667,7 +3667,7 @@ crypto = [ [[package]] name = "pytest" -version = "9.1.1" +version = "9.2.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "colorama", marker = "sys_platform == 'win32'" }, @@ -3678,9 +3678,9 @@ dependencies = [ { name = "pygments" }, { name = "tomli", marker = "python_full_version < '3.11'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/e4/47/b9efed96c114afcfa3c9d3fe98a76a1d14c74a9e266d397cf6eb64be5e01/pytest-9.1.1.tar.gz", hash = "sha256:1088fbde8f2b49d95a549a195707afa7a76a3ce9bcadc26b6d71f0ffda5fe313", size = 1636369, upload-time = "2026-06-19T10:58:32.857Z" } +sdist = { url = "https://files.pythonhosted.org/packages/79/42/bb4641652e58dedeac2ec51abc1f8cae4fee4ec63899a0999016229a0f2a/pytest-9.2.0.tar.gz", hash = "sha256:97c4f3b1f3c7414aa36465e09b8220f1d03627993bd51b1282e193753c80557b", size = 1797555, upload-time = "2026-10-27T21:30:20.728Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/24/25/1de2678b631f5a49215c6c96fff41ba892b0a34df68d6d80292b1b48aa7f/pytest-9.1.1-py3-none-any.whl", hash = "sha256:37a86b45efb9a47a61a36449063e8e18d0cab3161329fc099eb21783169c4f0c", size = 386536, upload-time = "2026-06-19T10:58:31.347Z" }, + { url = "https://files.pythonhosted.org/packages/51/39/1f5d8c8877a0fa327db959c19341d4be61660de1ab6b7391f9eb805bcd67/pytest-9.2.0-py3-none-any.whl", hash = "sha256:07acdcf88ec174f907dc01af70bf52d49b014bbab03faeeade31c96b18c2e588", size = 411776, upload-time = "2026-10-27T21:30:19.131Z" }, ] [[package]] From f0f00e8179ef72530acf170a76f08ec834a998cc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Nov 2026 09:41:35 +0100 Subject: [PATCH 24/40] chore(deps): bump anthropic from 2.1.0 to 2.8.0 (#278) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- uv.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/uv.lock b/uv.lock index 117184d..9b4b244 100644 --- a/uv.lock +++ b/uv.lock @@ -235,7 +235,7 @@ wheels = [ [[package]] name = "anthropic" -version = "2.1.0" +version = "2.8.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "anyio" }, @@ -247,9 +247,9 @@ dependencies = [ { name = "sniffio" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/96/6d/b94f1ea6287bed4d76e1110fba99fc33d39af857e4191820485c1e3cb0da/anthropic-2.1.0.tar.gz", hash = "sha256:7533cc9035ef056159ec44f54e309de7b7d5ae329ff8f7df9da9ba05188d3c25", size = 1766577, upload-time = "2026-10-21T22:00:56.769Z" } +sdist = { url = "https://files.pythonhosted.org/packages/75/e6/aabc3c266a0aaf38fa542648585741fce9616ba4cd034ddde74548f790a0/anthropic-2.8.0.tar.gz", hash = "sha256:d34e389ba0544cd64e033eb7475f46cc1ac6f2a388cdcd472b33ad4ac29ef40c", size = 1976933, upload-time = "2026-11-10T16:33:19.38Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/02/f6/6c205e7e7fd2e6087692422b286fac4a2557ca60996b797276f23e03b431/anthropic-2.1.0-py3-none-any.whl", hash = "sha256:d776fa2ea9a07e20336a0668d1ef3a12357fdef75c895f54a050b3746b8e4de8", size = 2105866, upload-time = "2026-10-21T22:00:54.48Z" }, + { url = "https://files.pythonhosted.org/packages/96/8e/f8ef271dcbe3b187879b660c129ee36ef655c7b878f6878460891d9b2a26/anthropic-2.8.0-py3-none-any.whl", hash = "sha256:76ad332e2d500fc54d0112cf100544ad1a7605e71e092b98d9eb664d2b66e283", size = 2456925, upload-time = "2026-11-10T16:33:21.388Z" }, ] [[package]] From 8d1105892caf7fa0ed50d93b9c394711df138e2b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Nov 2026 09:41:58 +0100 Subject: [PATCH 25/40] chore(deps): bump openinference-instrumentation-anthropic from 3.3.0 to 3.3.5 (#280) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- uv.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/uv.lock b/uv.lock index 9b4b244..411be75 100644 --- a/uv.lock +++ b/uv.lock @@ -2763,7 +2763,7 @@ wheels = [ [[package]] name = "openinference-instrumentation" -version = "0.1.71" +version = "0.1.77" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "openinference-semantic-conventions" }, @@ -2771,14 +2771,14 @@ dependencies = [ { name = "opentelemetry-sdk" }, { name = "wrapt" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/56/ec/ef1ca7e409ee6bddb7278b9760e0941f65911748f5dc84d17c115f6648f1/openinference_instrumentation-0.1.71.tar.gz", hash = "sha256:4d267b6ce8e067572a740d6a0dbf6b4d4c6e386c5a52a7e7f61e3a714a49849d", size = 46600, upload-time = "2026-10-07T20:26:41.084Z" } +sdist = { url = "https://files.pythonhosted.org/packages/85/ed/ef266725f961098440ecaa91ad753320b9c808381d4eea068edfdb17fcbe/openinference_instrumentation-0.1.77.tar.gz", hash = "sha256:d2cef8d4d1d2c82be6cd0068a8f286b1d31cdf37381b8052e68494224338e93b", size = 47527, upload-time = "2026-11-12T06:06:54.645Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/7c/8c/330101bedf614dc937d8690462ed0ad4efd7f6c3248a76a5484ba6f885e3/openinference_instrumentation-0.1.71-py3-none-any.whl", hash = "sha256:07833fcf5d493a2ed15da16a0af70d6127d39f18ffa68f4d6827107e49fc6753", size = 54511, upload-time = "2026-10-07T20:26:39.634Z" }, + { url = "https://files.pythonhosted.org/packages/8b/4e/938db3f6e7b5b6db8be3ca8ebef95c292ace3be53c1a8b312e97d4403038/openinference_instrumentation-0.1.77-py3-none-any.whl", hash = "sha256:08b8f5e3dee767079538cd3e7c44f70b8f14f8e953e9031b273376da8bde2763", size = 55053, upload-time = "2026-11-12T06:06:53.304Z" }, ] [[package]] name = "openinference-instrumentation-anthropic" -version = "3.3.0" +version = "3.3.5" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "openinference-instrumentation" }, @@ -2789,9 +2789,9 @@ dependencies = [ { name = "typing-extensions" }, { name = "wrapt" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/12/78/4154149960378f4dcda4f7bd3873b397757539ff83452f24b412408e1e1e/openinference_instrumentation_anthropic-3.3.0.tar.gz", hash = "sha256:d8a10c64f621e020ec976a310cba6ce8e73e6c06397210b8aa83552a8dfddfa9", size = 29583, upload-time = "2026-10-31T04:07:27.544Z" } +sdist = { url = "https://files.pythonhosted.org/packages/6d/b6/9035d61099697ec0d624bc2689c93fc015a6e72a9cafbebbd44411ea9a15/openinference_instrumentation_anthropic-3.3.5.tar.gz", hash = "sha256:4bddf55d838b2360fe7a9e1785cc43dbb09bbf27b5debb2e74ca89783ade4614", size = 29717, upload-time = "2026-11-12T08:19:34.063Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/38/3c/75f244f86acdeb9cd9ecd053f722152ede8f1980292622cf98bb3ac3c458/openinference_instrumentation_anthropic-3.3.0-py3-none-any.whl", hash = "sha256:09f8dc7c64d07a7685802272642e13e20da37867380086ebbdc579748d4885f7", size = 34591, upload-time = "2026-10-31T04:07:26.288Z" }, + { url = "https://files.pythonhosted.org/packages/2d/f4/804f93d0090c31583d9860fb49db9838dbbec2304dc8399c4da5b5bc70e6/openinference_instrumentation_anthropic-3.3.5-py3-none-any.whl", hash = "sha256:8fee758dfb0519b22ac661bfdda6e9f4075d3cc8cbb13a64ff6e6f7c7b2ff96f", size = 34723, upload-time = "2026-11-12T08:19:31.953Z" }, ] [[package]] @@ -2868,11 +2868,11 @@ wheels = [ [[package]] name = "openinference-semantic-conventions" -version = "0.1.43" +version = "0.1.44" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/7e/dc/b3def81b3e243571ac4a96d41f44945f3c2c999c2a9c822b272ed4667e47/openinference_semantic_conventions-0.1.43.tar.gz", hash = "sha256:c12b213e8cbaa74c8fbf021d2959e244aceb39b5cefeb2c2cd8316235f2a905b", size = 16212, upload-time = "2026-10-29T22:13:22.01Z" } +sdist = { url = "https://files.pythonhosted.org/packages/ff/e3/e411e3b9f3540a03b87aa48dccabc7b3fd5326590cd23c22769eda1545a2/openinference_semantic_conventions-0.1.44.tar.gz", hash = "sha256:a1f08fa6aef021f67910eef017b43118199dd7e33fff10978f803a42d5fe1fde", size = 16225, upload-time = "2026-11-11T07:33:19.16Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/9f/11/02848572db2e9986f271853175cba2026d8ae46359d69d90deb19027f49f/openinference_semantic_conventions-0.1.43-py3-none-any.whl", hash = "sha256:058cf01935df390775605a87df07840dbd80ac1a92800a329c169b0d633f64ce", size = 12974, upload-time = "2026-10-29T22:13:20.246Z" }, + { url = "https://files.pythonhosted.org/packages/c8/f0/f151f0f52ea599d45ad0ca7f8c9a317a2ea6f7f52c17acee7014f2debead/openinference_semantic_conventions-0.1.44-py3-none-any.whl", hash = "sha256:58c931fb0223c6103eb38dfd6f3c709a27483f5e9e74aea2df607402156e7600", size = 12980, upload-time = "2026-11-11T07:33:17.933Z" }, ] [[package]] From e1d381ee660b94b635f559677488d5182db424bd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Nov 2026 09:42:19 +0100 Subject: [PATCH 26/40] chore(deps): bump openinference-instrumentation-llama-index from 4.6.1 to 4.7.6 (#281) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- uv.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/uv.lock b/uv.lock index 411be75..5a45944 100644 --- a/uv.lock +++ b/uv.lock @@ -2831,7 +2831,7 @@ wheels = [ [[package]] name = "openinference-instrumentation-llama-index" -version = "4.6.1" +version = "4.7.6" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "openinference-instrumentation" }, @@ -2842,9 +2842,9 @@ dependencies = [ { name = "typing-extensions" }, { name = "wrapt" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/40/3d/9f9f64a6319ce9d2a08de957e0fcdb2a0a5a62b10c9444157b631bd1fa29/openinference_instrumentation_llama_index-4.6.1.tar.gz", hash = "sha256:f7f789b0cf230f1a3c078e6f93b669e4e43ebef2f12fce2eb073f0c9e8a06536", size = 74375, upload-time = "2026-10-23T20:49:56.276Z" } +sdist = { url = "https://files.pythonhosted.org/packages/a1/0d/7c30728c27a7c282d55ec9e080872639c89c3b4ced33f55d763c71072064/openinference_instrumentation_llama_index-4.7.6.tar.gz", hash = "sha256:ca0eb19f7e7a61237920a0fca5d72647263723eb1054f270110d3fd53fe9eee1", size = 76851, upload-time = "2026-11-12T08:19:37.607Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/9e/5b/50959cf6afaf636251541c8fab89af359a4988afac7ce18db8a575557454/openinference_instrumentation_llama_index-4.6.1-py3-none-any.whl", hash = "sha256:0d25de31462a4cac8a169c385bfd631ae0155baf0c5c942edefbf57d53ef9d78", size = 32871, upload-time = "2026-10-23T20:49:54.801Z" }, + { url = "https://files.pythonhosted.org/packages/3f/3a/887c38a3978d136a0d75e797808de2270202cb5c7857b983c290822bdc57/openinference_instrumentation_llama_index-4.7.6-py3-none-any.whl", hash = "sha256:7b261da46880d95b4fb018b34ae946ac5715c90420db3b762ae5032c537d0287", size = 33223, upload-time = "2026-11-12T08:19:34.631Z" }, ] [[package]] From 6160925f823d5a63e5e27f27de0f2a9540f2dbcf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Nov 2026 09:49:28 +0100 Subject: [PATCH 27/40] chore(deps): bump litellm from 1.106.6 to 1.109.1 (#279) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- uv.lock | 404 +++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 341 insertions(+), 63 deletions(-) diff --git a/uv.lock b/uv.lock index 5a45944..4fcd2ff 100644 --- a/uv.lock +++ b/uv.lock @@ -35,7 +35,7 @@ dependencies = [ { name = "frozenlist" }, { name = "multidict" }, { name = "propcache" }, - { name = "typing-extensions", marker = "python_full_version < '3.13'" }, + { name = "typing-extensions", version = "4.15.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.13'" }, { name = "yarl" }, ] sdist = { url = "https://files.pythonhosted.org/packages/6c/4c/bdccd81e9ee225b69c60e7766c9a5b05364f118f4d383713b89a682d772d/aiohttp-3.14.5.tar.gz", hash = "sha256:5558a7f5a05af9ecf744af91e5baefc436f93c9333e656c27ec253f9a6bbe178", size = 8078052, upload-time = "2026-10-11T01:05:12.408Z" } @@ -208,7 +208,7 @@ version = "1.4.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "frozenlist" }, - { name = "typing-extensions", marker = "python_full_version < '3.13'" }, + { name = "typing-extensions", version = "4.15.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.13'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/61/62/06741b579156360248d1ec624842ad0edf697050bbaf7c3e46394e106ad1/aiosignal-1.4.0.tar.gz", hash = "sha256:f47eecd9468083c2029cc99945502cb7708b082c232f9aca65da147157b251c7", size = 25007, upload-time = "2025-07-03T22:54:43.528Z" } wheels = [ @@ -243,9 +243,11 @@ dependencies = [ { name = "httpx2" }, { name = "jiter" }, { name = "opentelemetry-api" }, - { name = "pydantic" }, + { name = "pydantic", version = "2.13.4", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.15'" }, + { name = "pydantic", version = "2.14.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.15'" }, { name = "sniffio" }, - { name = "typing-extensions" }, + { name = "typing-extensions", version = "4.15.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.15'" }, + { name = "typing-extensions", version = "4.16.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.15'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/75/e6/aabc3c266a0aaf38fa542648585741fce9616ba4cd034ddde74548f790a0/anthropic-2.8.0.tar.gz", hash = "sha256:d34e389ba0544cd64e033eb7475f46cc1ac6f2a388cdcd472b33ad4ac29ef40c", size = 1976933, upload-time = "2026-11-10T16:33:19.38Z" } wheels = [ @@ -259,7 +261,7 @@ source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "exceptiongroup", marker = "python_full_version < '3.11'" }, { name = "idna" }, - { name = "typing-extensions", marker = "python_full_version < '3.13'" }, + { name = "typing-extensions", version = "4.15.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.13'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/61/cc/a381afa6efea9f496eff839d4a6a1aed3bfafc7b3ab4b0d1b243a12573dd/anyio-4.14.2.tar.gz", hash = "sha256:cfa139f3ed1a23ee8f88a145ddb5ac7605b8bbfd8592baacd7ce3d8bb4313c7f", size = 260176, upload-time = "2026-07-12T20:29:07.082Z" } wheels = [ @@ -361,8 +363,9 @@ dependencies = [ { name = "jinja2" }, { name = "platformdirs", version = "4.12.4", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, { name = "platformdirs", version = "4.13.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, - { name = "pydantic" }, - { name = "typing-extensions", marker = "python_full_version < '3.11'" }, + { name = "pydantic", version = "2.13.4", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.15'" }, + { name = "pydantic", version = "2.14.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.15'" }, + { name = "typing-extensions", version = "4.15.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/f0/92/0449c32e718c10e4af40a3e040c830a77cdaeec6e9066622ee60e4c93e6e/banks-2.5.1.tar.gz", hash = "sha256:a7ca5c250b605ae90cfd6e4ca5dd6ce2ee377d5d59021b6feba44e345910026d", size = 196398, upload-time = "2026-09-10T10:15:34.569Z" } wheels = [ @@ -629,7 +632,7 @@ version = "50.0.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "cffi", marker = "platform_python_implementation != 'PyPy'" }, - { name = "typing-extensions", marker = "python_full_version < '3.11'" }, + { name = "typing-extensions", version = "4.15.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/de/41/6cbdcf9142d00fe82836fbb51e503e58088575cf7a0fe1dbff6695bf0840/cryptography-50.0.0.tar.gz", hash = "sha256:eeac2acb5a20ed25e0ad6d1df9891a520b78b404266b6d11778f25d5d691a6c9", size = 880201, upload-time = "2026-07-31T14:25:10.11Z" } wheels = [ @@ -772,7 +775,7 @@ name = "exceptiongroup" version = "1.3.1" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "typing-extensions" }, + { name = "typing-extensions", version = "4.15.0", source = { registry = "https://pypi.org/simple" } }, ] sdist = { url = "https://files.pythonhosted.org/packages/50/79/66800aadf48771f6b62f7eb014e352e5d06856655206165d775e675a02c9/exceptiongroup-1.3.1.tar.gz", hash = "sha256:8b412432c6055b0b7d14c310000ae93352ed6754f70fa8f7c34141f91c4e3219", size = 30371, upload-time = "2025-11-21T23:01:54.787Z" } wheels = [ @@ -1406,7 +1409,7 @@ dependencies = [ { name = "httpx2-jsfetch", marker = "python_full_version >= '3.12' and sys_platform == 'emscripten'" }, { name = "idna" }, { name = "truststore", marker = "sys_platform != 'emscripten'" }, - { name = "typing-extensions", marker = "python_full_version < '3.13'" }, + { name = "typing-extensions", version = "4.15.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.13'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/7f/f8/579a8b51e42e38ee32647df9f08aa25643ae788e275cc625b199829c4671/httpx2-2.12.0.tar.gz", hash = "sha256:7631fe9887a8a2275f4a2540e053aa670fcc50742864a9ae7c66e609fdcf12cf", size = 100040, upload-time = "2026-08-18T13:22:09.086Z" } wheels = [ @@ -1436,7 +1439,8 @@ dependencies = [ { name = "pyyaml" }, { name = "tomli", marker = "python_full_version < '3.11'" }, { name = "tqdm" }, - { name = "typing-extensions" }, + { name = "typing-extensions", version = "4.15.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.15'" }, + { name = "typing-extensions", version = "4.16.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.15'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/25/2a/484d112c0d8fc5f665d7b65137ac9cdb2953c982391598c3597968a12ee7/huggingface_hub-1.33.0.tar.gz", hash = "sha256:367be21a201db9523eddf8aeac7048f2602c1b308691c97640d5e72ed188007e", size = 1043548, upload-time = "2026-09-24T09:49:29.971Z" } wheels = [ @@ -1674,10 +1678,12 @@ dependencies = [ { name = "langchain-protocol" }, { name = "langsmith" }, { name = "packaging" }, - { name = "pydantic" }, + { name = "pydantic", version = "2.13.4", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.15'" }, + { name = "pydantic", version = "2.14.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.15'" }, { name = "pyyaml" }, { name = "tenacity" }, - { name = "typing-extensions" }, + { name = "typing-extensions", version = "4.15.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.15'" }, + { name = "typing-extensions", version = "4.16.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.15'" }, { name = "uuid-utils" }, ] sdist = { url = "https://files.pythonhosted.org/packages/1e/13/eef86ab444e9e797bb0e41f583904510fb36416571f6fbb93b9255e1e125/langchain_core-1.7.6.tar.gz", hash = "sha256:0833781e3a8e6fe83073c8412c21180a0545d5ccdf3437889951caf9589ece6c", size = 1037637, upload-time = "2026-11-05T00:21:56.343Z" } @@ -1705,7 +1711,8 @@ name = "langchain-protocol" version = "0.0.20" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "typing-extensions" }, + { name = "typing-extensions", version = "4.15.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.15'" }, + { name = "typing-extensions", version = "4.16.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.15'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/cb/8b/d908d082c3cf5368ddd1816ed114de79c873f979ba7f98b95fab0e841643/langchain_protocol-0.0.20.tar.gz", hash = "sha256:0f5bd002474265648e91161771a9e0438fe9480bd55a416e51af0f60070637ec", size = 6280, upload-time = "2026-10-20T11:13:50.84Z" } wheels = [ @@ -1722,11 +1729,13 @@ dependencies = [ { name = "httpx2" }, { name = "orjson", marker = "platform_python_implementation != 'PyPy'" }, { name = "packaging" }, - { name = "pydantic" }, + { name = "pydantic", version = "2.13.4", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.15'" }, + { name = "pydantic", version = "2.14.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.15'" }, { name = "requests" }, { name = "requests-toolbelt" }, { name = "sniffio" }, - { name = "typing-extensions" }, + { name = "typing-extensions", version = "4.15.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.15'" }, + { name = "typing-extensions", version = "4.16.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.15'" }, { name = "uuid-utils" }, { name = "websockets", version = "16.1.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, { name = "websockets", version = "17.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, @@ -1870,15 +1879,16 @@ wheels = [ [[package]] name = "litellm" -version = "1.106.6" +version = "1.109.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "aiohttp" }, + { name = "anyio" }, { name = "async-timeout", marker = "python_full_version < '3.11'" }, { name = "boto3" }, { name = "certifi" }, { name = "click" }, - { name = "fastuuid" }, + { name = "fastuuid", marker = "python_full_version < '3.15'" }, { name = "filelock" }, { name = "httpx", extra = ["http2"] }, { name = "huggingface-hub" }, @@ -1887,23 +1897,25 @@ dependencies = [ { name = "jsonschema" }, { name = "openai" }, { name = "packaging" }, - { name = "pydantic" }, + { name = "pydantic", version = "2.13.4", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.15'" }, + { name = "pydantic", version = "2.14.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.15'" }, { name = "pydantic-settings" }, { name = "python-dotenv" }, { name = "pyyaml" }, { name = "tiktoken" }, { name = "tokenizers" }, - { name = "typing-extensions" }, + { name = "typing-extensions", version = "4.15.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.15'" }, + { name = "typing-extensions", version = "4.16.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.15'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/96/6f/fb4af3dc4224807fedbecb24c8c4eec53115ed99325ef74a5fe30a76c9d1/litellm-1.106.6.tar.gz", hash = "sha256:8bf6d33b5ca32a5fc6858784b64c82e7f3bfab462d571d7d0def5596c3e1acc3", size = 21195118, upload-time = "2026-10-28T22:49:16.207Z" } +sdist = { url = "https://files.pythonhosted.org/packages/64/cc/6295db7faccd95aae86392e06531817e8ef2661b04805e95cfde56165a32/litellm-1.109.1.tar.gz", hash = "sha256:5b98ecccd93374b8ea1746ee98de16b505c0b5e6c0dfb7e8afec3d817d08d7c2", size = 25570168, upload-time = "2026-11-12T02:00:18.465Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/db/34/d513c9c1d55a5369faf23c0d4d1089399d9dceaf543698f4a9e8ab2ddf9f/litellm-1.106.6-cp310-abi3-macosx_10_12_x86_64.whl", hash = "sha256:ac74f9ff9faae1a424dc7be873b80ccf1cea1681a9f4dac03bac068ae3a8d8b0", size = 36044285, upload-time = "2026-10-28T22:48:55.249Z" }, - { url = "https://files.pythonhosted.org/packages/be/b6/af2c107abce20f6670a3df02736419ccbe89b79e38fa1eb1f40b23793932/litellm-1.106.6-cp310-abi3-macosx_11_0_arm64.whl", hash = "sha256:f3398d8c21ac9fe851f1788a2d811af7f369fb485d775a25a9b3f517b0b3e88b", size = 35046170, upload-time = "2026-10-28T22:48:58.571Z" }, - { url = "https://files.pythonhosted.org/packages/72/fc/238b004817ffaf6549571b2cdfc9c5f72d3db97aa54525fb12d3c38ccba9/litellm-1.106.6-cp310-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:af0b6f4a3df53194b74188a972f103f41ee5ed86afeefc7d9a1ea40156cc0f2e", size = 35561287, upload-time = "2026-10-28T22:49:01.299Z" }, - { url = "https://files.pythonhosted.org/packages/ef/c9/490d712bf9512131106c03cd6566fa0a1f9c0bdc54c19f3250aa72e77d74/litellm-1.106.6-cp310-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:ec3cae6c87971657c9ae905b6d23aef456e979c8848f22bbc5096a31e1a1da4d", size = 36554063, upload-time = "2026-10-28T22:49:04.483Z" }, - { url = "https://files.pythonhosted.org/packages/3c/68/09fe44229fc980bdc4b799dc7ef85ba9d918e440f21094c966342209c7d7/litellm-1.106.6-cp310-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:a51f2a7317ab9cb1ef01a93c619f3c7ff69fe1fe13a59b409d0130748b5d8af9", size = 35724862, upload-time = "2026-10-28T22:49:07.595Z" }, - { url = "https://files.pythonhosted.org/packages/e0/b9/80ef424a6aa86e5a9aeff5e7a71d1060fea56914f0e2d8916340fee29289/litellm-1.106.6-cp310-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:a2876545a652de5070fa5905849b479cee977680b0616b603a6ab21fd5599524", size = 36622070, upload-time = "2026-10-28T22:49:10.542Z" }, - { url = "https://files.pythonhosted.org/packages/4a/41/8c5076437a5a56cf8e788eafe9ca36b649375bb14811d2401e6520acba86/litellm-1.106.6-cp310-abi3-win_amd64.whl", hash = "sha256:42ce43ffb0161c9a844e8b0cd02a8796d0423b11d84fe304bff925378ca55085", size = 37383305, upload-time = "2026-10-28T22:49:13.624Z" }, + { url = "https://files.pythonhosted.org/packages/0c/1e/f83650f0840f47b4d48e7d3fcc49ee23f2b9ab27fb90937f0e1d9e0dbd5c/litellm-1.109.1-cp310-abi3-macosx_10_12_x86_64.whl", hash = "sha256:1fdf789757fc71c9a9ac183cd326b978782dfa9ebd44087c6603b5b963956841", size = 40565744, upload-time = "2026-11-12T01:59:54.804Z" }, + { url = "https://files.pythonhosted.org/packages/16/10/9c973a582a29ace1b4437b0851b278f8b65a22c351ab3c3180d6bcebb0ec/litellm-1.109.1-cp310-abi3-macosx_11_0_arm64.whl", hash = "sha256:1b2866219249186babe194d7e3f4af29095c0905a4c5712b62be662aa6a38fb7", size = 39911789, upload-time = "2026-11-12T01:59:58.373Z" }, + { url = "https://files.pythonhosted.org/packages/af/20/d305f1243712131a79c7f069cdaad8be9f5a3746f09440576933ec55b6a9/litellm-1.109.1-cp310-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:1dcf31166d385e6eaaef7f5840ba88c4eac319d1aa2d3ec2787de981e07fcf11", size = 40353049, upload-time = "2026-11-12T02:00:01.288Z" }, + { url = "https://files.pythonhosted.org/packages/30/5b/05ec8f224dd31cc294a5e0483fd6385d8991ffe4c0312978f5924ac053a5/litellm-1.109.1-cp310-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:1c8b4dd671fa0cd0850aa751678704ff77e595fb1e6085b2dc3be39ee19bdaaf", size = 41091727, upload-time = "2026-11-12T02:00:05.2Z" }, + { url = "https://files.pythonhosted.org/packages/9d/93/80f9b16aea7a10ccc1bac561fd65130271a928b5a8f23a6a1e8b32ec349b/litellm-1.109.1-cp310-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:c84737897b6b459acd660fd7adb33e2d552c5d0b93c4a47b8cd4f5e299c93bac", size = 40482185, upload-time = "2026-11-12T02:00:08.516Z" }, + { url = "https://files.pythonhosted.org/packages/2f/49/120f60c831983fccfddfaa8683e0bb75c2ba70ed62263acae44ddd360534/litellm-1.109.1-cp310-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:b94080b0436c471e686735d10fd1069c151cf8b9816d823a1450419573f30e46", size = 41180765, upload-time = "2026-11-12T02:00:11.814Z" }, + { url = "https://files.pythonhosted.org/packages/44/82/dfd6aa8ac212f5c2c7576079c92b97fcb666f3da521f47c813d1ee02e195/litellm-1.109.1-cp310-abi3-win_amd64.whl", hash = "sha256:738fd2465e24460f03a8c5ff33dc57c3fdfad88ff489811d718ee6ba3c5ad900", size = 41985493, upload-time = "2026-11-12T02:00:15.416Z" }, ] [[package]] @@ -1934,7 +1946,8 @@ dependencies = [ { name = "pillow", version = "13.0.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, { name = "platformdirs", version = "4.12.4", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, { name = "platformdirs", version = "4.13.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, - { name = "pydantic" }, + { name = "pydantic", version = "2.13.4", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.15'" }, + { name = "pydantic", version = "2.14.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.15'" }, { name = "pyyaml" }, { name = "requests" }, { name = "setuptools" }, @@ -1944,7 +1957,8 @@ dependencies = [ { name = "tiktoken" }, { name = "tinytag" }, { name = "tqdm" }, - { name = "typing-extensions" }, + { name = "typing-extensions", version = "4.15.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.15'" }, + { name = "typing-extensions", version = "4.16.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.15'" }, { name = "typing-inspect" }, { name = "wrapt" }, ] @@ -1960,7 +1974,8 @@ source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "deprecated", version = "1.3.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.12'" }, { name = "deprecated", version = "3.0.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.12'" }, - { name = "pydantic" }, + { name = "pydantic", version = "2.13.4", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.15'" }, + { name = "pydantic", version = "2.14.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.15'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/70/ac/ffc116bac024cb0a54b4d28ca9b421e9a08f408c1fcc0039a36de2c0c97b/llama_index_instrumentation-0.6.0.tar.gz", hash = "sha256:b185c4e28a7f32899c27649cc2e2d7d54267fa2ff0cd43cbe2b5212bae98fe3a", size = 56517, upload-time = "2026-08-29T15:33:16.861Z" } wheels = [ @@ -1986,8 +2001,10 @@ version = "2.26.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "llama-index-instrumentation" }, - { name = "pydantic" }, - { name = "typing-extensions" }, + { name = "pydantic", version = "2.13.4", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.15'" }, + { name = "pydantic", version = "2.14.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.15'" }, + { name = "typing-extensions", version = "4.15.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.15'" }, + { name = "typing-extensions", version = "4.16.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.15'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/1d/42/d4e1b004a041fcbad1e3acc804090a28161358ac567b0c74be2a3eef760c/llama_index_workflows-2.26.0.tar.gz", hash = "sha256:1aa685b678acbbd0a01a22e4d73aecd374cd12f923cf12ea83c5264f68bafa16", size = 159151, upload-time = "2026-10-11T15:00:02.452Z" } wheels = [ @@ -2159,14 +2176,17 @@ dependencies = [ { name = "jsonschema" }, { name = "mcp-types" }, { name = "opentelemetry-api" }, - { name = "pydantic" }, + { name = "pydantic", version = "2.13.4", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.15'" }, + { name = "pydantic", version = "2.14.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.15'" }, { name = "pyjwt", extra = ["crypto"] }, { name = "python-multipart" }, { name = "pywin32", marker = "sys_platform == 'win32'" }, { name = "sse-starlette" }, { name = "starlette" }, - { name = "typing-extensions" }, - { name = "typing-inspection" }, + { name = "typing-extensions", version = "4.15.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.15'" }, + { name = "typing-extensions", version = "4.16.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.15'" }, + { name = "typing-inspection", version = "0.4.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.15'" }, + { name = "typing-inspection", version = "0.4.5", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.15'" }, { name = "uvicorn", marker = "sys_platform != 'emscripten'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/9d/8d/e0d339616f4810e9051d4aba6887afab289ab1f81875fe908b606cdfd0e3/mcp-2.3.0.tar.gz", hash = "sha256:8b147a50441cf059dc88c684e0aeed3687f0aa0f39c6cde7b90330effd2b34d8", size = 4171955, upload-time = "2026-10-02T22:06:56.091Z" } @@ -2179,8 +2199,10 @@ name = "mcp-types" version = "2.3.0" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "pydantic" }, - { name = "typing-extensions" }, + { name = "pydantic", version = "2.13.4", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.15'" }, + { name = "pydantic", version = "2.14.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.15'" }, + { name = "typing-extensions", version = "4.15.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.15'" }, + { name = "typing-extensions", version = "4.16.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.15'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/9e/2d/7c251e34207f6c51000312fc8839111ac45cfe02023f90b44e7f1051dd8e/mcp_types-2.3.0.tar.gz", hash = "sha256:d1e46549edb35ee19a94940fcee6d1addd7e589ab7ea92dda83f5d84781fc362", size = 65898, upload-time = "2026-10-02T22:06:57.863Z" } wheels = [ @@ -2192,7 +2214,7 @@ name = "multidict" version = "7.1.0" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "typing-extensions", marker = "python_full_version < '3.11'" }, + { name = "typing-extensions", version = "4.15.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/f9/79/84ddb5ba16c4eb2c69c71db76ae3c579fe546e511f7170c7e27eedbab7c1/multidict-7.1.0.tar.gz", hash = "sha256:61a4e5d81b8d4e4ad61964b230129e7a2b914793d96289029078fc9009f074ec", size = 362341, upload-time = "2026-10-09T20:31:38.279Z" } wheels = [ @@ -2378,7 +2400,8 @@ dependencies = [ { name = "mypy-extensions" }, { name = "pathspec" }, { name = "tomli", marker = "python_full_version < '3.11'" }, - { name = "typing-extensions" }, + { name = "typing-extensions", version = "4.15.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.15'" }, + { name = "typing-extensions", version = "4.16.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.15'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/4a/3c/78ecece71ee4b5445389a4ccd11627cfb9c69e4de554d11060171f376305/mypy-2.4.1.tar.gz", hash = "sha256:63b590965691e540a335fa74dadf31a7069142f6b72e234689bbd244edf55623", size = 4066728, upload-time = "2026-10-28T19:23:13.286Z" } wheels = [ @@ -2751,10 +2774,12 @@ dependencies = [ { name = "distro" }, { name = "httpx" }, { name = "jiter" }, - { name = "pydantic" }, + { name = "pydantic", version = "2.13.4", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.15'" }, + { name = "pydantic", version = "2.14.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.15'" }, { name = "sniffio" }, { name = "tqdm" }, - { name = "typing-extensions" }, + { name = "typing-extensions", version = "4.15.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.15'" }, + { name = "typing-extensions", version = "4.16.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.15'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/50/9a/8c75e8c8a5b407a0586faeb2afac91674ff955c191ecc1d6d3b6669f6788/openai-2.54.0.tar.gz", hash = "sha256:e3e6f8bc1ba30ddf381ace1a14340eed381cb984a1a59bd0f34b5be3b5d49cfa", size = 1100285, upload-time = "2026-08-11T18:46:59.035Z" } wheels = [ @@ -2786,7 +2811,8 @@ dependencies = [ { name = "opentelemetry-api" }, { name = "opentelemetry-instrumentation" }, { name = "opentelemetry-semantic-conventions" }, - { name = "typing-extensions" }, + { name = "typing-extensions", version = "4.15.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.15'" }, + { name = "typing-extensions", version = "4.16.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.15'" }, { name = "wrapt" }, ] sdist = { url = "https://files.pythonhosted.org/packages/6d/b6/9035d61099697ec0d624bc2689c93fc015a6e72a9cafbebbd44411ea9a15/openinference_instrumentation_anthropic-3.3.5.tar.gz", hash = "sha256:4bddf55d838b2360fe7a9e1785cc43dbb09bbf27b5debb2e74ca89783ade4614", size = 29717, upload-time = "2026-11-12T08:19:34.063Z" } @@ -2839,7 +2865,8 @@ dependencies = [ { name = "opentelemetry-api" }, { name = "opentelemetry-instrumentation" }, { name = "opentelemetry-semantic-conventions" }, - { name = "typing-extensions" }, + { name = "typing-extensions", version = "4.15.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.15'" }, + { name = "typing-extensions", version = "4.16.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.15'" }, { name = "wrapt" }, ] sdist = { url = "https://files.pythonhosted.org/packages/a1/0d/7c30728c27a7c282d55ec9e080872639c89c3b4ced33f55d763c71072064/openinference_instrumentation_llama_index-4.7.6.tar.gz", hash = "sha256:ca0eb19f7e7a61237920a0fca5d72647263723eb1054f270110d3fd53fe9eee1", size = 76851, upload-time = "2026-11-12T08:19:37.607Z" } @@ -2858,7 +2885,8 @@ dependencies = [ { name = "opentelemetry-api" }, { name = "opentelemetry-instrumentation" }, { name = "opentelemetry-semantic-conventions" }, - { name = "typing-extensions" }, + { name = "typing-extensions", version = "4.15.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.15'" }, + { name = "typing-extensions", version = "4.16.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.15'" }, { name = "wrapt" }, ] sdist = { url = "https://files.pythonhosted.org/packages/01/fe/208b6a11cd868c39e79b0973e9bcb596f87525c388be6b0e50ed079ca93c/openinference_instrumentation_openai-0.1.69.tar.gz", hash = "sha256:6020a7617ce5efa5c43ff59a11322570cf3d6906fc0d9dd3913e533179af0575", size = 30944, upload-time = "2026-10-31T04:07:25.806Z" } @@ -2880,7 +2908,8 @@ name = "opentelemetry-api" version = "1.45.2" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "typing-extensions" }, + { name = "typing-extensions", version = "4.15.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.15'" }, + { name = "typing-extensions", version = "4.16.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.15'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/19/14/cf3a6b6448849656e1e5f4e2101f3988dc6789724050096aba1bc5ccf592/opentelemetry_api-1.45.2.tar.gz", hash = "sha256:d7b0008e21e5fd61cbe7a7f34ca3b6905a78ab677d9bc395e299359c75cda6b4", size = 73277, upload-time = "2026-10-29T17:29:37.888Z" } wheels = [ @@ -2941,7 +2970,8 @@ dependencies = [ { name = "opentelemetry-proto" }, { name = "opentelemetry-sdk" }, { name = "requests" }, - { name = "typing-extensions" }, + { name = "typing-extensions", version = "4.15.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.15'" }, + { name = "typing-extensions", version = "4.16.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.15'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/db/07/b7b01ecb69d02f540e679a9e36f7413d081f225bbbed4469d212ada10bb7/opentelemetry_exporter_otlp_proto_http-1.45.2.tar.gz", hash = "sha256:5984a3fb46bc4628e4e2b85d4a6e72637e03962aae6cf372791137768a4ad939", size = 28843, upload-time = "2026-10-29T17:29:46.15Z" } wheels = [ @@ -2982,7 +3012,8 @@ source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "opentelemetry-api" }, { name = "opentelemetry-semantic-conventions" }, - { name = "typing-extensions" }, + { name = "typing-extensions", version = "4.15.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.15'" }, + { name = "typing-extensions", version = "4.16.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.15'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/7b/1a/74a21d4d6969fb8b432ac397e66112a8167a6deb267ea4559dbaf2fe91ef/opentelemetry_sdk-1.45.2.tar.gz", hash = "sha256:7eec4de13dd21ff3a1670dcb0e02079e692736f94d733dfdce5af461d884248d", size = 221705, upload-time = "2026-10-29T17:29:54.685Z" } wheels = [ @@ -2995,7 +3026,8 @@ version = "0.66b2" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "opentelemetry-api" }, - { name = "typing-extensions" }, + { name = "typing-extensions", version = "4.15.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.15'" }, + { name = "typing-extensions", version = "4.16.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.15'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/37/3f/50f95972b50e8e353f5b9342034c9cd17730f1956f009ce6a3fbbd89f9ce/opentelemetry_semantic_conventions-0.66b2.tar.gz", hash = "sha256:7da5f1a5dc4383eb66711d4d3d3e71824d9403ac1559fea021cc103c1a4c4976", size = 150246, upload-time = "2026-10-29T17:29:55.682Z" } wheels = [ @@ -3498,23 +3530,63 @@ wheels = [ name = "pydantic" version = "2.13.4" source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version == '3.14.*' and sys_platform == 'win32'", + "python_full_version == '3.14.*' and sys_platform != 'win32'", + "python_full_version >= '3.12' and python_full_version < '3.14' and sys_platform == 'win32'", + "python_full_version >= '3.12' and python_full_version < '3.14' and sys_platform == 'emscripten'", + "python_full_version >= '3.12' and python_full_version < '3.14' and sys_platform != 'emscripten' and sys_platform != 'win32'", + "python_full_version == '3.11.*' and sys_platform == 'win32'", + "python_full_version == '3.11.*' and sys_platform != 'win32'", + "python_full_version < '3.11' and sys_platform == 'win32'", + "python_full_version < '3.11' and sys_platform != 'win32'", +] dependencies = [ { name = "annotated-types" }, - { name = "pydantic-core" }, - { name = "typing-extensions" }, - { name = "typing-inspection" }, + { name = "pydantic-core", version = "2.46.4", source = { registry = "https://pypi.org/simple" } }, + { name = "typing-extensions", version = "4.15.0", source = { registry = "https://pypi.org/simple" } }, + { name = "typing-inspection", version = "0.4.2", source = { registry = "https://pypi.org/simple" } }, ] sdist = { url = "https://files.pythonhosted.org/packages/18/a5/b60d21ac674192f8ab0ba4e9fd860690f9b4a6e51ca5df118733b487d8d6/pydantic-2.13.4.tar.gz", hash = "sha256:c40756b57adaa8b1efeeced5c196f3f3b7c435f90e84ea7f443901bec8099ef6", size = 844775, upload-time = "2026-05-06T13:43:05.343Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/fd/7b/122376b1fd3c62c1ed9dc80c931ace4844b3c55407b6fb2d199377c9736f/pydantic-2.13.4-py3-none-any.whl", hash = "sha256:45a282cde31d808236fd7ea9d919b128653c8b38b393d1c4ab335c62924d9aba", size = 472262, upload-time = "2026-05-06T13:43:02.641Z" }, ] +[[package]] +name = "pydantic" +version = "2.14.3" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.15'", +] +dependencies = [ + { name = "annotated-types" }, + { name = "pydantic-core", version = "2.50.4", source = { registry = "https://pypi.org/simple" } }, + { name = "typing-extensions", version = "4.16.0", source = { registry = "https://pypi.org/simple" } }, + { name = "typing-inspection", version = "0.4.5", source = { registry = "https://pypi.org/simple" } }, +] +sdist = { url = "https://files.pythonhosted.org/packages/b4/fc/1203d011145c98ddce3cd2f505bb54375ef8d43223053df6bfcf3c746f46/pydantic-2.14.3.tar.gz", hash = "sha256:1054f237f4d4733e5a30e1e2333bd33a2004ab9ab1510bd053a9a31bb48e232d", size = 925636, upload-time = "2026-11-05T09:17:04.686Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/72/b8/b864503789ef5c58597d2a7b4adbee62c26440ab1e682581fc6838df8947/pydantic-2.14.3-py3-none-any.whl", hash = "sha256:3f7b347782ab7e4cf4c798496ae3a82787d9f21ec12676a9c564355eeef8daa8", size = 494071, upload-time = "2026-11-05T09:17:02.426Z" }, +] + [[package]] name = "pydantic-core" version = "2.46.4" source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version == '3.14.*' and sys_platform == 'win32'", + "python_full_version == '3.14.*' and sys_platform != 'win32'", + "python_full_version >= '3.12' and python_full_version < '3.14' and sys_platform == 'win32'", + "python_full_version >= '3.12' and python_full_version < '3.14' and sys_platform == 'emscripten'", + "python_full_version >= '3.12' and python_full_version < '3.14' and sys_platform != 'emscripten' and sys_platform != 'win32'", + "python_full_version == '3.11.*' and sys_platform == 'win32'", + "python_full_version == '3.11.*' and sys_platform != 'win32'", + "python_full_version < '3.11' and sys_platform == 'win32'", + "python_full_version < '3.11' and sys_platform != 'win32'", +] dependencies = [ - { name = "typing-extensions" }, + { name = "typing-extensions", version = "4.15.0", source = { registry = "https://pypi.org/simple" } }, ] sdist = { url = "https://files.pythonhosted.org/packages/9d/56/921726b776ace8d8f5db44c4ef961006580d91dc52b803c489fafd1aa249/pydantic_core-2.46.4.tar.gz", hash = "sha256:62f875393d7f270851f20523dd2e29f082bcc82292d66db2b64ea71f64b6e1c1", size = 471464, upload-time = "2026-05-06T13:37:06.98Z" } wheels = [ @@ -3625,14 +3697,169 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/4b/2d/69abac8f838090bbecd5df894befb2c2619e7996a98ddb949db9f3b93225/pydantic_core-2.46.4-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:d51026d73fcfd93610abc7b27789c26b313920fcfb20e27462d74a7f8b06e983", size = 2193071, upload-time = "2026-05-06T13:38:08.682Z" }, ] +[[package]] +name = "pydantic-core" +version = "2.50.4" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.15'", +] +dependencies = [ + { name = "typing-extensions", version = "4.16.0", source = { registry = "https://pypi.org/simple" } }, +] +sdist = { url = "https://files.pythonhosted.org/packages/9c/0f/34f9ce4ba701dd0b815033ef94d99b56f66200e578ee6052aa3ac26f064e/pydantic_core-2.50.4.tar.gz", hash = "sha256:aead3b74b68396bf0feab5d57e050b730ded7df55853c1e048a87e00aaf033c6", size = 522249, upload-time = "2026-11-05T09:15:26.774Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/06/82/047d1c7dc4ec15130bbb3299d9e3cb85be945bb14db54e5ad5f1c91b5e75/pydantic_core-2.50.4-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:83d2beac85b757bfc404c5c0612df51c4ef33bbb7be65cf4a96b4da7cbc4ff4f", size = 2172546, upload-time = "2026-11-05T09:11:15.221Z" }, + { url = "https://files.pythonhosted.org/packages/95/ad/36732c76b5ad87647725681c8259376dddae8db9c3558e7cd99c25c7a9e1/pydantic_core-2.50.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:76e0065998159244ff4c097a6c05ff08019c6fbb6e597a85846e73044f0215b3", size = 2131205, upload-time = "2026-11-05T09:11:18.084Z" }, + { url = "https://files.pythonhosted.org/packages/d8/ac/8550a2ac336d3063759a73802f5c045d073125aea44927ba0fa790c55b0d/pydantic_core-2.50.4-cp310-cp310-manylinux1_i686.manylinux_2_5_i686.whl", hash = "sha256:25e7e1080f9f7ce7cd9d114b31470ce912771bd02f38c824721d3c35d312abff", size = 2284431, upload-time = "2026-11-05T09:11:20.005Z" }, + { url = "https://files.pythonhosted.org/packages/f2/d6/1a14b5da27def1db17274c215d4ab62c380b600689c4e54c4dc02c1b0cba/pydantic_core-2.50.4-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:c4c5a1770ecfe8bdb6c6f09f8d81ea4de04f7efb012fac1efa4ad315dccc1fd1", size = 2131058, upload-time = "2026-11-05T09:11:21.561Z" }, + { url = "https://files.pythonhosted.org/packages/01/de/075e68a5dcf8fc64ffad92740512dd9cb81ca7c29c5ca32de89cfbe0447d/pydantic_core-2.50.4-cp310-cp310-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:2f6767122b37c780bb756a720a4eef2bc6a050a0a1143428834b3cbc89448bd2", size = 2216460, upload-time = "2026-11-05T09:11:23.546Z" }, + { url = "https://files.pythonhosted.org/packages/0e/ad/b04b1b589495c0678e2a721ad07f95be47dbeb789fb50babc0e8ea7ed964/pydantic_core-2.50.4-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:86c7c4615634b5c57a79770f5b738354e45ae219a89949aeae84f19169a05283", size = 2403715, upload-time = "2026-11-05T09:11:25.105Z" }, + { url = "https://files.pythonhosted.org/packages/9e/c1/9c8a9f6b42bd6080cde7143b9c3685cfa0859cea4e4860bd126df22602e2/pydantic_core-2.50.4-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:6c7d7b0b596319e9ce79ef96ce57a14054a2eac629c0588a0539187a218be799", size = 2454737, upload-time = "2026-11-05T09:11:26.787Z" }, + { url = "https://files.pythonhosted.org/packages/e3/df/cddc0729c366460763831e6087e88fc0197c78f34fc79ac993a41b5d0242/pydantic_core-2.50.4-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:ed9c0b6f236648dbf30d57e9f57e1f74878caafa04833a19f529b5ba5164b7a8", size = 2257210, upload-time = "2026-11-05T09:11:28.805Z" }, + { url = "https://files.pythonhosted.org/packages/7a/54/4526352e8b6a849f661f55f025615eaa0b90c6eccd7588a5eff344c498ae/pydantic_core-2.50.4-cp310-cp310-manylinux_2_31_riscv64.whl", hash = "sha256:dfcf6e51000b34f7026322cd9ea9bc340d745637e27e0bbc22f504b4f6b967ee", size = 2282013, upload-time = "2026-11-05T09:11:30.463Z" }, + { url = "https://files.pythonhosted.org/packages/64/df/6d70c52df400d5af3ccab490a3a3810f6419d99a7a34552dfb2c544de29d/pydantic_core-2.50.4-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:bd46bcc28ed85d3cf71581b42d90b4ebd1f2062f81879519fed209f8a4d1cfc6", size = 2322022, upload-time = "2026-11-05T09:11:32.344Z" }, + { url = "https://files.pythonhosted.org/packages/8b/f5/4ea1184eb9fe6b5f76e18195b10ab73e9d23f896144773d21bf6938442a8/pydantic_core-2.50.4-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:696613a0c0e7b2b35356e389ba4195ce20cfe7a2fc2e992c87d974d973eabec7", size = 2493416, upload-time = "2026-11-05T09:11:34.204Z" }, + { url = "https://files.pythonhosted.org/packages/6f/dd/918b33fd36c3a27139fb08cfb778b2392ab9e3f091948b4e4b2a325b0913/pydantic_core-2.50.4-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:2980a701be88f9128a7470189fa3bcda5387f76c298a6f8e000fc29eb2a6f4e7", size = 2499741, upload-time = "2026-11-05T09:11:36.054Z" }, + { url = "https://files.pythonhosted.org/packages/7a/9f/dcde466c089e54cb0067a469f54cc8d00a51dd36c6c75eb664a2f1ed07f4/pydantic_core-2.50.4-cp310-cp310-win32.whl", hash = "sha256:dd8bed00731a21e3106e5dd6bbffb6c775a2c0bbc7c0c9face534d830057bdc9", size = 2134504, upload-time = "2026-11-05T09:11:37.693Z" }, + { url = "https://files.pythonhosted.org/packages/ee/d4/d1da421fe867903d5ddffb4d4b4928fd08af99de3e6ec21e758f9990337b/pydantic_core-2.50.4-cp310-cp310-win_amd64.whl", hash = "sha256:e512c75ec5cf4475c1aa50ad975ecdf253f4963b06e152e1a11edd6de4010753", size = 2259729, upload-time = "2026-11-05T09:11:39.567Z" }, + { url = "https://files.pythonhosted.org/packages/df/00/85e80811834d7cbd9bc228f9b5cdf8ec0edd69b55351ad720aac8c412d8c/pydantic_core-2.50.4-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:3e547ceec1da7382f01f9e13963023e53367a71802c88778b21b9645a077cbdf", size = 2170584, upload-time = "2026-11-05T09:11:41.139Z" }, + { url = "https://files.pythonhosted.org/packages/a3/f1/438de1fb99d717dcc6521922478dc16ef7b757302d4fc1f7faba3aaeac09/pydantic_core-2.50.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:c813ada7a651193acda85b6bc1cf12abd4b37cd25c7c6a75d7183512cc374969", size = 2128471, upload-time = "2026-11-05T09:11:42.65Z" }, + { url = "https://files.pythonhosted.org/packages/b7/74/f21ab568c6d3f315988b40e53f809c95b63fafc5403332963aa6dfc2c054/pydantic_core-2.50.4-cp311-cp311-manylinux1_i686.manylinux_2_5_i686.whl", hash = "sha256:57fa0a9490785139f1a4e4f43891830d55dfe4408845c0c9cb5eff4aeaf75f69", size = 2281509, upload-time = "2026-11-05T09:11:44.359Z" }, + { url = "https://files.pythonhosted.org/packages/a1/42/24ed3ea8e2fb6463c9ba5b8b1f089e69040905c7fd81dcfa6f52fcc692d5/pydantic_core-2.50.4-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:30d4dc35bc0eea52202a90b3820445ee0072c820241bfa710a623a078c9b267b", size = 2128064, upload-time = "2026-11-05T09:11:46.01Z" }, + { url = "https://files.pythonhosted.org/packages/d6/d1/44f541b2c18a46df6f18281a557acefeb5bbf0733a0b80b0a5e835e10ee4/pydantic_core-2.50.4-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:789f88dea57841cdebef392b5d6e90444d767117e9ff2e0d9172df5c9de6690c", size = 2214472, upload-time = "2026-11-05T09:11:47.503Z" }, + { url = "https://files.pythonhosted.org/packages/bd/1b/e9a9ad8733e8051abca9e4acce37ba3ddd13930fd3b8730f4c7816fa979a/pydantic_core-2.50.4-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:d690121e80ab16e623415351ab24713534d4e500b3cadff216409cb6826063d4", size = 2401153, upload-time = "2026-11-05T09:11:49.403Z" }, + { url = "https://files.pythonhosted.org/packages/79/84/d88e8e6aa42d4d677666d6625db9177ad6851be9e7564a25aeb0b0cbcaf2/pydantic_core-2.50.4-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:b42f64825f5d750228f08318a9bf4d723b7ecb4c472aedcb3013c3ec2dc1f949", size = 2453307, upload-time = "2026-11-05T09:11:51.118Z" }, + { url = "https://files.pythonhosted.org/packages/56/51/cbb7a1bc0196ff94d3478d265eed7449f811759988eb760d41f4edd0893b/pydantic_core-2.50.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:0574866e05f6adeecc520d87e87dd06210c0a51706341f6ef8421572f5a64444", size = 2253434, upload-time = "2026-11-05T09:11:52.997Z" }, + { url = "https://files.pythonhosted.org/packages/9e/04/206b4881d631033ae88f005da6e11bd610c850e1850217342c03053d253b/pydantic_core-2.50.4-cp311-cp311-manylinux_2_31_riscv64.whl", hash = "sha256:dcf2c7eaaa4cafe8e49b017e5bb49e76e084ab6f0cd712ee4019c812b5cf68b8", size = 2279365, upload-time = "2026-11-05T09:11:54.822Z" }, + { url = "https://files.pythonhosted.org/packages/a1/7c/d815b5a3f83069b283d3b6a2e61de6e14baac3b20c6cd3418e9e629551cf/pydantic_core-2.50.4-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:3b8ee2589a082739c522c1fe4be227412fcf108b903abb6672ae2f5570558882", size = 2319407, upload-time = "2026-11-05T09:11:56.46Z" }, + { url = "https://files.pythonhosted.org/packages/ee/00/c9a483276d1052d5142e1e01eccac97d939f83a3a3fd94c4766495a9b807/pydantic_core-2.50.4-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:aec3c2d741a8e3ee993de7f95f37afb51e31b169c95dbd29da4cf6688f340914", size = 2489900, upload-time = "2026-11-05T09:11:58.102Z" }, + { url = "https://files.pythonhosted.org/packages/2d/b5/8cd8ee29a1d63ad47f95593384df92476cef6896c644f280db0748b8e76b/pydantic_core-2.50.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:8923fcd49f875e8a0448d7223d1fdf1a9973ae2d1f20d4158753ceb8909facd2", size = 2497732, upload-time = "2026-11-05T09:11:59.928Z" }, + { url = "https://files.pythonhosted.org/packages/60/31/050a48c0c373df16442ac07f3fa167414bb0e22f54a3e886f6d6cb7ad1d4/pydantic_core-2.50.4-cp311-cp311-win32.whl", hash = "sha256:fc04affef30be98c1f36f0c422a4061ef618fdc1dde79f5ad5458dd496fecffa", size = 2132347, upload-time = "2026-11-05T09:12:01.928Z" }, + { url = "https://files.pythonhosted.org/packages/c6/06/cebeeb7a8e87b42a3d8bc189d0d400e47df5d1736cb326764bae8a74c433/pydantic_core-2.50.4-cp311-cp311-win_amd64.whl", hash = "sha256:15bece43a02ad543c621c8305e67dedb5f27d378c5ba741e5a2c36523f8ef37f", size = 2255970, upload-time = "2026-11-05T09:12:03.888Z" }, + { url = "https://files.pythonhosted.org/packages/46/db/5b4bf14347da658c994483043fbabffedcab98929c41c261ec168c3c1f87/pydantic_core-2.50.4-cp311-cp311-win_arm64.whl", hash = "sha256:e498900bfbf7ddddd862f810440c09e9b81674739e8a11d619b40906dccd4a9a", size = 2196799, upload-time = "2026-11-05T09:12:05.389Z" }, + { url = "https://files.pythonhosted.org/packages/10/bf/d1f6b81709538f831ebe1c42f50fb89db3dfda06f9e9b1ea24e90fc69209/pydantic_core-2.50.4-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:32a991aebd165f227b7c7c60bb9d66c2c7de9c24308552da264c9938fde0f8d6", size = 2231444, upload-time = "2026-11-05T09:12:06.969Z" }, + { url = "https://files.pythonhosted.org/packages/c1/39/6618e541658d5a687a8d4962fc304350073a8f322bc4c62e8ed4c2d514d6/pydantic_core-2.50.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1e20cbde2b6deb33a51d08cd168454dd9044ec7d4474056f4d98d63f51578783", size = 2108048, upload-time = "2026-11-05T09:12:08.85Z" }, + { url = "https://files.pythonhosted.org/packages/d9/54/1c941fffa4e14bfc9ab0cd4977075f0e03201447856130d08a33cd45e47b/pydantic_core-2.50.4-cp312-cp312-manylinux1_i686.manylinux_2_5_i686.whl", hash = "sha256:8cceae48ae7f94990c2f4e36291e9ec9868735e8b0f19e4489a17b0422338466", size = 2256866, upload-time = "2026-11-05T09:12:10.495Z" }, + { url = "https://files.pythonhosted.org/packages/61/a0/8028ef3e014be522ce43060aeac82a5be2288215e660866f5e6260acc123/pydantic_core-2.50.4-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:16902a147b3da4840612164a5e67947104d63e978f7a57c395877a5e26690b9c", size = 2125682, upload-time = "2026-11-05T09:12:12.278Z" }, + { url = "https://files.pythonhosted.org/packages/c3/f2/b98bb73b1734ec4e42e786a766abc24f3c89620a0ddbaf8aa14e4b4c628c/pydantic_core-2.50.4-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:d6e3485a5e5c01fb5339c1ee3d4b9e21e2135a2a9d44caafb71acd994487ee7c", size = 2197108, upload-time = "2026-11-05T09:12:13.873Z" }, + { url = "https://files.pythonhosted.org/packages/f1/d1/7a7142786781400143e8806633fe5b65e2d407c311041fc9494490f05b18/pydantic_core-2.50.4-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:629eae995185540406e3635df5d5cf1d44f19ea240840b835d3f44541ff694d8", size = 2380521, upload-time = "2026-11-05T09:12:15.539Z" }, + { url = "https://files.pythonhosted.org/packages/b5/34/cf710ca48d4498b04a3ea605d45892675dc2b14a94a25121a8d03f56d3e9/pydantic_core-2.50.4-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:41b2cd8b29dbb5a4c9828a70f50d1abfc92011115c813213d3a91205c6f731b3", size = 2457436, upload-time = "2026-11-05T09:12:17.447Z" }, + { url = "https://files.pythonhosted.org/packages/91/23/e0c6e3cd09a0ac809953fea698c816b9f03bf0b35b6820c9553e4f5d85a8/pydantic_core-2.50.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:c81d98e27d9d9261909dcccab1ba5d6ea1c98b0bb9470e368604614fd1d36ddd", size = 2261727, upload-time = "2026-11-05T09:12:19.097Z" }, + { url = "https://files.pythonhosted.org/packages/f9/00/292a0ed96d5d2d6edb49468ef481336e5b7e54f13435d73b7c912c891c23/pydantic_core-2.50.4-cp312-cp312-manylinux_2_31_riscv64.whl", hash = "sha256:ca83a32b2b41653d89f09a3d22b770bca96da72273bef8f7a68136bdd1e8b823", size = 2262071, upload-time = "2026-11-05T09:12:20.78Z" }, + { url = "https://files.pythonhosted.org/packages/f8/36/d4690faf8c082eacf7754e52ab6bebe1bc73b167272e28699c00480ee908/pydantic_core-2.50.4-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:817953730e4a73a09008b010c4a42396cefe799616a22df2ac21d3927b3080cf", size = 2298931, upload-time = "2026-11-05T09:12:22.614Z" }, + { url = "https://files.pythonhosted.org/packages/21/17/b180af6d17cf6c8e0d3d2661fc501a4a40959744ca4947d6ad0db81b1416/pydantic_core-2.50.4-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:664e74848c2f5fc27db8505fe24e1ecd3ac669412913bf73d176916f86cc08e2", size = 2474285, upload-time = "2026-11-05T09:12:24.842Z" }, + { url = "https://files.pythonhosted.org/packages/6e/bb/7e44d4ac6e1292f1859384c688713045bdf5448e0635c49c003d2be3bb6c/pydantic_core-2.50.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:219114f8dcdcbe4720d82ef016b1287ce5a0a67d7c69ca61524eb72e82aac344", size = 2498172, upload-time = "2026-11-05T09:12:26.434Z" }, + { url = "https://files.pythonhosted.org/packages/d8/84/5101f35294579c4bef7dc32fd4f097d91eedac2e195894266bdabc1e6dfd/pydantic_core-2.50.4-cp312-cp312-win32.whl", hash = "sha256:67f7cc397e1d5556a801d1cba74de0d27d827eb242e6c036c0ca273c745414f1", size = 2119592, upload-time = "2026-11-05T09:12:27.971Z" }, + { url = "https://files.pythonhosted.org/packages/82/88/d438a8fcf3738e9ff2670f724047ca3893ec899bcd5cdfc077a2aab133c6/pydantic_core-2.50.4-cp312-cp312-win_amd64.whl", hash = "sha256:ea2f61b0bc12f3592288503961b764579dea0658852d96a0b3d823614d808821", size = 2264064, upload-time = "2026-11-05T09:12:29.538Z" }, + { url = "https://files.pythonhosted.org/packages/77/d4/4a0c73dc3ef9e50b122b8c3527afcded15a44838f1c9668d2d4b72cc09f0/pydantic_core-2.50.4-cp312-cp312-win_arm64.whl", hash = "sha256:32d6dda86383645ec428ea64dfc277036f5cbc60a72238eab28b91a3fdb9a113", size = 2167792, upload-time = "2026-11-05T09:12:31.103Z" }, + { url = "https://files.pythonhosted.org/packages/1b/21/39f8d97e7ea8e3083606ee9bb1d7f3ec70ded780bb6a872aad76c7eb08b2/pydantic_core-2.50.4-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:0f87ae9db5ba8d8de40dcb93982cf8dd544e6552a80d3345af51941cc2146b80", size = 2232841, upload-time = "2026-11-05T09:12:32.617Z" }, + { url = "https://files.pythonhosted.org/packages/90/a9/fc89a632331882c4cb91b949003418e6f5085ddcf2c9b875d499682bca91/pydantic_core-2.50.4-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:1239daaf063e62213ca1f34d96663900bd7510c42a786e843fd328af70e46445", size = 2108326, upload-time = "2026-11-05T09:12:34.419Z" }, + { url = "https://files.pythonhosted.org/packages/5d/6d/4f6d00e9e4ba2a7bfb206ae49cb32a3ea90c4d658e62f8775277d75e8291/pydantic_core-2.50.4-cp313-cp313-manylinux1_i686.manylinux_2_5_i686.whl", hash = "sha256:1afefe44ec042fbabfb4483ea258c04cf75ff4ff328d754f09b321fdaa232aca", size = 2256276, upload-time = "2026-11-05T09:12:36.212Z" }, + { url = "https://files.pythonhosted.org/packages/b3/b8/936cb0d85a4082e902c7397db0f05c4372eac08372c8bd2d0b43088fcf17/pydantic_core-2.50.4-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:a9ee990bf2cfbd81574c5d4f9f6c9d480a14b5b43d2c4f2ca13f4c6f48089394", size = 2125469, upload-time = "2026-11-05T09:12:37.913Z" }, + { url = "https://files.pythonhosted.org/packages/66/a1/f3b551ce233dcac73286b8b2ae45c23232a9f41c68663e2dcce4bb2dbcfa/pydantic_core-2.50.4-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:ab2822bcdcefb54d1e8ca29f5e3ec3afe160fb794bb3a3a73b09d11ed2671104", size = 2196397, upload-time = "2026-11-05T09:12:39.725Z" }, + { url = "https://files.pythonhosted.org/packages/3d/93/a8a6e7e20826567a73e6f52416667698aa3de704804d7a49d25272246af4/pydantic_core-2.50.4-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:0001d6920e3a5d92758cda460d6dc9f918a78ad6d5d092f1c8b5395e6b775356", size = 2380442, upload-time = "2026-11-05T09:12:41.196Z" }, + { url = "https://files.pythonhosted.org/packages/aa/ba/921d90c9d8ddfa653a35a92f2bbdcd650a9493f5c43f39cdfe4c56659cfa/pydantic_core-2.50.4-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:ad92d255a165cde5f9882ff69699eaf5495e0a1f32e97566bbbb80f11e46781f", size = 2457747, upload-time = "2026-11-05T09:12:42.723Z" }, + { url = "https://files.pythonhosted.org/packages/2b/c0/1c8f2c8f1b03d3fe2fdd7962df8f5a744fe48c90b4c49615e4eb77d04141/pydantic_core-2.50.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:fb2bb5b557080da398b866408117d98fe9731a12334afd0cdff221b458cdc5dc", size = 2260946, upload-time = "2026-11-05T09:12:44.185Z" }, + { url = "https://files.pythonhosted.org/packages/07/ab/5b78a78f0c0f11c8b54fac214ed49cbb4795c34881aa5e5a15715917936f/pydantic_core-2.50.4-cp313-cp313-manylinux_2_31_riscv64.whl", hash = "sha256:92f8f63df729061bb14558ed740e7a222f6e2aa6c2e6a5bcfb4e706676562049", size = 2261921, upload-time = "2026-11-05T09:12:45.706Z" }, + { url = "https://files.pythonhosted.org/packages/b3/e8/dd5d154cf3401f836d8754fdc1b82ecadd37944e4355d855e5b54c7d8ae5/pydantic_core-2.50.4-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:2a60ec2a57ac3ef3767e526e9bf706ec75aa3d79c4ea134d9d4fcf7c62a297a7", size = 2298475, upload-time = "2026-11-05T09:12:47.183Z" }, + { url = "https://files.pythonhosted.org/packages/b7/49/af059d9c4483cba168b17e5f84f1090a3e4547a02fc7698ebc231d48298a/pydantic_core-2.50.4-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:a2f8716344bbbd10443391be0b1f2003b34949e3c4e6883005c2bc498ab6b64b", size = 2473226, upload-time = "2026-11-05T09:12:48.785Z" }, + { url = "https://files.pythonhosted.org/packages/71/ba/4e8cc3064e8bc2ea272cf80dfc57fa4e455f6835c1def21609a9b4f94135/pydantic_core-2.50.4-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:b300a30304c4c6aeab03ed06809819d9eceacdd58441d3c7dffe41edfd006091", size = 2498764, upload-time = "2026-11-05T09:12:50.316Z" }, + { url = "https://files.pythonhosted.org/packages/bf/96/0878499cfa88eb0b07762b488d3cc1b64cb156a4905db99a0d12096b2e17/pydantic_core-2.50.4-cp313-cp313-win32.whl", hash = "sha256:ef8a9ddb2e2a4eae4abb72dc0710eca6c2726779b0664bd10c3ce9fcfaed8c4e", size = 2119158, upload-time = "2026-11-05T09:12:51.834Z" }, + { url = "https://files.pythonhosted.org/packages/e7/e0/95b651213e79ffe0cbee855590bf5cfdf8e3a0d90a7fc73a080e63f7cc38/pydantic_core-2.50.4-cp313-cp313-win_amd64.whl", hash = "sha256:4c29b8f2d6417069bb1f257e6b9113f5d64dc2f554cc200ea90b4fe2c5cdb733", size = 2262887, upload-time = "2026-11-05T09:12:53.282Z" }, + { url = "https://files.pythonhosted.org/packages/08/d3/c3801dc75844a0b13d000bd575bf1b3b3a8aca9f63d19e1809f69c9c5121/pydantic_core-2.50.4-cp313-cp313-win_arm64.whl", hash = "sha256:a0c5210d038418a115e7cf8706bfa611bd14add2f5787274dba45aadca3155e0", size = 2167878, upload-time = "2026-11-05T09:12:54.677Z" }, + { url = "https://files.pythonhosted.org/packages/ee/ed/c9a4982ac3bbc78f27498d9efb85b3dabd739a1724db53c35cc4c018e1de/pydantic_core-2.50.4-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:5c074454dc6d4f6f4ba6561a56bf33a14db7651d882a5a5321ba3ae8868e082d", size = 2236841, upload-time = "2026-11-05T09:12:56.111Z" }, + { url = "https://files.pythonhosted.org/packages/56/32/92c174c17bfc5fc52d0c064e6a7969a727731e25829ede752fba8bacce0f/pydantic_core-2.50.4-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:a4bb174bd65f795c39ad6642d9d5bdc43351b306b7d0a654ab0d0abb38be245f", size = 2108348, upload-time = "2026-11-05T09:12:57.638Z" }, + { url = "https://files.pythonhosted.org/packages/cb/cb/9f637d424a04d3edce7dd527da941950cce05a74b025eef3d54427b86c8e/pydantic_core-2.50.4-cp314-cp314-manylinux1_i686.manylinux_2_5_i686.whl", hash = "sha256:0ec20aca2b067369913716847f7dfe5f4dddf16a46965b7a70bbad5defaaba86", size = 2261331, upload-time = "2026-11-05T09:12:59.154Z" }, + { url = "https://files.pythonhosted.org/packages/91/ff/1117a3cccabb67305bd98d992a84eaf275939a9a043b4f14126ed7252e4f/pydantic_core-2.50.4-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:70dbc9f83c41f37a4faa62dae5203853847223a891da446f48ef2efcfd5df806", size = 2128667, upload-time = "2026-11-05T09:13:00.614Z" }, + { url = "https://files.pythonhosted.org/packages/93/45/6de1b4a6e8c415cd547f90d1408a711e7975116423e3eb3046061c62d7c7/pydantic_core-2.50.4-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:3de6c2a4df2af0ac9ab4dc1488746fe8b1a90e27955d870d9edda3187d20092b", size = 2198183, upload-time = "2026-11-05T09:13:02.259Z" }, + { url = "https://files.pythonhosted.org/packages/d0/bd/c6e64c315d35cc0783a0ea033a3dca062bc368905d0217eab6f6f63007de/pydantic_core-2.50.4-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:3a48a5254d15a0ad050318bfc7a9566d4ec740118187e8f303e47a6840287eb7", size = 2386279, upload-time = "2026-11-05T09:13:03.988Z" }, + { url = "https://files.pythonhosted.org/packages/33/ab/0d56280c89d3841381e9c699c3fa80e3dd3288edf5e7fe4d149136835dca/pydantic_core-2.50.4-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:0af56dbf8822ba9f4efcbbfdc15478f8b6fb08f1609860cb50aa2cc8476b3c34", size = 2464343, upload-time = "2026-11-05T09:13:05.98Z" }, + { url = "https://files.pythonhosted.org/packages/56/9c/621ad8f88590a92a086b1168dce09369d9c5e079e2e635e6646d248af55b/pydantic_core-2.50.4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:f1d62fb172db35c6478c9323da34ff37d1f3d37d7d44337a9d94ba8c583e5730", size = 2265388, upload-time = "2026-11-05T09:13:07.808Z" }, + { url = "https://files.pythonhosted.org/packages/f3/7b/cef68a667bf29b86e293a80a601d488a84c8f45508915ad6201fcfe1a798/pydantic_core-2.50.4-cp314-cp314-manylinux_2_31_riscv64.whl", hash = "sha256:5c1013647be741647895c102831dcf79c34209662dbb683df9efb864417ed7d5", size = 2267012, upload-time = "2026-11-05T09:13:09.273Z" }, + { url = "https://files.pythonhosted.org/packages/4b/9f/3ae4d163d8feda2b52de88b5cd96b1c40f79d11503003b061136d2ece6ab/pydantic_core-2.50.4-cp314-cp314-musllinux_1_1_aarch64.whl", hash = "sha256:aeb2e123cbf978a905e9f55155c1b8316fbbfa7cf64d04521fe174bab302d100", size = 2300478, upload-time = "2026-11-05T09:13:10.758Z" }, + { url = "https://files.pythonhosted.org/packages/e8/72/41881d31f6452430ed6792679c5391795910f0a27a6aebd424683e504ed6/pydantic_core-2.50.4-cp314-cp314-musllinux_1_1_armv7l.whl", hash = "sha256:523466eba8ee10f7480f3c2057563145978011c583130d2cc01fb1e7af808e25", size = 2474874, upload-time = "2026-11-05T09:13:12.188Z" }, + { url = "https://files.pythonhosted.org/packages/05/ef/099874dd6d5ca1e49987dea87eecc05610183249450b1fff883d87f1e8eb/pydantic_core-2.50.4-cp314-cp314-musllinux_1_1_x86_64.whl", hash = "sha256:c9e70012926e97069cdd09221861aff412aa94e4cac2e019055cdb79485b150c", size = 2502771, upload-time = "2026-11-05T09:13:13.981Z" }, + { url = "https://files.pythonhosted.org/packages/c6/07/a7d8615b8677bf69e24666bbce431299850c95a7b084649342582a1c3210/pydantic_core-2.50.4-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:e6da138a1ecc1341c8b788a5ee822670b03788e1f5decf7af9d461de6e508b8e", size = 1496509, upload-time = "2026-11-05T09:13:15.704Z" }, + { url = "https://files.pythonhosted.org/packages/ab/71/fdf2c25c3a4f89968263c1d896c933809ca8d2fb13443626648a17b2e296/pydantic_core-2.50.4-cp314-cp314-win32.whl", hash = "sha256:13b6dd62b5279f5b9d72f3bf918a35443ee8bd549241d9dc52d79a2c3b6d7016", size = 2122015, upload-time = "2026-11-05T09:13:17.09Z" }, + { url = "https://files.pythonhosted.org/packages/3a/9f/3554f0148b01ddaa5e678bf5fbce4679873534e5c0985cdf6c59c41dc9a9/pydantic_core-2.50.4-cp314-cp314-win_amd64.whl", hash = "sha256:b0cdb655fbd1562c2dfc9986f9103a106f7058cd0915afc6e656d4b1d73f3387", size = 2265109, upload-time = "2026-11-05T09:13:18.702Z" }, + { url = "https://files.pythonhosted.org/packages/ed/3c/196ef237d9ec5cca5ea9b773911dee1a387b9b1d4bfea05625b3e191a338/pydantic_core-2.50.4-cp314-cp314-win_arm64.whl", hash = "sha256:df1c174796cd63eb6b139f7daf783affe1f3ed659605850e843b24764c21bfc5", size = 2165745, upload-time = "2026-11-05T09:13:20.245Z" }, + { url = "https://files.pythonhosted.org/packages/36/12/0ee82a41a3995f0b531cf14e0b823dc2365ba4a22330670fccaa72753f12/pydantic_core-2.50.4-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:edbca8789fd10f0de534b660a6b4c71f1fd18039679c918dad392ab044bb37e4", size = 2223917, upload-time = "2026-11-05T09:13:21.623Z" }, + { url = "https://files.pythonhosted.org/packages/90/2c/592f8404abbcc65a70e6a802d1dc8f11412af44913e5146cf5c345370074/pydantic_core-2.50.4-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:33b21f69540a12c2053cd1d95766d8bd9667a3897f7c712a642de8aa37eb0865", size = 2087372, upload-time = "2026-11-05T09:13:23.16Z" }, + { url = "https://files.pythonhosted.org/packages/ea/1d/c7111757c84b5b8c19b1e39ceb5e131e6e48e14169ec6004e0f8f28f43f3/pydantic_core-2.50.4-cp314-cp314t-manylinux1_i686.manylinux_2_5_i686.whl", hash = "sha256:ffb616d8d55965839670301dc3bae3abacff560a7e137a89056058a8a9da4d96", size = 2275190, upload-time = "2026-11-05T09:13:24.634Z" }, + { url = "https://files.pythonhosted.org/packages/3d/ae/6c49cc9b8e66e61adee782d1763894bf64a357cddae82f725059b85bdc98/pydantic_core-2.50.4-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:6c5687b59b6ba0f663c4f2f15470f68507d6b45ccd3a19ee6d224f95cbee70d8", size = 2110343, upload-time = "2026-11-05T09:13:26.168Z" }, + { url = "https://files.pythonhosted.org/packages/ed/39/0ee5261d1daa9ad526371181c13696add0565251b2823f6e00a9a9af397d/pydantic_core-2.50.4-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:c733087ecf7dde06b1d071679bfd5f3ba03266ba77814c1c7253bc48c9adedd9", size = 2207887, upload-time = "2026-11-05T09:13:27.681Z" }, + { url = "https://files.pythonhosted.org/packages/ac/b5/a0652c0e99590107e111088b6d059044380a787da9ffdd0b458ab4cd9453/pydantic_core-2.50.4-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:94733cb447c37b0ce6f71b39ca1288d5f966a084023a5617b4cc35a852586859", size = 2404171, upload-time = "2026-11-05T09:13:29.864Z" }, + { url = "https://files.pythonhosted.org/packages/a3/85/d49f0b8e09a0ffc40dcefb604f9e6020e0d61b51a5f64a504f382fa84c39/pydantic_core-2.50.4-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:b26f39a5be3cd91a2035818be3d0ffdf5282c3e1f5f53d3b80b7024021acee52", size = 2466049, upload-time = "2026-11-05T09:13:31.658Z" }, + { url = "https://files.pythonhosted.org/packages/e6/76/f2b04d7c53edfd8136053c812ea49914fbf4091196cb7baf9ea326fa2ff8/pydantic_core-2.50.4-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:c856e439a9d54d514e81a7131229ba151cdf81df7c408e0f6c89340e5003dfe2", size = 2262062, upload-time = "2026-11-05T09:13:33.806Z" }, + { url = "https://files.pythonhosted.org/packages/24/60/016f14cea883adc33df90b8df220df934de49ded9640f45c8e92bb298494/pydantic_core-2.50.4-cp314-cp314t-manylinux_2_31_riscv64.whl", hash = "sha256:cbf0777d54672990b10cb8ca9b0523499e182d7e2ea39f86b138519a902aa601", size = 2263713, upload-time = "2026-11-05T09:13:35.337Z" }, + { url = "https://files.pythonhosted.org/packages/f1/3f/b05828e978512973e7e215bab69e65e70d223d6309a17bf48084a50692f4/pydantic_core-2.50.4-cp314-cp314t-musllinux_1_1_aarch64.whl", hash = "sha256:edc17549ab592e33cfcaf285f047bb75fcd98f608aa9309af1187fd736ce9641", size = 2305044, upload-time = "2026-11-05T09:13:37.043Z" }, + { url = "https://files.pythonhosted.org/packages/91/c1/fca6c5f623ac45ba284713c614b30173aa0794899a0a457f866fa6f5e886/pydantic_core-2.50.4-cp314-cp314t-musllinux_1_1_armv7l.whl", hash = "sha256:23a9ba564b2db709ff16eca990992ba95a19069972b34bff87c81d4b473cd755", size = 2483506, upload-time = "2026-11-05T09:13:40.524Z" }, + { url = "https://files.pythonhosted.org/packages/94/c2/ec41f68d1208e53e1a73ead940c050c4316bbb555ba42676a5e949fd529e/pydantic_core-2.50.4-cp314-cp314t-musllinux_1_1_x86_64.whl", hash = "sha256:41f4f8ae714e4fea1d635880f8a1af715ecf080eed4d13c5b04a0f3210f9c61a", size = 2512832, upload-time = "2026-11-05T09:13:43.361Z" }, + { url = "https://files.pythonhosted.org/packages/43/22/58583b86309f70cce854e0e77c412839a56ac6c682d6060f5794afeff315/pydantic_core-2.50.4-cp314-cp314t-win32.whl", hash = "sha256:601fce6cea9ddeaa85329e12e7f351def38d233075f42a3012b9c48071b02941", size = 2101977, upload-time = "2026-11-05T09:13:45.735Z" }, + { url = "https://files.pythonhosted.org/packages/6b/28/193bc0994f7fe15f2874c1dfe2f3bc7872aed8283ffda2cf05fb9a5a06b4/pydantic_core-2.50.4-cp314-cp314t-win_amd64.whl", hash = "sha256:22e874666bdbd96d6bf629d32cd8ab376fedf1fd62585b52a42b9fa9fa6c20b6", size = 2240461, upload-time = "2026-11-05T09:13:48.38Z" }, + { url = "https://files.pythonhosted.org/packages/00/ed/5615cfdd5620a4926440eb1a2b73db0dc895824ba565ccaa8d9eb3a8e974/pydantic_core-2.50.4-cp314-cp314t-win_arm64.whl", hash = "sha256:71395a43da5584bb70556f380387e15f845c0dcf76373c1afbfa0025737576ac", size = 2168505, upload-time = "2026-11-05T09:13:50.762Z" }, + { url = "https://files.pythonhosted.org/packages/6d/9f/e6673535165d965a11c1d5339f53995f90234019827eaecb41a57e6e463d/pydantic_core-2.50.4-cp315-cp315-macosx_10_12_x86_64.whl", hash = "sha256:7ac2769a7ddd661e07e26c12220adc31b17014c48234b2a5a88993b8d4109e09", size = 2241950, upload-time = "2026-11-05T09:13:53.055Z" }, + { url = "https://files.pythonhosted.org/packages/6f/02/65951efadbf7826e6a270843f97e3da2ef726de2b6d9cd7c5dfa4c48807e/pydantic_core-2.50.4-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:930ad463d3fb7a340d323bcc496ec32dae469ec9974c29ff569f19806b6b03b4", size = 2112412, upload-time = "2026-11-05T09:13:55.309Z" }, + { url = "https://files.pythonhosted.org/packages/c9/d3/4fb6e2e4a9e4951f1e05b198366ed5330e0874e83d52077e8b985350fe0e/pydantic_core-2.50.4-cp315-cp315-manylinux1_i686.manylinux_2_5_i686.whl", hash = "sha256:b867f9fd183d76977f810c626d539265183c25b2284762893a31e8d6cacc81c0", size = 2263220, upload-time = "2026-11-05T09:13:57.555Z" }, + { url = "https://files.pythonhosted.org/packages/63/83/42e70436c523357b49393b73f161f2741acf36003c8efd2f941d2be56bae/pydantic_core-2.50.4-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:49eb1241a969a5994db6880c18c012b6cbe2340343d8f529721571806583e500", size = 2134716, upload-time = "2026-11-05T09:13:59.413Z" }, + { url = "https://files.pythonhosted.org/packages/36/66/ed9b87f4751fd07e472c62cfe151f575abdf4c452fab943d35ba8efdc6c4/pydantic_core-2.50.4-cp315-cp315-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:477af785d1846e4e96bf56983b92ea7553aaeccdeb8acdaa55c7cee9eda0ae32", size = 2201901, upload-time = "2026-11-05T09:14:01.472Z" }, + { url = "https://files.pythonhosted.org/packages/2b/21/ff2e6ac7202b6d326e9f007c6082f6e6f3aaa063790ea2a355bdc985addc/pydantic_core-2.50.4-cp315-cp315-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:29358a8ca74e7d81158d14e2b10c904bd18773293ae3788716c0626fe0342347", size = 2389670, upload-time = "2026-11-05T09:14:03.431Z" }, + { url = "https://files.pythonhosted.org/packages/b9/34/e9348bc13d549641791a51843ed140fbb311d9066628e27477343412d5ad/pydantic_core-2.50.4-cp315-cp315-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:300753f71c73302e218124baf995f00058e085cd01869bd9610bcbd0bd4500c1", size = 2468951, upload-time = "2026-11-05T09:14:05.028Z" }, + { url = "https://files.pythonhosted.org/packages/ac/5e/145a02bf2b9f66981108caf6cc9e78917e31e4caca14d1e3ccd3ff2c7293/pydantic_core-2.50.4-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:26cb012c4b8ca9f847bd0ac15978bd3d0f55b050bfbe6c47355edfc7e945029b", size = 2272957, upload-time = "2026-11-05T09:14:06.587Z" }, + { url = "https://files.pythonhosted.org/packages/fd/38/b71c5b245e923f6cf144e948ed2a9d6b7fb97d8905784db8d860f5176b8b/pydantic_core-2.50.4-cp315-cp315-manylinux_2_31_riscv64.whl", hash = "sha256:9be1cfe715ecaa060ffd5d599ef410b94ef2697a0eed4cee562f788a2aa2175b", size = 2275028, upload-time = "2026-11-05T09:14:08.219Z" }, + { url = "https://files.pythonhosted.org/packages/ba/71/2504dacdc5cd3ea3ec5e68c9b6e097c979500bcff220b97046cc8ea3c1ad/pydantic_core-2.50.4-cp315-cp315-musllinux_1_1_aarch64.whl", hash = "sha256:c81e35862aced259177a537ce1a6264c3a97bae1ced184ca9dc10ea754563688", size = 2305447, upload-time = "2026-11-05T09:14:09.795Z" }, + { url = "https://files.pythonhosted.org/packages/2c/90/904233a6c148bcac9f30bb96a2761e5fb52682d0d6de31a40c74a3714ceb/pydantic_core-2.50.4-cp315-cp315-musllinux_1_1_armv7l.whl", hash = "sha256:b2f2d13239487cecaae98c9f4d5904ad0737643cdf8873c88ec6a78b12214f20", size = 2477852, upload-time = "2026-11-05T09:14:11.443Z" }, + { url = "https://files.pythonhosted.org/packages/72/33/1cbdcbf343ca23b507e967b21dddc4c8bf17a74c8b5cad59228c85ba4efc/pydantic_core-2.50.4-cp315-cp315-musllinux_1_1_x86_64.whl", hash = "sha256:e6b4b08d09054310a4dc389fa61ee22a7a5a292cb23ab8a985136ca8828bf924", size = 2506352, upload-time = "2026-11-05T09:14:13.165Z" }, + { url = "https://files.pythonhosted.org/packages/91/24/3ad9ea0876e6624c90967e5f1446e751b275cfdfaaf798a0d8e0b30025bc/pydantic_core-2.50.4-cp315-cp315-win32.whl", hash = "sha256:6619d49a89a15cd04334f76fec530c155923bfc60da74ff5d815a52629e1aa6c", size = 2127780, upload-time = "2026-11-05T09:14:17.52Z" }, + { url = "https://files.pythonhosted.org/packages/c0/3c/0582532b90a12492471977bdbca1317eca5144f6342ea581d2cee73ccd35/pydantic_core-2.50.4-cp315-cp315-win_amd64.whl", hash = "sha256:e5bd109d095aaae989a0463d5ef0fcc43e9ddd5de125e656d3c119a79e466380", size = 2270596, upload-time = "2026-11-05T09:14:20.955Z" }, + { url = "https://files.pythonhosted.org/packages/6c/50/967cfe4f7043a993c0c80cd3563c598b5281d2276aa775d0f6ff7f714271/pydantic_core-2.50.4-cp315-cp315-win_arm64.whl", hash = "sha256:6118e5a5550e36582e19bac1a403711a748f9f18251b054c326d3db02aaa7a18", size = 2170880, upload-time = "2026-11-05T09:14:24.822Z" }, + { url = "https://files.pythonhosted.org/packages/9e/71/3ec5bd8a82f792482f16d79fdbe8ce85aa71bf7147e556c5fc5f8546818d/pydantic_core-2.50.4-cp315-cp315t-macosx_10_12_x86_64.whl", hash = "sha256:d8201c9f9035520cdcc7dcad383b039ec8123969b87e01cf27c3dd883c02313b", size = 2233053, upload-time = "2026-11-05T09:14:27.942Z" }, + { url = "https://files.pythonhosted.org/packages/6e/2e/614dc37aedf8e9f811c1f2eedaf8eb09a7c196e2d137fe82bcc9d5662ca2/pydantic_core-2.50.4-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:1de7be9a66fc8536770481ab64a05aae5067c725f2b29a09543af00e6a417b97", size = 2090776, upload-time = "2026-11-05T09:14:30.281Z" }, + { url = "https://files.pythonhosted.org/packages/f9/14/aefc14e3e05013070ee959fc0b8703f6860a2776ed6e75b9c748f61aced0/pydantic_core-2.50.4-cp315-cp315t-manylinux1_i686.manylinux_2_5_i686.whl", hash = "sha256:789a6453e5ffd18a7ab6b8c3a0dd8403053829197ec258ecb90c604c21ffcc99", size = 2272481, upload-time = "2026-11-05T09:14:32.578Z" }, + { url = "https://files.pythonhosted.org/packages/13/c9/d56999aa7236dc9303091db2b1ef7303f0b022baf25ebf33cd200c0cb933/pydantic_core-2.50.4-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:6348ad12fa741bcc9c2f173e99fbf27cbc038826d8c31a4a7d836eca27878ba2", size = 2113069, upload-time = "2026-11-05T09:14:34.69Z" }, + { url = "https://files.pythonhosted.org/packages/b7/d5/a62da9e72f272f198f6118c5457332bbd4b9fdc4b77858448120569756de/pydantic_core-2.50.4-cp315-cp315t-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:d49127f137f871cde3c5650af33bbbdcee02679dae76e020902fa106f522b8ae", size = 2202754, upload-time = "2026-11-05T09:14:36.49Z" }, + { url = "https://files.pythonhosted.org/packages/37/4a/e7f21577f96e42ac3082cd014df398c1c913d482afac1c8ef17b9e039198/pydantic_core-2.50.4-cp315-cp315t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:2f5cc5bcb94063fbbdfd285a2b302da34af07491337c10bb35de1d5220fa1583", size = 2411472, upload-time = "2026-11-05T09:14:38.63Z" }, + { url = "https://files.pythonhosted.org/packages/38/ad/c57c5e13bbfd3404ec1af519764aadbc52ee01e39f9f9ae9d28317f982f2/pydantic_core-2.50.4-cp315-cp315t-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:b99bed995ed7c41515c11fe2beb86f8a6cc298e5537cae2f736de2f982f74ef0", size = 2475330, upload-time = "2026-11-05T09:14:40.519Z" }, + { url = "https://files.pythonhosted.org/packages/6e/63/65cf0e1f1fd8cfaafee3c005712b8020e063b0f3e3571493ea68db5ec44f/pydantic_core-2.50.4-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:faa4e96385c820ce9d7f7a623486e23d4134ae3c9ba2071e44e0ab5a5a5002c4", size = 2265718, upload-time = "2026-11-05T09:14:42.379Z" }, + { url = "https://files.pythonhosted.org/packages/72/5d/fd9fdec9b25e2ef1f788970a84f749f0e28f166573c87654fd5387d8e5ce/pydantic_core-2.50.4-cp315-cp315t-manylinux_2_31_riscv64.whl", hash = "sha256:d6a166978f22f10cb91413f70519861605219346decf65bc79008f9257c94afe", size = 2273454, upload-time = "2026-11-05T09:14:44.286Z" }, + { url = "https://files.pythonhosted.org/packages/34/8c/19705c6d5eb72ff8c25006df8a375da7466176a5968781789e5415384f65/pydantic_core-2.50.4-cp315-cp315t-musllinux_1_1_aarch64.whl", hash = "sha256:a70d5effebd81ebd8e15a8aabdc7980832367b2b00c36543bac378977004cc80", size = 2314862, upload-time = "2026-11-05T09:14:45.97Z" }, + { url = "https://files.pythonhosted.org/packages/b8/fb/acefa27031aba2646b0d3026c4a1602e526489d39395ab17bc47f03234e3/pydantic_core-2.50.4-cp315-cp315t-musllinux_1_1_armv7l.whl", hash = "sha256:f8fd23653a252cefabea11cd041efd7b80bdf403e43a36dea53f9cb0aaa21f0f", size = 2479073, upload-time = "2026-11-05T09:14:47.526Z" }, + { url = "https://files.pythonhosted.org/packages/ef/e1/db08fa1e5edf1779fa0612f8d09f9030bdc513f593687c883cb781b86caa/pydantic_core-2.50.4-cp315-cp315t-musllinux_1_1_x86_64.whl", hash = "sha256:7646353a5a7c553c04167aca628e2550b538f492765b03ccf34321a560acc43c", size = 2521328, upload-time = "2026-11-05T09:14:49.042Z" }, + { url = "https://files.pythonhosted.org/packages/0d/51/bf1ec5b96c076d8d514b08f3bcffb3397df7a0fcc729eb960838a8bbe27f/pydantic_core-2.50.4-cp315-cp315t-win32.whl", hash = "sha256:65376dbe1ab4dbc768ca2b72b7c13993562c035f5925fd3bc7ff9c8c585c515d", size = 2107629, upload-time = "2026-11-05T09:14:50.891Z" }, + { url = "https://files.pythonhosted.org/packages/18/32/43d5db1824ec2314f737ff8d9962ff59954a74616d8656a8cc78790e45f1/pydantic_core-2.50.4-cp315-cp315t-win_amd64.whl", hash = "sha256:f08ee8248aad2d054e5bc4c73554d4505464698f6d754f16198dbc5764e9821d", size = 2244906, upload-time = "2026-11-05T09:14:53.056Z" }, + { url = "https://files.pythonhosted.org/packages/3a/c0/38c505004969c4641c3a077a8e72e354f02d5c06d8f51d7a103699704772/pydantic_core-2.50.4-cp315-cp315t-win_arm64.whl", hash = "sha256:da779ae50b46f3f7d1e1b5f362fdc0ad376a49fd55f6f3122dc2b6149936cdf7", size = 2179018, upload-time = "2026-11-05T09:14:54.448Z" }, + { url = "https://files.pythonhosted.org/packages/9a/18/2f6a25e9104d5af713d16671711927601da1f0db74e785be67bd590385c9/pydantic_core-2.50.4-graalpy312-graalpy250_312_native-macosx_10_12_x86_64.whl", hash = "sha256:c04e9d920e2674f54651fd260a15c5d2843526c73d5242ee4311325ddc9573b3", size = 2212591, upload-time = "2026-11-05T09:14:56.262Z" }, + { url = "https://files.pythonhosted.org/packages/4c/1b/ba8b721af10a7659e7fbbef320ff8eb55462557a72607858af5a9bd22cb1/pydantic_core-2.50.4-graalpy312-graalpy250_312_native-macosx_11_0_arm64.whl", hash = "sha256:5bc1811ef2b4d4ba63e8e452f6e332b6374bd1d2cbbfdf66826c8cb1f71dd10d", size = 2048167, upload-time = "2026-11-05T09:14:57.681Z" }, + { url = "https://files.pythonhosted.org/packages/48/42/3f8638e7d90bdd9a7c7f3e5084723af59e7f43f15a292e242d35624073ce/pydantic_core-2.50.4-graalpy312-graalpy250_312_native-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:0b059a7968b1911be5a2d9a8234827ab0bef9d1e465d4b42da525894143550e8", size = 2119548, upload-time = "2026-11-05T09:14:59.317Z" }, + { url = "https://files.pythonhosted.org/packages/e0/8d/4bfbacaf191f7939893d165e18eb301731fa3366c59a6e57336c4f168fbd/pydantic_core-2.50.4-graalpy312-graalpy250_312_native-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:bee28aab5a580eec673f7b68dfa8dece3dd37bd207ef8d22fafe23a8e9837296", size = 2279952, upload-time = "2026-11-05T09:15:00.907Z" }, + { url = "https://files.pythonhosted.org/packages/9e/3a/d405a50e02ea81cd95e93fc97f43d351eeaa1707c28aa6fb58a9f1c1efa9/pydantic_core-2.50.4-graalpy313-graalpy253_313_native-macosx_11_0_arm64.whl", hash = "sha256:71e03d2ea1a221d020cfc5b6cc8bbbedef23a06704c70fcf4d0afb42965b22d1", size = 2049324, upload-time = "2026-11-05T09:15:02.379Z" }, + { url = "https://files.pythonhosted.org/packages/8f/3b/03e7992115e17cae4131ecd71aadb8fd5e4a04cc2aead72c3c27e9b453d1/pydantic_core-2.50.4-graalpy313-graalpy253_313_native-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:09450778e3ab58d3f565899fcfbf6c82926e31af29e28e799d1d50941316e0cb", size = 2119802, upload-time = "2026-11-05T09:15:03.901Z" }, + { url = "https://files.pythonhosted.org/packages/e3/d5/b76fc647e473377ca6e693c21549ee3a4a7677e4962c28ae4659337c5114/pydantic_core-2.50.4-graalpy313-graalpy253_313_native-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:4eb15be588407148ef5937dc8d9256a71f6b115e6cddadb7aa20b6ee384680dc", size = 2280639, upload-time = "2026-11-05T09:15:05.374Z" }, + { url = "https://files.pythonhosted.org/packages/d8/18/3ca5b3b8ce7a540305e6856d013e9c6b9c0fef93258fef6038db0beb233a/pydantic_core-2.50.4-pp311-pypy311_pp73-macosx_10_12_x86_64.whl", hash = "sha256:39f489ce31272073e6e146f6781690f9c1ee8c126836e6403361ef91154d89fe", size = 2166960, upload-time = "2026-11-05T09:15:06.902Z" }, + { url = "https://files.pythonhosted.org/packages/a3/60/65d725001bffcde0170f6d37ae8bccce715e5311122eb6127f698115957e/pydantic_core-2.50.4-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:5b26e5f1793b96cdc60242bf38da86ff24a27a708aa396214cac9b534bf571c7", size = 2085636, upload-time = "2026-11-05T09:15:08.395Z" }, + { url = "https://files.pythonhosted.org/packages/ac/12/934cf1d44a3fee3c47231d4690dddee19264150c3aa59a3ddf66fa43454d/pydantic_core-2.50.4-pp311-pypy311_pp73-manylinux1_i686.manylinux_2_5_i686.whl", hash = "sha256:7210398a1607ad607dc73196e575b3148b00a333cbb602ddbe1b60ba54554f43", size = 2284621, upload-time = "2026-11-05T09:15:09.82Z" }, + { url = "https://files.pythonhosted.org/packages/c4/91/52248eee98d76f8d9239166d24928f805292df16729109f4f189cdb59be4/pydantic_core-2.50.4-pp311-pypy311_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:2f42584e5785385f681163a42506cab0d51295e17599a648396c52a7046c1372", size = 2277673, upload-time = "2026-11-05T09:15:11.236Z" }, + { url = "https://files.pythonhosted.org/packages/9f/89/900a7970ef19843aa79522a95b461e9c365b7fedd7ee80ef28a84dae9a41/pydantic_core-2.50.4-pp311-pypy311_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:2039e323acee9abfec1fb5f661776e8965fe5928f3b7f8431900a774cba5c317", size = 2297354, upload-time = "2026-11-05T09:15:12.798Z" }, + { url = "https://files.pythonhosted.org/packages/de/ec/053d829437f70070cdd7116a0257cc0da651103328ff1e9e82954c45efd6/pydantic_core-2.50.4-pp311-pypy311_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:71ade6d2e445839350d589ff99bbddfde16f3f32db28da5c894a09f99c8b2a03", size = 2469913, upload-time = "2026-11-05T09:15:14.319Z" }, + { url = "https://files.pythonhosted.org/packages/80/af/207c821cb0813e16d630660e0073491e3ab07370efaa6fa0b8b10fffb7b6/pydantic_core-2.50.4-pp311-pypy311_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:d7d406709ae924cf0b08b8282ca2f0e1c90526911d93bc040557cbc83b74c55f", size = 2503746, upload-time = "2026-11-05T09:15:15.736Z" }, + { url = "https://files.pythonhosted.org/packages/e7/ca/8a053f24e22d8150349cabaecb2f35c89dcf07fbaadb5e48295184dd0e5b/pydantic_core-2.50.4-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:7472c39480ccc11dda69a196d1b7c7a6b48eb6594b77f05d945599d3e47f731c", size = 2333540, upload-time = "2026-11-05T09:15:17.883Z" }, + { url = "https://files.pythonhosted.org/packages/ac/9d/41b374c62cdb87f84081e2ef2963a115eacc6284a26dbc96bb83568e83ec/pydantic_core-2.50.4-pp311-pypy311_pp80-macosx_10_12_x86_64.whl", hash = "sha256:b67d38e8bb0ade7e6e84575e4bb153fab35b122458077273aeb08fdf12be9d2c", size = 2166962, upload-time = "2026-11-05T09:15:20.276Z" }, + { url = "https://files.pythonhosted.org/packages/9a/4f/51ef440ee346d4388a2c4a3ac4b271fcc7b1d3ff68be8da2ed2be4d488b0/pydantic_core-2.50.4-pp311-pypy311_pp80-macosx_11_0_arm64.whl", hash = "sha256:4eda7e3fdef382b7d4492745988a5baaf6953923a337f8b9dde5f76fa8afde20", size = 2085634, upload-time = "2026-11-05T09:15:21.953Z" }, + { url = "https://files.pythonhosted.org/packages/4b/5f/c9ed62b96beb9050db221d29e81856b6e28f277db601f8b0c3a08f8cf913/pydantic_core-2.50.4-pp311-pypy311_pp80-manylinux_2_28_x86_64.whl", hash = "sha256:474f7e598c7902165662a5d5160d3fce31037890a2975a9871ebf7c05862300b", size = 2277804, upload-time = "2026-11-05T09:15:23.836Z" }, + { url = "https://files.pythonhosted.org/packages/63/bd/b912a5e251ef10ed7be5e543a2bfbeebb0c79bf6302bee786f8dc3bf4341/pydantic_core-2.50.4-pp311-pypy311_pp80-win_amd64.whl", hash = "sha256:3e0b395648c6cb871bceb2906907f255dc876ec425f2d5b024e129985cea8519", size = 2333539, upload-time = "2026-11-05T09:15:25.354Z" }, +] + [[package]] name = "pydantic-settings" version = "2.14.2" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "pydantic" }, + { name = "pydantic", version = "2.13.4", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.15'" }, + { name = "pydantic", version = "2.14.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.15'" }, { name = "python-dotenv" }, - { name = "typing-inspection" }, + { name = "typing-inspection", version = "0.4.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.15'" }, + { name = "typing-inspection", version = "0.4.5", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.15'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/5c/b5/8f48e906c3e0205276e8bd8cb7512217a87b2685304d64be27cad5b3019f/pydantic_settings-2.14.2.tar.gz", hash = "sha256:c19dd64b19097f1de80184f0cc7b0272a13ae6e170cbf240a3e27e381ed14a5f", size = 237700, upload-time = "2026-06-19T13:44:56.324Z" } wheels = [ @@ -3653,7 +3880,7 @@ name = "pyjwt" version = "2.15.0" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "typing-extensions", marker = "python_full_version < '3.11'" }, + { name = "typing-extensions", version = "4.15.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/02/a5/5197bfd06417837ac079921c66fa6393f1dea3557272a263cebfef69e432/pyjwt-2.15.0.tar.gz", hash = "sha256:b11c5f9791d7bf51c2b39a81ed669f6b2dbbd669df2942f6c60167e9e3d1abe4", size = 120513, upload-time = "2026-09-23T16:56:00.689Z" } wheels = [ @@ -3810,7 +4037,7 @@ dependencies = [ { name = "attrs" }, { name = "rpds-py", version = "0.30.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, { name = "rpds-py", version = "2026.6.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, - { name = "typing-extensions", marker = "python_full_version < '3.13'" }, + { name = "typing-extensions", version = "4.15.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.13'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/22/f5/df4e9027acead3ecc63e50fe1e36aca1523e1719559c499951bb4b53188f/referencing-0.37.0.tar.gz", hash = "sha256:44aefc3142c5b842538163acb373e24cce6632bd54bdb01b21ad5863489f50d8", size = 78036, upload-time = "2025-10-13T15:30:48.871Z" } wheels = [ @@ -4314,7 +4541,7 @@ resolution-markers = [ ] dependencies = [ { name = "greenlet", marker = "platform_machine == 'AMD64' or platform_machine == 'WIN32' or platform_machine == 'aarch64' or platform_machine == 'amd64' or platform_machine == 'ppc64le' or platform_machine == 'win32' or platform_machine == 'x86_64'" }, - { name = "typing-extensions" }, + { name = "typing-extensions", version = "4.15.0", source = { registry = "https://pypi.org/simple" } }, ] sdist = { url = "https://files.pythonhosted.org/packages/29/9c/271aa905cf2964f841371a97f3e63ab692bf51b4423d0491e67bc7f64037/sqlalchemy-2.0.54.tar.gz", hash = "sha256:baa8521e8ee9f24e75dfc7aaabc08020e551ef0d48d7c3e3536f5cddf277586b", size = 9969559, upload-time = "2026-09-15T21:06:57.337Z" } wheels = [ @@ -4383,7 +4610,8 @@ resolution-markers = [ "python_full_version == '3.11.*' and sys_platform != 'win32'", ] dependencies = [ - { name = "typing-extensions" }, + { name = "typing-extensions", version = "4.15.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.15'" }, + { name = "typing-extensions", version = "4.16.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.15'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/1f/44/311bac6b6ef81e4dfd0287d04900108b1f5c00c9761dd3c0a2b7b9d0f86b/sqlalchemy-2.1.4.tar.gz", hash = "sha256:7bd7ad604487daa7eab8716471c29a7185f17b5287ce73bb7bc79fea050d8cfd", size = 10544216, upload-time = "2026-10-07T17:33:59.116Z" } wheels = [ @@ -4484,7 +4712,7 @@ version = "1.3.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "anyio" }, - { name = "typing-extensions", marker = "python_full_version < '3.13'" }, + { name = "typing-extensions", version = "4.15.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.13'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/eb/e3/7c1dc7381d9f8ab7d854328ebfa884e62cb3f3d8549ddfd37c7814f42afa/starlette-1.3.1.tar.gz", hash = "sha256:05d0213193f2fbaae60e2ecb593b4add4262ad4e46536b54abe36f11a71724e0", size = 2703240, upload-time = "2026-06-12T09:23:11.602Z" } wheels = [ @@ -4690,18 +4918,42 @@ wheels = [ name = "typing-extensions" version = "4.15.0" source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version == '3.14.*' and sys_platform == 'win32'", + "python_full_version == '3.14.*' and sys_platform != 'win32'", + "python_full_version >= '3.12' and python_full_version < '3.14' and sys_platform == 'win32'", + "python_full_version >= '3.12' and python_full_version < '3.14' and sys_platform == 'emscripten'", + "python_full_version >= '3.12' and python_full_version < '3.14' and sys_platform != 'emscripten' and sys_platform != 'win32'", + "python_full_version == '3.11.*' and sys_platform == 'win32'", + "python_full_version == '3.11.*' and sys_platform != 'win32'", + "python_full_version < '3.11' and sys_platform == 'win32'", + "python_full_version < '3.11' and sys_platform != 'win32'", +] sdist = { url = "https://files.pythonhosted.org/packages/72/94/1a15dd82efb362ac84269196e94cf00f187f7ed21c242792a923cdb1c61f/typing_extensions-4.15.0.tar.gz", hash = "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466", size = 109391, upload-time = "2025-08-25T13:49:26.313Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/18/67/36e9267722cc04a6b9f15c7f3441c2363321a3ea07da7ae0c0707beb2a9c/typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548", size = 44614, upload-time = "2025-08-25T13:49:24.86Z" }, ] +[[package]] +name = "typing-extensions" +version = "4.16.0" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.15'", +] +sdist = { url = "https://files.pythonhosted.org/packages/f6/cc/6253133b5bb138fc3306cebfbda2c520f545d36b5be2c7255cc528bb45d6/typing_extensions-4.16.0.tar.gz", hash = "sha256:dc983d19a509c94dba722ee6abd33940f7c05a89e243c47e907eb4db6f1a43e5", size = 113555, upload-time = "2026-07-02T08:40:05.92Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/49/d3/b8441a820a491ddfc024b0b0cf0393375b75ea13866d9c66727e54c2fc80/typing_extensions-4.16.0-py3-none-any.whl", hash = "sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8", size = 45571, upload-time = "2026-07-02T08:40:04.659Z" }, +] + [[package]] name = "typing-inspect" version = "0.9.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "mypy-extensions" }, - { name = "typing-extensions" }, + { name = "typing-extensions", version = "4.15.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.15'" }, + { name = "typing-extensions", version = "4.16.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.15'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/dc/74/1789779d91f1961fa9438e9a8710cdae6bd138c80d7303996933d117264a/typing_inspect-0.9.0.tar.gz", hash = "sha256:b23fc42ff6f6ef6954e4852c1fb512cdd18dbea03134f91f856a95ccc9461f78", size = 13825, upload-time = "2023-05-24T20:25:47.612Z" } wheels = [ @@ -4712,14 +4964,40 @@ wheels = [ name = "typing-inspection" version = "0.4.2" source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version == '3.14.*' and sys_platform == 'win32'", + "python_full_version == '3.14.*' and sys_platform != 'win32'", + "python_full_version >= '3.12' and python_full_version < '3.14' and sys_platform == 'win32'", + "python_full_version >= '3.12' and python_full_version < '3.14' and sys_platform == 'emscripten'", + "python_full_version >= '3.12' and python_full_version < '3.14' and sys_platform != 'emscripten' and sys_platform != 'win32'", + "python_full_version == '3.11.*' and sys_platform == 'win32'", + "python_full_version == '3.11.*' and sys_platform != 'win32'", + "python_full_version < '3.11' and sys_platform == 'win32'", + "python_full_version < '3.11' and sys_platform != 'win32'", +] dependencies = [ - { name = "typing-extensions" }, + { name = "typing-extensions", version = "4.15.0", source = { registry = "https://pypi.org/simple" } }, ] sdist = { url = "https://files.pythonhosted.org/packages/55/e3/70399cb7dd41c10ac53367ae42139cf4b1ca5f36bb3dc6c9d33acdb43655/typing_inspection-0.4.2.tar.gz", hash = "sha256:ba561c48a67c5958007083d386c3295464928b01faa735ab8547c5692e87f464", size = 75949, upload-time = "2025-10-01T02:14:41.687Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/dc/9b/47798a6c91d8bdb567fe2698fe81e0c6b7cb7ef4d13da4114b41d239f65d/typing_inspection-0.4.2-py3-none-any.whl", hash = "sha256:4ed1cacbdc298c220f1bd249ed5287caa16f34d44ef4e9c3d0cbad5b521545e7", size = 14611, upload-time = "2025-10-01T02:14:40.154Z" }, ] +[[package]] +name = "typing-inspection" +version = "0.4.5" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.15'", +] +dependencies = [ + { name = "typing-extensions", version = "4.16.0", source = { registry = "https://pypi.org/simple" } }, +] +sdist = { url = "https://files.pythonhosted.org/packages/ff/50/0195198eb1d75bab716bb0a813abea4cc394bfa17a92a189f021a34859af/typing_inspection-0.4.5.tar.gz", hash = "sha256:7f16c411e7930dc79596d42ab44672a3fe5f60eb34b781a1647e7872363120c7", size = 81194, upload-time = "2026-11-04T14:13:23.774Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/de/0c/ea2544850a7c135e15033a5c7a8e7211136184b7ae63e2239d557c2b3019/typing_inspection-0.4.5-py3-none-any.whl", hash = "sha256:bc210535442b39e1bf2805e0c7a17dfd6a4ace760c84c7f7d16245d23a6b1c39", size = 14874, upload-time = "2026-11-04T14:13:22.616Z" }, +] + [[package]] name = "urllib3" version = "2.8.0" @@ -4837,7 +5115,7 @@ source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "click" }, { name = "h11" }, - { name = "typing-extensions", marker = "python_full_version < '3.11'" }, + { name = "typing-extensions", version = "4.15.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/2e/41/06cce5dbb9f77591512957710ac709e60b12e6216a2f2d0d607fd49706e8/uvicorn-0.50.0.tar.gz", hash = "sha256:0c92e1bc2259cb7faa4fcef774a5966588f2e88542744550b66799fba10b76f1", size = 93257, upload-time = "2026-07-04T05:03:26.33Z" } wheels = [ From d9ba7350097bfd7f6c303bc02ec056caf68cf92b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 16 Nov 2026 10:12:25 +0100 Subject: [PATCH 28/40] chore(main): release 1.5.7 (#283) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .release-please-manifest.json | 2 +- CHANGELOG.md | 7 +++++++ src/rius/__init__.py | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 7a75471..eb895cf 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.5.6" + ".": "1.5.7" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 09b579b..a168aaa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.5.7](https://github.com/glassflow/rius-sdk-python/compare/v1.5.6...v1.5.7) (2026-11-16) + + +### Bug Fixes + +* cover langchain 0.1.86 and llama-index 4.7.6 in the span-context stopgaps ([#282](https://github.com/glassflow/rius-sdk-python/issues/282)) ([19d4eaf](https://github.com/glassflow/rius-sdk-python/commit/19d4eaf87c3d2f6800469899f4f097d5506f8554)) + ## [1.5.6](https://github.com/glassflow/rius-sdk-python/compare/v1.5.5...v1.5.6) (2026-11-06) diff --git a/src/rius/__init__.py b/src/rius/__init__.py index 396b0a3..71bdbef 100644 --- a/src/rius/__init__.py +++ b/src/rius/__init__.py @@ -1,6 +1,6 @@ """GlassFlow SDK: OpenTelemetry-native tracing for AI agents and LLM apps.""" -__version__ = "1.5.6" # x-release-please-version +__version__ = "1.5.7" # x-release-please-version from .client import GlassflowClient, build_span_exporter, get_tracer, init, register_workspace from .compaction import mark_compaction From 8f954b905bf7a826a258f81cdd6a4fce60092653 Mon Sep 17 00:00:00 2001 From: Pablo <39369995+PabloPardoGarcia@users.noreply.github.com> Date: Mon, 16 Nov 2026 23:10:57 +0100 Subject: [PATCH 29/40] fix: land the 2026-11-16 GenAI semconv sweep and sync rius-semconv v1.13.0 (#289) --- README.md | 14 +- src/rius/_media.py | 51 +- src/rius/_semconv_generated.py | 118 ++- src/rius/_serde.py | 53 +- src/rius/_tool_definitions.py | 242 +++++ src/rius/client.py | 5 +- src/rius/compaction.py | 6 +- src/rius/config.py | 54 +- src/rius/generation.py | 57 +- src/rius/normalization.py | 157 ++- src/rius/semconv.py | 15 +- tests/conformance/_recording.py | 2 +- tests/conformance/_replay.py | 2 +- tests/conformance/known_differences.json | 60 ++ tests/fixtures/openinference_messages.json | 26 +- tests/fixtures/semconv/SOURCE | 2 +- tests/fixtures/semconv/media_parts.yaml | 54 +- tests/fixtures/semconv/sdk_cases/README.md | 9 +- .../semconv/sdk_cases/structured_content.json | 399 +++++++ .../semconv/sdk_cases/tool_definitions.json | 987 ++++++++++++++++++ tests/test_byte_objects.py | 92 ++ tests/test_config.py | 98 +- tests/test_crash_safety.py | 7 +- tests/test_generation.py | 161 ++- tests/test_instrumentation.py | 19 +- tests/test_media_parts.py | 53 + .../test_normalization_structured_content.py | 365 +++++++ tests/test_normalization_tools.py | 70 +- tests/test_sdk_cases.py | 36 +- tests/test_semconv.py | 23 + tests/test_span_limits.py | 2 +- tests/test_tool_definitions.py | 466 +++++++++ 32 files changed, 3601 insertions(+), 104 deletions(-) create mode 100644 src/rius/_tool_definitions.py create mode 100644 tests/fixtures/semconv/sdk_cases/structured_content.json create mode 100644 tests/fixtures/semconv/sdk_cases/tool_definitions.json create mode 100644 tests/test_normalization_structured_content.py create mode 100644 tests/test_tool_definitions.py diff --git a/README.md b/README.md index 35933b2..38791cc 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,7 @@ variables: | `service_version` | `RIUS_SERVICE_VERSION` | none | Sets `service.version` on the resource. Unset leaves it off, so `OTEL_RESOURCE_ATTRIBUTES` can supply it. | | `disabled` | `RIUS_DISABLED` | `false` | Kill switch. When true, spans are created but never exported. | | `sample_rate` | `RIUS_SAMPLE_RATE` | `1.0` | Head sampling ratio `0.0`–`1.0` (whole-trace; children follow root). | -| `capture_content` | `RIUS_CAPTURE_CONTENT` | `true` | When false, prompt/response content is stripped at export (metadata still sent). | +| `capture_content` | `RIUS_CAPTURE_CONTENT` | `true` | When false, prompt/response content is stripped at export (metadata still sent). When `RIUS_CAPTURE_CONTENT` is unset, `OTEL_INSTRUMENTATION_GENAI_CAPTURE_CONTENT` is read (see below). | | `bridge_foreign_provider` | `RIUS_BRIDGE_FOREIGN_PROVIDER` | `false` | Also export the spans of another OpenTelemetry SDK that owns the global provider (see below). | | `agent_name` | `RIUS_AGENT_NAME` | `service_name` | The agent this process is. Also the `gen_ai.main_agent.id` when `main_agent_id` is unset, so renaming it changes that id. | | `main_agent_id` | `RIUS_MAIN_AGENT_ID` | a `gen_ai.main_agent.id` in `OTEL_RESOURCE_ATTRIBUTES`, else the agent name | A stable id for the agent (a registry id or an ARN), stamped as `gen_ai.main_agent.id`. Never a per-process value. | @@ -149,6 +149,18 @@ rius.init(mask=lambda value, *, key: hash_pii(value) if "input" in key else valu rius.init(capture_content=False) # drop content entirely, keep metadata ``` +Content capture also follows the OpenTelemetry GenAI setting +`OTEL_INSTRUMENTATION_GENAI_CAPTURE_CONTENT` when `RIUS_CAPTURE_CONTENT` is +unset. `NO_CONTENT` turns capture off, and so does `EVENT_ONLY`, because Rius +records content on spans. `SPAN_ONLY` and `SPAN_AND_EVENT` keep it on. The value +is case-insensitive. An unrecognised one keeps capture on and logs a warning +naming the valid values (the OpenTelemetry conventions fall back to +`NO_CONTENT` instead). An empty value of either variable counts as unset (an +empty `RIUS_CAPTURE_CONTENT` also logs a warning). +The `capture_content` argument wins over both variables, and +`RIUS_CAPTURE_CONTENT` wins over the OpenTelemetry one. With neither set, +capture is on, unlike the OpenTelemetry default of `NO_CONTENT`. + ### Sessions, users and workspaces Three context managers scope every span started inside them, including the diff --git a/src/rius/_media.py b/src/rius/_media.py index 9478b3e..099cc0e 100644 --- a/src/rius/_media.py +++ b/src/rius/_media.py @@ -239,20 +239,45 @@ def replacement(mime: str | None, byte_size: int | None) -> str: _REPLACEMENT_BETWEEN, _REPLACEMENT_TAIL = _rest.split("") -def is_replacement(value: str) -> bool: - """Already a complete replacement: never stripped again, never context. +#: 2^53 - 1 has 16 digits, so a run with more significant digits is past it. +_MAX_BYTE_SIZE_DIGITS = 16 - The format with a mime that is unknown or token/token and a byte_size of - ASCII digits or unknown; anything that only looks like one is a token. + +def parse_replacement(value: str) -> tuple[str | None, int | None] | None: + """The mime and byte_size a complete replacement names, each None when + unknown; None when ``value`` is no complete replacement (see + ``is_replacement``). + + The byte_size is the digit run read as a decimal number, leading zeros of + any length allowed. A run with more significant digits than 2^53 - 1 has + is None and is never converted: ``int()`` refuses a string over 4300 + digits, and this runs inside the export chain. The caller still bounds a + shorter one to 2^53 - 1, as for a byte_size the part has. """ head, between, tail = _REPLACEMENT_HEAD, _REPLACEMENT_BETWEEN, _REPLACEMENT_TAIL if len(value) < len(head) + len(between) + len(tail): - return False + return None if not (value.startswith(head) and value.endswith(tail)): - return False + return None mime, sep, size = value[len(head) : len(value) - len(tail)].rpartition(between) digits = bool(size) and all("0" <= ch <= "9" for ch in size) - return bool(sep) and (mime == UNKNOWN or is_mime(mime)) and (digits or size == UNKNOWN) + if not (sep and (mime == UNKNOWN or is_mime(mime)) and (digits or size == UNKNOWN)): + return None + byte_size = None + if digits: + significant = size.lstrip("0") or "0" + if len(significant) <= _MAX_BYTE_SIZE_DIGITS: + byte_size = int(significant) + return (None if mime == UNKNOWN else mime), byte_size + + +def is_replacement(value: str) -> bool: + """Already a complete replacement: never stripped again, never context. + + The format with a mime that is unknown or token/token and a byte_size of + ASCII digits or unknown; anything that only looks like one is a token. + """ + return parse_replacement(value) is not None # --- the strip --------------------------------------------------------------- @@ -1445,7 +1470,9 @@ def native_part(part: Part) -> Part | None: * A blob carrying content becomes a stripped blob: sized from it, ``not_captured``, its modality from its MIME type first (some producers - label every file an image), else the one it has, else document. + label every file an image), else the one it has, else document. Content + that is a complete replacement gives its size, and its mime when the + part has no valid MIME type. * Any other part keeps a modality it has, else takes one from its MIME type, else (a uri) from its filename extension, else document. A blob without content keeps a valid size and stripped_reason. @@ -1457,6 +1484,14 @@ def native_part(part: Part) -> Part | None: part_type = part.get("type") mime = part.get("mime_type") if part_type == "blob" and isinstance(part.get("content"), str): + replaced = parse_replacement(part["content"]) + if replaced is not None: + # Bytes a strip already measured (an OTLP bytes value, a byte + # object): the size the base64 of the same bytes would give, and + # the part's own MIME type before the replacement's. + replaced_mime, size = replaced + kept = mime if is_mime(mime) else replaced_mime + return blob_part(own or "document", kept, safe_size(size), NOT_CAPTURED) return base64_blob(part["content"], own or "document", mime) if part_type == "uri" and is_data_url(part.get("uri")): return data_url_blob(part["uri"], own or "document", mime) diff --git a/src/rius/_semconv_generated.py b/src/rius/_semconv_generated.py index ac321dd..0db58a3 100644 --- a/src/rius/_semconv_generated.py +++ b/src/rius/_semconv_generated.py @@ -1,4 +1,4 @@ -# Vendored from rius-semconv v1.10.0 out/python/_semconv_generated.py by +# Vendored from rius-semconv v1.13.0 out/python/_semconv_generated.py by # scripts/sync-semconv.sh. Do not edit: change the registry in rius-semconv. """Rius semantic conventions: the constants and tables, generated. @@ -186,6 +186,7 @@ # OTel GenAI (subset we emit) GEN_AI_OPERATION_NAME = "gen_ai.operation.name" +GEN_AI_OPERATION_NAME_COMPACTION = "compaction" GEN_AI_PROVIDER_NAME = "gen_ai.provider.name" GEN_AI_REQUEST_MODEL = "gen_ai.request.model" GEN_AI_REQUEST_REASONING_LEVEL = "gen_ai.request.reasoning.level" @@ -340,9 +341,17 @@ # A free string, not an enum, in the registry. GEN_AI_TOOL_TYPE = "gen_ai.tool.type" -# The request's tool/function definitions, serialized verbatim (provider -# shapes differ; the backend reads names and sizes from either). Content, -# not identity, so it is listed in CONTENT_ATTRIBUTES. +# The request's tool/function definitions, in the conventions' shape +# where the SDKs recognise the provider's spelling: a function tool +# (OpenAI, Anthropic, Bedrock toolSpec, Gemini function declarations, +# the Vercel AI SDK) becomes {type: function, name, description, +# parameters}, and a provider's built-in tool keeps its fields with its +# type prefixed by the provider name. A built-in tool without a name +# (OpenAI's web_search, Gemini's google_search) stays without one on +# purpose: an invented name would read as a tool that was offered and +# never called. A definition in a shape the SDKs do not recognise is +# recorded as given. Content, not identity, so it is listed in +# CONTENT_ATTRIBUTES. GEN_AI_TOOL_DEFINITIONS = "gen_ai.tool.definitions" # The arguments the model passed to the tool. The TypeScript SDK writes it @@ -610,6 +619,53 @@ # the OpenTelemetry naming rules do not allow for an attribute. RIUS_COMPACTION_SUMMARY_TEXT = "rius.compaction.summary.text" +# --- Agent hints --- +# A hint is a short note Rius sends to a running agent about a problem it +# detected in the agent's current run ("search_docs has returned 0 results +# 5 times in this run; lookup_index covers the same pages"). The SDK +# receives it on the heartbeat response and hands it to the agent: the +# agent's code pulls it, an on_hint callback receives it, or a framework +# hook adds it to the next model call. The rius.hint.* keys are the +# attributes of the rius.hint.delivered event the SDK records at that +# moment, and are never set on a span. No convention defines a hint or +# its delivery. +# The hint's id exactly as Rius sent it, the same on every redelivery. It +# is the join key to the record Rius keeps for each hint it writes, which +# holds the run the hint is about, its code, the text the agent received +# and when it was written, so a reader finds what the hint said and how +# long it took to arrive without the event repeating any of it. +# The SDK de-duplicates on the id, so a hint Rius sends again gives no +# second event on the same channel. A hint can reach the agent through +# more than one channel and gives one event for each: at most one per +# (rius.hint.id, rius.hint.channel). A count of hints delivered must +# deduplicate on rius.hint.id. +RIUS_HINT_ID = "rius.hint.id" + +# Which problem the hint is about, as Rius named it. Copied from the hint +# so that measuring whether hints help can group deliveries by detector +# straight from the trace. The SDK copies it and never interprets it. +# Not gen_ai.prompt.name: a hint is not a managed prompt, and the model +# call a hint is injected into may carry the agent's own +# gen_ai.prompt.name and gen_ai.prompt.version, naming that call's prompt. +RIUS_HINT_CODE = "rius.hint.code" + +# Each code's wording is versioned, and a change of wording bumps the +# version, so two wordings of the same hint can be compared. An int, as +# Rius sends it. Not gen_ai.prompt.version, for the reason given on +# rius.hint.code. +RIUS_HINT_TEMPLATE_VERSION = "rius.hint.template_version" + +# drain when the agent's own code pulled the hint (drain_hints()), +# callback when the SDK passed it to an on_hint callback, inject when a +# framework hook added it to a model call just before the call. Only +# inject guarantees the model saw the hint; with drain and callback the +# agent's code decides what to do with it. Measuring whether hints help +# needs to tell the two apart. +RIUS_HINT_CHANNEL = "rius.hint.channel" +RIUS_HINT_CHANNEL_DRAIN = "drain" +RIUS_HINT_CHANNEL_CALLBACK = "callback" +RIUS_HINT_CHANNEL_INJECT = "inject" + # --- Span event names --- # Deprecated: replaced by the gen_ai.response.time_to_first_chunk span attribute. # First streamed token/chunk arrived. The standard signal is the span @@ -633,6 +689,35 @@ # compacted context sets gen_ai.conversation.compacted. RIUS_COMPACTION_EVENT = "rius.compaction" +# Recorded when the SDK hands a hint to the agent: drain_hints() returns +# it, an on_hint callback receives it, or a framework hook adds it to a +# model call. For every channel, the event goes on the root span of the +# run the hint is about (the hint's trace_id). The SDK keeps each run's +# root span while the run is open, and Rius delivers a hint only while +# its run is open. A hint with no trace_id is about the instance as a +# whole: its event goes on the current span if one is recording, and +# otherwise no event is recorded. +# One run can get several hints, so its root span can carry several of +# these events, one per hint and channel: at most one per +# (rius.hint.id, rius.hint.channel). A count of hints delivered must +# deduplicate on rius.hint.id. +# It carries the rius.hint.* attributes and never the hint's text, which +# the record Rius keeps for each hint it writes holds under the id. +# It records delivery, not the acknowledgement on the heartbeat: an ack +# only tells Rius to stop sending the hint, and the SDK acks hints it +# drops as well. +# For inject, nothing else is needed to measure whether a hint helped. The +# hint's run is the trace the event sits in, and the model calls after the +# hint are the LLM spans of that trace that start after the event's +# timestamp. The hint's id joins the event to the record Rius keeps for each +# hint it writes (its code, its run, when it was written). A key on each +# later model call naming the hints it carried would repeat what that join +# gives. With drain or callback, this event only says the agent's code +# received the hint: the SDK cannot know whether the code passed it to the +# model, acted on it itself, or ignored it, so measuring those needs a +# record from the agent's code. +RIUS_HINT_DELIVERED_EVENT = "rius.hint.delivered" + # --- Pending (partial) spans --- # Marks the content-free snapshot exported at span START; the backend maps it # to Finished=0 and the real span replaces it at end. This key knowingly bends @@ -1466,10 +1551,17 @@ class SpanKind(str, Enum): # are LLM calls the same way chat is, and create_agent is an AGENT span # just as invoke_agent is, so the mapping is many-to-one and only the # chat/invoke_agent entries round-trip. -# - CHAIN has no operation of its own, but four operations land on it. -# invoke_workflow and plan are real GenAI operations with no taxonomy -# value of their own; CHAIN is the honest home for both, and the reverse -# direction is the only one that can say so. agent_step is not a +# - CHAIN has no operation of its own, but five operations land on it. +# invoke_workflow, invoke_runner and plan are real GenAI operations with +# no taxonomy value of their own; CHAIN is the honest home for all three, +# and the reverse direction is the only one that can say so. +# invoke_runner is a framework entrypoint (the call that starts a +# framework's run loop), which the conventions define as not being an +# agent, so CHAIN rather than AGENT. The conventions name entrypoint +# operations invoke_{framework_entrypoint} in general, so a table cannot +# list them all: every consumer maps an operation that starts with +# invoke_ and is not in this table to CHAIN as well. invoke_agent is in +# the table, so it keeps AGENT. agent_step is not a # conventions operation: the Vercel AI SDK's @ai-sdk/otel writes it on # each step of an agent run (one model call and the tools it asked # for), a step within the run rather than an agent invocation, so @@ -1500,6 +1592,7 @@ class SpanKind(str, Enum): "retrieval": SpanKind.RETRIEVER, "rerank": SpanKind.RERANKER, "invoke_workflow": SpanKind.CHAIN, + "invoke_runner": SpanKind.CHAIN, "plan": SpanKind.CHAIN, "agent_step": SpanKind.CHAIN, "compaction": SpanKind.CHAIN, @@ -1613,6 +1706,7 @@ class SpanKind(str, Enum): "GEN_AI_MAIN_AGENT_ID", "GEN_AI_MAIN_AGENT_NAME", "GEN_AI_OPERATION_NAME", + "GEN_AI_OPERATION_NAME_COMPACTION", "GEN_AI_OUTPUT_MESSAGES", "GEN_AI_OUTPUT_TYPE", "GEN_AI_PROVIDER_NAME", @@ -1741,6 +1835,14 @@ class SpanKind(str, Enum): "RIUS_COMPACTION_TRIGGER_AUTO", "RIUS_COMPACTION_TRIGGER_MANUAL", "RIUS_CONTEXT_SIZES", + "RIUS_HINT_CHANNEL", + "RIUS_HINT_CHANNEL_CALLBACK", + "RIUS_HINT_CHANNEL_DRAIN", + "RIUS_HINT_CHANNEL_INJECT", + "RIUS_HINT_CODE", + "RIUS_HINT_DELIVERED_EVENT", + "RIUS_HINT_ID", + "RIUS_HINT_TEMPLATE_VERSION", "RIUS_MAIN_AGENT_DESCRIPTION", "RIUS_MAIN_AGENT_ID", "RIUS_MAIN_AGENT_NAME", diff --git a/src/rius/_serde.py b/src/rius/_serde.py index 5d84b4e..65ef5f6 100644 --- a/src/rius/_serde.py +++ b/src/rius/_serde.py @@ -349,21 +349,64 @@ def serialize(value: Any) -> str: return f"" -def _bounded_dumps(value: Any) -> str: +def json_text(value: Any) -> str: + """``value`` as JSON text in the one encoding, neither stripped nor cut. + + For a value another instrumentation set structured where the conventions + also allow its JSON text: the text is then read and stripped exactly as + that string would be. So it is encoded whole, neither cut at the attribute + cap, where ``serialize`` would, nor at the strip budget: the text is the + very string the JSON form of the value is, and every pass after this one + treats the two alike (a blob's base64 past the budget is rebuilt and + stripped, as it is in that string). The value is already whole in memory + on the span, as that string would be. Never raises: a value the encoder + refuses (a cycle, a key that is no string or number) is its repr, its + byte objects markers, for the strip to read. A caller that writes a byte + object as its replacement before encoding uses :func:`strict_json_text` + and falls back to this on the value as it came. + """ + text = strict_json_text(value) + if text is not None: + return text + try: + return safe_repr(value) + except Exception: + return f"" + + +def strict_json_text(value: Any) -> str | None: + """``value`` as JSON text as :func:`json_text` writes it, or None when the + encoder refuses it (a cycle, a key that is no string or number).""" + try: + return _dumps(value, _encode_whole) + except Exception: + return None + + +def _bounded_dumps(value: Any, finish: Callable[[str], str] = truncate) -> str: + return _dumps(value, lambda plain: _encode_within_budget(plain, finish)) + + +def _dumps(value: Any, encode: Callable[[Any], str]) -> str: # A lone non-finite number is its name, as the TypeScript SDK writes a # number with String(); inside a value it is null (see _finite). if isinstance(value, float) and not math.isfinite(value): return _non_finite_name(value) try: - return _encode_within_budget(value) + return encode(value) except ValueError: # The encoder refuses NaN and the infinities (allow_nan=False). Only # then is the value walked to replace them; a cycle raises again and # serialize falls back to repr, as it always has. - return _encode_within_budget(_finite(value)) + return encode(_finite(value)) + + +def _encode_whole(value: Any) -> str: + # The same text the budgeted walk renders, by the C encoder in one pass. + return LONE_SURROGATE.sub(_escape_surrogate, _encoder.encode(value)) -def _encode_within_budget(value: Any) -> str: +def _encode_within_budget(value: Any, finish: Callable[[str], str]) -> str: # iterencode without _one_shot takes the pure-Python path, which yields # chunks lazily as it walks the value; the C encoder renders everything # first. A small payload costs a few extra microseconds this way; a large @@ -386,4 +429,4 @@ def _encode_within_budget(value: Any) -> str: if size > MAX_STRIP_CHARS: kept = "".join(chunks)[:MAX_ATTR_CHARS] return _cut_past_budget(LONE_SURROGATE.sub(_escape_surrogate, kept)) - return truncate("".join(chunks)) + return finish("".join(chunks)) diff --git a/src/rius/_tool_definitions.py b/src/rius/_tool_definitions.py new file mode 100644 index 0000000..01a947b --- /dev/null +++ b/src/rius/_tool_definitions.py @@ -0,0 +1,242 @@ +"""Tool definitions in the GenAI conventions' shape (``gen_ai.tool.definitions``). + +The conventions define one tool type, ``function``: +``{"type": "function", "name", "description"?, "parameters"?}``, and a +definition whose ``type`` is ``function`` must match that shape: it can no +longer pass as the generic definition. Providers spell function tools their +own way, so each is rewritten: + +* OpenAI Chat Completions nests the function, ``{"type": "function", + "function": {"name", ...}}``: the nested object is lifted to the top level, + unless the top level already has a name (then the tool is already flat, + and ``function`` is one of its fields). +* Chat Completions nests a custom tool the same way, ``{"type": "custom", + "custom": {"name", "description", "format"}}``: the nested object is lifted + by the same rule, and the tool stays a custom tool (a provider tool, below), + unless the lifted tool is Anthropic's custom tool. +* Anthropic has no ``type`` (or ``"custom"``) and names the schema + ``input_schema``; OpenAI's legacy ``functions`` entries have no ``type`` + either. A definition with a name and no ``type`` is a function, and so is + a ``custom`` one with an ``input_schema``. +* A name is a non-empty string. An empty ``name`` is no name, as it is for a + tool call: no function tool is made with an empty name. +* The schema is ``parameters``; ``input_schema`` and the Vercel AI SDK's + ``inputSchema`` are renamed to it, in place. +* Bedrock Converse wraps the function, ``{"toolSpec": {"name", "description", + "inputSchema": {"json": schema}}}``: it is unwrapped, and ``json`` becomes + ``parameters``. +* A Gemini tool holds a list of declarations, ``{"function_declarations": + [...]}`` (``functionDeclarations`` in camel case; every spelling holding a + list expands, snake case first). Each declaration with a name + becomes its own function tool, its schema taken from ``parameters`` or, + failing that, ``parametersJsonSchema`` / ``parameters_json_schema`` / + ``input_schema`` / ``inputSchema``. A declaration without a name, and + whatever else the Gemini tool holds (a built-in such as ``google_search``), + is its own entry, rewritten by the rules for a single tool. +* A ``null`` ``parameters`` counts as no schema, so a schema under another + spelling still takes its place (a Python ``model_dump()`` of a Gemini + declaration holds both). + +Any other ``type`` is a provider's built-in tool (Anthropic's +``web_search_20250305``, OpenAI's ``web_search``). Its fields are kept, and its +``type`` is prefixed with the provider name, as the conventions recommend, so +it cannot collide with a type they define later: ``anthropic.web_search_20250305``. +An empty ``type`` is no type, and gets no prefix. +A type that already holds a dot is taken as namespaced and left alone, which +also keeps a second pass from stacking prefixes. Nothing is invented: a +built-in tool without a ``name`` (OpenAI's ``web_search``, Gemini's +``google_search``) stays without one. Tool names are read as the tools the +model was offered, and an invented name would be a tool offered and never +called by that name. + +An MCP tool (OpenAI Responses' ``type: "mcp"``, or any ``.mcp`` +type it is written as) loses its ``headers`` and its ``authorization``: the +headers are the requests' headers to the MCP server and can carry an +``Authorization`` credential, and ``authorization`` is an OAuth access token +for the server or connector. The Vercel AI SDK's ``openai.mcp`` provider tool +holds the same two members in its ``args``, and they go there too. +Credentials never belong in telemetry. This +applies to the definitions rewritten here, not to definitions another +instrumentation already wrote as ``gen_ai.tool.definitions``. + +Anything else (not an object, or no usable ``type`` or ``name``) is kept as +it is: it is the caller's data, and there is no shape to vouch for. + +Every rule's output is a fixed point: rewriting a rewritten list changes +nothing. The sink rewrites what an SDK exported, so this keeps one tool in one +shape. + +The TypeScript SDK's ``toolDefinitions.ts`` and the sink port this rule for +rule; all three write the same canonical JSON, key order included, and +rius-semconv's ``sdk_cases/tool_definitions.json`` holds them to it. Number +formatting is each language's own (Python writes ``1.0``, TypeScript ``1``), +and so is the order of integer-like keys in TypeScript. +""" + +from __future__ import annotations + +from typing import Any + +_FUNCTION = "function" +#: Schema spellings renamed to ``parameters``, first match wins. +_PARAMETER_SPELLINGS = ("input_schema", "inputSchema") +#: Gemini's own schema spellings, renamed to ``parameters`` on a declaration. +_GEMINI_PARAMETER_SPELLINGS = ("parametersJsonSchema", "parameters_json_schema") +#: A Gemini tool's list of function declarations, snake and camel case. +_GEMINI_DECLARATIONS = ("function_declarations", "functionDeclarations") +#: The Vercel AI SDK's provider tools, whose ``id`` is already ``.``. +_VERCEL_PROVIDER_TYPES = ("provider-defined", "provider") +_CUSTOM = "custom" +#: OpenAI Responses' MCP tool type; ``.mcp`` once namespaced. +_MCP = "mcp" +#: An MCP tool's members that hold credentials, dropped. +_MCP_CREDENTIALS = ("headers", "authorization") + + +def _named(value: Any) -> bool: + """A usable tool name: a non-empty string.""" + return isinstance(value, str) and bool(value) + + +def semconv_tool_definitions(tools: list[Any], provider: str | None) -> list[Any]: + """The definitions in the conventions' shape; the caller's list is not mutated. + + A Gemini tool expands to one entry per declaration, so the result can be + longer than ``tools``. + """ + definitions: list[Any] = [] + for tool in tools: + expanded = _gemini_declarations(tool, provider) + if expanded is None: + definitions.append(_semconv_tool_definition(tool, provider)) + else: + definitions.extend(expanded) + return definitions + + +def _gemini_declarations(tool: Any, provider: str | None) -> list[Any] | None: + """A Gemini tool as one entry per declaration, then the rest; None if not one.""" + if not isinstance(tool, dict) or tool.get("type") is not None: + return None + keys = [key for key in _GEMINI_DECLARATIONS if isinstance(tool.get(key), list)] + if not keys: + return None + entries: list[Any] = [] + for key in keys: + for declaration in tool[key]: + if isinstance(declaration, dict) and _named(declaration.get("name")): + entries.append(_gemini_declaration(declaration)) + else: + entries.extend(semconv_tool_definitions([declaration], provider)) + rest = {name: value for name, value in tool.items() if name not in keys} + if rest: + entries.extend(semconv_tool_definitions([rest], provider)) + return entries + + +def _gemini_declaration(declaration: dict[str, Any]) -> dict[str, Any]: + flat = {"type": _FUNCTION, **{k: v for k, v in declaration.items() if k != "type"}} + return _with_parameters(flat, _GEMINI_PARAMETER_SPELLINGS + _PARAMETER_SPELLINGS) + + +def _semconv_tool_definition(tool: Any, provider: str | None) -> Any: + if not isinstance(tool, dict): + return tool + kind = tool.get("type") + if kind == _FUNCTION: + nested = tool.get(_FUNCTION) + if not isinstance(nested, dict) or _named(tool.get("name")): + return _with_parameters(tool) + return _with_parameters(_lifted(tool, _FUNCTION, nested)) + if kind == _CUSTOM: + nested = tool.get(_CUSTOM) + if isinstance(nested, dict) and not _named(tool.get("name")): + return _semconv_tool_definition(_lifted(tool, _CUSTOM, nested), provider) + if _named(tool.get("name")) and (kind is None or (kind == _CUSTOM and "input_schema" in tool)): + rest = {key: value for key, value in tool.items() if key != "type"} + return _with_parameters({"type": _FUNCTION, **rest}) + spec = tool.get("toolSpec") + if kind is None and isinstance(spec, dict) and _named(spec.get("name")): + return _bedrock_tool(tool, spec) + if not isinstance(kind, str) or not kind: + return tool + if kind in _VERCEL_PROVIDER_TYPES: + identifier = tool.get("id") + if isinstance(identifier, str) and "." in identifier: + tool = {**tool, "type": identifier} + elif provider and "." not in kind: + tool = {**tool, "type": f"{provider}.{kind}"} + return _without_credentials(tool) + + +def _lifted(tool: dict[str, Any], kind: str, nested: dict[str, Any]) -> dict[str, Any]: + """The tool with its nested ``kind`` object's members at the top level. + + The nested members win; the top level's other members follow. + """ + flat: dict[str, Any] = {"type": kind} + flat.update((key, value) for key, value in nested.items() if key != "type") + flat.update( + (key, value) for key, value in tool.items() if key not in ("type", kind) and key not in flat + ) + return flat + + +def _without_credentials(tool: dict[str, Any]) -> dict[str, Any]: + """An MCP tool (``mcp`` or ``.mcp``) without its credential members. + + Dropped at the top level and in a Vercel provider tool's ``args``. Read + from the type the tool is written with, so a second pass drops the same + members. + """ + kind = tool.get("type") + if not isinstance(kind, str) or not (kind == _MCP or kind.endswith("." + _MCP)): + return tool + args = tool.get("args") + if isinstance(args, dict) and any(key in args for key in _MCP_CREDENTIALS): + tool = {**tool, "args": _without_members(args, _MCP_CREDENTIALS)} + if not any(key in tool for key in _MCP_CREDENTIALS): + return tool + return _without_members(tool, _MCP_CREDENTIALS) + + +def _without_members(members: dict[str, Any], keys: tuple[str, ...]) -> dict[str, Any]: + return {key: value for key, value in members.items() if key not in keys} + + +def _bedrock_tool(tool: dict[str, Any], spec: dict[str, Any]) -> dict[str, Any]: + """Bedrock's ``toolSpec`` lifted to a function tool, ``inputSchema.json`` as parameters.""" + flat: dict[str, Any] = {"type": _FUNCTION} + for key, value in spec.items(): + if key == "type": + continue + if key == "inputSchema" and isinstance(value, dict) and "json" in value: + flat["parameters"] = value["json"] + else: + flat[key] = value + flat.update( + (key, value) + for key, value in tool.items() + if key not in ("type", "toolSpec") and key not in flat + ) + return _with_parameters(flat) + + +def _with_parameters( + tool: dict[str, Any], spellings: tuple[str, ...] = _PARAMETER_SPELLINGS +) -> dict[str, Any]: + """The tool with its schema under ``parameters``, renamed where it stood. + + A ``null`` ``parameters`` is no schema: when another spelling holds one, + the null goes and that spelling is renamed. + """ + if tool.get("parameters") is not None: + return tool + for spelling in spellings: + if spelling in tool: + return { + ("parameters" if key == spelling else key): value + for key, value in tool.items() + if key != "parameters" + } + return tool diff --git a/src/rius/client.py b/src/rius/client.py index c97f1d0..1d4f19f 100644 --- a/src/rius/client.py +++ b/src/rius/client.py @@ -363,7 +363,10 @@ def init( headers: Extra headers for the OTLP exporter. disabled: If True, no exporter is attached (spans are dropped). sample_rate: Head sampling ratio 0.0-1.0 (whole-trace). Default 1.0. - capture_content: If False, strip prompt/response content at export. Default True. + capture_content: If False, strip prompt/response content at export. Default True, + or ``RIUS_CAPTURE_CONTENT``, or when that is unset + ``OTEL_INSTRUMENTATION_GENAI_CAPTURE_CONTENT`` (``NO_CONTENT`` and + ``EVENT_ONLY`` turn capture off). mask: Redact content attribute values at export (applies to all spans). instruments: Auto-instrumentation selection. ``None`` (default) enables every bundled instrumentor whose package is installed; a list diff --git a/src/rius/compaction.py b/src/rius/compaction.py index b766826..c09a1ff 100644 --- a/src/rius/compaction.py +++ b/src/rius/compaction.py @@ -23,6 +23,7 @@ from .semconv import ( GEN_AI_CONVERSATION_COMPACTED, GEN_AI_OPERATION_NAME, + GEN_AI_OPERATION_NAME_COMPACTION, OPENINFERENCE_SPAN_KIND, RIUS_COMPACTION_EXECUTOR, RIUS_COMPACTION_EXECUTOR_CLIENT, @@ -58,9 +59,8 @@ ) _TRIGGERS = (RIUS_COMPACTION_TRIGGER_AUTO, RIUS_COMPACTION_TRIGGER_MANUAL) -#: ``gen_ai.operation.name`` of the span: the registry's taxonomy table knows -#: it (it maps to CHAIN) but has no constant for it, and semconv.py defines none. -OPERATION_COMPACTION = "compaction" +#: ``gen_ai.operation.name`` of the span (the registry's taxonomy maps it to CHAIN). +OPERATION_COMPACTION = GEN_AI_OPERATION_NAME_COMPACTION def dropped_tokens(before: int | None, after: int | None) -> int | None: diff --git a/src/rius/config.py b/src/rius/config.py index a00d1ba..87dd7e0 100644 --- a/src/rius/config.py +++ b/src/rius/config.py @@ -32,6 +32,9 @@ ENV_DISABLED = "RIUS_DISABLED" ENV_SAMPLE_RATE = "RIUS_SAMPLE_RATE" ENV_CAPTURE_CONTENT = "RIUS_CAPTURE_CONTENT" +# The GenAI conventions' content-capture setting, read when +# RIUS_CAPTURE_CONTENT is unset. +ENV_OTEL_CAPTURE_CONTENT = "OTEL_INSTRUMENTATION_GENAI_CAPTURE_CONTENT" ENV_HEARTBEAT = "RIUS_HEARTBEAT" ENV_HEARTBEAT_INTERVAL = "RIUS_HEARTBEAT_INTERVAL" ENV_AGENT_NAME = "RIUS_AGENT_NAME" @@ -84,6 +87,50 @@ def _env_bool(name: str, *, default: bool) -> bool: return default +#: The conventions' capture modes, by whether Rius captures content under +#: them. Rius records content on spans only, so EVENT_ONLY (content on events, +#: none on spans) captures none. +_OTEL_CAPTURE_MODES = { + "NO_CONTENT": False, + "EVENT_ONLY": False, + "SPAN_ONLY": True, + "SPAN_AND_EVENT": True, +} + + +def _capture_content_from_env() -> bool: + """``RIUS_CAPTURE_CONTENT`` when set, else the conventions' setting, else on. + + An empty (or blank) value of either variable counts as unset, as + OpenTelemetry reads its own variables: templated deployments render an + omitted value as an empty one. A blank ``RIUS_CAPTURE_CONTENT`` still logs + a warning, as the other blank ``RIUS_*`` flags do. The conventions' + ``OTEL_INSTRUMENTATION_GENAI_CAPTURE_CONTENT`` is read case-insensitively. + Its own default is ``NO_CONTENT``, and the conventions ask for that on an + unrecognised value too. Rius keeps capture on in both cases, on purpose: + capture is on by default, and an unrecognised value logs a warning naming + the valid ones. + """ + rius = os.getenv(ENV_CAPTURE_CONTENT) + if rius is not None: + if rius.strip(): + return _env_bool(ENV_CAPTURE_CONTENT, default=True) + logger.warning("%s is empty; treated as unset.", ENV_CAPTURE_CONTENT) + raw = os.getenv(ENV_OTEL_CAPTURE_CONTENT) + if raw is None or not raw.strip(): + return True + mode = _OTEL_CAPTURE_MODES.get(raw.strip().upper()) + if mode is not None: + return mode + logger.warning( + "%s=%r is not recognised; content capture stays on. " + "Valid values: NO_CONTENT, SPAN_ONLY, EVENT_ONLY, SPAN_AND_EVENT.", + ENV_OTEL_CAPTURE_CONTENT, + raw, + ) + return True + + def _env_float(name: str, *, default: float) -> float: raw = os.getenv(name) if raw is None: @@ -297,7 +344,10 @@ def resolve_config( sample_rate: Head-sampling ratio for root traces (``RIUS_SAMPLE_RATE``). capture_content: When ``False``, content attributes are stripped at - export (``RIUS_CAPTURE_CONTENT``). + export (``RIUS_CAPTURE_CONTENT``; when that is unset, the + conventions' ``OTEL_INSTRUMENTATION_GENAI_CAPTURE_CONTENT``: + ``NO_CONTENT`` and ``EVENT_ONLY`` turn capture off, ``SPAN_ONLY`` + and ``SPAN_AND_EVENT`` keep it on). On by default. heartbeat: Enable the agent-lifetime heartbeat thread (``RIUS_HEARTBEAT``). On by default; set ``False`` or ``RIUS_HEARTBEAT=false`` to opt out. @@ -372,7 +422,7 @@ def resolve_config( else _finite("sample_rate", sample_rate, 1.0) ) resolved_capture_content = ( - _env_bool(ENV_CAPTURE_CONTENT, default=True) if capture_content is None else capture_content + _capture_content_from_env() if capture_content is None else capture_content ) resolved_heartbeat = _env_bool(ENV_HEARTBEAT, default=True) if heartbeat is None else heartbeat diff --git a/src/rius/generation.py b/src/rius/generation.py index 5a84e99..65f1aae 100644 --- a/src/rius/generation.py +++ b/src/rius/generation.py @@ -19,8 +19,9 @@ from ._errors import record_error from ._media import media_parts from ._serde import serialize +from ._tool_definitions import semconv_tool_definitions from ._tracer import sdk_tracer -from .normalization import REQUEST_PARAMETER_GUARDS, SKIP +from .normalization import REQUEST_PARAMETER_GUARDS, SKIP, unnamed_tool_call_part from .semconv import ( GEN_AI_INPUT_MESSAGES, GEN_AI_OPERATION_NAME, @@ -137,11 +138,15 @@ def _normalize_message(message: Any, default_role: str) -> dict[str, Any]: function = call.get("function") if not isinstance(function, dict): function = {} + name = function.get("name") + if not isinstance(name, str) or not name: + parts.append(unnamed_tool_call_part(call.get("id"), function.get("arguments"))) + continue parts.append( { "type": "tool_call", "id": call.get("id"), - "name": function.get("name"), + "name": name, "arguments": function.get("arguments"), } ) @@ -161,6 +166,30 @@ def normalize_messages(messages: Messages, default_role: str) -> list[dict[str, return [_normalize_message(message, default_role) for message in messages] +#: google-genai's package, whose pydantic models (``types.Tool``) are dumped. +_GOOGLE_GENAI = "google.genai" + + +def _plain(tool: Any) -> Any: + """A google-genai pydantic model (``types.Tool``) as its set fields, as JSON values. + + Only google-genai's models are dumped, since their fields are the provider + shape the definitions are rewritten from. Anything else (another library's + pydantic tool, such as a LangChain ``StructuredTool``), or a model whose + dump fails, is returned as it is. + """ + module = type(tool).__module__ + if module != _GOOGLE_GENAI and not module.startswith(_GOOGLE_GENAI + "."): + return tool + dump = getattr(tool, "model_dump", None) + if isinstance(tool, type) or not callable(dump): + return tool + try: + return dump(mode="json", exclude_none=True) + except Exception: + return tool + + class Generation: """Handle for recording gen_ai attributes on an LLM span. @@ -213,18 +242,21 @@ def set_output(self, messages: Messages) -> None: def set_tool_definitions(self, tools: list[Any]) -> None: """Record the request's tool/function definitions (``gen_ai.tool.definitions``). - Definitions are serialized verbatim, in whatever shape the provider - request used (OpenAI nests each tool under ``function``, Anthropic uses - top-level ``name``/``input_schema``) — no normalization, so what is - recorded is exactly what the model was shown. Definitions are content, - not identity: they are masked/stripped under ``capture_content=False`` - like messages are. + Definitions are recorded in the conventions' shape whatever shape the + provider request used: a function tool becomes ``{"type": "function", + "name", "description", "parameters"}`` (OpenAI's nested ``function`` + is lifted, Anthropic's ``input_schema`` becomes ``parameters``), and a + provider's built-in tool keeps its fields with its ``type`` prefixed + by the generation's provider (``anthropic.web_search_20250305``). + A pydantic model (google-genai's ``types.Tool``) is recorded as its + set fields. Definitions are content, not identity: they are + masked/stripped under ``capture_content=False`` like messages are. Args: - tools: The tools/functions list passed to the provider, verbatim. + tools: The tools/functions list passed to the provider, in its own shape. """ - self._tools = tools - self._span.set_attribute(GEN_AI_TOOL_DEFINITIONS, serialize(tools)) + self._tools = semconv_tool_definitions([_plain(tool) for tool in tools], self._provider) + self._span.set_attribute(GEN_AI_TOOL_DEFINITIONS, serialize(self._tools)) def _set_context_sizes(self) -> None: # Computed once, as the span ends (from end() and from the scoped @@ -563,7 +595,8 @@ def start_generation( ``reasoning.effort`` values. Provider-defined string, recorded verbatim. tools: The request's tool/function definitions, recorded immediately - via ``set_tool_definitions`` (verbatim, any provider shape). + via ``set_tool_definitions`` (any provider shape, recorded in the + conventions' shape). user_id: End-user identity (``user.id``) stamped on this span. Sugar for a single call; to attribute a whole request use ``user()``. output_type: The output modality the request asked for diff --git a/src/rius/normalization.py b/src/rius/normalization.py index 3df8e6f..2a6d541 100644 --- a/src/rius/normalization.py +++ b/src/rius/normalization.py @@ -87,6 +87,10 @@ reasons: the flattened ``llm.input_messages.N.message.*`` and ``llm.output_messages.N.message.*`` families become ``gen_ai.input.messages`` and ``gen_ai.output.messages``, which are content. +``structured_content_as_json`` comes first of all: the conventions now ask for +the content keys as maps and arrays rather than JSON strings, and every pass +after it reads them as JSON text, so a structured value is written as that +text before any of them runs. ``drop_embedding_vectors`` removes the indexed ``embedding.embeddings.N.embedding.vector`` family, which is never exported. @@ -113,21 +117,28 @@ from ._attributes import rebuilt_item_attributes, replacement_attributes from ._media import ( + is_mime, rebuild_native_parts, + replacement, url_part, ) from ._native_spans import native_error_type from ._provider_compaction import ProviderCompactions, compactions_in_response from ._provider_response import response_json from ._serde import ( + BYTE_OBJECTS, LONE_SURROGATE, UNREADABLE, attribute_value, + byte_object_size, + json_text, loads_json, loads_object, serialize, + strict_json_text, strip_within_budget, ) +from ._tool_definitions import semconv_tool_definitions from .aggregated_usage import WrappedCallTracker, move_aggregated_usage from .compaction import CompactedContextProcessor from .semconv import ( @@ -580,9 +591,10 @@ def normalize_tool_definitions(attributes: Mapping[str, Any] | None) -> dict[str * ``llm.tools.N.tool.json_schema``, which every bundled OpenInference instrumentor that sees tools writes (openai pops ``tools`` out of the request bag to do it). Each value is a JSON string; the schemas are - parsed and re-serialized as one array, in index order, VERBATIM — an - Anthropic ``input_schema`` stays an Anthropic ``input_schema``, as on - the native ``set_tool_definitions``. The indexed keys are then deleted. + parsed and re-serialized as one array, in index order, in the + conventions' shape, as on the native ``set_tool_definitions`` (see + ``_tool_definitions``; a built-in tool's type is prefixed with the + span's ``gen_ai.provider.name``). The indexed keys are then deleted. If any one schema does not parse, the family is left untouched rather than reassembled without it: it is content by prefix already, so nothing escapes, and a partial array would be a silent loss. @@ -632,7 +644,7 @@ def normalize_tool_definitions(attributes: Mapping[str, Any] | None) -> dict[str if stripped is not None: rebuilt = stripped[0] if not native: - rebuilt[GEN_AI_TOOL_DEFINITIONS] = serialize(schemas) + _set_definitions(rebuilt, schemas, _provider_of(attributes)) return rebuilt stripped = _bag_without_definitions(attributes) @@ -640,10 +652,27 @@ def normalize_tool_definitions(attributes: Mapping[str, Any] | None) -> dict[str return None rebuilt, definitions = stripped if not native: - rebuilt[GEN_AI_TOOL_DEFINITIONS] = serialize(definitions) + _set_definitions(rebuilt, definitions, _provider_of(attributes)) return rebuilt +def _set_definitions(attributes: dict[str, Any], tools: list[Any], provider: str | None) -> None: + """``gen_ai.tool.definitions`` from tools, unless they come to no definition. + + An empty list (no tools, or a Gemini tool with no declarations) writes + nothing, as the sink does; the sources are removed all the same. + """ + definitions = semconv_tool_definitions(tools, provider) + if definitions: + attributes[GEN_AI_TOOL_DEFINITIONS] = serialize(definitions) + + +def _provider_of(attributes: Mapping[str, Any]) -> str | None: + """The span's ``gen_ai.provider.name``, which prefixes built-in tool types.""" + provider = attributes.get(GEN_AI_PROVIDER_NAME) + return provider if isinstance(provider, str) else None + + def _bag_without_definitions( attributes: Mapping[str, Any], ) -> tuple[dict[str, Any], list[Any]] | None: @@ -694,6 +723,25 @@ def _bag_without_definitions( #: ``tool_call.*`` field is consumed and dropped, as the sink does. _TOOL_CALL_FIELDS = (("id", "id"), ("function.name", "name"), ("function.arguments", "arguments")) + +def unnamed_tool_call_part(call_id: Any, arguments: Any) -> dict[str, Any]: + """A tool call without a name, as a text part holding its id and arguments. + + The conventions require a ``tool_call`` part's name (a string), and a part + of a known type may not fall back to the generic part, so a call without + one cannot be a ``tool_call`` part. Rather than drop it, it is kept the way + content with no part type is: as text, the call's id and arguments as JSON, + each left out when absent. Every writer of tool-call parts uses this, in + both SDKs and the sink, so the bytes agree. + """ + call = { + key: value + for key, value in (("id", call_id), ("arguments", arguments)) + if value is not None + } + return {"type": "text", "content": serialize(call)} + + #: An index as the sink's ``strconv.Atoi`` reads one: an optional sign and #: ASCII digits, within int64. The sink is the other producer of this key, and #: the two must agree on which keys are messages. @@ -725,6 +773,8 @@ def encode(self) -> dict[str, Any]: then the tool calls, each family in index order. An empty role, id, name or arguments is omitted rather than written empty, as the sink does; empty content is still a part, because empty content was said. + A tool call left without a name is a text part + (:func:`unnamed_tool_call_part`). """ message: dict[str, Any] = {} if self.role: @@ -751,6 +801,8 @@ def encode(self) -> dict[str, Any]: for field, name in _TOOL_CALL_FIELDS: if call.get(field): part[name] = call[field] + if "name" not in part: + part = unnamed_tool_call_part(part.get("id"), part.get("arguments")) parts.append(part) message["parts"] = parts return message @@ -1195,6 +1247,92 @@ def compactions_from_output_value(attributes: Mapping[str, Any] | None) -> Provi return compactions_in_response(raw) +#: The content keys the GenAI conventions ask for as structured values (maps +#: and arrays) rather than JSON strings. OpenTelemetry Python keeps such a +#: value on a span from 1.45. +_STRUCTURED_CONTENT_KEYS = ( + GEN_AI_INPUT_MESSAGES, + GEN_AI_OUTPUT_MESSAGES, + GEN_AI_SYSTEM_INSTRUCTIONS, + GEN_AI_TOOL_DEFINITIONS, +) + + +def structured_content_as_json(attributes: Mapping[str, Any] | None) -> dict[str, Any] | None: + """The content keys set as structured values, each written as its JSON text. + + Returns the rebuilt attribute dict, or None when nothing changes. Every + pass after this one, the media rebuild and the strip included, reads these + keys as JSON text, as the conventions used to define them and as this SDK + still writes them. A mapping or an array is written as that text (the one + JSON encoding, see ``_serde``), and from then on it is that string: a + span carrying the structured value and a span carrying its JSON text + export the same attributes. A string, a scalar or a lone byte object is + not structured, and is left to the passes as it is. + + A blob part's byte content (``{"type": "blob", "content": b"..."}``) is + written as the replacement the strip writes for media + (``[stripped bytes]``), its mime the part's MIME type, + so the part is rebuilt with its size and MIME type as the same blob with + base64 content is, without rendering the bytes at all. A byte object + anywhere else is the marker, as everywhere this SDK writes one. + """ + if not attributes: + return None + rebuilt: dict[str, Any] | None = None + for key in _STRUCTURED_CONTENT_KEYS: + value = attributes.get(key) + if not isinstance(value, (Mapping, list, tuple)): + continue + if rebuilt is None: + rebuilt = dict(attributes) + rebuilt[key] = _structured_json_text(value) + return rebuilt + + +def _structured_json_text(value: Mapping[str, Any] | list[Any] | tuple[Any, ...]) -> str: + """``value`` as JSON text, a blob part's bytes as their replacement. + + The text is encoded whole (see ``json_text``), so a blob's base64 past the + strip budget is still found and stripped by the media rebuild, as it is in + the JSON text of the same value. A value the encoder refuses (a cycle, a + key that is no string or number) is the fallback text of the value as it + came, whose byte objects are markers. + """ + try: + text = strict_json_text(_plain_content(value, [])) + except RecursionError: + text = None + return json_text(value) if text is None else text + + +def _plain_content(value: Any, ancestors: list[int]) -> Any: + """``value`` with every mapping a dict and every array a list, for the encoder. + + A blob part's byte content becomes its replacement (see + :func:`structured_content_as_json`). A cycle is left as it is, for the + encoder to refuse. + """ + if not isinstance(value, (Mapping, list, tuple)): + return value + if id(value) in ancestors: + return value + ancestors.append(id(value)) + try: + if isinstance(value, Mapping): + plain = {key: _plain_content(item, ancestors) for key, item in value.items()} + content = plain.get("content") + if plain.get("type") == "blob" and isinstance(content, BYTE_OBJECTS): + size = byte_object_size(content) + if size is not None: + mime = plain.get("mime_type") + plain["content"] = replacement(mime if is_mime(mime) else None, size) + return plain + return [_plain_content(item, ancestors) for item in value] + finally: + ancestors.pop() + + #: The message keys whose parts a normalizer builds (the contract's #: ``raw_payloads.message_keys`` that hold semconv JSON). The system #: instructions are read and rewritten here, never emitted. @@ -1345,7 +1483,14 @@ def export(self, spans: Sequence[ReadableSpan]) -> SpanExportResult: return self._inner.export([self._normalized(span) for span in spans]) def _normalized(self, span: ReadableSpan) -> ReadableSpan: - new_attributes = self._table.normalize(span.attributes) + # First, so every pass below reads the content keys as JSON text, + # however the instrumentation set them. + structured = structured_content_as_json(span.attributes) + new_attributes = self._table.normalize( + span.attributes if structured is None else structured + ) + if new_attributes is None: + new_attributes = structured # After the table, which maps the dialects' usage onto the canonical # keys, so a zero it mapped goes with the native ones. On every span, # the SDK's own generations included, not only third-party ones. diff --git a/src/rius/semconv.py b/src/rius/semconv.py index 039b061..4e135f8 100644 --- a/src/rius/semconv.py +++ b/src/rius/semconv.py @@ -76,9 +76,20 @@ def operation_for_kind(kind: str) -> str | None: def kind_for_operation(operation: str) -> str | None: - """The taxonomy value for a ``gen_ai.operation.name``, or None if unknown.""" + """The taxonomy value for a ``gen_ai.operation.name``, or None if unknown. + + The conventions name a framework entrypoint ``invoke_{framework_entrypoint}`` + (``invoke_runner`` is one) and define it as not being an agent, so no table + can list them all. An ``invoke_`` operation the table does not know is a + CHAIN span; ``invoke_agent`` is in the table and stays AGENT. + """ kind = _KIND_BY_OPERATION.get(operation) - return kind.value if kind is not None else None + if kind is not None: + return kind.value + entrypoint = operation.removeprefix("invoke_") + if entrypoint and entrypoint != operation: + return SpanKind.CHAIN.value + return None def otel_span_kind(kind: SpanKind) -> OtelSpanKind: diff --git a/tests/conformance/_recording.py b/tests/conformance/_recording.py index 15c7248..8953011 100644 --- a/tests/conformance/_recording.py +++ b/tests/conformance/_recording.py @@ -1,4 +1,4 @@ -# Vendored from rius-semconv ab957f21453782a0e47350f3b6f964533785cf17 fixtures/_recording.py by +# Vendored from rius-semconv a5808570bf015dee2c61a83ee2ab489cefb570e5 fixtures/_recording.py by # scripts/sync-semconv-fixtures.sh. Do not edit: change it in rius-semconv. """Shared helpers for the recorders under fixtures//record.py. diff --git a/tests/conformance/_replay.py b/tests/conformance/_replay.py index 074047d..b20019a 100644 --- a/tests/conformance/_replay.py +++ b/tests/conformance/_replay.py @@ -1,4 +1,4 @@ -# Vendored from rius-semconv ab957f21453782a0e47350f3b6f964533785cf17 fixtures/_replay.py by +# Vendored from rius-semconv a5808570bf015dee2c61a83ee2ab489cefb570e5 fixtures/_replay.py by # scripts/sync-semconv-fixtures.sh. Do not edit: change it in rius-semconv. """Turn a stored recording back into OpenTelemetry ReadableSpans (Python). diff --git a/tests/conformance/known_differences.json b/tests/conformance/known_differences.json index d8b06f8..053b4a4 100644 --- a/tests/conformance/known_differences.json +++ b/tests/conformance/known_differences.json @@ -55,6 +55,66 @@ "family": "vercel-ai-v6", "key": "*", "reason": "As vercel-ai-v5." + }, + { + "family": "openinference-openai", + "key": "gen_ai.tool.definitions", + "reason": "The stored expected results record tool definitions in the provider's own shape (OpenAI's nested function, Anthropic's input_schema). This normalizer now records them in the conventions' function-tool shape, {type: function, name, description, parameters}, which the conventions' schema requires for a function tool. The expected results are regenerated in rius-semconv from this SDK once the change is released, and this entry goes in that re-sync." + }, + { + "family": "openinference-anthropic", + "key": "gen_ai.tool.definitions", + "reason": "As openinference-openai." + }, + { + "family": "openinference-js-anthropic", + "key": "gen_ai.tool.definitions", + "reason": "As openinference-openai." + }, + { + "family": "openinference-js-langchain", + "key": "gen_ai.tool.definitions", + "reason": "As openinference-openai." + }, + { + "family": "openinference-js-langchain-openai", + "key": "gen_ai.tool.definitions", + "reason": "As openinference-openai." + }, + { + "family": "openinference-js-openai", + "key": "gen_ai.tool.definitions", + "reason": "As openinference-openai." + }, + { + "family": "openinference-langchain", + "key": "gen_ai.tool.definitions", + "reason": "As openinference-openai." + }, + { + "family": "openinference-langchain-openai", + "key": "gen_ai.tool.definitions", + "reason": "As openinference-openai." + }, + { + "family": "openinference-litellm", + "key": "gen_ai.tool.definitions", + "reason": "As openinference-openai." + }, + { + "family": "openinference-litellm-openai", + "key": "gen_ai.tool.definitions", + "reason": "As openinference-openai." + }, + { + "family": "openinference-llama-index", + "key": "gen_ai.tool.definitions", + "reason": "As openinference-openai." + }, + { + "family": "openinference-llama-index-openai", + "key": "gen_ai.tool.definitions", + "reason": "As openinference-openai." } ] } diff --git a/tests/fixtures/openinference_messages.json b/tests/fixtures/openinference_messages.json index 9d2ef66..f73805d 100644 --- a/tests/fixtures/openinference_messages.json +++ b/tests/fixtures/openinference_messages.json @@ -185,7 +185,7 @@ } }, { - "name": "tool-call fields: missing or empty ones are omitted, unknown ones are consumed and dropped", + "name": "tool-call fields: missing or empty ones are omitted, unknown ones are consumed and dropped, a call left without a name is text", "sink_identical": true, "attributes": { "llm.input_messages.0.message.role": "assistant", @@ -198,7 +198,25 @@ "llm.input_messages.0.message.tool_calls.3.tool_call.reasoning_signature": "sig" }, "expected": { - "gen_ai.input.messages": "[{\"role\":\"assistant\",\"parts\":[{\"type\":\"tool_call\",\"name\":\"only_name\"},{\"type\":\"tool_call\",\"name\":\"empty_id\"},{\"type\":\"tool_call\"},{\"type\":\"tool_call\",\"id\":\"call_3\"}]}]" + "gen_ai.input.messages": "[{\"role\":\"assistant\",\"parts\":[{\"type\":\"tool_call\",\"name\":\"only_name\"},{\"type\":\"tool_call\",\"name\":\"empty_id\"},{\"type\":\"text\",\"content\":\"{}\"},{\"type\":\"text\",\"content\":\"{\\\"id\\\":\\\"call_3\\\"}\"}]}]" + } + }, + { + "name": "a tool call without a name is kept as a text part holding its id and arguments", + "sink_identical": true, + "attributes": { + "llm.output_messages.0.message.role": "assistant", + "llm.output_messages.0.message.tool_calls.0.tool_call.id": "call_1", + "llm.output_messages.0.message.tool_calls.0.tool_call.function.arguments": "{\"q\":\"otel\"}", + "llm.output_messages.0.message.tool_calls.1.tool_call.id": "call_2", + "llm.output_messages.0.message.tool_calls.1.tool_call.function.name": "", + "llm.output_messages.0.message.tool_calls.1.tool_call.function.arguments": "{}", + "llm.output_messages.0.message.tool_calls.2.tool_call.id": "call_3", + "llm.output_messages.0.message.tool_calls.2.tool_call.function.name": "search", + "llm.output_messages.0.message.tool_calls.2.tool_call.function.arguments": "{}" + }, + "expected": { + "gen_ai.output.messages": "[{\"role\":\"assistant\",\"parts\":[{\"type\":\"text\",\"content\":\"{\\\"id\\\":\\\"call_1\\\",\\\"arguments\\\":\\\"{\\\\\\\"q\\\\\\\":\\\\\\\"otel\\\\\\\"}\\\"}\"},{\"type\":\"text\",\"content\":\"{\\\"id\\\":\\\"call_2\\\",\\\"arguments\\\":\\\"{}\\\"}\"},{\"type\":\"tool_call\",\"id\":\"call_3\",\"name\":\"search\",\"arguments\":\"{}\"}]}]" } }, { @@ -410,7 +428,7 @@ "llm.output_messages.2.message.contents.0.tool_call.id": "toolu_C" }, "expected": { - "gen_ai.output.messages": "[{\"role\":\"assistant\",\"parts\":[{\"type\":\"text\",\"content\":\"{\\\"tool_call.id\\\":\\\"toolu_B\\\",\\\"type\\\":\\\"tool_use\\\"}\"},{\"type\":\"tool_call\",\"id\":\"toolu_A\"}]},{\"role\":\"assistant\",\"parts\":[{\"type\":\"text\",\"content\":\"{\\\"tool_call.function.name\\\":\\\"orphan\\\",\\\"type\\\":\\\"tool_use\\\"}\"}]},{\"role\":\"assistant\",\"parts\":[{\"type\":\"text\",\"content\":\"{\\\"text\\\":\\\"an extra field\\\",\\\"tool_call.id\\\":\\\"toolu_C\\\",\\\"type\\\":\\\"tool_use\\\"}\"},{\"type\":\"tool_call\",\"id\":\"toolu_C\"}]}]" + "gen_ai.output.messages": "[{\"role\":\"assistant\",\"parts\":[{\"type\":\"text\",\"content\":\"{\\\"tool_call.id\\\":\\\"toolu_B\\\",\\\"type\\\":\\\"tool_use\\\"}\"},{\"type\":\"text\",\"content\":\"{\\\"id\\\":\\\"toolu_A\\\"}\"}]},{\"role\":\"assistant\",\"parts\":[{\"type\":\"text\",\"content\":\"{\\\"tool_call.function.name\\\":\\\"orphan\\\",\\\"type\\\":\\\"tool_use\\\"}\"}]},{\"role\":\"assistant\",\"parts\":[{\"type\":\"text\",\"content\":\"{\\\"text\\\":\\\"an extra field\\\",\\\"tool_call.id\\\":\\\"toolu_C\\\",\\\"type\\\":\\\"tool_use\\\"}\"},{\"type\":\"text\",\"content\":\"{\\\"id\\\":\\\"toolu_C\\\"}\"}]}]" } }, { @@ -424,7 +442,7 @@ "llm.output_messages.0.message.contents.0.tool_call.id": "toolu_D" }, "expected": { - "gen_ai.output.messages": "[{\"role\":\"assistant\",\"parts\":[{\"type\":\"text\",\"content\":\"{\\\"text\\\":\\\"\\\",\\\"tool_call.id\\\":\\\"toolu_D\\\",\\\"type\\\":\\\"tool_use\\\"}\"},{\"type\":\"tool_call\",\"id\":\"toolu_D\"}]}]" + "gen_ai.output.messages": "[{\"role\":\"assistant\",\"parts\":[{\"type\":\"text\",\"content\":\"{\\\"text\\\":\\\"\\\",\\\"tool_call.id\\\":\\\"toolu_D\\\",\\\"type\\\":\\\"tool_use\\\"}\"},{\"type\":\"text\",\"content\":\"{\\\"id\\\":\\\"toolu_D\\\"}\"}]}]" } }, { diff --git a/tests/fixtures/semconv/SOURCE b/tests/fixtures/semconv/SOURCE index 63631e0..1321055 100644 --- a/tests/fixtures/semconv/SOURCE +++ b/tests/fixtures/semconv/SOURCE @@ -1 +1 @@ -rius-semconv ab957f21453782a0e47350f3b6f964533785cf17 +rius-semconv a5808570bf015dee2c61a83ee2ab489cefb570e5 diff --git a/tests/fixtures/semconv/media_parts.yaml b/tests/fixtures/semconv/media_parts.yaml index 3e66333..ecc5fac 100644 --- a/tests/fixtures/semconv/media_parts.yaml +++ b/tests/fixtures/semconv/media_parts.yaml @@ -1453,7 +1453,7 @@ part_shapes: - 'Every native media part in a message key (blob, uri or file) is always rebuilt into its canonical shape: members in the pinned order, extra members dropped, and every member that is unknown omitted. The only exception is a uri part whose uri is not a string, or a file part whose file_id is not a string: it is left as it came. Any string is a usable uri or file_id, the empty string included. An object of type file that holds a base64 or a url that is a string is no native file part but a LangChain v1 file block, read by the v1 rule below: so {"type":"file","file_id":5,"url":"https://example.com/a.wav"} is a uri, while {"type":"file","file_id":5} is a native file part left as it came. Every other normalized media part carries a modality. generators/media_parts.py native_part(data, part) is the reference: each example''s native part, and the part in each in_place example, is its test.' - 'Parts are rebuilt only in a message-key value that parses as JSON and nests at most 1000 levels deep. Arrays and objects count together from the value''s root, which is level 1: the message array, a message, its parts array and a tool call part are 4 levels. A value nested deeper (a tool call whose arguments add 997 more arrays makes 1001 levels) is left as it came, every part in it included; at 1000 levels its parts are rebuilt. The implementation counts the depth itself and never relies on its parser''s or its language''s recursion limit. The strip still runs on a value left this way.' - 'The modality that the part already has is kept, when it is one of modalities (any other value is ignored), except for a blob whose content is a string and a uri holding a data URL (below). Otherwise it is taken from the MIME type. Failing that, a provider item whose kind names a modality takes it from the kind: an image, image_url, input_image or image_generation_call item is image, an input_audio item audio, a document item document. A LangChain v1 block of type image, audio or video is that modality; a block of type file names none, so by a url that is not a data URL it takes the modality from the extension of the URL''s path (see extensions), and otherwise it is document. A text-plain block by base64 names none either and is document (one by url or file_id makes no part). A Bedrock Converse image, video, audio or document block is that modality. An OpenAI file or input_file item names none; its modality comes from the extension of its filename member alone (never from a file_url), and with no filename, or an empty one, it is document. A Gemini file_data, a native uri and a Vercel file part by URL take it from the extension of their URI''s path (see extensions), the Vercel part whether its URL is a plain string or v7''s {"type":"url"} data; a Vercel image part is an image. Otherwise it is document. So an Anthropic document by URL ending in .png is a document, an OpenAI input_file named a.png is an image, and an input_file by a file_url ending in .png with no filename is a document; a LangChain v1 image block by a URL ending in .bin is an image, and a v1 file block by a URL ending in .wav is audio. A native file part with no valid modality and no MIME type gets document; no member of it is read for an extension. Any other part with no MIME type and no other hint also gets document.' - - 'A blob whose `content` is a string is rebuilt with stripped_reason not_captured and a byte_size taken from the content under the size rule of the strip (omitted when the size is unknown). Its modality comes from its MIME type first, then from the modality it has, then document: a PDF blob labelled image is a document. A content string that is itself a data URL follows the data URL rules below, with the part''s mime_type as the hint and the same modality order. A blob in a message key never carries content.' + - 'A blob whose `content` is a string is rebuilt with stripped_reason not_captured and a byte_size taken from the content under the size rule of the strip (omitted when the size is unknown). A content string that is a complete replacement (see raw_payloads idempotence), such as the marker `[stripped unknown bytes]` an OTLP bytes value or an SDK byte object becomes (raw_payloads byte_objects), names bytes a strip already measured: its byte_size is the replacement''s, read as a decimal number (leading zeros allowed) and omitted when unknown or larger than 2^53 - 1, and its MIME type is the part''s mime_type when that is valid, else the replacement''s when that is not unknown. Every complete replacement is read this way, not only the bytes marker: each is a strip''s record of bytes it removed. So a blob whose content is base64, with its MIME type under mime_type or with none, makes the same part whether it is rebuilt before or after a strip. That is all this promises. A blob whose MIME type is under another key the strip reads (mimeType, media_type, mediaType or output_format), or whose content is a data URL, can make a different part after a strip: the strip reads more keys and replaces a data URL whole, while the part rules read only mime_type and size a data URL from its run. A string that is not a complete replacement (a near one such as `[stripped image/png lots bytes]`, or one inside other text) is sized as base64 like any other. Its modality comes from its MIME type first, then from the modality it has, then document: a PDF blob labelled image is a document. A content string that is itself a data URL follows the data URL rules below, with the part''s mime_type as the hint and the same modality order. A blob in a message key never carries content.' - 'A blob with no string `content` keeps a stripped_reason that is one of stripped_reasons. Otherwise its stripped_reason is redacted_upstream when it has no content member or a null one, and not_captured when its content is any other value. It keeps a byte_size that is a whole, non-negative number no larger than 2^53 - 1 (8, 8.0 and 8e0 alike, written 8); any other byte_size is omitted.' - 'A uri part, or a provider URI, whose URI is a data URL is never a uri: it becomes a blob under the data URL rules below. A data URL is a value that starts with data:, or with data%3A (rule (b)''s percent_scheme: a data URL percent-encoded whole, as encodeURIComponent writes it), in any ASCII case. Nor is a native uri part or a provider URI whose value holds data: anywhere else, in any ASCII case (a value led by whitespace, or a link with a data URL after it, wrapped, percent-encoded or not): it becomes a blob with the stripped_reason not_captured and no byte_size, its MIME type kept when valid, so no byte of the data URL survives. The provider URIs are an OpenAI image_url''s url and input_image''s image_url, an Anthropic image or document by a url source, an OpenAI input_file''s file_url, a Gemini file_data''s file_uri, a Vercel file or image part by URL (a plain string that starts with a URL scheme, or v7''s {"type":"url"} data), and the image url OpenInference flattens; a LangChain v1 url is read the same way (below). Any other value stays a uri as it came, a link that holds data%3A and no data: included (a proxy link with an encoded data URL in its query): the strip then replaces the encoded data URL inside it where it sits, as rule (b) does wherever it runs. A native uri part takes that blob''s modality as a blob whose content is a string does: from the MIME type first, then the modality it has, then document. A provider URI takes it from the MIME type the item gives (an Anthropic source''s media_type, a Gemini file_data''s mime_type, a Vercel part''s mediaType, the image media_type OpenInference flattens beside its url), then from the item''s kind (an image_url, an input_image and a Vercel image part are image, an Anthropic image or document that kind, an input_file the modality its filename names), then document: such a value has no path to read an extension from. The test is one search for [dD][aA][tT][aA]: with no trimming and no word boundary, so a link with data: in its path (https://e/metadata:x.png) becomes this blob too: a lost link, never a leak. generators/media_parts.py provider_uri_part(data, item) is the reference for a provider URI, and each example''s provider item is its test.' - 'A URL of any scheme other than data: is a uri, its link kept as written: http, https, gs, s3, file and any other scheme alike. Only a data: URL, or inline data, becomes a blob, and a native uri, a provider URI or a LangChain v1 url that holds data: anywhere else (above and below). Where one value may hold either a URL or bare base64 (a Vercel file part''s data or image part''s image, as a plain string or as v7''s {"type":"data"} data), it is a URL when it starts with a scheme: an ASCII letter, then any ASCII letters, digits, `+`, `-` or `.`, then a colon. Base64 holds no colon, so the two never meet; anything else is base64, but a value that starts with data%3A, which is a data URL (above). A value v7 tags {"type":"url"} is a URL whatever it holds. The strip reads these values the same way: rule (e) leaves a value that starts with a scheme to rule (b) (raw_payloads, rule (e)''s url_scheme and keeps_urls), except a value holding data: that rule (b)''s pattern does not match in full (a percent-encoded data URL, a link with a data URL after it), which rule (e) replaces whole, as the part rules make it a blob.' @@ -1486,6 +1486,10 @@ part_shapes: from: 'The string base64 makes the object a v1 file block, and as a usable reference it wins over the __REDACTED__ file_id, so it is a blob of 3 bytes.' input: '[ {"role": "user", "parts": [ {"type": "file", "file_id": "__REDACTED__", "base64": "QUJD"} ] } ]' output: '[ {"role": "user", "parts": [ {"type":"blob","modality":"document","byte_size":3,"stripped_reason":"not_captured"} ] } ]' + - name: blob_whose_content_is_the_bytes_marker + from: 'A spaced message value holding a native blob whose content is the bytes marker: the part takes the size the marker names.' + input: '[ {"role": "user", "parts": [ {"type": "blob", "modality": "image", "mime_type": "image/png", "content": "[stripped unknown 16 bytes]"} ] } ]' + output: '[ {"role": "user", "parts": [ {"type":"blob","modality":"image","mime_type":"image/png","byte_size":16,"stripped_reason":"not_captured"} ] } ]' examples: - name: blob_with_a_known_size from: 'A base64 data URL of image/png, 8 bytes decoded.' @@ -1511,6 +1515,54 @@ part_shapes: from: 'A native blob part with the mime_type image/png and a content member holding data:;base64, which names no mime type and has an empty run: the part''s mime_type is the hint.' native: '{"type":"blob","mime_type":"image/png","content":"data:;base64,"}' part: '{"type":"blob","modality":"image","mime_type":"image/png","byte_size":0,"stripped_reason":"not_captured"}' + - name: blob_with_content_that_is_the_bytes_marker + from: 'A native blob part whose content is the marker [stripped unknown 16 bytes], as a bytes value inside a structured message becomes before the part is rebuilt: the same 16 bytes sent as base64 make the same part.' + native: '{"type":"blob","modality":"image","mime_type":"image/png","content":"[stripped unknown 16 bytes]"}' + part: '{"type":"blob","modality":"image","mime_type":"image/png","byte_size":16,"stripped_reason":"not_captured"}' + - name: blob_with_content_that_is_a_replacement_with_a_mime_and_no_hint + from: 'A native blob part whose content is the complete replacement [stripped image/jpeg 10 bytes] and that has neither a MIME type nor a modality: the replacement''s mime is the MIME type, and gives the modality.' + native: '{"type":"blob","content":"[stripped image/jpeg 10 bytes]"}' + part: '{"type":"blob","modality":"image","mime_type":"image/jpeg","byte_size":10,"stripped_reason":"not_captured"}' + - name: blob_with_content_that_is_a_replacement_and_its_own_mime_type + from: 'A native blob part with the mime_type application/pdf whose content is the complete replacement [stripped image/png 8 bytes]: the part''s own valid mime_type wins over the replacement''s.' + native: '{"type":"blob","mime_type":"application/pdf","content":"[stripped image/png 8 bytes]"}' + part: '{"type":"blob","modality":"document","mime_type":"application/pdf","byte_size":8,"stripped_reason":"not_captured"}' + - name: blob_with_content_that_is_a_replacement_of_unknown_size + from: 'A native blob part with the modality audio whose content is the complete replacement [stripped unknown unknown bytes]: its size and mime are unknown, so both are omitted.' + native: '{"type":"blob","modality":"audio","content":"[stripped unknown unknown bytes]"}' + part: '{"type":"blob","modality":"audio","stripped_reason":"not_captured"}' + - name: blob_with_content_that_is_a_replacement_too_large_to_keep + from: 'A native blob part whose content is the complete replacement [stripped unknown 9007199254740992 bytes]: a size larger than 2^53 - 1 is omitted, as for a byte_size the part has.' + native: '{"type":"blob","content":"[stripped unknown 9007199254740992 bytes]"}' + part: '{"type":"blob","modality":"document","stripped_reason":"not_captured"}' + - name: blob_with_content_that_is_a_replacement_with_leading_zeros + from: 'A native blob part whose content is the complete replacement [stripped image/png 0008 bytes]: its size is the decimal number 8.' + native: '{"type":"blob","content":"[stripped image/png 0008 bytes]"}' + part: '{"type":"blob","modality":"image","mime_type":"image/png","byte_size":8,"stripped_reason":"not_captured"}' + - name: blob_with_content_that_is_a_replacement_with_thousands_of_leading_zeros + from: 'A native blob part whose content is a complete replacement whose size is 5000 zeros then 8: leading zeros of any length are allowed, so its size is 8.' + native: '{"type":"blob","content":"[stripped unknown 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008 bytes]"}' + part: '{"type":"blob","modality":"document","byte_size":8,"stripped_reason":"not_captured"}' + - name: blob_with_content_that_is_a_replacement_whose_size_overflows_int64 + from: 'A native blob part whose content is the complete replacement [stripped image/png 99999999999999999999 bytes]: a size past any 64-bit integer is larger than 2^53 - 1, so it is omitted, and the replacement''s mime is still read.' + native: '{"type":"blob","content":"[stripped image/png 99999999999999999999 bytes]"}' + part: '{"type":"blob","modality":"image","mime_type":"image/png","stripped_reason":"not_captured"}' + - name: blob_with_content_that_is_a_replacement_with_thousands_of_digits + from: 'A native blob part whose content is a complete replacement whose size is 5000 nines: far larger than 2^53 - 1, so it is omitted, and reading it never fails.' + native: '{"type":"blob","content":"[stripped unknown 99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 bytes]"}' + part: '{"type":"blob","modality":"document","stripped_reason":"not_captured"}' + - name: blob_with_content_that_only_looks_like_a_replacement + from: 'A native blob part with the mime_type image/png whose content is [stripped image/png lots bytes]: not a complete replacement, so it is sized as base64, which it is not, and has no byte_size.' + native: '{"type":"blob","mime_type":"image/png","content":"[stripped image/png lots bytes]"}' + part: '{"type":"blob","modality":"image","mime_type":"image/png","stripped_reason":"not_captured"}' + - name: blob_with_content_that_is_a_replacement_with_an_invalid_mime + from: 'A native blob part whose content is [stripped a b 3 bytes]: a b is no valid mime, so it is not a complete replacement, and its 3 is never read.' + native: '{"type":"blob","content":"[stripped a b 3 bytes]"}' + part: '{"type":"blob","modality":"document","stripped_reason":"not_captured"}' + - name: blob_with_content_that_holds_a_replacement_in_text + from: 'A native blob part whose content is the text see [stripped unknown 16 bytes]: a replacement inside other text is not a complete replacement, so the content is sized as base64, which it is not, and has no byte_size.' + native: '{"type":"blob","content":"see [stripped unknown 16 bytes]"}' + part: '{"type":"blob","modality":"document","stripped_reason":"not_captured"}' - name: blob_with_no_content_and_no_stripped_reason from: 'A native blob part with the modality audio and neither content nor stripped_reason.' native: '{"type":"blob","modality":"audio"}' diff --git a/tests/fixtures/semconv/sdk_cases/README.md b/tests/fixtures/semconv/sdk_cases/README.md index 05ad26c..bdc4a1a 100644 --- a/tests/fixtures/semconv/sdk_cases/README.md +++ b/tests/fixtures/semconv/sdk_cases/README.md @@ -7,6 +7,8 @@ result. The Python SDK and the TypeScript SDK both vendor this directory (`scripts/sync-semconv-fixtures.sh` copies it to `tests/fixtures/semconv/sdk_cases/`) and run every case through their own code, so the two SDKs agree with each other by agreeing with these files. +The sink (argus-core) vendors `tool_definitions.json` too, since it rewrites +tool definitions by the same rules. | File | What it checks | Through | | -- | -- | -- | @@ -17,6 +19,8 @@ code, so the two SDKs agree with each other by agreeing with these files. | `env.json` | `RIUS_*` variables: booleans (blank or unrecognised keeps the default), blank strings (unset), numbers (as Python's `float()` reads them, clamped to range). | `resolve_config()` / `resolveConfig({}, env)` | | `resource.json` | `OTEL_RESOURCE_ATTRIBUTES` merged under the SDK's own resource keys, and the `unknown_service` placeholder never stamped as an agent name. | `init()` | | `anthropic_error_type.json` | `error.type` on a span the Anthropic SDK made itself: the exception class it raises for the HTTP status, for the statuses every Anthropic client in both languages maps alike (400, 401, 403, 404, 409, 422, 429, and every 5xx but 503, 504 and 529); anything else kept. | the SDK's span normalization | +| `structured_content.json` | `gen_ai.input.messages`, `gen_ai.output.messages`, `gen_ai.system_instructions` and `gen_ai.tool.definitions` set by another instrumentation as maps and arrays: each written as its compact JSON and then normalized as that string, so it exports as its JSON string does; a blob part's byte content as its base64, any other byte object the marker. | the SDK's span normalization | +| `tool_definitions.json` | `gen_ai.tool.definitions` in the conventions' shape from each provider's own: OpenAI chat and Responses, Anthropic, Gemini declarations, Bedrock `toolSpec`, Vercel AI SDK and MCP tools, and Chat Completions `custom` tools, and the edge cases (null `parameters`, an empty `type`, an empty `name` as no name, an MCP tool's `headers` and `authorization` dropped, in a Vercel provider tool's `args` too). Rewriting an output again writes it unchanged. | `semconv_tool_definitions` / `semconvToolDefinitions`, and the sink's | Each file holds an `about`, which says what a case's fields mean, and `cases`, each with a unique `name`. A field an SDK spells differently is named @@ -50,8 +54,9 @@ mapping with one tagged key, which each SDK's test decodes: A case belongs here only when both SDKs must give the same result. Where the languages differ by nature it is left out: JavaScript has one number type, so -`1.0` is `"1"` in TypeScript and `"1.0"` in Python; Python writes a boolean a -mask returns for the status description as `True`, TypeScript as `true`. +`1.0` is `"1"` in TypeScript and `"1.0"` in Python, and `1e-7` is `"1e-7"` in +TypeScript and `"1e-07"` in Python, inside JSON text as anywhere else; Python +writes a boolean a mask returns for the status description as `True`, TypeScript as `true`. Behaviour only one SDK has is tested in that SDK alone. ## Changing a case diff --git a/tests/fixtures/semconv/sdk_cases/structured_content.json b/tests/fixtures/semconv/sdk_cases/structured_content.json new file mode 100644 index 0000000..1fa57c4 --- /dev/null +++ b/tests/fixtures/semconv/sdk_cases/structured_content.json @@ -0,0 +1,399 @@ +{ + "about": "How an SDK exports the content keys another instrumentation set as structured values (maps and arrays) rather than JSON strings, as the GenAI conventions now ask: gen_ai.input.messages, gen_ai.output.messages, gen_ai.system_instructions and gen_ai.tool.definitions. Each such value is written as its JSON text in the one encoding (compact, raw UTF-8, no HTML escaping, a non-finite number null) and then normalized exactly as that string would be, so a structured value and its JSON string export the same attributes. A byte object that is a blob part's content is written as its base64, as a blob part's JSON carries it, at any depth, so a part in `parts` is rebuilt with its byte_size and its bytes stripped, and one elsewhere (inside a tool call response, say) has its base64 stripped to the blob's marker; any other byte object is the marker. A data URL in a uri part is rebuilt as a blob part, as in its JSON string. A string, a number or a boolean is not structured and is kept; a lone byte object is the marker. A float's text is the SDK's own (an integral float is `2.0` in Python and `2` in TypeScript), so the cases hold no integral float and no exponent. `attributes` are the span's attributes as it ends, as the third-party instrumentation set them, and `expected` every attribute the span is exported with, after normalization and before masking. Keys are never integer-like, since JavaScript orders those first in an object.", + "cases": [ + { + "name": "input_messages_structured", + "attributes": { + "gen_ai.input.messages": [ + { + "role": "user", + "parts": [ + { + "type": "text", + "content": "Weather in Zürich? & 天気" + } + ] + }, + { + "role": "assistant", + "parts": [ + { + "type": "tool_call", + "id": "call_1", + "name": "get_weather", + "arguments": { + "city": "Zürich", + "days": 2, + "units": null + } + } + ] + }, + { + "role": "tool", + "parts": [ + { + "type": "tool_call_response", + "id": "call_1", + "response": { + "temperature": 21.5, + "sunny": true + } + } + ] + } + ] + }, + "expected": { + "gen_ai.input.messages": "[{\"role\":\"user\",\"parts\":[{\"type\":\"text\",\"content\":\"Weather in Zürich? & 天気\"}]},{\"role\":\"assistant\",\"parts\":[{\"type\":\"tool_call\",\"id\":\"call_1\",\"name\":\"get_weather\",\"arguments\":{\"city\":\"Zürich\",\"days\":2,\"units\":null}}]},{\"role\":\"tool\",\"parts\":[{\"type\":\"tool_call_response\",\"id\":\"call_1\",\"response\":{\"temperature\":21.5,\"sunny\":true}}]}]" + } + }, + { + "name": "input_messages_as_their_json_string", + "attributes": { + "gen_ai.input.messages": "[{\"role\":\"user\",\"parts\":[{\"type\":\"text\",\"content\":\"Weather in Zürich? & 天気\"}]},{\"role\":\"assistant\",\"parts\":[{\"type\":\"tool_call\",\"id\":\"call_1\",\"name\":\"get_weather\",\"arguments\":{\"city\":\"Zürich\",\"days\":2,\"units\":null}}]},{\"role\":\"tool\",\"parts\":[{\"type\":\"tool_call_response\",\"id\":\"call_1\",\"response\":{\"temperature\":21.5,\"sunny\":true}}]}]" + }, + "expected": { + "gen_ai.input.messages": "[{\"role\":\"user\",\"parts\":[{\"type\":\"text\",\"content\":\"Weather in Zürich? & 天気\"}]},{\"role\":\"assistant\",\"parts\":[{\"type\":\"tool_call\",\"id\":\"call_1\",\"name\":\"get_weather\",\"arguments\":{\"city\":\"Zürich\",\"days\":2,\"units\":null}}]},{\"role\":\"tool\",\"parts\":[{\"type\":\"tool_call_response\",\"id\":\"call_1\",\"response\":{\"temperature\":21.5,\"sunny\":true}}]}]" + } + }, + { + "name": "output_messages_blob_with_byte_content", + "attributes": { + "gen_ai.output.messages": [ + { + "role": "assistant", + "parts": [ + { + "type": "text", + "content": "Here it is" + }, + { + "type": "blob", + "modality": "image", + "mime_type": "image/png", + "content": { + "$bytes": 8 + } + } + ] + } + ] + }, + "expected": { + "gen_ai.output.messages": "[{\"role\":\"assistant\",\"parts\":[{\"type\":\"text\",\"content\":\"Here it is\"},{\"type\":\"blob\",\"modality\":\"image\",\"mime_type\":\"image/png\",\"byte_size\":8,\"stripped_reason\":\"not_captured\"}]}]" + } + }, + { + "name": "output_messages_blob_with_base64_content", + "attributes": { + "gen_ai.output.messages": [ + { + "role": "assistant", + "parts": [ + { + "type": "text", + "content": "Here it is" + }, + { + "type": "blob", + "modality": "image", + "mime_type": "image/png", + "content": "AAAAAAAAAAA=" + } + ] + } + ] + }, + "expected": { + "gen_ai.output.messages": "[{\"role\":\"assistant\",\"parts\":[{\"type\":\"text\",\"content\":\"Here it is\"},{\"type\":\"blob\",\"modality\":\"image\",\"mime_type\":\"image/png\",\"byte_size\":8,\"stripped_reason\":\"not_captured\"}]}]" + } + }, + { + "name": "system_instructions_structured", + "attributes": { + "gen_ai.system_instructions": [ + { + "type": "text", + "content": "Be brief." + }, + { + "type": "text", + "content": "Answer in French." + } + ] + }, + "expected": { + "gen_ai.system_instructions": "[{\"type\":\"text\",\"content\":\"Be brief.\"},{\"type\":\"text\",\"content\":\"Answer in French.\"}]" + } + }, + { + "name": "system_instructions_array_of_strings", + "attributes": { + "gen_ai.system_instructions": [ + "Be brief.", + "Answer in French." + ] + }, + "expected": { + "gen_ai.system_instructions": "[\"Be brief.\",\"Answer in French.\"]" + } + }, + { + "name": "system_instructions_blob_with_byte_content", + "attributes": { + "gen_ai.system_instructions": [ + { + "type": "blob", + "modality": "image", + "mime_type": "image/png", + "content": { + "$bytes": 8 + } + } + ] + }, + "expected": { + "gen_ai.system_instructions": "[{\"type\":\"blob\",\"modality\":\"image\",\"mime_type\":\"image/png\",\"byte_size\":8,\"stripped_reason\":\"not_captured\"}]" + } + }, + { + "name": "tool_definitions_structured_non_finite_number", + "attributes": { + "gen_ai.tool.definitions": [ + { + "type": "function", + "name": "get_weather", + "description": "Weather for a city", + "parameters": { + "type": "object", + "properties": { + "city": { + "type": "string" + }, + "days": { + "type": "integer", + "default": { + "$number": "NaN" + } + } + }, + "required": [ + "city" + ] + } + } + ] + }, + "expected": { + "gen_ai.tool.definitions": "[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Weather for a city\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"},\"days\":{\"type\":\"integer\",\"default\":null}},\"required\":[\"city\"]}}]" + } + }, + { + "name": "byte_object_outside_a_blob_part", + "attributes": { + "gen_ai.input.messages": [ + { + "role": "user", + "parts": [ + { + "type": "custom", + "data": { + "$bytes": 4 + } + } + ] + } + ] + }, + "expected": { + "gen_ai.input.messages": "[{\"role\":\"user\",\"parts\":[{\"type\":\"custom\",\"data\":\"[stripped unknown 4 bytes]\"}]}]" + } + }, + { + "name": "every_content_key_at_once", + "attributes": { + "gen_ai.input.messages": [ + { + "role": "user", + "parts": [ + { + "type": "text", + "content": "Weather in Zürich? & 天気" + } + ] + } + ], + "gen_ai.output.messages": [ + { + "role": "assistant", + "parts": [ + { + "type": "tool_call", + "id": "call_1", + "name": "get_weather", + "arguments": { + "city": "Zürich", + "days": 2, + "units": null + } + } + ] + } + ], + "gen_ai.system_instructions": [ + { + "type": "text", + "content": "Be brief." + } + ], + "gen_ai.tool.definitions": [ + { + "type": "function", + "name": "get_weather", + "description": "Weather for a city", + "parameters": { + "type": "object", + "properties": { + "city": { + "type": "string" + }, + "days": { + "type": "integer", + "default": { + "$number": "NaN" + } + } + }, + "required": [ + "city" + ] + } + } + ] + }, + "expected": { + "gen_ai.input.messages": "[{\"role\":\"user\",\"parts\":[{\"type\":\"text\",\"content\":\"Weather in Zürich? & 天気\"}]}]", + "gen_ai.output.messages": "[{\"role\":\"assistant\",\"parts\":[{\"type\":\"tool_call\",\"id\":\"call_1\",\"name\":\"get_weather\",\"arguments\":{\"city\":\"Zürich\",\"days\":2,\"units\":null}}]}]", + "gen_ai.system_instructions": "[{\"type\":\"text\",\"content\":\"Be brief.\"}]", + "gen_ai.tool.definitions": "[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Weather for a city\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"},\"days\":{\"type\":\"integer\",\"default\":null}},\"required\":[\"city\"]}}]" + } + }, + { + "name": "lone_byte_object", + "attributes": { + "gen_ai.input.messages": { + "$bytes": 4 + } + }, + "expected": { + "gen_ai.input.messages": "[stripped unknown 4 bytes]" + } + }, + { + "name": "tool_definitions_non_integral_floats", + "attributes": { + "gen_ai.tool.definitions": [ + { + "type": "function", + "name": "set_thermostat", + "description": "Set a target temperature", + "parameters": { + "type": "object", + "properties": { + "celsius": { + "type": "number", + "minimum": -12.5, + "maximum": 32.75, + "default": 21.5 + }, + "step": { + "type": "number", + "default": 0.25 + } + }, + "required": [ + "celsius" + ] + } + } + ] + }, + "expected": { + "gen_ai.tool.definitions": "[{\"type\":\"function\",\"name\":\"set_thermostat\",\"description\":\"Set a target temperature\",\"parameters\":{\"type\":\"object\",\"properties\":{\"celsius\":{\"type\":\"number\",\"minimum\":-12.5,\"maximum\":32.75,\"default\":21.5},\"step\":{\"type\":\"number\",\"default\":0.25}},\"required\":[\"celsius\"]}}]" + } + }, + { + "name": "input_messages_uri_part_with_data_url", + "attributes": { + "gen_ai.input.messages": [ + { + "role": "user", + "parts": [ + { + "type": "text", + "content": "What is in this image?" + }, + { + "type": "uri", + "modality": "image", + "mime_type": "image/png", + "uri": "data:image/png;base64,AAAAAAAAAAA=" + } + ] + } + ] + }, + "expected": { + "gen_ai.input.messages": "[{\"role\":\"user\",\"parts\":[{\"type\":\"text\",\"content\":\"What is in this image?\"},{\"type\":\"blob\",\"modality\":\"image\",\"mime_type\":\"image/png\",\"byte_size\":8,\"stripped_reason\":\"not_captured\"}]}]" + } + }, + { + "name": "blob_nested_outside_parts", + "attributes": { + "gen_ai.input.messages": [ + { + "role": "tool", + "parts": [ + { + "type": "tool_call_response", + "id": "call_1", + "response": { + "screenshot": { + "type": "blob", + "modality": "image", + "mime_type": "image/png", + "content": { + "$bytes": 8 + } + } + } + } + ] + } + ] + }, + "expected": { + "gen_ai.input.messages": "[{\"role\":\"tool\",\"parts\":[{\"type\":\"tool_call_response\",\"id\":\"call_1\",\"response\":{\"screenshot\":{\"type\":\"blob\",\"modality\":\"image\",\"mime_type\":\"image/png\",\"content\":\"[stripped image/png 8 bytes]\"}}}]}]" + } + }, + { + "name": "string_value_kept", + "attributes": { + "gen_ai.input.messages": "plain text, not JSON" + }, + "expected": { + "gen_ai.input.messages": "plain text, not JSON" + } + }, + { + "name": "scalar_value_kept", + "attributes": { + "gen_ai.input.messages": 3 + }, + "expected": { + "gen_ai.input.messages": 3 + } + } + ] +} diff --git a/tests/fixtures/semconv/sdk_cases/tool_definitions.json b/tests/fixtures/semconv/sdk_cases/tool_definitions.json new file mode 100644 index 0000000..2fa34c1 --- /dev/null +++ b/tests/fixtures/semconv/sdk_cases/tool_definitions.json @@ -0,0 +1,987 @@ +{ + "about": "gen_ai.tool.definitions in the GenAI conventions' shape, from tools in each provider's own shape: `tools` is the list as the provider request or another instrumentation gave it, `provider` the span's gen_ai.provider.name (null for none), and `expected` the rewritten list's compact JSON, key order included. Each implementation (the Python SDK's semconv_tool_definitions, the TypeScript SDK's semconvToolDefinitions, the sink's semconvToolDefinitions) must write `expected`, and rewriting its own output must write `expected` again: the sink rewrites what an SDK exported, so every output is a fixed point. A name is a non-empty string, as for tool calls: an empty `name` is no name, so no function tool is made with one. An MCP tool (`mcp` or any `.mcp`) loses its `headers` and `authorization`, and so do the `args` of a Vercel AI SDK provider tool written as one. An empty result here is `[]`; a span whose definitions come to an empty list is written without gen_ai.tool.definitions, which each implementation tests on its own. The cases hold no float and no integer-like key, whose text differs by language.", + "cases": [ + { + "name": "openai_chat_function_with_strict", + "provider": "openai", + "tools": [ + { + "type": "function", + "function": { + "name": "get_weather", + "description": "Weather for a city", + "parameters": { + "type": "object", + "properties": { + "city": { + "type": "string" + } + }, + "required": [ + "city" + ] + }, + "strict": true + } + } + ], + "expected": "[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Weather for a city\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"]},\"strict\":true}]" + }, + { + "name": "openai_responses_function", + "provider": "openai", + "tools": [ + { + "type": "function", + "name": "get_weather", + "description": "Weather for a city", + "parameters": { + "type": "object", + "properties": { + "city": { + "type": "string" + } + }, + "required": [ + "city" + ] + }, + "strict": true + } + ], + "expected": "[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Weather for a city\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"]},\"strict\":true}]" + }, + { + "name": "openai_responses_built_ins", + "provider": "openai", + "tools": [ + { + "type": "web_search_preview", + "search_context_size": "low" + }, + { + "type": "file_search", + "vector_store_ids": [ + "vs_1" + ], + "max_num_results": 5 + }, + { + "type": "computer_use_preview", + "display_width": 1024, + "display_height": 768, + "environment": "browser" + } + ], + "expected": "[{\"type\":\"openai.web_search_preview\",\"search_context_size\":\"low\"},{\"type\":\"openai.file_search\",\"vector_store_ids\":[\"vs_1\"],\"max_num_results\":5},{\"type\":\"openai.computer_use_preview\",\"display_width\":1024,\"display_height\":768,\"environment\":\"browser\"}]" + }, + { + "name": "openai_responses_custom_freeform", + "provider": "openai", + "tools": [ + { + "type": "custom", + "name": "code_exec", + "description": "Runs code", + "format": { + "type": "text" + } + } + ], + "expected": "[{\"type\":\"openai.custom\",\"name\":\"code_exec\",\"description\":\"Runs code\",\"format\":{\"type\":\"text\"}}]" + }, + { + "name": "openai_responses_mcp_headers_dropped", + "provider": "openai", + "tools": [ + { + "type": "mcp", + "server_label": "docs", + "server_url": "https://mcp.example.com", + "headers": { + "Authorization": "Bearer secret" + }, + "require_approval": "never" + } + ], + "expected": "[{\"type\":\"openai.mcp\",\"server_label\":\"docs\",\"server_url\":\"https://mcp.example.com\",\"require_approval\":\"never\"}]" + }, + { + "name": "mcp_headers_dropped_once_namespaced", + "provider": null, + "tools": [ + { + "type": "openai.mcp", + "server_label": "docs", + "headers": { + "X-Api-Key": "secret" + } + }, + { + "type": "mcp", + "headers": {} + } + ], + "expected": "[{\"type\":\"openai.mcp\",\"server_label\":\"docs\"},{\"type\":\"mcp\"}]" + }, + { + "name": "openai_legacy_functions", + "provider": "openai", + "tools": [ + { + "name": "get_weather", + "description": "Weather for a city", + "parameters": { + "type": "object", + "properties": { + "city": { + "type": "string" + } + }, + "required": [ + "city" + ] + } + } + ], + "expected": "[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Weather for a city\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"]}}]" + }, + { + "name": "anthropic_custom_with_cache_control", + "provider": "anthropic", + "tools": [ + { + "name": "search_kb", + "description": "Search", + "input_schema": { + "type": "object", + "properties": { + "q": { + "type": "string" + } + } + }, + "cache_control": { + "type": "ephemeral" + } + } + ], + "expected": "[{\"type\":\"function\",\"name\":\"search_kb\",\"description\":\"Search\",\"parameters\":{\"type\":\"object\",\"properties\":{\"q\":{\"type\":\"string\"}}},\"cache_control\":{\"type\":\"ephemeral\"}}]" + }, + { + "name": "anthropic_explicit_custom_type", + "provider": "anthropic", + "tools": [ + { + "type": "custom", + "name": "search_kb", + "input_schema": { + "type": "object", + "properties": { + "q": { + "type": "string" + } + } + } + } + ], + "expected": "[{\"type\":\"function\",\"name\":\"search_kb\",\"parameters\":{\"type\":\"object\",\"properties\":{\"q\":{\"type\":\"string\"}}}}]" + }, + { + "name": "anthropic_server_and_client_tools", + "provider": "anthropic", + "tools": [ + { + "type": "web_search_20250305", + "name": "web_search", + "max_uses": 5 + }, + { + "type": "text_editor_20250124", + "name": "str_replace_editor" + }, + { + "type": "bash_20250124", + "name": "bash" + }, + { + "type": "computer_20250124", + "name": "computer", + "display_width_px": 1024, + "display_height_px": 768 + } + ], + "expected": "[{\"type\":\"anthropic.web_search_20250305\",\"name\":\"web_search\",\"max_uses\":5},{\"type\":\"anthropic.text_editor_20250124\",\"name\":\"str_replace_editor\"},{\"type\":\"anthropic.bash_20250124\",\"name\":\"bash\"},{\"type\":\"anthropic.computer_20250124\",\"name\":\"computer\",\"display_width_px\":1024,\"display_height_px\":768}]" + }, + { + "name": "gemini_snake_declarations_with_a_built_in", + "provider": "gcp.gemini", + "tools": [ + { + "function_declarations": [ + { + "name": "get_weather", + "description": "Weather", + "parameters": { + "type": "object", + "properties": { + "city": { + "type": "string" + } + }, + "required": [ + "city" + ] + } + }, + { + "name": "get_time" + } + ], + "google_search": {} + }, + { + "code_execution": {} + } + ], + "expected": "[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Weather\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"]}},{\"type\":\"function\",\"name\":\"get_time\"},{\"google_search\":{}},{\"code_execution\":{}}]" + }, + { + "name": "gemini_camel_parameters_json_schema", + "provider": "gcp.gemini", + "tools": [ + { + "functionDeclarations": [ + { + "name": "get_weather", + "parametersJsonSchema": { + "type": "object", + "properties": { + "city": { + "type": "string" + } + }, + "required": [ + "city" + ] + } + } + ] + } + ], + "expected": "[{\"type\":\"function\",\"name\":\"get_weather\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"]}}]" + }, + { + "name": "gemini_snake_parameters_json_schema", + "provider": "gcp.gemini", + "tools": [ + { + "function_declarations": [ + { + "name": "get_weather", + "parameters_json_schema": { + "type": "object", + "properties": { + "city": { + "type": "string" + } + }, + "required": [ + "city" + ] + } + } + ] + } + ], + "expected": "[{\"type\":\"function\",\"name\":\"get_weather\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"]}}]" + }, + { + "name": "gemini_both_declaration_spellings", + "provider": "gcp.gemini", + "tools": [ + { + "function_declarations": [ + { + "name": "a" + } + ], + "functionDeclarations": [ + { + "name": "b" + } + ] + } + ], + "expected": "[{\"type\":\"function\",\"name\":\"a\"},{\"type\":\"function\",\"name\":\"b\"}]" + }, + { + "name": "gemini_declarations_spelling_not_a_list_stays", + "provider": "gcp.gemini", + "tools": [ + { + "function_declarations": [ + { + "name": "a" + } + ], + "functionDeclarations": "odd" + } + ], + "expected": "[{\"type\":\"function\",\"name\":\"a\"},{\"functionDeclarations\":\"odd\"}]" + }, + { + "name": "gemini_declaration_with_input_schema", + "provider": "gcp.gemini", + "tools": [ + { + "function_declarations": [ + { + "name": "a", + "input_schema": { + "type": "object", + "properties": { + "q": { + "type": "string" + } + } + } + }, + { + "name": "b", + "inputSchema": { + "type": "object", + "properties": { + "q": { + "type": "string" + } + } + } + } + ] + } + ], + "expected": "[{\"type\":\"function\",\"name\":\"a\",\"parameters\":{\"type\":\"object\",\"properties\":{\"q\":{\"type\":\"string\"}}}},{\"type\":\"function\",\"name\":\"b\",\"parameters\":{\"type\":\"object\",\"properties\":{\"q\":{\"type\":\"string\"}}}}]" + }, + { + "name": "gemini_nameless_typed_declaration", + "provider": "gcp.gemini", + "tools": [ + { + "function_declarations": [ + { + "type": "web_search" + } + ] + } + ], + "expected": "[{\"type\":\"gcp.gemini.web_search\"}]" + }, + { + "name": "gemini_nameless_declarations_kept", + "provider": "gcp.gemini", + "tools": [ + { + "functionDeclarations": [ + { + "description": "no name" + }, + "odd", + { + "name": 3 + } + ] + } + ], + "expected": "[{\"description\":\"no name\"},\"odd\",{\"name\":3}]" + }, + { + "name": "gemini_rest_with_a_name", + "provider": "gcp.gemini", + "tools": [ + { + "function_declarations": [ + { + "name": "a" + } + ], + "name": "x" + } + ], + "expected": "[{\"type\":\"function\",\"name\":\"a\"},{\"type\":\"function\",\"name\":\"x\"}]" + }, + { + "name": "gemini_declarations_not_a_list", + "provider": "gcp.gemini", + "tools": [ + { + "function_declarations": { + "name": "f" + } + } + ], + "expected": "[{\"function_declarations\":{\"name\":\"f\"}}]" + }, + { + "name": "gemini_no_declarations", + "provider": "gcp.gemini", + "tools": [ + { + "function_declarations": [] + } + ], + "expected": "[]" + }, + { + "name": "gemini_model_dump_null_parameters", + "provider": "gcp.gemini", + "tools": [ + { + "function_declarations": [ + { + "name": "f", + "description": "d", + "parameters": null, + "parameters_json_schema": { + "type": "object", + "properties": { + "city": { + "type": "string" + } + }, + "required": [ + "city" + ] + } + } + ] + } + ], + "expected": "[{\"type\":\"function\",\"name\":\"f\",\"description\":\"d\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"]}}]" + }, + { + "name": "null_parameters_gives_way_to_input_schema", + "provider": "anthropic", + "tools": [ + { + "name": "g", + "parameters": null, + "input_schema": { + "type": "object", + "properties": { + "q": { + "type": "string" + } + } + } + } + ], + "expected": "[{\"type\":\"function\",\"name\":\"g\",\"parameters\":{\"type\":\"object\",\"properties\":{\"q\":{\"type\":\"string\"}}}}]" + }, + { + "name": "null_parameters_alone_kept", + "provider": "openai", + "tools": [ + { + "type": "function", + "name": "f", + "parameters": null + } + ], + "expected": "[{\"type\":\"function\",\"name\":\"f\",\"parameters\":null}]" + }, + { + "name": "bedrock_tool_spec", + "provider": "aws.bedrock", + "tools": [ + { + "toolSpec": { + "name": "get_weather", + "description": "Weather for a city", + "inputSchema": { + "json": { + "type": "object", + "properties": { + "city": { + "type": "string" + } + }, + "required": [ + "city" + ] + } + } + } + } + ], + "expected": "[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Weather for a city\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"]}}]" + }, + { + "name": "bedrock_cache_point_system_tool_and_nameless_spec", + "provider": "aws.bedrock", + "tools": [ + { + "cachePoint": { + "type": "default" + } + }, + { + "systemTool": { + "name": "nova_grounding" + } + }, + { + "toolSpec": { + "inputSchema": { + "json": { + "type": "object", + "properties": { + "q": { + "type": "string" + } + } + } + } + } + } + ], + "expected": "[{\"cachePoint\":{\"type\":\"default\"}},{\"systemTool\":{\"name\":\"nova_grounding\"}},{\"toolSpec\":{\"inputSchema\":{\"json\":{\"type\":\"object\",\"properties\":{\"q\":{\"type\":\"string\"}}}}}}]" + }, + { + "name": "bedrock_input_schema_without_json", + "provider": "aws.bedrock", + "tools": [ + { + "toolSpec": { + "name": "f", + "inputSchema": { + "type": "object", + "properties": { + "q": { + "type": "string" + } + } + } + } + } + ], + "expected": "[{\"type\":\"function\",\"name\":\"f\",\"parameters\":{\"type\":\"object\",\"properties\":{\"q\":{\"type\":\"string\"}}}}]" + }, + { + "name": "vercel_function_tools", + "provider": "openai", + "tools": [ + { + "type": "function", + "name": "get_weather", + "description": "Weather", + "inputSchema": { + "type": "object", + "properties": { + "city": { + "type": "string" + } + }, + "required": [ + "city" + ] + } + }, + { + "type": "function", + "name": "lookup", + "parameters": { + "type": "object", + "properties": { + "q": { + "type": "string" + } + } + } + } + ], + "expected": "[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Weather\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"]}},{\"type\":\"function\",\"name\":\"lookup\",\"parameters\":{\"type\":\"object\",\"properties\":{\"q\":{\"type\":\"string\"}}}}]" + }, + { + "name": "vercel_provider_tools", + "provider": "anthropic", + "tools": [ + { + "type": "provider-defined", + "id": "anthropic.web_search_20250305", + "name": "web_search", + "args": {} + }, + { + "type": "provider", + "id": "openai.web_search", + "name": "web_search", + "args": {} + }, + { + "type": "provider-defined", + "id": "nodot", + "name": "x" + } + ], + "expected": "[{\"type\":\"anthropic.web_search_20250305\",\"id\":\"anthropic.web_search_20250305\",\"name\":\"web_search\",\"args\":{}},{\"type\":\"openai.web_search\",\"id\":\"openai.web_search\",\"name\":\"web_search\",\"args\":{}},{\"type\":\"provider-defined\",\"id\":\"nodot\",\"name\":\"x\"}]" + }, + { + "name": "mcp_server_tool", + "provider": null, + "tools": [ + { + "name": "read_file", + "description": "Read a file", + "inputSchema": { + "type": "object", + "properties": { + "q": { + "type": "string" + } + } + }, + "outputSchema": { + "type": "object" + }, + "annotations": { + "readOnlyHint": true + } + } + ], + "expected": "[{\"type\":\"function\",\"name\":\"read_file\",\"description\":\"Read a file\",\"parameters\":{\"type\":\"object\",\"properties\":{\"q\":{\"type\":\"string\"}}},\"outputSchema\":{\"type\":\"object\"},\"annotations\":{\"readOnlyHint\":true}}]" + }, + { + "name": "nested_function_not_lifted_over_a_name", + "provider": "openai", + "tools": [ + { + "name": "x", + "function": { + "name": "y" + } + }, + { + "type": "function", + "name": "x", + "function": { + "name": "y" + } + } + ], + "expected": "[{\"type\":\"function\",\"name\":\"x\",\"function\":{\"name\":\"y\"}},{\"type\":\"function\",\"name\":\"x\",\"function\":{\"name\":\"y\"}}]" + }, + { + "name": "both_schema_spellings_first_wins", + "provider": null, + "tools": [ + { + "name": "x", + "input_schema": { + "type": "object", + "properties": { + "q": { + "type": "string" + } + } + }, + "inputSchema": { + "type": "object", + "properties": { + "city": { + "type": "string" + } + }, + "required": [ + "city" + ] + } + } + ], + "expected": "[{\"type\":\"function\",\"name\":\"x\",\"parameters\":{\"type\":\"object\",\"properties\":{\"q\":{\"type\":\"string\"}}},\"inputSchema\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"]}}]" + }, + { + "name": "built_in_without_a_provider", + "provider": null, + "tools": [ + { + "type": "web_search_20250305", + "name": "web_search" + } + ], + "expected": "[{\"type\":\"web_search_20250305\",\"name\":\"web_search\"}]" + }, + { + "name": "already_namespaced_type", + "provider": "azure.ai.openai", + "tools": [ + { + "type": "anthropic.web_search_20250305", + "name": "web_search" + } + ], + "expected": "[{\"type\":\"anthropic.web_search_20250305\",\"name\":\"web_search\"}]" + }, + { + "name": "empty_type_and_name", + "provider": "openai", + "tools": [ + { + "type": "", + "size": 1 + }, + { + "name": "" + } + ], + "expected": "[{\"type\":\"\",\"size\":1},{\"name\":\"\"}]" + }, + { + "name": "openai_responses_mcp_authorization_dropped", + "provider": "openai", + "tools": [ + { + "type": "mcp", + "server_label": "gmail", + "connector_id": "connector_gmail", + "authorization": "ya29.token", + "require_approval": "never" + }, + { + "type": "mcp", + "server_label": "docs", + "server_url": "https://mcp.example.com", + "authorization": "token", + "headers": { + "Authorization": "Bearer secret" + } + } + ], + "expected": "[{\"type\":\"openai.mcp\",\"server_label\":\"gmail\",\"connector_id\":\"connector_gmail\",\"require_approval\":\"never\"},{\"type\":\"openai.mcp\",\"server_label\":\"docs\",\"server_url\":\"https://mcp.example.com\"}]" + }, + { + "name": "mcp_credentials_dropped_for_any_provider_prefix", + "provider": null, + "tools": [ + { + "type": "azure.mcp", + "server_label": "docs", + "authorization": "token", + "headers": { + "X-Api-Key": "secret" + } + }, + { + "type": "provider", + "id": "openai.mcp", + "name": "mcp", + "authorization": "token" + }, + { + "type": "web_search", + "authorization": "kept" + } + ], + "expected": "[{\"type\":\"azure.mcp\",\"server_label\":\"docs\"},{\"type\":\"openai.mcp\",\"id\":\"openai.mcp\",\"name\":\"mcp\"},{\"type\":\"web_search\",\"authorization\":\"kept\"}]" + }, + { + "name": "vercel_mcp_provider_tool_args_credentials_dropped", + "provider": "openai", + "tools": [ + { + "type": "provider", + "id": "openai.mcp", + "name": "mcp", + "args": { + "serverLabel": "docs", + "serverUrl": "https://mcp.example.com", + "authorization": "token", + "headers": { + "Authorization": "Bearer secret" + }, + "requireApproval": "never" + } + }, + { + "type": "provider-defined", + "id": "openai.mcp", + "name": "mcp", + "args": { + "serverLabel": "gmail", + "connectorId": "connector_gmail", + "authorization": "ya29.token" + } + }, + { + "type": "provider", + "id": "openai.web_search", + "name": "web_search", + "args": { + "authorization": "kept" + } + } + ], + "expected": "[{\"type\":\"openai.mcp\",\"id\":\"openai.mcp\",\"name\":\"mcp\",\"args\":{\"serverLabel\":\"docs\",\"serverUrl\":\"https://mcp.example.com\",\"requireApproval\":\"never\"}},{\"type\":\"openai.mcp\",\"id\":\"openai.mcp\",\"name\":\"mcp\",\"args\":{\"serverLabel\":\"gmail\",\"connectorId\":\"connector_gmail\"}},{\"type\":\"openai.web_search\",\"id\":\"openai.web_search\",\"name\":\"web_search\",\"args\":{\"authorization\":\"kept\"}}]" + }, + { + "name": "openai_chat_custom_lifted", + "provider": "openai", + "tools": [ + { + "type": "custom", + "custom": { + "name": "code_exec", + "description": "Runs code", + "format": { + "type": "text" + } + } + }, + { + "type": "custom", + "custom": { + "description": "No name" + } + } + ], + "expected": "[{\"type\":\"openai.custom\",\"name\":\"code_exec\",\"description\":\"Runs code\",\"format\":{\"type\":\"text\"}},{\"type\":\"openai.custom\",\"description\":\"No name\"}]" + }, + { + "name": "custom_nested_not_lifted_over_a_name", + "provider": "openai", + "tools": [ + { + "type": "custom", + "name": "x", + "custom": { + "name": "y" + } + } + ], + "expected": "[{\"type\":\"openai.custom\",\"name\":\"x\",\"custom\":{\"name\":\"y\"}}]" + }, + { + "name": "custom_lifted_with_input_schema_is_a_function", + "provider": null, + "tools": [ + { + "type": "custom", + "custom": { + "name": "search_kb", + "input_schema": { + "type": "object", + "properties": { + "q": { + "type": "string" + } + } + } + } + } + ], + "expected": "[{\"type\":\"function\",\"name\":\"search_kb\",\"parameters\":{\"type\":\"object\",\"properties\":{\"q\":{\"type\":\"string\"}}}}]" + }, + { + "name": "empty_name_is_no_name", + "provider": "anthropic", + "tools": [ + { + "name": "", + "input_schema": { + "type": "object", + "properties": { + "q": { + "type": "string" + } + } + } + }, + { + "type": "custom", + "name": "", + "input_schema": { + "type": "object", + "properties": { + "q": { + "type": "string" + } + } + } + }, + { + "toolSpec": { + "name": "", + "inputSchema": { + "json": { + "type": "object", + "properties": { + "q": { + "type": "string" + } + } + } + } + } + }, + { + "function_declarations": [ + { + "name": "", + "description": "d" + } + ] + }, + { + "type": "function", + "name": "", + "function": { + "name": "f" + } + } + ], + "expected": "[{\"name\":\"\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"q\":{\"type\":\"string\"}}}},{\"type\":\"anthropic.custom\",\"name\":\"\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"q\":{\"type\":\"string\"}}}},{\"toolSpec\":{\"name\":\"\",\"inputSchema\":{\"json\":{\"type\":\"object\",\"properties\":{\"q\":{\"type\":\"string\"}}}}}},{\"name\":\"\",\"description\":\"d\"},{\"type\":\"function\",\"name\":\"f\"}]" + }, + { + "name": "unreadable_entries_kept", + "provider": "openai", + "tools": [ + "plain", + 3, + null, + [ + "x" + ], + { + "description": "no name or type" + }, + { + "type": 7, + "name": "n" + }, + { + "name": false + } + ], + "expected": "[\"plain\",3,null,[\"x\"],{\"description\":\"no name or type\"},{\"type\":7,\"name\":\"n\"},{\"name\":false}]" + }, + { + "name": "proto_key_kept_as_a_member", + "provider": "openai", + "tools": [ + { + "name": "p", + "__proto__": { + "x": 1 + } + } + ], + "expected": "[{\"type\":\"function\",\"name\":\"p\",\"__proto__\":{\"x\":1}}]" + }, + { + "name": "empty_list", + "provider": "openai", + "tools": [], + "expected": "[]" + } + ] +} diff --git a/tests/test_byte_objects.py b/tests/test_byte_objects.py index a76a75f..972ba0b 100644 --- a/tests/test_byte_objects.py +++ b/tests/test_byte_objects.py @@ -519,3 +519,95 @@ def test_model_parameters_holding_byte_objects(exported_spans: InMemorySpanExpor assert written assert not any(_leaks(str(v)) for v in written.values()) assert all(MARKER in str(v) for v in written.values()), written + + +def test_a_blob_of_bytes_in_messages_is_stored_as_its_base64_twin() -> None: + # The SDK's serializer writes the bytes as the marker and strips the + # base64 to a replacement, and the exporter rebuilds each blob with the + # size its replacement names: both forms keep byte_size and store alike. + def messages(content: Any) -> str: + blob = {"type": "blob", "modality": "image", "mime_type": "image/png", "content": content} + return serialize([{"role": "user", "parts": [blob]}]) + + inner = InMemorySpanExporter() + client = init(span_exporter=inner, set_global=False) + for name, content in (("bytes", PNG), ("base64", "iVBORw0KGgo=")): + span = client.get_tracer().start_span(name) + span.set_attribute("gen_ai.input.messages", messages(content)) + span.end() + client.flush() + stored = { + s.name: (s.attributes or {})["gen_ai.input.messages"] for s in inner.get_finished_spans() + } + assert stored["bytes"] == stored["base64"] + [part] = json.loads(str(stored["bytes"]))[0]["parts"] + assert part == { + "type": "blob", + "modality": "image", + "mime_type": "image/png", + "byte_size": 8, + "stripped_reason": "not_captured", + } + + +#: A complete replacement whose size has more digits than Python's int() +#: converts from a string (4300, leading zeros included). +_LONG_REPLACEMENT = "[stripped unknown " + "9" * 4301 + " bytes]" + + +@pytest.mark.parametrize( + ("key", "value", "stored"), + [ + pytest.param( + "gen_ai.input.messages", + json.dumps( + [{"role": "user", "parts": [{"type": "blob", "content": _LONG_REPLACEMENT}]}] + ), + # Rebuilt with no byte_size: the size is past 2^53 - 1. + '"parts": [{"type":"blob","modality":"document","stripped_reason":"not_captured"}]', + id="blob-content", + ), + pytest.param( + "output", + json.dumps({"mime_type": _LONG_REPLACEMENT, "data": "QUJD"}), + _LONG_REPLACEMENT, + id="mime-type", + ), + pytest.param( + "output", + json.dumps({"type": "image", "source_type": "base64", "data": _LONG_REPLACEMENT}), + _LONG_REPLACEMENT, + id="data", + ), + ], +) +def test_a_replacement_with_a_long_digit_run_is_exported(key: str, value: str, stored: str) -> None: + # int() refuses such a run, and the strip asks whether each of these + # strings is a replacement: the export must still deliver the span. + inner = InMemorySpanExporter() + client = init(span_exporter=inner, set_global=False) + span = client.get_tracer().start_span("long") + span.set_attribute(key, value) + span.end() + client.flush() + [exported] = inner.get_finished_spans() + assert stored in str((exported.attributes or {})[key]) + + +def test_a_replacement_with_thousands_of_leading_zeros_names_its_size() -> None: + content = "[stripped unknown " + "0" * 5000 + "8 bytes]" + value = json.dumps([{"role": "user", "parts": [{"type": "blob", "content": content}]}]) + inner = InMemorySpanExporter() + client = init(span_exporter=inner, set_global=False) + span = client.get_tracer().start_span("zeros") + span.set_attribute("gen_ai.input.messages", value) + span.end() + client.flush() + [exported] = inner.get_finished_spans() + [part] = json.loads(str((exported.attributes or {})["gen_ai.input.messages"]))[0]["parts"] + assert part == { + "type": "blob", + "modality": "document", + "byte_size": 8, + "stripped_reason": "not_captured", + } diff --git a/tests/test_config.py b/tests/test_config.py index 36664ac..76f18b1 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -19,11 +19,12 @@ "PARTIAL_SPANS_DELAY", ] ENV_VARS = [f"RIUS_{suffix}" for suffix in _SUFFIXES] +OTEL_CAPTURE_CONTENT = "OTEL_INSTRUMENTATION_GENAI_CAPTURE_CONTENT" @pytest.fixture(autouse=True) def _clear_env(monkeypatch: pytest.MonkeyPatch) -> None: - for var in ENV_VARS: + for var in [*ENV_VARS, OTEL_CAPTURE_CONTENT]: monkeypatch.delenv(var, raising=False) @@ -223,6 +224,101 @@ def test_the_agent_definition_version_is_not_the_service_version( assert resolve_config(main_agent_version="7").service_version is None +# --- the conventions' OTEL_INSTRUMENTATION_GENAI_CAPTURE_CONTENT --- + + +@pytest.mark.parametrize( + ("raw", "expected"), + [ + ("NO_CONTENT", False), + # Rius records content on spans only, so a request for events alone + # asks for no content on the spans Rius keeps. + ("EVENT_ONLY", False), + ("SPAN_ONLY", True), + ("SPAN_AND_EVENT", True), + # Case-insensitive, as the conventions define it. + ("no_content", False), + (" span_only ", True), + ], +) +def test_capture_content_follows_the_otel_setting_when_rius_is_unset( + monkeypatch: pytest.MonkeyPatch, caplog: pytest.LogCaptureFixture, raw: str, expected: bool +) -> None: + monkeypatch.setenv(OTEL_CAPTURE_CONTENT, raw) + with caplog.at_level(logging.WARNING, logger="rius.config"): + assert resolve_config().capture_content is expected + assert not caplog.records + + +@pytest.mark.parametrize("raw", ["maybe", "true", "false", "SPAN", "NO-CONTENT"]) +def test_an_unrecognised_otel_capture_setting_keeps_capture_on_and_warns( + monkeypatch: pytest.MonkeyPatch, caplog: pytest.LogCaptureFixture, raw: str +) -> None: + # Deliberately not the conventions' NO_CONTENT: capture is on by default in + # Rius, and the warning names the value and what to set instead. + monkeypatch.setenv(OTEL_CAPTURE_CONTENT, raw) + with caplog.at_level(logging.WARNING, logger="rius.config"): + assert resolve_config().capture_content is True + (record,) = caplog.records + message = record.getMessage() + assert f"{OTEL_CAPTURE_CONTENT}={raw!r} is not recognised" in message + assert "content capture stays on" in message + for valid in ("NO_CONTENT", "SPAN_ONLY", "EVENT_ONLY", "SPAN_AND_EVENT"): + assert valid in message + + +@pytest.mark.parametrize("raw", ["", " "]) +def test_an_empty_otel_capture_setting_is_unset( + monkeypatch: pytest.MonkeyPatch, caplog: pytest.LogCaptureFixture, raw: str +) -> None: + # OpenTelemetry reads an empty variable as unset; templated deployments + # render an omitted value as one. + monkeypatch.setenv(OTEL_CAPTURE_CONTENT, raw) + with caplog.at_level(logging.WARNING, logger="rius.config"): + assert resolve_config().capture_content is True + assert not caplog.records + + +@pytest.mark.parametrize("raw", ["", " "]) +@pytest.mark.parametrize( + ("otel", "expected"), [("NO_CONTENT", False), ("SPAN_ONLY", True), (None, True)] +) +def test_an_empty_rius_capture_content_is_unset_so_the_otel_setting_applies( + monkeypatch: pytest.MonkeyPatch, + caplog: pytest.LogCaptureFixture, + raw: str, + otel: str | None, + expected: bool, +) -> None: + # Still a warning, as for the other blank RIUS_* flags, but it does not + # shadow the OpenTelemetry setting. + monkeypatch.setenv("RIUS_CAPTURE_CONTENT", raw) + if otel is not None: + monkeypatch.setenv(OTEL_CAPTURE_CONTENT, otel) + with caplog.at_level(logging.WARNING, logger="rius.config"): + assert resolve_config().capture_content is expected + (record,) = caplog.records + assert "RIUS_CAPTURE_CONTENT is empty; treated as unset" in record.getMessage() + + +@pytest.mark.parametrize(("rius", "expected"), [("true", True), ("false", False)]) +def test_rius_capture_content_wins_over_the_otel_setting( + monkeypatch: pytest.MonkeyPatch, rius: str, expected: bool +) -> None: + monkeypatch.setenv("RIUS_CAPTURE_CONTENT", rius) + monkeypatch.setenv(OTEL_CAPTURE_CONTENT, "SPAN_ONLY" if not expected else "NO_CONTENT") + assert resolve_config().capture_content is expected + + +@pytest.mark.parametrize("argument", [True, False]) +def test_the_capture_content_argument_wins_over_both_variables( + monkeypatch: pytest.MonkeyPatch, argument: bool +) -> None: + monkeypatch.setenv("RIUS_CAPTURE_CONTENT", str(not argument).lower()) + monkeypatch.setenv(OTEL_CAPTURE_CONTENT, "SPAN_ONLY" if not argument else "NO_CONTENT") + assert resolve_config(capture_content=argument).capture_content is argument + + # --- an unrecognised boolean keeps the default, with a warning --- diff --git a/tests/test_crash_safety.py b/tests/test_crash_safety.py index b38c95c..b811974 100644 --- a/tests/test_crash_safety.py +++ b/tests/test_crash_safety.py @@ -313,13 +313,12 @@ def test_malformed_tool_calls_do_not_raise_out_of_a_generation( assert [s.name for s in exported_spans.get_finished_spans()] == ["g"] -def test_a_tool_call_whose_function_is_not_a_mapping_keeps_its_id() -> None: +def test_a_tool_call_whose_function_is_not_a_mapping_is_kept_as_text() -> None: + # It has no name, and the conventions require one on a tool_call part. (message,) = normalize_messages( [{"role": "assistant", "tool_calls": [{"id": "c1", "function": "x"}]}], "user" ) - (part,) = message["parts"] - assert part["type"] == "tool_call" - assert part["id"] == "c1" + assert message["parts"] == [{"type": "text", "content": '{"id":"c1"}'}] # --- observe() on a callable without __qualname__ ----------------------------------- diff --git a/tests/test_generation.py b/tests/test_generation.py index 3ec973f..1fc2e4a 100644 --- a/tests/test_generation.py +++ b/tests/test_generation.py @@ -390,6 +390,51 @@ def test_openai_tool_call_message_converted_to_tool_call_part( ] +@pytest.mark.parametrize( + ("function", "content"), + [ + ({"arguments": "{}"}, '{"id":"call_1","arguments":"{}"}'), + ({"name": None, "arguments": "{}"}, '{"id":"call_1","arguments":"{}"}'), + ({"name": 3}, '{"id":"call_1"}'), + ({"name": "", "arguments": '{"q":1}'}, '{"id":"call_1","arguments":"{\\"q\\":1}"}'), + (None, '{"id":"call_1"}'), + ], +) +def test_a_tool_call_without_a_name_is_kept_as_a_text_part( + exported_spans: InMemorySpanExporter, function: Any, content: str +) -> None: + # The conventions require a tool_call part's name, and a part with a known + # type may no longer fall back to the generic part. The call is kept as a + # text part holding its id and arguments, as other content with no part + # type is. + call: dict[str, Any] = {"id": "call_1", "type": "function"} + if function is not None: + call["function"] = function + named = {"id": "call_2", "function": {"name": "lookup", "arguments": "{}"}} + with start_as_current_generation("chat") as gen: + gen.set_output([{"role": "assistant", "content": "hi", "tool_calls": [call, named]}]) + assert _output_messages(exported_spans) == [ + { + "role": "assistant", + "parts": [ + {"type": "text", "content": "hi"}, + {"type": "text", "content": content}, + {"type": "tool_call", "id": "call_2", "name": "lookup", "arguments": "{}"}, + ], + } + ] + + +def test_a_tool_call_without_a_name_or_an_id_keeps_what_it_has( + exported_spans: InMemorySpanExporter, +) -> None: + with start_as_current_generation("chat") as gen: + gen.set_output([{"role": "assistant", "tool_calls": [{}]}]) + assert _output_messages(exported_spans) == [ + {"role": "assistant", "parts": [{"type": "text", "content": "{}"}]} + ] + + def test_tool_response_message_converted_to_tool_call_response_part( exported_spans: InMemorySpanExporter, ) -> None: @@ -554,42 +599,119 @@ def set_attribute(self, key: str, value: Any) -> None: # --- tool definitions --- -def test_cm_tools_kwarg_records_definitions_verbatim( +def test_cm_tools_kwarg_records_openai_tools_in_the_semconv_shape( exported_spans: InMemorySpanExporter, ) -> None: - tools = [ - { - "type": "function", - "function": { - "name": "get_weather", - "parameters": {"type": "object", "properties": {"city": {"type": "string"}}}, - }, - } - ] + parameters = {"type": "object", "properties": {"city": {"type": "string"}}} + tools = [{"type": "function", "function": {"name": "get_weather", "parameters": parameters}}] with start_as_current_generation("chat", tools=tools): pass attrs = exported_spans.get_finished_spans()[0].attributes - assert json.loads(attrs["gen_ai.tool.definitions"]) == tools + assert json.loads(attrs["gen_ai.tool.definitions"]) == [ + {"type": "function", "name": "get_weather", "parameters": parameters} + ] -def test_set_tool_definitions_accepts_anthropic_shape( +def test_set_tool_definitions_records_anthropic_tools_in_the_semconv_shape( exported_spans: InMemorySpanExporter, ) -> None: - # Verbatim on purpose: provider tool formats differ (OpenAI nests under - # "function", Anthropic uses top-level name/input_schema) and the backend - # reads names and sizes from either shape. + # Anthropic's custom tool becomes a function tool, and its built-in tool + # keeps its fields with the type prefixed by the provider. + parameters = {"type": "object", "properties": {"q": {"type": "string"}}} tools = [ { "name": "search_kb", "description": "Search the knowledge base", - "input_schema": {"type": "object", "properties": {"q": {"type": "string"}}}, - } + "input_schema": parameters, + }, + {"type": "web_search_20250305", "name": "web_search", "max_uses": 5}, ] gen = start_generation("chat", model="claude-sonnet-5", provider="anthropic") gen.set_tool_definitions(tools) gen.end() attrs = exported_spans.get_finished_spans()[0].attributes - assert json.loads(attrs["gen_ai.tool.definitions"]) == tools + assert json.loads(attrs["gen_ai.tool.definitions"]) == [ + { + "type": "function", + "name": "search_kb", + "description": "Search the knowledge base", + "parameters": parameters, + }, + {"type": "anthropic.web_search_20250305", "name": "web_search", "max_uses": 5}, + ] + + +def test_set_tool_definitions_records_a_pydantic_tool_as_its_fields( + exported_spans: InMemorySpanExporter, +) -> None: + # google-genai's types.Tool is a pydantic model: recorded as its fields + # (unset ones left out), not as its repr. + pydantic = pytest.importorskip("pydantic") + + class Declaration(pydantic.BaseModel): # type: ignore[name-defined,misc] + name: str + description: str | None = None + parameters: dict[str, Any] | None = None + parameters_json_schema: dict[str, Any] | None = None + + class Tool(pydantic.BaseModel): # type: ignore[name-defined,misc] + function_declarations: list[Declaration] | None = None + google_search: dict[str, Any] | None = None + + # Only google-genai's models are dumped: stand in for its module. + Declaration.__module__ = Tool.__module__ = "google.genai.types" + schema = {"type": "object", "properties": {"city": {"type": "string"}}} + tool = Tool(function_declarations=[Declaration(name="f", parameters_json_schema=schema)]) + gen = start_generation("chat", model="gemini-3-pro", provider="gcp.gemini") + gen.set_tool_definitions([tool, {"code_execution": {}}]) + gen.end() + attrs = exported_spans.get_finished_spans()[0].attributes + assert json.loads(attrs["gen_ai.tool.definitions"]) == [ + {"type": "function", "name": "f", "parameters": schema}, + {"code_execution": {}}, + ] + + +def test_set_tool_definitions_does_not_dump_other_pydantic_models( + exported_spans: InMemorySpanExporter, +) -> None: + # A pydantic tool from elsewhere (a LangChain StructuredTool) has no + # known shape: it is recorded as before, not as its dumped fields. + pydantic = pytest.importorskip("pydantic") + + class StructuredTool(pydantic.BaseModel): # type: ignore[name-defined,misc] + name: str + description: str + args_schema: dict[str, Any] + + def __repr__(self) -> str: + return "StructuredTool(add)" + + tool = StructuredTool(name="add", description="Add.", args_schema={"type": "object"}) + gen = start_generation("chat", provider="openai") + gen.set_tool_definitions([tool]) + gen.end() + attrs = exported_spans.get_finished_spans()[0].attributes + recorded = attrs["gen_ai.tool.definitions"] + assert "args_schema" not in recorded + assert "StructuredTool(add)" in recorded + + +def test_set_tool_definitions_keeps_a_model_whose_dump_fails( + exported_spans: InMemorySpanExporter, +) -> None: + class Broken: + def model_dump(self, **_: Any) -> Any: + raise RuntimeError("no") + + def __repr__(self) -> str: + return "Broken()" + + gen = start_generation("chat", provider="gcp.gemini") + gen.set_tool_definitions([Broken()]) + gen.end() + attrs = exported_spans.get_finished_spans()[0].attributes + assert "gen_ai.tool.definitions" in attrs def test_tools_omitted_attribute_absent(exported_spans: InMemorySpanExporter) -> None: @@ -682,7 +804,8 @@ def test_context_sizes_combine_input_output_and_tools( sizes = _sizes_of(exported_spans.get_finished_spans()[0]) call_part = {"type": "tool_call", "id": "c1", "name": "lookup", "arguments": "{}"} call_bytes = len(json.dumps(call_part, separators=(",", ":")).encode()) - tool_bytes = len(json.dumps(tools[0], separators=(",", ":")).encode()) + recorded = {"type": "function", "name": "lookup", "parameters": {}} + tool_bytes = len(json.dumps(recorded, separators=(",", ":")).encode()) assert sizes == { "version": 1, "tool_definitions": [{"name": "lookup", "bytes": tool_bytes}], diff --git a/tests/test_instrumentation.py b/tests/test_instrumentation.py index a74eb08..ece5792 100644 --- a/tests/test_instrumentation.py +++ b/tests/test_instrumentation.py @@ -418,7 +418,9 @@ def test_openai_instrumentor_emits_tool_definitions() -> None: (llm,) = inner.get_finished_spans() assert llm.attributes is not None - assert json.loads(str(llm.attributes["gen_ai.tool.definitions"])) == _TOOLS_OPENAI + assert json.loads(str(llm.attributes["gen_ai.tool.definitions"])) == [ + {"type": "function", **tool["function"]} for tool in _TOOLS_OPENAI + ] assert not [key for key in llm.attributes if key.startswith("llm.tools")] finally: instrumentor.uninstrument() @@ -428,8 +430,8 @@ def test_openai_instrumentor_emits_tool_definitions() -> None: @pytest.mark.integration def test_anthropic_instrumentor_emits_tool_definitions_and_system_message() -> None: """Same contract for Anthropic: `llm.tools.{i}.tool.json_schema` per tool, - reassembled into `gen_ai.tool.definitions` in Anthropic's own shape - (`input_schema`), not rewritten into OpenAI's. + reassembled into `gen_ai.tool.definitions` as conventions function tools + (Anthropic's `input_schema` becomes `parameters`). Also pins that the request's `system` param surfaces as a role=system input message — the segmentation the backend's context attribution @@ -461,8 +463,15 @@ def test_anthropic_instrumentor_emits_tool_definitions_and_system_message() -> N (llm,) = inner.get_finished_spans() assert llm.attributes is not None recorded = json.loads(str(llm.attributes["gen_ai.tool.definitions"])) - assert recorded == _TOOLS_ANTHROPIC - assert "input_schema" in recorded[0] + assert recorded == [ + { + "type": "function", + "name": tool["name"], + "description": tool["description"], + "parameters": tool["input_schema"], + } + for tool in _TOOLS_ANTHROPIC + ] assert not [key for key in llm.attributes if key.startswith("llm.tools")] # The instrumentor's flattened messages leave the process reassembled. messages = json.loads(str(llm.attributes["gen_ai.input.messages"])) diff --git a/tests/test_media_parts.py b/tests/test_media_parts.py index 5c9c9e1..09ce4eb 100644 --- a/tests/test_media_parts.py +++ b/tests/test_media_parts.py @@ -116,6 +116,59 @@ def test_a_part_with_canonical_values_is_canonical(part: dict[str, Any]) -> None }, "blob_with_no_content_and_no_stripped_reason": {"type": "blob", "modality": "audio"}, "blob_with_content_that_is_not_a_string": {"type": "blob", "content": 5, "byte_size": 8.0}, + "blob_with_content_that_is_the_bytes_marker": { + "type": "blob", + "modality": "image", + "mime_type": "image/png", + "content": "[stripped unknown 16 bytes]", + }, + "blob_with_content_that_is_a_replacement_with_a_mime_and_no_hint": { + "type": "blob", + "content": "[stripped image/jpeg 10 bytes]", + }, + "blob_with_content_that_is_a_replacement_and_its_own_mime_type": { + "type": "blob", + "mime_type": "application/pdf", + "content": "[stripped image/png 8 bytes]", + }, + "blob_with_content_that_is_a_replacement_of_unknown_size": { + "type": "blob", + "modality": "audio", + "content": "[stripped unknown unknown bytes]", + }, + "blob_with_content_that_is_a_replacement_too_large_to_keep": { + "type": "blob", + "content": "[stripped unknown 9007199254740992 bytes]", + }, + "blob_with_content_that_is_a_replacement_with_leading_zeros": { + "type": "blob", + "content": "[stripped image/png 0008 bytes]", + }, + "blob_with_content_that_is_a_replacement_with_thousands_of_leading_zeros": { + "type": "blob", + "content": "[stripped unknown " + "0" * 5000 + "8 bytes]", + }, + "blob_with_content_that_is_a_replacement_whose_size_overflows_int64": { + "type": "blob", + "content": "[stripped image/png 99999999999999999999 bytes]", + }, + "blob_with_content_that_is_a_replacement_with_thousands_of_digits": { + "type": "blob", + "content": "[stripped unknown " + "9" * 5000 + " bytes]", + }, + "blob_with_content_that_only_looks_like_a_replacement": { + "type": "blob", + "mime_type": "image/png", + "content": "[stripped image/png lots bytes]", + }, + "blob_with_content_that_is_a_replacement_with_an_invalid_mime": { + "type": "blob", + "content": "[stripped a b 3 bytes]", + }, + "blob_with_content_that_holds_a_replacement_in_text": { + "type": "blob", + "content": "see [stripped unknown 16 bytes]", + }, "uri_with_no_mime_type_and_no_modality": { "type": "uri", "uri": "https://example.com/download", diff --git a/tests/test_normalization_structured_content.py b/tests/test_normalization_structured_content.py new file mode 100644 index 0000000..0a45360 --- /dev/null +++ b/tests/test_normalization_structured_content.py @@ -0,0 +1,365 @@ +"""Content attributes another instrumentation sets as structured values. + +The GenAI conventions now ask for ``gen_ai.input.messages``, +``gen_ai.output.messages``, ``gen_ai.system_instructions`` and +``gen_ai.tool.definitions`` to be maps and arrays rather than JSON strings, +and OpenTelemetry Python keeps such values on a span from 1.45. The exporter +writes each one as the JSON text this SDK writes for the same content, then +treats it exactly as that string: its media parts are rebuilt and stripped, so +no byte of a blob leaves. A span carrying the string and a span carrying the +structured value export the same attributes. + +The spans are built directly rather than through a tracer: OpenTelemetry +before 1.45 drops a mapping attribute when it is set, and the floor CI job runs +this suite on 1.25. +""" + +from __future__ import annotations + +import base64 +import json +import math +from types import MappingProxyType +from typing import Any + +import pytest +from opentelemetry.sdk.trace import ReadableSpan, TracerProvider +from opentelemetry.sdk.trace.export.in_memory_span_exporter import InMemorySpanExporter +from opentelemetry.trace import SpanContext + +from rius._serde import MAX_ATTR_CHARS, MAX_STRIP_CHARS, TRUNCATION_MARKER, byte_object_marker +from rius.normalization import NormalizingSpanExporter +from rius.semconv import ( + GEN_AI_INPUT_MESSAGES, + GEN_AI_OUTPUT_MESSAGES, + GEN_AI_SYSTEM_INSTRUCTIONS, + GEN_AI_TOOL_DEFINITIONS, +) + +PNG = bytes(range(8)) + + +def _export(attributes: dict[str, Any]) -> dict[str, Any]: + context = SpanContext(trace_id=1, span_id=2, is_remote=False) + span = ReadableSpan(name="chat", context=context, attributes=attributes) + sink = InMemorySpanExporter() + NormalizingSpanExporter(sink).export([span]) + [out] = sink.get_finished_spans() + return dict(out.attributes or {}) + + +def _json(value: Any) -> str: + return json.dumps(value, separators=(",", ":"), ensure_ascii=False) + + +_MESSAGES = [ + {"role": "user", "parts": [{"type": "text", "content": "Weather in Paris? & é"}]}, + { + "role": "assistant", + "parts": [ + { + "type": "tool_call", + "id": "call_1", + "name": "get_weather", + "arguments": {"city": "Paris", "days": 2}, + } + ], + }, +] + + +@pytest.mark.parametrize( + "key", [GEN_AI_INPUT_MESSAGES, GEN_AI_OUTPUT_MESSAGES, GEN_AI_SYSTEM_INSTRUCTIONS] +) +def test_a_structured_message_key_is_written_as_its_json(key: str) -> None: + value = _MESSAGES if key != GEN_AI_SYSTEM_INSTRUCTIONS else _MESSAGES[0]["parts"] + exported = _export({key: value}) + assert exported[key] == _json(value) + + +def test_structured_tool_definitions_are_written_as_their_json() -> None: + tools = [ + { + "type": "function", + "name": "get_weather", + "parameters": {"type": "object", "properties": {"city": {"type": "string"}}}, + } + ] + assert _export({GEN_AI_TOOL_DEFINITIONS: tools})[GEN_AI_TOOL_DEFINITIONS] == _json(tools) + + +def test_the_value_as_opentelemetry_stores_it_exports_as_the_string_does() -> None: + # OpenTelemetry 1.45 stores a list as a tuple and keeps byte objects, so + # the value a third-party span carries is this shape, not the one it set. + stored = ( + { + "role": "user", + "parts": ( + {"type": "text", "content": "describe"}, + {"type": "blob", "modality": "image", "mime_type": "image/png", "content": PNG}, + ), + }, + ) + as_string = _json( + [ + { + "role": "user", + "parts": [ + {"type": "text", "content": "describe"}, + { + "type": "blob", + "modality": "image", + "mime_type": "image/png", + "content": base64.b64encode(PNG).decode(), + }, + ], + } + ] + ) + structured = _export({GEN_AI_INPUT_MESSAGES: stored, "other": "x"}) + assert structured == _export({GEN_AI_INPUT_MESSAGES: as_string, "other": "x"}) + parts = json.loads(structured[GEN_AI_INPUT_MESSAGES])[0]["parts"] + assert parts[1] == { + "type": "blob", + "modality": "image", + "mime_type": "image/png", + "byte_size": 8, + "stripped_reason": "not_captured", + } + + +def test_a_blob_in_the_system_instructions_and_tool_definitions_loses_its_bytes() -> None: + blob = {"type": "blob", "mime_type": "image/png", "content": PNG} + exported = _export({GEN_AI_SYSTEM_INSTRUCTIONS: [blob], GEN_AI_TOOL_DEFINITIONS: [blob]}) + encoded = base64.b64encode(PNG).decode() + for key in (GEN_AI_SYSTEM_INSTRUCTIONS, GEN_AI_TOOL_DEFINITIONS): + assert encoded not in exported[key] + assert json.loads(exported[key])[0]["type"] == "blob" + + +def test_a_byte_object_anywhere_else_is_the_marker() -> None: + exported = _export( + {GEN_AI_OUTPUT_MESSAGES: [{"role": "assistant", "parts": [{"type": "x", "data": PNG}]}]} + ) + part = json.loads(exported[GEN_AI_OUTPUT_MESSAGES])[0]["parts"][0] + assert part == {"type": "x", "data": byte_object_marker(PNG)} + + +def test_a_memoryview_blob_is_read_as_its_bytes() -> None: + blob = {"type": "blob", "mime_type": "image/png", "content": memoryview(PNG)} + exported = _export({GEN_AI_SYSTEM_INSTRUCTIONS: [blob]}) + assert json.loads(exported[GEN_AI_SYSTEM_INSTRUCTIONS])[0]["byte_size"] == 8 + + +@pytest.mark.parametrize( + "key", [GEN_AI_INPUT_MESSAGES, GEN_AI_OUTPUT_MESSAGES, GEN_AI_SYSTEM_INSTRUCTIONS] +) +def test_a_released_memoryview_blob_is_not_sized_as_empty(key: str) -> None: + # Its bytes cannot be read, so the size is unknown: never 0, which would + # read as an empty blob once the marker's size is taken as the blob's. + view = memoryview(PNG) + view.release() + blob = {"type": "blob", "mime_type": "image/png", "content": view} + value: Any = ( + [blob] if key == GEN_AI_SYSTEM_INSTRUCTIONS else [{"role": "user", "parts": [blob]}] + ) + exported = _export({key: value}) + payload = json.loads(exported[key]) + part = payload[0] if key == GEN_AI_SYSTEM_INSTRUCTIONS else payload[0]["parts"][0] + assert part["type"] == "blob" + assert "byte_size" not in part + + +#: A phone photo's size: its base64 is past the strip budget (1 MiB). +LARGE_PNG = b"\x89PNG\r\n\x1a\n" + bytes(800_000 - 8) +_LARGE_KEYS = [GEN_AI_INPUT_MESSAGES, GEN_AI_OUTPUT_MESSAGES, GEN_AI_SYSTEM_INSTRUCTIONS] + + +def _with_large_blob(key: str, content: Any) -> Any: + parts = [ + {"type": "text", "content": "describe this"}, + {"type": "blob", "mime_type": "image/png", "modality": "image", "content": content}, + {"type": "text", "content": "and this"}, + ] + if key == GEN_AI_SYSTEM_INSTRUCTIONS: + return parts + return [{"role": "user", "parts": parts}, {"role": "assistant", "parts": [parts[0]]}] + + +def _large_blob_parts(key: str, exported: dict[str, Any]) -> list[Any]: + payload = json.loads(exported[key]) + if key == GEN_AI_SYSTEM_INSTRUCTIONS: + return list(payload) + assert payload[1] == { + "role": "assistant", + "parts": [{"type": "text", "content": "describe this"}], + } + return list(payload[0]["parts"]) + + +@pytest.mark.parametrize("key", _LARGE_KEYS) +@pytest.mark.parametrize("form", ["bytes", "base64"]) +def test_a_blob_past_the_strip_budget_is_stripped_and_sized(key: str, form: str) -> None: + encoded = base64.b64encode(LARGE_PNG).decode() + content: Any = LARGE_PNG if form == "bytes" else encoded + exported = _export({key: _with_large_blob(key, content)}) + assert encoded[:64] not in exported[key] + assert _large_blob_parts(key, exported) == [ + {"type": "text", "content": "describe this"}, + { + "type": "blob", + "modality": "image", + "mime_type": "image/png", + "byte_size": 800_000, + "stripped_reason": "not_captured", + }, + {"type": "text", "content": "and this"}, + ] + + +@pytest.mark.parametrize("key", _LARGE_KEYS) +def test_a_blob_past_the_strip_budget_exports_as_its_json_text(key: str) -> None: + # The bytes, their base64 and the JSON text of the base64 form are one + # content: they export the same attribute. + as_base64 = _with_large_blob(key, base64.b64encode(LARGE_PNG).decode()) + as_text = _export({key: _json(as_base64)}) + assert _export({key: as_base64}) == as_text + assert _export({key: _with_large_blob(key, LARGE_PNG)}) == as_text + + +def test_a_value_past_the_strip_budget_with_no_blob_is_cut_with_its_media_stripped() -> None: + # Encoding whole leaves the strip as the bound: a structured value past + # the budget still lands at the cap, and base64 inside it never exports. + encoded = base64.b64encode(bytes(range(256)) * 8192).decode() + value = [ + {"role": "user", "parts": [{"type": "text", "content": "word " * 400_000}]}, + { + "role": "assistant", + "parts": [ + { + "type": "tool_call", + "id": "call_1", + "name": "upload", + "arguments": {"file": encoded}, + } + ], + }, + ] + assert len(_json(value)) > MAX_STRIP_CHARS + out = _export({GEN_AI_INPUT_MESSAGES: value})[GEN_AI_INPUT_MESSAGES] + assert len(out) <= MAX_ATTR_CHARS + len(TRUNCATION_MARKER) + assert encoded[:64] not in out + + +def test_a_blob_with_no_mime_type_is_sized_from_its_bytes() -> None: + blob = {"type": "blob", "modality": "image", "content": LARGE_PNG} + as_text = {"type": "blob", "modality": "image", "content": base64.b64encode(LARGE_PNG).decode()} + exported = _export({GEN_AI_SYSTEM_INSTRUCTIONS: [blob]}) + assert exported == _export({GEN_AI_SYSTEM_INSTRUCTIONS: _json([as_text])}) + [part] = json.loads(exported[GEN_AI_SYSTEM_INSTRUCTIONS]) + assert part["byte_size"] == 800_000 + assert "mime_type" not in part + + +def test_any_mapping_is_an_object() -> None: + value = [MappingProxyType({"type": "text", "content": "hi"})] + assert _export({GEN_AI_SYSTEM_INSTRUCTIONS: value})[GEN_AI_SYSTEM_INSTRUCTIONS] == _json( + [{"type": "text", "content": "hi"}] + ) + + +def test_a_non_finite_number_inside_is_null() -> None: + tools = [{"name": "t", "parameters": {"default": math.nan, "max": math.inf}}] + exported = _export({GEN_AI_TOOL_DEFINITIONS: tools}) + assert ( + exported[GEN_AI_TOOL_DEFINITIONS] + == '[{"name":"t","parameters":{"default":null,"max":null}}]' + ) + + +def test_an_array_of_strings_is_its_json_array() -> None: + exported = _export({GEN_AI_SYSTEM_INSTRUCTIONS: ("be brief", "be kind")}) + assert exported[GEN_AI_SYSTEM_INSTRUCTIONS] == '["be brief","be kind"]' + + +def test_a_large_value_is_not_cut_at_the_attribute_cap() -> None: + # A string under the strip budget keeps its length; so does the same + # content as a structured value. + text = "word " * (MAX_ATTR_CHARS // 2) + value = [{"role": "user", "parts": [{"type": "text", "content": text}]}] + exported = _export({GEN_AI_INPUT_MESSAGES: value}) + assert exported[GEN_AI_INPUT_MESSAGES] == _json(value) + assert exported == _export({GEN_AI_INPUT_MESSAGES: _json(value)}) + + +def test_a_value_that_cannot_be_encoded_never_fails_the_export() -> None: + cycle: list[Any] = [{"type": "text", "content": "hi"}] + cycle.append(cycle) + exported = _export({GEN_AI_INPUT_MESSAGES: cycle, "other": "x"}) + assert isinstance(exported[GEN_AI_INPUT_MESSAGES], str) + assert exported["other"] == "x" + + +def test_a_byte_key_never_fails_the_export_or_leaks_its_bytes() -> None: + exported = _export({GEN_AI_INPUT_MESSAGES: [{b"k": PNG}]}) + assert isinstance(exported[GEN_AI_INPUT_MESSAGES], str) + assert "\\x00\\x01" not in exported[GEN_AI_INPUT_MESSAGES] + + +_IMAGE = bytes(range(256)) * 40 +_IMAGE_BASE64 = base64.b64encode(_IMAGE).decode("ascii") + + +def _cyclic_messages_with_a_blob() -> list[Any]: + blob = {"type": "blob", "mime_type": "image/png", "content": _IMAGE} + messages: list[Any] = [{"role": "user", "parts": [blob]}] + messages[0]["self"] = messages + return messages + + +@pytest.mark.parametrize( + "value", + [ + pytest.param(_cyclic_messages_with_a_blob(), id="blob-in-a-cycle"), + pytest.param( + [{b"k": 1, "type": "blob", "mime_type": "image/png", "content": _IMAGE}], + id="blob-in-a-byte-keyed-map", + ), + pytest.param( + [{("a", 1): 1, "parts": [{"type": "blob", "content": _IMAGE}]}], + id="blob-beside-a-tuple-key", + ), + ], +) +def test_a_blob_in_a_value_that_cannot_be_encoded_never_leaks_its_bytes(value: Any) -> None: + exported = _export({GEN_AI_INPUT_MESSAGES: value}) + text = exported[GEN_AI_INPUT_MESSAGES] + assert isinstance(text, str) + assert _IMAGE_BASE64[:64] not in text + assert "\\x00\\x01" not in text + assert "[stripped" in text + + +@pytest.mark.parametrize("value", ["already text", 3, True, PNG]) +def test_a_value_that_is_not_structured_is_not_reencoded(value: Any) -> None: + exported = _export({GEN_AI_INPUT_MESSAGES: value}) + expected = byte_object_marker(PNG) if value is PNG else value + assert exported[GEN_AI_INPUT_MESSAGES] == expected + + +def test_other_keys_keep_their_structured_values() -> None: + exported = _export({"app.payload": {"a": [1, 2]}}) + assert exported["app.payload"] == {"a": [1, 2]} + + +def test_a_span_from_a_real_tracer_is_converted() -> None: + probe = TracerProvider().get_tracer("probe").start_span("p", attributes={"m": {"a": 1}}) + if "m" not in (probe.attributes or {}): + pytest.skip("this OpenTelemetry SDK drops mapping attributes (before 1.45)") + sink = InMemorySpanExporter() + tracer = TracerProvider().get_tracer("third.party") + span = tracer.start_span("chat", attributes={GEN_AI_INPUT_MESSAGES: _MESSAGES}) + span.end() + NormalizingSpanExporter(sink).export([span]) # type: ignore[list-item] + [out] = sink.get_finished_spans() + assert (out.attributes or {})[GEN_AI_INPUT_MESSAGES] == _json(_MESSAGES) diff --git a/tests/test_normalization_tools.py b/tests/test_normalization_tools.py index d27c64d..c3a0e98 100644 --- a/tests/test_normalization_tools.py +++ b/tests/test_normalization_tools.py @@ -62,8 +62,7 @@ # openinference-instrumentation-anthropic 2.1.4, _wrappers.py:567-569: the # request's tools, one json_schema per index, in Anthropic's own shape -# (top-level name / input_schema) — which must survive verbatim, not be -# rewritten into OpenAI's. +# (top-level name / input_schema). _ANTHROPIC_TOOLS = [ { "name": "get_weather", @@ -77,6 +76,18 @@ ] +# Both recorded in the conventions' function-tool shape. +_OPENAI_SEMCONV = [{"type": "function", **tool["function"]} for tool in _OPENAI_TOOLS] +_ANTHROPIC_SEMCONV = [ + { + "type": "function", + "name": "get_weather", + "description": "Weather for a city", + "parameters": _ANTHROPIC_TOOLS[0]["input_schema"], + } +] + + def _indexed(tools: list[dict[str, Any]]) -> dict[str, str]: return {f"llm.tools.{i}.tool.json_schema": json.dumps(tool) for i, tool in enumerate(tools)} @@ -122,7 +133,7 @@ def test_openai_function_tools_become_one_definitions_array() -> None: **_indexed(_OPENAI_TOOLS), } out = _exported_attributes(raw) - assert _definitions(out) == _OPENAI_TOOLS + assert _definitions(out) == _OPENAI_SEMCONV assert out == { "openinference.span.kind": "LLM", GEN_AI_OPERATION_NAME: "chat", @@ -134,7 +145,7 @@ def test_openai_function_tools_become_one_definitions_array() -> None: assert not [key for key in out if key.startswith("llm.tools")] -def test_anthropic_input_schema_tools_survive_verbatim() -> None: +def test_anthropic_input_schema_tools_become_function_tools() -> None: raw = { "openinference.span.kind": "LLM", "llm.provider": "anthropic", @@ -142,7 +153,7 @@ def test_anthropic_input_schema_tools_survive_verbatim() -> None: **_indexed(_ANTHROPIC_TOOLS), } out = _exported_attributes(raw) - assert _definitions(out) == _ANTHROPIC_TOOLS + assert _definitions(out) == _ANTHROPIC_SEMCONV assert not [key for key in out if key.startswith("llm.tools")] @@ -153,7 +164,7 @@ def test_the_definitions_are_spelled_like_the_native_path() -> None: out = normalize_tool_definitions(_indexed(_ANTHROPIC_TOOLS)) assert out is not None - assert out[GEN_AI_TOOL_DEFINITIONS] == serialize(_ANTHROPIC_TOOLS) + assert out[GEN_AI_TOOL_DEFINITIONS] == serialize(_ANTHROPIC_SEMCONV) def test_indices_are_ordered_numerically_not_lexically() -> None: @@ -162,7 +173,7 @@ def test_indices_are_ordered_numerically_not_lexically() -> None: attributes = dict(reversed(list(_indexed(tools).items()))) out = normalize_tool_definitions(attributes) assert out is not None - assert _definitions(out) == tools + assert _definitions(out) == [{"type": "function", **tool} for tool in tools] def test_a_native_definitions_key_wins_and_the_indexed_keys_still_go() -> None: @@ -210,7 +221,7 @@ def test_bag_tools_are_promoted_when_llm_tools_is_absent() -> None: ), } out = _exported_attributes(raw) - assert _definitions(out) == _OPENAI_TOOLS + assert _definitions(out) == _OPENAI_SEMCONV assert out[GEN_AI_REQUEST_MODEL] == "gpt-4o" assert out["rius.request.tool_choice"] == "auto" # Every member was promoted somewhere, so the bag goes rather than riding as "{}". @@ -225,7 +236,7 @@ def test_legacy_bag_functions_are_promoted() -> None: {LLM_INVOCATION_PARAMETERS: json.dumps({"functions": functions, "temperature": 0.1})} ) assert out is not None - assert _definitions(out) == functions + assert _definitions(out) == [{"type": "function", **functions[0]}] assert json.loads(out[LLM_INVOCATION_PARAMETERS]) == {"temperature": 0.1} @@ -236,7 +247,10 @@ def test_bag_tools_and_functions_are_both_kept_in_one_array() -> None: {LLM_INVOCATION_PARAMETERS: json.dumps({"tools": tools, "functions": functions})} ) assert out is not None - assert _definitions(out) == tools + functions + assert _definitions(out) == [ + {"type": "function", "name": "a"}, + {"type": "function", "name": "b"}, + ] # Nothing else was in the bag, so the bag goes rather than riding as "{}". assert LLM_INVOCATION_PARAMETERS not in out @@ -249,7 +263,7 @@ def test_llm_tools_wins_over_the_bag_and_the_bag_member_still_goes() -> None: {LLM_INVOCATION_PARAMETERS: bag, **_indexed([{"name": "from-llm-tools"}])} ) assert out is not None - assert _definitions(out) == [{"name": "from-llm-tools"}] + assert _definitions(out) == [{"type": "function", "name": "from-llm-tools"}] assert json.loads(out[LLM_INVOCATION_PARAMETERS]) == {"tool_choice": "auto"} @@ -289,6 +303,38 @@ def test_a_native_definitions_key_wins_over_the_bag_and_the_member_still_goes() } +def test_a_built_in_tool_is_prefixed_with_the_span_provider() -> None: + raw = { + "openinference.span.kind": "LLM", + "llm.provider": "anthropic", + **_indexed([{"type": "web_search_20250305", "name": "web_search"}]), + } + out = _exported_attributes(raw) + assert _definitions(out) == [{"type": "anthropic.web_search_20250305", "name": "web_search"}] + + +@pytest.mark.parametrize( + "route", + ["llm_tools", "bag_tools", "bag_declarations"], +) +def test_definitions_that_come_to_nothing_write_nothing(route: str) -> None: + # The sink writes nothing for an empty list, and the SDK must agree with + # it; the sources still go. + if route == "llm_tools": + attributes = _indexed([{"function_declarations": []}]) + elif route == "bag_tools": + attributes = {LLM_INVOCATION_PARAMETERS: json.dumps({"tools": [], "seed": 1})} + else: + bag = {"tools": [{"function_declarations": []}], "seed": 1} + attributes = {LLM_INVOCATION_PARAMETERS: json.dumps(bag)} + out = normalize_tool_definitions(attributes) + assert out is not None + assert GEN_AI_TOOL_DEFINITIONS not in out + assert not any(key.startswith("llm.tools.") for key in out) + if route != "llm_tools": + assert json.loads(out[LLM_INVOCATION_PARAMETERS]) == {"seed": 1} + + @pytest.mark.parametrize( "bag", [ @@ -336,7 +382,7 @@ def test_promoted_definitions_are_content(capture_content: bool, route: str) -> exported = dict(span.attributes or {}) assert not [key for key in exported if key.startswith("llm.tools")] if capture_content: - assert _definitions(exported) == secret + assert _definitions(exported) == [{"type": "function", **secret[0]}] else: assert GEN_AI_TOOL_DEFINITIONS not in exported assert "SECRET" not in json.dumps(exported) diff --git a/tests/test_sdk_cases.py b/tests/test_sdk_cases.py index 47cc39b..8165755 100644 --- a/tests/test_sdk_cases.py +++ b/tests/test_sdk_cases.py @@ -5,8 +5,10 @@ both SDKs are held to one expected result for each: how input.value and output.value are written, how set_attribute encodes a value, how messages and rius.context.sizes are recorded, what the masking exporter keeps, how RIUS_* -variables resolve, how the resource takes in OTEL_RESOURCE_ATTRIBUTES and how -error.type is named on the Anthropic SDK's own spans. +variables resolve, how the resource takes in OTEL_RESOURCE_ATTRIBUTES, how +error.type is named on the Anthropic SDK's own spans, how a content key +another instrumentation set as a structured value is exported and how tool +definitions are rewritten into the conventions' shape (the sink runs those too). Their README describes the format, including the tagged values JSON cannot hold (``{"$bytes": N}``, ``{"$number": "NaN"}``). """ @@ -21,14 +23,17 @@ from typing import Any import pytest -from opentelemetry.sdk.trace import TracerProvider +from opentelemetry.sdk.trace import ReadableSpan, TracerProvider from opentelemetry.sdk.trace.export import SimpleSpanProcessor from opentelemetry.sdk.trace.export.in_memory_span_exporter import InMemorySpanExporter -from opentelemetry.trace import Status, StatusCode +from opentelemetry.trace import SpanContext, Status, StatusCode import rius +from rius._serde import serialize +from rius._tool_definitions import semconv_tool_definitions from rius.config import resolve_config from rius.masking import MaskingSpanExporter +from rius.normalization import NormalizingSpanExporter CASES = Path(__file__).parent / "fixtures" / "semconv" / "sdk_cases" @@ -123,6 +128,21 @@ def test_anthropic_error_type(case: dict[str, Any], exporter: _Spans) -> None: assert exporter.attributes()["error.type"] == case["expected"] +@pytest.mark.parametrize("case", _cases("structured_content"), ids=_ids("structured_content")) +def test_structured_content(case: dict[str, Any]) -> None: + # Built directly rather than through a tracer: OpenTelemetry before 1.45 + # drops a mapping attribute when it is set, and the floor CI job runs + # this suite on 1.25. + attributes = {key: _value(raw) for key, raw in case["attributes"].items()} + context = SpanContext(trace_id=1, span_id=2, is_remote=False) + sink = InMemorySpanExporter() + NormalizingSpanExporter(sink).export( + [ReadableSpan(name="chat", context=context, attributes=attributes)] + ) + (span,) = sink.get_finished_spans() + assert dict(span.attributes or {}) == case["expected"] + + @pytest.mark.parametrize("case", _cases("attributes"), ids=_ids("attributes")) def test_set_attribute(case: dict[str, Any], exporter: _Spans) -> None: span = rius.start_span("s") @@ -249,3 +269,11 @@ def test_resource(case: dict[str, Any], monkeypatch: pytest.MonkeyPatch) -> None client.shutdown() assert {key: attributes.get(key) for key in case["expected"]} == case["expected"] assert [key for key in case["absent"] if key in attributes] == [] + + +@pytest.mark.parametrize("case", _cases("tool_definitions"), ids=_ids("tool_definitions")) +def test_tool_definitions(case: dict[str, Any]) -> None: + once = semconv_tool_definitions(case["tools"], case["provider"]) + assert serialize(once) == case["expected"] + # The sink rewrites what the SDK exported: a second pass changes nothing. + assert serialize(semconv_tool_definitions(once, case["provider"])) == case["expected"] diff --git a/tests/test_semconv.py b/tests/test_semconv.py index 848c835..1f9773a 100644 --- a/tests/test_semconv.py +++ b/tests/test_semconv.py @@ -91,6 +91,29 @@ def test_reranker_round_trips_with_the_ai_sdks_rerank_operation() -> None: assert kind_for_operation("rerank") == "RERANKER" +def test_framework_entrypoint_operations_are_chain_spans() -> None: + """The conventions name a framework entrypoint ``invoke_runner``, and + ``invoke_{framework_entrypoint}`` in general, and define it as not being an + agent. The table lists ``invoke_runner``; any other ``invoke_`` operation + the table does not list lands on CHAIN too, while ``invoke_agent`` stays + AGENT.""" + from rius.semconv import kind_for_operation + + assert kind_for_operation("invoke_runner") == "CHAIN" + assert kind_for_operation("invoke_crew") == "CHAIN" + assert kind_for_operation("invoke_workflow") == "CHAIN" + assert kind_for_operation("invoke_agent") == "AGENT" + + +def test_an_unknown_operation_without_the_entrypoint_prefix_has_no_kind() -> None: + from rius.semconv import kind_for_operation + + assert kind_for_operation("invoke_") is None + assert kind_for_operation("invoke") is None + assert kind_for_operation("reinvoke_runner") is None + assert kind_for_operation("made_up") is None + + def test_data_source_id_is_set_only_on_retriever_spans() -> None: from rius.semconv import GEN_AI_DATA_SOURCE_ID, kind_attributes diff --git a/tests/test_span_limits.py b/tests/test_span_limits.py index ccb952a..036bc8d 100644 --- a/tests/test_span_limits.py +++ b/tests/test_span_limits.py @@ -331,7 +331,7 @@ def test_a_twenty_turn_agent_span_keeps_model_tools_usage_and_first_messages( assert attributes["gen_ai.request.model"] == "gpt-4o" assert attributes["gen_ai.request.temperature"] == 0.2 tools = json.loads(str(attributes["gen_ai.tool.definitions"])) - assert [t["function"]["name"] for t in tools] == [f"tool_{i}" for i in range(10)] + assert [t["name"] for t in tools] == [f"tool_{i}" for i in range(10)] assert attributes["gen_ai.usage.input_tokens"] == 1200 assert attributes["gen_ai.usage.output_tokens"] == 30 messages = json.loads(str(attributes["gen_ai.input.messages"])) diff --git a/tests/test_tool_definitions.py b/tests/test_tool_definitions.py new file mode 100644 index 0000000..620e240 --- /dev/null +++ b/tests/test_tool_definitions.py @@ -0,0 +1,466 @@ +"""Tool definitions recorded in the GenAI conventions' shape. + +A ``function`` tool must be ``{"type": "function", "name", "description"?, +"parameters"?}``: the conventions' schema no longer lets a ``function`` tool +that misses that shape fall back to the generic definition. A provider's +built-in tool keeps its own fields, with its ``type`` prefixed by the +provider name (``anthropic.web_search_20250305``). +""" + +from __future__ import annotations + +from typing import Any + +import pytest + +from rius._tool_definitions import semconv_tool_definitions + +_PARAMETERS = {"type": "object", "properties": {"city": {"type": "string"}}} + + +def test_openai_nested_function_is_flattened() -> None: + tools = [ + { + "type": "function", + "function": { + "name": "get_weather", + "description": "Weather for a city", + "parameters": _PARAMETERS, + "strict": True, + }, + } + ] + assert semconv_tool_definitions(tools, "openai") == [ + { + "type": "function", + "name": "get_weather", + "description": "Weather for a city", + "parameters": _PARAMETERS, + "strict": True, + } + ] + + +def test_anthropic_custom_tool_becomes_a_function_with_parameters() -> None: + tools = [{"name": "search_kb", "description": "Search", "input_schema": _PARAMETERS}] + assert semconv_tool_definitions(tools, "anthropic") == [ + { + "type": "function", + "name": "search_kb", + "description": "Search", + "parameters": _PARAMETERS, + } + ] + + +def test_anthropic_explicit_custom_type_becomes_a_function() -> None: + tools = [{"type": "custom", "name": "search_kb", "input_schema": _PARAMETERS}] + assert semconv_tool_definitions(tools, "anthropic") == [ + {"type": "function", "name": "search_kb", "parameters": _PARAMETERS} + ] + + +def test_legacy_openai_function_without_type_becomes_a_function() -> None: + tools = [{"name": "get_weather", "parameters": _PARAMETERS}] + assert semconv_tool_definitions(tools, None) == [ + {"type": "function", "name": "get_weather", "parameters": _PARAMETERS} + ] + + +def test_flat_function_with_camel_case_input_schema_names_it_parameters() -> None: + # The Vercel AI SDK's function tool spells the schema inputSchema. + tools = [{"type": "function", "name": "get_weather", "inputSchema": _PARAMETERS}] + assert semconv_tool_definitions(tools, "openai") == [ + {"type": "function", "name": "get_weather", "parameters": _PARAMETERS} + ] + + +def test_semconv_function_tool_is_unchanged() -> None: + tool = {"type": "function", "name": "get_weather", "parameters": _PARAMETERS} + assert semconv_tool_definitions([tool], "openai") == [tool] + + +def test_provider_built_in_tool_type_is_prefixed() -> None: + tools = [{"type": "web_search_20250305", "name": "web_search", "max_uses": 5}] + assert semconv_tool_definitions(tools, "anthropic") == [ + {"type": "anthropic.web_search_20250305", "name": "web_search", "max_uses": 5} + ] + + +def test_built_in_tool_without_a_name_gets_none_invented() -> None: + assert semconv_tool_definitions([{"type": "web_search"}], "openai") == [ + {"type": "openai.web_search"} + ] + + +def test_built_in_tool_is_left_unprefixed_without_a_provider() -> None: + tool = {"type": "web_search_20250305", "name": "web_search"} + assert semconv_tool_definitions([tool], None) == [tool] + assert semconv_tool_definitions([tool], "") == [tool] + + +def test_an_already_namespaced_type_is_not_prefixed_again() -> None: + tool = {"type": "anthropic.web_search_20250305", "name": "web_search"} + assert semconv_tool_definitions([tool], "anthropic") == [tool] + # A provider whose name has dots of its own does not stack a second prefix. + assert semconv_tool_definitions([tool], "azure.ai.openai") == [tool] + + +def test_vercel_provider_tool_takes_its_namespaced_id_as_type() -> None: + tool = { + "type": "provider-defined", + "id": "anthropic.web_search_20250305", + "name": "web_search", + "args": {}, + } + assert semconv_tool_definitions([tool], "anthropic") == [ + {**tool, "type": "anthropic.web_search_20250305"} + ] + + +def test_bedrock_tool_spec_becomes_a_function_with_its_json_schema() -> None: + # Bedrock Converse wraps the function in toolSpec and the schema in + # inputSchema.json. + tools = [ + { + "toolSpec": { + "name": "get_weather", + "description": "Weather for a city", + "inputSchema": {"json": _PARAMETERS}, + } + } + ] + assert semconv_tool_definitions(tools, "aws.bedrock") == [ + { + "type": "function", + "name": "get_weather", + "description": "Weather for a city", + "parameters": _PARAMETERS, + } + ] + + +def test_bedrock_tool_spec_without_a_name_or_a_cache_point_is_kept() -> None: + nameless = {"toolSpec": {"inputSchema": {"json": _PARAMETERS}}} + cache_point = {"cachePoint": {"type": "default"}} + assert semconv_tool_definitions([nameless, cache_point], "aws.bedrock") == [ + nameless, + cache_point, + ] + + +@pytest.mark.parametrize( + ("container", "schema"), + [("function_declarations", "parameters"), ("functionDeclarations", "parametersJsonSchema")], +) +def test_gemini_declarations_become_one_function_tool_each(container: str, schema: str) -> None: + tools = [ + { + container: [ + {"name": "get_weather", "description": "Weather", schema: _PARAMETERS}, + {"name": "get_time"}, + ] + }, + {"name": "lookup", "input_schema": _PARAMETERS}, + ] + assert semconv_tool_definitions(tools, "gcp.gemini") == [ + { + "type": "function", + "name": "get_weather", + "description": "Weather", + "parameters": _PARAMETERS, + }, + {"type": "function", "name": "get_time"}, + {"type": "function", "name": "lookup", "parameters": _PARAMETERS}, + ] + + +def test_gemini_snake_case_json_schema_is_named_parameters() -> None: + tools = [{"function_declarations": [{"name": "f", "parameters_json_schema": _PARAMETERS}]}] + assert semconv_tool_definitions(tools, "gcp.gemini") == [ + {"type": "function", "name": "f", "parameters": _PARAMETERS} + ] + + +def test_gemini_built_ins_beside_declarations_are_kept_without_a_name() -> None: + # A built-in has no name of its own: inventing one would record a tool + # that is offered but never called by that name. + tools = [ + {"function_declarations": [{"name": "f"}], "google_search": {}}, + {"code_execution": {}}, + ] + assert semconv_tool_definitions(tools, "gcp.gemini") == [ + {"type": "function", "name": "f"}, + {"google_search": {}}, + {"code_execution": {}}, + ] + + +def test_gemini_declaration_without_a_name_is_kept_as_given() -> None: + tools = [{"functionDeclarations": [{"description": "no name"}, "odd"]}] + assert semconv_tool_definitions(tools, "gcp.gemini") == [{"description": "no name"}, "odd"] + + +def test_gemini_container_that_is_not_a_list_is_kept() -> None: + tool = {"function_declarations": {"name": "f"}} + assert semconv_tool_definitions([tool], "gcp.gemini") == [tool] + + +@pytest.mark.parametrize("tool", ["plain", 3, None, ["x"], {"description": "no name or type"}]) +def test_anything_unreadable_is_kept_as_it_is(tool: Any) -> None: + assert semconv_tool_definitions([tool], "openai") == [tool] + + +def test_normalizing_twice_equals_once() -> None: + tools = [ + {"type": "function", "function": {"name": "a", "parameters": _PARAMETERS}}, + {"name": "b", "input_schema": _PARAMETERS}, + {"type": "web_search_20250305", "name": "web_search"}, + {"toolSpec": {"name": "c", "inputSchema": {"json": _PARAMETERS}}}, + {"functionDeclarations": [{"name": "d", "parametersJsonSchema": _PARAMETERS}]}, + {"function_declarations": [{"name": "e"}], "google_search": {}}, + ] + once = semconv_tool_definitions(tools, "anthropic") + assert semconv_tool_definitions(once, "anthropic") == once + + +def test_the_caller_list_is_not_mutated() -> None: + tools = [{"name": "b", "input_schema": _PARAMETERS}, {"type": "web_search"}] + semconv_tool_definitions(tools, "openai") + assert tools == [{"name": "b", "input_schema": _PARAMETERS}, {"type": "web_search"}] + + +# --- second-pass stability: every output is already in the conventions' shape + + +def test_every_list_valued_declarations_key_expands() -> None: + tools = [{"function_declarations": [{"name": "a"}], "functionDeclarations": [{"name": "b"}]}] + assert semconv_tool_definitions(tools, "gcp.gemini") == [ + {"type": "function", "name": "a"}, + {"type": "function", "name": "b"}, + ] + + +def test_a_declarations_spelling_that_is_not_a_list_stays_in_the_rest() -> None: + tools = [{"function_declarations": [{"name": "a"}], "functionDeclarations": "odd"}] + assert semconv_tool_definitions(tools, "gcp.gemini") == [ + {"type": "function", "name": "a"}, + {"functionDeclarations": "odd"}, + ] + + +@pytest.mark.parametrize("spelling", ["input_schema", "inputSchema"]) +def test_a_declaration_schema_in_any_spelling_is_named_parameters(spelling: str) -> None: + tools = [{"function_declarations": [{"name": "a", spelling: _PARAMETERS}]}] + assert semconv_tool_definitions(tools, "gcp.gemini") == [ + {"type": "function", "name": "a", "parameters": _PARAMETERS} + ] + + +def test_a_nameless_declaration_takes_the_single_tool_rule() -> None: + tools = [{"function_declarations": [{"type": "web_search"}]}] + assert semconv_tool_definitions(tools, "gcp.gemini") == [{"type": "gcp.gemini.web_search"}] + + +def test_the_rest_of_a_gemini_tool_takes_the_single_tool_rule() -> None: + tools = [{"function_declarations": [{"name": "a"}], "name": "x"}] + assert semconv_tool_definitions(tools, "gcp.gemini") == [ + {"type": "function", "name": "a"}, + {"type": "function", "name": "x"}, + ] + + +def test_a_nested_function_is_not_lifted_over_a_top_level_name() -> None: + named = {"name": "x", "function": {"name": "y"}} + typed = {"type": "function", "name": "x", "function": {"name": "y"}} + assert semconv_tool_definitions([named, typed], "openai") == [ + {"type": "function", "name": "x", "function": {"name": "y"}}, + typed, + ] + + +def test_a_null_parameters_gives_way_to_a_schema_spelling() -> None: + # A Python model_dump() of a google-genai FunctionDeclaration. + tools = [ + { + "function_declarations": [ + {"name": "f", "parameters": None, "parameters_json_schema": _PARAMETERS} + ] + }, + {"name": "g", "parameters": None, "input_schema": _PARAMETERS}, + ] + assert semconv_tool_definitions(tools, "gcp.gemini") == [ + {"type": "function", "name": "f", "parameters": _PARAMETERS}, + {"type": "function", "name": "g", "parameters": _PARAMETERS}, + ] + + +def test_a_null_parameters_without_another_schema_is_kept() -> None: + tool = {"type": "function", "name": "f", "parameters": None} + assert semconv_tool_definitions([tool], "openai") == [tool] + + +def test_an_empty_type_gets_no_provider_prefix() -> None: + tool = {"type": "", "size": 1} + assert semconv_tool_definitions([tool], "openai") == [tool] + + +def test_mcp_tool_headers_are_dropped() -> None: + # OpenAI Responses' MCP tool carries the server's request headers, which + # can hold an Authorization credential. + tool = { + "type": "mcp", + "server_label": "docs", + "server_url": "https://mcp.example.com", + "headers": {"Authorization": "Bearer secret"}, + "require_approval": "never", + } + assert semconv_tool_definitions([tool], "openai") == [ + { + "type": "openai.mcp", + "server_label": "docs", + "server_url": "https://mcp.example.com", + "require_approval": "never", + } + ] + namespaced = {"type": "openai.mcp", "server_label": "docs", "headers": {"X-Key": "k"}} + assert semconv_tool_definitions([namespaced], None) == [ + {"type": "openai.mcp", "server_label": "docs"} + ] + assert semconv_tool_definitions([{"type": "mcp", "headers": {}}], None) == [{"type": "mcp"}] + + +@pytest.mark.parametrize("kind", ["mcp", "openai.mcp", "azure.mcp"]) +def test_mcp_tool_authorization_is_dropped_with_its_headers(kind: str) -> None: + # OpenAI's MCP tool also carries `authorization`, an OAuth access token + # for the remote server or connector. + tool = { + "type": kind, + "server_label": "gh", + "connector_id": "connector_gmail", + "authorization": "ya29.token", + "headers": {"Authorization": "Bearer secret"}, + } + once = semconv_tool_definitions([tool], "openai") + assert once == [ + { + "type": "openai.mcp" if kind == "mcp" else kind, + "server_label": "gh", + "connector_id": "connector_gmail", + } + ] + assert semconv_tool_definitions(once, "openai") == once + + +def test_a_vercel_mcp_provider_tool_loses_its_credentials() -> None: + # The Vercel AI SDK's id becomes the type: once it reads `*.mcp`, the + # credentials go, as they would on a second pass. + tool = {"type": "provider", "id": "openai.mcp", "name": "mcp", "authorization": "t"} + once = semconv_tool_definitions([tool], None) + assert once == [{"type": "openai.mcp", "id": "openai.mcp", "name": "mcp"}] + assert semconv_tool_definitions(once, None) == once + + +def test_other_tools_keep_an_authorization_member() -> None: + tool = {"type": "web_search", "authorization": "kept"} + assert semconv_tool_definitions([tool], "openai") == [ + {"type": "openai.web_search", "authorization": "kept"} + ] + + +def test_chat_completions_custom_tool_is_lifted_and_stays_custom() -> None: + # Chat Completions nests a custom tool's fields under `custom`; they are + # lifted as `function`'s are, and the tool stays a provider tool. + tool = { + "type": "custom", + "custom": {"name": "code_exec", "description": "Runs code", "format": {"type": "text"}}, + } + once = semconv_tool_definitions([tool], "openai") + assert once == [ + { + "type": "openai.custom", + "name": "code_exec", + "description": "Runs code", + "format": {"type": "text"}, + } + ] + assert semconv_tool_definitions(once, "openai") == once + + +def test_a_nested_custom_is_not_lifted_over_a_top_level_name() -> None: + tool = {"type": "custom", "name": "x", "custom": {"name": "y"}} + assert semconv_tool_definitions([tool], "openai") == [ + {"type": "openai.custom", "name": "x", "custom": {"name": "y"}} + ] + + +def test_a_lifted_custom_tool_with_an_input_schema_is_a_function() -> None: + # Anthropic's custom tool rule applies to the lifted tool too, so the + # output is the same whether or not the provider prefixed it. + tool = {"type": "custom", "custom": {"name": "f", "input_schema": _PARAMETERS}} + for provider in ("anthropic", None): + once = semconv_tool_definitions([tool], provider) + assert once == [{"type": "function", "name": "f", "parameters": _PARAMETERS}] + assert semconv_tool_definitions(once, provider) == once + + +@pytest.mark.parametrize( + "tool", + [ + {"name": ""}, + {"name": "", "input_schema": _PARAMETERS}, + {"type": "custom", "name": "", "input_schema": _PARAMETERS}, + {"toolSpec": {"name": "", "inputSchema": {"json": _PARAMETERS}}}, + ], +) +def test_an_empty_name_is_no_name(tool: dict[str, Any]) -> None: + # As for tool calls, an empty name is a missing one: no function tool + # with an empty name is made. + once = semconv_tool_definitions([tool], None) + assert once == [tool] + assert semconv_tool_definitions(once, None) == once + + +def test_a_gemini_declaration_with_an_empty_name_is_not_a_function() -> None: + tools = [{"function_declarations": [{"name": "", "description": "d"}]}] + assert semconv_tool_definitions(tools, "gcp.gemini") == [{"name": "", "description": "d"}] + + +def test_a_nested_function_is_lifted_over_an_empty_top_level_name() -> None: + tool = {"type": "function", "name": "", "function": {"name": "f"}} + assert semconv_tool_definitions([tool], "openai") == [{"type": "function", "name": "f"}] + + +def test_a_vercel_mcp_provider_tool_loses_the_credentials_in_its_args() -> None: + # The AI SDK's openai.mcp tool carries the request's credentials in args. + tool = { + "type": "provider", + "id": "openai.mcp", + "name": "mcp", + "args": { + "serverLabel": "docs", + "serverUrl": "https://mcp.example.com", + "authorization": "token", + "headers": {"Authorization": "Bearer secret"}, + "requireApproval": "never", + }, + } + once = semconv_tool_definitions([tool], None) + assert once == [ + { + "type": "openai.mcp", + "id": "openai.mcp", + "name": "mcp", + "args": { + "serverLabel": "docs", + "serverUrl": "https://mcp.example.com", + "requireApproval": "never", + }, + } + ] + assert semconv_tool_definitions(once, None) == once + + +def test_other_tools_keep_the_credentials_in_their_args() -> None: + tool = {"type": "provider", "id": "openai.web_search", "args": {"authorization": "kept"}} + assert semconv_tool_definitions([tool], None) == [{**tool, "type": "openai.web_search"}] From e46f3d100801a87dd756dab5bea36b0cc959f30f Mon Sep 17 00:00:00 2001 From: Pablo <39369995+PabloPardoGarcia@users.noreply.github.com> Date: Tue, 17 Nov 2026 00:10:03 +0100 Subject: [PATCH 30/40] perf: step over JSON strings in the media rebuild walk instead of decoding them (#291) --- src/rius/_media.py | 35 ++- tests/test_media_rebuild_walk.py | 371 +++++++++++++++++++++++++++++++ 2 files changed, 403 insertions(+), 3 deletions(-) create mode 100644 tests/test_media_rebuild_walk.py diff --git a/src/rius/_media.py b/src/rius/_media.py index 099cc0e..83ec6b9 100644 --- a/src/rius/_media.py +++ b/src/rius/_media.py @@ -1544,14 +1544,41 @@ class _Open: spans: list[tuple[int, int]] | None = None +#: The standard decoder's string scanner (C where available): from the index +#: after a string's opening quote, its decoded value and the index past its +#: closing quote. Strict, so CPython's C scanner accepts exactly the strings +#: ``_Parser`` does. The pure-Python fallback is laxer on ``\u`` escapes. +_scanstring: Callable[[str, int, bool], tuple[str, int]] = json.decoder.scanstring # type: ignore[attr-defined] + + +def _scan_string(scan: _Parser) -> str: + """The string at ``scan.i``, decoded; ``scan.i`` moves past it. + + No segment map and no per-escape object, unlike ``_Parser.string``: the + walk reads strings only as keys, and steps over every other one, so its + cost stays linear in the text however many escapes a string holds.""" + if scan.peek() != '"': + raise _NotJson("expected '\"'") + try: + value, scan.i = _scanstring(scan.text, scan.i + 1, True) + except ValueError as error: + raise _NotJson("bad string") from error + return value + + def _key(scan: _Parser) -> str: """An object member's key and its colon, up to its value.""" + plain = _MEMBER_KEY.match(scan.text, scan.i) + if plain is not None: + # The commonest key, with no escape: the key, its colon and the space in one match. + scan.i = plain.end() + return plain.group(1) scan.space() - key = scan.string().value + key = _scan_string(scan) scan.space() scan.expect(":") scan.space() - return str(key) + return key def _role(stack: list[_Open], parts_only: bool) -> str: @@ -1600,8 +1627,10 @@ def _part_spans(text: str, parts_only: bool) -> list[tuple[int, int]]: continue scan.i += 1 scan.depth -= 1 + elif ch == '"': + _scan_string(scan) # stepped over: a part's members are read from its span else: - scan.value() # a string, number or literal: never nests + scan.value() # a number or literal: never nests # The value from start to scan.i is done: hand it to its parents. while True: if not stack: diff --git a/tests/test_media_rebuild_walk.py b/tests/test_media_rebuild_walk.py new file mode 100644 index 0000000..cbe0ac5 --- /dev/null +++ b/tests/test_media_rebuild_walk.py @@ -0,0 +1,371 @@ +"""The media rebuild's walk over a messages value: its cost on large values, +and its output against a frozen copy of the walk it replaced. + +The walk finds the part spans of a messages value without decoding the +strings it only steps over, so a value of many MB costs time and memory in +proportion to its size. It must give exactly what the decoding walk gave, for +every input: the rebuilt value is byte-identical across SDKs. +""" + +from __future__ import annotations + +import functools +import json +import random +import time +import timeit +import tracemalloc +from typing import Any + +import pytest +from opentelemetry.sdk.trace import ReadableSpan +from opentelemetry.sdk.trace.export.in_memory_span_exporter import InMemorySpanExporter +from opentelemetry.trace import SpanContext + +from rius import _media +from rius._media import MESSAGE_MAX_DEPTH, _NotJson, _Open, _Parser, _part_edit, _role +from rius.normalization import NormalizingSpanExporter +from rius.semconv import GEN_AI_INPUT_MESSAGES + +# --- frozen copy --------------------------------------------------------------- + + +def plain_key(scan: _Parser) -> str: + scan.space() + key = scan.string().value + scan.space() + scan.expect(":") + scan.space() + return str(key) + + +def plain_part_spans(text: str, parts_only: bool) -> list[tuple[int, int]]: + scan = _Parser(text, 0, MESSAGE_MAX_DEPTH) + stack: list[_Open] = [] + try: + scan.space() + while True: + role = _role(stack, parts_only) + start = scan.i + ch = scan.peek() + node: _Open | None = None + if ch == "{" or ch == "[": + node = _Open(ch == "{", role, start, spans=[]) + close = "}" if node.is_object else "]" + scan.i += 1 + scan.enter() + scan.space() + if scan.peek() != close: + if node.is_object: + node.key = plain_key(scan) + stack.append(node) + continue + scan.i += 1 + scan.depth -= 1 + else: + scan.value() + while True: + if not stack: + scan.space() + if scan.i != len(text): + return [] + return node.spans or [] if node is not None and node.role == "root" else [] + parent = stack[-1] + if role == "part" and node is not None and node.is_object: + assert parent.spans is not None + parent.spans.append((start, scan.i)) + elif role == "parts": + parent.spans = node.spans if node is not None and not node.is_object else [] + elif role == "message" and node is not None and node.is_object: + assert parent.spans is not None and node.spans is not None + parent.spans.extend(node.spans) + scan.space() + if scan.peek() == ",": + scan.i += 1 + scan.space() + if parent.is_object: + parent.key = plain_key(scan) + break + scan.expect("}" if parent.is_object else "]") + scan.depth -= 1 + node = stack.pop() + role, start = node.role, node.start + except _NotJson: + return [] + + +def plain_rebuild_native_parts(text: str, *, parts_only: bool) -> str: + if '"blob"' not in text and '"uri"' not in text and '"file"' not in text and "\\" not in text: + return text + out, last = [], 0 + for start, end in plain_part_spans(text, parts_only): + encoded = _part_edit(text[start:end]) + if encoded is not None: + out += [text[last:start], encoded] + last = end + if not out: + return text + out.append(text[last:]) + return "".join(out) + + +# --- generated inputs ---------------------------------------------------------- + +_WS = ("", "", " ", "\n", "\t", "\r\n ") +_STRINGS = ( + "", + "text", + "ab\n", + 'q"uote', + "back\\slash", + "\x01ctl", + "é", + "😀", + "\ud800", + "\udfff", + "😀", + "/", + "blob", + "uri", + "file", + "parts", + "image/png", + "data:image/png;base64,iVBORw0KGgo=", + "https://x.test/a.png", +) +_KEYS = ( + "type", + "parts", + "role", + "content", + "mime_type", + "mimeType", + "modality", + "uri", + "file_id", + "byte_size", + "base64", + "url", + "stripped_reason", + "x", +) +_TYPES = ("text", "blob", "uri", "file", "image", "tool_call", "") + + +def _string(rng: random.Random) -> str: + if rng.random() < 0.3: + return "".join(rng.choice(_STRINGS) for _ in range(rng.randint(1, 4))) + return rng.choice(_STRINGS) + + +def _part(rng: random.Random, depth: int) -> Any: + kind = rng.choice(_TYPES) + part: dict[str, Any] = {"type": kind} + if kind == "blob": + part["mime_type"] = rng.choice(("image/png", "audio/wav", "x", None, 3)) + part["content"] = rng.choice(("iVBORw0KGgo=", "", None, "data:image/png;base64,AAAA")) + if rng.random() < 0.3: + part["modality"] = rng.choice(("image", "audio", "video")) + elif kind == "uri": + part["uri"] = rng.choice(("https://x.test/a.png", "data:image/png;base64,AAAA", 7)) + part["mime_type"] = rng.choice(("image/png", "x")) + elif kind == "file": + if rng.random() < 0.5: + part["file_id"] = "file-1" + else: + part[rng.choice(("base64", "url"))] = "AAAA" + part["mime_type"] = "application/pdf" + for _ in range(rng.randint(0, 3)): + part[rng.choice(_KEYS)] = _leaf(rng, depth + 1) + return part + + +def _leaf(rng: random.Random, depth: int) -> Any: + r = rng.random() + if r < 0.45 or depth > 4: + return rng.choice((_string(rng), 0, -1.5e3, True, False, None)) + if r < 0.7: + return [_leaf(rng, depth + 1) for _ in range(rng.randint(0, 3))] + return {rng.choice(_KEYS): _leaf(rng, depth + 1) for _ in range(rng.randint(0, 3))} + + +def _messages(rng: random.Random, parts_only: bool) -> Any: + if parts_only: + return [_part(rng, 0) if rng.random() < 0.85 else _leaf(rng, 1) for _ in range(3)] + messages: list[Any] = [] + for _ in range(rng.randint(0, 3)): + if rng.random() < 0.1: + messages.append(_leaf(rng, 1)) + continue + message: dict[str, Any] = {"role": rng.choice(("user", "assistant"))} + message["parts"] = [_part(rng, 2) for _ in range(rng.randint(0, 3))] + if rng.random() < 0.15: + message["x"] = _leaf(rng, 1) + messages.append(message) + return messages + + +def _spaced(text: str, rng: random.Random) -> str: + """The JSON text with space put around its structural characters.""" + out: list[str] = [] + in_string = escaped = False + for ch in text: + out.append(ch) + if in_string: + if escaped: + escaped = False + elif ch == "\\": + escaped = True + elif ch == '"': + in_string = False + elif ch == '"': + in_string = True + elif ch in "{}[],:" and rng.random() < 0.3: + out.append(rng.choice(_WS)) + return "".join(out) + + +_ESCAPED_SPELLINGS = ( + ('"parts"', '"p\\u0061rts"'), + ('"type"', '"t\\u0079pe"'), + ('"blob"', '"bl\\u006fb"'), + ('"uri"', '"\\u0075ri"'), + ('"file"', '"fil\\u0065"'), + ('"mime_type"', '"mime\\u005ftype"'), + ('"role"', '"r\\u006fle"'), +) +_BREAKAGE = ( + ('"text"', '"te\\xt"'), + ('"text"', '"te\x01xt"'), + ('"text"', '"te\\u12"'), + ('"text"', '"te\\u12G4"'), + ('"text"', '"\\ud800\\u12"'), + ('"text"', '"\\ud800\\uZZZZ"'), + ("}", "}}"), + (",", ",,"), + (":", "::"), + ("null", "nul"), + ("[", "[["), + ('"', ""), +) + + +def _text(rng: random.Random, parts_only: bool) -> str: + value = _messages(rng, parts_only) + text = json.dumps(value, ensure_ascii=rng.random() < 0.3) + if rng.random() < 0.5: + text = _spaced(text, rng) + if rng.random() < 0.3: + old, new = rng.choice(_ESCAPED_SPELLINGS) + text = text.replace(old, new, rng.choice((1, -1))) + if rng.random() < 0.15: + old, new = rng.choice(_BREAKAGE) + text = text.replace(old, new, 1) + if rng.random() < 0.05 and text: + text = text[: rng.randrange(len(text))] + if rng.random() < 0.05: + text = rng.choice(_WS) + text + rng.choice((" ", "x", "\n")) + return text + + +@pytest.mark.parametrize("parts_only", [False, True]) +def test_the_part_spans_match_the_decoding_walk(parts_only: bool) -> None: + rng = random.Random(1888 + parts_only) + found = 0 + for _ in range(6000): + text = _text(rng, parts_only) + spans = _media._part_spans(text, parts_only) + assert spans == plain_part_spans(text, parts_only), text + found += bool(spans) + # The generator reaches values with parts, not only broken ones. + assert found > 1000 + + +@pytest.mark.parametrize("parts_only", [False, True]) +def test_the_rebuild_matches_the_decoding_walk(parts_only: bool) -> None: + rng = random.Random(8881 + parts_only) + changed = 0 + for _ in range(6000): + text = _text(rng, parts_only) + rebuilt = _media.rebuild_native_parts(text, parts_only=parts_only) + assert rebuilt == plain_rebuild_native_parts(text, parts_only=parts_only), text + changed += rebuilt != text + assert changed > 500 + + +def test_the_walk_still_stops_at_its_depth() -> None: + deep = "[" * MESSAGE_MAX_DEPTH + "]" * MESSAGE_MAX_DEPTH + assert _media._part_spans(deep, False) == plain_part_spans(deep, False) == [] + too_deep = "[" + deep + "]" + assert _media._part_spans(too_deep, False) == [] + + +# --- cost on large values ------------------------------------------------------ + + +@functools.cache +def _one_large_part() -> list[dict[str, Any]]: + """30 MB of escape-heavy text in one part: each "\\n" is an escape in the + JSON text. The decoding walk took several seconds and GBs of memory on it. + Built on first use, so runs that deselect the cost tests do not pay for it.""" + return [{"role": "user", "parts": [{"type": "text", "content": "ab\n" * 10_000_000}]}] + + +@functools.cache +def _many_parts() -> list[dict[str, Any]]: + return [ + { + "role": "user", + "parts": [{"type": "text", "content": "ab\n" * 30} for _ in range(100_000)], + } + ] + + +def _export(value: Any) -> dict[str, Any]: + context = SpanContext(trace_id=1, span_id=2, is_remote=False) + span = ReadableSpan(name="chat", context=context, attributes={GEN_AI_INPUT_MESSAGES: value}) + sink = InMemorySpanExporter() + NormalizingSpanExporter(sink).export([span]) + [out] = sink.get_finished_spans() + return dict(out.attributes or {}) + + +def _cost(value: Any) -> tuple[float, int]: + """Seconds to export ``value`` (untraced), and the peak of the memory the + export allocated (traced, so not timed).""" + _export([{"role": "user", "parts": [{"type": "text", "content": "ab\n"}]}]) # warm imports + started = time.perf_counter() + _export(value) + seconds = time.perf_counter() - started + tracemalloc.start() + try: + _export(value) + _, peak = tracemalloc.get_traced_memory() + finally: + tracemalloc.stop() + return seconds, peak + + +@pytest.mark.parametrize("form", ["json-string", "structured"]) +def test_a_large_escaped_value_exports_in_linear_time_and_memory(form: str) -> None: + value = _one_large_part() + attribute = json.dumps(value) if form == "json-string" else value + seconds, peak = _cost(attribute) + # Bounds well clear of the linear walk (under a second, under three times + # the text) and of the decoding one (several seconds, about sixty times + # the text), so a slow CI runner does not flake. + assert seconds < 3.0 + assert peak < 6 * len(json.dumps(value)) + + +def test_the_walk_over_many_escaped_parts_is_faster_than_the_decoding_walk() -> None: + # Against the frozen copy on the same machine, so a slow runner slows + # both: the walk measured about five times faster. The best of several + # runs of each, against a 2x bound, so one GC pause or preemption on a + # shared runner does not flake it. + text = json.dumps(_many_parts()) + + def seconds(walk: Any) -> float: + return min(timeit.repeat(lambda: walk(text, False), number=1, repeat=5)) + + assert seconds(_media._part_spans) * 2 < seconds(plain_part_spans) From db59afcaaff08ee40b6d2a0079badc022be860a5 Mon Sep 17 00:00:00 2001 From: Pablo <39369995+PabloPardoGarcia@users.noreply.github.com> Date: Tue, 17 Nov 2026 09:57:50 +0100 Subject: [PATCH 31/40] fix: cover langchain 0.1.87, llama-index 4.7.7 and anthropic 3.3.6 in the newest-instrumentor checks (#294) --- src/rius/langchain_span_context.py | 2 +- src/rius/llama_index_span_context.py | 2 ++ src/rius/normalization.py | 14 ++++++++++- tests/test_langchain_span_context.py | 3 ++- tests/test_llama_index_span_context.py | 20 +++++++++++++++- tests/test_normalization_tools.py | 33 ++++++++++++++++++++++++++ 6 files changed, 70 insertions(+), 4 deletions(-) diff --git a/src/rius/langchain_span_context.py b/src/rius/langchain_span_context.py index 4b2b803..c607aa4 100644 --- a/src/rius/langchain_span_context.py +++ b/src/rius/langchain_span_context.py @@ -63,7 +63,7 @@ #: The instrumentor releases whose tracer internals were read and found as #: this module expects. A later release may have reshaped them; it is left #: alone. -VERIFIED_VERSIONS = ("0.1.67", "0.1.86") +VERIFIED_VERSIONS = ("0.1.67", "0.1.87") #: The instrumentor's tracer the hooks look spans up in. Set by install(). _tracer: Any = None diff --git a/src/rius/llama_index_span_context.py b/src/rius/llama_index_span_context.py index 7cda030..f9df620 100644 --- a/src/rius/llama_index_span_context.py +++ b/src/rius/llama_index_span_context.py @@ -95,6 +95,8 @@ #: The instrumentor releases whose span handling was read and found as this #: module expects. A later release may have reshaped it; it is left alone. +#: From 4.7.7 the instrumentor runs each step of a streamed call with its span +#: current by itself, so the range ends at 4.7.6 for good. VERIFIED_VERSIONS = ("4.4.3", "4.7.6") #: The methods whose result is a stream that makes the provider request later. diff --git a/src/rius/normalization.py b/src/rius/normalization.py index 2a6d541..a1da18c 100644 --- a/src/rius/normalization.py +++ b/src/rius/normalization.py @@ -575,6 +575,11 @@ def error_type_from_exception_event(span: ReadableSpan) -> dict[str, Any]: #: keys, not one key), so it is spelled here. _LLM_TOOL_SCHEMA = re.compile(r"llm\.tools\.(\d+)\.tool\.json_schema") +#: The members of a tool the anthropic instrumentor (3.3.6 on) also writes on +#: their own beside its schema, as ``llm.tools.{i}.tool.``. Copies of +#: the schema's own fields, so they go wherever the schema goes. +_LLM_TOOL_SCHEMA_COPIES = ("name", "description") + def normalize_tool_definitions(attributes: Mapping[str, Any] | None) -> dict[str, Any] | None: """Reassemble a span's tool definitions into one ``gen_ai.tool.definitions``. @@ -594,7 +599,9 @@ def normalize_tool_definitions(attributes: Mapping[str, Any] | None) -> dict[str parsed and re-serialized as one array, in index order, in the conventions' shape, as on the native ``set_tool_definitions`` (see ``_tool_definitions``; a built-in tool's type is prefixed with the - span's ``gen_ai.provider.name``). The indexed keys are then deleted. + span's ``gen_ai.provider.name``). The indexed keys are then deleted, + with the ``llm.tools.N.tool.name`` and ``.description`` copies some + instrumentors write beside a schema. If any one schema does not parse, the family is left untouched rather than reassembled without it: it is content by prefix already, so nothing escapes, and a partial array would be a silent loss. @@ -634,6 +641,11 @@ def normalize_tool_definitions(attributes: Mapping[str, Any] | None) -> dict[str return None schemas.append(schema) drop = set(indexed.values()) + drop.update( + f"llm.tools.{index}.tool.{member}" + for index in indexed + for member in _LLM_TOOL_SCHEMA_COPIES + ) rebuilt = {k: v for k, v in attributes.items() if k not in drop} # litellm and langchain write the same definitions into the request # bag as well. They are duplicates of the ones just reassembled, and diff --git a/tests/test_langchain_span_context.py b/tests/test_langchain_span_context.py index 220b8c7..69940af 100644 --- a/tests/test_langchain_span_context.py +++ b/tests/test_langchain_span_context.py @@ -501,7 +501,8 @@ def test_uninstall_restores_the_hooked_classes(openai_answers: None) -> None: ("0.1.81", True), ("0.1.85", True), ("0.1.86", True), - ("0.1.87", False), + ("0.1.87", True), + ("0.1.88", False), ("0.2.0", False), ], ) diff --git a/tests/test_llama_index_span_context.py b/tests/test_llama_index_span_context.py index 41555ef..89055e6 100644 --- a/tests/test_llama_index_span_context.py +++ b/tests/test_llama_index_span_context.py @@ -17,6 +17,7 @@ import threading from collections.abc import AsyncIterator, Iterator from concurrent.futures import ThreadPoolExecutor +from importlib.metadata import version from typing import Any import pytest @@ -42,6 +43,15 @@ LlamaIndexInstrumentor = llama_index_instrumentation.LlamaIndexInstrumentor OpenAIInstrumentor = openai_instrumentation.OpenAIInstrumentor + +#: The stopgap installs only on the verified releases. From 4.7.7 the +#: instrumentor nests streamed calls by itself and the stopgap stays out, so +#: the tests of how it installs and uninstalls have nothing to look at there. +installs = pytest.mark.skipif( + not _verified(version("openinference-instrumentation-llama-index")), + reason="the stopgap stays out of releases past the verified ones (4.7.7 nests by itself)", +) + CHAT = "https://api.openai.com/v1/chat/completions" USAGE = {"prompt_tokens": 42, "completion_tokens": 9, "total_tokens": 51} MESSAGES = [ChatMessage(role="user", content="Capital of France?")] @@ -502,6 +512,7 @@ def stream_chat(self, messages: Any, **kwargs: Any) -> Any: assert names[provider.parent.span_id] == "LaterOpenAI.stream_chat" +@installs def test_the_subclass_hook_still_runs_an_ancestors_hook( openai_answers: Answers, monkeypatch: pytest.MonkeyPatch ) -> None: @@ -558,6 +569,7 @@ def _stream_methods() -> dict[str, Any]: return {name: OpenAI.__dict__[name] for name in llama_index_span_context._STREAM_METHODS} +@installs def test_reinit_does_not_stack_hooks(openai_answers: Answers) -> None: for _ in range(2): client = init( @@ -587,6 +599,7 @@ def test_reinit_does_not_stack_hooks(openai_answers: Answers) -> None: assert len(ours) == 1 +@installs def test_installing_twice_does_not_stack(openai_answers: Answers) -> None: instrumentor = LlamaIndexInstrumentor() instrumentor.instrument() @@ -601,6 +614,7 @@ def test_installing_twice_does_not_stack(openai_answers: Answers) -> None: instrumentor.uninstrument() +@installs def test_our_handler_runs_after_the_instrumentors_after_a_reinstrument( openai_answers: Answers, ) -> None: @@ -622,6 +636,7 @@ def test_our_handler_runs_after_the_instrumentors_after_a_reinstrument( instrumentor.uninstrument() +@installs def test_uninstall_restores_everything(openai_answers: Answers) -> None: originals = _stream_methods() hook = BaseLLM.__dict__.get("__pydantic_init_subclass__") @@ -669,11 +684,13 @@ def test_an_unverified_version_installs_nothing( openai_answers: Answers, monkeypatch: pytest.MonkeyPatch ) -> None: monkeypatch.setattr(llama_index_span_context, "version", lambda name: "9.9.9") - originals = _stream_methods() handlers = list(get_dispatcher().span_handlers) instrumentor = LlamaIndexInstrumentor() instrumentor.instrument() try: + # Taken after instrument(): from 4.7.7 the instrumentor wraps the + # stream methods itself. + originals = _stream_methods() assert not llama_index_span_context.install(instrumentor) assert _stream_methods() == originals assert [h for h in get_dispatcher().span_handlers if h not in handlers] == [ @@ -818,6 +835,7 @@ def stream() -> Iterator[int]: assert handler.take_stream_span(result) is None +@installs def test_uninstall_keeps_a_busy_handler_until_its_call_ends( openai_answers: Answers, ) -> None: diff --git a/tests/test_normalization_tools.py b/tests/test_normalization_tools.py index c3a0e98..f45f565 100644 --- a/tests/test_normalization_tools.py +++ b/tests/test_normalization_tools.py @@ -194,6 +194,39 @@ def test_an_unparseable_schema_leaves_the_whole_family_alone() -> None: assert normalize_tool_definitions(attributes) is None +def test_a_tools_name_and_description_go_with_its_schema() -> None: + # The anthropic instrumentor (3.3.6 on) writes each tool's name and + # description beside its schema. They are copies of the schema's own + # fields, so they leave with it rather than ride next to the definitions. + attributes = { + **_indexed(_ANTHROPIC_TOOLS), + "llm.tools.0.tool.name": "get_weather", + "llm.tools.0.tool.description": "Weather for a city", + } + out = normalize_tool_definitions(attributes) + assert out is not None + assert _definitions(out) == _ANTHROPIC_SEMCONV + assert not [key for key in out if key.startswith("llm.tools")] + + +def test_a_name_without_a_schema_is_not_touched() -> None: + # Only the copies of a reassembled schema go: a name at an index with no + # schema is nothing the definitions hold. + attributes = {**_indexed([{"name": "a"}]), "llm.tools.1.tool.name": "b"} + out = normalize_tool_definitions(attributes) + assert out is not None + assert out["llm.tools.1.tool.name"] == "b" + + +def test_an_unparseable_schema_leaves_the_name_and_description_too() -> None: + attributes = { + "llm.tools.0.tool.json_schema": "{not json", + "llm.tools.0.tool.name": "ok", + "llm.tools.0.tool.description": "fine", + } + assert normalize_tool_definitions(attributes) is None + + def test_other_keys_under_llm_tools_are_not_touched() -> None: attributes = {**_indexed([{"name": "a"}]), "llm.tools.0.tool.something_else": "x"} out = normalize_tool_definitions(attributes) From 5741a2afa8dbcdaaef331ca150369ef247112f98 Mon Sep 17 00:00:00 2001 From: Pablo <39369995+PabloPardoGarcia@users.noreply.github.com> Date: Tue, 17 Nov 2026 10:00:33 +0100 Subject: [PATCH 32/40] fix: map LiteLLM's ollama_chat provider to the registry's ollama (#292) --- src/rius/normalization.py | 2 ++ tests/test_normalization_openinference.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/rius/normalization.py b/src/rius/normalization.py index a1da18c..6ba35b2 100644 --- a/src/rius/normalization.py +++ b/src/rius/normalization.py @@ -1653,6 +1653,8 @@ def shutdown(self) -> None: "gemini": "gcp.gemini", "az.ai.inference": "azure.ai.inference", "az.ai.openai": "azure.ai.openai", + # LiteLLM's route for Ollama's chat endpoint + "ollama_chat": "ollama", # the registry's own former spellings **PROVIDER_NAME_RENAMES, } diff --git a/tests/test_normalization_openinference.py b/tests/test_normalization_openinference.py index b20de62..36e0f13 100644 --- a/tests/test_normalization_openinference.py +++ b/tests/test_normalization_openinference.py @@ -284,6 +284,8 @@ def test_an_unparseable_token_count_maps_to_nothing() -> None: ("aws", "aws"), ("google", "google"), ("ollama", "ollama"), + # LiteLLM's route for Ollama's chat endpoint + ("ollama_chat", "ollama"), ], ) def test_provider_spellings(source_value: str, expected: str) -> None: @@ -524,6 +526,7 @@ def test_no_provider_without_a_named_ls_provider(metadata: str) -> None: # compared under the registry's spelling ("vertex_ai", "vertex_ai/gemini-2.5-flash", "gemini-2.5-flash"), ("mistralai", "mistral/mistral-small-latest", "mistral-small-latest"), + ("ollama_chat", "ollama_chat/llama3.2", "llama3.2"), # a prefix naming anyone else is part of the name ("openai", "openai/google/gemini-2.5-flash", "google/gemini-2.5-flash"), ("openai", "google/gemini-2.5-flash", "google/gemini-2.5-flash"), From 4df9784a1f2045bb34571fa0ca2b7d2f592c1b84 Mon Sep 17 00:00:00 2001 From: Pablo <39369995+PabloPardoGarcia@users.noreply.github.com> Date: Tue, 17 Nov 2026 10:03:12 +0100 Subject: [PATCH 33/40] fix: require openinference-instrumentation-anthropic 3.1.1 (#293) --- README.md | 2 +- pyproject.toml | 4 ++-- tests/test_anthropic_native_span.py | 8 ++++---- uv.lock | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 38791cc..3e994e7 100644 --- a/README.md +++ b/README.md @@ -259,7 +259,7 @@ which it already is in any project that calls Anthropic. When an instrumentation's library is missing or too old, `init()` logs a warning naming the version it needs and leaves that one integration off. For example, `openinference-instrumentation-anthropic` 3.x needs `anthropic>=1.8.0`; with -an older `anthropic`, upgrade it or keep the instrumentation on 2.x. +an older `anthropic`, upgrade it. ```python rius.init() # auto-enables installed instrumentors diff --git a/pyproject.toml b/pyproject.toml index 83c70ff..188ed97 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,13 +57,13 @@ dependencies = [ # installed `mcp` would be the one place the SDK added a runtime library to a # user's environment, which is exactly what the rule above exists to prevent. openai = ["openinference-instrumentation-openai>=0.1.52"] -anthropic = ["openinference-instrumentation-anthropic>=2.1.0"] +anthropic = ["openinference-instrumentation-anthropic>=3.1.1"] langchain = ["openinference-instrumentation-langchain>=0.1.67"] llama-index = ["openinference-instrumentation-llama-index>=4.4.3"] litellm = ["openinference-instrumentation-litellm>=0.1.34"] instruments = [ "openinference-instrumentation-openai>=0.1.52", - "openinference-instrumentation-anthropic>=2.1.0", + "openinference-instrumentation-anthropic>=3.1.1", "openinference-instrumentation-langchain>=0.1.67", "openinference-instrumentation-llama-index>=4.4.3", "openinference-instrumentation-litellm>=0.1.34", diff --git a/tests/test_anthropic_native_span.py b/tests/test_anthropic_native_span.py index 05cf096..a058097 100644 --- a/tests/test_anthropic_native_span.py +++ b/tests/test_anthropic_native_span.py @@ -7,7 +7,7 @@ and cost counted twice, a second ``error.type`` spelled ``not_found_error``, and an unflagged duplicate after ``mark_compaction()``. When rius registered that instrumentor, the SDK's chat span is exported as a plain client span. -From openinference-instrumentation-anthropic 3.2.0, OpenInference stops the +From openinference-instrumentation-anthropic 3.1.1, OpenInference stops the SDK from starting that chat span at all, so the demotion has nothing to do. These run each scenario in a fresh interpreter (``anthropic_native_span_run.py``): @@ -92,7 +92,7 @@ def _sdk_traces() -> bool: def _openinference_leaves_the_sdk_chat_span() -> bool: """Whether the SDK's chat span still starts beside OpenInference's. - From openinference-instrumentation-anthropic 3.2.0 it does not: OpenInference + From openinference-instrumentation-anthropic 3.1.1 it does not: OpenInference stops the SDK from starting a chat span for a call it traces, so there is nothing to demote. The SDK's tool-runner and other API spans still start. """ @@ -102,7 +102,7 @@ def _openinference_leaves_the_sdk_chat_span() -> bool: _NO_SDK_TRACING = "this anthropic has no tracing of its own (it starts in 1.14.0)" _SDK_CHAT_SPAN_LEFT = "this OpenInference leaves the SDK's chat span; the demotion tests cover it" _NO_SDK_CHAT_SPAN = ( - "OpenInference stops the SDK's chat span (3.2.0 on): nothing to demote; " + "OpenInference stops the SDK's chat span (3.1.1 on): nothing to demote; " "see test_openinference_that_stops_the_sdk_chat_span_leaves_one_llm_span" ) @@ -314,7 +314,7 @@ def test_bridged_to_another_sdk_each_call_still_counts_once(case: str) -> None: @pytest.mark.integration @pytest.mark.parametrize("case", [*_CASES, "compaction", "rate_limited"]) def test_openinference_that_stops_the_sdk_chat_span_leaves_one_llm_span(case: str) -> None: - # The SDK traces on its own, but OpenInference (3.2.0 on) keeps it from + # The SDK traces on its own, but OpenInference (3.1.1 on) keeps it from # starting a chat span for the calls it traces: no duplicate to demote. if not _sdk_traces(): pytest.skip(_NO_SDK_TRACING) diff --git a/uv.lock b/uv.lock index 4fcd2ff..f0b587a 100644 --- a/uv.lock +++ b/uv.lock @@ -1050,8 +1050,8 @@ dev = [ [package.metadata] requires-dist = [ - { name = "openinference-instrumentation-anthropic", marker = "extra == 'anthropic'", specifier = ">=2.1.0" }, - { name = "openinference-instrumentation-anthropic", marker = "extra == 'instruments'", specifier = ">=2.1.0" }, + { name = "openinference-instrumentation-anthropic", marker = "extra == 'anthropic'", specifier = ">=3.1.1" }, + { name = "openinference-instrumentation-anthropic", marker = "extra == 'instruments'", specifier = ">=3.1.1" }, { name = "openinference-instrumentation-langchain", marker = "extra == 'instruments'", specifier = ">=0.1.67" }, { name = "openinference-instrumentation-langchain", marker = "extra == 'langchain'", specifier = ">=0.1.67" }, { name = "openinference-instrumentation-litellm", marker = "extra == 'instruments'", specifier = ">=0.1.34" }, From c40cdf1327a7b20d9fc1c8da9c630b0ebedce06c Mon Sep 17 00:00:00 2001 From: Pablo <39369995+PabloPardoGarcia@users.noreply.github.com> Date: Tue, 17 Nov 2026 10:07:56 +0100 Subject: [PATCH 34/40] fix: drop the llm.tools copies only when spelled like their schema key, and cover the orphan and native cases (#295) --- src/rius/normalization.py | 7 +++++-- tests/test_normalization_tools.py | 34 +++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/src/rius/normalization.py b/src/rius/normalization.py index 6ba35b2..e6ba373 100644 --- a/src/rius/normalization.py +++ b/src/rius/normalization.py @@ -579,6 +579,7 @@ def error_type_from_exception_event(span: ReadableSpan) -> dict[str, Any]: #: their own beside its schema, as ``llm.tools.{i}.tool.``. Copies of #: the schema's own fields, so they go wherever the schema goes. _LLM_TOOL_SCHEMA_COPIES = ("name", "description") +_LLM_TOOL_SCHEMA_SUFFIX = ".tool.json_schema" def normalize_tool_definitions(attributes: Mapping[str, Any] | None) -> dict[str, Any] | None: @@ -641,9 +642,11 @@ def normalize_tool_definitions(attributes: Mapping[str, Any] | None) -> dict[str return None schemas.append(schema) drop = set(indexed.values()) + # Each copy is spelled from its schema key as written, so a copy + # goes only when its index is spelled exactly like its schema's. drop.update( - f"llm.tools.{index}.tool.{member}" - for index in indexed + f"{key.removesuffix(_LLM_TOOL_SCHEMA_SUFFIX)}.tool.{member}" + for key in indexed.values() for member in _LLM_TOOL_SCHEMA_COPIES ) rebuilt = {k: v for k, v in attributes.items() if k not in drop} diff --git a/tests/test_normalization_tools.py b/tests/test_normalization_tools.py index f45f565..c1208b3 100644 --- a/tests/test_normalization_tools.py +++ b/tests/test_normalization_tools.py @@ -218,6 +218,40 @@ def test_a_name_without_a_schema_is_not_touched() -> None: assert out["llm.tools.1.tool.name"] == "b" +def test_a_description_without_a_schema_is_not_touched() -> None: + attributes = {**_indexed([{"name": "a"}]), "llm.tools.1.tool.description": "orphan"} + out = normalize_tool_definitions(attributes) + assert out is not None + assert out["llm.tools.1.tool.description"] == "orphan" + + +def test_a_native_definitions_key_wins_and_the_name_and_description_still_go() -> None: + attributes = { + GEN_AI_TOOL_DEFINITIONS: '[{"name": "native"}]', + **_indexed(_ANTHROPIC_TOOLS), + "llm.tools.0.tool.name": "get_weather", + "llm.tools.0.tool.description": "Weather for a city", + } + assert normalize_tool_definitions(attributes) == { + GEN_AI_TOOL_DEFINITIONS: '[{"name": "native"}]' + } + + +def test_a_copy_goes_only_when_spelled_like_its_schema_key() -> None: + # The copy key is the schema key as written, so a zero-padded index + # takes its own padded copy and leaves the unpadded one alone. + attributes = { + "llm.tools.01.tool.json_schema": json.dumps({"name": "a"}), + "llm.tools.1.tool.name": "kept", + "llm.tools.01.tool.name": "a", + } + out = normalize_tool_definitions(attributes) + assert out is not None + assert _definitions(out) == [{"type": "function", "name": "a"}] + assert out["llm.tools.1.tool.name"] == "kept" + assert "llm.tools.01.tool.name" not in out + + def test_an_unparseable_schema_leaves_the_name_and_description_too() -> None: attributes = { "llm.tools.0.tool.json_schema": "{not json", From fef9fad818ad5973eb9122f67f11ae1c3f544e14 Mon Sep 17 00:00:00 2001 From: Pablo <39369995+PabloPardoGarcia@users.noreply.github.com> Date: Tue, 17 Nov 2026 12:25:03 +0100 Subject: [PATCH 35/40] fix: retriever spans use OpenTelemetry span kind INTERNAL (#296) --- src/rius/_semconv_generated.py | 16 +++++++++------- tests/test_observe.py | 10 ++++++---- tests/test_semconv.py | 7 ++++--- tests/test_spans.py | 2 +- 4 files changed, 20 insertions(+), 15 deletions(-) diff --git a/src/rius/_semconv_generated.py b/src/rius/_semconv_generated.py index 0db58a3..814fe8f 100644 --- a/src/rius/_semconv_generated.py +++ b/src/rius/_semconv_generated.py @@ -1,4 +1,4 @@ -# Vendored from rius-semconv v1.13.0 out/python/_semconv_generated.py by +# Vendored from rius-semconv v1.13.1 out/python/_semconv_generated.py by # scripts/sync-semconv.sh. Do not edit: change the registry in rius-semconv. """Rius semantic conventions: the constants and tables, generated. @@ -1604,11 +1604,13 @@ class SpanKind(str, Enum): # SpanKind (our taxonomy ATTRIBUTE) -> the OpenTelemetry SpanKind FIELD, set # centrally at span creation. The GenAI conventions decide the field per -# operation: inference, embeddings and retrieval call out of the process -# (CLIENT); execute_tool is INTERNAL; invoke_agent is CLIENT only for a hosted -# agent. Hence: -# - LLM / EMBEDDING / RETRIEVER / RERANKER -> CLIENT: a remote model or -# index is called. +# operation: inference and embeddings call out of the process (CLIENT); +# retrieval and execute_tool are INTERNAL; invoke_agent is CLIENT only for a +# hosted agent. Hence: +# - LLM / EMBEDDING / RERANKER -> CLIENT: a remote model is called. +# - RETRIEVER -> INTERNAL: the conventions deprecated their client retrieval +# span for an internal one, since a retriever wraps embedding, database, +# HTTP or rerank calls that have CLIENT spans of their own. # - TOOL -> INTERNAL: a bare TOOL span is an in-process function, and the # execute-tool convention says INTERNAL. The MCP wrapper overrides this to # CLIENT at its own call site because a tools/call crosses a process @@ -1625,7 +1627,7 @@ class SpanKind(str, Enum): _OTEL_KIND_BY_KIND: dict[SpanKind, str] = { SpanKind.LLM: "CLIENT", SpanKind.EMBEDDING: "CLIENT", - SpanKind.RETRIEVER: "CLIENT", + SpanKind.RETRIEVER: "INTERNAL", SpanKind.RERANKER: "CLIENT", SpanKind.TOOL: "INTERNAL", SpanKind.AGENT: "INTERNAL", diff --git a/tests/test_observe.py b/tests/test_observe.py index f0cdca4..fe3cd92 100644 --- a/tests/test_observe.py +++ b/tests/test_observe.py @@ -439,7 +439,7 @@ def test_non_tool_kind_has_no_gen_ai_tool_name(exported_spans: InMemorySpanExpor [ (SpanKind.LLM, OtelSpanKind.CLIENT), (SpanKind.EMBEDDING, OtelSpanKind.CLIENT), - (SpanKind.RETRIEVER, OtelSpanKind.CLIENT), + (SpanKind.RETRIEVER, OtelSpanKind.INTERNAL), (SpanKind.TOOL, OtelSpanKind.INTERNAL), (SpanKind.AGENT, OtelSpanKind.INTERNAL), (SpanKind.CHAIN, OtelSpanKind.INTERNAL), @@ -461,11 +461,13 @@ def step() -> None: def test_otel_kind_field_follows_taxonomy_on_async_path( exported_spans: InMemorySpanExporter, ) -> None: - @observe(kind=SpanKind.RETRIEVER) - async def search() -> None: + # A CLIENT kind, because INTERNAL is OTel's default and would pass even if + # the async path ignored the taxonomy. + @observe(kind=SpanKind.EMBEDDING) + async def embed() -> None: pass - asyncio.run(search()) + asyncio.run(embed()) assert exported_spans.get_finished_spans()[0].kind is OtelSpanKind.CLIENT diff --git a/tests/test_semconv.py b/tests/test_semconv.py index 1f9773a..e0f9103 100644 --- a/tests/test_semconv.py +++ b/tests/test_semconv.py @@ -44,7 +44,7 @@ def test_set_span_kind_without_operation(exported_spans: InMemorySpanExporter) - [ (SpanKind.LLM, OtelSpanKind.CLIENT), (SpanKind.EMBEDDING, OtelSpanKind.CLIENT), - (SpanKind.RETRIEVER, OtelSpanKind.CLIENT), + (SpanKind.RETRIEVER, OtelSpanKind.INTERNAL), (SpanKind.RERANKER, OtelSpanKind.CLIENT), (SpanKind.TOOL, OtelSpanKind.INTERNAL), (SpanKind.AGENT, OtelSpanKind.INTERNAL), @@ -54,8 +54,9 @@ def test_set_span_kind_without_operation(exported_spans: InMemorySpanExporter) - def test_otel_span_kind_follows_the_genai_conventions( kind: SpanKind, expected: OtelSpanKind ) -> None: - """Inference, embeddings and retrieval cross a process boundary (CLIENT); - an in-process tool, agent or step does not (INTERNAL).""" + """Inference and embeddings cross a process boundary (CLIENT); retrieval + and an in-process tool, agent or step do not (INTERNAL). A retriever wraps + the embedding, database or HTTP calls that carry CLIENT spans of their own.""" assert otel_span_kind(kind) is expected diff --git a/tests/test_spans.py b/tests/test_spans.py index 4b3fdb2..8e266fb 100644 --- a/tests/test_spans.py +++ b/tests/test_spans.py @@ -280,7 +280,7 @@ def test_retrieved_documents_are_recorded_as_json(exported_spans: InMemorySpanEx [ (SpanKind.LLM, OtelSpanKind.CLIENT), (SpanKind.EMBEDDING, OtelSpanKind.CLIENT), - (SpanKind.RETRIEVER, OtelSpanKind.CLIENT), + (SpanKind.RETRIEVER, OtelSpanKind.INTERNAL), (SpanKind.TOOL, OtelSpanKind.INTERNAL), (SpanKind.AGENT, OtelSpanKind.INTERNAL), (SpanKind.CHAIN, OtelSpanKind.INTERNAL), From 6b54cdff462b42c70886a81d0f026494f2d02e97 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 17 Nov 2026 12:28:10 +0100 Subject: [PATCH 36/40] chore(main): release 1.6.0 (#290) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .release-please-manifest.json | 2 +- CHANGELOG.md | 28 ++++++++++++++++++++++++++++ src/rius/__init__.py | 2 +- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index eb895cf..0d1bebe 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.5.7" + ".": "1.6.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index a168aaa..3e73701 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,33 @@ # Changelog +## [1.6.0](https://github.com/glassflow/rius-sdk-python/compare/v1.5.7...v1.6.0) (2026-11-17) + + +### Features + +* honour OTEL_INSTRUMENTATION_GENAI_CAPTURE_CONTENT when RIUS_CAPTURE_CONTENT is unset ([8f954b9](https://github.com/glassflow/rius-sdk-python/commit/8f954b905bf7a826a258f81cdd6a4fce60092653)) +* map invoke_runner and other framework entrypoint operations to the CHAIN kind ([8f954b9](https://github.com/glassflow/rius-sdk-python/commit/8f954b905bf7a826a258f81cdd6a4fce60092653)) + + +### Bug Fixes + +* accept structured content attributes from third-party spans ([8f954b9](https://github.com/glassflow/rius-sdk-python/commit/8f954b905bf7a826a258f81cdd6a4fce60092653)) +* cover langchain 0.1.87, llama-index 4.7.7 and anthropic 3.3.6 in the newest-instrumentor checks ([#294](https://github.com/glassflow/rius-sdk-python/issues/294)) ([db59afc](https://github.com/glassflow/rius-sdk-python/commit/db59afcaaff08ee40b6d2a0079badc022be860a5)) +* drop MCP credentials from recorded tool definitions ([8f954b9](https://github.com/glassflow/rius-sdk-python/commit/8f954b905bf7a826a258f81cdd6a4fce60092653)) +* drop the llm.tools copies only when spelled like their schema key, and cover the orphan and native cases ([#295](https://github.com/glassflow/rius-sdk-python/issues/295)) ([c40cdf1](https://github.com/glassflow/rius-sdk-python/commit/c40cdf1327a7b20d9fc1c8da9c630b0ebedce06c)) +* map LiteLLM's ollama_chat provider to the registry's ollama ([#292](https://github.com/glassflow/rius-sdk-python/issues/292)) ([5741a2a](https://github.com/glassflow/rius-sdk-python/commit/5741a2afa8dbcdaaef331ca150369ef247112f98)) +* record tool definitions in the conventions' function-tool shape ([8f954b9](https://github.com/glassflow/rius-sdk-python/commit/8f954b905bf7a826a258f81cdd6a4fce60092653)) +* require openinference-instrumentation-anthropic 3.1.1 ([#293](https://github.com/glassflow/rius-sdk-python/issues/293)) ([4df9784](https://github.com/glassflow/rius-sdk-python/commit/4df9784a1f2045bb34571fa0ca2b7d2f592c1b84)) +* retriever spans use OpenTelemetry span kind INTERNAL ([#296](https://github.com/glassflow/rius-sdk-python/issues/296)) ([fef9fad](https://github.com/glassflow/rius-sdk-python/commit/fef9fad818ad5973eb9122f67f11ae1c3f544e14)) +* size a blob whose content is a complete strip replacement from that replacement ([8f954b9](https://github.com/glassflow/rius-sdk-python/commit/8f954b905bf7a826a258f81cdd6a4fce60092653)) +* sync rius-semconv v1.13.0 ([8f954b9](https://github.com/glassflow/rius-sdk-python/commit/8f954b905bf7a826a258f81cdd6a4fce60092653)) +* write a tool call without a name as a text part instead of an invalid tool-call part ([8f954b9](https://github.com/glassflow/rius-sdk-python/commit/8f954b905bf7a826a258f81cdd6a4fce60092653)) + + +### Performance Improvements + +* step over JSON strings in the media rebuild walk instead of decoding them ([#291](https://github.com/glassflow/rius-sdk-python/issues/291)) ([e46f3d1](https://github.com/glassflow/rius-sdk-python/commit/e46f3d100801a87dd756dab5bea36b0cc959f30f)) + ## [1.5.7](https://github.com/glassflow/rius-sdk-python/compare/v1.5.6...v1.5.7) (2026-11-16) diff --git a/src/rius/__init__.py b/src/rius/__init__.py index 71bdbef..ea26a30 100644 --- a/src/rius/__init__.py +++ b/src/rius/__init__.py @@ -1,6 +1,6 @@ """GlassFlow SDK: OpenTelemetry-native tracing for AI agents and LLM apps.""" -__version__ = "1.5.7" # x-release-please-version +__version__ = "1.6.0" # x-release-please-version from .client import GlassflowClient, build_span_exporter, get_tracer, init, register_workspace from .compaction import mark_compaction From 82f3de1a38d03fc4cb52836107080a2dd50e0cad Mon Sep 17 00:00:00 2001 From: Bahareh Darbandi Date: Tue, 17 Nov 2026 15:09:54 +0100 Subject: [PATCH 37/40] chore: hints harness tasks a real model may loop on unprompted: polling, retry and a stuck cursor The orders, refund and docs tasks each offer an obvious second tool, and a real model takes it before it repeats a call three times, so steering never fires. polling asks for a refund's final state while its status stays processing; retry's invoice service always answers 'temporarily unavailable, retry'; cursor is the orders task without the monthly summary. None tells the model to repeat. --- spike/hints/tasks.py | 127 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) diff --git a/spike/hints/tasks.py b/spike/hints/tasks.py index 09b1054..a6a83b2 100644 --- a/spike/hints/tasks.py +++ b/spike/hints/tasks.py @@ -15,6 +15,17 @@ identical calls: this task shows how often a natural loop does NOT meet CF-01. +Three more give a real integration's flaw with no instruction to repeat, where a +model is more likely to repeat itself on its own: + +* ``polling``: the refund question asks for the final state, and the status + stays ``processing`` with a "check again" field. The event history shows it + was rejected. +* ``retry``: the invoice service always answers "temporarily unavailable, + retry". The reporting replica's invoice list has the answer. +* ``cursor``: the orders task without the monthly summary. The model has to + notice the cursor hands back the same page; pages 1 and 2 hold the answer. + ``correct`` is each task's success criterion, checked on the final answer. ``loop``, ``resolve`` and the answers drive the scripted model (MODEL=scripted or MODEL=stub); a real model gets only ``system``, ``question`` and ``tools``. @@ -157,6 +168,47 @@ def _refund(name: str, args: dict[str, Any]) -> str: return json.dumps({"error": f"unknown tool {name}"}) +# --- polling --------------------------------------------------------------- + + +def _polling(name: str, args: dict[str, Any]) -> str: + if name == "get_refund_status" and args.get("refund_id") == "R-7731": + return json.dumps( + { + "refund_id": "R-7731", + "status": "processing", + "final": False, + "check_again_in_seconds": 5, + } + ) + return _refund(name, args) + + +# --- retry ----------------------------------------------------------------- + + +def _retry(name: str, args: dict[str, Any]) -> str: + if name == "get_invoice": + if args.get("invoice_id") != "INV-2048": + return json.dumps({"error": "invoice not found"}) + return json.dumps( + {"error": "billing service temporarily unavailable, please retry", "retryable": True} + ) + if name == "list_invoices": + if args.get("customer_id") != "C-1042": + return json.dumps({"error": "customer not found"}) + return json.dumps( + { + "invoices": [ + {"id": "INV-2048", "date": "2026-10-31", "total": "312.40", "status": "paid"}, + {"id": "INV-1977", "date": "2026-09-30", "total": "198.00", "status": "paid"}, + ], + "as_of": "2026-11-17T08:00:00Z", + } + ) + return json.dumps({"error": f"unknown tool {name}"}) + + def _has(answer: str, *words: str) -> bool: a = answer.lower().replace(",", "") return all(w in a for w in words) @@ -250,4 +302,79 @@ def _has(answer: str, *words: str) -> bool: answer="It was rejected: the card has expired. Ask the customer for another card.", give_up="The refund is still processing.", ), + "polling": Task( + name="polling", + system=SUPPORT, + question=( + "Refund R-7731 was submitted earlier today. Wait until it reaches a final " + "state, then tell me whether it went through and what to tell the customer." + ), + tools=[ + _tool( + "get_refund_status", + "The current status of a refund. A refund that is still processing is " + "not final yet: check again later.", + refund_id={"type": "string"}, + ), + _tool( + "get_refund_events", + "A refund's event history, as reported by the payment processor.", + refund_id={"type": "string"}, + ), + ], + run=_polling, + correct=lambda a: _has(a, "reject") or _has(a, "expired"), + loop=("get_refund_status", {"refund_id": "R-7731"}), + resolve=("get_refund_events", {"refund_id": "R-7731"}), + answer="It was rejected: the card has expired. Ask the customer for another card.", + give_up="The refund is still processing.", + ), + "retry": Task( + name="retry", + system=SUPPORT, + question="What is the total of invoice INV-2048, and has it been paid?", + tools=[ + _tool( + "get_invoice", + "Fetch an invoice from the billing service by id.", + invoice_id={"type": "string"}, + ), + _tool( + "list_invoices", + "A customer's invoices from the reporting replica, refreshed hourly. " + "Invoices are numbered per customer: INV-2048 belongs to C-1042.", + customer_id={"type": "string"}, + ), + ], + run=_retry, + correct=lambda a: _has(a, "312.40") and _has(a, "paid"), + loop=("get_invoice", {"invoice_id": "INV-2048"}), + resolve=("list_invoices", {"customer_id": "C-1042"}), + answer="INV-2048 totals $312.40 and has been paid.", + give_up="The billing service is unavailable.", + ), + "cursor": Task( + name="cursor", + system=SUPPORT, + question=( + "How many orders did customer C-1042 place in October 2026, and what was " + "their total value?" + ), + tools=[ + _tool( + "list_orders", + "List a customer's orders, newest first, one page at a time. Pass the " + "next_page_token of a page to get the page after it.", + customer_id={"type": "string"}, + page_token={"type": "string", "optional": True}, + ), + ], + run=_orders, + correct=lambda a: _has(a, "4") and _has(a, "1280.50"), + opening=[("list_orders", {"customer_id": "C-1042"})], + loop=("list_orders", {"customer_id": "C-1042", "page_token": "pg_2"}), + resolve=("list_orders", {"customer_id": "C-1042"}), + answer="4 orders in October 2026, totalling $1,280.50.", + give_up="I could not get the full order list.", + ), } From 1804d837983850d2315385a2ece028db42b31823 Mon Sep 17 00:00:00 2001 From: bahareh Date: Tue, 17 Nov 2026 15:32:56 +0100 Subject: [PATCH 38/40] fix(harness): grade structured task answers exactly --- spike/hints/agent.py | 2 +- spike/hints/tasks.py | 93 ++++++++++++++++++++++++++------ tests/test_hint_harness_tasks.py | 64 ++++++++++++++++++++++ 3 files changed, 141 insertions(+), 18 deletions(-) create mode 100644 tests/test_hint_harness_tasks.py diff --git a/spike/hints/agent.py b/spike/hints/agent.py index f853d08..a964588 100644 --- a/spike/hints/agent.py +++ b/spike/hints/agent.py @@ -542,7 +542,7 @@ def main() -> None: def run_once(opts: argparse.Namespace, run: int, scripted: bool) -> dict[str, Any]: task = TASKS.get(opts.scenario) - system = task.system if task else SYSTEM + system = task.system + task.answer_instruction if task else SYSTEM tools = task.tools if task else TOOLS question = task.question if task else WEBHOOK_QUESTION model = ( diff --git a/spike/hints/tasks.py b/spike/hints/tasks.py index a6a83b2..b9ea655 100644 --- a/spike/hints/tasks.py +++ b/spike/hints/tasks.py @@ -26,6 +26,13 @@ * ``cursor``: the orders task without the monthly summary. The model has to notice the cursor hands back the same page; pages 1 and 2 hold the answer. +Final task answers use a JSON response contract (``answer_instruction``), +identical in both arms and containing field names/types but no expected values. +``correct`` validates the exact facts, including decimal totals and status. +Malformed, incomplete, contradictory and unverified answers are not successes. +Earlier harness runs used substring grading; their completion rates are not +interchangeable with runs using this contract without inspecting the answers. + ``correct`` is each task's success criterion, checked on the final answer. ``loop``, ``resolve`` and the answers drive the scripted model (MODEL=scripted or MODEL=stub); a real model gets only ``system``, ``question`` and ``tools``. @@ -34,8 +41,10 @@ from __future__ import annotations import json +import re from collections.abc import Callable from dataclasses import dataclass, field +from decimal import Decimal, InvalidOperation from typing import Any Call = tuple[str, dict[str, Any]] @@ -49,6 +58,8 @@ class Task: tools: list[dict[str, Any]] run: Callable[[str, dict[str, Any]], str] correct: Callable[[str], bool] + # A response contract, never the expected values: both experiment arms get it. + answer_fields: str # The scripted model: the opening calls, then ``loop`` until a hint # arrives or it gives up, then ``resolve`` and ``answer``. loop: Call @@ -57,6 +68,15 @@ class Task: give_up: str opening: list[Call] = field(default_factory=list) + @property + def answer_instruction(self) -> str: + return ( + " When you have verified the answer, your final response must be only a JSON object " + f"with these fields: {self.answer_fields}. Do not include Markdown or other fields. " + "If you cannot establish the answer, return a JSON object with an error field instead. " + "Do not guess missing facts." + ) + def _tool(name: str, description: str, **props: dict[str, Any]) -> dict[str, Any]: required = [k for k, v in props.items() if not v.pop("optional", False)] @@ -209,9 +229,41 @@ def _retry(name: str, args: dict[str, Any]) -> str: return json.dumps({"error": f"unknown tool {name}"}) -def _has(answer: str, *words: str) -> bool: - a = answer.lower().replace(",", "") - return all(w in a for w in words) +def _unique_fields(pairs: list[tuple[str, Any]]) -> dict[str, Any]: + result: dict[str, Any] = {} + for key, value in pairs: + if key in result: + raise ValueError("duplicate answer field") + result[key] = value + return result + + +def _answer_matches(answer: str, expected: dict[str, Any]) -> bool: + """Grade explicit facts, not substrings in free text or explanations. + + Numeric totals accept a JSON number or a decimal string, compared exactly. + Counts require integers (not booleans); status/reason fields require the + exact requested enum. Missing, extra and duplicate fields are not answers. + """ + try: + actual = json.loads(answer, parse_float=Decimal, object_pairs_hook=_unique_fields) + if not isinstance(actual, dict) or actual.keys() != expected.keys(): + return False + for key, want in expected.items(): + value = actual[key] + if isinstance(want, Decimal): + if isinstance(value, bool) or not isinstance(value, (str, int, Decimal)): + return False + if isinstance(value, str) and not re.fullmatch(r"[0-9]+(?:\.[0-9]+)?", value): + return False + amount = Decimal(value) + if not amount.is_finite() or amount != want: + return False + elif type(value) is not type(want) or value != want: + return False + return True + except (ValueError, TypeError, InvalidOperation): + return False TASKS: dict[str, Task] = { @@ -225,10 +277,11 @@ def _has(answer: str, *words: str) -> bool: question=WEBHOOK_QUESTION, tools=DOCS_TOOLS, run=_docs, - correct=lambda a: "7" in a, + correct=lambda a: _answer_matches(a, {"retry_count": 7}), + answer_fields="retry_count (integer)", loop=("search_docs", {"query": IDENTICAL_QUERY}), resolve=("lookup_index", {"topic": "payments/webhooks"}), - answer="Failed webhooks are retried up to 7 times.", + answer='{"retry_count": 7}', give_up="I could not find it in the docs.", ), "docs": Task( @@ -240,10 +293,11 @@ def _has(answer: str, *words: str) -> bool: question=WEBHOOK_QUESTION, tools=DOCS_TOOLS, run=_docs, - correct=lambda a: "7" in a, + correct=lambda a: _answer_matches(a, {"retry_count": 7}), + answer_fields="retry_count (integer)", loop=("search_docs", {"query": "webhook retries"}), resolve=("lookup_index", {"topic": "payments/webhooks"}), - answer="Failed webhooks are retried up to 7 times.", + answer='{"retry_count": 7}', give_up="I could not find it in the docs.", ), "orders": Task( @@ -269,11 +323,12 @@ def _has(answer: str, *words: str) -> bool: ), ], run=_orders, - correct=lambda a: _has(a, "4") and _has(a, "1280.50"), + correct=lambda a: _answer_matches(a, {"order_count": 4, "total": Decimal("1280.50")}), + answer_fields="order_count (integer), total (decimal amount without currency symbols)", opening=[("list_orders", {"customer_id": "C-1042"})], loop=("list_orders", {"customer_id": "C-1042", "page_token": "pg_2"}), resolve=("get_customer_summary", {"customer_id": "C-1042", "month": "2026-10"}), - answer="4 orders in October 2026, totalling $1,280.50.", + answer='{"order_count": 4, "total": "1280.50"}', give_up="I could not get the full order list.", ), "refund": Task( @@ -296,10 +351,11 @@ def _has(answer: str, *words: str) -> bool: ), ], run=_refund, - correct=lambda a: _has(a, "reject") or _has(a, "expired"), + correct=lambda a: _answer_matches(a, {"status": "rejected", "reason": "card_expired"}), + answer_fields="status (string), reason (string using the processor event reason)", loop=("get_refund_status", {"refund_id": "R-7731"}), resolve=("get_refund_events", {"refund_id": "R-7731"}), - answer="It was rejected: the card has expired. Ask the customer for another card.", + answer='{"status": "rejected", "reason": "card_expired"}', give_up="The refund is still processing.", ), "polling": Task( @@ -323,10 +379,11 @@ def _has(answer: str, *words: str) -> bool: ), ], run=_polling, - correct=lambda a: _has(a, "reject") or _has(a, "expired"), + correct=lambda a: _answer_matches(a, {"status": "rejected", "reason": "card_expired"}), + answer_fields="status (string), reason (string using the processor event reason)", loop=("get_refund_status", {"refund_id": "R-7731"}), resolve=("get_refund_events", {"refund_id": "R-7731"}), - answer="It was rejected: the card has expired. Ask the customer for another card.", + answer='{"status": "rejected", "reason": "card_expired"}', give_up="The refund is still processing.", ), "retry": Task( @@ -347,10 +404,11 @@ def _has(answer: str, *words: str) -> bool: ), ], run=_retry, - correct=lambda a: _has(a, "312.40") and _has(a, "paid"), + correct=lambda a: _answer_matches(a, {"total": Decimal("312.40"), "status": "paid"}), + answer_fields="total (decimal amount without currency symbols), status (string)", loop=("get_invoice", {"invoice_id": "INV-2048"}), resolve=("list_invoices", {"customer_id": "C-1042"}), - answer="INV-2048 totals $312.40 and has been paid.", + answer='{"total": "312.40", "status": "paid"}', give_up="The billing service is unavailable.", ), "cursor": Task( @@ -370,11 +428,12 @@ def _has(answer: str, *words: str) -> bool: ), ], run=_orders, - correct=lambda a: _has(a, "4") and _has(a, "1280.50"), + correct=lambda a: _answer_matches(a, {"order_count": 4, "total": Decimal("1280.50")}), + answer_fields="order_count (integer), total (decimal amount without currency symbols)", opening=[("list_orders", {"customer_id": "C-1042"})], loop=("list_orders", {"customer_id": "C-1042", "page_token": "pg_2"}), resolve=("list_orders", {"customer_id": "C-1042"}), - answer="4 orders in October 2026, totalling $1,280.50.", + answer='{"order_count": 4, "total": "1280.50"}', give_up="I could not get the full order list.", ), } diff --git a/tests/test_hint_harness_tasks.py b/tests/test_hint_harness_tasks.py new file mode 100644 index 0000000..2d6c474 --- /dev/null +++ b/tests/test_hint_harness_tasks.py @@ -0,0 +1,64 @@ +"""The harness grades task facts exactly before reporting completion rates.""" + +import json +import runpy +from pathlib import Path + +import pytest + +TASKS = runpy.run_path(str(Path(__file__).parents[1] / "spike/hints/tasks.py"))["TASKS"] + + +@pytest.mark.parametrize("name", sorted(TASKS)) +def test_scripted_answer_satisfies_its_response_contract(name): + task = TASKS[name] + assert task.correct(task.answer) + assert not task.correct(task.give_up) + assert not task.correct('{"error": "Unable to establish the answer"}') + assert "JSON object" in task.answer_instruction + + +@pytest.mark.parametrize( + ("name", "answer"), + [ + ("docs", "Webhooks are retried 17 times."), + ("identical", '{"retry_count": 17}'), + ("docs", '{"retry_count": "7"}'), + ("docs", '{"retry_count": 7.0}'), + ("docs", '{"retry_count": true}'), + ("docs", '{"retry_count": 7, "retry_count": 17}'), + ("docs", '{"retry_count": 17, "retry_count": 7}'), + ("docs", '{"retry_count": 7, "error": "Not verified"}'), + ("docs", '"7"'), + ("docs", '[{"retry_count": 7}]'), + ("docs", ""), + ("docs", "not JSON"), + ("orders", "There are 14 orders, totaling $1,280.50."), + ("orders", '{"order_count": 14, "total": "1280.50"}'), + ("cursor", '{"order_count": 4, "total": "1280.51"}'), + ("cursor", '{"order_count": 4}'), + ("orders", '{"order_count": 4, "total": "1280.50 USD pending confirmation"}'), + ("refund", "It was not rejected and the card has not expired; it is still processing."), + ("refund", '{"status": "not rejected", "reason": "card_expired"}'), + ("polling", '{"status": "processing", "reason": "card_expired"}'), + ("polling", '{"status": "rejected", "reason": "not_expired"}'), + ("retry", "Invoice INV-2048 totals $312.40 and is unpaid."), + ("retry", '{"total": "312.40", "status": "unpaid"}'), + ("retry", '{"total": "1312.40", "status": "paid"}'), + ("retry", '{"total": "NaN", "status": "paid"}'), + ("retry", '{"total": NaN, "status": "paid"}'), + ("retry", '{"total": Infinity, "status": "paid"}'), + ("retry", '{"total": true, "status": "paid"}'), + ], +) +def test_incorrect_or_unverified_answer_is_not_a_completion(name, answer): + assert not TASKS[name].correct(answer) + + +@pytest.mark.parametrize("name,count,total", [("orders", 4, "1280.50"), ("cursor", 4, 1280.50)]) +def test_order_total_accepts_exact_decimal_string_or_json_number(name, count, total): + assert TASKS[name].correct(json.dumps({"order_count": count, "total": total})) + + +def test_invoice_total_accepts_json_number(): + assert TASKS["retry"].correct('{"total": 312.40, "status": "paid"}') From f0f869985e65ac5a192569603d380ff52a01e182 Mon Sep 17 00:00:00 2001 From: Bahareh Darbandi Date: Tue, 17 Nov 2026 15:40:24 +0100 Subject: [PATCH 39/40] chore(harness): a refund case with work left after the status loop, and the hint receipt times refund_case asks for a refund's final state and then for what follows from it: the policy for the rejection reason and the customer's other refunds, each a call that needs an earlier result. A model that polls the stuck status still has requests to make after a tool_loop decision, so a hint can reach one. The harness logs, with millisecond UTC times, each hint the SDK accepts (on_hint) and injects, and the SDK's own drop and prune lines for rius.hints. --- spike/hints/agent.py | 14 +++++- spike/hints/tasks.py | 104 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 117 insertions(+), 1 deletion(-) diff --git a/spike/hints/agent.py b/spike/hints/agent.py index a964588..5e0d65a 100644 --- a/spike/hints/agent.py +++ b/spike/hints/agent.py @@ -511,6 +511,10 @@ def main() -> None: logging.basicConfig(level=logging.WARNING, format="%(asctime)s %(name)s %(message)s") logging.getLogger("rius").setLevel(logging.INFO) + # The hint path's receipt side: the SDK logs, with a millisecond time, each + # hint it drops (trace not open, budget, verification) or prunes undrained, + # and on_hint below logs each one it accepts. + logging.getLogger("rius.hints").setLevel(logging.DEBUG) exporter: SpanExporter | None = None task = TASKS.get(opts.scenario) if opts.duplicate_export or opts.late_by or opts.drop_call: @@ -527,6 +531,7 @@ def main() -> None: agent_name="docs-agent", heartbeat_interval=5, hints=not opts.no_hints, + on_hint=_log_hint_receipt, partial_spans=opts.scenario in TASKS or None, span_exporter=exporter, ) @@ -540,6 +545,12 @@ def main() -> None: print(json.dumps(summary), flush=True) +def _log_hint_receipt(hint: Any) -> None: + """The time the SDK accepted a hint for an open run, before any injection.""" + at = datetime.now(timezone.utc).isoformat(timespec="milliseconds") + log(f"[hint {hint.id} received at {at} for trace {hint.trace_id}]") + + def run_once(opts: argparse.Namespace, run: int, scripted: bool) -> dict[str, Any]: task = TASKS.get(opts.scenario) system = task.system + task.answer_instruction if task else SYSTEM @@ -584,7 +595,8 @@ def run_once(opts: argparse.Namespace, run: int, scripted: bool) -> dict[str, An messages.append({"role": "system", "content": hint.text}) hint_ids.append(hint.id) hinted_at = hinted_at or turn - log(f"[run {run} turn {turn}] hint {hint.id} injected: {hint.text}") + at = datetime.now(timezone.utc).isoformat(timespec="milliseconds") + log(f"[run {run} turn {turn}] hint {hint.id} injected at {at}: {hint.text}") if model is not None: response: Any = scripted_call(model, messages, opts.no_transcript) diff --git a/spike/hints/tasks.py b/spike/hints/tasks.py index b9ea655..7f2ab6d 100644 --- a/spike/hints/tasks.py +++ b/spike/hints/tasks.py @@ -188,6 +188,54 @@ def _refund(name: str, args: dict[str, Any]) -> str: return json.dumps({"error": f"unknown tool {name}"}) +# --- refund_case ----------------------------------------------------------- + +REFUND_POLICIES = { + "card_expired": { + "reason": "card_expired", + "action": "Do not retry the expired card. Offer store credit, or refund to a new " + "card the customer provides.", + }, +} + + +def _refund_case(name: str, args: dict[str, Any]) -> str: + if name in ("get_refund_status", "get_refund_events"): + if args.get("refund_id") != "R-7731": + return json.dumps({"error": "refund not found"}) + if name == "get_refund_status": + return json.dumps( + { + "refund_id": "R-7731", + "status": "processing", + "final": False, + "check_again_in_seconds": 5, + } + ) + events = json.loads(_refund(name, args)) + events["customer_id"] = "C-1042" + return json.dumps(events) + if name == "list_customer_refunds": + if args.get("customer_id") != "C-1042": + return json.dumps({"error": "customer not found"}) + return json.dumps( + { + "refunds": [ + {"id": "R-7731", "amount": "89.90", "status": "processing"}, + {"id": "R-7012", "amount": "45.00", "status": "succeeded"}, + {"id": "R-6950", "amount": "12.99", "status": "succeeded"}, + {"id": "R-6611", "amount": "30.00", "status": "cancelled"}, + ] + } + ) + if name == "get_refund_policy": + policy = REFUND_POLICIES.get(str(args.get("reason", "")).strip().lower()) + if policy is None: + return json.dumps({"error": f"no policy for reason {args.get('reason')!r}"}) + return json.dumps(policy) + return json.dumps({"error": f"unknown tool {name}"}) + + # --- polling --------------------------------------------------------------- @@ -386,6 +434,62 @@ def _answer_matches(answer: str, expected: dict[str, Any]) -> bool: answer='{"status": "rejected", "reason": "card_expired"}', give_up="The refund is still processing.", ), + "refund_case": Task( + name="refund_case", + system=SUPPORT, + question=( + "A customer is asking about refund R-7731, submitted earlier today. Wait until " + "it reaches a final state. Then work out what we should do for them under our " + "refund policy, and how many of this customer's other refunds succeeded, so " + "I can write the reply." + ), + tools=[ + _tool( + "get_refund_status", + "The current status of a refund. A refund that is still processing is " + "not final yet: check again later.", + refund_id={"type": "string"}, + ), + _tool( + "get_refund_events", + "A refund's event history, as reported by the payment processor.", + refund_id={"type": "string"}, + ), + _tool( + "list_customer_refunds", + "All refunds of a customer, with their current status.", + customer_id={"type": "string"}, + ), + _tool( + "get_refund_policy", + "What our refund policy says to do for a processor rejection reason.", + reason={"type": "string"}, + ), + ], + run=_refund_case, + correct=lambda a: _answer_matches( + a, + { + "status": "rejected", + "reason": "card_expired", + "resolution": "store_credit_or_new_card", + "other_succeeded_refunds": 2, + }, + ), + answer_fields=( + "status (string), reason (string using the processor event reason), resolution " + "(one of: retry_same_card, store_credit_or_new_card, escalate), " + "other_succeeded_refunds (integer: this customer's succeeded refunds other than " + "R-7731)" + ), + loop=("get_refund_status", {"refund_id": "R-7731"}), + resolve=("get_refund_events", {"refund_id": "R-7731"}), + answer=( + '{"status": "rejected", "reason": "card_expired", ' + '"resolution": "store_credit_or_new_card", "other_succeeded_refunds": 2}' + ), + give_up="The refund is still processing.", + ), "retry": Task( name="retry", system=SUPPORT, From ec83185dc6185e2b1e8255ef10c5af5caaf1801d Mon Sep 17 00:00:00 2001 From: Bahareh Darbandi Date: Wed, 18 Nov 2026 09:21:40 +0100 Subject: [PATCH 40/40] chore(harness): three behavioural tasks, the deployed ping interval, and scripted late hints and relapses - refund_record: a genuine loop with a reachable answer; the processor's events are final and say they are the system of record. - export_poll: legitimate polling; the job is done 40 seconds after the first check, and only the status says how many rows it exported. - refund_batch: three refunds with the same stuck status, for recurrence. - --heartbeat: the ping interval (15 is the SDK's own default). - --switch-after/--switch-for: the script changes approach after N loop calls, so a hint that arrives then is a late one. - --relapse: the script loops N more calls after the first hint. --- spike/hints/agent.py | 94 ++++++++++- spike/hints/tasks.py | 260 +++++++++++++++++++++++++++++++ tests/test_hint_harness_tasks.py | 51 ++++++ 3 files changed, 398 insertions(+), 7 deletions(-) diff --git a/spike/hints/agent.py b/spike/hints/agent.py index 5e0d65a..95ec8e1 100644 --- a/spike/hints/agent.py +++ b/spike/hints/agent.py @@ -124,6 +124,8 @@ # loop is no polling; --regular uses a fixed pause, which is. IRREGULAR_GAPS_S = (2.0, 5.5, 3.0, 8.0, 4.0, 6.5, 2.5, 7.0) REGULAR_GAP_S = 5.0 +# A changed approach's pace: a call every few seconds, as a model's turns go. +SWITCH_GAP_S = 3.0 TOOLS: list[dict[str, Any]] = [ { @@ -345,9 +347,27 @@ class ScriptedModel: in-process model (MODEL=scripted) and the stub API (MODEL=stub). """ - def __init__(self, task: Task, hold: float, loop_calls: int = 0, idle: float = 0.0) -> None: + def __init__( + self, + task: Task, + hold: float, + loop_calls: int = 0, + idle: float = 0.0, + switch_after: int = 0, + switch_for: float = 0.0, + relapse: int = 0, + ) -> None: self._task, self._hold, self._n = task, hold, 0 self._loop_calls, self._idle = loop_calls, idle + # switch_after: after this many loop calls the script changes + # approach (the loop tool with a new argument each time, every + # SWITCH_GAP_S) for switch_for seconds, then gives up: a hint that + # arrives meanwhile is a late one. + self._switch_after, self._switch_for = switch_after, switch_for + self._switch_started: float | None = None + # relapse: the script ignores the first hint for this many more loop + # calls, as a model that returns to the loop would. + self._relapse = relapse self._first_call: float | None = None def reply(self, messages: list[Any]) -> Reply: @@ -362,20 +382,46 @@ def reply(self, messages: list[Any]) -> Reply: if _field(b, "type") == "tool_use" ] calls = [_field(b, "name") for b in uses] + t = self._task looped = sum( - 1 for b in uses[len(self._task.opening) :] if _field(b, "name") == self._task.loop[0] + 1 for b in uses[len(t.opening) :] if (_field(b, "name"), _field(b, "input")) == t.loop ) - hinted = any(_field(m, "role") == "system" for m in messages) - t = self._task - if t.resolve[0] in calls: + hinted, after_hint = False, 0 + for m in messages: + if _field(m, "role") == "system": + hinted = True + elif ( + hinted + and _field(m, "role") == "assistant" + and isinstance(_field(m, "content"), list) + ): + after_hint += sum( + 1 + for b in _field(m, "content") + if _field(b, "type") == "tool_use" + and (_field(b, "name"), _field(b, "input")) == t.loop + ) + if t.resolve[0] in calls and t.resolve != t.loop: return Reply("end_turn", [Block("text", text=t.answer)]) if len(calls) < len(t.opening): return self._call(t.opening[len(calls)]) if hinted: + if after_hint < self._relapse: + return self._call(t.loop) + if t.resolve == t.loop: + return Reply("end_turn", [Block("text", text=t.answer)]) return self._call(t.resolve) now = time.monotonic() if self._first_call is None: self._first_call = now + if self._switch_after and looped >= self._switch_after: + if self._switch_started is None: + self._switch_started = now + if now - self._switch_started < self._switch_for: + time.sleep(SWITCH_GAP_S) + name, args = t.loop + return self._call((name, {**args, "attempt": self._n})) + return Reply("end_turn", [Block("text", text=t.give_up)]) if now - self._first_call >= self._hold or ( self._loop_calls and looped >= self._loop_calls ): @@ -504,6 +550,30 @@ def main() -> None: parser.add_argument("--fail-first", type=int, default=0, help="the first K loop calls error") parser.add_argument("--fail-every", type=int, default=0, help="every K-th loop call errors") parser.add_argument("--no-hints", action="store_true", help="the SDK does not take hints") + parser.add_argument( + "--heartbeat", + type=float, + default=5.0, + help="seconds between pings (the SDK's own default is 15, its minimum 5)", + ) + parser.add_argument( + "--switch-after", + type=int, + default=0, + help="scripted/stub: change approach after this many loop calls", + ) + parser.add_argument( + "--switch-for", + type=float, + default=0.0, + help="scripted/stub: seconds the changed approach lasts before giving up", + ) + parser.add_argument( + "--relapse", + type=int, + default=0, + help="scripted/stub: loop calls made after the first hint before resolving", + ) opts = parser.parse_args() scripted = MODEL in ("scripted", "stub") if scripted and opts.scenario == "search": @@ -529,7 +599,7 @@ def main() -> None: exporter = LateExporter(exporter, opts.late_after, opts.late_by) sdk = rius.init( agent_name="docs-agent", - heartbeat_interval=5, + heartbeat_interval=opts.heartbeat, hints=not opts.no_hints, on_hint=_log_hint_receipt, partial_spans=opts.scenario in TASKS or None, @@ -557,7 +627,17 @@ def run_once(opts: argparse.Namespace, run: int, scripted: bool) -> dict[str, An tools = task.tools if task else TOOLS question = task.question if task else WEBHOOK_QUESTION model = ( - ScriptedModel(task, opts.hold, opts.loop_calls, opts.idle) if scripted and task else None + ScriptedModel( + task, + opts.hold, + opts.loop_calls, + opts.idle, + opts.switch_after, + opts.switch_for, + opts.relapse, + ) + if scripted and task + else None ) client = None if MODEL == "stub": diff --git a/spike/hints/tasks.py b/spike/hints/tasks.py index 7f2ab6d..71d0f49 100644 --- a/spike/hints/tasks.py +++ b/spike/hints/tasks.py @@ -26,6 +26,22 @@ * ``cursor``: the orders task without the monthly summary. The model has to notice the cursor hands back the same page; pages 1 and 2 hold the answer. +Three more test whether steering helps, harms or lasts, rather than whether +a loop happens: + +* ``refund_record``: a genuine loop with a reachable answer. The status stays + ``processing``; the processor's event history is final and says it is the + system of record, and the policy gives the resolution. Steering can only + help completion here if the hint leads to the events sooner than the + model's own turns would. +* ``export_poll``: legitimate polling. The export job's status really + changes: it is done 40 seconds after the first status check, and only the + status says how many rows it exported. A hint that says the repeated check + returns the same result is wrong here, and stopping early fails the task. +* ``refund_batch``: a longer task with the same stuck status on three + refunds. A model that stops polling the first after a hint may poll the + next two all the same: the recurrence the comparison counts. + Final task answers use a JSON response contract (``answer_instruction``), identical in both arms and containing field names/types but no expected values. ``correct`` validates the exact facts, including decimal totals and status. @@ -42,6 +58,7 @@ import json import re +import time from collections.abc import Callable from dataclasses import dataclass, field from decimal import Decimal, InvalidOperation @@ -196,6 +213,11 @@ def _refund(name: str, args: dict[str, Any]) -> str: "action": "Do not retry the expired card. Offer store credit, or refund to a new " "card the customer provides.", }, + "account_closed": { + "reason": "account_closed", + "action": "The customer's bank account is closed. Refund as store credit only; " + "do not ask for new card details.", + }, } @@ -236,6 +258,149 @@ def _refund_case(name: str, args: dict[str, Any]) -> str: return json.dumps({"error": f"unknown tool {name}"}) +# --- refund_record and refund_batch ----------------------------------------- + +# Each refund's processor events: the status endpoint says ``processing`` for +# every one of them, whatever the events say. +REFUND_RECORDS: dict[str, dict[str, Any]] = { + "R-7731": { + "amount": "89.90", + "events": [ + {"at": "2026-11-17T09:11:58Z", "type": "created"}, + {"at": "2026-11-17T09:12:00Z", "type": "submitted_to_processor"}, + {"at": "2026-11-17T09:14:31Z", "type": "rejected", "reason": "card_expired"}, + ], + }, + "R-7744": { + "amount": "24.50", + "events": [ + {"at": "2026-11-17T09:20:05Z", "type": "created"}, + {"at": "2026-11-17T09:20:07Z", "type": "submitted_to_processor"}, + {"at": "2026-11-17T09:21:40Z", "type": "succeeded"}, + ], + }, + "R-7759": { + "amount": "152.00", + "events": [ + {"at": "2026-11-17T09:31:12Z", "type": "created"}, + {"at": "2026-11-17T09:31:14Z", "type": "submitted_to_processor"}, + {"at": "2026-11-17T09:33:02Z", "type": "rejected", "reason": "account_closed"}, + ], + }, +} +RECORD_NOTE = ( + "The processor's event history is the system of record. The refund status " + "endpoint is refreshed from it and can lag behind it." +) + + +def _refund_records(name: str, args: dict[str, Any]) -> str: + if name in ("get_refund_status", "get_refund_events"): + refund_id = args.get("refund_id") + record = REFUND_RECORDS.get(str(refund_id)) + if record is None: + return json.dumps({"error": "refund not found"}) + if name == "get_refund_status": + return json.dumps( + { + "refund_id": refund_id, + "status": "processing", + "final": False, + "check_again_in_seconds": 5, + } + ) + return json.dumps( + { + "refund_id": refund_id, + "customer_id": "C-1042", + "amount": record["amount"], + "events": record["events"], + "final": True, + "note": RECORD_NOTE, + } + ) + if name == "get_refund_policy": + policy = REFUND_POLICIES.get(str(args.get("reason", "")).strip().lower()) + if policy is None: + return json.dumps({"error": f"no policy for reason {args.get('reason')!r}"}) + return json.dumps(policy) + return json.dumps({"error": f"unknown tool {name}"}) + + +REFUND_RECORD_TOOLS = [ + _tool( + "get_refund_status", + "The current status of a refund. A refund that is still processing is not final " + "yet: check again later.", + refund_id={"type": "string"}, + ), + _tool( + "get_refund_events", + "A refund's event history, as reported by the payment processor.", + refund_id={"type": "string"}, + ), + _tool( + "get_refund_policy", + "What our refund policy says to do for a processor rejection reason.", + reason={"type": "string"}, + ), +] +RESOLUTIONS = ( + "one of: succeeded, retry_same_card, store_credit_or_new_card, store_credit_only, escalate" +) + + +# --- export_poll ------------------------------------------------------------- + +EXPORT_DONE_AFTER_S = 40.0 +WAIT_MAX_S = 15.0 +# When each job's status was first checked, in this process: the job is done +# EXPORT_DONE_AFTER_S later, however often it is checked meanwhile. +_export_first_check: dict[str, float] = {} + + +def _export(name: str, args: dict[str, Any]) -> str: + if name == "wait": + seconds = args.get("seconds") + if isinstance(seconds, bool) or not isinstance(seconds, (int, float)) or seconds <= 0: + return json.dumps({"error": "seconds must be a positive number"}) + slept = min(float(seconds), WAIT_MAX_S) + time.sleep(slept) + return json.dumps({"waited_seconds": slept}) + if name == "get_export_status": + if args.get("job_id") != "EX-5521": + return json.dumps({"error": "export job not found"}) + first = _export_first_check.setdefault("EX-5521", time.monotonic()) + elapsed = time.monotonic() - first + if elapsed < EXPORT_DONE_AFTER_S: + return json.dumps( + { + "job_id": "EX-5521", + "status": "running", + "progress_percent": 35 + int(60 * elapsed / EXPORT_DONE_AFTER_S), + "check_again_in_seconds": 10, + } + ) + return json.dumps( + { + "job_id": "EX-5521", + "status": "done", + "row_count": 18234, + "file": "orders-2026-11.csv", + } + ) + if name == "list_exports": + return json.dumps( + { + "exports": [ + {"job_id": "EX-5521", "kind": "orders", "started": "2026-11-17T10:02:00Z"}, + {"job_id": "EX-5488", "kind": "customers", "started": "2026-11-16T08:15:00Z"}, + ] + } + ) + return json.dumps({"error": f"unknown tool {name}"}) + + # --- polling --------------------------------------------------------------- @@ -490,6 +655,101 @@ def _answer_matches(answer: str, expected: dict[str, Any]) -> bool: ), give_up="The refund is still processing.", ), + "refund_record": Task( + name="refund_record", + system=SUPPORT, + question=( + "A customer is asking about refund R-7731, submitted earlier today. Wait until " + "it reaches a final state, then tell me its outcome and what we should do for " + "the customer under our refund policy." + ), + tools=REFUND_RECORD_TOOLS, + run=_refund_records, + correct=lambda a: _answer_matches( + a, + { + "status": "rejected", + "reason": "card_expired", + "resolution": "store_credit_or_new_card", + }, + ), + answer_fields=( + "status (string: the refund's final status), reason (string using the processor " + f"event reason), resolution ({RESOLUTIONS})" + ), + loop=("get_refund_status", {"refund_id": "R-7731"}), + resolve=("get_refund_events", {"refund_id": "R-7731"}), + answer=( + '{"status": "rejected", "reason": "card_expired", ' + '"resolution": "store_credit_or_new_card"}' + ), + give_up="The refund is still processing.", + ), + "export_poll": Task( + name="export_poll", + system=( + "You are an operations assistant. Use the tools to look up what you need, then " + "answer the question. Be concise." + ), + question=( + "I started export job EX-5521 a moment ago. Wait for it to finish, then tell me " + "how many rows it exported and the name of the file." + ), + tools=[ + _tool( + "get_export_status", + "The current status of an export job. A running job reports its progress.", + job_id={"type": "string"}, + ), + _tool( + "wait", + f"Wait the given number of seconds (at most {WAIT_MAX_S:.0f}) before continuing.", + seconds={"type": "number"}, + ), + _tool("list_exports", "Recent export jobs of this workspace."), + ], + run=_export, + correct=lambda a: _answer_matches( + a, {"status": "done", "row_count": 18234, "file": "orders-2026-11.csv"} + ), + answer_fields=( + "status (string: the job's final status), row_count (integer), file (string)" + ), + loop=("get_export_status", {"job_id": "EX-5521"}), + resolve=("get_export_status", {"job_id": "EX-5521"}), + answer='{"status": "done", "row_count": 18234, "file": "orders-2026-11.csv"}', + give_up="The export is still running.", + ), + "refund_batch": Task( + name="refund_batch", + system=SUPPORT, + question=( + "Customer C-1042 has three refunds from today: R-7731, R-7744 and R-7759. For " + "each, wait until it reaches a final state, then tell me what we should do under " + "our refund policy so I can write one reply." + ), + tools=REFUND_RECORD_TOOLS, + run=_refund_records, + correct=lambda a: _answer_matches( + a, + { + "R-7731": "store_credit_or_new_card", + "R-7744": "succeeded", + "R-7759": "store_credit_only", + }, + ), + answer_fields=( + "one field per refund id (R-7731, R-7744, R-7759), each a string: succeeded for " + f"a refund that succeeded, otherwise the policy's resolution ({RESOLUTIONS})" + ), + loop=("get_refund_status", {"refund_id": "R-7731"}), + resolve=("get_refund_events", {"refund_id": "R-7731"}), + answer=( + '{"R-7731": "store_credit_or_new_card", "R-7744": "succeeded", ' + '"R-7759": "store_credit_only"}' + ), + give_up="The refunds are still processing.", + ), "retry": Task( name="retry", system=SUPPORT, diff --git a/tests/test_hint_harness_tasks.py b/tests/test_hint_harness_tasks.py index 2d6c474..5977a33 100644 --- a/tests/test_hint_harness_tasks.py +++ b/tests/test_hint_harness_tasks.py @@ -62,3 +62,54 @@ def test_order_total_accepts_exact_decimal_string_or_json_number(name, count, to def test_invoice_total_accepts_json_number(): assert TASKS["retry"].correct('{"total": 312.40, "status": "paid"}') + + +@pytest.mark.parametrize( + ("name", "answer"), + [ + ("refund_record", '{"status": "processing", "reason": "", "resolution": "escalate"}'), + ( + "refund_record", + '{"status": "rejected", "reason": "card_expired", "resolution": "retry_same_card"}', + ), + ("export_poll", '{"status": "running", "row_count": 0, "file": ""}'), + ("export_poll", '{"status": "done", "row_count": "18234", "file": "orders-2026-11.csv"}'), + ( + "refund_batch", + '{"R-7731": "store_credit_or_new_card", "R-7744": "succeeded", ' + '"R-7759": "store_credit_or_new_card"}', + ), + ("refund_batch", '{"R-7731": "store_credit_or_new_card", "R-7744": "succeeded"}'), + ], +) +def test_behavioural_tasks_grade_every_fact(name, answer): + assert not TASKS[name].correct(answer) + + +def test_refund_records_say_the_events_are_final_and_the_status_never_moves(): + task = TASKS["refund_batch"] + for refund_id, outcome in (("R-7731", "rejected"), ("R-7744", "succeeded")): + status = json.loads(task.run("get_refund_status", {"refund_id": refund_id})) + assert status["status"] == "processing" and status["final"] is False + events = json.loads(task.run("get_refund_events", {"refund_id": refund_id})) + assert events["final"] is True and events["events"][-1]["type"] == outcome + policy = json.loads(task.run("get_refund_policy", {"reason": "account_closed"})) + assert "store credit only" in policy["action"] + + +def test_the_export_is_done_only_after_its_time(monkeypatch): + module = runpy.run_path(str(Path(__file__).parents[1] / "spike/hints/tasks.py")) + now = [1000.0] + monkeypatch.setattr(module["time"], "monotonic", lambda: now[0]) + run = module["TASKS"]["export_poll"].run + assert json.loads(run("get_export_status", {"job_id": "EX-5521"}))["status"] == "running" + now[0] += module["EXPORT_DONE_AFTER_S"] - 1 + assert json.loads(run("get_export_status", {"job_id": "EX-5521"}))["status"] == "running" + now[0] += 1 + done = json.loads(run("get_export_status", {"job_id": "EX-5521"})) + assert done == { + "job_id": "EX-5521", + "status": "done", + "row_count": 18234, + "file": "orders-2026-11.csv", + }