Spaces:
Sleeping
Sleeping
pwilczewski
commited on
Commit
·
762baf0
1
Parent(s):
172e154
removed some debugging stuff
Browse files- app.py +4 -3
- plots/placeholder.txt +0 -0
app.py
CHANGED
@@ -52,14 +52,15 @@ def create_agent(llm: ChatOpenAI, tools: list, task: str):
|
|
52 |
)
|
53 |
agent = create_openai_tools_agent(llm, tools, prompt)
|
54 |
# for debugging
|
55 |
-
executor = AgentExecutor(agent=agent, tools=tools, verbose=True, return_intermediate_steps=True)
|
|
|
56 |
return executor
|
57 |
|
58 |
# AIMessage will have all kinds of metadata, so treat it all as HumanMessage I suppose?
|
59 |
def agent_node(state: AgentState, agent, name):
|
60 |
result = agent.invoke(state)
|
61 |
-
|
62 |
-
return {"messages": [result]}
|
63 |
|
64 |
# I need to write the message to state here? or is that handled automatically?
|
65 |
def chain_node(state: AgentState, chain, name):
|
|
|
52 |
)
|
53 |
agent = create_openai_tools_agent(llm, tools, prompt)
|
54 |
# for debugging
|
55 |
+
# executor = AgentExecutor(agent=agent, tools=tools, verbose=True, return_intermediate_steps=True)
|
56 |
+
executor = AgentExecutor(agent=agent, tools=tools)
|
57 |
return executor
|
58 |
|
59 |
# AIMessage will have all kinds of metadata, so treat it all as HumanMessage I suppose?
|
60 |
def agent_node(state: AgentState, agent, name):
|
61 |
result = agent.invoke(state)
|
62 |
+
return {"messages": [HumanMessage(content=result["output"], name=name)]}
|
63 |
+
# return {"messages": [result]}
|
64 |
|
65 |
# I need to write the message to state here? or is that handled automatically?
|
66 |
def chain_node(state: AgentState, chain, name):
|
plots/placeholder.txt
DELETED
File without changes
|