Spaces:
Runtime error
Runtime error
Update function.py
Browse files- function.py +6 -10
function.py
CHANGED
|
@@ -10,15 +10,12 @@ def get_answers(questions,model):
|
|
| 10 |
answer_prompt = (f"I want you to become a teacher answer this specific Question: {questions}. You should gave me a straightforward and consise explanation and answer to each one of them")
|
| 11 |
|
| 12 |
|
| 13 |
-
|
| 14 |
-
llm = OpenAI(temperature=0.8, openai_api_key=st.secrets["OPENAI_API_KEY"])
|
| 15 |
-
answers = llm(answer_prompt)
|
| 16 |
-
# return questions
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
# return questions.content
|
| 23 |
|
| 24 |
return(answers)
|
|
@@ -41,9 +38,8 @@ def GetLLMResponse(selected_topic_level, selected_topic,num_quizzes, model):
|
|
| 41 |
questions = questions.content
|
| 42 |
# return questions.content
|
| 43 |
|
| 44 |
-
answers = "testing"
|
| 45 |
|
| 46 |
-
|
| 47 |
|
| 48 |
|
| 49 |
return(questions,answers)
|
|
|
|
| 10 |
answer_prompt = (f"I want you to become a teacher answer this specific Question: {questions}. You should gave me a straightforward and consise explanation and answer to each one of them")
|
| 11 |
|
| 12 |
|
| 13 |
+
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
+
|
| 16 |
+
llm = ChatGoogleGenerativeAI(model="gemini-pro", google_api_key=st.secrets["GOOGLE_API_KEY"])
|
| 17 |
+
answers = llm.invoke(answer_prompt)
|
| 18 |
+
answers = answers.content
|
| 19 |
# return questions.content
|
| 20 |
|
| 21 |
return(answers)
|
|
|
|
| 38 |
questions = questions.content
|
| 39 |
# return questions.content
|
| 40 |
|
|
|
|
| 41 |
|
| 42 |
+
answers = get_answers(questions,model)
|
| 43 |
|
| 44 |
|
| 45 |
return(questions,answers)
|