-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feature] Embed assistants #1489
base: main
Are you sure you want to change the base?
Conversation
3194ba5
to
54f1570
Compare
|
||
document.addEventListener('DOMContentLoaded', function() { | ||
const button = document.createElement('button'); | ||
button.className = 'fixed bottom-5 right-5 z-50 px-1.5 py-1 bg-blue-500 text-white rounded cursor-pointer hover:bg-blue-600 transition-colors flex items-center focus:outline-none'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how is it going to work with tailwindcss?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will convert it back to regular css once we agree on the design
ed116a5
to
8749982
Compare
b19cc4b
to
fb52674
Compare
<!-- TODO: remove --> | ||
{#if !$page.data.embeddedAssistantId} | ||
<script | ||
src="http://localhost:5173/chat/api/assistant/{$page.data.assistants.at(-1) | ||
._id}/embed-snippet" | ||
defer | ||
></script> | ||
{/if} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to make testing the embedded assistants easier, I'm embedding hf assistant inside the chat-ui. These lines would be removed before merging to main
.
you can change {$page.data.assistants.at(-1)._id}
this part that grabs the last assistant id to any specific local assistant id if you want
Description
Users can now create tools and connect their tools to their assistants (read here), making for use cases such as: create an assistant that queries your websites and chats about your website.
This PR adds an ability where users can embed their assistants on their websites.
Step1: under assistants settings, there will be
script
tag that can be put on a website's html head section.Step2:
HF Chat
button will appear on the bottom right section of your website.Step3: When you click on
HF Chat
button, a chat window modal with minimal hf/hf-chat chrome will appearTesting locally
Reviewing
when reviewing make sure to click
Hide whitespace
to see the actual diffScreen recording
Screen.Recording.2024-09-28.at.11.00.44.mov
it may look bit confusing in the video because I'm embedding hf-chat inside hf-chat locally for testing purposes. but you can imagine the hf-chat modal being embedded on any arbitrary website