from langchain.schema.output_parser import StrOutputParser from chains.utils import getToolPromptTemplate from model import llm4 from langchain.tools import tool step3ToolName = "Problem Sharing" step3ToolContext = """\ After structuring the problem descriptions in the previous step, the team will share the following content within the group: - The problem/story described on the [Problem Storming Board]. - The refined problem description on the [Problem Deconstruction Canvas] based on the aforementioned problem/story. - The rationale behind posing such a question and the logical considerations involved. - Seek additional information inputs from the team, relevant stakeholders, or even the target users, considering their perspectives. During the sharing process, the facilitator should guide the group to merge similar problems according to the four dimensions of problem refinement. \ This collaborative approach ensures that the team consolidates their understanding of the problems at hand, \ enriches the context with diverse perspectives, and streamlines the focus for more targeted problem-solving efforts.\ """ step3ToolSuggestion = """\ 1. Centering on the [Problem Deconstruction Canvas]: \ Each participant takes a problem identified from the initial problem-storming phase and uses the canvas to dissect and organize it further. 2. Clarification of Dimensions: Before diving into the task, \ it's recommended to take 5 minutes to ensure that all participants have a clear understanding of each dimension on the canvas. \ This step is crucial for maintaining consistency in how problems are deconstructed and ensuring that all team members are on the same page.\ """ prompt = getToolPromptTemplate(step3ToolName, step3ToolContext, step3ToolSuggestion) step3Chain = prompt | llm4 | StrOutputParser() @tool("Problem Sharing") def step3Tool(context: str) -> str: """Useful for find some detail advise or examples when you process on "Problem Sharing" step. Need to input current problem context about Problem Sharing.""" return step3Chain.invoke({"current_situation": context})