https://github.com/denishlamichhane/chatbotintern
Intern project task using langchain and chat with multiple document
https://github.com/denishlamichhane/chatbotintern
chatbot gemini huggingface intern langcahin
Last synced: 8 months ago
JSON representation
Intern project task using langchain and chat with multiple document
- Host: GitHub
- URL: https://github.com/denishlamichhane/chatbotintern
- Owner: DenishLamichhane
- Created: 2024-03-20T15:32:05.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-21T15:02:25.000Z (over 2 years ago)
- Last Synced: 2025-08-25T16:37:44.896Z (10 months ago)
- Topics: chatbot, gemini, huggingface, intern, langcahin
- Language: Jupyter Notebook
- Homepage:
- Size: 82 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ChatBotIntern
# Palm Mind
# gemini
# langchain
The provided code implements a chatbot system that utilizes Langchain for natural language processing and document indexing. Here's a breakdown of the code:
**Setting Up Langchain and Indexing Documents:**
Langchain's OpenAI model is initialized with the provided API key.
The construct_index function reads text documents from a specified directory path and constructs an index using VectorStoreIndex from llama_index.core. The index is saved to disk using pickle for later retrieval.
**Collecting User Information:**
The collect_user_info function prompts the user to input their name, phone number, and email. It validates the input using regular expressions and calls the call_user function if the input is valid.
**Initiating a Call:**
The call_user function simulates calling the user by printing a message with their provided information. You can add code here to initiate a real call using a telephony service like Twilio.
**Asking the AI:**
The ask_ai function prompts the user to input queries. If the query is "call me," it triggers the user information collection process. Otherwise, it generates a response using Langchain and displays it.
**Running the Chatbot:**
The ask_ai function is called with the constructed index to start the chatbot interaction.
This code allows users to interact with the chatbot, ask queries, and request a call by providing their information. The chatbot generates responses based on the queries using Langchain's AI model.