Spaces:
Sleeping
Sleeping
Upload 3 files
Browse files- 1_app.py +22 -0
- README.md +4 -9
- copy_button.html +39 -0
1_app.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
# Title and caption
|
| 6 |
+
st.title("π¬ AI Chatbot development")
|
| 7 |
+
st.caption("π Your Personal AI Assistant helping in your activities")
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
with st.sidebar:
|
| 11 |
+
st.write("check out this [article](https://medium.com/@c.giancaterino/build-your-personal-ai-assistant-with-streamlit-and-llms-2f95c9b00e0b)")
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
st.markdown("""
|
| 15 |
+
**π Select a page from the dropdown on the left** to see some applications of the app!""")
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
st.image("./images/magicstudio-art_ai_1.jpg", width=500)
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
|
README.md
CHANGED
|
@@ -1,10 +1,5 @@
|
|
| 1 |
-
|
| 2 |
-
title: AI Chatbot
|
| 3 |
-
emoji: π
|
| 4 |
-
colorFrom: gray
|
| 5 |
-
colorTo: blue
|
| 6 |
-
sdk: docker
|
| 7 |
-
pinned: false
|
| 8 |
-
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
|
|
|
| 1 |
+
# AI_Personal_Assistant
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
+
Read the article on [medium](https://medium.com/@c.giancaterino/build-your-personal-ai-assistant-with-streamlit-and-llms-2f95c9b00e0b)
|
| 4 |
+
|
| 5 |
+
Go to the [app](https://aipersonalassistant.streamlit.app/)
|
copy_button.html
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<html>
|
| 2 |
+
<head>
|
| 3 |
+
<meta charset="UTF-8">
|
| 4 |
+
<title>Copy Text to Clipboard</title>
|
| 5 |
+
<meta http-equiv="Content-Security-Policy" content="frame-ancestors 'self' *">
|
| 6 |
+
<style>
|
| 7 |
+
#copyButton {
|
| 8 |
+
transition: opacity 1s;
|
| 9 |
+
}
|
| 10 |
+
</style>
|
| 11 |
+
</head>
|
| 12 |
+
<body>
|
| 13 |
+
<input type="text" id="textToCopy" value="" style="position: absolute; left: -9999px;">
|
| 14 |
+
<button id="copyButton" onclick="copyToClipboard()">π</button>
|
| 15 |
+
<script>
|
| 16 |
+
function getQueryParam(name) {
|
| 17 |
+
const urlSearchParams = new URLSearchParams(window.location.search);
|
| 18 |
+
return urlSearchParams.get(name);
|
| 19 |
+
}
|
| 20 |
+
const textToCopy = document.getElementById("textToCopy");
|
| 21 |
+
const copyText = getQueryParam("copy");
|
| 22 |
+
if (copyText) {
|
| 23 |
+
textToCopy.value = decodeURIComponent(copyText);
|
| 24 |
+
}
|
| 25 |
+
const copyButton = document.getElementById("copyButton");
|
| 26 |
+
copyButton.title = textToCopy.value;
|
| 27 |
+
function copyToClipboard() {
|
| 28 |
+
textToCopy.select();
|
| 29 |
+
document.execCommand("copy");
|
| 30 |
+
const clipboardContents = textToCopy.value;
|
| 31 |
+
copyButton.textContent = "β";
|
| 32 |
+
setTimeout(function () {
|
| 33 |
+
copyButton.textContent = "π";
|
| 34 |
+
copyButton.title = textToCopy.value;
|
| 35 |
+
}, 1000);
|
| 36 |
+
}
|
| 37 |
+
</script>
|
| 38 |
+
</body>
|
| 39 |
+
</html>
|