Spaces:
Sleeping
Sleeping
Update agent.py
Browse files
agent.py
CHANGED
|
@@ -33,6 +33,8 @@ HUGGINGFACEHUB_API_TOKEN = getenv("HUGGINGFACEHUB_API_TOKEN")
|
|
| 33 |
SUPABASE_URL = os.environ.get("SUPABASE_URL")
|
| 34 |
SUPABASE_SERVICE_ROLE_KEY = os.environ.get("SUPABASE_SERVICE_ROLE_KEY")
|
| 35 |
TAVILY_API_KEY = os.environ.get("TAVILY_API_KEY")
|
|
|
|
|
|
|
| 36 |
|
| 37 |
# load the system prompt from the file
|
| 38 |
with open("prompt.txt", "r", encoding="utf-8") as f:
|
|
@@ -44,8 +46,7 @@ sys_msg = SystemMessage(content=system_prompt)
|
|
| 44 |
|
| 45 |
# Loading the assistant
|
| 46 |
#chat = ChatGoogleGenerativeAI(model="gemini-2.0-flash", temperature=0)
|
| 47 |
-
chat =
|
| 48 |
-
|
| 49 |
|
| 50 |
tools = [add,
|
| 51 |
substract,
|
|
@@ -72,7 +73,6 @@ def simple_graph():
|
|
| 72 |
## Defining our nodes
|
| 73 |
def assistant(state: MessagesState):
|
| 74 |
"""Assistant node"""
|
| 75 |
-
time.sleep(45)
|
| 76 |
return {"messages": [chat_with_tools.invoke([sys_msg] + state["messages"])]}
|
| 77 |
|
| 78 |
# def retriever(state: MessagesState):
|
|
|
|
| 33 |
SUPABASE_URL = os.environ.get("SUPABASE_URL")
|
| 34 |
SUPABASE_SERVICE_ROLE_KEY = os.environ.get("SUPABASE_SERVICE_ROLE_KEY")
|
| 35 |
TAVILY_API_KEY = os.environ.get("TAVILY_API_KEY")
|
| 36 |
+
GROQ_API_KEY = os.environ.get("GROQ_API_KEY")
|
| 37 |
+
|
| 38 |
|
| 39 |
# load the system prompt from the file
|
| 40 |
with open("prompt.txt", "r", encoding="utf-8") as f:
|
|
|
|
| 46 |
|
| 47 |
# Loading the assistant
|
| 48 |
#chat = ChatGoogleGenerativeAI(model="gemini-2.0-flash", temperature=0)
|
| 49 |
+
chat = ChatGroq(model_name="mixtral-8x7b-32768", temperature=0)
|
|
|
|
| 50 |
|
| 51 |
tools = [add,
|
| 52 |
substract,
|
|
|
|
| 73 |
## Defining our nodes
|
| 74 |
def assistant(state: MessagesState):
|
| 75 |
"""Assistant node"""
|
|
|
|
| 76 |
return {"messages": [chat_with_tools.invoke([sys_msg] + state["messages"])]}
|
| 77 |
|
| 78 |
# def retriever(state: MessagesState):
|