pwilczewski commited on
Commit
f8087a3
·
1 Parent(s): d3d051b

adding verbose output

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -51,7 +51,7 @@ def create_agent(llm: ChatOpenAI, tools: list, task: str):
51
  ]
52
  )
53
  agent = create_openai_tools_agent(llm, tools, prompt)
54
- executor = AgentExecutor(agent=agent, tools=tools)
55
  return executor
56
 
57
  # AIMessage will have all kinds of metadata, so treat it all as HumanMessage I suppose?
@@ -90,7 +90,8 @@ workflow.add_edge("EDA", END)
90
  graph = workflow.compile()
91
 
92
  def greet(name):
93
- return graph.invoke({"messages": [HumanMessage(content="Run the analysis")]})
 
94
 
95
  demo = gr.Interface(fn=greet, inputs="text", outputs="text")
96
  demo.launch()
 
51
  ]
52
  )
53
  agent = create_openai_tools_agent(llm, tools, prompt)
54
+ executor = AgentExecutor(agent=agent, tools=tools, verbose=True)
55
  return executor
56
 
57
  # AIMessage will have all kinds of metadata, so treat it all as HumanMessage I suppose?
 
90
  graph = workflow.compile()
91
 
92
  def greet(name):
93
+ resp = graph.invoke({"messages": [HumanMessage(content="Run the analysis")]})
94
+ return resp['messages']
95
 
96
  demo = gr.Interface(fn=greet, inputs="text", outputs="text")
97
  demo.launch()