langgraph-api 0.2.130__py3-none-any.whl → 0.2.134__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.
Files changed (51) hide show
  1. langgraph_api/__init__.py +1 -1
  2. langgraph_api/api/assistants.py +32 -6
  3. langgraph_api/api/meta.py +3 -1
  4. langgraph_api/api/openapi.py +1 -1
  5. langgraph_api/api/runs.py +50 -10
  6. langgraph_api/api/threads.py +27 -1
  7. langgraph_api/api/ui.py +2 -0
  8. langgraph_api/asgi_transport.py +2 -2
  9. langgraph_api/asyncio.py +10 -8
  10. langgraph_api/auth/custom.py +9 -4
  11. langgraph_api/auth/langsmith/client.py +1 -1
  12. langgraph_api/cli.py +5 -4
  13. langgraph_api/config.py +1 -1
  14. langgraph_api/executor_entrypoint.py +23 -0
  15. langgraph_api/graph.py +25 -9
  16. langgraph_api/http.py +10 -7
  17. langgraph_api/http_metrics.py +4 -1
  18. langgraph_api/js/build.mts +11 -2
  19. langgraph_api/js/client.http.mts +2 -0
  20. langgraph_api/js/client.mts +13 -3
  21. langgraph_api/js/package.json +2 -2
  22. langgraph_api/js/remote.py +17 -12
  23. langgraph_api/js/src/preload.mjs +9 -1
  24. langgraph_api/js/src/utils/files.mts +5 -2
  25. langgraph_api/js/sse.py +1 -1
  26. langgraph_api/js/yarn.lock +9 -9
  27. langgraph_api/logging.py +3 -3
  28. langgraph_api/middleware/http_logger.py +2 -1
  29. langgraph_api/models/run.py +19 -14
  30. langgraph_api/patch.py +2 -2
  31. langgraph_api/queue_entrypoint.py +33 -18
  32. langgraph_api/schema.py +88 -4
  33. langgraph_api/serde.py +32 -5
  34. langgraph_api/server.py +5 -3
  35. langgraph_api/state.py +8 -8
  36. langgraph_api/store.py +1 -1
  37. langgraph_api/stream.py +33 -20
  38. langgraph_api/traceblock.py +1 -1
  39. langgraph_api/utils/__init__.py +40 -5
  40. langgraph_api/utils/config.py +13 -4
  41. langgraph_api/utils/future.py +1 -1
  42. langgraph_api/utils/uuids.py +87 -0
  43. langgraph_api/validation.py +9 -0
  44. langgraph_api/webhook.py +20 -20
  45. langgraph_api/worker.py +8 -5
  46. {langgraph_api-0.2.130.dist-info → langgraph_api-0.2.134.dist-info}/METADATA +2 -2
  47. {langgraph_api-0.2.130.dist-info → langgraph_api-0.2.134.dist-info}/RECORD +51 -49
  48. openapi.json +331 -1
  49. {langgraph_api-0.2.130.dist-info → langgraph_api-0.2.134.dist-info}/WHEEL +0 -0
  50. {langgraph_api-0.2.130.dist-info → langgraph_api-0.2.134.dist-info}/entry_points.txt +0 -0
  51. {langgraph_api-0.2.130.dist-info → langgraph_api-0.2.134.dist-info}/licenses/LICENSE +0 -0
openapi.json CHANGED
@@ -157,6 +157,59 @@
157
157
  }
158
158
  }
159
159
  },
160
+ "/assistants/count": {
161
+ "post": {
162
+ "tags": [
163
+ "Assistants"
164
+ ],
165
+ "summary": "Count Assistants",
166
+ "description": "Get the count of assistants matching the specified criteria.",
167
+ "operationId": "count_assistants_assistants_count_post",
168
+ "requestBody": {
169
+ "content": {
170
+ "application/json": {
171
+ "schema": {
172
+ "$ref": "#/components/schemas/AssistantCountRequest"
173
+ }
174
+ }
175
+ },
176
+ "required": true
177
+ },
178
+ "responses": {
179
+ "200": {
180
+ "description": "Success",
181
+ "content": {
182
+ "application/json": {
183
+ "schema": {
184
+ "type": "integer",
185
+ "title": "Count"
186
+ }
187
+ }
188
+ }
189
+ },
190
+ "404": {
191
+ "description": "Not Found",
192
+ "content": {
193
+ "application/json": {
194
+ "schema": {
195
+ "$ref": "#/components/schemas/ErrorResponse"
196
+ }
197
+ }
198
+ }
199
+ },
200
+ "422": {
201
+ "description": "Validation Error",
202
+ "content": {
203
+ "application/json": {
204
+ "schema": {
205
+ "$ref": "#/components/schemas/ErrorResponse"
206
+ }
207
+ }
208
+ }
209
+ }
210
+ }
211
+ }
212
+ },
160
213
  "/assistants/{assistant_id}": {
161
214
  "get": {
162
215
  "tags": [
@@ -813,6 +866,59 @@
813
866
  }
814
867
  }
815
868
  },
869
+ "/threads/count": {
870
+ "post": {
871
+ "tags": [
872
+ "Threads"
873
+ ],
874
+ "summary": "Count Threads",
875
+ "description": "Get the count of threads matching the specified criteria.",
876
+ "operationId": "count_threads_threads_count_post",
877
+ "requestBody": {
878
+ "content": {
879
+ "application/json": {
880
+ "schema": {
881
+ "$ref": "#/components/schemas/ThreadCountRequest"
882
+ }
883
+ }
884
+ },
885
+ "required": true
886
+ },
887
+ "responses": {
888
+ "200": {
889
+ "description": "Success",
890
+ "content": {
891
+ "application/json": {
892
+ "schema": {
893
+ "type": "integer",
894
+ "title": "Count"
895
+ }
896
+ }
897
+ }
898
+ },
899
+ "404": {
900
+ "description": "Not Found",
901
+ "content": {
902
+ "application/json": {
903
+ "schema": {
904
+ "$ref": "#/components/schemas/ErrorResponse"
905
+ }
906
+ }
907
+ }
908
+ },
909
+ "422": {
910
+ "description": "Validation Error",
911
+ "content": {
912
+ "application/json": {
913
+ "schema": {
914
+ "$ref": "#/components/schemas/ErrorResponse"
915
+ }
916
+ }
917
+ }
918
+ }
919
+ }
920
+ }
921
+ },
816
922
  "/threads/{thread_id}/state": {
817
923
  "get": {
818
924
  "tags": [
@@ -1469,6 +1575,30 @@
1469
1575
  },
1470
1576
  "name": "status",
1471
1577
  "in": "query"
1578
+ },
1579
+ {
1580
+ "required": false,
1581
+ "schema": {
1582
+ "type": "array",
1583
+ "items": {
1584
+ "type": "string",
1585
+ "enum": [
1586
+ "run_id",
1587
+ "thread_id",
1588
+ "assistant_id",
1589
+ "created_at",
1590
+ "updated_at",
1591
+ "status",
1592
+ "metadata",
1593
+ "kwargs",
1594
+ "multitask_strategy"
1595
+ ]
1596
+ },
1597
+ "title": "Select",
1598
+ "description": "Specify which fields to return. If not provided, all fields are returned."
1599
+ },
1600
+ "name": "select",
1601
+ "in": "query"
1472
1602
  }
1473
1603
  ],
1474
1604
  "responses": {
@@ -2320,6 +2450,59 @@
2320
2450
  }
2321
2451
  }
2322
2452
  },
2453
+ "/runs/crons/count": {
2454
+ "post": {
2455
+ "tags": [
2456
+ "Crons (Plus tier)"
2457
+ ],
2458
+ "summary": "Count Crons",
2459
+ "description": "Get the count of crons matching the specified criteria.",
2460
+ "operationId": "count_crons_runs_crons_count_post",
2461
+ "requestBody": {
2462
+ "content": {
2463
+ "application/json": {
2464
+ "schema": {
2465
+ "$ref": "#/components/schemas/CronCountRequest"
2466
+ }
2467
+ }
2468
+ },
2469
+ "required": true
2470
+ },
2471
+ "responses": {
2472
+ "200": {
2473
+ "description": "Success",
2474
+ "content": {
2475
+ "application/json": {
2476
+ "schema": {
2477
+ "type": "integer",
2478
+ "title": "Count"
2479
+ }
2480
+ }
2481
+ }
2482
+ },
2483
+ "404": {
2484
+ "description": "Not Found",
2485
+ "content": {
2486
+ "application/json": {
2487
+ "schema": {
2488
+ "$ref": "#/components/schemas/ErrorResponse"
2489
+ }
2490
+ }
2491
+ }
2492
+ },
2493
+ "422": {
2494
+ "description": "Validation Error",
2495
+ "content": {
2496
+ "application/json": {
2497
+ "schema": {
2498
+ "$ref": "#/components/schemas/ErrorResponse"
2499
+ }
2500
+ }
2501
+ }
2502
+ }
2503
+ }
2504
+ }
2505
+ },
2323
2506
  "/runs/stream": {
2324
2507
  "post": {
2325
2508
  "tags": [
@@ -3379,6 +3562,12 @@
3379
3562
  "title": "Cron Id",
3380
3563
  "description": "The ID of the cron."
3381
3564
  },
3565
+ "assistant_id": {
3566
+ "type": ["string", "null"],
3567
+ "format": "uuid",
3568
+ "title": "Assistant Id",
3569
+ "description": "The ID of the assistant."
3570
+ },
3382
3571
  "thread_id": {
3383
3572
  "type": "string",
3384
3573
  "format": "uuid",
@@ -3408,10 +3597,26 @@
3408
3597
  "title": "Updated At",
3409
3598
  "description": "The last time the cron was updated."
3410
3599
  },
3600
+ "user_id": {
3601
+ "type": ["string", "null"],
3602
+ "title": "User Id",
3603
+ "description": "The ID of the user."
3604
+ },
3411
3605
  "payload": {
3412
3606
  "type": "object",
3413
3607
  "title": "Payload",
3414
3608
  "description": "The run payload to use for creating new run."
3609
+ },
3610
+ "next_run_date": {
3611
+ "type": ["string", "null"],
3612
+ "format": "date-time",
3613
+ "title": "Next Run Date",
3614
+ "description": "The next run date of the cron."
3615
+ },
3616
+ "metadata": {
3617
+ "type": "object",
3618
+ "title": "Metadata",
3619
+ "description": "The cron metadata."
3415
3620
  }
3416
3621
  },
3417
3622
  "type": "object",
@@ -3572,7 +3777,7 @@
3572
3777
  "type": "string",
3573
3778
  "format": "uuid",
3574
3779
  "title": "Assistant Id",
3575
- "description": "The assistant ID or graph name to search for."
3780
+ "description": "The assistant ID or graph name to filter by using exact match."
3576
3781
  },
3577
3782
  "thread_id": {
3578
3783
  "type": "string",
@@ -3608,6 +3813,28 @@
3608
3813
  "description": "The order to sort by.",
3609
3814
  "default": "desc",
3610
3815
  "enum": ["asc", "desc"]
3816
+ },
3817
+ "select": {
3818
+ "type": "array",
3819
+ "items": {
3820
+ "type": "string",
3821
+ "enum": [
3822
+ "cron_id",
3823
+ "assistant_id",
3824
+ "thread_id",
3825
+ "end_time",
3826
+ "schedule",
3827
+ "created_at",
3828
+ "updated_at",
3829
+ "user_id",
3830
+ "payload",
3831
+ "next_run_date",
3832
+ "metadata",
3833
+ "now"
3834
+ ]
3835
+ },
3836
+ "title": "Select",
3837
+ "description": "Specify which fields to return. If not provided, all fields are returned."
3611
3838
  }
3612
3839
  },
3613
3840
  "type": "object",
@@ -3615,6 +3842,25 @@
3615
3842
  "title": "CronSearch",
3616
3843
  "description": "Payload for listing crons"
3617
3844
  },
3845
+ "CronCountRequest": {
3846
+ "properties": {
3847
+ "assistant_id": {
3848
+ "type": "string",
3849
+ "format": "uuid",
3850
+ "title": "Assistant Id",
3851
+ "description": "The assistant ID or graph name to search for."
3852
+ },
3853
+ "thread_id": {
3854
+ "type": "string",
3855
+ "format": "uuid",
3856
+ "title": "Thread Id",
3857
+ "description": "The thread ID to search for."
3858
+ }
3859
+ },
3860
+ "type": "object",
3861
+ "title": "CronCountRequest",
3862
+ "description": "Payload for counting crons"
3863
+ },
3618
3864
  "GraphSchema": {
3619
3865
  "properties": {
3620
3866
  "graph_id": {
@@ -4392,12 +4638,49 @@
4392
4638
  ],
4393
4639
  "title": "Sort Order",
4394
4640
  "description": "The order to sort by."
4641
+ },
4642
+ "select": {
4643
+ "type": "array",
4644
+ "items": {
4645
+ "type": "string",
4646
+ "enum": [
4647
+ "assistant_id",
4648
+ "graph_id",
4649
+ "name",
4650
+ "description",
4651
+ "config",
4652
+ "context",
4653
+ "created_at",
4654
+ "updated_at",
4655
+ "metadata",
4656
+ "version"
4657
+ ]
4658
+ },
4659
+ "title": "Select",
4660
+ "description": "Specify which fields to return. If not provided, all fields are returned."
4395
4661
  }
4396
4662
  },
4397
4663
  "type": "object",
4398
4664
  "title": "AssistantSearchRequest",
4399
4665
  "description": "Payload for listing assistants."
4400
4666
  },
4667
+ "AssistantCountRequest": {
4668
+ "properties": {
4669
+ "metadata": {
4670
+ "type": "object",
4671
+ "title": "Metadata",
4672
+ "description": "Metadata to filter by. Exact match filter for each KV pair."
4673
+ },
4674
+ "graph_id": {
4675
+ "type": "string",
4676
+ "title": "Graph Id",
4677
+ "description": "The ID of the graph to filter by. The graph ID is normally set in your langgraph.json configuration."
4678
+ }
4679
+ },
4680
+ "type": "object",
4681
+ "title": "AssistantCountRequest",
4682
+ "description": "Payload for counting assistants."
4683
+ },
4401
4684
  "AssistantVersionsSearchRequest": {
4402
4685
  "properties": {
4403
4686
  "metadata": {
@@ -4482,12 +4765,59 @@
4482
4765
  ],
4483
4766
  "title": "Sort Order",
4484
4767
  "description": "Sort order."
4768
+ },
4769
+ "select": {
4770
+ "type": "array",
4771
+ "items": {
4772
+ "type": "string",
4773
+ "enum": [
4774
+ "thread_id",
4775
+ "created_at",
4776
+ "updated_at",
4777
+ "metadata",
4778
+ "config",
4779
+ "context",
4780
+ "status",
4781
+ "values",
4782
+ "interrupts"
4783
+ ]
4784
+ },
4785
+ "title": "Select",
4786
+ "description": "Specify which fields to return. If not provided, all fields are returned."
4485
4787
  }
4486
4788
  },
4487
4789
  "type": "object",
4488
4790
  "title": "ThreadSearchRequest",
4489
4791
  "description": "Payload for listing threads."
4490
4792
  },
4793
+ "ThreadCountRequest": {
4794
+ "properties": {
4795
+ "metadata": {
4796
+ "type": "object",
4797
+ "title": "Metadata",
4798
+ "description": "Thread metadata to filter on."
4799
+ },
4800
+ "values": {
4801
+ "type": "object",
4802
+ "title": "Values",
4803
+ "description": "State values to filter on."
4804
+ },
4805
+ "status": {
4806
+ "type": "string",
4807
+ "enum": [
4808
+ "idle",
4809
+ "busy",
4810
+ "interrupted",
4811
+ "error"
4812
+ ],
4813
+ "title": "Status",
4814
+ "description": "Thread status to filter on."
4815
+ }
4816
+ },
4817
+ "type": "object",
4818
+ "title": "ThreadCountRequest",
4819
+ "description": "Payload for counting threads."
4820
+ },
4491
4821
  "Thread": {
4492
4822
  "properties": {
4493
4823
  "thread_id": {