1MR commited on
Commit
fabb385
Β·
verified Β·
1 Parent(s): 66c7934

Upload simple_math_agent.py

Browse files
Files changed (1) hide show
  1. simple_math_agent.py +24 -0
simple_math_agent.py ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from langchain_groq import ChatGroq
2
+ from langgraph.checkpoint.memory import InMemorySaver
3
+ from langgraph.prebuilt import create_react_agent
4
+ from loguru import logger
5
+ import os
6
+ os.environ["GROQ_API_KEY"] = "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"
7
+ model = ChatGroq(
8
+ model="meta-llama/llama-4-scout-17b-16e-instruct",
9
+ max_tokens=50,
10
+ )
11
+
12
+
13
+ system_prompt = """You are hassan, a helpful assistant with for hotel room booking and other services about hotel. be frendly and polite."""
14
+
15
+ memory = InMemorySaver()
16
+
17
+ agent = create_react_agent(
18
+ model=model,
19
+ tools=[],
20
+ prompt=system_prompt,
21
+ checkpointer=memory,
22
+ )
23
+
24
+ agent_config = {"configurable": {"thread_id": "default_user"}}