พื้นที่เก็บข้อมูลนี้แสดงให้เห็นถึงวิธีการสร้าง chatbots ที่มีความสามารถในระดับหน่วยความจำที่แตกต่างกันโดยใช้ langchain, pinecone และ streamlit โครงการแสดงวิวัฒนาการจาก chatbot ไร้สัญชาติไปยังหนึ่งที่มีที่เก็บหน่วยความจำถาวร
ก่อนที่คุณจะเริ่มตรวจสอบให้แน่ใจว่ามี:
git clone https://github.com/spandan114/building-intelligent-chatbots.git
cd building-intelligent-chatbotsบน Windows:
# Create virtual environment
python -m venv chatbotenv
# Activate virtual environment
chatbotenv S cripts a ctivateบน macOS/linux:
# Create virtual environment
python -m venv chatbotenv
# Activate virtual environment
source chatbotenv/bin/activatepip install -r requirements.txt สร้างไฟล์ .env ในรูทโครงการ:
PINECONE_API_KEY = your_pinecone_api_key_here
OPENAI_API_KEY = your_openai_api_key_here
GROQ_API_KEY = your_groq_api_key_herestreamlit run app.py แอปพลิเคชันจะมีให้ที่ http://localhost:8501
deactivate building-intelligent-chatbots/
├── bot_with_pinecone_memory.py # Main application with Pinecone
├── bot_without_memory.py # Basic bot implementation
├── bot_with_temporary_memory.py # Bot with session state memory
├── requirements.txt # Project dependencies
├── .env # Environment variables (create this)
└── README.md # This file
บอทพื้นฐาน ( bot_without_memory.py ):
streamlit run bot_without_memory.py บอทหน่วยความจำชั่วคราว ( bot_with_temporary_memory.py ):
streamlit run bot_with_temporary_memory.py บอทหน่วยความจำถาวร ( bot_with_pinecone_memory.py ):
streamlit run bot_with_pinecone_memory.py langchain
langchain-groq
langchain-pinecone
langchain-huggingface
langchain-postgres
langchain-community
langchain-core
streamlit
python-dotenv
pinecone-client
psycopg2-binary
sentence-transformers
openai
tiktoken
ModulenotFoundError :
pip install -r requirements.txtข้อผิดพลาดคีย์ API :
.env ของคุณมีอยู่หรือไม่และมีปุ่ม API ที่ถูกต้องข้อผิดพลาด Pinecone :
หากคุณพบว่าโครงการนี้มีประโยชน์โปรดพิจารณาให้เป็นดารา! ช่วยให้ผู้อื่นค้นพบโครงการและกระตุ้นให้เราสร้างเนื้อหาเพิ่มเติม
สำหรับคำถามและข้อเสนอแนะโปรดเปิดปัญหาในที่เก็บ GitHub
การเข้ารหัสมีความสุข!