mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-03 20:16:52 +00:00
Format Templates (#12396)
This commit is contained in:
@@ -27,14 +27,16 @@ Assistant: <tool>search</tool><tool_input>weather in SF</tool_input>
|
||||
It is 64 degress in SF
|
||||
|
||||
|
||||
Begin!"""
|
||||
Begin!""" # noqa: E501
|
||||
|
||||
conversational_prompt = ChatPromptTemplate.from_messages([
|
||||
("system", template),
|
||||
MessagesPlaceholder(variable_name="chat_history"),
|
||||
("user", "{question}"),
|
||||
("ai", "{agent_scratchpad}")
|
||||
])
|
||||
conversational_prompt = ChatPromptTemplate.from_messages(
|
||||
[
|
||||
("system", template),
|
||||
MessagesPlaceholder(variable_name="chat_history"),
|
||||
("user", "{question}"),
|
||||
("ai", "{agent_scratchpad}"),
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
def parse_output(message):
|
||||
@@ -47,4 +49,4 @@ def parse_output(message):
|
||||
_tool_input = _tool_input.split("</tool_input>")[0]
|
||||
return AgentAction(tool=_tool, tool_input=_tool_input, log=text)
|
||||
else:
|
||||
return AgentFinish(return_values={"output": text}, log=text)
|
||||
return AgentFinish(return_values={"output": text}, log=text)
|
||||
|
Reference in New Issue
Block a user