Hammad712 commited on
Commit
e4c8a4e
·
verified ·
1 Parent(s): 5ca56e1

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +6 -2
main.py CHANGED
@@ -47,12 +47,16 @@ async def root():
47
  @app.post("/generate_quiz/")
48
  async def generate_quiz(request: QuizRequest):
49
  # fetch & store context
50
- context_docs = wikipedia_query(request.search_query)
 
 
 
 
51
  context_text = str(context_docs)
52
  STORE["context"] = context_text
53
 
54
  # generate quiz
55
- llm = get_llm()
56
  prompt = f"""
57
  You are a quiz generator assistant. Create a quiz for the given context.
58
 
 
47
  @app.post("/generate_quiz/")
48
  async def generate_quiz(request: QuizRequest):
49
  # fetch & store context
50
+
51
+ llm = get_llm()
52
+ search_query=llm.invoke(f'write one word which should be search for this question {request.search_query}')
53
+
54
+ context_docs = wikipedia_query(search_query)
55
  context_text = str(context_docs)
56
  STORE["context"] = context_text
57
 
58
  # generate quiz
59
+
60
  prompt = f"""
61
  You are a quiz generator assistant. Create a quiz for the given context.
62