Sachitksh commited on
Commit
8a11ab6
·
verified ·
1 Parent(s): 1616856

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -10
app.py CHANGED
@@ -1,19 +1,16 @@
1
  import streamlit as st
2
- #from langchain.llms import OpenAI
3
  from langchain_community.llms import OpenAI
4
 
5
-
6
  st.title("Maths Problem Solving with Adolina!")
7
 
8
  def mathematics(topic):
9
- # Enhanced prompt with additional context for better post generation
10
- prompt =(
11
- f"solve this :{topic} as a CBSE Board Mathematics Teacher, you need to provide solutions for the questions asked in the following format:"
12
-
13
- "1. Problem Statement: State the problem clearly."
14
- "2. Solution Approach: Solve as per CBSE guidelines."
15
- "3. Step-by-Step Solution: Show the method of solution."
16
- "4. Final Answer: Clearly present the final answer, with any necessary units or explanations."
17
  )
18
  llm = OpenAI(temperature=0.7, openai_api_key=st.secrets["sk-proj-q7ZheuD9p1QQ9zdOFcesT3BlbkFJ8zIk4TSUwCDpYrOIk0nV"])
19
  response = llm(prompt)
 
1
  import streamlit as st
 
2
  from langchain_community.llms import OpenAI
3
 
 
4
  st.title("Maths Problem Solving with Adolina!")
5
 
6
  def mathematics(topic):
7
+ prompt = (
8
+ f"Solve this: {topic} as a CBSE Board Mathematics Teacher. "
9
+ "You need to provide solutions for the questions asked in the following format:\n\n"
10
+ "1. Problem Statement: State the problem clearly.\n"
11
+ "2. Solution Approach: Solve as per CBSE guidelines.\n"
12
+ "3. Step-by-Step Solution: Show the method of solution.\n"
13
+ "4. Final Answer: Clearly present the final answer, with any necessary units or explanations."
 
14
  )
15
  llm = OpenAI(temperature=0.7, openai_api_key=st.secrets["sk-proj-q7ZheuD9p1QQ9zdOFcesT3BlbkFJ8zIk4TSUwCDpYrOIk0nV"])
16
  response = llm(prompt)