Find answers from the community

Updated 3 months ago

Prompts

What is the proper way to pass in custom input_variables for Prompt? It says its supported at query time in the doc. I have a custom {history} one for instance, should it be passed in the query engine call where I define custom QA and refine prompts?
L
v
9 comments
Only very specific variables get filled in the prompt templates at query time.

If you add your own, you should fill it in instead of leaving it as a variable before passing it into the query 🫑
Ah! Interesting this is is what I was doing since I didn't find the "other" way. Glad to see what I was doing wasn't too wacky 🀣
Maybe a follow up question for you @Logan M (thanks for the help btw) is if I pass the history of chat convo this way, is there a way to integrate it in the embedding calls too so it's not just the prompt aware of it?
The query function takes two types of inputs, a string, and a query bundle

The query bundle allows you to specify something called embedding_strs, which is the string that is used for embeddings

You can add the history and query str to this attribute!
Searching for the docs page with more info...
Close enough!
Once again, the real MVP! Thank you so much will try this right away
Add a reply
Sign up and join the conversation on Discord