Find answers from the community

Updated 9 months ago

@Logan M can you give me some advice on

@Logan M can you give me some advice on how can I replace this part
Plain Text
custom_prompt = PromptTemplate(
    """\
Given a conversation (between Human and Assistant) and a follow up message from Human, \
rewrite the message to be a standalone question that captures all relevant context \
from the conversation.

<Chat History>
{chat_history}

<Follow Up Message>
{question}

<Standalone question>
"""
)
with somthing like
Plain Text
my_template = "Given a conversation (between Human and Assistant) and a follow up message from Human, rewrite the message to be a standalone question that captures all relevant context from the conversation.

<Chat History>
{chat_history}

<Follow Up Message>
{question}

<Standalone question>"

custom_prompt = PromptTemplate(my_template)
W
A
3 comments
Do you want to remove the forward slash or unnecessary spaces?
You could do something for spaces like:
Plain Text
my_template = (
"Given a conversation (between Human and Assistant) and a follow up message from Human,"
"rewrite the message to be a standalone question that captures all relevant context"
"from the conversation."

"<Chat History>\n"
"{chat_history}\n"

"<Follow Up Message>\n"
"{question}\n"

"<Standalone question>"
)

custom_prompt = PromptTemplate(my_template)
I want to have this my_template = "my prompt template instruction" as text string will be then correct to use like this custom_prompt = PromptTemplate(my_template) ?
Add a reply
Sign up and join the conversation on Discord