Vipul Swarup commited on
Commit
dd2524f
·
1 Parent(s): 9e54b07

something

Browse files
Files changed (1) hide show
  1. app.py +8 -10
app.py CHANGED
@@ -20,17 +20,16 @@ st.header("FRQs using GPT-4")
20
 
21
  if "sessionMessages" not in st.session_state:
22
  st.session_state.sessionMessages = [
23
- SystemMessage(content = "You are a bot that generates free response questions based on the input of a Common Core Standard, and area of interest.\
24
- The Human Input will be in JSON format. The Common Core Standard will be specified with the key cc-standard. The area of interest will \
25
- be specified with the key area-of-interest.\
26
- \
27
- Give one response only for each JSON object. ")
28
  ]
29
 
30
 
31
  #Function to return the response
32
  def load_answer(question):
33
- st.session_state.sessionMessages.append(HumanMessage(content=question))
 
34
  assistant_answer = chat(st.session_state.sessionMessages)
35
  st.session_state.sessionMessages.append(AIMessage(content=assistant_answer.content))
36
  return assistant_answer.content
@@ -57,11 +56,10 @@ if submit:
57
  # iterate through the dict, and create a new dict with each response from the LLM
58
  responseDict=[]
59
  for row in questionArray:
60
- print (row)
61
  st.write(row)
62
- #response = load_answer(key, inputDict[key])
63
- #st.subheader("Answer:")
64
- #st.write(response)
65
 
66
 
67
 
 
20
 
21
  if "sessionMessages" not in st.session_state:
22
  st.session_state.sessionMessages = [
23
+ SystemMessage(content = "You are a bot that generates 'free response questions' for assesing school students based on the input of a Common Core Standard, and area of interest.\
24
+ If the common core standard involves reading a passage, then also generate a passage of exactly 300 words, and use real world examples. Provide an introduction and clear context for the questions.\
25
+ To answer the questions, the student should only need to read the presented text and should not need to refer to external sources.")
 
 
26
  ]
27
 
28
 
29
  #Function to return the response
30
  def load_answer(question):
31
+ #st.session_state.sessionMessages.append(HumanMessage(content="Common Core standard is: {question[0]}, and the area of interest is: {question[1]}"))
32
+ st.session_state.sessionMessages.append(HumanMessage(content=str(question)))
33
  assistant_answer = chat(st.session_state.sessionMessages)
34
  st.session_state.sessionMessages.append(AIMessage(content=assistant_answer.content))
35
  return assistant_answer.content
 
56
  # iterate through the dict, and create a new dict with each response from the LLM
57
  responseDict=[]
58
  for row in questionArray:
 
59
  st.write(row)
60
+ response = load_answer(row)
61
+ st.subheader("Answer:")
62
+ st.write(response)
63
 
64
 
65