scholar-labs / scholar-backend

0 stars 4 forks source link

[Task] Create a route to get the answer to a question based on given context #6

Closed apoorvsxna closed 1 month ago

apoorvsxna commented 1 month ago

Description

Route

Suggested Implementation

model = genai.GenerativeModel('gemini-1.5-flash')

context = "In physics, a state of matter is one of the distinct forms in which matter can exist. Four states of matter are observable in everyday life: solid, liquid, gas, and plasma."

question = "How many states of matter are there?"

prompt = f"The context provided is: {context}. The question is: {question}. What is the answer?"

response = model.generate_content(prompt)

print(response)


- Get your API key [here](https://[aistudio.google.com/app/apikey](https://aistudio.google.com/app/apikey)).
priyendushivam commented 1 month ago

I will work on this

apoorvsxna commented 1 month ago

@PShivam02 Assigned.