langgraph-api 0.4.48__py3-none-any.whl → 0.5.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of langgraph-api might be problematic. Click here for more details.
- langgraph_api/__init__.py +1 -1
- langgraph_api/api/assistants.py +65 -61
- langgraph_api/api/meta.py +6 -0
- langgraph_api/api/threads.py +1 -1
- langgraph_api/auth/custom.py +29 -24
- langgraph_api/config.py +56 -1
- langgraph_api/graph.py +1 -1
- langgraph_api/{grpc_ops → grpc}/client.py +91 -0
- langgraph_api/grpc/config_conversion.py +225 -0
- langgraph_api/grpc/generated/core_api_pb2.py +275 -0
- langgraph_api/{grpc_ops → grpc}/generated/core_api_pb2.pyi +20 -31
- langgraph_api/{grpc_ops → grpc}/generated/core_api_pb2_grpc.py +2 -2
- langgraph_api/grpc/generated/engine_common_pb2.py +190 -0
- langgraph_api/grpc/generated/engine_common_pb2.pyi +634 -0
- langgraph_api/grpc/generated/engine_common_pb2_grpc.py +24 -0
- langgraph_api/{grpc_ops → grpc}/ops.py +75 -217
- langgraph_api/js/package.json +5 -5
- langgraph_api/js/src/graph.mts +20 -0
- langgraph_api/js/yarn.lock +137 -187
- langgraph_api/queue_entrypoint.py +2 -2
- langgraph_api/route.py +14 -4
- langgraph_api/schema.py +2 -2
- langgraph_api/self_hosted_metrics.py +48 -2
- langgraph_api/serde.py +58 -14
- langgraph_api/worker.py +1 -1
- {langgraph_api-0.4.48.dist-info → langgraph_api-0.5.6.dist-info}/METADATA +5 -5
- {langgraph_api-0.4.48.dist-info → langgraph_api-0.5.6.dist-info}/RECORD +32 -28
- langgraph_api/grpc_ops/generated/core_api_pb2.py +0 -276
- /langgraph_api/{grpc_ops → grpc}/__init__.py +0 -0
- /langgraph_api/{grpc_ops → grpc}/generated/__init__.py +0 -0
- {langgraph_api-0.4.48.dist-info → langgraph_api-0.5.6.dist-info}/WHEEL +0 -0
- {langgraph_api-0.4.48.dist-info → langgraph_api-0.5.6.dist-info}/entry_points.txt +0 -0
- {langgraph_api-0.4.48.dist-info → langgraph_api-0.5.6.dist-info}/licenses/LICENSE +0 -0
langgraph_api/js/yarn.lock
CHANGED
|
@@ -180,10 +180,10 @@
|
|
|
180
180
|
resolved "https://registry.yarnpkg.com/@hono/zod-validator/-/zod-validator-0.2.2.tgz#929a1c40aee5eac1ed9c84094d6d977e0b70187a"
|
|
181
181
|
integrity sha512-dSDxaPV70Py8wuIU2QNpoVEIOSzSXZ/6/B/h4xA7eOMz7+AarKTSGV8E6QwrdcCbBLkpqfJ4Q2TmBO0eP1tCBQ==
|
|
182
182
|
|
|
183
|
-
"@jridgewell/sourcemap-codec@^1.5.
|
|
184
|
-
version "1.5.
|
|
185
|
-
resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.
|
|
186
|
-
integrity sha512-
|
|
183
|
+
"@jridgewell/sourcemap-codec@^1.5.5":
|
|
184
|
+
version "1.5.5"
|
|
185
|
+
resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz#6912b00d2c631c0d15ce1a7ab57cd657f2a8f8ba"
|
|
186
|
+
integrity sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==
|
|
187
187
|
|
|
188
188
|
"@langchain/core@^1.0.1":
|
|
189
189
|
version "1.0.1"
|
|
@@ -374,6 +374,11 @@
|
|
|
374
374
|
resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.41.1.tgz#848f99b0d9936d92221bb6070baeff4db6947a30"
|
|
375
375
|
integrity sha512-Wq2zpapRYLfi4aKxf2Xff0tN+7slj2d4R87WEzqw7ZLsVvO5zwYCIuEGSZYiK41+GlwUo1HiR+GdkLEJnCKTCw==
|
|
376
376
|
|
|
377
|
+
"@standard-schema/spec@^1.0.0":
|
|
378
|
+
version "1.0.0"
|
|
379
|
+
resolved "https://registry.yarnpkg.com/@standard-schema/spec/-/spec-1.0.0.tgz#f193b73dc316c4170f2e82a881da0f550d551b9c"
|
|
380
|
+
integrity sha512-m2bOd0f2RT9k8QJx1JN85cZYyH1RqFBdlwtkSlf4tBDYLCiiZnv1fIIwacK6cqwXavOydf0NPToMQgpKq+dVlA==
|
|
381
|
+
|
|
377
382
|
"@tailwindcss/node@4.0.11":
|
|
378
383
|
version "4.0.11"
|
|
379
384
|
resolved "https://registry.yarnpkg.com/@tailwindcss/node/-/node-4.0.11.tgz#0d635f7e4fb4407f61da2e81404e7dfb8ce500c9"
|
|
@@ -467,6 +472,19 @@
|
|
|
467
472
|
postcss "^8.4.41"
|
|
468
473
|
tailwindcss "4.0.11"
|
|
469
474
|
|
|
475
|
+
"@types/chai@^5.2.2":
|
|
476
|
+
version "5.2.3"
|
|
477
|
+
resolved "https://registry.yarnpkg.com/@types/chai/-/chai-5.2.3.tgz#8e9cd9e1c3581fa6b341a5aed5588eb285be0b4a"
|
|
478
|
+
integrity sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==
|
|
479
|
+
dependencies:
|
|
480
|
+
"@types/deep-eql" "*"
|
|
481
|
+
assertion-error "^2.0.1"
|
|
482
|
+
|
|
483
|
+
"@types/deep-eql@*":
|
|
484
|
+
version "4.0.2"
|
|
485
|
+
resolved "https://registry.yarnpkg.com/@types/deep-eql/-/deep-eql-4.0.2.tgz#334311971d3a07121e7eb91b684a605e7eea9cbd"
|
|
486
|
+
integrity sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==
|
|
487
|
+
|
|
470
488
|
"@types/estree@1.0.7":
|
|
471
489
|
version "1.0.7"
|
|
472
490
|
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.7.tgz#4158d3105276773d5b7695cd4834b1722e4f37a8"
|
|
@@ -528,64 +546,63 @@
|
|
|
528
546
|
dependencies:
|
|
529
547
|
debug "^4.1.1"
|
|
530
548
|
|
|
531
|
-
"@vitest/expect@
|
|
532
|
-
version "
|
|
533
|
-
resolved "https://registry.yarnpkg.com/@vitest/expect/-/expect-
|
|
534
|
-
integrity sha512-
|
|
549
|
+
"@vitest/expect@4.0.6":
|
|
550
|
+
version "4.0.6"
|
|
551
|
+
resolved "https://registry.yarnpkg.com/@vitest/expect/-/expect-4.0.6.tgz#33df10e2f9728b7338c2a2331c75814d1f840ab7"
|
|
552
|
+
integrity sha512-5j8UUlBVhOjhj4lR2Nt9sEV8b4WtbcYh8vnfhTNA2Kn5+smtevzjNq+xlBuVhnFGXiyPPNzGrOVvmyHWkS5QGg==
|
|
535
553
|
dependencies:
|
|
536
|
-
"@
|
|
537
|
-
"@
|
|
538
|
-
|
|
539
|
-
|
|
554
|
+
"@standard-schema/spec" "^1.0.0"
|
|
555
|
+
"@types/chai" "^5.2.2"
|
|
556
|
+
"@vitest/spy" "4.0.6"
|
|
557
|
+
"@vitest/utils" "4.0.6"
|
|
558
|
+
chai "^6.0.1"
|
|
559
|
+
tinyrainbow "^3.0.3"
|
|
540
560
|
|
|
541
|
-
"@vitest/mocker@
|
|
542
|
-
version "
|
|
543
|
-
resolved "https://registry.yarnpkg.com/@vitest/mocker/-/mocker-
|
|
544
|
-
integrity sha512-
|
|
561
|
+
"@vitest/mocker@4.0.6":
|
|
562
|
+
version "4.0.6"
|
|
563
|
+
resolved "https://registry.yarnpkg.com/@vitest/mocker/-/mocker-4.0.6.tgz#3e27579d4444ca113685fc040961ce4b415ba5d2"
|
|
564
|
+
integrity sha512-3COEIew5HqdzBFEYN9+u0dT3i/NCwppLnO1HkjGfAP1Vs3vti1Hxm/MvcbC4DAn3Szo1M7M3otiAaT83jvqIjA==
|
|
545
565
|
dependencies:
|
|
546
|
-
"@vitest/spy" "
|
|
566
|
+
"@vitest/spy" "4.0.6"
|
|
547
567
|
estree-walker "^3.0.3"
|
|
548
|
-
magic-string "^0.30.
|
|
568
|
+
magic-string "^0.30.19"
|
|
549
569
|
|
|
550
|
-
"@vitest/pretty-format@
|
|
551
|
-
version "
|
|
552
|
-
resolved "https://registry.yarnpkg.com/@vitest/pretty-format/-/pretty-format-
|
|
553
|
-
integrity sha512-
|
|
570
|
+
"@vitest/pretty-format@4.0.6":
|
|
571
|
+
version "4.0.6"
|
|
572
|
+
resolved "https://registry.yarnpkg.com/@vitest/pretty-format/-/pretty-format-4.0.6.tgz#af838540d3cd6b29c5d434fbdd36eb2543b040a3"
|
|
573
|
+
integrity sha512-4vptgNkLIA1W1Nn5X4x8rLJBzPiJwnPc+awKtfBE5hNMVsoAl/JCCPPzNrbf+L4NKgklsis5Yp2gYa+XAS442g==
|
|
554
574
|
dependencies:
|
|
555
|
-
tinyrainbow "^
|
|
575
|
+
tinyrainbow "^3.0.3"
|
|
556
576
|
|
|
557
|
-
"@vitest/runner@
|
|
558
|
-
version "
|
|
559
|
-
resolved "https://registry.yarnpkg.com/@vitest/runner/-/runner-
|
|
560
|
-
integrity sha512-
|
|
577
|
+
"@vitest/runner@4.0.6":
|
|
578
|
+
version "4.0.6"
|
|
579
|
+
resolved "https://registry.yarnpkg.com/@vitest/runner/-/runner-4.0.6.tgz#5a938015cfb202b96cbff4688400f1cd4899b40a"
|
|
580
|
+
integrity sha512-trPk5qpd7Jj+AiLZbV/e+KiiaGXZ8ECsRxtnPnCrJr9OW2mLB72Cb824IXgxVz/mVU3Aj4VebY+tDTPn++j1Og==
|
|
561
581
|
dependencies:
|
|
562
|
-
"@vitest/utils" "
|
|
582
|
+
"@vitest/utils" "4.0.6"
|
|
563
583
|
pathe "^2.0.3"
|
|
564
584
|
|
|
565
|
-
"@vitest/snapshot@
|
|
566
|
-
version "
|
|
567
|
-
resolved "https://registry.yarnpkg.com/@vitest/snapshot/-/snapshot-
|
|
568
|
-
integrity sha512-
|
|
585
|
+
"@vitest/snapshot@4.0.6":
|
|
586
|
+
version "4.0.6"
|
|
587
|
+
resolved "https://registry.yarnpkg.com/@vitest/snapshot/-/snapshot-4.0.6.tgz#5cf47e396123cc379944632e908e74fb78d58f13"
|
|
588
|
+
integrity sha512-PaYLt7n2YzuvxhulDDu6c9EosiRuIE+FI2ECKs6yvHyhoga+2TBWI8dwBjs+IeuQaMtZTfioa9tj3uZb7nev1g==
|
|
569
589
|
dependencies:
|
|
570
|
-
"@vitest/pretty-format" "
|
|
571
|
-
magic-string "^0.30.
|
|
590
|
+
"@vitest/pretty-format" "4.0.6"
|
|
591
|
+
magic-string "^0.30.19"
|
|
572
592
|
pathe "^2.0.3"
|
|
573
593
|
|
|
574
|
-
"@vitest/spy@
|
|
575
|
-
version "
|
|
576
|
-
resolved "https://registry.yarnpkg.com/@vitest/spy/-/spy-
|
|
577
|
-
integrity sha512-
|
|
578
|
-
dependencies:
|
|
579
|
-
tinyspy "^3.0.2"
|
|
594
|
+
"@vitest/spy@4.0.6":
|
|
595
|
+
version "4.0.6"
|
|
596
|
+
resolved "https://registry.yarnpkg.com/@vitest/spy/-/spy-4.0.6.tgz#3860eb53cfe333c5eefe8b510eb7d71da7f4bd70"
|
|
597
|
+
integrity sha512-g9jTUYPV1LtRPRCQfhbMintW7BTQz1n6WXYQYRQ25qkyffA4bjVXjkROokZnv7t07OqfaFKw1lPzqKGk1hmNuQ==
|
|
580
598
|
|
|
581
|
-
"@vitest/utils@
|
|
582
|
-
version "
|
|
583
|
-
resolved "https://registry.yarnpkg.com/@vitest/utils/-/utils-
|
|
584
|
-
integrity sha512-
|
|
599
|
+
"@vitest/utils@4.0.6":
|
|
600
|
+
version "4.0.6"
|
|
601
|
+
resolved "https://registry.yarnpkg.com/@vitest/utils/-/utils-4.0.6.tgz#e8ce743a4a5adcd7228823249b643bc894c0955d"
|
|
602
|
+
integrity sha512-bG43VS3iYKrMIZXBo+y8Pti0O7uNju3KvNn6DrQWhQQKcLavMB+0NZfO1/QBAEbq0MaQ3QjNsnnXlGQvsh0Z6A==
|
|
585
603
|
dependencies:
|
|
586
|
-
"@vitest/pretty-format" "
|
|
587
|
-
|
|
588
|
-
tinyrainbow "^2.0.0"
|
|
604
|
+
"@vitest/pretty-format" "4.0.6"
|
|
605
|
+
tinyrainbow "^3.0.3"
|
|
589
606
|
|
|
590
607
|
ansi-styles@^4.1.0:
|
|
591
608
|
version "4.3.0"
|
|
@@ -643,11 +660,6 @@ bundle-name@^4.1.0:
|
|
|
643
660
|
dependencies:
|
|
644
661
|
run-applescript "^7.0.0"
|
|
645
662
|
|
|
646
|
-
cac@^6.7.14:
|
|
647
|
-
version "6.7.14"
|
|
648
|
-
resolved "https://registry.yarnpkg.com/cac/-/cac-6.7.14.tgz#804e1e6f506ee363cb0e3ccbb09cad5dd9870959"
|
|
649
|
-
integrity sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==
|
|
650
|
-
|
|
651
663
|
camelcase@6:
|
|
652
664
|
version "6.3.0"
|
|
653
665
|
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a"
|
|
@@ -658,16 +670,10 @@ caniuse-lite@^1.0.30001646, caniuse-lite@^1.0.30001688:
|
|
|
658
670
|
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001702.tgz#cde16fa8adaa066c04aec2967b6cde46354644c4"
|
|
659
671
|
integrity sha512-LoPe/D7zioC0REI5W73PeR1e1MLCipRGq/VkovJnd6Df+QVqT+vT33OXCp8QUd7kA7RZrHWxb1B36OQKI/0gOA==
|
|
660
672
|
|
|
661
|
-
chai@^
|
|
662
|
-
version "
|
|
663
|
-
resolved "https://registry.yarnpkg.com/chai/-/chai-
|
|
664
|
-
integrity sha512-
|
|
665
|
-
dependencies:
|
|
666
|
-
assertion-error "^2.0.1"
|
|
667
|
-
check-error "^2.1.1"
|
|
668
|
-
deep-eql "^5.0.1"
|
|
669
|
-
loupe "^3.1.0"
|
|
670
|
-
pathval "^2.0.0"
|
|
673
|
+
chai@^6.0.1:
|
|
674
|
+
version "6.2.0"
|
|
675
|
+
resolved "https://registry.yarnpkg.com/chai/-/chai-6.2.0.tgz#181bca6a219cddb99c3eeefb82483800ffa550ce"
|
|
676
|
+
integrity sha512-aUTnJc/JipRzJrNADXVvpVqi6CO0dn3nx4EVPxijri+fj3LUUDyZQOgVeW54Ob3Y1Xh9Iz8f+CgaCl8v0mn9bA==
|
|
671
677
|
|
|
672
678
|
chalk@^4.1.2:
|
|
673
679
|
version "4.1.2"
|
|
@@ -677,11 +683,6 @@ chalk@^4.1.2:
|
|
|
677
683
|
ansi-styles "^4.1.0"
|
|
678
684
|
supports-color "^7.1.0"
|
|
679
685
|
|
|
680
|
-
check-error@^2.1.1:
|
|
681
|
-
version "2.1.1"
|
|
682
|
-
resolved "https://registry.yarnpkg.com/check-error/-/check-error-2.1.1.tgz#87eb876ae71ee388fa0471fe423f494be1d96ccc"
|
|
683
|
-
integrity sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==
|
|
684
|
-
|
|
685
686
|
color-convert@^1.9.3:
|
|
686
687
|
version "1.9.3"
|
|
687
688
|
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8"
|
|
@@ -764,17 +765,10 @@ csstype@^3.0.2:
|
|
|
764
765
|
resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.3.tgz#d80ff294d114fb0e6ac500fbf85b60137d7eff81"
|
|
765
766
|
integrity sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==
|
|
766
767
|
|
|
767
|
-
debug@^4.1.1:
|
|
768
|
-
version "4.3
|
|
769
|
-
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.
|
|
770
|
-
integrity sha512-
|
|
771
|
-
dependencies:
|
|
772
|
-
ms "^2.1.3"
|
|
773
|
-
|
|
774
|
-
debug@^4.4.0:
|
|
775
|
-
version "4.4.0"
|
|
776
|
-
resolved "https://registry.yarnpkg.com/debug/-/debug-4.4.0.tgz#2b3f2aea2ffeb776477460267377dc8710faba8a"
|
|
777
|
-
integrity sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==
|
|
768
|
+
debug@^4.1.1, debug@^4.4.3:
|
|
769
|
+
version "4.4.3"
|
|
770
|
+
resolved "https://registry.yarnpkg.com/debug/-/debug-4.4.3.tgz#c6ae432d9bd9662582fce08709b038c58e9e3d6a"
|
|
771
|
+
integrity sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==
|
|
778
772
|
dependencies:
|
|
779
773
|
ms "^2.1.3"
|
|
780
774
|
|
|
@@ -783,15 +777,10 @@ decamelize@1.2.0:
|
|
|
783
777
|
resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
|
|
784
778
|
integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==
|
|
785
779
|
|
|
786
|
-
dedent@^1.5.3:
|
|
787
|
-
version "1.
|
|
788
|
-
resolved "https://registry.yarnpkg.com/dedent/-/dedent-1.
|
|
789
|
-
integrity sha512-
|
|
790
|
-
|
|
791
|
-
deep-eql@^5.0.1:
|
|
792
|
-
version "5.0.2"
|
|
793
|
-
resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-5.0.2.tgz#4b756d8d770a9257300825d52a2c2cff99c3a341"
|
|
794
|
-
integrity sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==
|
|
780
|
+
dedent@^1.5.3, dedent@^1.7.0:
|
|
781
|
+
version "1.7.0"
|
|
782
|
+
resolved "https://registry.yarnpkg.com/dedent/-/dedent-1.7.0.tgz#c1f9445335f0175a96587be245a282ff451446ca"
|
|
783
|
+
integrity sha512-HGFtf8yhuhGhqO07SV79tRp+br4MnbdjeVxotpn1QBl30pcLLCQjX5b2295ll0fv8RKDKsmWYrl05usHM9CewQ==
|
|
795
784
|
|
|
796
785
|
default-browser-id@^5.0.0:
|
|
797
786
|
version "5.0.0"
|
|
@@ -912,16 +901,21 @@ exit-hook@^4.0.0:
|
|
|
912
901
|
resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-4.0.0.tgz#c1e16ebd03d3166f837b1502dac755bb5c460d58"
|
|
913
902
|
integrity sha512-Fqs7ChZm72y40wKjOFXBKg7nJZvQJmewP5/7LtePDdnah/+FH9Hp5sgMujSCMPXlxOAW2//1jrW9pnsY7o20vQ==
|
|
914
903
|
|
|
915
|
-
expect-type@^1.2.
|
|
916
|
-
version "1.2.
|
|
917
|
-
resolved "https://registry.yarnpkg.com/expect-type/-/expect-type-1.2.
|
|
918
|
-
integrity sha512
|
|
904
|
+
expect-type@^1.2.2:
|
|
905
|
+
version "1.2.2"
|
|
906
|
+
resolved "https://registry.yarnpkg.com/expect-type/-/expect-type-1.2.2.tgz#c030a329fb61184126c8447585bc75a7ec6fbff3"
|
|
907
|
+
integrity sha512-JhFGDVJ7tmDJItKhYgJCGLOWjuK9vPxiXoUFLwLDc99NlmklilbiQJwoctZtt13+xMw91MCk/REan6MWHqDjyA==
|
|
919
908
|
|
|
920
909
|
fdir@^6.4.4:
|
|
921
910
|
version "6.4.5"
|
|
922
911
|
resolved "https://registry.yarnpkg.com/fdir/-/fdir-6.4.5.tgz#328e280f3a23699362f95f2e82acf978a0c0cb49"
|
|
923
912
|
integrity sha512-4BG7puHpVsIYxZUbiUE3RqGloLaSSwzYie5jvasC4LWuBWzZawynvYouhjbQKw2JuIGYdm0DzIxl8iVidKlUEw==
|
|
924
913
|
|
|
914
|
+
fdir@^6.5.0:
|
|
915
|
+
version "6.5.0"
|
|
916
|
+
resolved "https://registry.yarnpkg.com/fdir/-/fdir-6.5.0.tgz#ed2ab967a331ade62f18d077dae192684d50d350"
|
|
917
|
+
integrity sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==
|
|
918
|
+
|
|
925
919
|
fecha@^4.2.0:
|
|
926
920
|
version "4.2.3"
|
|
927
921
|
resolved "https://registry.yarnpkg.com/fecha/-/fecha-4.2.3.tgz#4d9ccdbc61e8629b259fdca67e65891448d569fd"
|
|
@@ -949,11 +943,6 @@ generic-names@^4.0.0:
|
|
|
949
943
|
dependencies:
|
|
950
944
|
loader-utils "^3.2.0"
|
|
951
945
|
|
|
952
|
-
get-func-name@^2.0.1:
|
|
953
|
-
version "2.0.2"
|
|
954
|
-
resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.2.tgz#0d7cf20cd13fda808669ffa88f4ffc7a3943fc41"
|
|
955
|
-
integrity sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==
|
|
956
|
-
|
|
957
946
|
get-tsconfig@^4.7.5:
|
|
958
947
|
version "4.8.1"
|
|
959
948
|
resolved "https://registry.yarnpkg.com/get-tsconfig/-/get-tsconfig-4.8.1.tgz#8995eb391ae6e1638d251118c7b56de7eb425471"
|
|
@@ -971,10 +960,10 @@ has-flag@^4.0.0:
|
|
|
971
960
|
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b"
|
|
972
961
|
integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==
|
|
973
962
|
|
|
974
|
-
hono@^4.10.
|
|
975
|
-
version "4.10.
|
|
976
|
-
resolved "https://registry.yarnpkg.com/hono/-/hono-4.10.
|
|
977
|
-
integrity sha512-
|
|
963
|
+
hono@^4.10.4, hono@^4.5.4:
|
|
964
|
+
version "4.10.4"
|
|
965
|
+
resolved "https://registry.yarnpkg.com/hono/-/hono-4.10.4.tgz#226f19a7be0f524c3acb736f5c9da5bd081954ca"
|
|
966
|
+
integrity sha512-YG/fo7zlU3KwrBL5vDpWKisLYiM+nVstBQqfr7gCPbSYURnNEP9BDxEMz8KfsDR9JX0lJWDRNc6nXX31v7ZEyg==
|
|
978
967
|
|
|
979
968
|
icss-utils@^5.0.0, icss-utils@^5.1.0:
|
|
980
969
|
version "5.1.0"
|
|
@@ -1155,24 +1144,12 @@ logform@^2.2.0, logform@^2.7.0:
|
|
|
1155
1144
|
safe-stable-stringify "^2.3.1"
|
|
1156
1145
|
triple-beam "^1.3.0"
|
|
1157
1146
|
|
|
1158
|
-
|
|
1159
|
-
version "
|
|
1160
|
-
resolved "https://registry.yarnpkg.com/
|
|
1161
|
-
integrity sha512-
|
|
1162
|
-
dependencies:
|
|
1163
|
-
get-func-name "^2.0.1"
|
|
1164
|
-
|
|
1165
|
-
loupe@^3.1.3:
|
|
1166
|
-
version "3.1.3"
|
|
1167
|
-
resolved "https://registry.yarnpkg.com/loupe/-/loupe-3.1.3.tgz#042a8f7986d77f3d0f98ef7990a2b2fef18b0fd2"
|
|
1168
|
-
integrity sha512-kkIp7XSkP78ZxJEsSxW3712C6teJVoeHHwgo9zJ380de7IYyJ2ISlxojcH2pC5OFLewESmnRi/+XCDIEEVyoug==
|
|
1169
|
-
|
|
1170
|
-
magic-string@^0.30.17:
|
|
1171
|
-
version "0.30.17"
|
|
1172
|
-
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.30.17.tgz#450a449673d2460e5bbcfba9a61916a1714c7453"
|
|
1173
|
-
integrity sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==
|
|
1147
|
+
magic-string@^0.30.19:
|
|
1148
|
+
version "0.30.21"
|
|
1149
|
+
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.30.21.tgz#56763ec09a0fa8091df27879fd94d19078c00d91"
|
|
1150
|
+
integrity sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==
|
|
1174
1151
|
dependencies:
|
|
1175
|
-
"@jridgewell/sourcemap-codec" "^1.5.
|
|
1152
|
+
"@jridgewell/sourcemap-codec" "^1.5.5"
|
|
1176
1153
|
|
|
1177
1154
|
ms@^2.1.1, ms@^2.1.3:
|
|
1178
1155
|
version "2.1.3"
|
|
@@ -1271,20 +1248,15 @@ pathe@^2.0.3:
|
|
|
1271
1248
|
resolved "https://registry.yarnpkg.com/pathe/-/pathe-2.0.3.tgz#3ecbec55421685b70a9da872b2cff3e1cbed1716"
|
|
1272
1249
|
integrity sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==
|
|
1273
1250
|
|
|
1274
|
-
pathval@^2.0.0:
|
|
1275
|
-
version "2.0.0"
|
|
1276
|
-
resolved "https://registry.yarnpkg.com/pathval/-/pathval-2.0.0.tgz#7e2550b422601d4f6b8e26f1301bc8f15a741a25"
|
|
1277
|
-
integrity sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==
|
|
1278
|
-
|
|
1279
1251
|
picocolors@^1.0.0, picocolors@^1.0.1, picocolors@^1.1.1:
|
|
1280
1252
|
version "1.1.1"
|
|
1281
1253
|
resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b"
|
|
1282
1254
|
integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==
|
|
1283
1255
|
|
|
1284
|
-
picomatch@^4.0.2:
|
|
1285
|
-
version "4.0.
|
|
1286
|
-
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-4.0.
|
|
1287
|
-
integrity sha512-
|
|
1256
|
+
picomatch@^4.0.2, picomatch@^4.0.3:
|
|
1257
|
+
version "4.0.3"
|
|
1258
|
+
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-4.0.3.tgz#796c76136d1eead715db1e7bad785dedd695a042"
|
|
1259
|
+
integrity sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==
|
|
1288
1260
|
|
|
1289
1261
|
postcss-modules-extract-imports@^3.1.0:
|
|
1290
1262
|
version "3.1.0"
|
|
@@ -1355,10 +1327,10 @@ postgres@^3.4.4:
|
|
|
1355
1327
|
resolved "https://registry.yarnpkg.com/postgres/-/postgres-3.4.4.tgz#adbe08dc1fff0dea3559aa4f83ded70a289a6cb8"
|
|
1356
1328
|
integrity sha512-IbyN+9KslkqcXa8AO9fxpk97PA4pzewvpi2B3Dwy9u4zpV32QicaEdgmF3eSQUzdRk7ttDHQejNgAEr4XoeH4A==
|
|
1357
1329
|
|
|
1358
|
-
prettier@^3.
|
|
1359
|
-
version "3.
|
|
1360
|
-
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.
|
|
1361
|
-
integrity sha512-
|
|
1330
|
+
prettier@^3.6.2:
|
|
1331
|
+
version "3.6.2"
|
|
1332
|
+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.6.2.tgz#ccda02a1003ebbb2bfda6f83a074978f608b9393"
|
|
1333
|
+
integrity sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==
|
|
1362
1334
|
|
|
1363
1335
|
readable-stream@^3.4.0, readable-stream@^3.6.2:
|
|
1364
1336
|
version "3.6.2"
|
|
@@ -1528,38 +1500,28 @@ tinyexec@^0.3.2:
|
|
|
1528
1500
|
resolved "https://registry.yarnpkg.com/tinyexec/-/tinyexec-0.3.2.tgz#941794e657a85e496577995c6eef66f53f42b3d2"
|
|
1529
1501
|
integrity sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==
|
|
1530
1502
|
|
|
1531
|
-
tinyglobby@^0.2.13:
|
|
1532
|
-
version "0.2.
|
|
1533
|
-
resolved "https://registry.yarnpkg.com/tinyglobby/-/tinyglobby-0.2.
|
|
1534
|
-
integrity sha512-
|
|
1503
|
+
tinyglobby@^0.2.13, tinyglobby@^0.2.15:
|
|
1504
|
+
version "0.2.15"
|
|
1505
|
+
resolved "https://registry.yarnpkg.com/tinyglobby/-/tinyglobby-0.2.15.tgz#e228dd1e638cea993d2fdb4fcd2d4602a79951c2"
|
|
1506
|
+
integrity sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==
|
|
1535
1507
|
dependencies:
|
|
1536
|
-
fdir "^6.
|
|
1537
|
-
picomatch "^4.0.
|
|
1508
|
+
fdir "^6.5.0"
|
|
1509
|
+
picomatch "^4.0.3"
|
|
1538
1510
|
|
|
1539
|
-
|
|
1540
|
-
version "
|
|
1541
|
-
resolved "https://registry.yarnpkg.com/
|
|
1542
|
-
integrity sha512-
|
|
1543
|
-
|
|
1544
|
-
tinyrainbow@^2.0.0:
|
|
1545
|
-
version "2.0.0"
|
|
1546
|
-
resolved "https://registry.yarnpkg.com/tinyrainbow/-/tinyrainbow-2.0.0.tgz#9509b2162436315e80e3eee0fcce4474d2444294"
|
|
1547
|
-
integrity sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==
|
|
1548
|
-
|
|
1549
|
-
tinyspy@^3.0.2:
|
|
1550
|
-
version "3.0.2"
|
|
1551
|
-
resolved "https://registry.yarnpkg.com/tinyspy/-/tinyspy-3.0.2.tgz#86dd3cf3d737b15adcf17d7887c84a75201df20a"
|
|
1552
|
-
integrity sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==
|
|
1511
|
+
tinyrainbow@^3.0.3:
|
|
1512
|
+
version "3.0.3"
|
|
1513
|
+
resolved "https://registry.yarnpkg.com/tinyrainbow/-/tinyrainbow-3.0.3.tgz#984a5b1c1b25854a9b6bccbe77964d0593d1ea42"
|
|
1514
|
+
integrity sha512-PSkbLUoxOFRzJYjjxHJt9xro7D+iilgMX/C9lawzVuYiIdcihh9DXmVibBe8lmcFrRi/VzlPjBxbN7rH24q8/Q==
|
|
1553
1515
|
|
|
1554
1516
|
triple-beam@^1.3.0:
|
|
1555
1517
|
version "1.4.1"
|
|
1556
1518
|
resolved "https://registry.yarnpkg.com/triple-beam/-/triple-beam-1.4.1.tgz#6fde70271dc6e5d73ca0c3b24e2d92afb7441984"
|
|
1557
1519
|
integrity sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg==
|
|
1558
1520
|
|
|
1559
|
-
tsx@^4.19.3:
|
|
1560
|
-
version "4.
|
|
1561
|
-
resolved "https://registry.yarnpkg.com/tsx/-/tsx-4.
|
|
1562
|
-
integrity sha512-
|
|
1521
|
+
tsx@^4.19.3, tsx@^4.20.6:
|
|
1522
|
+
version "4.20.6"
|
|
1523
|
+
resolved "https://registry.yarnpkg.com/tsx/-/tsx-4.20.6.tgz#8fb803fd9c1f70e8ccc93b5d7c5e03c3979ccb2e"
|
|
1524
|
+
integrity sha512-ytQKuwgmrrkDTFP4LjR0ToE2nqgy886GpvRSpU0JAnrdBYppuY5rLkRUYPU1yCryb24SsKBTL/hlDQAEFVwtZg==
|
|
1563
1525
|
dependencies:
|
|
1564
1526
|
esbuild "~0.25.0"
|
|
1565
1527
|
get-tsconfig "^4.7.5"
|
|
@@ -1609,18 +1571,7 @@ uuid@^9.0.0:
|
|
|
1609
1571
|
resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.1.tgz#e188d4c8853cc722220392c424cd637f32293f30"
|
|
1610
1572
|
integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==
|
|
1611
1573
|
|
|
1612
|
-
vite
|
|
1613
|
-
version "3.1.4"
|
|
1614
|
-
resolved "https://registry.yarnpkg.com/vite-node/-/vite-node-3.1.4.tgz#13f10b2cb155197a971cb2761664ec952c6cae18"
|
|
1615
|
-
integrity sha512-6enNwYnpyDo4hEgytbmc6mYWHXDHYEn0D1/rw4Q+tnHUGtKTJsn8T1YkX6Q18wI5LCrS8CTYlBaiCqxOy2kvUA==
|
|
1616
|
-
dependencies:
|
|
1617
|
-
cac "^6.7.14"
|
|
1618
|
-
debug "^4.4.0"
|
|
1619
|
-
es-module-lexer "^1.7.0"
|
|
1620
|
-
pathe "^2.0.3"
|
|
1621
|
-
vite "^5.0.0 || ^6.0.0"
|
|
1622
|
-
|
|
1623
|
-
"vite@^5.0.0 || ^6.0.0", vite@^6.1.6, vite@^6.4.1:
|
|
1574
|
+
"vite@^6.0.0 || ^7.0.0", vite@^6.1.6, vite@^6.4.1:
|
|
1624
1575
|
version "6.4.1"
|
|
1625
1576
|
resolved "https://registry.yarnpkg.com/vite/-/vite-6.4.1.tgz#afbe14518cdd6887e240a4b0221ab6d0ce733f96"
|
|
1626
1577
|
integrity sha512-+Oxm7q9hDoLMyJOYfUYBuHQo+dkAloi33apOPP56pzj+vsdJDzr+j1NISE5pyaAuKL4A3UD34qd0lx5+kfKp2g==
|
|
@@ -1634,31 +1585,30 @@ vite-node@3.1.4:
|
|
|
1634
1585
|
optionalDependencies:
|
|
1635
1586
|
fsevents "~2.3.3"
|
|
1636
1587
|
|
|
1637
|
-
vitest@^
|
|
1638
|
-
version "
|
|
1639
|
-
resolved "https://registry.yarnpkg.com/vitest/-/vitest-
|
|
1640
|
-
integrity sha512-
|
|
1641
|
-
dependencies:
|
|
1642
|
-
"@vitest/expect" "
|
|
1643
|
-
"@vitest/mocker" "
|
|
1644
|
-
"@vitest/pretty-format" "
|
|
1645
|
-
"@vitest/runner" "
|
|
1646
|
-
"@vitest/snapshot" "
|
|
1647
|
-
"@vitest/spy" "
|
|
1648
|
-
"@vitest/utils" "
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
expect-type "^1.2.
|
|
1652
|
-
magic-string "^0.30.
|
|
1588
|
+
vitest@^4.0.6:
|
|
1589
|
+
version "4.0.6"
|
|
1590
|
+
resolved "https://registry.yarnpkg.com/vitest/-/vitest-4.0.6.tgz#a0cbc78192cce8726d06c471b8e5b5b9cc6beea5"
|
|
1591
|
+
integrity sha512-gR7INfiVRwnEOkCk47faros/9McCZMp5LM+OMNWGLaDBSvJxIzwjgNFufkuePBNaesGRnLmNfW+ddbUJRZn0nQ==
|
|
1592
|
+
dependencies:
|
|
1593
|
+
"@vitest/expect" "4.0.6"
|
|
1594
|
+
"@vitest/mocker" "4.0.6"
|
|
1595
|
+
"@vitest/pretty-format" "4.0.6"
|
|
1596
|
+
"@vitest/runner" "4.0.6"
|
|
1597
|
+
"@vitest/snapshot" "4.0.6"
|
|
1598
|
+
"@vitest/spy" "4.0.6"
|
|
1599
|
+
"@vitest/utils" "4.0.6"
|
|
1600
|
+
debug "^4.4.3"
|
|
1601
|
+
es-module-lexer "^1.7.0"
|
|
1602
|
+
expect-type "^1.2.2"
|
|
1603
|
+
magic-string "^0.30.19"
|
|
1653
1604
|
pathe "^2.0.3"
|
|
1605
|
+
picomatch "^4.0.3"
|
|
1654
1606
|
std-env "^3.9.0"
|
|
1655
1607
|
tinybench "^2.9.0"
|
|
1656
1608
|
tinyexec "^0.3.2"
|
|
1657
|
-
tinyglobby "^0.2.
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
vite "^5.0.0 || ^6.0.0"
|
|
1661
|
-
vite-node "3.1.4"
|
|
1609
|
+
tinyglobby "^0.2.15"
|
|
1610
|
+
tinyrainbow "^3.0.3"
|
|
1611
|
+
vite "^6.0.0 || ^7.0.0"
|
|
1662
1612
|
why-is-node-running "^2.3.0"
|
|
1663
1613
|
|
|
1664
1614
|
why-is-node-running@^2.3.0:
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
# ruff: noqa: E402
|
|
2
2
|
import os
|
|
3
3
|
|
|
4
|
-
from langgraph_api.api.meta import METRICS_FORMATS
|
|
5
|
-
|
|
6
4
|
if not (
|
|
7
5
|
(disable_truststore := os.getenv("DISABLE_TRUSTSTORE"))
|
|
8
6
|
and disable_truststore.lower() == "true"
|
|
@@ -45,6 +43,8 @@ async def health_and_metrics_server():
|
|
|
45
43
|
from starlette.responses import JSONResponse, PlainTextResponse
|
|
46
44
|
from starlette.routing import Route
|
|
47
45
|
|
|
46
|
+
from langgraph_api.api.meta import METRICS_FORMATS
|
|
47
|
+
|
|
48
48
|
port = int(os.getenv("PORT", "8080"))
|
|
49
49
|
host = os.getenv("LANGGRAPH_SERVER_HOST", "0.0.0.0")
|
|
50
50
|
|
langgraph_api/route.py
CHANGED
|
@@ -14,6 +14,7 @@ from starlette.responses import JSONResponse
|
|
|
14
14
|
from starlette.routing import Route, compile_path, get_name
|
|
15
15
|
from starlette.types import ASGIApp, Receive, Scope, Send
|
|
16
16
|
|
|
17
|
+
from langgraph_api import config
|
|
17
18
|
from langgraph_api.serde import json_dumpb
|
|
18
19
|
from langgraph_api.utils import get_auth_ctx, with_user
|
|
19
20
|
|
|
@@ -58,10 +59,11 @@ class ApiResponse(JSONResponse):
|
|
|
58
59
|
|
|
59
60
|
|
|
60
61
|
def _json_loads(content: bytearray, schema: SchemaType) -> typing.Any:
|
|
61
|
-
|
|
62
|
+
"""Parse JSON and validate schema. Used by threadpool for large payloads."""
|
|
63
|
+
json_data = orjson.loads(content)
|
|
62
64
|
if schema is not None:
|
|
63
|
-
schema.validate(
|
|
64
|
-
return
|
|
65
|
+
schema.validate(json_data)
|
|
66
|
+
return json_data
|
|
65
67
|
|
|
66
68
|
|
|
67
69
|
class ApiRequest(Request):
|
|
@@ -76,8 +78,16 @@ class ApiRequest(Request):
|
|
|
76
78
|
async def json(self, schema: SchemaType = None) -> typing.Any:
|
|
77
79
|
if not hasattr(self, "_json"):
|
|
78
80
|
body = await self.body()
|
|
81
|
+
|
|
82
|
+
# Hybrid approach for optimal performance:
|
|
83
|
+
# - Small payloads: parse directly (fast, no queueing/thread pool limitations)
|
|
84
|
+
# - Large payloads: use dedicated thread pool (safer, doesn't block event loop)
|
|
79
85
|
try:
|
|
80
|
-
self._json =
|
|
86
|
+
self._json = (
|
|
87
|
+
await run_in_threadpool(_json_loads, body, schema)
|
|
88
|
+
if len(body) > config.JSON_THREAD_POOL_MINIMUM_SIZE_BYTES
|
|
89
|
+
else _json_loads(body, schema)
|
|
90
|
+
)
|
|
81
91
|
except orjson.JSONDecodeError as e:
|
|
82
92
|
raise HTTPException(
|
|
83
93
|
status_code=422, detail="Invalid JSON in request body"
|
langgraph_api/schema.py
CHANGED
|
@@ -249,8 +249,8 @@ class ThreadUpdateResponse(TypedDict):
|
|
|
249
249
|
class QueueStats(TypedDict):
|
|
250
250
|
n_pending: int
|
|
251
251
|
n_running: int
|
|
252
|
-
|
|
253
|
-
|
|
252
|
+
pending_runs_wait_time_max_secs: float | None
|
|
253
|
+
pending_runs_wait_time_med_secs: float | None
|
|
254
254
|
|
|
255
255
|
|
|
256
256
|
# Canonical field sets for select= validation and type aliases for ops
|
|
@@ -109,6 +109,20 @@ def initialize_self_hosted_metrics():
|
|
|
109
109
|
callbacks=[_get_running_runs_callback],
|
|
110
110
|
)
|
|
111
111
|
|
|
112
|
+
meter.create_observable_gauge(
|
|
113
|
+
name="lg_api_pending_runs_wait_time_max",
|
|
114
|
+
description="The maximum time a run has been pending, in seconds",
|
|
115
|
+
unit="s",
|
|
116
|
+
callbacks=[_get_pending_runs_wait_time_max_callback],
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
meter.create_observable_gauge(
|
|
120
|
+
name="lg_api_pending_runs_wait_time_med",
|
|
121
|
+
description="The median pending wait time across runs, in seconds",
|
|
122
|
+
unit="s",
|
|
123
|
+
callbacks=[_get_pending_runs_wait_time_med_callback],
|
|
124
|
+
)
|
|
125
|
+
|
|
112
126
|
if config.N_JOBS_PER_WORKER > 0:
|
|
113
127
|
meter.create_observable_gauge(
|
|
114
128
|
name="lg_api_workers_max",
|
|
@@ -232,14 +246,24 @@ def _get_queue_stats():
|
|
|
232
246
|
return await Runs.stats(conn)
|
|
233
247
|
except Exception as e:
|
|
234
248
|
logger.warning("Failed to get queue stats from database", exc_info=e)
|
|
235
|
-
return {
|
|
249
|
+
return {
|
|
250
|
+
"n_pending": 0,
|
|
251
|
+
"n_running": 0,
|
|
252
|
+
"pending_runs_wait_time_max_secs": 0,
|
|
253
|
+
"pending_runs_wait_time_med_secs": 0,
|
|
254
|
+
}
|
|
236
255
|
|
|
237
256
|
try:
|
|
238
257
|
future = lg_asyncio.run_coroutine_threadsafe(_fetch_queue_stats())
|
|
239
258
|
return future.result(timeout=5)
|
|
240
259
|
except Exception as e:
|
|
241
260
|
logger.warning("Failed to get queue stats", exc_info=e)
|
|
242
|
-
return {
|
|
261
|
+
return {
|
|
262
|
+
"n_pending": 0,
|
|
263
|
+
"n_running": 0,
|
|
264
|
+
"pending_runs_wait_time_max_secs": 0,
|
|
265
|
+
"pending_runs_wait_time_med_secs": 0,
|
|
266
|
+
}
|
|
243
267
|
|
|
244
268
|
|
|
245
269
|
def _get_pool_stats():
|
|
@@ -280,6 +304,28 @@ def _get_running_runs_callback(options: CallbackOptions):
|
|
|
280
304
|
return [Observation(0, attributes=_customer_attributes)]
|
|
281
305
|
|
|
282
306
|
|
|
307
|
+
def _get_pending_runs_wait_time_max_callback(options: CallbackOptions):
|
|
308
|
+
try:
|
|
309
|
+
stats = _get_queue_stats()
|
|
310
|
+
value = stats.get("pending_runs_wait_time_max_secs")
|
|
311
|
+
value = 0 if value is None else value
|
|
312
|
+
return [Observation(value, attributes=_customer_attributes)]
|
|
313
|
+
except Exception as e:
|
|
314
|
+
logger.warning("Failed to get max pending wait time", exc_info=e)
|
|
315
|
+
return [Observation(0, attributes=_customer_attributes)]
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
def _get_pending_runs_wait_time_med_callback(options: CallbackOptions):
|
|
319
|
+
try:
|
|
320
|
+
stats = _get_queue_stats()
|
|
321
|
+
value = stats.get("pending_runs_wait_time_med_secs")
|
|
322
|
+
value = 0 if value is None else value
|
|
323
|
+
return [Observation(value, attributes=_customer_attributes)]
|
|
324
|
+
except Exception as e:
|
|
325
|
+
logger.warning("Failed to get median pending wait time", exc_info=e)
|
|
326
|
+
return [Observation(0, attributes=_customer_attributes)]
|
|
327
|
+
|
|
328
|
+
|
|
283
329
|
def _get_workers_max_callback(options: CallbackOptions):
|
|
284
330
|
try:
|
|
285
331
|
metrics_data = get_metrics()
|