Skip to content
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

Assistants feature #639

Merged
merged 72 commits into from
Jan 24, 2024
Merged

Assistants feature #639

merged 72 commits into from
Jan 24, 2024

Conversation

nsarrazin
Copy link
Collaborator

@nsarrazin nsarrazin commented Dec 15, 2023

Current look

New assistant

image

Assistant (created by you)

image

Assistant (created by another user)

image

Conversation starting page

image

Ongoing conversation

(note top of page indicator and avatar in side menu)
image

Receiving a shared assistant

image

Assistant without an avatar

image

@nsarrazin nsarrazin added enhancement New feature or request front This issue is related to the front-end of the app. back This issue is related to the Svelte backend or the DB labels Dec 15, 2023
@hungryalgo
Copy link

This feature reminds me of the Agents feature that you were doing, but this seems very different without tools usage.

Why is the Agents feature dropped? Or why is this one having more precedence?
Both seem very interesting, I am guessing that this Assistants feature is more important, but not sure why.

#462

thanks!

@nsarrazin nsarrazin marked this pull request as ready for review December 20, 2023 13:49
@nsarrazin nsarrazin requested a review from gary149 December 20, 2023 14:11
@nsarrazin
Copy link
Collaborator Author

This is ready for review @gary149, it's only missing the edit an existing assistant feature but I don't think it's a blocker and the rest is done

@gary149 gary149 requested a review from mishig25 December 22, 2023 14:10
@mishig25
Copy link
Collaborator

On the create new assistant modal, there is this cutoff text Cli...

image

@mishig25
Copy link
Collaborator

mishig25 commented Dec 22, 2023

Maybe in the start messages, as soon as message gets empty, delete that empty item from the list?

image

@mishig25
Copy link
Collaborator

For the system prompts, maybe we can create and link to an example dataset of 10 system prompts for the inspiration. Something like https://huggingface.co/datasets/fka/awesome-chatgpt-prompts

image

@mishig25
Copy link
Collaborator

Once assistant is created, you can't edit the system prompt. Is it expected?

image

@nsarrazin
Copy link
Collaborator Author

Merged back #662 into this branch. There's a feature flag if we think it's not a feature we want in prod yet 😄

@gururise
Copy link
Contributor

Testing this PR and I can't seem to create a "new assistant" as the option appears to be missing:
image

I did add the following to .env.local:
ENABLE_ASSISTANTS=true

@nsarrazin
Copy link
Collaborator Author

@gururise thanks for testing! By any chance do you have any openid config ? We've configured it so that only logged-in users can create assistants if openid is configured. But it should be accessible if you have no login setup. I'll have a look as well.

@gururise
Copy link
Contributor

@gururise thanks for testing! By any chance do you have any openid config ? We've configured it so that only logged-in users can create assistants if openid is configured. But it should be accessible if you have no login setup. I'll have a look as well.

I only tested without openid. I'll try with openid.

@gururise
Copy link
Contributor

gururise commented Jan 17, 2024

image

Just tried with OpenID and it works. One issue is that the "created by user" is always null when using OpenID from google. If we don't have the user's name, could we just use their email address instead?

Are the assistants shared across all logins?

@nsarrazin
Copy link
Collaborator Author

Ok then I need to fix it so that it also works without OpenID! 😁 And good catch on the created by, will see if we can default to something else.

Assistants are public but not shared by default, (you can share them using the URL in the settings)

@nsarrazin
Copy link
Collaborator Author

Should be better @gururise 😄

@gururise
Copy link
Contributor

Should be better @gururise 😄

Works perfectly now! Thanks!

* Add rate-limited image generating endpoint

* Add generate avatar button

* add little padding for firefox focus ring

* format

* fix upload image bug

* Fix uploads, replace reset by delete

* left-align buttons

* rm avatar generation feature

* final changes to delete feature

* sys prompt min height

* padding

* Add object-cover everywhere

---------

Co-authored-by: Victor Mustar <[email protected]>
@nsarrazin nsarrazin merged commit 992a8de into main Jan 24, 2024
3 checks passed
@nsarrazin nsarrazin deleted the feature/assistants branch January 24, 2024 16:30
@SvCy
Copy link

SvCy commented Feb 2, 2024

Really glad to see that it's finally up! 🤗

ice91 pushed a commit to ice91/chat-ui that referenced this pull request Oct 30, 2024
* First push on assistants

* push fixes

* fix add assistant

* Sign up works

* lint

* mobile layout fixes

* design fixes

* Merge branch 'main' into feature/assistants

* fix copy button

* add error feedback

* hide duplicate feature

* remove wrong comments

* add autoredirect if assistant is missing

* latest changes:
- add edit feature
- hash assistant avatar
- get rid of ugly line
- check for non existent avatar
- make a better looking upload icon

* Update src/routes/conversation/+server.ts

Co-authored-by: Mishig <[email protected]>

* reused type more cleanly

* fix type in shared conversation

* fixed feature

* fix: share conv with an assistant

* delete assistant avatars in db when deleting avatar

* affordance on avatar upload

* improve assistant conv start on mobile

* settings modal fly in

* better mobile intro

* mobile padding

* link affordance

* Make assistants disabled by default, but enabled in huggingchat

* lint

* Fix bottom model name

* ui tweaks

* Initial work on chat thumbnails

* fix build

* Get rid of deps

* Update src/routes/settings/assistants/[assistantId]/avatar/+server.ts

Co-authored-by: Mishig <[email protected]>

* add comment to app_base

* Use event modifiers

* Use CSS uppercase instead everywhere

* Update src/lib/components/NavMenu.svelte

Co-authored-by: Mishig <[email protected]>

* Update src/routes/+layout.server.ts

Co-authored-by: Mishig <[email protected]>

* Clearer error message for avatar size check

* one less op on flag check

* revert back preventDefault change in LoginModal

* Update src/routes/settings/+layout.svelte

Co-authored-by: Mishig <[email protected]>

* Update src/routes/+layout.server.ts

Co-authored-by: Mishig <[email protected]>

* Update src/routes/+layout.server.ts

Co-authored-by: Mishig <[email protected]>

* Added app logo in corner of thumbnail and clamped description length

* improved thumbnails

* Remove warnings

* Reuse Assisntants settings component (huggingface#678)

* Update Assisntants settings

* format

* [Assistants] Use textToImage task for avatar generation (huggingface#662)

* Generate assistants avatar using stablediffusion

* wording

* Update +page.server.ts

Co-authored-by: Michael Fried <[email protected]>

* Add timeout & controls to avatar generation

* Add controls for avatar generation in .env

* Update src/routes/+layout.server.ts

Co-authored-by: Mishig <[email protected]>

* Update src/lib/components/AssistantSettings.svelte

Co-authored-by: Mishig <[email protected]>

* Fix avatar gen feature flag

* Can only upload avatar if generate is unchecked

---------

Co-authored-by: Michael Fried <[email protected]>
Co-authored-by: Mishig <[email protected]>

* layout

* small fixes

* hint

* Show feature if login is not required

* lint

* Only show creator name if it's defined

* tweaks

* thumbnail update

* thumbnail font-size

* Always display model at the bottom

* Bottom links now go to settings

* fix lint

* silent release

* fix bg on share link

* [Assistant] Delete avatar button instead of reset (huggingface#725)

* Add rate-limited image generating endpoint

* Add generate avatar button

* add little padding for firefox focus ring

* format

* fix upload image bug

* Fix uploads, replace reset by delete

* left-align buttons

* rm avatar generation feature

* final changes to delete feature

* sys prompt min height

* padding

* Add object-cover everywhere

---------

Co-authored-by: Victor Mustar <[email protected]>

---------

Co-authored-by: Mishig <[email protected]>
Co-authored-by: Victor Mustar <[email protected]>
Co-authored-by: Michael Fried <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
back This issue is related to the Svelte backend or the DB enhancement New feature or request front This issue is related to the front-end of the app.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants