| { | |
| "class_name": "SequentialWorkFlowGraph", | |
| "goal": "Answer user questions accurately and concisely by decomposing the problem into analysis and generate.", | |
| "tasks": [ | |
| { | |
| "name": "handle_ambiguity3812", | |
| "description": "Task to handle_ambiguity3812. Takes question as input. Produces clarified_question as output.", | |
| "inputs": [ | |
| { | |
| "name": "question", | |
| "type": "str", | |
| "description": "Input parameter question for handle_ambiguity3812", | |
| "required": false | |
| } | |
| ], | |
| "outputs": [ | |
| { | |
| "name": "clarified_question", | |
| "type": "str", | |
| "description": "Output parameter clarified_question from handle_ambiguity3812", | |
| "required": true | |
| } | |
| ], | |
| "prompt": "```xml\n\"\"\"\nThink step by step to answer the question based on the context provided in {context}. First, analyze {question} to identify any ambiguous elements or missing information that may require clarification. If necessary, formulate specific questions to gather additional details that will aid in providing a comprehensive answer. Once you have sufficient context, generate an initial answer based on the analysis of {question}. After generating the answer, validate it against the context to ensure both accuracy and relevance. If any contradictions arise between the validated answer and the context, address them to refine the final output. Present your thought process in the 'thought' field and provide the final answer in the 'answer' field, ensuring clarity and conciseness throughout the response.\nFormat your output in xml format, such as <thought>xxx</thought> and <answer>xxx</answer>.\n\"\"\"\n```", | |
| "prompt_template": { | |
| "class_name": "StringTemplate", | |
| "instruction": "Think step by step to answer the question based on the question context. You should integrate context for answering. You should explain your thinking process in the 'thought' field, and provide the final answer in the 'answer' field.\nFormat your output in xml format, such as <thought>xxx</thought> and <answer>xxx</answer>." | |
| }, | |
| "system_prompt": "You are a helpful and highly intelligent assistant.", | |
| "parse_mode": "xml", | |
| "parse_func": null, | |
| "parse_title": null, | |
| "tool_names": null | |
| }, | |
| { | |
| "name": "generate_answer", | |
| "description": "Draft an answer using the retrieved context.", | |
| "inputs": [ | |
| { | |
| "name": "question", | |
| "type": "str", | |
| "description": "The original question from the user.", | |
| "required": true | |
| } | |
| ], | |
| "outputs": [ | |
| { | |
| "name": "draft_answer", | |
| "type": "str", | |
| "description": "A concise, direct answer to the question.", | |
| "required": true | |
| } | |
| ], | |
| "prompt": "\"\"\"\nYou can think to generate answers. First, analyze the context of the question `{question}` to identify its key components and determine if it can be answered with a simple \"Yes\" or \"No.\" If the question is complex or ambiguous, ask clarifying questions to gather more information and provide a nuanced response that addresses the underlying issues. After generating the draft answer, validate it against the context `{context}` to ensure accuracy and relevance. If there are contradictions between the draft answer and the context, clarify these discrepancies before finalizing the response. If the question is unanswerable based on the context, invoke the 'handle_unanswerable4864' step to provide an appropriate response. Format your final answer in the 'answer' field as <answer>{final_answer}</answer>.\n\"\"\"", | |
| "prompt_template": { | |
| "class_name": "StringTemplate", | |
| "instruction": "You can think to generate answers. You should provide the final answer (Yes or No) in the 'answer' field. Format your answer in <answer>xxx</answer>." | |
| }, | |
| "system_prompt": "You are a helpful and highly intelligent assistant.", | |
| "parse_mode": "xml", | |
| "parse_func": null, | |
| "parse_title": null, | |
| "tool_names": null | |
| }, | |
| { | |
| "name": "validate_answer4047", | |
| "description": "Task to validate_answer4047. Takes draft_answer, context as input. Produces validated_answer as output.", | |
| "inputs": [ | |
| { | |
| "name": "draft_answer", | |
| "type": "str", | |
| "description": "Input parameter draft_answer for validate_answer4047", | |
| "required": false | |
| }, | |
| { | |
| "name": "context", | |
| "type": "str", | |
| "description": "Input parameter context for validate_answer4047", | |
| "required": false | |
| } | |
| ], | |
| "outputs": [ | |
| { | |
| "name": "validated_answer", | |
| "type": "str", | |
| "description": "Output parameter validated_answer from validate_answer4047", | |
| "required": true | |
| } | |
| ], | |
| "prompt": "\"\"\"\nThink step by step to answer the question based on the context provided in {context}. Begin by analyzing {question} to identify any ambiguities and clarify them if necessary, using the output from the 'handle_ambiguity3812' step to ensure a clear understanding of the user's intent. Then, generate a draft answer based on your analysis of the clarified question. Validate this draft answer against the context to ensure accuracy and relevance, making any necessary adjustments based on the validation process. After validation, check for any contradictions between the validated answer and the context, ensuring that the reasoning aligns with the information provided. Explain your reasoning process in the 'thought' field, detailing how you integrated the context and addressed any ambiguities or contradictions. Finally, provide the final answer in the 'answer' field. Format your output in XML format, such as <thought>{thought}</thought> and <answer>{answer}</answer>.\n\"\"\"", | |
| "prompt_template": { | |
| "class_name": "StringTemplate", | |
| "instruction": "Think step by step to answer the question based on the question context. You should integrate context for answering. You should explain your thinking process in the 'thought' field, and provide the final answer in the 'answer' field.\nFormat your output in xml format, such as <thought>xxx</thought> and <answer>xxx</answer>." | |
| }, | |
| "system_prompt": "You are a helpful and highly intelligent assistant.", | |
| "parse_mode": "xml", | |
| "parse_func": null, | |
| "parse_title": null, | |
| "tool_names": null | |
| }, | |
| { | |
| "name": "check_for_contradictions92", | |
| "description": "Task to check_for_contradictions92. Takes validated_answer, context as input. Produces final_answer as output.", | |
| "inputs": [ | |
| { | |
| "name": "validated_answer", | |
| "type": "str", | |
| "description": "Input parameter validated_answer for check_for_contradictions92", | |
| "required": false | |
| }, | |
| { | |
| "name": "context", | |
| "type": "str", | |
| "description": "Input parameter context for check_for_contradictions92", | |
| "required": false | |
| } | |
| ], | |
| "outputs": [ | |
| { | |
| "name": "final_answer", | |
| "type": "str", | |
| "description": "Output parameter final_answer from check_for_contradictions92", | |
| "required": true | |
| } | |
| ], | |
| "prompt": "```xml\n\"\"\"\nThink step by step to answer the question based on the context provided in {context}. First, analyze the {validated_answer} in relation to {context} to ensure consistency and accuracy. If any contradictions arise between the {validated_answer} and the {context}, explicitly address them and revise the answer accordingly. Additionally, if there is uncertainty or ambiguity in the answer, clearly indicate this in your response. Provide your reasoning in the 'thought' field, and present the final answer in the 'answer' field. If the context does not provide sufficient information to answer the question, acknowledge this limitation in your response.\nFormat your output in xml format, such as <thought>xxx</thought> and <answer>xxx</answer>.\n\"\"\"\n```", | |
| "prompt_template": { | |
| "class_name": "StringTemplate", | |
| "instruction": "Think step by step to answer the question based on the question context. You should integrate context for answering. You should explain your thinking process in the 'thought' field, and provide the final answer in the 'answer' field.\nFormat your output in xml format, such as <thought>xxx</thought> and <answer>xxx</answer>." | |
| }, | |
| "system_prompt": "You are a helpful and highly intelligent assistant.", | |
| "parse_mode": "xml", | |
| "parse_func": null, | |
| "parse_title": null, | |
| "tool_names": null | |
| } | |
| ] | |
| } |