Skip to content

How to add more inputs to my Retrieval QA Prompt Template #11542

Answered by eyurtsev
sergiogcb asked this question in Q&A
Discussion options

You must be logged in to vote

The original code has a bug in it -- After formatting the value needs to be assigned to a variable

myapp = 'hello'
context = 'meow'

template =  """You are a human assist that is expert with our app.
Always say "Best regards" at the end of the answer, and "Thanks for your request, at the beginning.
{context}
App: {app}
At the end of your sentence return the used app"""

template.format(app=myapp, context=context)
print(template)

print("Correct")
template = template.format(app=myapp, context=context)
print(template)


QA_CHAIN_PROMPT = PromptTemplate.from_template(template)
QA_CHAIN_PROMPT.invoke({})

Replies: 4 comments 12 replies

Comment options

You must be logged in to vote
2 replies
@sergiogcb
Comment options

@dosubot
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
10 replies
@weissenbacherpwc
Comment options

@weissenbacherpwc
Comment options

@eyurtsev
Comment options

@NickWyq
Comment options

@weissenbacherpwc
Comment options

Answer selected by eyurtsev
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants