heysho commited on
Commit
769cd5a
1 Parent(s): 2c47a07

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -29
app.py CHANGED
@@ -6,15 +6,6 @@ from langchain_openai import ChatOpenAI
6
  from langchain_anthropic import ChatAnthropic
7
  from langchain_google_genai import ChatGoogleGenerativeAI
8
 
9
- ###### dotenv を利用する場合 ######
10
- try:
11
- from dotenv import load_dotenv
12
- load_dotenv()
13
- except ImportError:
14
- import warnings
15
- warnings.warn("dotenv not found. Please make sure to set your environment variables manually.", ImportWarning)
16
- ################################################
17
-
18
 
19
  PROMPT = """
20
  You are an AI language model that helps users generate email replies. Given the context of an email conversation, you will create a well-structured, appropriate response based on the provided inputs. The response should match the specified tone and length.
@@ -77,6 +68,10 @@ def init_chain():
77
 
78
  def main():
79
  init_page()
 
 
 
 
80
  chain = init_chain()
81
  if chain:
82
  sender = st.selectbox("Sender",("Co-worker", "Boss", "Client", "Friend"),key="sender")
@@ -86,23 +81,3 @@ def main():
86
  if st.button("Generate the Reply"):
87
  result = chain.stream({"sender": sender, "subject": subject, "message": message, "reply": reply})
88
  st.write(result)
89
-
90
-
91
- if __name__ == '__main__':
92
- main()
93
-
94
- # Style adjustments (optional, remove if not needed)
95
- st.markdown(
96
- """
97
- <style>
98
- /* Custom style adjustments */
99
- .st-emotion-cache-15ecox0 { display: none !important; }
100
- @media (max-width: 50.5rem) {
101
- .st-emotion-cache-13ln4jf {
102
- max-width: calc(0rem + 100vw);
103
- }
104
- }
105
- </style>
106
- """,
107
- unsafe_allow_html=True,
108
- )
 
6
  from langchain_anthropic import ChatAnthropic
7
  from langchain_google_genai import ChatGoogleGenerativeAI
8
 
 
 
 
 
 
 
 
 
 
9
 
10
  PROMPT = """
11
  You are an AI language model that helps users generate email replies. Given the context of an email conversation, you will create a well-structured, appropriate response based on the provided inputs. The response should match the specified tone and length.
 
68
 
69
  def main():
70
  init_page()
71
+ # Style adjustments (optional, remove if not needed)
72
+ st.markdown("""<style>.st-emotion-cache-15ecox0 { display: none !important; }
73
+ @media (max-width: 50.5rem) {.st-emotion-cache-13ln4jf {max-width: calc(0rem + 100vw);}}
74
+ </style>""",unsafe_allow_html=True,)
75
  chain = init_chain()
76
  if chain:
77
  sender = st.selectbox("Sender",("Co-worker", "Boss", "Client", "Friend"),key="sender")
 
81
  if st.button("Generate the Reply"):
82
  result = chain.stream({"sender": sender, "subject": subject, "message": message, "reply": reply})
83
  st.write(result)