app.py
Browse files
app.py
CHANGED
|
@@ -119,16 +119,47 @@ with tab2:
|
|
| 119 |
st.text_area("Meeting Transcript", combined_text, height=300)
|
| 120 |
|
| 121 |
if st.button("Generate Meeting Minutes"):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 122 |
response = client.chat.completions.create(
|
| 123 |
model="gpt-4-turbo",
|
| 124 |
messages=[
|
| 125 |
-
{"role": "system", "content": "You are an AI assistant that generates professional meeting minutes."},
|
| 126 |
-
{"role": "user", "content":
|
| 127 |
]
|
| 128 |
)
|
| 129 |
st.session_state["generated_minutes"] = response.choices[0].message.content
|
| 130 |
-
|
| 131 |
-
st.
|
|
|
|
| 132 |
|
| 133 |
if st.session_state["generated_minutes"]:
|
| 134 |
doc = Document()
|
|
@@ -142,9 +173,9 @@ with tab2:
|
|
| 142 |
data=docx_io,
|
| 143 |
file_name="Meeting_Minutes.docx",
|
| 144 |
mime="application/vnd.openxmlformats-officedocument.wordprocessingml.document")
|
| 145 |
-
|
| 146 |
if st.button("Contract Analysis"):
|
| 147 |
-
analysis_prompt = "
|
| 148 |
thread = client.beta.threads.create()
|
| 149 |
thread_id = thread.id
|
| 150 |
client.beta.threads.messages.create(
|
|
@@ -152,20 +183,20 @@ with tab2:
|
|
| 152 |
role="user",
|
| 153 |
content=analysis_prompt
|
| 154 |
)
|
| 155 |
-
|
| 156 |
run = client.beta.threads.runs.create(
|
| 157 |
thread_id=thread_id,
|
| 158 |
assistant_id=ASSISTANT_ID
|
| 159 |
)
|
| 160 |
-
|
| 161 |
while True:
|
| 162 |
run_status = client.beta.threads.runs.retrieve(thread_id=thread_id, run_id=run.id)
|
| 163 |
if run_status.status == "completed":
|
| 164 |
break
|
| 165 |
time.sleep(1)
|
| 166 |
-
|
| 167 |
messages = client.beta.threads.messages.list(thread_id=thread_id)
|
| 168 |
analysis_output = messages.data[0].content[0].text.value
|
| 169 |
-
|
| 170 |
st.write("### Contract Analysis Output:")
|
| 171 |
-
st.text_area("Contract Analysis", analysis_output, height=300)
|
|
|
|
| 119 |
st.text_area("Meeting Transcript", combined_text, height=300)
|
| 120 |
|
| 121 |
if st.button("Generate Meeting Minutes"):
|
| 122 |
+
prompt = f"""
|
| 123 |
+
Based on the following meeting transcript, generate structured meeting minutes in the format below:
|
| 124 |
+
|
| 125 |
+
---
|
| 126 |
+
**Meeting Name:** [Enter meeting name]
|
| 127 |
+
**Location:** [Enter location]
|
| 128 |
+
**Date:** [Enter date]
|
| 129 |
+
**Time:** [Enter time]
|
| 130 |
+
**Attendees:** [List attendees]
|
| 131 |
+
|
| 132 |
+
### Agenda Items
|
| 133 |
+
- [Agenda Item 1]
|
| 134 |
+
- [Agenda Item 2]
|
| 135 |
+
- [Agenda Item 3]
|
| 136 |
+
|
| 137 |
+
### Action Items
|
| 138 |
+
| Action Item | Owner(s) | Deadline | Status |
|
| 139 |
+
|------------|---------|----------|--------|
|
| 140 |
+
| [Action Item 1] | [Owner(s) 1] | [Deadline 1] | [Status 1] |
|
| 141 |
+
| [Action Item 2] | [Owner(s) 2] | [Deadline 2] | [Status 2] |
|
| 142 |
+
| [Action Item 3] | [Owner(s) 3] | [Deadline 3] | [Status 3] |
|
| 143 |
+
|
| 144 |
+
---
|
| 145 |
+
**Meeting Summary:**
|
| 146 |
+
[Brief summary of key points, discussions, and decisions]
|
| 147 |
+
|
| 148 |
+
**Transcript:**
|
| 149 |
+
{combined_text}
|
| 150 |
+
"""
|
| 151 |
+
|
| 152 |
response = client.chat.completions.create(
|
| 153 |
model="gpt-4-turbo",
|
| 154 |
messages=[
|
| 155 |
+
{"role": "system", "content": "You are an AI assistant that generates professional meeting minutes in a structured template."},
|
| 156 |
+
{"role": "user", "content": prompt}
|
| 157 |
]
|
| 158 |
)
|
| 159 |
st.session_state["generated_minutes"] = response.choices[0].message.content
|
| 160 |
+
|
| 161 |
+
st.write("### Generated Meeting Minutes:")
|
| 162 |
+
st.text_area("Meeting Minutes", st.session_state["generated_minutes"], height=400)
|
| 163 |
|
| 164 |
if st.session_state["generated_minutes"]:
|
| 165 |
doc = Document()
|
|
|
|
| 173 |
data=docx_io,
|
| 174 |
file_name="Meeting_Minutes.docx",
|
| 175 |
mime="application/vnd.openxmlformats-officedocument.wordprocessingml.document")
|
| 176 |
+
|
| 177 |
if st.button("Contract Analysis"):
|
| 178 |
+
analysis_prompt = "Analyze this data and provide insights, risks, and relevant data based on the contract:\n" + st.session_state["generated_minutes"]
|
| 179 |
thread = client.beta.threads.create()
|
| 180 |
thread_id = thread.id
|
| 181 |
client.beta.threads.messages.create(
|
|
|
|
| 183 |
role="user",
|
| 184 |
content=analysis_prompt
|
| 185 |
)
|
| 186 |
+
|
| 187 |
run = client.beta.threads.runs.create(
|
| 188 |
thread_id=thread_id,
|
| 189 |
assistant_id=ASSISTANT_ID
|
| 190 |
)
|
| 191 |
+
|
| 192 |
while True:
|
| 193 |
run_status = client.beta.threads.runs.retrieve(thread_id=thread_id, run_id=run.id)
|
| 194 |
if run_status.status == "completed":
|
| 195 |
break
|
| 196 |
time.sleep(1)
|
| 197 |
+
|
| 198 |
messages = client.beta.threads.messages.list(thread_id=thread_id)
|
| 199 |
analysis_output = messages.data[0].content[0].text.value
|
| 200 |
+
|
| 201 |
st.write("### Contract Analysis Output:")
|
| 202 |
+
st.text_area("Contract Analysis", analysis_output, height=300)
|