Based
Langchain
llama_index >=0.6.5
GPT-3.5
websockets
python >=3.10
dependence
1 | pip install llama-index |
What use
Supporting private knowledge base AI question-answering chatbot, capable of both knowledge-based Q&A and casual conversation.
AI Chatbot
1 | from llama_index import SimpleDirectoryReader, ServiceContext, GPTVectorStoreIndex, PromptHelper,StorageContext,load_index_from_storage |
Integrate WebSocket
Receive questions from the client and have AI generate answers.
websocket server.py
1 | from llama_index import SimpleDirectoryReader, ServiceContext, PromptHelper,StorageContext,load_index_from_storage,GPTVectorStoreIndex |
custom callback handler.py
Return AI’s response to the WebSocket client
1 | from typing import Any, Union |
- 本文作者: reiner
- 本文链接: https://reiner.host/posts/8f0289a1.html
- 版权声明: 转载请注明出处,并附上原文链接