Commit Graph
125 Commits
Author SHA1 Message Date
Nuno Campos 2f8ae4fdb4 Simplify tool executor 2024-04-02 14:46:14 -07:00
Nuno Campos 2a299d070e Optimize tracing output of Graph/StateGraph/MessageGraph
- control selection of relevant runs (needs langsmith release)
- see output of conditional edge function
- fix issue with conditional entry point not getting full state values as input
2024-04-02 10:32:47 -07:00
Nuno Campos a184600915 MessageGraph now accepts same shorthand message formats as langchain-core 2024-04-01 18:44:06 -07:00
Nuno Campos 694343c5b5 Update test 2024-04-01 18:03:52 -07:00
Nuno Campos cbd2024dec Add async test, add test for validation error 2024-04-01 17:56:18 -07:00
Nuno Campos 961ddd49ed Add test and notebook for using pydantic base model as state object 2024-04-01 17:40:55 -07:00
Nuno Campos f88ef74002 Add tests for both values of CheckpointAt
- fix bug when using at=END_OF_RUN together with interrupt_before
- fix bug when calling update_state after only node has run
- update some notebooks to new streaming format (ie. no __end__ node)
2024-04-01 17:17:39 -07:00
Nuno Campos 2736d72989 Remove __start__ node from stream output 2024-04-01 16:05:12 -07:00
Nuno Campos b6848c5fdf Optimize tracing run tree
- Do not run node if it's a passthrough
- Do not run writers that wouldn't affect any channels
- Combine consecutive writers when it doesn't change semantics
2024-04-01 13:43:23 -07:00
Nuno Campos 3451e04b7d Add test for waiting edge triggered via conditional edge 2024-04-01 12:36:55 -07:00
Nuno Campos 2bf66b8834 Add some more docstrings around multi edges
- prompted by some github issues
2024-04-01 12:29:00 -07:00
Nuno Campos 4e373b8af2 Remove noisy frames from stack traces
- The less frames in library code the less confused the user is
- This doesn't remove all library frames (not possible), but it's a start
2024-03-31 20:19:10 -07:00
Nuno Campos a20bf12da9 Lint 2024-03-31 19:18:47 -07:00
Nuno Campos 0d2bbe85c6 Fix default condition name 2024-03-31 18:56:38 -07:00
Nuno Campos b668bf8eab Rewrite Graph/StateGraph.compile()
- Each iteration of the graph is one single iteration in Pregel (ie. no more "{node}:edges" nodes)
- .update_state() now acts exactly as one of the nodes in the graph (which can be chosen), which makes human-in-the-loop scenarios where you want to override the actions of a specific node a lot easier to build
- Graph/StateGraph.compile() now delegate adding nodes/edges/etc to dedicated methods that operate on the Pregel object, which is 90% of the way towards dynamic graphs where nodes and edges can be added during execution
2024-03-31 17:17:18 -07:00
Nuno Campos 4fd90f8ad6 Rename BaseChannel.empty() to BaseChannel.from_checkpoint()
- clearer name
- channels with complex data structures in checkpoint (eg a set or list) now copy the checkpointed data structures before creating the new channel
2024-03-31 09:25:08 -07:00
Nuno Campos 03b7d6fe0d Remove __end__ node from state graph
No longer necessary with stream output modes
2024-03-30 22:04:27 -07:00
Nuno Campos 1ad017781d Add stream_mode=updates or values
- stream(stream_mode="values") yields thre current channel values whenever a channel is updated
- stream(stream_mode="updates") yields the update sent to each channel by each node
- this removes the __end__ value present at the end of each call to Graph/StateGraph/MessageGraph.stream(). To access the __end__ value either call .invoke() or stream(stream_mode="values")
2024-03-30 21:24:39 -07:00
Nuno Campos 0baaf5cd96 Remove private api to mutate values during call to stream() 2024-03-30 19:41:50 -07:00
Nuno Campos 5aa036639b Update 2024-03-26 15:42:16 -07:00
jacoblee93 a6a9def91a Adds async conditional edge support 2024-03-26 12:46:15 -07:00
Nuno CamposandGitHub 458d71e694 Merge pull request #226 from langchain-ai/nc/21mar/add-message-graph-test
Add one more test for message graph
2024-03-21 18:00:00 -07:00
Nuno Campos db2ec5b2de Rename to add_edge(string[], string) 2024-03-21 17:56:35 -07:00
Nuno Campos e11153cf09 Fix graph repr 2024-03-21 16:53:59 -07:00
Nuno Campos 319d72952c Add one more test for message graph 2024-03-21 16:35:26 -07:00
Nuno Campos ccea395002 Fox 2024-03-21 16:06:23 -07:00
Nuno Campos 01c32c2464 Finish 2024-03-21 15:54:03 -07:00
Nuno Campos 6cb5062c1a Lol 2024-03-21 14:30:51 -07:00
Nuno Campos 158f84c826 WIP Waiting edge 2024-03-21 14:29:40 -07:00
Nuno Campos 3bfac1f490 Track parent relationships for checkpoints
- This enables building "branching" views of checkpoint history
2024-03-20 12:08:22 -07:00
Nuno Campos 7548f412fb Support updating existing messages in messagegraph 2024-03-15 12:13:58 -07:00
Nuno Campos 0d13c6b159 Add history tracking to in-memory, sqlite and aiosqlite checkpointers
- Add Pregel.get_state_history and .aget_state_history methods to get history iterator
- Update checkpointer base class with new list and get_tuple methods
- Rewrite in-memory checkpointer class to track history
- Rewrite sqlite and aiosqlite checkpointers to track history
- Add new tests for history tracking
2024-03-13 17:22:39 -07:00
Nuno Campos f5c3c7ac7d Remove subscribe_to_each() method in pregel api
- can be replaced by piping to batch method instead
2024-03-13 11:17:49 -07:00
Nuno Campos c90a6b14b9 Fix human in the loop notebook 2024-03-12 10:40:47 -07:00
Nuno Campos a33acb6d8a Implement xray mode for graph draw 2024-02-29 19:07:58 -08:00
Nuno Campos 359340dbc8 One more 2024-02-29 19:03:42 -08:00
Nuno Campos 971e15873e Fix core version mismatch in snapshot tests 2024-02-29 19:01:44 -08:00
Nuno Campos d75792f6e8 Fix 2024-02-29 18:48:21 -08:00
Nuno Campos 5c2afc9418 Fix behaviour of interrupt_before
- checkpoints are now copied before being mutated
- compiled graph and compiled state graph no longer need to override get_state/update_state
- pregel class now natively supports interrupt before/after
2024-02-24 19:43:30 -08:00
Nuno CamposandNuno Campos fdb273b0f4 Add get_state() and update_state() methods to get and update checkpoint in between runs 2024-02-24 16:58:18 -08:00
Nuno Campos debd9a8d9c Add support for conditional entry points in Graph, StateGraph, MessageGraph 2024-02-22 15:19:03 -08:00
Nuno Campos c3cbececcf Update snapshots 2024-02-20 09:51:33 -08:00
Nuno Campos 4f1980df7c Add missing input and output types for state graph 2024-02-19 13:14:24 -08:00
Nuno Campos 27464c0f46 Implement input_schema, output_schema, get_graph for Graph, StateGraph, MessageGraph 2024-02-19 13:07:34 -08:00
Nuno CamposandGitHub 50b1a455bd Merge pull request #41 from langchain-ai/nc/fan-out
StateGraph/MessageGraph: Add support for multiple incoming edges
2024-02-19 13:06:14 -08:00
Nuno Campos e4bfa8603d Support multiple tool calls, Lint 2024-02-19 09:12:08 -08:00
midas8181919 794cc71254 fixed 2024-02-13 22:42:37 +00:00
midas8181919 41ff4c8c43 fix some errors 2024-02-13 15:41:27 +00:00
midas8181919 b4269f6453 finish test 2024-02-11 02:04:09 +00:00
midas8181919 acaa4567e1 fix test 2024-02-10 23:25:17 +00:00