Commit Graph
82 Commits
Author SHA1 Message Date
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
Nuno Campos f3ae555b91 Shorten conditional edge names 2024-04-12 09:29:27 -07:00
Nuno Campos a8af7467b8 In stream_mode=values yield all values, instead of only changed ones 2024-04-11 11:12:10 -07:00
Nuno CamposandGitHub 9ffd6d9c78 Merge pull request #296 from langchain-ai/nc/10apr/tool-node
Add prebuilt ToolNode, Make prebuilt create_tool_calling_executor compatible with any tool calling model
2024-04-11 11:10:59 -07:00
Nuno Campos 46e67cff87 Remove flag 2024-04-11 08:44:41 -07:00
hmasdev 236ecb1982 rename node name in tests 2024-04-11 20:34:45 +09:00
hmasdev 42de3304dc Add support for allow_falsy_output parameter in Pregel class 2024-04-11 19:46:01 +09:00
Nuno Campos 7dafc09a5b Add prebuilt ToolNode 2024-04-10 18:15:19 -07:00
Nuno Campos 641def6fdb Fix null output for node with conditional edge returning END 2024-04-10 16:10:08 -07:00
Nuno Campos fd6f44a7e4 feat: Return multiple destinations from conditional edge 2024-04-08 17:05:16 -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 cbd2024dec Add async test, add test for validation error 2024-04-01 17:56:18 -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 3451e04b7d Add test for waiting edge triggered via conditional edge 2024-04-01 12:36:55 -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 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 Campos db2ec5b2de Rename to add_edge(string[], string) 2024-03-21 17:56:35 -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 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 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 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
Nuno Campos 979b735256 Allow fan-in in stategraph 2024-02-10 12:01:52 -08:00
Nuno Campos c4f87cdccd Close the connection 2024-02-07 20:02:36 -08:00
Nuno Campos f2ad930cd4 Add AsyncSqliteSaver 2024-02-07 19:31:24 -08:00
Nuno Campos afa9592f6a Only execute tasks leftover from previous checkpoint when resuming with no new input 2024-02-04 14:12:10 -08:00
Nuno Campos 150583bd40 py3.9 compat 2024-01-21 09:12:18 -08:00
Nuno Campos 07f0eca65f Add MessageGraph 2024-01-20 17:17:01 -08:00
Nuno Campos b328a46f73 Change chat executor back 2024-01-20 17:05:47 -08:00
Nuno Campos ee66e11eae Add support for single key state, eg just list of messages 2024-01-20 15:04:35 -08:00
Nuno Campos e245b1d2ff Lint 2024-01-17 13:55:26 -08:00
Nuno Campos b535b5caa0 Add tests 2024-01-16 16:23:41 -08:00
Nuno Campos 2e537320c3 Rename saver to checkpointer, expose in graph, state graph, prebuilt agent exec 2024-01-15 13:45:54 -08:00
Nuno Campos 23f84c9ac9 Fix tests to run in py 3.9 2024-01-15 13:18:32 -08:00