-
Notifications
You must be signed in to change notification settings - Fork 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
Paul assistant #1342
Open
willydouhard
wants to merge
32
commits into
main
Choose a base branch
from
paul-assistant
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Paul assistant #1342
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
81d21d1
feat: v0 of chat assistants feature
ModEnter dcfe390
fix: brought back markdown description, enlarged the new assistant po…
ModEnter 2b1d0ac
change: moved the assistant related ui elements to the sidebar, chang…
ModEnter b825360
fix: list_assistants returns a baseassistant
ModEnter 4c8b119
fix: list_assistants returns a baseassistant
ModEnter 1d749f6
feat: assistant avatars work, folder /publid/avatars
ModEnter c041027
feat: added id and created_by atttributes
ModEnter 179fd65
feat: added warning banner on missing assistant field
ModEnter 3876a26
feat: edit assistants
ModEnter eab3e47
feat: changed the assistant paradigm, from inheritance to extendability
ModEnter e13dde7
feat: changed the assistant paradigm, from inheritance to extendability
ModEnter 07f2839
fix: fix forgot to update project.ts in previous commit
ModEnter 2b2d453
fix: fixed icons
ModEnter 430376c
fix: fixed session clear issues, added assistant selection in session
ModEnter ef1face
temporary commit, not working, to add created_by and id
ModEnter e10bec5
feat: created_by and id working, issue with pictures on edit assistant
ModEnter 661aa4b
feat: added assitantinfoscreen (chatprofile welcome screen equivalent…
ModEnter c32d849
feat: working icons and assistants splash screens, bug cannot unset icon
ModEnter 30baa5d
feat: select first assistant by default (if any)
ModEnter 5384a6c
fix: fixed icons that could not be removed from assistant
ModEnter d075a22
fix: fixed fetchassistants call on no assistants error
ModEnter 9cff5b1
fix: removed comments
ModEnter 85e285d
merge conflict paul-ssistant main
ModEnter 108863f
fix: fix init broken after merge
ModEnter 243e87e
fix: fixed all cypress tests, added callback tests and e2e tests for …
ModEnter c5301f8
fix: fixed missing auth secret for assistant profiles e2e tests
ModEnter 76140bb
fix: fixed backend tests for assistant profiles
ModEnter 42c83ea
fix: added comment to mark assistant features as experimental
ModEnter c610991
feat: added @experimental decorator to mark feature as experimental
ModEnter 50efe4a
bump version
willydouhard 4c05051
chore: pre-release from current branch
willydouhard 0424ae1
use this branch for the prerelease
willydouhard File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from typing import List, Dict | ||
from chainlit.input_widget import InputWidget | ||
|
||
class Assistant: | ||
input_widgets: List[InputWidget] = [] | ||
settings_values: Dict = {} | ||
|
||
def __init__(self, input_widgets: List[InputWidget], settings_values: Dict): | ||
self.input_widgets = input_widgets | ||
self.settings_values = settings_values | ||
|
||
def to_dict(self): | ||
return { | ||
"input_widgets": [widget.__repr__() for widget in self.input_widgets], | ||
"settings_values": self.settings_values | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import logging | ||
from typing import List | ||
|
||
from chainlit.context import context | ||
from chainlit.input_widget import InputWidget | ||
from pydantic.dataclasses import Field, dataclass | ||
|
||
|
||
@dataclass | ||
class AssistantSettings: | ||
"""Useful to create chat settings that the user can change.""" | ||
|
||
inputs: List[InputWidget] = Field(default_factory=list, exclude=True) | ||
|
||
def __init__( | ||
self, | ||
inputs: List[InputWidget], | ||
) -> None: | ||
self.inputs = inputs | ||
|
||
def settings(self): | ||
return dict( | ||
[(input_widget.id, input_widget.initial) for input_widget in self.inputs] | ||
) | ||
|
||
async def send(self): | ||
settings = self.settings() | ||
context.emitter.set_assistant_settings(settings) | ||
|
||
inputs_content = [input_widget.to_dict() for input_widget in self.inputs] | ||
# logging.info(f"Sending assistant settings: {inputs_content}") | ||
await context.emitter.emit("assistant_settings", inputs_content) | ||
|
||
# logging.info(f"Assistant settings sent: {settings}") | ||
return settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
if we have multiple assistant file it can be in a dedicated folder/module