Skip to content

Commit 90e1291

Browse files
authored
Merge pull request #17 from code0-tech/feat/#16
Flow to flow generation doesn't load functions from starting flow into generation
2 parents cc6d81f + 871dc72 commit 90e1291

2 files changed

Lines changed: 29 additions & 3 deletions

File tree

src/endpoint/generation/generate_endpoint.py

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,26 @@ def Flow(self, request: pb2.FlowRequest, context) -> pb2.FlowResponse:
379379
identifiers=flow_few_shot_flow_type_ids
380380
)
381381

382+
incoming_flow_function_ids = list({
383+
node.function_identifier
384+
for node in incoming_flow.nodes
385+
})
386+
incoming_flow_flow_type_ids = [incoming_flow.type] if incoming_flow.type else []
387+
388+
if incoming_flow_function_ids:
389+
log.debug(f"[Flow] Incoming-flow functions: {incoming_flow_function_ids}")
390+
if incoming_flow_flow_type_ids:
391+
log.debug(f"[Flow] Incoming-flow flow types: {incoming_flow_flow_type_ids}")
392+
393+
incoming_flow_functions = self.function_store.find_all(
394+
group_identifier=str(request.project_id),
395+
identifiers=incoming_flow_function_ids
396+
)
397+
incoming_flow_flow_types = self.flow_type_store.find_all(
398+
group_identifier=str(request.project_id),
399+
identifiers=incoming_flow_flow_type_ids
400+
)
401+
382402
few_shots = [
383403
msg
384404
for fS in flow_few_shots
@@ -388,8 +408,14 @@ def Flow(self, request: pb2.FlowRequest, context) -> pb2.FlowResponse:
388408
)
389409
]
390410

391-
combined_functions = self.function_store.combine(prompt_functions, flow_few_shot_functions)
392-
combined_flow_types = self.flow_type_store.combine(prompt_flow_types, flow_few_shots_flow_types)
411+
combined_functions = self.function_store.combine(
412+
self.function_store.combine(prompt_functions, flow_few_shot_functions),
413+
incoming_flow_functions
414+
)
415+
combined_flow_types = self.flow_type_store.combine(
416+
self.flow_type_store.combine(prompt_flow_types, flow_few_shots_flow_types),
417+
incoming_flow_flow_types
418+
)
393419

394420
log.debug(
395421
f"[Flow] Combined — functions={len(combined_functions)} "

src/interceptor/auth_interceptor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def intercept_service(self, continuation, handler_call_details):
3131
algorithms=['HS256']
3232
)
3333
except Exception as e:
34-
log.warning(f"Invalid token | method={handler_call_details.method} error={e}")
34+
log.warning(f"Invalid token | method={handler_call_details.method} token={auth_token} error={e}")
3535
return self._abort_handler()
3636

3737
return continuation(handler_call_details)

0 commit comments

Comments
 (0)