from modules.conditional_judgement_module import judgment_module from modules.gpt_module import gpt_module from modules.interact_module import interact_module from utils.configuration import Configuration configuration=Configuration('three_kingdoms_test') input_path,prompt_input_declare,prompt_path,output,next_module=configuration.read_gpt_config('input',1) prompt_input_value=configuration.prompt_input_process(input_path,prompt_input_declare) prompt=configuration.read_prompt(prompt_path) gpt_module('input',1,prompt_input_value,prompt,output) while True: if next_module["type"]=="GPT": input_path,prompt_input_declare,prompt_path,output,next_module_temp=configuration.read_gpt_config(next_module["class"],next_module["id"]) prompt_input_value=configuration.prompt_input_process(input_path,prompt_input_declare) prompt=configuration.read_prompt(prompt_path) gpt_module(next_module["class"],next_module["id"],prompt_input_value,prompt,output) next_module=next_module_temp elif next_module["type"]=="Judgement": input,value,judgement=configuration.read_judgement_config(next_module["class"],next_module["id"]) input_value=configuration.judgement_input_process(input,value) next_module=judgment_module(next_module["class"],input_value,judgement) elif next_module["type"]=="Interact": input,choices,output,next_module_temp=configuration.read_interact_config(next_module["class"],next_module["id"]) choices_value=configuration.interact_input_process(input,choices) interact_module(next_module["class"],next_module["id"],choices_value,output) next_module=next_module_temp else: break # input_path,prompt_input_declare,prompt_path,output,next_module=configuration.read_gpt_config('input',1) # prompt_input_value=configuration.prompt_input_process(input_path,prompt_input_declare) # prompt=configuration.read_prompt(prompt_path) # gpt_module('input',1,prompt_input_value,prompt,output) # input_path,prompt_input_declare,prompt_path,output,next_module=configuration.read_gpt_config('value',1) # prompt_input_value=configuration.prompt_input_process(input_path,prompt_input_declare) # prompt=configuration.read_prompt(prompt_path) # gpt_module('value',1,prompt_input_value,prompt,output) # input_path,prompt_input_declare,prompt_path,output,next_module=configuration.read_gpt_config('event',1) # prompt_input_value=configuration.prompt_input_process(input_path,prompt_input_declare) # prompt=configuration.read_prompt(prompt_path) # gpt_module('event',1,prompt_input_value,prompt,output) # input_path,prompt_input_declare,prompt_path,output,next_module=configuration.read_gpt_config('value',2) # prompt_input_value=configuration.prompt_input_process(input_path,prompt_input_declare) # prompt=configuration.read_prompt(prompt_path) # gpt_module('value',2,prompt_input_value,prompt,output) # input,value,judgement=configuration.read_judgement_config('Boolean',1) # input_value=configuration.judgement_input_process(input,value) # result=judgment_module('Boolean',input_value,judgement) # if result["type"]=="Interact": # input,choices,output=configuration.read_interact_config(result["class"],result["id"]) # choices_value=configuration.interact_input_process(input,choices) # interact_module(result["class"],result["id"],choices_value,output) # input_path,prompt_input_declare,prompt_path,output,next_module=configuration.read_gpt_config('event',2) # prompt_input_value=configuration.prompt_input_process(input_path,prompt_input_declare) # prompt=configuration.read_prompt(prompt_path) # gpt_module('event',2,prompt_input_value,prompt,output) # input_path,prompt_input_declare,prompt_path,output,next_module=configuration.read_gpt_config('value',2) # prompt_input_value=configuration.prompt_input_process(input_path,prompt_input_declare) # prompt=configuration.read_prompt(prompt_path) # gpt_module('value',2,prompt_input_value,prompt,output)