From the course: Level up LLM applications development with LangChain and OpenAI

Unlock the full course today

Join today to access over 24,400 courses taught by industry experts.

Query documents and generate extended responses

Query documents and generate extended responses

- [Instructor] For the final step, now we are able to execute the chain. So for the chain that we have composed, using, here, the retriever, and we also use the user query to then pass the information through to the custom rag prompts. And so the instructions that we give to the language model is to use the following pieces of context to answer the question at the end. And we also give the instructions to not try to make up the answer and to say that you don't know if you don't know the answer. And next, we can then send instructions to the language models to generate an output, which is then formatted, transformed into a string objects. So let's use it now because we would like to now run a demonstration from the main entry points by using our interactive app from the terminal. So let's wrap all of this within a function. I'm going to call it query data and I'm going to keep a few things. So first the question that we can use as an example. That's going to be answer. And then we're…

Contents