in llm_demo/orchestrator/langchain_tools/langchain_tools_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,
]
)
human_message_template = "{input}\n\n{agent_scratchpad}"
prompt = ChatPromptTemplate.from_messages(
[("system", template), ("human", human_message_template)]
)
prompt = prompt.partial(cur_datetime=self.get_datetime)
return prompt