Update app.py
Browse files
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 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 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)
|