app.py
Browse files
app.py
CHANGED
@@ -111,25 +111,14 @@ with tab2:
|
|
111 |
st.text_area("Meeting Transcript", combined_text, height=300)
|
112 |
|
113 |
if st.button("Generate Meeting Minutes"):
|
114 |
-
response = client.
|
115 |
-
|
116 |
-
|
117 |
-
|
|
|
|
|
118 |
)
|
119 |
-
|
120 |
-
run = client.beta.threads.runs.create(
|
121 |
-
thread_id=ASSISTANT_ID,
|
122 |
-
assistant_id=ASSISTANT_ID
|
123 |
-
)
|
124 |
-
|
125 |
-
while True:
|
126 |
-
run_status = client.beta.threads.runs.retrieve(thread_id=ASSISTANT_ID, run_id=run.id)
|
127 |
-
if run_status.status == "completed":
|
128 |
-
break
|
129 |
-
time.sleep(1)
|
130 |
-
|
131 |
-
messages = client.beta.threads.messages.list(thread_id=ASSISTANT_ID)
|
132 |
-
minutes = messages.data[0].content[0].text.value
|
133 |
st.write("### Meeting Minutes:")
|
134 |
st.text_area("Generated Minutes", minutes, height=300)
|
135 |
|
@@ -147,24 +136,26 @@ with tab2:
|
|
147 |
|
148 |
if st.button("Contract Analysis"):
|
149 |
analysis_prompt = "Analyse this data and provide any insights, risks and relevant data based on the contract that we need to be aware of.\n" + minutes
|
150 |
-
|
151 |
-
|
|
|
|
|
152 |
role="user",
|
153 |
content=analysis_prompt
|
154 |
)
|
155 |
|
156 |
run = client.beta.threads.runs.create(
|
157 |
-
thread_id=
|
158 |
assistant_id=ASSISTANT_ID
|
159 |
)
|
160 |
|
161 |
while True:
|
162 |
-
run_status = client.beta.threads.runs.retrieve(thread_id=
|
163 |
if run_status.status == "completed":
|
164 |
break
|
165 |
time.sleep(1)
|
166 |
|
167 |
-
messages = client.beta.threads.messages.list(thread_id=
|
168 |
analysis_output = messages.data[0].content[0].text.value
|
169 |
|
170 |
st.write("### Contract Analysis Output:")
|
|
|
111 |
st.text_area("Meeting Transcript", combined_text, height=300)
|
112 |
|
113 |
if st.button("Generate Meeting Minutes"):
|
114 |
+
response = client.chat.completions.create(
|
115 |
+
model="gpt-4-turbo",
|
116 |
+
messages=[
|
117 |
+
{"role": "system", "content": "You are an AI assistant that generates professional meeting minutes."},
|
118 |
+
{"role": "user", "content": f"Summarize the following into structured meeting minutes:\n{combined_text}"}
|
119 |
+
]
|
120 |
)
|
121 |
+
minutes = response.choices[0].message.content
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
st.write("### Meeting Minutes:")
|
123 |
st.text_area("Generated Minutes", minutes, height=300)
|
124 |
|
|
|
136 |
|
137 |
if st.button("Contract Analysis"):
|
138 |
analysis_prompt = "Analyse this data and provide any insights, risks and relevant data based on the contract that we need to be aware of.\n" + minutes
|
139 |
+
thread = client.beta.threads.create()
|
140 |
+
thread_id = thread.id
|
141 |
+
client.beta.threads.messages.create(
|
142 |
+
thread_id=thread_id,
|
143 |
role="user",
|
144 |
content=analysis_prompt
|
145 |
)
|
146 |
|
147 |
run = client.beta.threads.runs.create(
|
148 |
+
thread_id=thread_id,
|
149 |
assistant_id=ASSISTANT_ID
|
150 |
)
|
151 |
|
152 |
while True:
|
153 |
+
run_status = client.beta.threads.runs.retrieve(thread_id=thread_id, run_id=run.id)
|
154 |
if run_status.status == "completed":
|
155 |
break
|
156 |
time.sleep(1)
|
157 |
|
158 |
+
messages = client.beta.threads.messages.list(thread_id=thread_id)
|
159 |
analysis_output = messages.data[0].content[0].text.value
|
160 |
|
161 |
st.write("### Contract Analysis Output:")
|