Use LangChain to build a question-and-answer chat robot case (1)

Use LangChain to build a question-and-answer chat robot case

Live demonstration of GPT-4 code
generation In this section, we will explain LangChain to you through a comprehensive case. The code generated in this case will run directly in the browser and output the results, as shown in Figure 14-1. The user asks: "What was the highest close price of IBM?" ("What is the highest closing price of IBM?"), the displayed result is: "Highest close price of IBM: 215.8" ("IBM's highest closing price: 215.8") Gavin Cafe WeChat: NLP_Matrix_Space
insert image description here

Figure 14-1 Schematic diagram of a question-and-answer chatbot
This is content related to stock prices. Note that this result is generated by Python code. The browser uses LangChain Python code to run the chatbot. Since it is a conversational robot, it must use natural language. The question here is "What was the highest close price of IBM?", we can change it to: "What were the highest and lowerest close price of IBM?" ("What was the highest and lowest closing price of IBM?" ), click Run, as shown in Figure 14-2, the displayed results are: "Highest close price of IBM: 215.8" ("IBM highest closing price: 215.8"), "Lowest close price of IBM

Guess you like

Origin blog.csdn.net/duan_zhihua/article/details/132003347