Skip to content

Commit

Permalink
add gooey bot to page wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
anish-work committed Dec 9, 2024
1 parent f97597e commit d17e8c0
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions routers/root.py
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,26 @@ def page_wrapper(request: Request, className=""):
with gui.div(id="main-content", className="container-xxl " + className):
yield current_workspace

gui.html(
"""
<div id="gooey-embed"></div>
<script id="gooey-bot-embed-script" src="https://gooey.ai/chat/the-gooeyai-bot-4rv/lib.js"></script>
"""
)
gui.js(
# language=javascript
"""
async function loadGooeyEmbed() {
await window.waitUntilHydrated;
if (typeof GooeyEmbed === 'undefined') return;
GooeyEmbed.unmount();
GooeyEmbed.mount({});
}
const script = document.getElementById("gooey-bot-embed-script");
if (script) script.onload = loadGooeyEmbed;
loadGooeyEmbed();
""",
)
gui.html(templates.get_template("footer.html").render(**context))
gui.html(templates.get_template("login_scripts.html").render(**context))

Expand Down

0 comments on commit d17e8c0

Please sign in to comment.