Skip to content

🌿 AyurGuru Flask API is an intelligent, Ayurveda-focused conversational API designed to provide insightful and meaningful responses powered by advanced AI models like Groq Cloud and Llama 3.1. It offers Ayurveda-specific guidance on topics like herbal remedies and lifestyle practices, along with context-aware interaction through document summary.

License

Notifications You must be signed in to change notification settings

abhaydixit07/ayurguru-flask-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

21 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AyurGuru Flask API 🌿

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. ✨


Features 🌟

  • 🧘 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.

API Documentation πŸ“–

For detailed API documentation, including all available endpoints, parameters, and example responses, please visit:
Postman Documentation


Tech Stack πŸ› οΈ

  • 🐍 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.

API Endpoints πŸš€

1. Chat with AyurChatbot πŸ§‘β€βš•οΈ

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

Request Body πŸ“€

{
  "message": "Sample query about Ayurveda",
  "auth_message": "AUTH_MESSAGE"
}

Response Example πŸ“₯

{
  "response": "✨ Namaste! Ayurveda suggests incorporating turmeric and ginger into your diet for their anti-inflammatory properties."
}

2. Chat with Context πŸ“

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

Request Body πŸ“€

{
  "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 Example πŸ“₯

{
  "response": "Yes, Ayurveda offers a holistic approach, including dietary changes and herbs like fenugreek and bitter melon to help manage diabetes naturally."
}

Installation and Local Deployment πŸ–₯️

Prerequisites πŸ“‹

  • Python installed on your system.

Steps to Run Locally πŸ—οΈ

  1. Clone the repository:

    git clone https://github.com/abhaydixit07/ayurguru-flask-api.git
    cd ayurguru-flask-api
  2. 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.

  3. Install dependencies:

    pip install -r requirements.txt
  4. Start the server:

    python api/index.py
  5. 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.


Example Scenarios 🎯

  1. Healthcare Chatbot: Integrate the /generate_response endpoint to build a chatbot focused on Ayurvedic healthcare advice.
  2. Research Assistant: Use /generate_response_with_context for analyzing documents and providing insights on Ayurvedic applications.
  3. General AI Assistant: Leverage /general_chat for answering a broad range of questions.

Contribution Guidelines 🀝

We welcome contributions! Here's how you can get involved:

  1. Fork this repository.
  2. Create a new branch (feature-name or bugfix-name).
  3. Commit your changes.
  4. Submit a pull request with a detailed description.

License πŸ“œ

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. 🌺

About

🌿 AyurGuru Flask API is an intelligent, Ayurveda-focused conversational API designed to provide insightful and meaningful responses powered by advanced AI models like Groq Cloud and Llama 3.1. It offers Ayurveda-specific guidance on topics like herbal remedies and lifestyle practices, along with context-aware interaction through document summary.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages