babelAI commited on
Commit
f03bf02
Β·
verified Β·
1 Parent(s): 0a13ca3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -6
app.py CHANGED
@@ -3,14 +3,17 @@ from langchain_openai import ChatOpenAI
3
  from langchain.schema import AIMessage, HumanMessage, SystemMessage
4
 
5
  # Streamlit UI μ„€μ •
6
- st.set_page_config(page_title="λŒ€ν™”ν˜• AI 봇-의료 상담", page_icon=":robot:")
7
- #st.header("μ•ˆλ…•ν•˜μ„Έμš”. μ €λŠ” 의료 상담 AI μ±—λ΄‡μœΌλ‘œ λ§μ”€ν•˜μ‹œλŠ” 것을 κΈ°μ–΅ν•©λ‹ˆλ‹€. κ³„μ†ν•΄μ„œ μ§ˆλ¬Έν•΄μ£Όμ‹œλ©΄ λ˜μš”.")
8
- st.header("hello. I am a medical consultation AI chatbot. You can continue to ask questions.(It takes time. Wait a sec")
9
 
10
  # μ„Έμ…˜ λ©”μ‹œμ§€ μ΄ˆκΈ°ν™”
11
  if "sessionMessages" not in st.session_state:
12
  st.session_state.sessionMessages = [
13
- SystemMessage(content="You are a renowned medical doctor.")
 
 
 
14
  ]
15
 
16
  # λŒ€λ‹΅ λ‘œλ“œ ν•¨μˆ˜
@@ -22,7 +25,7 @@ def load_answer(question):
22
 
23
  # μ‚¬μš©μž μž…λ ₯ λ°›κΈ°
24
  def get_text():
25
- #input_text = st.text_input("μƒλ‹΄μž: ", key="input")
26
  input_text = st.text_input("Client: ", key="input")
27
  return input_text
28
 
@@ -30,7 +33,7 @@ def get_text():
30
  chat = ChatOpenAI(temperature=0.7)
31
 
32
  user_input = get_text()
33
- #submit = st.button('μƒλ‹΄ν•˜κΈ°')
34
  submit = st.button('Counsel')
35
 
36
  if submit:
 
3
  from langchain.schema import AIMessage, HumanMessage, SystemMessage
4
 
5
  # Streamlit UI μ„€μ •
6
+ st.set_page_config(page_title="경기일보 ν—€λ“œλΌμΈ 생성 AI", page_icon=":robot:")
7
+ #st.header("μ•ˆλ…•ν•˜μ„Έμš”. κΈ°μ‚¬λ‚΄μš©μ„ μž…λ ₯ν•΄μ£Όμ„Έμš”.")
8
+ st.header("μ•ˆλ…•ν•˜μ„Έμš”. κΈ°μ‚¬λ‚΄μš©μ„ μž…λ ₯ν•˜μ‹œλ©΄ λ©‹μ§„ 기사 제λͺ©μ„ μƒμ„±ν•΄λ“œλ¦½λ‹ˆλ‹€!")
9
 
10
  # μ„Έμ…˜ λ©”μ‹œμ§€ μ΄ˆκΈ°ν™”
11
  if "sessionMessages" not in st.session_state:
12
  st.session_state.sessionMessages = [
13
+ SystemMessage(content="Imagine you are a seasoned journalist with a keen insight into societal trends, audience interests, and the pulse of current events. You have a knack for condensing complex stories into captivating titles that instantly grab attention. Your task is to create a newspaper article title that resonates with readers by sparking curiosity, offering value, or highlighting urgent issues. The title should be concise, no more than ten words, and must cleverly use language to intrigue, provoke thought, or convey the significance of the story. Consider using puns, alliterations, or unexpected juxtapositions to make the title memorable. Reflect on the core message of the article, its impact on the reader, and the broader implications for society. The title should stand as a call to action or an invitation to delve deeper into the narrative, compelling the subscriber to engage with the content immediately
14
+
15
+
16
+ Make a Korean title on the upper article.")
17
  ]
18
 
19
  # λŒ€λ‹΅ λ‘œλ“œ ν•¨μˆ˜
 
25
 
26
  # μ‚¬μš©μž μž…λ ₯ λ°›κΈ°
27
  def get_text():
28
+ #input_text = st.text_input("기자: ", key="input")
29
  input_text = st.text_input("Client: ", key="input")
30
  return input_text
31
 
 
33
  chat = ChatOpenAI(temperature=0.7)
34
 
35
  user_input = get_text()
36
+ #submit = st.button('제λͺ© μƒμ„±ν•˜κΈ°')
37
  submit = st.button('Counsel')
38
 
39
  if submit: