pwilczewski commited on
Commit
b7eb826
·
1 Parent(s): 30d6ff7

all output

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -132,16 +132,16 @@ from langgraph.graph import END, StateGraph, START
132
  # add a chain to the node to analyze the ACF plot?
133
  workflow = StateGraph(AgentState)
134
  workflow.add_node("EDA", eda_node)
135
- # workflow.add_node("PlotAnalysis", plot_node)
136
- # workflow.add_node("Difference", diff_node)
137
- # workflow.add_node("ARIMA", arima_node)
138
 
139
  # conditional_edge to refit and the loop refit with resid?
140
  workflow.add_edge(START, "EDA")
141
  workflow.add_edge("EDA", END)
142
- # workflow.add_conditional_edges("PlotAnalysis", router)
143
- # workflow.add_edge("Difference", "EDA")
144
- # workflow.add_edge("ARIMA", END)
145
 
146
  graph = workflow.compile()
147
 
@@ -149,7 +149,7 @@ graph = workflow.compile()
149
  def gradio_interface(input_text):
150
  # input_data = {"messages": [HumanMessage(content="Run the analysis")]}
151
  resp = graph.invoke({"messages": [HumanMessage(content="Run the analysis")]}) # debug=True
152
- return resp['messages'][-1].content
153
 
154
  dropdown = gr.Dropdown(
155
  choices=["Option 1", "Option 2", "Option 3"],
 
132
  # add a chain to the node to analyze the ACF plot?
133
  workflow = StateGraph(AgentState)
134
  workflow.add_node("EDA", eda_node)
135
+ workflow.add_node("PlotAnalysis", plot_node)
136
+ workflow.add_node("Difference", diff_node)
137
+ workflow.add_node("ARIMA", arima_node)
138
 
139
  # conditional_edge to refit and the loop refit with resid?
140
  workflow.add_edge(START, "EDA")
141
  workflow.add_edge("EDA", END)
142
+ workflow.add_conditional_edges("PlotAnalysis", router)
143
+ workflow.add_edge("Difference", "EDA")
144
+ workflow.add_edge("ARIMA", END)
145
 
146
  graph = workflow.compile()
147
 
 
149
  def gradio_interface(input_text):
150
  # input_data = {"messages": [HumanMessage(content="Run the analysis")]}
151
  resp = graph.invoke({"messages": [HumanMessage(content="Run the analysis")]}) # debug=True
152
+ return '\n'.join([msg.content for msg in resp['messages'][1:]])
153
 
154
  dropdown = gr.Dropdown(
155
  choices=["Option 1", "Option 2", "Option 3"],