Commit Graph
188 Commits
Author SHA1 Message Date
William FHandGitHub dbe10a8c99 Migrate Tool Executor to ReAct Agent (#409) 2024-05-07 12:23:04 -07:00
Nuno Campos e892c95194 Export all exceptions from langgraph.errors 2024-05-07 08:07:26 -07:00
Nuno CamposandGitHub 5bee63c7d5 Merge pull request #387 from langchain-ai/nc/3may/checkpoint-metadata
Add metadata to checkpoints, checkpoint inputs before first step
2024-05-06 14:41:29 -07:00
Nuno Campos 52852cb226 Update langchain-core 2024-05-06 12:20:20 -07:00
Nuno Campos 48865daf02 Fix checkpoint lineage for updates/resumes 2024-05-06 11:53:20 -07:00
Nuno Campos 611ecdb1cd Checkpoint inputs before starting the first step for easier error recovery
- this enables easier retrying, for any error just do .invoke(None, config) no matter which step the error happened on
2024-05-06 11:53:20 -07:00
Nuno Campos f160f82912 Add checkpoint metadata fields
- source: input, update or loop
- step: int
- make step counter continue from previous last step
2024-05-06 11:52:49 -07:00
Nuno Campos 3ff3def62b Remove option to only checkpoint at end of run
- Now that checkpoint at end of each step adds no latency there is not point to keep this
- This will make it easier to add future features
2024-05-06 11:52:49 -07:00
Nuno Campos f304908102 Add metadata to checkpoints
- not yet used in this PR
2024-05-06 11:52:49 -07:00
Nuno Campos 04fe48f661 Add (failing) test for drawing cyclic edge
- fix waiting for new release of langchain-core
2024-05-03 15:17:20 -07:00
Nuno Campos 446543d973 Fix RunnableCallable wrapper when sync func with config arg is invoked async 2024-05-03 12:33:12 -07:00
Nuno Campos 42d3215e34 Implement cursor pagination for get_state_history (time travel endpoint)
- interface in base checkpointer
- implement in sqlite, aiosqlite, memory
- implement in Pregel.get_state_history()
2024-05-03 10:34:11 -07:00
Nuno Campos 467f42d799 Optional 2nd arg to StateGraph with config schema 2024-05-03 10:05:14 -07:00
Nuno CamposandGitHub 8ec1d2e3e9 Merge pull request #363 from langchain-ai/harrison/add-args
Harrison/add args
2024-05-02 15:49:21 -07:00
Nuno Campos 27efba27c0 Update tests 2024-05-02 09:31:22 -07:00
Harrison Chase dea85d236c Merge branch 'master' into harrison/add-args 2024-05-01 08:26:00 -07:00
Harrison Chase 97f3d66c0e cr 2024-05-01 08:17:21 -07:00
Nuno Campos 5e322a6550 Implement stream_mode=debug
- outputs 3 types of payloads
-- task: node about to be executed
-- task_result: result of node execution
-- checkpoint: state values at end of superstep
2024-04-30 16:15:38 -07:00
Nuno Campos 281e312d40 Add tests for async cancellation
- when outer invoke/stream is cancelled currently running nodes should be cancelled
- when multiple nodes run in parallel and one fails the others should be cancelled
2024-04-30 13:57:11 -07:00
Nuno Campos afa6a91934 Implement interrupt_before=* and interrupt_after=*
- This interrupts execution before/after all nodes
2024-04-30 10:05:53 -07:00
Nuno Campos 9a79eb54f9 Finish fixing tests 2024-04-30 09:23:41 -07:00
Nuno Campos 96870c0935 Pregel: Remove implicit creation of channels referenced by nodes
- channels must be declared in the constructor args
2024-04-30 09:04:19 -07:00
Nuno Campos 7554309abf Update tests 2024-04-29 17:46:42 -07:00
Nuno Campos a3c867d688 Remove add_condition_nodes 2024-04-29 11:13:16 -07:00
Nuno Campos 3a59fb2247 Pass add_condition_node 2024-04-29 11:04:15 -07:00
Nuno Campos a83fd19b29 For cond edges support specifying list of possible destinations as a list or typing annotation 2024-04-29 10:38:06 -07:00
Nuno Campos fd9d30f144 Improve tracing output for function nodes
- remove double entry in tracing tree when using functions as nodes
2024-04-29 08:59:56 -07:00
Nuno Campos 61d0f60b8e Update 2024-04-25 11:30:23 -07:00
Nuno Campos 42b13ef576 Improvements to get_graph(xray=)
- Support xray: int, to control depth, eg xray=1 only exposes one level deep
- In mermaid draw a containing box around subgraphs created from xray
2024-04-25 11:27:13 -07:00
Nuno Campos 4b8599b325 Fix 39 2024-04-24 16:19:32 -07:00
Nuno Campos f9646b6a57 Use by default in sqlite adapters
- Support loading pickled checkpoints for backwards compat
- Update copy_checkpoint to coerce values to defaultdicts where needed
2024-04-24 16:08:41 -07:00
Nuno Campos e45c461d99 Fix 2024-04-24 15:42:43 -07:00
Nuno Campos d4982eb022 Fix 2024-04-24 15:40:48 -07:00
Nuno Campos 2824541102 Fix 2024-04-24 15:40:48 -07:00
Nuno Campos c6a199abc2 Skip py39 2024-04-24 15:40:48 -07:00
Nuno Campos 3ad0204a90 Add test 2024-04-24 15:40:48 -07:00
Nuno Campos 3571a893f2 Fix bug where saving a runnable or function in state object would misbehave
- the function/runnable would be called when processing the state update
2024-04-24 15:35:02 -07:00
Nuno Campos 79bff13a47 Add then= arg for add_conditional_edge and set_conditional_entry_point
- This makes it easy to implement graphs where you want to decide among N possible nodes, and then visit another node after whichever one you chose
2024-04-24 14:06:07 -07:00
Nuno Campos f2803372ec Improve graph validation
- Move all validation to compile() This allows adding edges before nodes
- Detect more cases of missing edges with shorthand branches
2024-04-24 11:19:40 -07:00
Nuno Campos 190d163005 Fix 2024-04-22 09:54:45 -07:00
Nuno Campos 85bdc8bdfa Fix issue when drawing graphs w repeat conditions 2024-04-22 09:53:14 -07:00
Nuno Campos 3edf7e4d73 Fix 2024-04-18 10:18:56 -07:00
Nuno Campos 38d990cf99 Merge branch 'main' into improve_visualization_notebook 2024-04-18 09:02:45 -07:00
Nuno Campos 9e6fc78ac2 Make test deterministic 2024-04-18 08:40:56 -07:00
Angel Igareta d925736741 Snapshot updated for python 3.11 2024-04-18 13:19:51 +02:00
Angel Igareta 63125fe7a7 Snapshot updated 2024-04-18 13:01:24 +02:00
Angel Igareta 99c2754156 Fix tests due to change of style for conditional edges. Migrate ascii to snapshot for system compatiblity 2024-04-18 12:53:43 +02:00
Nuno Campos 64dd631668 Lint 2024-04-17 15:26:05 -07:00
Nuno Campos 322cea054c Fix astream_events modifying output format unexpectedly
- (unrelated) use run_id passed in
- if using a graph as node in another graph ensure stream_mode for inner call is always values
- ensure langchain-core doesn't auto promote streamed dicts to addable dicts, which results in unexpected output (only) when calling astream_events
2024-04-17 15:24:43 -07:00
Angel Igareta 0f667cd9eb Add add_condition_nodes parameter to offer possibility of not including conditional nodes 2024-04-15 10:56:19 +02:00