Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 8 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
FROM python:3.9-slim

FROM python:3.12.7-slim-bullseye

WORKDIR /app


COPY requirements.txt .

RUN apt-get update && apt-get install -y libmagic-dev
RUN apt-get update && apt-get install -y \
build-essential \
libmagic-dev \
gcc \
g++ \
&& rm -rf /var/lib/apt/lists/*

RUN pip install --upgrade pip

RUN pip install --no-cache-dir -r requirements.txt


COPY . .


EXPOSE 8000


ENV PORT=8000

# Command to run the application
# CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "10000"]
84 changes: 49 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,28 +192,7 @@ percentage, missing keywords, and profile summary.
- Choose between vector search or summarization for responses.
- Support for multiple Open Source LLMs models.

### 21. Tech News Agent using Crew ai

- **Route:** `/news_agent`
- **Description:** This endpoint leverages AI agents to conduct research and generate articles on various tech topics. The agents are designed to uncover groundbreaking technologies and narrate compelling tech stories.
- **Features:**
- Accepts a `topic` parameter specifying the tech topic of interest.
- Utilizes caching mechanisms for improved performance by storing and retrieving responses from Redis cache.
- Integrates with MongoDB for storing endpoint usage data.
- Returns articles and research findings related to the specified tech topic.
- Handles exceptions gracefully and returns error messages in JSON format.

### 22. Query Database

- **Route:** `/query_db`
- **Description:** This API endpoint facilitates querying SQL databases using a Cohere ReAct Agent, integrated with Langchain's SQLDBToolkit.
- **Feature:**
- Upload a `.db` file containing the database to be queried.
- Provide a natural language prompt or query to retrieve relevant information
from the database.
- Utilizes a Cohere ReAct Agent to process user queries and generate responses.

### 23. MediGem: Medical Diagnosis AI Assistant
### 21. MediGem: Medical Diagnosis AI Assistant

- **Route:** `/MediGem`
- **Description:** This API endpoint leverages the New Google Gemini AI Model to analyze medical images and identify potential health conditions.
Expand All @@ -226,7 +205,7 @@ percentage, missing keywords, and profile summary.
- **Image Quality Note:** Indicates if certain aspects are 'Unable to be determined based on the provided image.'
- **Disclaimer:** Includes the disclaimer: "Consult with a Doctor before making any decisions."

### 24. NoteGem: Automated Note-Taking Assistant
### 22. NoteGem: Automated Note-Taking Assistant

- **Route:** `/NoteGem`
- **Description:** This API endpoint leverages the Google Gemini AI Model to generate comprehensive notes from YouTube video transcripts.
Expand All @@ -236,7 +215,50 @@ percentage, missing keywords, and profile summary.
- **Error Handling for Transcripts:** If the transcript is not available, it returns a message indicating that the transcript is not available for transcription.
- **AI Summary Generation:** The AI model generates a structured summary of the transcript focusing on main points, critical information, key takeaways, examples or case studies, quotes, and actionable steps.

### 25. Investment Risk Analyst Agent
### 23. Audio Video Transcriber

- **Route:** `/transcriber`
- **Description:** This API endpoint allows users to upload audio or video files to be transcribed into text using the OpenAI Whisper model.
- **Feature:**
- **File Upload:** Users can upload audio or video files in various formats.
- **Transcription:** The API uses the OpenAI Whisper model to transcribe the uploaded file into text.

### 24. Agrilens

- **Route:** `/agrilens`
- **Description:** This API endpoint allows users to upload agricultural images and receive AI-powered insights into crops, pests, diseases, and overall health assessment.
The analysis also includes actionable recommendations for improving agricultural practices and yields.
- **Features:**
- **Image Upload:** Users can upload agricultural images in JPG, JPEG, or PNG formats.
- **Advanced Detection:** Identifies crops, pests, diseases, and farming equipment within the uploaded image.
- **Health Assessment:** Evaluates crop health, identifying stress factors or signs of disease.
- **Smart Recommendations:** Provides actionable insights for enhancing agricultural productivity, such as fertilizer, pesticide, or irrigation advice.

### AGENTS Endpoint

### 1. Tech News Agent using Crew ai

- **Route:** `/news_agent`
- **Description:** This endpoint leverages AI agents to conduct research and generate articles on various tech topics. The agents are designed to uncover groundbreaking technologies and narrate compelling tech stories.
- **Features:**
- Accepts a `topic` parameter specifying the tech topic of interest.
- Utilizes caching mechanisms for improved performance by storing and retrieving responses from Redis cache.
- Integrates with MongoDB for storing endpoint usage data.
- Returns articles and research findings related to the specified tech topic.
- Handles exceptions gracefully and returns error messages in JSON format.

### 2. Query Database

- **Route:** `/query_db`
- **Description:** This API endpoint facilitates querying SQL databases using a Cohere ReAct Agent, integrated with Langchain's SQLDBToolkit.
- **Feature:**
- Upload a `.db` file containing the database to be queried.
- Provide a natural language prompt or query to retrieve relevant information
from the database.
- Utilizes a Cohere ReAct Agent to process user queries and generate responses.


### 3. Investment Risk Analyst Agent

- **Route:** `/investment_risk_agent`
- **Description:** This API endpoint coordinates a team of AI agents to perform comprehensive investment risk analysis and strategy development.
Expand All @@ -247,7 +269,7 @@ percentage, missing keywords, and profile summary.
- **Risk Assessment:** The risk management agent evaluates potential risks associated with the trading strategy and suggests mitigation measures.
- **Execution Planning:** The execution agent develops a detailed plan for executing the trading strategy, considering the assessed risks.

### 26. Agent Doc
### 4. Agent Doc

- **Route:** `/agent_doc`
- **Description:** This API endpoint coordinates a team of AI agents to perform comprehensive healthcare diagnosis and treatment recommendations.
Expand All @@ -256,15 +278,7 @@ percentage, missing keywords, and profile summary.
- **Diagnosis:** The diagnostician agent analyzes the input data to provide a preliminary diagnosis with possible conditions.
- **Treatment Recommendations:** The treatment advisor agent formulates a suitable treatment plan based on the diagnosis and user-provided information.

### 27. Audio Video Transcriber

- **Route:** `/transcriber`
- **Description:** This API endpoint allows users to upload audio or video files to be transcribed into text using the OpenAI Whisper model.
- **Feature:**
- **File Upload:** Users can upload audio or video files in various formats.
- **Transcription:** The API uses the OpenAI Whisper model to transcribe the uploaded file into text.

### 28. Job Posting Agent
### 5. Job Posting Agent

- **Route:** `/job_posting_agent`
- **Description:** This API endpoint coordinates a team of AI agents to generate a detailed and engaging job posting tailored to the company's culture and values.
Expand All @@ -275,7 +289,7 @@ percentage, missing keywords, and profile summary.
- **Job Posting Drafting:** The job description writer agent uses the insights to create a detailed, engaging, and enticing job posting that aligns with the company's culture and values.
- **Review and Editing:** The review and editing specialist agent reviews the job posting for clarity, engagement, grammatical accuracy, and alignment with company values, refining it to ensure perfection.

### 29. ML Assistant Agent
### 6. ML Assistant Agent

- **Route:** `/ml_assistant`
- **Description:** This endpoint coordinates a team of AI agents to process an uploaded CSV file and a user-defined machine learning problem description. It aims to provide a clear problem definition, assess the data quality, recommend suitable machine learning models, and generate starter Python code for the project.
Expand Down
8 changes: 3 additions & 5 deletions agents/agent_doc/agents.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
from crewai import Agent
from .tools import scrape_tool, search_tool
from langchain_google_genai import ChatGoogleGenerativeAI
import os
import settings

llm=ChatGoogleGenerativeAI(model=settings.GEMINI_FLASH,
verbose=True,
temperature=0.7,
google_api_key=os.getenv("GOOGLE_API_KEY"))
os.environ["GEMINI_API_KEY"] = os.environ.get('GEMINI_API_KEY')

llm = "gemini/gemini-1.5-flash-8b"


diagnostician = Agent(
Expand Down
5 changes: 2 additions & 3 deletions agents/agent_doc/crew.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@

doc_crew = Crew(
agents=[diagnostician, treatment_advisor],
tasks=[diagnose_task, treatment_task],
verbose=2
tasks=[diagnose_task, treatment_task]
)

def run_doc_crew(input_data):
result = doc_crew.kickoff(inputs=input_data)
return result
return str(result)

if __name__=='__main__':
doc_agent_input ={
Expand Down
8 changes: 3 additions & 5 deletions agents/investment_risk_analyst_agent/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@
from .tools import search_tool,scrape_tool
from dotenv import load_dotenv
load_dotenv()
from langchain_google_genai import ChatGoogleGenerativeAI
import os
import settings

llm=ChatGoogleGenerativeAI(model=settings.GEMINI_FLASH,
verbose=True,
temperature=0.5,
google_api_key=os.getenv("GOOGLE_API_KEY"))
os.environ["GEMINI_API_KEY"] = os.environ.get('GEMINI_API_KEY')

llm = "gemini/gemini-1.5-flash-8b"

data_analyst_agent = Agent(
role="Data Analyst",
Expand Down
9 changes: 4 additions & 5 deletions agents/investment_risk_analyst_agent/crew.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
from .agents import data_analyst_agent,trading_strategy_agent,execution_agent,risk_management_agent
from .tasks import data_analysis_task,strategy_development_task,risk_assessment_task,execution_planning_task

llm=ChatGoogleGenerativeAI(model="gemini-1.5-flash-latest",
verbose=True,
temperature=0.7,
google_api_key=os.getenv("GOOGLE_API_KEY"))
os.environ["GEMINI_API_KEY"] = os.environ.get('GEMINI_API_KEY')

llm = "gemini/gemini-1.5-flash-8b"


financial_trading_crew = Crew(
Expand All @@ -31,7 +30,7 @@

def run_investment_crew(input_data):
result = financial_trading_crew.kickoff(inputs=input_data)
return result
return str(result)

if __name__=='__main__':
financial_trading_inputs ={
Expand Down
8 changes: 3 additions & 5 deletions agents/job_posting_agent/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
from .tools import web_search_tool, serper_search_tool
import os
import settings
from langchain_google_genai import ChatGoogleGenerativeAI

llm=ChatGoogleGenerativeAI(model=settings.GEMINI_FLASH,
verbose=True,
temperature=0.7,
google_api_key=os.getenv("GOOGLE_API_KEY"))
os.environ["GEMINI_API_KEY"] = os.environ.get('GEMINI_API_KEY')

llm = "gemini/gemini-1.5-flash-8b"


class JobAgents():
Expand Down
2 changes: 1 addition & 1 deletion agents/job_posting_agent/crew.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

def run_job_crew(input_data):
result = job_crew.kickoff(input_data)
return result
return str(result)

if __name__=='__main__':
job_agent_input = {
Expand Down
5 changes: 2 additions & 3 deletions agents/ml_assistant/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@

class MLAgents():
def __init__(self,model) -> None:
self.llm = ChatGroq(
api_key=os.environ['GROQ_API_KEY'],
model_name=model)
os.environ["GROQ_API_KEY"] = os.environ.get('GROQ_API_KEY')
self.llm = f"groq/{model}"

def problem_definition_agent(self):
return Agent(
Expand Down
4 changes: 2 additions & 2 deletions agents/ml_assistant/crew.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def run_ml_crew(file_path, user_question, model="llama3-70b-8192"):
# Format the input data for agents
input_data = {
"ml_problem": user_question,
"df": df.head(),
"df": df.head().to_json(orient="records"),
"file_name": file_path
}

Expand All @@ -40,7 +40,7 @@ def run_ml_crew(file_path, user_question, model="llama3-70b-8192"):
)

result = ml_crew.kickoff(input_data)
return result
return str(result)

if __name__=="__main__":
print(run_ml_crew(file_path="data/iris.csv",
Expand Down
9 changes: 3 additions & 6 deletions agents/tech_news_agent/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@
from .tools import tool
from dotenv import load_dotenv
load_dotenv()
from langchain_google_genai import ChatGoogleGenerativeAI
import os


## call the gemini models
llm=ChatGoogleGenerativeAI(model="gemini-1.5-flash",
verbose=True,
temperature=0.5,
google_api_key=os.getenv("GOOGLE_API_KEY"))
os.environ["GEMINI_API_KEY"] = os.environ.get('GEMINI_API_KEY')

llm = "gemini/gemini-1.5-flash-8b"

# Creating a senior researcher agent with memory and verbose mode

Expand Down
2 changes: 1 addition & 1 deletion agents/tech_news_agent/crew.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

def run_crew(topic):
result = crew.kickoff(inputs={'topic': topic})
return result
return str(result)

if __name__=='__main__':
print(run_crew(topic="AI in Constructions"))
Loading
Loading