Fix issue with next_vertices_ids in build_vertex function
This commit is contained in:
parent
6781460869
commit
2861391e6e
1 changed files with 8 additions and 1 deletions
|
|
@ -124,7 +124,7 @@ async def build_vertex(
|
|||
artifacts = vertex.artifacts
|
||||
else:
|
||||
raise ValueError(f"No result found for vertex {vertex_id}")
|
||||
|
||||
next_vertices_ids = vertex.successors_ids
|
||||
result_data_response = ResultDataResponse(**result_dict.model_dump())
|
||||
|
||||
except Exception as exc:
|
||||
|
|
@ -160,6 +160,13 @@ async def build_vertex(
|
|||
graph.reset_inactive_vertices()
|
||||
chat_service.set_cache(flow_id, graph)
|
||||
|
||||
# graph.stop_vertex tells us if the user asked
|
||||
# to stop the build of the graph at a certain vertex
|
||||
# if it is in next_vertices_ids, we need to remove other
|
||||
# vertices from next_vertices_ids
|
||||
if graph.stop_vertex and graph.stop_vertex in next_vertices_ids:
|
||||
next_vertices_ids = [graph.stop_vertex]
|
||||
|
||||
build_response = VertexBuildResponse(
|
||||
next_vertices_ids=next_vertices_ids,
|
||||
inactive_vertices=inactive_vertices,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue