File tree Expand file tree Collapse file tree 5 files changed +22
-5
lines changed
samples/generic-rag-agent Expand file tree Collapse file tree 5 files changed +22
-5
lines changed Original file line number Diff line number Diff line change 11{
22 "query" : " What is the company policy on travel spending? What is the price of GPUs in 2025? What is 5+6+7+8+(6*10)?" ,
3- "add_data_to_index" : false
3+ "add_data_to_index" : false ,
4+ "include_hitl" : false
45}
Original file line number Diff line number Diff line change 4747class CustomStartEvent (StartEvent ):
4848 query : str = ""
4949 add_data_to_index : Optional [bool ] = False
50+ include_hitl : bool = False
5051
5152
5253class QueryEvent (Event ):
@@ -165,6 +166,7 @@ async def workflow_entrypoint(
165166 await ctx .store .set ("original_query" , ev .query )
166167 await ctx .store .set ("iteration_count" , 0 )
167168 await ctx .store .set ("feedback_history" , [])
169+ await ctx .store .set ("include_hitl" , ev .include_hitl )
168170
169171 if ev .add_data_to_index :
170172 return AddDataToIndexEvent ()
@@ -396,8 +398,17 @@ async def request_human_confirmation(
396398 ) -> OutputEvent | QueryEvent :
397399 """
398400 Present the formatted answer to the user and request confirmation.
401+ If include_hitl is False, skip human confirmation and return the output directly.
399402 """
400- await ctx .store .set ("last_formatted_answer" , ev .formatted_answer )
403+ include_hitl = await ctx .store .get ("include_hitl" , False )
404+
405+ if not include_hitl :
406+ print ("\n " + "=" * 80 )
407+ print ("FORMATTED ANSWER (HITL disabled):" )
408+ print ("=" * 80 )
409+ print (ev .formatted_answer )
410+ print ("=" * 80 )
411+ return OutputEvent (output = ev .formatted_answer )
401412
402413 print ("\n " + "=" * 80 )
403414 print ("FORMATTED ANSWER:" )
Original file line number Diff line number Diff line change 11[project ]
22name = " generic-rag-agent"
3- version = " 0.0.29 "
3+ version = " 0.0.30 "
44description = " A generic RAG agent that combines multiple knowledge bases with web search capabilities and MCP tool support"
55authors = [{ name = " John Doe" , email = " john.doe@myemail.com" }]
66readme = { file = " README.md" , content-type = " text/markdown" }
Original file line number Diff line number Diff line change 22 "entryPoints" : [
33 {
44 "filePath" : " agent" ,
5- "uniqueId" : " e321d542-02cc-47d8-9e28-88b4b638c4d0 " ,
5+ "uniqueId" : " de56dd1d-85cc-4b3d-b794-e8ddccae291a " ,
66 "type" : " agent" ,
77 "input" : {
88 "type" : " object" ,
1515 "add_data_to_index" : {
1616 "type" : " boolean" ,
1717 "nullable" : true
18+ },
19+ "include_hitl" : {
20+ "default" : false ,
21+ "title" : " Include Hitl" ,
22+ "type" : " boolean"
1823 }
1924 },
2025 "required" : []
You can’t perform that action at this time.
0 commit comments