From 000a5c5b83bf0a26e1d13f3c7e72efca5a1a82ef Mon Sep 17 00:00:00 2001 From: Vadym Barda Date: Wed, 26 Jun 2024 13:43:14 -0400 Subject: [PATCH] docs: update graph state in readme (#835) --- README.md | 4 ++-- libs/langgraph/README.md | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0ef2a2765..e0ac582a2 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ tool_node = ToolNode(tools) model = ChatOpenAI(temperature=0).bind_tools(tools) # Define the function that determines whether to continue or not -def should_continue(state: AgentState) -> Literal["tools", END]: +def should_continue(state: MessagesState) -> Literal["tools", END]: messages = state['messages'] last_message = messages[-1] # If the LLM makes a tool call, then we route to the "tools" node @@ -83,7 +83,7 @@ def should_continue(state: AgentState) -> Literal["tools", END]: # Define the function that calls the model -def call_model(state: AgentState): +def call_model(state: MessagesState): messages = state['messages'] response = model.invoke(messages) # We return a list, because this will get added to the existing list diff --git a/libs/langgraph/README.md b/libs/langgraph/README.md index b49d56d35..e0ac582a2 100644 --- a/libs/langgraph/README.md +++ b/libs/langgraph/README.md @@ -72,7 +72,7 @@ tool_node = ToolNode(tools) model = ChatOpenAI(temperature=0).bind_tools(tools) # Define the function that determines whether to continue or not -def should_continue(state: AgentState) -> Literal["tools", END]: +def should_continue(state: MessagesState) -> Literal["tools", END]: messages = state['messages'] last_message = messages[-1] # If the LLM makes a tool call, then we route to the "tools" node @@ -83,7 +83,7 @@ def should_continue(state: AgentState) -> Literal["tools", END]: # Define the function that calls the model -def call_model(state: AgentState): +def call_model(state: MessagesState): messages = state['messages'] response = model.invoke(messages) # We return a list, because this will get added to the existing list @@ -215,4 +215,5 @@ final_state["messages"][-1].content * [Tutorials](https://langchain-ai.github.io/langgraph/tutorials/): Learn to build with LangGraph through guided examples. * [How-to Guides](https://langchain-ai.github.io/langgraph/how-tos/): Accomplish specific things within LangGraph, from streaming, to adding memory & persistence, to common design patterns (branching, subgraphs, etc.), these are the place to go if you want to copy and run a specific code snippet. * [Conceptual Guides](https://langchain-ai.github.io/langgraph/concepts/): In-depth explanations of the key concepts and principles behind LangGraph, such as nodes, edges, state and more. -* [API Reference](https://langchain-ai.github.io/langgraph/reference/graphs/): Review important classes and methods, simple examples of how to use the graph and checkpointing APIs, higher-level prebuilt components and more. \ No newline at end of file +* [API Reference](https://langchain-ai.github.io/langgraph/reference/graphs/): Review important classes and methods, simple examples of how to use the graph and checkpointing APIs, higher-level prebuilt components and more. +* [Cloud (alpha)](https://langchain-ai.github.io/langgraph/cloud/): With one click, deploy LangGraph applications to LangGraph Cloud.