@@ -205,16 +205,18 @@ def Prompt(self, request: pb2.PromptRequest, context) -> pb2.FlowResponse:
205205 log .success ( # type: ignore[attr-defined]
206206 f"[Prompt] Generated '{ generated_flow .name } ' in { elapsed :.2f} s | tokens={ completion .usage .total_tokens } "
207207 )
208+ log .info (f"[Prompt] Generated flow: { generated_flow .model_dump_json ()} " )
209+
210+ final_flow = flow_postprocessing (
211+ generated_flow ,
212+ combined_flow_types ,
213+ combined_functions
214+ )
215+ log .info (f"[Prompt] Post-processed flow: { final_flow .model_dump_json ()} " )
208216
209217 current_time_ms = int (time .time () * 1000 )
210218 return pb2 .FlowResponse (
211- flow = map_to_grpc_flow (
212- flow_postprocessing (
213- generated_flow ,
214- combined_flow_types ,
215- combined_functions
216- )
217- ),
219+ flow = map_to_grpc_flow (final_flow ),
218220 cached_until = current_time_ms + 300000 ,
219221 usage = completion .usage .total_tokens
220222 )
@@ -252,7 +254,8 @@ def Flow(self, request: pb2.FlowRequest, context) -> pb2.FlowResponse:
252254 )
253255
254256 try :
255- Flow .model_validate (map_to_flow_schema (request .flow ))
257+ incoming_flow = Flow .model_validate (map_to_flow_schema (request .flow ))
258+ log .info (f"[Flow] Incoming flow: { incoming_flow .model_dump_json ()} " )
256259 except ValidationError as e :
257260 log .warning (f"[Flow] Rejected — invalid flow schema: { e } " )
258261 context .abort (
@@ -409,16 +412,18 @@ def Flow(self, request: pb2.FlowRequest, context) -> pb2.FlowResponse:
409412 log .success ( # type: ignore[attr-defined]
410413 f"[Flow] Modified '{ generated_flow .name } ' in { elapsed :.2f} s | tokens={ completion .usage .total_tokens } "
411414 )
415+ log .info (f"[Flow] Generated flow: { generated_flow .model_dump_json ()} " )
416+
417+ final_flow = flow_postprocessing (
418+ generated_flow ,
419+ combined_flow_types ,
420+ combined_functions
421+ )
422+ log .info (f"[Flow] Post-processed flow: { final_flow .model_dump_json ()} " )
412423
413424 current_time_ms = int (time .time () * 1000 )
414425 return pb2 .FlowResponse (
415- flow = map_to_grpc_flow (
416- flow_postprocessing (
417- generated_flow ,
418- combined_flow_types ,
419- combined_functions
420- )
421- ),
426+ flow = map_to_grpc_flow (final_flow ),
422427 cached_until = current_time_ms + 300000 ,
423428 usage = completion .usage .total_tokens
424429 )
0 commit comments