shreyanshknayak's picture
Created main.py
50fde1e verified
from embedchain import App
from fastapi import FastAPI
from mangum import Mangum
from pydantic import BaseModel
import os
app = FastAPI()
handler = Mangum(app)
api_key = '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'
config = {
'llm': {
'provider': 'groq',
'config': {
'model':'llama3-70b-8192',
'top_p': 0.5,
'api_key': api_key,
'stream': True
}
},
'embedder': {
'provider': 'gpt4all',
}
}
swot_bot = App.from_config(config=config)
swot_bot.add("web_page","https://www.allen.ac.in/engineering/jee-main/tips-tricks/")
swot_bot.add("https://motion.ac.in/blog/jee-main-weightage-chapter-wise/")
swot_bot.add("https://www.allen.ac.in/engineering/jee-main/preparation-strategy/")
swot_bot.add("https://byjus.com/jee/how-to-prepare-for-jee-at-home/")
swot_bot.add("https://www.askiitians.com/iit-jee/how-to-prepare-for-iit-jee-from-class-11.html")
swot_bot.add("https://byjus.com/jee/complete-study-plan-to-crack-jee-main/")
#swot_bot.add("https://mystudycart.com/iit-jee-preparation")
swot_bot.add("https://engineering.careers360.com/articles/how-prepare-for-jee-main")
swot_bot.add("https://www.allenoverseas.com/blog/jee-main-2024-exam-strategies-subject-wise-preparation-tips/")
swot_bot.add("https://www.vedantu.com/jee-main/topics")
swot_bot.add("https://www.pw.live/exams/wp-content/uploads/2024/01/syllabus-for-jee-main-2024-as-on-01-november-2023-1-3.pdf")
swot_bot.add("https://www.pw.live/exams/wp-content/uploads/2024/01/syllabus-for-jee-main-2024-as-on-01-november-2023-4-8.pdf")
swot_bot.add("https://www.pw.live/exams/jee/jee-main-chemistry-syllabus/")
swot_bot.add("https://www.pw.live/topics-chemistry-class-11")
swot_bot.add("https://www.pw.live/topics-chemistry-class-12")
@app.post("/")
async def get_analysis(str: UserPromptInput):
output = swot_bot.query(UserPromptInput)
return {"query": output}