Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
@@ -481,7 +481,25 @@ def process_voice_input(text):
|
|
481 |
titles_summary=True,
|
482 |
full_audio=True
|
483 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
484 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
485 |
md_file, audio_file = save_qa_with_audio(text, result)
|
486 |
|
487 |
st.subheader("📝 Generated Files")
|
|
|
481 |
titles_summary=True,
|
482 |
full_audio=True
|
483 |
)
|
484 |
+
|
485 |
+
# Claude
|
486 |
+
user_input = text
|
487 |
+
response = client.messages.create(
|
488 |
+
model="claude-3-sonnet-20240229",
|
489 |
+
max_tokens=1000,
|
490 |
+
messages=[
|
491 |
+
{"role": "user", "content": user_input}
|
492 |
+
]
|
493 |
+
st.write("Claude's reply 🧠:")
|
494 |
+
ClaudesReply = response.content[0].text
|
495 |
|
496 |
+
st.write(ClaudesReply)
|
497 |
+
filename = generate_filename(user_input + ClaudesReply, "md")
|
498 |
+
create_file(filename, user_input, response.content[0].text)
|
499 |
+
st.session_state.chat_history.append({"user": user_input, "claude": response.content[0].text})
|
500 |
+
|
501 |
+
|
502 |
+
# long run
|
503 |
md_file, audio_file = save_qa_with_audio(text, result)
|
504 |
|
505 |
st.subheader("📝 Generated Files")
|