def create_prompt_template()

in llm_demo/orchestrator/langgraph/langgraph_orchestrator.py [0:0]


    def create_prompt_template(self, tools: List[StructuredTool]) -> ChatPromptTemplate:
        # Create new prompt template
        tool_strings = "\n".join(
            [f"> {tool.name}: {tool.description}" for tool in tools]
        )
        tool_names = ", ".join([tool.name for tool in tools])
        format_instructions = FORMAT_INSTRUCTIONS.format(
            tool_names=tool_names,
        )
        current_datetime = "Today's date and current time is {cur_datetime}."
        template = "\n\n".join(
            [
                PREFIX,
                current_datetime,
                TOOLS_PREFIX,
                tool_strings,
                format_instructions,
                SUFFIX,
            ]
        )

        prompt = ChatPromptTemplate.from_messages(
            [("system", template), ("placeholder", "{messages}")]
        )
        prompt = prompt.partial(cur_datetime=self.get_datetime)
        return prompt