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

Unlock the full course today

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

Create a retrieval chain: Parse and format results

Create a retrieval chain: Parse and format results

- [Instructor] Before, we have seen that the language model generates an object as a response. And so what we need is to return a string format, so an object in a string format. So we're going to use this StringOutputParser as a last component. And so to use it, we need to also import it. So that's going to be from langchain, actually schema import StringOutputParser. Here it is. And so, now, when we run, we're going to be able to use these two statements here. So we're going to be able to log first the question and then the answer. Let's try this, this time. All right, so now we can read question first. "How can I secure my MongoDB Atlas cluster?" Which is exactly the question that we ask. Then the answer that is being generated and that we can read in a string format. To secure your MongoDB Atlas cluster, you can enter that authentication. An IP address white list are enabled right out of the box. Excellent. So now we know how to set up a chain with RAG in order to allow the…

Contents