pratikshahp commited on
Commit
4e6f320
·
verified ·
1 Parent(s): b0d63e3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -0
app.py CHANGED
@@ -4,6 +4,18 @@ from typing_extensions import TypedDict
4
 
5
  from langgraph.graph import StateGraph, START, END
6
  from langgraph.graph.message import add_messages
 
 
 
 
 
 
 
 
 
 
 
 
7
 
8
 
9
  class State(TypedDict):
 
4
 
5
  from langgraph.graph import StateGraph, START, END
6
  from langgraph.graph.message import add_messages
7
+ from langchain_anthropic import ChatAnthropic
8
+
9
+ llm = ChatAnthropic(model="claude-3-5-sonnet-20240620")
10
+
11
+ def chatbot(state: State):
12
+ return {"messages": [llm.invoke(state["messages"])]}
13
+
14
+
15
+ # The first argument is the unique node name
16
+ # The second argument is the function or object that will be called whenever
17
+ # the node is used.
18
+ graph_builder.add_node("chatbot", chatbot)
19
 
20
 
21
  class State(TypedDict):