def_pure(self,prompt:List[dict[str,str]],queries:List[str],retrieved_contents:List[List[str]],)->List[List[dict[str,str]]]:""" Make a prompt using f-string from a query and retrieved_contents. You must type a prompt or prompt list at a config YAML file like this: .. Code:: yaml nodes: - node_type: prompt_maker modules: - module_type: chatfstring prompt: - - role: system content: You are a helpful assistant that helps people find information. - role: user content: | Answer this question: {query} {retrieved_contents} - - role: system content: You are helpful. - role: user content: | Read the passages carefully and answer this question: {query} Passages: {retrieved_contents} :param prompt: A prompt string. :param queries: List of query strings. :param retrieved_contents: List of retrieved contents. :return: Prompts that are made by chat f-string. It is the list of OpenAI chat format prompts. """deffstring_row(_prompt:List[dict[str,str]],_query:str,_retrieved_contents:List[str])->List[dict[str,str]]:contents_str="\n\n".join(_retrieved_contents)result_prompt=copy.deepcopy(_prompt)forlstinresult_prompt:if"content"inlst:lst["content"]=lst["content"].format(query=_query,retrieved_contents=contents_str)returnresult_promptreturnlist(map(lambdax:fstring_row(prompt,x[0],x[1]),zip(queries,retrieved_contents),))