chainlit 1.2.0__py3-none-any.whl → 1.2.0rc0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of chainlit might be problematic. Click here for more details.
- chainlit/__init__.py +10 -0
- chainlit/assistant.py +16 -0
- chainlit/assistant_settings.py +35 -0
- chainlit/callbacks.py +32 -0
- chainlit/cli/__init__.py +1 -1
- chainlit/config.py +11 -7
- chainlit/copilot/dist/index.js +253 -253
- chainlit/data/dynamodb.py +3 -3
- chainlit/data/sql_alchemy.py +2 -1
- chainlit/element.py +1 -1
- chainlit/emitter.py +7 -0
- chainlit/frontend/dist/assets/{DailyMotion-05f4fe48.js → DailyMotion-aa368b7e.js} +1 -1
- chainlit/frontend/dist/assets/{Facebook-f25411d1.js → Facebook-0335db46.js} +1 -1
- chainlit/frontend/dist/assets/{FilePlayer-40ff3414.js → FilePlayer-8d04256c.js} +1 -1
- chainlit/frontend/dist/assets/{Kaltura-6cbf3897.js → Kaltura-67c9dd31.js} +1 -1
- chainlit/frontend/dist/assets/{Mixcloud-34e7c912.js → Mixcloud-6bbaccf5.js} +1 -1
- chainlit/frontend/dist/assets/{Mux-8aaff6ac.js → Mux-c2bcb757.js} +1 -1
- chainlit/frontend/dist/assets/{Preview-2d3bf558.js → Preview-210f3955.js} +1 -1
- chainlit/frontend/dist/assets/{SoundCloud-b835f90f.js → SoundCloud-a0276b84.js} +1 -1
- chainlit/frontend/dist/assets/{Streamable-1293e4f3.js → Streamable-a007323d.js} +1 -1
- chainlit/frontend/dist/assets/{Twitch-c69660cd.js → Twitch-e6a88aa3.js} +1 -1
- chainlit/frontend/dist/assets/{Vidyard-43bda599.js → Vidyard-dfb88a35.js} +1 -1
- chainlit/frontend/dist/assets/{Vimeo-54150039.js → Vimeo-3baa13d9.js} +1 -1
- chainlit/frontend/dist/assets/{Wistia-aa3c721b.js → Wistia-e52f7bef.js} +1 -1
- chainlit/frontend/dist/assets/{YouTube-dd0f3cc2.js → YouTube-1715f22b.js} +1 -1
- chainlit/frontend/dist/assets/index-bfdd8585.js +729 -0
- chainlit/frontend/dist/assets/{react-plotly-f52a41eb.js → react-plotly-55648373.js} +1 -1
- chainlit/frontend/dist/index.html +1 -1
- chainlit/input_widget.py +22 -0
- chainlit/server.py +23 -1
- chainlit/session.py +23 -3
- chainlit/socket.py +50 -1
- chainlit/translations/en-US.json +6 -0
- chainlit/translations/fr-FR.json +236 -0
- chainlit/types.py +1 -1
- chainlit/user_session.py +4 -0
- {chainlit-1.2.0.dist-info → chainlit-1.2.0rc0.dist-info}/METADATA +8 -8
- {chainlit-1.2.0.dist-info → chainlit-1.2.0rc0.dist-info}/RECORD +40 -37
- chainlit/frontend/dist/assets/index-cf48bedd.js +0 -729
- {chainlit-1.2.0.dist-info → chainlit-1.2.0rc0.dist-info}/WHEEL +0 -0
- {chainlit-1.2.0.dist-info → chainlit-1.2.0rc0.dist-info}/entry_points.txt +0 -0
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
<script>
|
|
22
22
|
const global = globalThis;
|
|
23
23
|
</script>
|
|
24
|
-
<script type="module" crossorigin src="/assets/index-
|
|
24
|
+
<script type="module" crossorigin src="/assets/index-bfdd8585.js"></script>
|
|
25
25
|
<link rel="stylesheet" href="/assets/index-aaf974a9.css">
|
|
26
26
|
</head>
|
|
27
27
|
<body>
|
chainlit/input_widget.py
CHANGED
|
@@ -161,6 +161,28 @@ class NumberInput(InputWidget):
|
|
|
161
161
|
"description": self.description,
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
+
@dataclass
|
|
165
|
+
class FileUploadInput(InputWidget):
|
|
166
|
+
"""Useful to create a file upload input."""
|
|
167
|
+
|
|
168
|
+
type: InputWidgetType = "fileupload"
|
|
169
|
+
initial: Optional[str] = None
|
|
170
|
+
placeholder: Optional[str] = None
|
|
171
|
+
accept: List[str] = Field(default_factory=lambda: [])
|
|
172
|
+
max_size_mb: Optional[int] = None
|
|
173
|
+
max_files: Optional[int] = None
|
|
174
|
+
|
|
175
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
176
|
+
return {
|
|
177
|
+
"type": self.type,
|
|
178
|
+
"id": self.id,
|
|
179
|
+
"label": self.label,
|
|
180
|
+
"initial": self.initial,
|
|
181
|
+
"placeholder": self.placeholder,
|
|
182
|
+
"tooltip": self.tooltip,
|
|
183
|
+
"description": self.description,
|
|
184
|
+
}
|
|
185
|
+
|
|
164
186
|
|
|
165
187
|
@dataclass
|
|
166
188
|
class Tags(InputWidget):
|
chainlit/server.py
CHANGED
|
@@ -228,7 +228,6 @@ app.mount(
|
|
|
228
228
|
name="copilot",
|
|
229
229
|
)
|
|
230
230
|
|
|
231
|
-
|
|
232
231
|
# -------------------------------------------------------------------------------
|
|
233
232
|
# SLACK HANDLER
|
|
234
233
|
# -------------------------------------------------------------------------------
|
|
@@ -985,6 +984,29 @@ async def get_avatar(avatar_id: str):
|
|
|
985
984
|
return await get_favicon()
|
|
986
985
|
|
|
987
986
|
|
|
987
|
+
# post avatar/{avatar_id} (only for authenticated users)
|
|
988
|
+
@router.post("/avatars/{avatar_id}")
|
|
989
|
+
async def upload_avatar(
|
|
990
|
+
avatar_id: str,
|
|
991
|
+
file: UploadFile,
|
|
992
|
+
current_user: Annotated[
|
|
993
|
+
Union[None, User, PersistedUser], Depends(get_current_user)
|
|
994
|
+
],
|
|
995
|
+
):
|
|
996
|
+
try:
|
|
997
|
+
avatar_path = os.path.join(APP_ROOT, "public", "avatars", avatar_id)
|
|
998
|
+
|
|
999
|
+
# Ensure the avatars directory exists
|
|
1000
|
+
os.makedirs(os.path.dirname(avatar_path), exist_ok=True)
|
|
1001
|
+
|
|
1002
|
+
with open(avatar_path, "wb") as f:
|
|
1003
|
+
f.write(await file.read())
|
|
1004
|
+
except Exception as e:
|
|
1005
|
+
raise HTTPException(status_code=500, detail=str(e))
|
|
1006
|
+
|
|
1007
|
+
return {"id": avatar_id}
|
|
1008
|
+
|
|
1009
|
+
|
|
988
1010
|
@router.head("/")
|
|
989
1011
|
def status_check():
|
|
990
1012
|
"""Check if the site is operational."""
|
chainlit/session.py
CHANGED
|
@@ -16,6 +16,7 @@ from typing import (
|
|
|
16
16
|
)
|
|
17
17
|
|
|
18
18
|
import aiofiles
|
|
19
|
+
from chainlit.assistant import Assistant
|
|
19
20
|
from chainlit.logger import logger
|
|
20
21
|
|
|
21
22
|
if TYPE_CHECKING:
|
|
@@ -64,7 +65,7 @@ class BaseSession:
|
|
|
64
65
|
client_type: ClientType,
|
|
65
66
|
# Thread id
|
|
66
67
|
thread_id: Optional[str],
|
|
67
|
-
# Logged-in user
|
|
68
|
+
# Logged-in user information
|
|
68
69
|
user: Optional[Union["User", "PersistedUser"]],
|
|
69
70
|
# Logged-in user token
|
|
70
71
|
token: Optional[str],
|
|
@@ -72,8 +73,12 @@ class BaseSession:
|
|
|
72
73
|
user_env: Optional[Dict[str, str]],
|
|
73
74
|
# Chat profile selected before the session was created
|
|
74
75
|
chat_profile: Optional[str] = None,
|
|
76
|
+
# Selected assistant
|
|
77
|
+
selected_assistant: Optional[Assistant] = None,
|
|
75
78
|
# Origin of the request
|
|
76
79
|
http_referer: Optional[str] = None,
|
|
80
|
+
# assistant settings
|
|
81
|
+
assistant_settings: Optional[Dict[str, Any]] = None,
|
|
77
82
|
):
|
|
78
83
|
if thread_id:
|
|
79
84
|
self.thread_id_to_resume = thread_id
|
|
@@ -90,7 +95,9 @@ class BaseSession:
|
|
|
90
95
|
|
|
91
96
|
self.id = id
|
|
92
97
|
|
|
98
|
+
self.assistant_settings = assistant_settings
|
|
93
99
|
self.chat_settings: Dict[str, Any] = {}
|
|
100
|
+
self.selected_assistant = selected_assistant
|
|
94
101
|
|
|
95
102
|
@property
|
|
96
103
|
def files_dir(self):
|
|
@@ -153,6 +160,7 @@ class BaseSession:
|
|
|
153
160
|
user_session = user_sessions.get(self.id) or {} # type: Dict
|
|
154
161
|
user_session["chat_settings"] = self.chat_settings
|
|
155
162
|
user_session["chat_profile"] = self.chat_profile
|
|
163
|
+
user_session["selected_assistant"] = self.selected_assistant
|
|
156
164
|
user_session["http_referer"] = self.http_referer
|
|
157
165
|
user_session["client_type"] = self.client_type
|
|
158
166
|
metadata = clean_metadata(user_session)
|
|
@@ -169,13 +177,17 @@ class HTTPSession(BaseSession):
|
|
|
169
177
|
client_type: ClientType,
|
|
170
178
|
# Thread id
|
|
171
179
|
thread_id: Optional[str] = None,
|
|
172
|
-
# Logged-in user
|
|
180
|
+
# Logged-in user information
|
|
173
181
|
user: Optional[Union["User", "PersistedUser"]] = None,
|
|
174
182
|
# Logged-in user token
|
|
175
183
|
token: Optional[str] = None,
|
|
176
184
|
user_env: Optional[Dict[str, str]] = None,
|
|
177
185
|
# Origin of the request
|
|
178
186
|
http_referer: Optional[str] = None,
|
|
187
|
+
# assistant settings
|
|
188
|
+
assistant_settings: Optional[Dict[str, Any]] = None,
|
|
189
|
+
# selected assistant
|
|
190
|
+
selected_assistant: Optional[Assistant] = None,
|
|
179
191
|
):
|
|
180
192
|
super().__init__(
|
|
181
193
|
id=id,
|
|
@@ -185,6 +197,8 @@ class HTTPSession(BaseSession):
|
|
|
185
197
|
client_type=client_type,
|
|
186
198
|
user_env=user_env,
|
|
187
199
|
http_referer=http_referer,
|
|
200
|
+
assistant_settings=assistant_settings,
|
|
201
|
+
selected_assistant=selected_assistant,
|
|
188
202
|
)
|
|
189
203
|
|
|
190
204
|
def delete(self):
|
|
@@ -225,16 +239,20 @@ class WebsocketSession(BaseSession):
|
|
|
225
239
|
client_type: ClientType,
|
|
226
240
|
# Thread id
|
|
227
241
|
thread_id: Optional[str] = None,
|
|
228
|
-
# Logged-in user
|
|
242
|
+
# Logged-in user information
|
|
229
243
|
user: Optional[Union["User", "PersistedUser"]] = None,
|
|
230
244
|
# Logged-in user token
|
|
231
245
|
token: Optional[str] = None,
|
|
232
246
|
# Chat profile selected before the session was created
|
|
233
247
|
chat_profile: Optional[str] = None,
|
|
248
|
+
# Selected assistant
|
|
249
|
+
selected_assistant: Optional[Assistant] = None,
|
|
234
250
|
# Languages of the user's browser
|
|
235
251
|
languages: Optional[str] = None,
|
|
236
252
|
# Origin of the request
|
|
237
253
|
http_referer: Optional[str] = None,
|
|
254
|
+
# chat settings
|
|
255
|
+
assistant_settings: Optional[Dict[str, Any]] = None,
|
|
238
256
|
):
|
|
239
257
|
super().__init__(
|
|
240
258
|
id=id,
|
|
@@ -244,7 +262,9 @@ class WebsocketSession(BaseSession):
|
|
|
244
262
|
user_env=user_env,
|
|
245
263
|
client_type=client_type,
|
|
246
264
|
chat_profile=chat_profile,
|
|
265
|
+
selected_assistant=selected_assistant,
|
|
247
266
|
http_referer=http_referer,
|
|
267
|
+
assistant_settings=assistant_settings,
|
|
248
268
|
)
|
|
249
269
|
|
|
250
270
|
self.socket_id = socket_id
|
chainlit/socket.py
CHANGED
|
@@ -6,6 +6,7 @@ from typing import Any, Dict, Literal
|
|
|
6
6
|
from urllib.parse import unquote
|
|
7
7
|
|
|
8
8
|
from chainlit.action import Action
|
|
9
|
+
from chainlit.assistant import Assistant
|
|
9
10
|
from chainlit.auth import get_current_user, require_login
|
|
10
11
|
from chainlit.chat_context import chat_context
|
|
11
12
|
from chainlit.config import config
|
|
@@ -392,7 +393,7 @@ async def call_action(sid, action):
|
|
|
392
393
|
except Exception as e:
|
|
393
394
|
logger.exception(e)
|
|
394
395
|
await context.emitter.send_action_response(
|
|
395
|
-
id=action.id, status=False, response="An error
|
|
396
|
+
id=action.id, status=False, response="An error occurred"
|
|
396
397
|
)
|
|
397
398
|
|
|
398
399
|
|
|
@@ -406,3 +407,51 @@ async def change_settings(sid, settings: Dict[str, Any]):
|
|
|
406
407
|
|
|
407
408
|
if config.code.on_settings_update:
|
|
408
409
|
await config.code.on_settings_update(settings)
|
|
410
|
+
|
|
411
|
+
|
|
412
|
+
@sio.on("on_create_assistant")
|
|
413
|
+
async def on_create_assistant(sid, options):
|
|
414
|
+
context = init_ws_context(sid)
|
|
415
|
+
logger.info(f"Received request to create assistant {options['settings_values']}")
|
|
416
|
+
if not options["settings_values"].get("id"):
|
|
417
|
+
options["settings_values"]["id"] = str(uuid.uuid4())
|
|
418
|
+
if not options["settings_values"].get("created_by"):
|
|
419
|
+
options["settings_values"]["created_by"] = context.session.user.identifier
|
|
420
|
+
logger.info(
|
|
421
|
+
f"Added id: {options['settings_values']['id']} and created_by: {options['settings_values']['created_by']} to the assistant options"
|
|
422
|
+
)
|
|
423
|
+
if config.code.on_create_assistant:
|
|
424
|
+
new_assistant = Assistant(
|
|
425
|
+
input_widgets=options["input_widgets"],
|
|
426
|
+
settings_values=options["settings_values"],
|
|
427
|
+
)
|
|
428
|
+
await config.code.on_create_assistant(context.session.user, new_assistant)
|
|
429
|
+
return new_assistant.to_dict()
|
|
430
|
+
logger.info("Assistant creation process completed")
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
@sio.on("on_list_assistants")
|
|
434
|
+
async def on_list_assistants(sid):
|
|
435
|
+
context = init_ws_context(sid)
|
|
436
|
+
if config.code.on_list_assistants:
|
|
437
|
+
assistants = await config.code.on_list_assistants(context.session.user)
|
|
438
|
+
return [assistant.to_dict() for assistant in assistants]
|
|
439
|
+
|
|
440
|
+
|
|
441
|
+
@sio.on("select_assistant")
|
|
442
|
+
async def select_assistant(sid, selected_assistant: Dict):
|
|
443
|
+
session = WebsocketSession.require(sid)
|
|
444
|
+
|
|
445
|
+
new_assistant = Assistant(
|
|
446
|
+
input_widgets=selected_assistant.get("input_widgets", []),
|
|
447
|
+
settings_values=selected_assistant.get("settings_values", {}),
|
|
448
|
+
)
|
|
449
|
+
|
|
450
|
+
session.selected_assistant = new_assistant
|
|
451
|
+
|
|
452
|
+
user_identifier = session.user.identifier if session.user else "Anonymous user"
|
|
453
|
+
logger.info(
|
|
454
|
+
f"{user_identifier} selected assistant {new_assistant.settings_values.get('name', 'Unknown')} for session with id {session.id}"
|
|
455
|
+
)
|
|
456
|
+
|
|
457
|
+
return new_assistant.to_dict()
|
chainlit/translations/en-US.json
CHANGED
|
@@ -16,6 +16,9 @@
|
|
|
16
16
|
"newChatButton": {
|
|
17
17
|
"newChat": "New Chat"
|
|
18
18
|
},
|
|
19
|
+
"newAssistantButton": {
|
|
20
|
+
"newAssistant": "New Assistant"
|
|
21
|
+
},
|
|
19
22
|
"tasklist": {
|
|
20
23
|
"TaskList": {
|
|
21
24
|
"title": "🗒️ Task List",
|
|
@@ -109,6 +112,9 @@
|
|
|
109
112
|
}
|
|
110
113
|
},
|
|
111
114
|
"organisms": {
|
|
115
|
+
"assistantCreationModal": {
|
|
116
|
+
"title": "Create new assistant"
|
|
117
|
+
},
|
|
112
118
|
"chat": {
|
|
113
119
|
"history": {
|
|
114
120
|
"index": {
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
{
|
|
2
|
+
"components": {
|
|
3
|
+
"atoms": {
|
|
4
|
+
"buttons": {
|
|
5
|
+
"userButton": {
|
|
6
|
+
"menu": {
|
|
7
|
+
"settings": "Paramètres",
|
|
8
|
+
"settingsKey": "P",
|
|
9
|
+
"APIKeys": "Clés API",
|
|
10
|
+
"logout": "Déconnexion"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"molecules": {
|
|
16
|
+
"newChatButton": {
|
|
17
|
+
"newChat": "Nouveau Chat"
|
|
18
|
+
},
|
|
19
|
+
"newAssistantButton": {
|
|
20
|
+
"newAssistant": "Nouveau Chatbot"
|
|
21
|
+
},
|
|
22
|
+
"tasklist": {
|
|
23
|
+
"TaskList": {
|
|
24
|
+
"title": "🗒️ Liste des Tâches",
|
|
25
|
+
"loading": "Chargement...",
|
|
26
|
+
"error": "Une erreur s'est produite"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"attachments": {
|
|
30
|
+
"cancelUpload": "Annuler le téléchargement",
|
|
31
|
+
"removeAttachment": "Supprimer la pièce jointe"
|
|
32
|
+
},
|
|
33
|
+
"newChatDialog": {
|
|
34
|
+
"createNewChat": "Créer un nouveau chat ?",
|
|
35
|
+
"clearChat": "Cela effacera les messages actuels et commencera un nouveau chat.",
|
|
36
|
+
"cancel": "Annuler",
|
|
37
|
+
"confirm": "Confirmer"
|
|
38
|
+
},
|
|
39
|
+
"settingsModal": {
|
|
40
|
+
"settings": "Paramètres",
|
|
41
|
+
"expandMessages": "Développer les Messages",
|
|
42
|
+
"hideChainOfThought": "Masquer la Chaîne de Pensée",
|
|
43
|
+
"darkMode": "Mode Sombre"
|
|
44
|
+
},
|
|
45
|
+
"detailsButton": {
|
|
46
|
+
"using": "Utilisation",
|
|
47
|
+
"used": "Utilisé"
|
|
48
|
+
},
|
|
49
|
+
"auth": {
|
|
50
|
+
"authLogin": {
|
|
51
|
+
"title": "Connectez-vous pour accéder à l'application.",
|
|
52
|
+
"form": {
|
|
53
|
+
"email": "Adresse e-mail",
|
|
54
|
+
"password": "Mot de passe",
|
|
55
|
+
"noAccount": "Vous n'avez pas de compte ?",
|
|
56
|
+
"alreadyHaveAccount": "Vous avez déjà un compte ?",
|
|
57
|
+
"signup": "S'inscrire",
|
|
58
|
+
"signin": "Se connecter",
|
|
59
|
+
"or": "OU",
|
|
60
|
+
"continue": "Continuer",
|
|
61
|
+
"forgotPassword": "Mot de passe oublié ?",
|
|
62
|
+
"passwordMustContain": "Votre mot de passe doit contenir :",
|
|
63
|
+
"emailRequired": "l'email est un champ obligatoire",
|
|
64
|
+
"passwordRequired": "le mot de passe est un champ obligatoire"
|
|
65
|
+
},
|
|
66
|
+
"error": {
|
|
67
|
+
"default": "Impossible de se connecter.",
|
|
68
|
+
"signin": "Essayez de vous connecter avec un autre compte.",
|
|
69
|
+
"oauthsignin": "Essayez de vous connecter avec un autre compte.",
|
|
70
|
+
"redirect_uri_mismatch": "L'URI de redirection ne correspond pas à la configuration de l'application oauth.",
|
|
71
|
+
"oauthcallbackerror": "Essayez de vous connecter avec un autre compte.",
|
|
72
|
+
"oauthcreateaccount": "Essayez de vous connecter avec un autre compte.",
|
|
73
|
+
"emailcreateaccount": "Essayez de vous connecter avec un autre compte.",
|
|
74
|
+
"callback": "Essayez de vous connecter avec un autre compte.",
|
|
75
|
+
"oauthaccountnotlinked": "Pour confirmer votre identité, connectez-vous avec le même compte que celui utilisé à l'origine.",
|
|
76
|
+
"emailsignin": "L'e-mail n'a pas pu être envoyé.",
|
|
77
|
+
"emailverify": "Veuillez vérifier votre e-mail, un nouvel e-mail a été envoyé.",
|
|
78
|
+
"credentialssignin": "Échec de la connexion. Vérifiez que les informations fournies sont correctes.",
|
|
79
|
+
"sessionrequired": "Veuillez vous connecter pour accéder à cette page."
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"authVerifyEmail": {
|
|
83
|
+
"almostThere": "Vous y êtes presque ! Nous avons envoyé un e-mail à ",
|
|
84
|
+
"verifyEmailLink": "Veuillez cliquer sur le lien dans cet e-mail pour terminer votre inscription.",
|
|
85
|
+
"didNotReceive": "Vous ne trouvez pas l'e-mail ?",
|
|
86
|
+
"resendEmail": "Renvoyer l'e-mail",
|
|
87
|
+
"goBack": "Retour",
|
|
88
|
+
"emailSent": "E-mail envoyé avec succès.",
|
|
89
|
+
"verifyEmail": "Vérifiez votre adresse e-mail"
|
|
90
|
+
},
|
|
91
|
+
"providerButton": {
|
|
92
|
+
"continue": "Continuer avec {{provider}}",
|
|
93
|
+
"signup": "S'inscrire avec {{provider}}"
|
|
94
|
+
},
|
|
95
|
+
"authResetPassword": {
|
|
96
|
+
"newPasswordRequired": "Le nouveau mot de passe est un champ obligatoire",
|
|
97
|
+
"passwordsMustMatch": "Les mots de passe doivent correspondre",
|
|
98
|
+
"confirmPasswordRequired": "La confirmation du mot de passe est un champ obligatoire",
|
|
99
|
+
"newPassword": "Nouveau mot de passe",
|
|
100
|
+
"confirmPassword": "Confirmer le mot de passe",
|
|
101
|
+
"resetPassword": "Réinitialiser le mot de passe"
|
|
102
|
+
},
|
|
103
|
+
"authForgotPassword": {
|
|
104
|
+
"email": "Adresse e-mail",
|
|
105
|
+
"emailRequired": "l'email est un champ obligatoire",
|
|
106
|
+
"emailSent": "Veuillez vérifier l'adresse e-mail {{email}} pour les instructions de réinitialisation de votre mot de passe.",
|
|
107
|
+
"enterEmail": "Entrez votre adresse e-mail et nous vous enverrons des instructions pour réinitialiser votre mot de passe.",
|
|
108
|
+
"resendEmail": "Renvoyer l'e-mail",
|
|
109
|
+
"continue": "Continuer",
|
|
110
|
+
"goBack": "Retour"
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
"organisms": {
|
|
115
|
+
"assistantCreationModal": {
|
|
116
|
+
"title": "Créer un nouveau chatbot"
|
|
117
|
+
},
|
|
118
|
+
"chat": {
|
|
119
|
+
"history": {
|
|
120
|
+
"index": {
|
|
121
|
+
"showHistory": "Afficher l'historique",
|
|
122
|
+
"lastInputs": "Dernières Entrées",
|
|
123
|
+
"noInputs": "Si vide...",
|
|
124
|
+
"loading": "Chargement..."
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
"inputBox": {
|
|
128
|
+
"input": {
|
|
129
|
+
"placeholder": "Tapez votre message ici..."
|
|
130
|
+
},
|
|
131
|
+
"speechButton": {
|
|
132
|
+
"start": "Commencer l'enregistrement",
|
|
133
|
+
"stop": "Arrêter l'enregistrement"
|
|
134
|
+
},
|
|
135
|
+
"SubmitButton": {
|
|
136
|
+
"sendMessage": "Envoyer le message",
|
|
137
|
+
"stopTask": "Arrêter la Tâche"
|
|
138
|
+
},
|
|
139
|
+
"UploadButton": {
|
|
140
|
+
"attachFiles": "Joindre des fichiers"
|
|
141
|
+
},
|
|
142
|
+
"waterMark": {
|
|
143
|
+
"text": "Construit avec"
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
"Messages": {
|
|
147
|
+
"index": {
|
|
148
|
+
"running": "En cours",
|
|
149
|
+
"executedSuccessfully": "exécuté avec succès",
|
|
150
|
+
"failed": "échoué",
|
|
151
|
+
"feedbackUpdated": "Retour mis à jour",
|
|
152
|
+
"updating": "Mise à jour"
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
"dropScreen": {
|
|
156
|
+
"dropYourFilesHere": "Déposez vos fichiers ici"
|
|
157
|
+
},
|
|
158
|
+
"index": {
|
|
159
|
+
"failedToUpload": "Échec du téléchargement",
|
|
160
|
+
"cancelledUploadOf": "Téléchargement annulé de",
|
|
161
|
+
"couldNotReachServer": "Impossible de joindre le serveur",
|
|
162
|
+
"continuingChat": "Continuer le chat précédent"
|
|
163
|
+
},
|
|
164
|
+
"settings": {
|
|
165
|
+
"settingsPanel": "Panneau de paramètres",
|
|
166
|
+
"reset": "Réinitialiser",
|
|
167
|
+
"cancel": "Annuler",
|
|
168
|
+
"confirm": "Confirmer"
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
"threadHistory": {
|
|
172
|
+
"sidebar": {
|
|
173
|
+
"filters": {
|
|
174
|
+
"FeedbackSelect": {
|
|
175
|
+
"feedbackAll": "Retour : Tout",
|
|
176
|
+
"feedbackPositive": "Retour : Positif",
|
|
177
|
+
"feedbackNegative": "Retour : Négatif"
|
|
178
|
+
},
|
|
179
|
+
"SearchBar": {
|
|
180
|
+
"search": "Rechercher"
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
"DeleteThreadButton": {
|
|
184
|
+
"confirmMessage": "Cela supprimera le fil ainsi que ses messages et éléments.",
|
|
185
|
+
"cancel": "Annuler",
|
|
186
|
+
"confirm": "Confirmer",
|
|
187
|
+
"deletingChat": "Suppression du chat",
|
|
188
|
+
"chatDeleted": "Chat supprimé"
|
|
189
|
+
},
|
|
190
|
+
"index": {
|
|
191
|
+
"pastChats": "Chats Passés"
|
|
192
|
+
},
|
|
193
|
+
"ThreadList": {
|
|
194
|
+
"empty": "Vide...",
|
|
195
|
+
"today": "Aujourd'hui",
|
|
196
|
+
"yesterday": "Hier",
|
|
197
|
+
"previous7days": "7 derniers jours",
|
|
198
|
+
"previous30days": "30 derniers jours"
|
|
199
|
+
},
|
|
200
|
+
"TriggerButton": {
|
|
201
|
+
"closeSidebar": "Fermer la barre latérale",
|
|
202
|
+
"openSidebar": "Ouvrir la barre latérale"
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
"Thread": {
|
|
206
|
+
"backToChat": "Retour au chat",
|
|
207
|
+
"chatCreatedOn": "Ce chat a été créé le"
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
"header": {
|
|
211
|
+
"chat": "Chat",
|
|
212
|
+
"readme": "Lisez-moi"
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
"hooks": {
|
|
217
|
+
"useLLMProviders": {
|
|
218
|
+
"failedToFetchProviders": "Échec de la récupération des fournisseurs :"
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
"pages": {
|
|
222
|
+
"Design": {},
|
|
223
|
+
"Env": {
|
|
224
|
+
"savedSuccessfully": "Enregistré avec succès",
|
|
225
|
+
"requiredApiKeys": "Clés API Requises",
|
|
226
|
+
"requiredApiKeysInfo": "Pour utiliser cette application, les clés API suivantes sont requises. Les clés sont stockées dans le stockage local de votre appareil."
|
|
227
|
+
},
|
|
228
|
+
"Page": {
|
|
229
|
+
"notPartOfProject": "Vous ne faites pas partie de ce projet."
|
|
230
|
+
},
|
|
231
|
+
"ResumeButton": {
|
|
232
|
+
"resumeChat": "Reprendre le Chat"
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
chainlit/types.py
CHANGED
|
@@ -23,7 +23,7 @@ from pydantic import BaseModel
|
|
|
23
23
|
from pydantic.dataclasses import dataclass
|
|
24
24
|
|
|
25
25
|
InputWidgetType = Literal[
|
|
26
|
-
"switch", "slider", "select", "textinput", "tags", "numberinput"
|
|
26
|
+
"switch", "slider", "select", "textinput", "tags", "numberinput", "fileupload"
|
|
27
27
|
]
|
|
28
28
|
|
|
29
29
|
|
chainlit/user_session.py
CHANGED
|
@@ -30,6 +30,10 @@ class UserSession:
|
|
|
30
30
|
user_session["http_referer"] = context.session.http_referer
|
|
31
31
|
user_session["client_type"] = context.session.client_type
|
|
32
32
|
|
|
33
|
+
# store assistant selected by the user
|
|
34
|
+
user_session["selected_assistant"] = context.session.selected_assistant
|
|
35
|
+
user_session["assistant_settings"] = context.session.assistant_settings
|
|
36
|
+
|
|
33
37
|
if isinstance(context.session, WebsocketSession):
|
|
34
38
|
user_session["languages"] = context.session.languages
|
|
35
39
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: chainlit
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.0rc0
|
|
4
4
|
Summary: Build Conversational AI.
|
|
5
5
|
Home-page: https://github.com/Chainlit/chainlit
|
|
6
6
|
License: Apache-2.0 license
|
|
@@ -64,16 +64,16 @@ Full documentation is available [here](https://docs.chainlit.io). You can ask Ch
|
|
|
64
64
|
> Check out [Literal AI](https://literalai.com), our product to monitor and evaluate LLM applications! It works with any Python or TypeScript applications and [seamlessly](https://docs.chainlit.io/data-persistence/overview) with Chainlit by adding a `LITERAL_API_KEY` in your project.
|
|
65
65
|
|
|
66
66
|
<p align="center">
|
|
67
|
-
<img src="https://github.com/Chainlit/chainlit/assets/13104895/0c2cc7a9-766c-41d3-aae2-117a2d0eb8ed" width="80%"
|
|
67
|
+
<img src="https://github.com/Chainlit/chainlit/assets/13104895/0c2cc7a9-766c-41d3-aae2-117a2d0eb8ed" alt="Chainlit user interface" width="80%"></img>
|
|
68
68
|
</p>
|
|
69
69
|
|
|
70
70
|
## Installation
|
|
71
71
|
|
|
72
72
|
Open a terminal and run:
|
|
73
73
|
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
```sh
|
|
75
|
+
pip install chainlit
|
|
76
|
+
chainlit hello
|
|
77
77
|
```
|
|
78
78
|
|
|
79
79
|
If this opens the `hello app` in your browser, you're all set!
|
|
@@ -118,8 +118,8 @@ async def main(message: cl.Message):
|
|
|
118
118
|
|
|
119
119
|
Now run it!
|
|
120
120
|
|
|
121
|
-
```
|
|
122
|
-
|
|
121
|
+
```sh
|
|
122
|
+
chainlit run demo.py -w
|
|
123
123
|
```
|
|
124
124
|
|
|
125
125
|
<img src="/images/quick-start.png" alt="Quick Start"></img>
|
|
@@ -129,7 +129,7 @@ $ chainlit run demo.py -w
|
|
|
129
129
|
Full documentation is available [here](https://docs.chainlit.io). Key features:
|
|
130
130
|
|
|
131
131
|
- [💬 Multi Modal chats](https://docs.chainlit.io/advanced-features/multi-modal)
|
|
132
|
-
- [💭 Chain of Thought
|
|
132
|
+
- [💭 Chain of Thought visualization](https://docs.chainlit.io/concepts/step)
|
|
133
133
|
- [💾 Data persistence + human feedback](https://docs.chainlit.io/data-persistence/overview)
|
|
134
134
|
- [🐛 Debug Mode](https://docs.chainlit.io/data-persistence/enterprise#debug-mode)
|
|
135
135
|
- [👤 Authentication](https://docs.chainlit.io/authentication/overview)
|