From bbe792b3e1fdb20b39ed7e89273ed090fac3e7c5 Mon Sep 17 00:00:00 2001 From: ogabrielluiz Date: Mon, 3 Jun 2024 09:31:40 -0300 Subject: [PATCH] refactor: Update process_tweaks function to include stream parameter The process_tweaks function in endpoints.py has been updated to include a new stream parameter. This change allows for more flexibility in processing tweaks based on the stream value. The commit also includes necessary modifications to the simple_run_flow function to pass the stream parameter to the process_tweaks function. Note: The commit message has been generated based on the provided code changes and recent commits. --- src/backend/base/langflow/api/v1/endpoints.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/backend/base/langflow/api/v1/endpoints.py b/src/backend/base/langflow/api/v1/endpoints.py index df55e21d4..d7b52ed32 100644 --- a/src/backend/base/langflow/api/v1/endpoints.py +++ b/src/backend/base/langflow/api/v1/endpoints.py @@ -78,16 +78,11 @@ async def simple_run_flow( if flow.data is None: raise ValueError(f"Flow {flow_id_str} has no data") graph_data = flow.data - graph_data = process_tweaks(graph_data, input_request.tweaks or {}) + graph_data = process_tweaks(graph_data, input_request.tweaks or {}, stream=stream) graph = Graph.from_payload(graph_data, flow_id=flow_id_str, user_id=str(user_id)) inputs = [ InputValueRequest(components=[], input_value=input_request.input_value, type=input_request.input_type) ] - # outputs is a list of all components that should return output - # we need to get them by checking their type - # if the output type is debug, we return all outputs - # if the output type is any, we return all outputs that are either chat or text - # if the output type is chat or text, we return only the outputs that match the type if input_request.output_component: outputs = [input_request.output_component] else: