Compare commits

...
Author SHA1 Message Date
Jacob LeeandGitHub b6c46d1a45 Update README.md 2024-07-11 15:42:32 -07:00
Jacob LeeandGitHub 9c7dafb75a Update README.md 2024-07-11 15:42:16 -07:00
jacoblee93 b67c3d1edd Sync readmes 2024-07-11 15:16:58 -07:00
Jacob LeeandGitHub 634fd082c5 Fix example
CC @vbarda
2024-07-11 15:14:12 -07:00
2 changed files with 2 additions and 6 deletions
+1 -3
View File
@@ -57,8 +57,6 @@ export LANGSMITH_API_KEY=lsv2_sk_...
```
```python
from typing import Annotated, Literal, TypedDict
from langchain_core.messages import HumanMessage
from langchain_anthropic import ChatAnthropic
from langchain_core.tools import tool
@@ -84,7 +82,7 @@ tool_node = ToolNode(tools)
model = ChatAnthropic(model="claude-3-5-sonnet-20240620", temperature=0).bind_tools(tools)
# Define the function that determines whether to continue or not
def should_continue(state: MessagesState) -> Literal["tools", END]:
def should_continue(state: MessagesState) -> Union[Literal["tools"], type(END)]:
messages = state['messages']
last_message = messages[-1]
# If the LLM makes a tool call, then we route to the "tools" node
+1 -3
View File
@@ -57,8 +57,6 @@ export LANGSMITH_API_KEY=lsv2_sk_...
```
```python
from typing import Annotated, Literal, TypedDict
from langchain_core.messages import HumanMessage
from langchain_anthropic import ChatAnthropic
from langchain_core.tools import tool
@@ -84,7 +82,7 @@ tool_node = ToolNode(tools)
model = ChatAnthropic(model="claude-3-5-sonnet-20240620", temperature=0).bind_tools(tools)
# Define the function that determines whether to continue or not
def should_continue(state: MessagesState) -> Literal["tools", END]:
def should_continue(state: MessagesState) -> Union[Literal["tools"], type(END)]:
messages = state['messages']
last_message = messages[-1]
# If the LLM makes a tool call, then we route to the "tools" node