File tree Expand file tree Collapse file tree 2 files changed +9
-15
lines changed Expand file tree Collapse file tree 2 files changed +9
-15
lines changed Original file line number Diff line number Diff line change @@ -999,11 +999,11 @@ async def generate_bot_message(
999
999
prompt [i ]["content" ] = user_message
1000
1000
break
1001
1001
else :
1002
- prompt : Optional [
1002
+ prompt : Optional [ # pyright: ignore (TODO Refactor these branches into separate methods)
1003
1003
str
1004
1004
] = context .get ( # pyright: ignore (TODO Refactor these branches into separate methods)
1005
1005
"user_message"
1006
- ) # pyright: ignore (TODO - refactor nested `prompt` definitions)
1006
+ )
1007
1007
if not prompt :
1008
1008
raise Exception ("User message not found in context" )
1009
1009
@@ -1058,7 +1058,10 @@ async def generate_bot_message(
1058
1058
] = self .llm_task_manager .render_task_prompt (
1059
1059
task = Task .GENERATE_BOT_MESSAGE ,
1060
1060
events = events ,
1061
- context = {"examples" : examples , "relevant_chunks" : relevant_chunks },
1061
+ context = {
1062
+ "examples" : examples ,
1063
+ "relevant_chunks" : relevant_chunks ,
1064
+ },
1062
1065
)
1063
1066
1064
1067
t0 = time ()
Original file line number Diff line number Diff line change @@ -235,18 +235,11 @@ async def _collect_user_intent_and_examples(
235
235
and "_user_intent" in element_flow_state_instance [0 ].context
236
236
):
237
237
if flow_config .elements [1 ]["_type" ] == "doc_string_stmt" :
238
+ # TODO! Need to make this type-safe but no idea what's going on
238
239
examples += "user action: <" + (
239
- flow_config .elements [1 ]["elements" ][0 ][
240
- "elements"
241
- ][ # pyright: ignore (TODO - Don't know where to even start with this line of code)
240
+ flow_config .elements [1 ]["elements" ][ # pyright: ignore
242
241
0
243
- ][
244
- "elements"
245
- ][
246
- 0
247
- ][
248
- 3 :- 3
249
- ]
242
+ ]["elements" ][0 ]["elements" ][0 ][3 :- 3 ]
250
243
+ ">\n "
251
244
)
252
245
examples += f"user intent: { flow_id } \n \n "
@@ -496,8 +489,6 @@ async def passthrough_llm_action(
496
489
497
490
text = self .llm_task_manager .parse_task_output (Task .GENERAL , output = text )
498
491
499
- text = result .text
500
-
501
492
return text
502
493
503
494
@action (name = "CheckValidFlowExistsAction" , is_system_action = True )
You can’t perform that action at this time.
0 commit comments