ApplicationIntermediate
In the Langflow flow described in the chapter, what is the exact prompt template used to combine the user query with the retrieved context, and what are the two input ports that appear on the Prompt component after entering this template?
The exact prompt template is: "Answer the user query by using the context. Context: {chunks} User: {message}". After entering this template, two input ports appear on the Prompt component: chunk and message.
In the flow, the template instructs the LLM to answer the user query using the provided context, with placeholders for the retrieved chunks and the user query. The two input ports that appear are named chunk, which receives the retrieved context from the Data to Message component, and message, which receives the user query from the Chat Input component.
Key points
- Prompt template: "Answer the user query by using the context. Context: {chunks} User: {message}"
- The two input ports are chunk and message.
- The chunk port connects to the output of Data to Message.
- The message port connects to the output of Chat Input.
Related questions
AI Agents and Applications
Andrea De Mauro
MEAP Edition Version 7 · Manning Publications