def new_story(generator, context, prompt, memory=None, first_result=None): if memory is None: memory = [] context = context.strip() prompt = prompt.strip() story = Story(generator, context, memory) if first_result is None: story.act(prompt) else: story.actions.append(prompt) story.results.append(first_result) story.print_story() return story
def new_story(generator, context, prompt, memory=None, first_result=None): if memory is None: memory = [] context = context.strip() prompt = prompt.strip() erase = 0 if use_ptoolkit(): erase = output(context, 'user-text', prompt, 'user-text', sep="\n\n") story = Story(generator, context, memory) if first_result is None: story.act(prompt) else: story.actions.append(prompt) story.results.append(first_result) clear_lines(erase) story.print_story() return story
def newStory(generator, prompt, context): story = Story(generator, prompt) assert (story.prompt) first_result = story.act(context) colPrint(prompt, colors['user-text'], end='') colPrint(context, colors['user-text'], end='') colPrint(first_result[0], colors['ai-text'], end='') print("\n\n") return story