Spaces:
Sleeping
Sleeping
Aryan Jain commited on
Commit ·
c2ebaa7
1
Parent(s): 43b064c
add api to update the pinecone database
Browse files- sifars.md +257 -0
- src/app.py +3 -2
- src/controllers/__init__.py +3 -0
- src/controllers/_database_controller.py +19 -0
- src/crawler/__init__.py +9 -0
- src/crawler/_database_updater.py +57 -0
- src/crawler/_web_crawler.py +83 -0
- src/services/__init__.py +2 -0
- src/services/_chat_service.py +1 -1
- src/services/_database_service.py +21 -0
- src/utils/_chat_client.py +11 -19
- src/utils/_pinecone_client.py +13 -6
sifars.md
ADDED
|
@@ -0,0 +1,257 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Sifars
|
| 2 |
+
|
| 3 |
+
## Brand Positioning
|
| 4 |
+
- Whether you’re a start-up or an established enterprise looking to outshine with innovative ideas, our Enterprise Software Development Services helps business swiftness and efficiency with mobile and web solutions.
|
| 5 |
+
- We engineer delightful exceptional and customer-grade experiences.
|
| 6 |
+
- We love the work we do. We work closely with our clients to deliver the best possible solutions for their needs
|
| 7 |
+
- We tailor products that serve as fuel to your business.
|
| 8 |
+
- Driving Growth through Digital Innovation
|
| 9 |
+
- Sifars synergizes talent and experience. We deliver the best Web, UX & Software development solutions for startups & enterprises.
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
## Technologies Used by Sifars
|
| 14 |
+
|
| 15 |
+
1. Artificial Intelligence
|
| 16 |
+
- **Generative AI**: Imagine an AI that can create new ideas for you. Our generative AI solutions can generate code, write content, or even compose music. The possibilities are endless.
|
| 17 |
+
- **AI Consultation**: We'll help you navigate the AI landscape. Our experts will guide you in choosing the right AI solution for your business.
|
| 18 |
+
- **Model Fine-Tuning**: We'll take your AI model to the next level. Our team of experts will fine-tune your model to achieve better results.
|
| 19 |
+
- **Conversational Chatbots**: Create a better customer experience with our conversational chatbots. We'll help you build a chatbot that can understand and respond to customer queries in a human-like way.
|
| 20 |
+
- **LLM Optimization**: Get the most out of your large language model (LLM). We'll help you optimize your LLM to achieve better performance and reduce costs.
|
| 21 |
+
- **Computer Vision**: Analyze and understand visual data with our computer vision solutions. We'll help you build a system that can detect objects, recognize faces, and more.
|
| 22 |
+
- **Predictive Analytics**: Make better decisions with our predictive analytics solutions. We'll help you build a system that can predict customer behavior, detect anomalies, and more.
|
| 23 |
+
- **Machine Learning**: Build a better future with machine learning. We'll help you build a system that can learn from data and make decisions on its own.
|
| 24 |
+
- **Natural Language Processing**: Build a better customer experience with natural language processing. We'll help you build a system that can understand and respond to customer queries in a human-like way.
|
| 25 |
+
- **Deep Learning**: Build a better AI model with deep learning. We'll help you build a model that can learn from data and make decisions on its own.
|
| 26 |
+
- **Reinforcement Learning**: Build a better AI model with reinforcement learning. We'll help you build a model that can learn from data and make decisions on its own.
|
| 27 |
+
- **Transfer Learning**: Build a better AI model with transfer learning. We'll help you build a model that can learn from data and make decisions on its own.
|
| 28 |
+
- **And more**: We have expertise in many other AI technologies, including neural networks, decision trees, random forests, and more.
|
| 29 |
+
|
| 30 |
+
2. Web Development
|
| 31 |
+
- **Laravel**: Build a better web application with Laravel. Our team of experts will help you build a web application that is fast, secure, and scalable.
|
| 32 |
+
- **UI/UX**: Create a better user experience with our UI/UX solutions. We'll help you design a user interface that is intuitive and easy to use.
|
| 33 |
+
- **Node Js**: Build a better web application with Node.js. Our team of experts will help you build a web application that is fast, secure, and scalable.
|
| 34 |
+
- **React Js**: Build a better web application with React.js. Our team of experts will help you build a web application that is fast, secure, and scalable.
|
| 35 |
+
- **Vue Js**: Build a better web application with Vue.js. Our team of experts will help you build a web application that is fast, secure, and scalable.
|
| 36 |
+
- **Angular**: Build a better web application with Angular. Our team of experts will help you build a web application that is fast, secure, and scalable.
|
| 37 |
+
- **Python**: Build a better web application with Python. Our team of experts will help you build a web application that is fast, secure, and scalable.
|
| 38 |
+
- **Django**: Build a better web application with Django. Our team of experts will help you build a web application that is fast, secure, and scalable.
|
| 39 |
+
- **Ruby on Rails**: Build a better web application with Ruby on Rails. Our team of experts will help you build a web application that is fast, secure, and scalable.
|
| 40 |
+
- **PHP**: Build a better web application with PHP. Our team of experts will help you build a web application that is fast, secure, and scalable.
|
| 41 |
+
- **Cloud App**: Build a better web application with cloud app. Our team of experts will help you build a web application that is fast, secure, and scalable.
|
| 42 |
+
- **Automation**: Automate your web application with our automation solutions. We'll help you build a system that can automate tasks and workflows.
|
| 43 |
+
- **Bot**: Build a better web application with bots. We'll help you build a system that can automate tasks and workflows.
|
| 44 |
+
- **Data Services**: Get the most out of your data with our data services. We'll help you build a system that can collect, store, and analyze data.
|
| 45 |
+
- **And more**: We have expertise in many other web development technologies, including HTML, CSS, JavaScript, and more.
|
| 46 |
+
|
| 47 |
+
3. Mobile App Development:
|
| 48 |
+
- **Mobility**: Build a better mobile app with our mobility solutions. We'll help you build a mobile app that is fast, secure, and scalable.
|
| 49 |
+
- **Android Apps**: Build a better Android app with our Android app development solutions. We'll help you build a mobile app that is fast, secure, and scalable.
|
| 50 |
+
- **iOS Apps**: Build a better iOS app with our iOS app development solutions. We'll help you build a mobile app that is fast, secure, and scalable.
|
| 51 |
+
- **React Native**: Build a better mobile app with React Native. Our team of experts will help you build a mobile app that is fast, secure, and scalable.
|
| 52 |
+
- **Ionic**: Build a better mobile app with Ionic. Our team of experts will help you build a mobile app that is fast, secure, and scalable.
|
| 53 |
+
- **Flutter**: Build a better mobile app with Flutter. Our team of experts will help you build a mobile app that is fast, secure, and scalable.
|
| 54 |
+
- **Kotlin**: Build a better Android app with Kotlin. Our team of experts will help you build a mobile app that is fast, secure, and scalable.
|
| 55 |
+
- **Swift**: Build a better iOS app with Swift. Our team of experts will help you build a mobile app that is fast, secure, and scalable.
|
| 56 |
+
- **Java**: Build a better Android app with Java. Our team of experts will help you build a mobile app that is fast, secure, and scalable.
|
| 57 |
+
- **And more**: We have expertise in many other mobile app development technologies, including Objective-C, C#, and more.
|
| 58 |
+
|
| 59 |
+
4. DevOps
|
| 60 |
+
- **Docker**: Build a better application with Docker. Our team of experts will help you use Docker to build, ship, and run your application.
|
| 61 |
+
- **Kubernetes**: Build a better application with Kubernetes. Our team of experts will help you use Kubernetes to build, ship, and run your application.
|
| 62 |
+
- **Jenkins**: Build a better application with Jenkins. Our team of experts will help you use Jenkins to build, ship, and run your application.
|
| 63 |
+
- **GitLab CI/CD**: Build a better application with GitLab CI/CD. Our team of experts will help you use GitLab CI/CD to build, ship, and run your application.
|
| 64 |
+
- **Azure DevOps**: Build a better application with Azure DevOps. Our team of experts will help you use Azure DevOps to build, ship, and run your application.
|
| 65 |
+
- **Cloud Foundry**: Build a better application with Cloud Foundry. Our team of experts will help you use Cloud Foundry to build, ship, and run your application.
|
| 66 |
+
- **Google Cloud Build**: Build a better application with Google Cloud Build. Our team of experts will help you use Google Cloud Build to build, ship, and run your application.
|
| 67 |
+
- **CircleCI**: Build a better application with CircleCI. Our team of experts will help you use CircleCI to build, ship, and run your application.
|
| 68 |
+
- **Travis CI**: Build a better application with Travis CI. Our team of experts will help you use Travis CI to build, ship, and run your application.
|
| 69 |
+
- **And more**: We have expertise in many other DevOps technologies, including Ansible, Puppet, Chef, and more.
|
| 70 |
+
|
| 71 |
+
5. Cyber Security
|
| 72 |
+
- **Penetration Testing**: Protect your business from cyber threats with our penetration testing solutions. We'll help you identify vulnerabilities in your system and fix them before they can be exploited.
|
| 73 |
+
- **Vulnerability Assessment**: Get a comprehensive view of your system's vulnerabilities with our vulnerability assessment solutions. We'll help you identify vulnerabilities and fix them before they can be exploited.
|
| 74 |
+
- **Compliance and Risk Management**: Get a comprehensive view of your system's compliance and risk management with our compliance and risk management solutions. We'll help you identify vulnerabilities and fix them before they can be exploited.
|
| 75 |
+
- **Incident Response**: Protect your business from cyber threats with our incident response solutions. We'll help you respond quickly and effectively to cyber threats.
|
| 76 |
+
- **Security Orchestration**: Protect your business from cyber threats with our security orchestration solutions. We'll help you automate and streamline your security processes.
|
| 77 |
+
- **Identity and Access Management**: Protect your business from cyber threats with our identity and access management solutions. We'll help you manage access to your system and ensure that only authorized users can access your data.
|
| 78 |
+
- **Network Security**: Protect your business from cyber threats with our network security solutions. We'll help you secure your network and ensure that only authorized users can access your data.
|
| 79 |
+
- **Cryptography**: Protect your business from cyber threats with our cryptography solutions. We'll help you encrypt your data and ensure that only authorized users can access it.
|
| 80 |
+
- **And more**: We have expertise in many other cyber security technologies, including encryption, access control, and more.
|
| 81 |
+
|
| 82 |
+
6. Database Management
|
| 83 |
+
- **MySQL**: Store your data securely with MySQL. Our team of experts will help you design, deploy, and manage a MySQL database that is optimized for performance and scalability.
|
| 84 |
+
- **PostgreSQL**: Store your data securely with PostgreSQL. Our team of experts will help you design, deploy, and manage a PostgreSQL database that is optimized for performance and scalability.
|
| 85 |
+
- **MongoDB**: Store your data securely with MongoDB. Our team of experts will help you design, deploy, and manage a MongoDB database that is optimized for performance and scalability.
|
| 86 |
+
- **Cassandra**: Store your data securely with Cassandra. Our team of experts will help you design, deploy, and manage a Cassandra database that is optimized for performance and scalability.
|
| 87 |
+
- **Oracle**: Store your data securely with Oracle. Our team of experts will help you design, deploy, and manage an Oracle database that is optimized for performance and scalability.
|
| 88 |
+
- **Microsoft SQL Server**: Store your data securely with Microsoft SQL Server. Our team of experts will help you design, deploy, and manage a Microsoft SQL Server database that is optimized for performance and scalability.
|
| 89 |
+
- **IBM DB2**: Store your data securely with IBM DB2. Our team of experts will help you design, deploy, and manage an IBM DB2 database that is optimized for performance and scalability.
|
| 90 |
+
- **Amazon DynamoDB**: Store your data securely with Amazon DynamoDB. Our team of experts will help you design, deploy, and manage an Amazon DynamoDB database that is optimized for performance and scalability.
|
| 91 |
+
- **Google Cloud SQL**: Store your data securely with Google Cloud SQL. Our team of experts will help you design, deploy, and manage a Google Cloud SQL database that is optimized for performance and scalability.
|
| 92 |
+
- **And more**: We have expertise in many other database management technologies, including IBM Informix, Apache Cassandra, and more.
|
| 93 |
+
|
| 94 |
+
7. Cloud Services
|
| 95 |
+
- **AWS**: Build a better cloud infrastructure with AWS. Our team of experts will help you design, deploy, and manage a cloud infrastructure that is optimized for performance and scalability.
|
| 96 |
+
- **Azure**: Build a better cloud infrastructure with Azure. Our team of experts will help you design, deploy, and manage a cloud infrastructure that is optimized for performance and scalability.
|
| 97 |
+
- **Google Cloud Platform**: Build a better cloud infrastructure with Google Cloud Platform. Our team of experts will help you design, deploy, and manage a cloud infrastructure that is optimized for performance and scalability.
|
| 98 |
+
- **IBM Cloud**: Build a better cloud infrastructure with IBM Cloud. Our team of experts will help you design, deploy, and manage a cloud infrastructure that is optimized for performance and scalability.
|
| 99 |
+
- **Rackspace**: Build a better cloud infrastructure with Rackspace. Our team of experts will help you design, deploy, and manage a cloud infrastructure that is optimized for performance and scalability.
|
| 100 |
+
- **Cloud Foundry**: Build a better cloud infrastructure with Cloud Foundry. Our team of experts will help you design, deploy, and manage a cloud infrastructure that is optimized for performance and scalability.
|
| 101 |
+
- **Heroku**: Build a better cloud infrastructure with Heroku. Our team of experts will help you design, deploy, and manage a cloud infrastructure that is optimized for performance and scalability.
|
| 102 |
+
- **OpenStack**: Build a better cloud infrastructure with OpenStack. Our team of experts will help you design, deploy, and manage a cloud infrastructure that is optimized for performance and scalability.
|
| 103 |
+
- **And more**: We have expertise in many other cloud services, including Oracle Cloud, SAP Cloud Platform, and more.
|
| 104 |
+
|
| 105 |
+
## Testimonials
|
| 106 |
+
|
| 107 |
+
**Great Work Speaks for Itself**
|
| 108 |
+
|
| 109 |
+
**Gabriela Bazan**
|
| 110 |
+
*Founder of GLB Design & Development*
|
| 111 |
+
"The Sifars Team is an arsenal of talented developers that I admire and trust. They’re a dream team, so fun to work with, and at the same time completely professional."
|
| 112 |
+
|
| 113 |
+
---
|
| 114 |
+
|
| 115 |
+
**Siamak Mehraghdam**
|
| 116 |
+
*Co-Founder of Qcentic*
|
| 117 |
+
"Sifars is an extended team to us. The level of their expertise, consultancy, and professionalism are commendable. Really responsive and good listeners, deliver exactly what one expects with a level of expertise."
|
| 118 |
+
|
| 119 |
+
---
|
| 120 |
+
|
| 121 |
+
**Santiago Sanches**
|
| 122 |
+
*Development Manager at Savage Global Marketing*
|
| 123 |
+
"The level of support during the whole development cycle was remarkable. I must say the team is highly professional, competent, and responsive."
|
| 124 |
+
|
| 125 |
+
---
|
| 126 |
+
|
| 127 |
+
**Barrister Naveed Khan**
|
| 128 |
+
*CEO of Askwakeel*
|
| 129 |
+
"They are very competent and reasonable with their pricing. The platform functions well without any bugs. Sifars is a highly deadline-oriented, communicative group."
|
| 130 |
+
|
| 131 |
+
|
| 132 |
+
## Projects
|
| 133 |
+
**Our Portfolio Embraces Apex and Extraordinary Projects**
|
| 134 |
+
|
| 135 |
+
### Hoora
|
| 136 |
+
*Introducing Hoora, the avant-garde multi-tenant employee management app redefining workplace efficiency. Hoora comes equipped with an advanced AI chatbot that not only provides information but actively assists employees across various organizational aspects. Seamlessly integrating with your database and organizational files, Hoora's AI chatbot streamlines tasks, offers real-time information, and ensures a more productive and engaged workforce.*
|
| 137 |
+
|
| 138 |
+
---
|
| 139 |
+
|
| 140 |
+
### Elevate.AI
|
| 141 |
+
*Welcome to Elevate.AI, where cutting-edge technology meets personalized real estate solutions. Elevate.AI is a revolutionary project designed to seamlessly connect with potential real estate clients through the familiar and convenient platform of WhatsApp. Acting as your virtual human assistant, Elevate.AI employs advanced artificial intelligence to engage, generate leads, and schedule appointments with clients, making your real estate business more efficient and customer-centric.*
|
| 142 |
+
|
| 143 |
+
---
|
| 144 |
+
|
| 145 |
+
### Adamo
|
| 146 |
+
*Personalized nutrition, wellness tips, travel insights, and more. Upcoming features include prompt and image generators, seamless social media integration, and a media center. Boost business productivity with AI integration. Welcome to Adamo – where possibilities abound.*
|
| 147 |
+
|
| 148 |
+
---
|
| 149 |
+
|
| 150 |
+
### SalesBod
|
| 151 |
+
*A Chrome extension empowered with AI capabilities that helps salespeople gain information about companies and individuals. It enables salespeople to compose emails with a single prompt and generate POV. Additionally, it provides access to a user admin panel where users can manage their histories and company information related to executed prompts.*
|
| 152 |
+
|
| 153 |
+
---
|
| 154 |
+
|
| 155 |
+
### Travelidu
|
| 156 |
+
*A custom web application that scrapes data from multiple providers and displays suitable vacations for users. It is empowered with an admin panel to manage all its bots and scrapers, along with data management functionalities. It provides various filters for holidays and locations to facilitate search. The admin panel empowers administrators to manage complex data with a user-friendly interface.*
|
| 157 |
+
|
| 158 |
+
---
|
| 159 |
+
|
| 160 |
+
### Online Donation Form Management Web Application
|
| 161 |
+
*A custom web application that allows multiple clients to manage online donation forms. A robust and flexible application with technology integrated to seamlessly allow future enhancement and growth to the online donation processing system.*
|
| 162 |
+
|
| 163 |
+
---
|
| 164 |
+
|
| 165 |
+
### Indian Wedding & Event Planning Platform
|
| 166 |
+
*A dedicated website for easy event planning and hiring resources for an event. Specially designed and curated for Indian weddings and events.*
|
| 167 |
+
|
| 168 |
+
---
|
| 169 |
+
|
| 170 |
+
### CatsBill
|
| 171 |
+
*A Sifars initiative, an elegant and easy-to-use online portal to generate GST invoicing in India with many advanced features like inventory, stock transfer, and invoice management.*
|
| 172 |
+
|
| 173 |
+
---
|
| 174 |
+
|
| 175 |
+
### Instagram Auto Posting Platform
|
| 176 |
+
*An interactive Instagram auto-posting platform engaging multiple profiles. A custom automation tool with features like scheduled follow, unfollow, and likes to organically grow Instagram followers.*
|
| 177 |
+
|
| 178 |
+
---
|
| 179 |
+
|
| 180 |
+
### iTunes Traffic Booster
|
| 181 |
+
*An automation tool to increase the traffic of your song on iTunes.*
|
| 182 |
+
|
| 183 |
+
---
|
| 184 |
+
|
| 185 |
+
### Domotron
|
| 186 |
+
*An interactive design made using PicoCMS and Pattern Labs.*
|
| 187 |
+
|
| 188 |
+
---
|
| 189 |
+
|
| 190 |
+
### Labonics WooCommerce Theme
|
| 191 |
+
*A custom theme for a WooCommerce site to shop Labonics products integrated with an ERP system.*
|
| 192 |
+
|
| 193 |
+
---
|
| 194 |
+
|
| 195 |
+
### Get Connect
|
| 196 |
+
*A cloud-based ETL software solution specifically designed for the banking sector to automate manual ETL processes into a design-enriched automated software program. The program is highly flexible and integrated with many administrative controls.*
|
| 197 |
+
|
| 198 |
+
---
|
| 199 |
+
|
| 200 |
+
### Advertorials.ai
|
| 201 |
+
*Struggling to create ads that actually convert? Meet Advertorials.ai. Our AI-powered platform crafts top-performing advertorials in minutes, based on the best in the business. Plus, we streamline your workflow with project management tools, making collaboration a breeze. Test more, stress less, and watch your ad game soar with Advertorials.ai.*
|
| 202 |
+
|
| 203 |
+
---
|
| 204 |
+
|
| 205 |
+
### Forecasty.ai
|
| 206 |
+
*Forecasty.ai is a self-service forecasting platform powered by advanced AI/ML technology, enabling you to generate forecasts easier and faster. It generates high-quality forecasts and provides predictive insights to make smarter business decisions. In-depth forecasts for commodity prices to prepare better in a volatile commodity market.*
|
| 207 |
+
|
| 208 |
+
|
| 209 |
+
## About Sifars
|
| 210 |
+
|
| 211 |
+
Sifars, a pioneering web service provider, emerged onto the tech landscape in 2018 with a vision to revolutionize the digital sphere. Founded by visionary entrepreneurs Jatin Sethi, Munish Kumar, and Sukhwinder Singh, Sifars set its sights on empowering businesses worldwide with cutting-edge technology solutions. With its global headquarters nestled in the vibrant city of Patiala, Punjab, India, Sifars quickly garnered recognition as a leading application development company, committed to propelling businesses towards success in the ever-evolving tech landscape.
|
| 212 |
+
|
| 213 |
+
**Mission and Vision**
|
| 214 |
+
|
| 215 |
+
At Sifars, we pride ourselves on our unwavering commitment to excellence and innovation. Our mission is simple yet profound: to tailor products that serve as the lifeblood of businesses, fueling their growth and success in the digital age. With a steadfast focus on driving growth through digital innovation, we strive to empower businesses of all sizes to establish their identity and thrive in the competitive tech world. Our vision is to be the catalyst for transformation, leveraging technology to unlock new possibilities and propel businesses towards unprecedented success.
|
| 216 |
+
|
| 217 |
+
**Core Values**
|
| 218 |
+
|
| 219 |
+
At the heart of Sifars lie our core values, which serve as the guiding principles in everything we do:
|
| 220 |
+
|
| 221 |
+
* **Innovation:** We embrace innovation as the cornerstone of progress, constantly pushing boundaries and exploring new frontiers in technology.
|
| 222 |
+
* **Quality:** We are committed to delivering excellence in every endeavor, ensuring that our products and solutions meet the highest standards of quality and reliability.
|
| 223 |
+
* **Collaboration:** We foster a culture of collaboration and teamwork, recognizing that the collective genius of our team fuels our success.
|
| 224 |
+
* **Customer-Centricity:** We prioritize the needs and aspirations of our clients, striving to exceed their expectations and deliver unparalleled value.
|
| 225 |
+
* **Integrity:** We conduct ourselves with integrity and honesty, upholding the highest ethical standards in all our interactions and endeavors.
|
| 226 |
+
|
| 227 |
+
## Approach to Clients
|
| 228 |
+
|
| 229 |
+
At Sifars, we believe in building strong, long-lasting relationships with our clients. Our success is intrinsically tied to theirs. That's why we take a highly personalized and client-centric approach to every project.
|
| 230 |
+
|
| 231 |
+
**We begin by truly understanding your vision:**
|
| 232 |
+
|
| 233 |
+
* **We listen attentively:** We don't just hear your words, we actively listen to grasp the underlying needs and challenges driving your project. We ask questions to ensure we fully comprehend your goals and expectations.
|
| 234 |
+
* **We leverage our industry expertise:** Our team is well-versed in various industries and can quickly tailor solutions to your specific needs. Whether you're in healthcare, finance, or retail, we can understand your unique challenges and develop solutions that address them directly.
|
| 235 |
+
* **We collaborate with you:** We believe in a collaborative approach to ideation. We brainstorm together to develop innovative and creative solutions that push the boundaries of what's possible.
|
| 236 |
+
|
| 237 |
+
**Once we've gained a deep understanding, we focus on crafting a tailor-made solution:**
|
| 238 |
+
|
| 239 |
+
* **Custom development is our specialty:** We don't believe in one-size-fits-all solutions. We create custom software that perfectly addresses your unique requirements and challenges, ensuring the final product is exactly what you need.
|
| 240 |
+
* **We embrace agile development:** This iterative process allows us to incorporate your feedback at every stage, ensuring that the final product meets your evolving needs. It's about constant collaboration and adaptation.
|
| 241 |
+
* **We stay at the forefront of technology:** We are always learning and adapting, using the latest tools and frameworks to create the most efficient and cutting-edge solutions. We have the expertise to choose the right technology for your project, guaranteeing the best possible outcome.
|
| 242 |
+
|
| 243 |
+
**But we don't stop at just delivering a product.**
|
| 244 |
+
|
| 245 |
+
* **Transparency is key:** We believe in open and honest communication. We keep you informed every step of the way, providing regular updates on timelines, costs, and any potential challenges. We value transparency and trust in our client relationships.
|
| 246 |
+
* **We're obsessed with quality:** Our rigorous testing and quality assurance processes guarantee a bug-free and highly functional product. We want you to be confident in the quality and reliability of our work.
|
| 247 |
+
* **We're here for the long haul:** We don't just deliver a product and move on. We provide ongoing support and maintenance to ensure your solution continues to function smoothly and meets your evolving needs. We are committed to your long-term success.
|
| 248 |
+
|
| 249 |
+
**At Sifars, we are passionate about building innovative solutions that help our clients achieve their goals.** Our client-centric approach, combined with our expertise, commitment to quality, and dedication to long-term partnerships, allows us to create truly impactful and transformative solutions.
|
| 250 |
+
|
| 251 |
+
## Work-Life Balance
|
| 252 |
+
|
| 253 |
+
At Sifars, we understand the importance of maintaining a healthy work-life balance. In addition to our commitment to delivering excellence, we prioritize the well-being of our team members. To foster a positive work environment and promote team cohesion, we organize weekly strengthening bond calls, where team members come together to unwind and engage in recreational activities. These calls serve as a respite from the demands of work, allowing team members to recharge and rejuvenate, thereby enhancing overall productivity and morale.
|
| 254 |
+
|
| 255 |
+
|
| 256 |
+
## COntact Details
|
| 257 |
+
|
src/app.py
CHANGED
|
@@ -5,7 +5,7 @@ from fastapi.middleware.cors import CORSMiddleware
|
|
| 5 |
|
| 6 |
from src.utils import logger
|
| 7 |
|
| 8 |
-
from src.controllers import ws_router
|
| 9 |
|
| 10 |
|
| 11 |
@asynccontextmanager
|
|
@@ -37,4 +37,5 @@ app.add_middleware(
|
|
| 37 |
async def check_health():
|
| 38 |
return {"response": "Service is healthy!"}
|
| 39 |
|
| 40 |
-
app.include_router(ws_router)
|
|
|
|
|
|
| 5 |
|
| 6 |
from src.utils import logger
|
| 7 |
|
| 8 |
+
from src.controllers import ws_router, api_router
|
| 9 |
|
| 10 |
|
| 11 |
@asynccontextmanager
|
|
|
|
| 37 |
async def check_health():
|
| 38 |
return {"response": "Service is healthy!"}
|
| 39 |
|
| 40 |
+
app.include_router(ws_router)
|
| 41 |
+
app.include_router(api_router, prefix="/api/v1")
|
src/controllers/__init__.py
CHANGED
|
@@ -1,9 +1,12 @@
|
|
| 1 |
from ._chat_controller import ChatController
|
|
|
|
| 2 |
|
| 3 |
ws_router = ChatController().router
|
|
|
|
| 4 |
|
| 5 |
__all__ = [
|
| 6 |
"ws_router",
|
|
|
|
| 7 |
]
|
| 8 |
__version__ = "0.1.0"
|
| 9 |
__author__ = "Aryan Jain"
|
|
|
|
| 1 |
from ._chat_controller import ChatController
|
| 2 |
+
from ._database_controller import DatabaseController
|
| 3 |
|
| 4 |
ws_router = ChatController().router
|
| 5 |
+
api_router = DatabaseController().router
|
| 6 |
|
| 7 |
__all__ = [
|
| 8 |
"ws_router",
|
| 9 |
+
"api_router",
|
| 10 |
]
|
| 11 |
__version__ = "0.1.0"
|
| 12 |
__author__ = "Aryan Jain"
|
src/controllers/_database_controller.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from fastapi import APIRouter, HTTPException
|
| 2 |
+
|
| 3 |
+
from src.utils import logger
|
| 4 |
+
|
| 5 |
+
from src.services import DatabaseService
|
| 6 |
+
|
| 7 |
+
class DatabaseController:
|
| 8 |
+
def __init__(self):
|
| 9 |
+
self.database_service = DatabaseService
|
| 10 |
+
self.router = APIRouter(prefix="/update_database", tags=["database"])
|
| 11 |
+
self.router.add_api_route("/", self.update_database, methods=["POST"])
|
| 12 |
+
|
| 13 |
+
async def update_database(self, url: str = "https://sifars.com/"):
|
| 14 |
+
try:
|
| 15 |
+
async with self.database_service() as database_service:
|
| 16 |
+
await database_service._update_database(url)
|
| 17 |
+
except Exception as e:
|
| 18 |
+
logger.error(e)
|
| 19 |
+
raise HTTPException(status_code=500, detail=str(e))
|
src/crawler/__init__.py
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from ._web_crawler import WebCrawler
|
| 2 |
+
from ._database_updater import DatabaseUpdater
|
| 3 |
+
|
| 4 |
+
__all__ = [
|
| 5 |
+
"WebCrawler"
|
| 6 |
+
"DatabaseUpdater"
|
| 7 |
+
]
|
| 8 |
+
__version__ = "0.1.0"
|
| 9 |
+
__author__ = "Aryan Jain"
|
src/crawler/_database_updater.py
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import aiofiles
|
| 2 |
+
from src.utils import PineconeClient
|
| 3 |
+
from src.crawler import WebCrawler
|
| 4 |
+
import tiktoken
|
| 5 |
+
|
| 6 |
+
class DatabaseUpdater:
|
| 7 |
+
def __init__(self):
|
| 8 |
+
self.model_name = 'gpt-3.5-turbo'
|
| 9 |
+
self.pinecone_client = PineconeClient
|
| 10 |
+
self.web_crawler = WebCrawler
|
| 11 |
+
|
| 12 |
+
async def __aenter__(self):
|
| 13 |
+
self.tokenizer = tiktoken.encoding_for_model(self.model_name)
|
| 14 |
+
return self
|
| 15 |
+
|
| 16 |
+
async def __aexit__(self, exc_type, exc_val, exc_tb):
|
| 17 |
+
pass
|
| 18 |
+
|
| 19 |
+
async def _split_text_with_overlap(self, text, token_limit, overlap_size):
|
| 20 |
+
tokens = self.tokenizer.encode(text)
|
| 21 |
+
chunks = []
|
| 22 |
+
i = 0
|
| 23 |
+
while i < len(tokens):
|
| 24 |
+
chunk = tokens[i:i + token_limit]
|
| 25 |
+
chunks.append(chunk)
|
| 26 |
+
i += token_limit - overlap_size
|
| 27 |
+
text_chunks = [self.tokenizer.decode(chunk) for chunk in chunks]
|
| 28 |
+
return text_chunks
|
| 29 |
+
|
| 30 |
+
async def _update_database(self, sentences):
|
| 31 |
+
async with self.pinecone_client() as pinecone_client:
|
| 32 |
+
for i in range(0, len(sentences), 95):
|
| 33 |
+
await pinecone_client._upsert(sentences[i:i+95])
|
| 34 |
+
return
|
| 35 |
+
|
| 36 |
+
async def _delete_old_database(self):
|
| 37 |
+
async with self.pinecone_client() as pinecone_client:
|
| 38 |
+
await pinecone_client._delete_index()
|
| 39 |
+
return
|
| 40 |
+
|
| 41 |
+
async def _extract_new_data(self, url):
|
| 42 |
+
async with self.web_crawler(url) as crawler:
|
| 43 |
+
await crawler.crawl(url)
|
| 44 |
+
return
|
| 45 |
+
|
| 46 |
+
async def _update_database_from_file(self, file_paths):
|
| 47 |
+
for file_path in file_paths:
|
| 48 |
+
async with aiofiles.open(file_path, 'r', encoding='utf-8') as f:
|
| 49 |
+
content = await f.read()
|
| 50 |
+
sentences = await self._split_text_with_overlap(content, 1024, 200)
|
| 51 |
+
await self._update_database(sentences)
|
| 52 |
+
return
|
| 53 |
+
|
| 54 |
+
async def _clear_old_scrapped_file(self):
|
| 55 |
+
async with aiofiles.open("scrapped.txt", 'w', encoding='utf-8') as f:
|
| 56 |
+
await f.write("")
|
| 57 |
+
return
|
src/crawler/_web_crawler.py
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import time
|
| 2 |
+
from selenium import webdriver
|
| 3 |
+
from selenium.webdriver.chrome.service import Service
|
| 4 |
+
from webdriver_manager.chrome import ChromeDriverManager
|
| 5 |
+
from bs4 import BeautifulSoup
|
| 6 |
+
import aiofiles
|
| 7 |
+
|
| 8 |
+
from src.utils import logger
|
| 9 |
+
from selenium.webdriver.common.by import By
|
| 10 |
+
|
| 11 |
+
from selenium.common.exceptions import StaleElementReferenceException
|
| 12 |
+
from selenium.webdriver.support.ui import WebDriverWait
|
| 13 |
+
from selenium.webdriver.support import expected_conditions as EC
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
class WebCrawler:
|
| 18 |
+
def __init__(self, base_url):
|
| 19 |
+
self.base_url = base_url
|
| 20 |
+
self.visited_links = set()
|
| 21 |
+
self.file_path = "scrapped.txt"
|
| 22 |
+
options = webdriver.ChromeOptions()
|
| 23 |
+
options.add_argument("--headless")
|
| 24 |
+
options.add_argument("--no-sandbox")
|
| 25 |
+
options.add_argument("--disable-dev-shm-usage")
|
| 26 |
+
self.driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=options)
|
| 27 |
+
|
| 28 |
+
async def __aenter__(self):
|
| 29 |
+
return self
|
| 30 |
+
|
| 31 |
+
async def __aexit__(self, exc_type, exc_val, exc_tb):
|
| 32 |
+
await self.close()
|
| 33 |
+
|
| 34 |
+
async def crawl(self, url):
|
| 35 |
+
if url in self.visited_links:
|
| 36 |
+
return
|
| 37 |
+
self.visited_links.add(url)
|
| 38 |
+
self.driver.get(url)
|
| 39 |
+
time.sleep(3)
|
| 40 |
+
structured_text = await self.extract_structured_text()
|
| 41 |
+
if "404 Not Found" in structured_text:
|
| 42 |
+
return
|
| 43 |
+
async with aiofiles.open(self.file_path, 'a+', encoding='utf-8') as f:
|
| 44 |
+
await f.write(f'Page: {url}\n')
|
| 45 |
+
await f.write(f'{structured_text}\n')
|
| 46 |
+
await f.write("-" * 200 + "\n")
|
| 47 |
+
links = await self.get_links()
|
| 48 |
+
for link in links:
|
| 49 |
+
await self.crawl(link)
|
| 50 |
+
|
| 51 |
+
async def get_links(self):
|
| 52 |
+
links = set()
|
| 53 |
+
try:
|
| 54 |
+
WebDriverWait(self.driver, 10).until(
|
| 55 |
+
EC.presence_of_element_located((By.TAG_NAME, "a"))
|
| 56 |
+
)
|
| 57 |
+
anchors = self.driver.find_elements(By.TAG_NAME, "a")
|
| 58 |
+
for anchor in anchors:
|
| 59 |
+
try:
|
| 60 |
+
href = anchor.get_attribute("href")
|
| 61 |
+
if href and await self.is_valid_url(href):
|
| 62 |
+
links.add(href)
|
| 63 |
+
except StaleElementReferenceException:
|
| 64 |
+
logger.warning("Stale element encountered while getting href. Skipping...")
|
| 65 |
+
except StaleElementReferenceException as e:
|
| 66 |
+
logger.error(f"Failed to retrieve elements due to stale reference: {str(e)}")
|
| 67 |
+
return links
|
| 68 |
+
|
| 69 |
+
async def extract_structured_text(self):
|
| 70 |
+
soup = BeautifulSoup(self.driver.page_source, 'html.parser')
|
| 71 |
+
structured_content = []
|
| 72 |
+
for element in soup.find_all(['h1', 'h2', 'h3', 'p', 'ul', 'ol']):
|
| 73 |
+
if element.name in ['h1', 'h2', 'h3']:
|
| 74 |
+
structured_content.append(f"{element.name.upper()}: {element.get_text(strip=True)}")
|
| 75 |
+
else:
|
| 76 |
+
structured_content.append(f"TEXT: {element.get_text(strip=True)}")
|
| 77 |
+
return '\n'.join(structured_content)
|
| 78 |
+
|
| 79 |
+
async def is_valid_url(self, url):
|
| 80 |
+
return url.startswith(self.base_url) and not url.startswith("#")
|
| 81 |
+
|
| 82 |
+
async def close(self):
|
| 83 |
+
self.driver.quit()
|
src/services/__init__.py
CHANGED
|
@@ -1,9 +1,11 @@
|
|
| 1 |
from ._connection_service import ConnectionService
|
| 2 |
from ._chat_service import ChatService
|
|
|
|
| 3 |
|
| 4 |
__all__ = [
|
| 5 |
"ConnectionService",
|
| 6 |
"ChatService",
|
|
|
|
| 7 |
]
|
| 8 |
__version__ = "0.1.0"
|
| 9 |
__author__ = "Aryan Jain"
|
|
|
|
| 1 |
from ._connection_service import ConnectionService
|
| 2 |
from ._chat_service import ChatService
|
| 3 |
+
from ._database_service import DatabaseService
|
| 4 |
|
| 5 |
__all__ = [
|
| 6 |
"ConnectionService",
|
| 7 |
"ChatService",
|
| 8 |
+
"DatabaseService"
|
| 9 |
]
|
| 10 |
__version__ = "0.1.0"
|
| 11 |
__author__ = "Aryan Jain"
|
src/services/_chat_service.py
CHANGED
|
@@ -25,5 +25,5 @@ class ChatService:
|
|
| 25 |
message = f"Context is: {context} and User Query is: {messages[-1]['content']}"
|
| 26 |
messages[-1]["content"] = message
|
| 27 |
async with self.chat_client() as chat_client:
|
| 28 |
-
async for response in chat_client.chat(messages[
|
| 29 |
yield response
|
|
|
|
| 25 |
message = f"Context is: {context} and User Query is: {messages[-1]['content']}"
|
| 26 |
messages[-1]["content"] = message
|
| 27 |
async with self.chat_client() as chat_client:
|
| 28 |
+
async for response in chat_client.chat(messages[-1:]):
|
| 29 |
yield response
|
src/services/_database_service.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from src.crawler import DatabaseUpdater
|
| 2 |
+
|
| 3 |
+
from src.utils import logger
|
| 4 |
+
|
| 5 |
+
class DatabaseService:
|
| 6 |
+
def __init__(self):
|
| 7 |
+
self.database_updater = DatabaseUpdater
|
| 8 |
+
self.file_paths = ["scrapped.txt", "sifars.md"]
|
| 9 |
+
|
| 10 |
+
async def __aenter__(self):
|
| 11 |
+
return self
|
| 12 |
+
|
| 13 |
+
async def __aexit__(self, exc_type, exc_val, exc_tb):
|
| 14 |
+
pass
|
| 15 |
+
|
| 16 |
+
async def _update_database(self, url: str = ""):
|
| 17 |
+
async with self.database_updater() as database_updater:
|
| 18 |
+
await database_updater._clear_old_scrapped_file()
|
| 19 |
+
await database_updater._extract_new_data(url)
|
| 20 |
+
await database_updater._delete_old_database()
|
| 21 |
+
await database_updater._update_database_from_file(file_paths=self.file_paths)
|
src/utils/_chat_client.py
CHANGED
|
@@ -4,33 +4,25 @@ from huggingface_hub import InferenceClient
|
|
| 4 |
INSTRUCTIONS="""
|
| 5 |
You are an AI assistant designed by Sifars, a web development company, who gives answers to queries regarding Sifars, to the best of your ability.
|
| 6 |
You will be provided a context along with each user query which you will use to answer the queries.
|
|
|
|
| 7 |
<RULES>
|
| 8 |
-
- Keep
|
|
|
|
| 9 |
- Use plural first person pronouns when talking about sifars.
|
| 10 |
-
-
|
| 11 |
-
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
- https://www.sifars.com/en/career/ for more about our career opportunities
|
| 18 |
-
- If user asks to reach out to us prompt them to do so by:
|
| 19 |
-
- Providing their contact details in the chat, and our experts can assist them with their query.
|
| 20 |
-
- Our email to [connect@sifars.com](mailto:connect@sifars.com)
|
| 21 |
-
- Visiting our contact page at [this link](https://www.sifars.com/en/contact/)
|
| 22 |
-
- Our address: "SCO 6, First Floor, Phulkian Enclave, Near Mini Secretariat, Patiala, Punjab 147001"
|
| 23 |
-
- Our phone number: +91 8106 455 950, +91 8008 296 463, +91 8896 720 000
|
| 24 |
-
- Answer only using the context provided. Do not make up any responses.
|
| 25 |
-
- If the provided context cannot be used at all to answer the query, send this exact message with no changes or precursors: "Thank you for reaching out! Our experts are ready to assist you with any queries you may have. Please provide your contact details, and we'll connect with you shortly. You can also reach us directly at [contact@sifars.com](mailto:contact@sifars.com) or visit our contact page at [this link](https://www.sifars.com/en/contact/). We look forward to helping you!". Do not add anything else to the message, whether before it or after.
|
| 26 |
-
- Do not, for any reason whatsoever, mention the context provided, or the contents of the context, in your response.
|
| 27 |
</RULES>
|
| 28 |
"""
|
| 29 |
|
| 30 |
class ChatClient:
|
| 31 |
def __init__(
|
| 32 |
self,
|
| 33 |
-
model: str="meta-llama/
|
| 34 |
max_tokens: int=4096,
|
| 35 |
stream: bool=True,
|
| 36 |
system_message: str=INSTRUCTIONS
|
|
|
|
| 4 |
INSTRUCTIONS="""
|
| 5 |
You are an AI assistant designed by Sifars, a web development company, who gives answers to queries regarding Sifars, to the best of your ability.
|
| 6 |
You will be provided a context along with each user query which you will use to answer the queries.
|
| 7 |
+
Match the question with the context and according to that answer the user query.
|
| 8 |
<RULES>
|
| 9 |
+
- Keep your responses as short and to the point as possible. They should be concise, engaging, and easy to read.
|
| 10 |
+
- Avoid including extra information not asked for in the user query.
|
| 11 |
- Use plural first person pronouns when talking about sifars.
|
| 12 |
+
- Try to answer the query from the context provided. Even if the context does not directly answer the question, try to relate it to the question and formulate an answer.
|
| 13 |
+
- Do not mention the context provided, or the contents of the context, for any reason in your message.
|
| 14 |
+
- If someone asks about sifars, give them only the necessary details and then ask them to visit our about page at [this link](https://www.sifars.com/en/about/).
|
| 15 |
+
- If someone asks about the services we provide, give them a bit of idea according to the interest of their query and then direct them to our services page at [this link](https://www.sifars.com/en/services/).
|
| 16 |
+
- If someone asks about our projects or portfolio, provide them details of any three projects with minimal overview of those projects, according to the interest of their query and then direct them to our portfolio page at [this link](https://www.sifars.com/en/portfolio/).
|
| 17 |
+
- If someone asks about our technology or tech stack that we use, give them a bit of idea according to the interest of their query and then direct them to our technology page at [this link](https://www.sifars.com/en/technology/).
|
| 18 |
+
- If someone asks about career opportunities, direct them to our career page at [this link](https://www.sifars.com/en/career/).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
</RULES>
|
| 20 |
"""
|
| 21 |
|
| 22 |
class ChatClient:
|
| 23 |
def __init__(
|
| 24 |
self,
|
| 25 |
+
model: str="meta-llama/Llama-3.2-11B-Vision-Instruct",
|
| 26 |
max_tokens: int=4096,
|
| 27 |
stream: bool=True,
|
| 28 |
system_message: str=INSTRUCTIONS
|
src/utils/_pinecone_client.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
import os
|
|
|
|
| 2 |
|
| 3 |
from pinecone.grpc import PineconeGRPC as Pinecone
|
| 4 |
from pinecone import ServerlessSpec
|
|
@@ -71,7 +72,7 @@ class PineconeClient:
|
|
| 71 |
index.upsert(
|
| 72 |
vectors=[
|
| 73 |
{
|
| 74 |
-
"id": str(
|
| 75 |
"values": embeddings.data[i]['values'],
|
| 76 |
"metadata": {
|
| 77 |
"text": text
|
|
@@ -88,9 +89,15 @@ class PineconeClient:
|
|
| 88 |
index = await self._fetch_index(index_name)
|
| 89 |
results = index.query(
|
| 90 |
vector=embeddings.data[0]['values'],
|
| 91 |
-
top_k=top_k
|
|
|
|
| 92 |
)
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import os
|
| 2 |
+
import uuid
|
| 3 |
|
| 4 |
from pinecone.grpc import PineconeGRPC as Pinecone
|
| 5 |
from pinecone import ServerlessSpec
|
|
|
|
| 72 |
index.upsert(
|
| 73 |
vectors=[
|
| 74 |
{
|
| 75 |
+
"id": str(uuid.uuid1()),
|
| 76 |
"values": embeddings.data[i]['values'],
|
| 77 |
"metadata": {
|
| 78 |
"text": text
|
|
|
|
| 89 |
index = await self._fetch_index(index_name)
|
| 90 |
results = index.query(
|
| 91 |
vector=embeddings.data[0]['values'],
|
| 92 |
+
top_k=top_k,
|
| 93 |
+
include_metadata=True
|
| 94 |
)
|
| 95 |
+
for metadata in results['matches']:
|
| 96 |
+
yield metadata["metadata"]["text"]
|
| 97 |
+
|
| 98 |
+
async def _delete_index(self, index_name=None):
|
| 99 |
+
if not index_name:
|
| 100 |
+
index_name = self.index_name
|
| 101 |
+
if await self._is_index_exist(index_name):
|
| 102 |
+
self.pc.delete_index(index_name)
|
| 103 |
+
return
|