Welcome to the AyurGuru Flask API π, a powerful service designed to provide intelligent, Ayurveda-focused conversational support. This API uses cutting-edge AI models via the Groq client to generate accurate and meaningful responses grounded in Ayurvedic principles. Whether you're looking to chat about Ayurveda, integrate contextual documents, or leverage general conversational capabilities, this API is tailored for all your needs. β¨
- π§ Ayurvedic Expertise: Gain insights into Ayurvedic principles, medicinal herbs, lifestyle changes, and more.
- π Context-Aware Interactions: Enhance conversations with document summaries and chat history for deeper contextual understanding.
- π¬ General AI Chat: Access general conversational capabilities with a wide range of topics.
- π Seamless Integration: Easy-to-use endpoints with flexible JSON-based input and output.
- π Secure Access: Authentication mechanisms for safe and controlled usage.
For detailed API documentation, including all available endpoints, parameters, and example responses, please visit:
Postman Documentation
- π Python: Backend language powering the API.
- π Flask: Web framework for creating robust and scalable APIs.
- βοΈ Groq Cloud: AI-powered conversational model integration.
- π€ Llama 3.1: Advanced AI model for enhanced natural language understanding.
- π dotenv: Environment variable management.
- π CORS: Cross-Origin Resource Sharing support for secure integration.
Endpoint: /generate_response
This endpoint allows users to send queries related to Ayurveda and receive AI-generated responses.
- Method:
POST
- URL:
https://ayurguru-flask-api.vercel.app/generate_response
{
"message": "Sample query about Ayurveda",
"auth_message": "AUTH_MESSAGE"
}
{
"response": "β¨ Namaste! Ayurveda suggests incorporating turmeric and ginger into your diet for their anti-inflammatory properties."
}
Endpoint: /generate_response_with_context
Enables context-aware interactions by passing document summaries and chat history for personalized and meaningful responses.
- Method:
POST
- URL:
https://ayurguru-flask-api.vercel.app/generate_response_with_context
{
"auth_message": "AUTH_MESSAGE",
"message": "Can Ayurveda help with managing diabetes?",
"document_summary": "The document discusses herbal remedies like turmeric, fenugreek, and bitter melon.",
"chat_history": [
{
"role": "user",
"content": "I have recently been diagnosed with diabetes."
},
{
"role": "assistant",
"content": "Ayurveda recommends lifestyle changes and herbal remedies for managing blood sugar levels."
}
]
}
{
"response": "Yes, Ayurveda offers a holistic approach, including dietary changes and herbs like fenugreek and bitter melon to help manage diabetes naturally."
}
- Python installed on your system.
-
Clone the repository:
git clone https://github.com/abhaydixit07/ayurguru-flask-api.git cd ayurguru-flask-api
-
Create a
.env
file in the root directory and add the following environment variables:GROQ_API_KEY=<Your Groq API Key> AUTH_MESSAGE=<Your Authentication Message>
Replace
<Your Groq API Key>
and<Your Authentication Message>
with your actual credentials. -
Install dependencies:
pip install -r requirements.txt
-
Start the server:
python api/index.py
-
Your server will now be running locally on
http://127.0.0.1:5000
. You can test the endpoints using tools like Postman or cURL.
- Healthcare Chatbot: Integrate the
/generate_response
endpoint to build a chatbot focused on Ayurvedic healthcare advice. - Research Assistant: Use
/generate_response_with_context
for analyzing documents and providing insights on Ayurvedic applications. - General AI Assistant: Leverage
/general_chat
for answering a broad range of questions.
We welcome contributions! Here's how you can get involved:
- Fork this repository.
- Create a new branch (
feature-name
orbugfix-name
). - Commit your changes.
- Submit a pull request with a detailed description.
This project is licensed under the MIT License. Feel free to use, modify, and distribute it in accordance with the license terms.
Crafted with β€οΈ to promote holistic well-being through the wisdom of Ayurveda. πΊ