🐛 fix(endpoints.py): change graph_data variable to use flow_obj.data instead of flow_obj.flow

The graph_data variable was previously assigned to flow_obj.flow, which is incorrect as the flow_obj object does not have a flow attribute. Instead, the correct attribute to use is flow_obj.data.
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-06-10 16:17:56 -03:00
commit cdbe2b0401

View file

@ -33,9 +33,8 @@ async def get_load(
flow_obj = session.get(Flow, flow_id)
if flow_obj is None:
raise ValueError(f"Flow {flow_id} not found")
graph_data = flow_obj.flow
data: dict = graph_data.get("data", {})
response = process_graph_cached(data, predict_request.message)
graph_data = flow_obj.data
response = process_graph_cached(graph_data, predict_request.message)
return PredictResponse(
result=response.get("result", ""),
intermediate_steps=response.get("thought", ""),