Spaces:
Runtime error
Runtime error
File size: 1,938 Bytes
50fde1e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | 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}
|