chainlit 1.1.306__py3-none-any.whl → 1.1.400__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 +16 -3
- chainlit/config.py +4 -4
- chainlit/context.py +9 -0
- chainlit/copilot/dist/index.js +132 -129
- chainlit/data/__init__.py +8 -12
- chainlit/data/sql_alchemy.py +0 -4
- chainlit/discord/app.py +42 -20
- chainlit/emitter.py +5 -9
- chainlit/frontend/dist/assets/{DailyMotion-4ebdfef1.js → DailyMotion-e2c926d0.js} +1 -1
- chainlit/frontend/dist/assets/{Facebook-40982be3.js → Facebook-88f80aba.js} +1 -1
- chainlit/frontend/dist/assets/{FilePlayer-5b3a4ad0.js → FilePlayer-febd1b0d.js} +1 -1
- chainlit/frontend/dist/assets/{Kaltura-6c5cb748.js → Kaltura-606fe0bd.js} +1 -1
- chainlit/frontend/dist/assets/{Mixcloud-7a304880.js → Mixcloud-b3db090a.js} +1 -1
- chainlit/frontend/dist/assets/{Mux-1bd85c69.js → Mux-ca847a7d.js} +1 -1
- chainlit/frontend/dist/assets/{Preview-e91eb05e.js → Preview-7a3747b5.js} +1 -1
- chainlit/frontend/dist/assets/{SoundCloud-2f2116b2.js → SoundCloud-0da01fb1.js} +1 -1
- chainlit/frontend/dist/assets/{Streamable-b92c07ce.js → Streamable-4a6ab048.js} +1 -1
- chainlit/frontend/dist/assets/{Twitch-58a2eb9a.js → Twitch-3e260619.js} +1 -1
- chainlit/frontend/dist/assets/{Vidyard-ad5bffa0.js → Vidyard-73692980.js} +1 -1
- chainlit/frontend/dist/assets/{Vimeo-8fb43e9c.js → Vimeo-6627c7a8.js} +1 -1
- chainlit/frontend/dist/assets/{Wistia-d03e6237.js → Wistia-27df9c66.js} +1 -1
- chainlit/frontend/dist/assets/{YouTube-6b7d1dae.js → YouTube-a11d419d.js} +1 -1
- chainlit/frontend/dist/assets/{index-4f01eb67.js → index-d66d1800.js} +104 -101
- chainlit/frontend/dist/assets/{react-plotly-ef3ac5f0.js → react-plotly-012ed517.js} +1 -1
- chainlit/frontend/dist/index.html +1 -1
- chainlit/haystack/callbacks.py +1 -3
- chainlit/langchain/callbacks.py +37 -16
- chainlit/llama_index/callbacks.py +0 -6
- chainlit/message.py +0 -16
- chainlit/mistralai/__init__.py +2 -5
- chainlit/openai/__init__.py +0 -2
- chainlit/server.py +2 -2
- chainlit/session.py +2 -12
- chainlit/slack/app.py +36 -27
- chainlit/socket.py +10 -10
- chainlit/step.py +37 -32
- chainlit/teams/app.py +23 -18
- chainlit/translations/zh-CN.json +229 -0
- chainlit/user_session.py +0 -3
- {chainlit-1.1.306.dist-info → chainlit-1.1.400.dist-info}/METADATA +1 -1
- chainlit-1.1.400.dist-info/RECORD +82 -0
- chainlit-1.1.306.dist-info/RECORD +0 -81
- {chainlit-1.1.306.dist-info → chainlit-1.1.400.dist-info}/WHEEL +0 -0
- {chainlit-1.1.306.dist-info → chainlit-1.1.400.dist-info}/entry_points.txt +0 -0
chainlit/step.py
CHANGED
|
@@ -7,7 +7,7 @@ from functools import wraps
|
|
|
7
7
|
from typing import Callable, Dict, List, Optional, TypedDict, Union
|
|
8
8
|
|
|
9
9
|
from chainlit.config import config
|
|
10
|
-
from chainlit.context import context, local_steps
|
|
10
|
+
from chainlit.context import CL_RUN_NAMES, context, local_steps
|
|
11
11
|
from chainlit.data import get_data_layer
|
|
12
12
|
from chainlit.element import Element
|
|
13
13
|
from chainlit.logger import logger
|
|
@@ -18,13 +18,35 @@ from literalai.helper import utc_now
|
|
|
18
18
|
from literalai.step import StepType, TrueStepType
|
|
19
19
|
|
|
20
20
|
|
|
21
|
+
def check_add_step_in_cot(step: "Step"):
|
|
22
|
+
is_message = step.type in [
|
|
23
|
+
"user_message",
|
|
24
|
+
"assistant_message",
|
|
25
|
+
]
|
|
26
|
+
is_cl_run = step.name in CL_RUN_NAMES and step.type == "run"
|
|
27
|
+
if config.ui.cot == "hidden" and not is_message and not is_cl_run:
|
|
28
|
+
return False
|
|
29
|
+
return True
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def stub_step(step: "Step"):
|
|
33
|
+
return {
|
|
34
|
+
"type": step.type,
|
|
35
|
+
"name": step.name,
|
|
36
|
+
"id": step.id,
|
|
37
|
+
"parentId": step.parent_id,
|
|
38
|
+
"threadId": step.thread_id,
|
|
39
|
+
"input": "",
|
|
40
|
+
"output": "",
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
|
|
21
44
|
class StepDict(TypedDict, total=False):
|
|
22
45
|
name: str
|
|
23
46
|
type: StepType
|
|
24
47
|
id: str
|
|
25
48
|
threadId: str
|
|
26
49
|
parentId: Optional[str]
|
|
27
|
-
disableFeedback: bool
|
|
28
50
|
streaming: bool
|
|
29
51
|
waitForAnswer: Optional[bool]
|
|
30
52
|
isError: Optional[bool]
|
|
@@ -48,8 +70,8 @@ def step(
|
|
|
48
70
|
name: Optional[str] = "",
|
|
49
71
|
type: TrueStepType = "undefined",
|
|
50
72
|
id: Optional[str] = None,
|
|
73
|
+
parent_id: Optional[str] = None,
|
|
51
74
|
tags: Optional[List[str]] = None,
|
|
52
|
-
disable_feedback: bool = True,
|
|
53
75
|
language: Optional[str] = None,
|
|
54
76
|
show_input: Union[bool, str] = "json",
|
|
55
77
|
):
|
|
@@ -70,7 +92,7 @@ def step(
|
|
|
70
92
|
type=type,
|
|
71
93
|
name=name,
|
|
72
94
|
id=id,
|
|
73
|
-
|
|
95
|
+
parent_id=parent_id,
|
|
74
96
|
tags=tags,
|
|
75
97
|
language=language,
|
|
76
98
|
show_input=show_input,
|
|
@@ -97,7 +119,7 @@ def step(
|
|
|
97
119
|
type=type,
|
|
98
120
|
name=name,
|
|
99
121
|
id=id,
|
|
100
|
-
|
|
122
|
+
parent_id=parent_id,
|
|
101
123
|
tags=tags,
|
|
102
124
|
language=language,
|
|
103
125
|
show_input=show_input,
|
|
@@ -130,7 +152,6 @@ class Step:
|
|
|
130
152
|
type: TrueStepType
|
|
131
153
|
id: str
|
|
132
154
|
parent_id: Optional[str]
|
|
133
|
-
disable_feedback: bool
|
|
134
155
|
|
|
135
156
|
streaming: bool
|
|
136
157
|
persisted: bool
|
|
@@ -158,7 +179,6 @@ class Step:
|
|
|
158
179
|
elements: Optional[List[Element]] = None,
|
|
159
180
|
metadata: Optional[Dict] = None,
|
|
160
181
|
tags: Optional[List[str]] = None,
|
|
161
|
-
disable_feedback: bool = True,
|
|
162
182
|
language: Optional[str] = None,
|
|
163
183
|
show_input: Union[bool, str] = "json",
|
|
164
184
|
):
|
|
@@ -170,7 +190,6 @@ class Step:
|
|
|
170
190
|
self.name = name or ""
|
|
171
191
|
self.type = type
|
|
172
192
|
self.id = id or str(uuid.uuid4())
|
|
173
|
-
self.disable_feedback = disable_feedback
|
|
174
193
|
self.metadata = metadata or {}
|
|
175
194
|
self.tags = tags
|
|
176
195
|
self.is_error = False
|
|
@@ -256,7 +275,6 @@ class Step:
|
|
|
256
275
|
"id": self.id,
|
|
257
276
|
"threadId": self.thread_id,
|
|
258
277
|
"parentId": self.parent_id,
|
|
259
|
-
"disableFeedback": self.disable_feedback,
|
|
260
278
|
"streaming": self.streaming,
|
|
261
279
|
"metadata": self.metadata,
|
|
262
280
|
"tags": self.tags,
|
|
@@ -295,13 +313,10 @@ class Step:
|
|
|
295
313
|
tasks = [el.send(for_id=self.id) for el in self.elements]
|
|
296
314
|
await asyncio.gather(*tasks)
|
|
297
315
|
|
|
298
|
-
if
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
return True
|
|
303
|
-
|
|
304
|
-
await context.emitter.update_step(step_dict)
|
|
316
|
+
if not check_add_step_in_cot(self):
|
|
317
|
+
await context.emitter.update_step(stub_step(self))
|
|
318
|
+
else:
|
|
319
|
+
await context.emitter.update_step(step_dict)
|
|
305
320
|
|
|
306
321
|
return True
|
|
307
322
|
|
|
@@ -352,13 +367,10 @@ class Step:
|
|
|
352
367
|
tasks = [el.send(for_id=self.id) for el in self.elements]
|
|
353
368
|
await asyncio.gather(*tasks)
|
|
354
369
|
|
|
355
|
-
if
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
return self
|
|
360
|
-
|
|
361
|
-
await context.emitter.send_step(step_dict)
|
|
370
|
+
if not check_add_step_in_cot(self):
|
|
371
|
+
await context.emitter.send_step(stub_step(self))
|
|
372
|
+
else:
|
|
373
|
+
await context.emitter.send_step(step_dict)
|
|
362
374
|
|
|
363
375
|
return self
|
|
364
376
|
|
|
@@ -380,10 +392,8 @@ class Step:
|
|
|
380
392
|
|
|
381
393
|
assert self.id
|
|
382
394
|
|
|
383
|
-
if
|
|
384
|
-
|
|
385
|
-
"assistant_message",
|
|
386
|
-
]:
|
|
395
|
+
if not check_add_step_in_cot(self):
|
|
396
|
+
await context.emitter.send_step(stub_step(self))
|
|
387
397
|
return
|
|
388
398
|
|
|
389
399
|
if not self.streaming:
|
|
@@ -404,7 +414,6 @@ class Step:
|
|
|
404
414
|
id=self.id,
|
|
405
415
|
parent_id=self.parent_id,
|
|
406
416
|
thread_id=self.thread_id,
|
|
407
|
-
disable_feedback=self.disable_feedback,
|
|
408
417
|
)
|
|
409
418
|
|
|
410
419
|
# Handle Context Manager Protocol
|
|
@@ -416,8 +425,6 @@ class Step:
|
|
|
416
425
|
if not self.parent_id:
|
|
417
426
|
if parent_step:
|
|
418
427
|
self.parent_id = parent_step.id
|
|
419
|
-
elif context.session.root_message:
|
|
420
|
-
self.parent_id = context.session.root_message.id
|
|
421
428
|
context.active_steps.append(self)
|
|
422
429
|
local_steps.set(previous_steps + [self])
|
|
423
430
|
await self.send()
|
|
@@ -449,8 +456,6 @@ class Step:
|
|
|
449
456
|
if not self.parent_id:
|
|
450
457
|
if parent_step:
|
|
451
458
|
self.parent_id = parent_step.id
|
|
452
|
-
elif context.session.root_message:
|
|
453
|
-
self.parent_id = context.session.root_message.id
|
|
454
459
|
context.active_steps.append(self)
|
|
455
460
|
local_steps.set(previous_steps + [self])
|
|
456
461
|
|
chainlit/teams/app.py
CHANGED
|
@@ -3,6 +3,7 @@ import base64
|
|
|
3
3
|
import mimetypes
|
|
4
4
|
import os
|
|
5
5
|
import uuid
|
|
6
|
+
from datetime import datetime
|
|
6
7
|
from typing import TYPE_CHECKING, Dict, List, Literal, Optional, Union
|
|
7
8
|
|
|
8
9
|
import filetype
|
|
@@ -28,7 +29,7 @@ from botbuilder.schema import (
|
|
|
28
29
|
HeroCard,
|
|
29
30
|
)
|
|
30
31
|
from chainlit.config import config
|
|
31
|
-
from chainlit.context import ChainlitContext, HTTPSession, context_var
|
|
32
|
+
from chainlit.context import ChainlitContext, HTTPSession, context, context_var
|
|
32
33
|
from chainlit.data import get_data_layer
|
|
33
34
|
from chainlit.element import Element, ElementDict
|
|
34
35
|
from chainlit.emitter import BaseChainlitEmitter
|
|
@@ -41,13 +42,12 @@ from chainlit.user_session import user_session
|
|
|
41
42
|
|
|
42
43
|
|
|
43
44
|
class TeamsEmitter(BaseChainlitEmitter):
|
|
44
|
-
def __init__(self, session: HTTPSession, turn_context: TurnContext
|
|
45
|
+
def __init__(self, session: HTTPSession, turn_context: TurnContext):
|
|
45
46
|
super().__init__(session)
|
|
46
47
|
self.turn_context = turn_context
|
|
47
|
-
self.enabled = enabled
|
|
48
48
|
|
|
49
49
|
async def send_element(self, element_dict: ElementDict):
|
|
50
|
-
if
|
|
50
|
+
if element_dict.get("display") != "inline":
|
|
51
51
|
return
|
|
52
52
|
|
|
53
53
|
persisted_file = self.session.files.get(element_dict.get("chainlitKey") or "")
|
|
@@ -81,7 +81,7 @@ class TeamsEmitter(BaseChainlitEmitter):
|
|
|
81
81
|
await self.turn_context.send_activity(Activity(attachments=[attachment]))
|
|
82
82
|
|
|
83
83
|
async def send_step(self, step_dict: StepDict):
|
|
84
|
-
if not
|
|
84
|
+
if not step_dict["type"] == "assistant_message":
|
|
85
85
|
return
|
|
86
86
|
|
|
87
87
|
step_type = step_dict.get("type")
|
|
@@ -89,26 +89,27 @@ class TeamsEmitter(BaseChainlitEmitter):
|
|
|
89
89
|
"user_message",
|
|
90
90
|
"assistant_message",
|
|
91
91
|
]
|
|
92
|
-
is_chain_of_thought = bool(step_dict.get("parentId"))
|
|
93
92
|
is_empty_output = not step_dict.get("output")
|
|
94
93
|
|
|
95
|
-
if
|
|
94
|
+
if is_empty_output or not is_message:
|
|
96
95
|
return
|
|
97
96
|
else:
|
|
98
97
|
reply = MessageFactory.text(step_dict["output"])
|
|
99
|
-
enable_feedback =
|
|
98
|
+
enable_feedback = get_data_layer()
|
|
100
99
|
if enable_feedback:
|
|
100
|
+
current_run = context.current_run
|
|
101
|
+
scorable_id = current_run.id if current_run else step_dict["id"]
|
|
101
102
|
like_button = CardAction(
|
|
102
103
|
type=ActionTypes.message_back,
|
|
103
104
|
title="👍",
|
|
104
105
|
text="like",
|
|
105
|
-
value={"feedback": "like", "step_id":
|
|
106
|
+
value={"feedback": "like", "step_id": scorable_id},
|
|
106
107
|
)
|
|
107
108
|
dislike_button = CardAction(
|
|
108
109
|
type=ActionTypes.message_back,
|
|
109
110
|
title="👎",
|
|
110
111
|
text="dislike",
|
|
111
|
-
value={"feedback": "dislike", "step_id":
|
|
112
|
+
value={"feedback": "dislike", "step_id": scorable_id},
|
|
112
113
|
)
|
|
113
114
|
card = HeroCard(buttons=[like_button, dislike_button])
|
|
114
115
|
attachment = Attachment(
|
|
@@ -119,7 +120,7 @@ class TeamsEmitter(BaseChainlitEmitter):
|
|
|
119
120
|
await self.turn_context.send_activity(reply)
|
|
120
121
|
|
|
121
122
|
async def update_step(self, step_dict: StepDict):
|
|
122
|
-
if not
|
|
123
|
+
if not step_dict["type"] == "assistant_message":
|
|
123
124
|
return
|
|
124
125
|
|
|
125
126
|
await self.send_step(step_dict)
|
|
@@ -225,7 +226,13 @@ async def process_teams_message(
|
|
|
225
226
|
user = await get_user(turn_context.activity.from_property)
|
|
226
227
|
|
|
227
228
|
thread_id = str(
|
|
228
|
-
uuid.uuid5(
|
|
229
|
+
uuid.uuid5(
|
|
230
|
+
uuid.NAMESPACE_DNS,
|
|
231
|
+
str(
|
|
232
|
+
turn_context.activity.conversation.id
|
|
233
|
+
+ datetime.today().strftime("%Y-%m-%d")
|
|
234
|
+
),
|
|
235
|
+
)
|
|
229
236
|
)
|
|
230
237
|
|
|
231
238
|
text = clean_content(turn_context.activity)
|
|
@@ -247,6 +254,9 @@ async def process_teams_message(
|
|
|
247
254
|
|
|
248
255
|
file_elements = await download_teams_files(session, teams_files)
|
|
249
256
|
|
|
257
|
+
if on_chat_start := config.code.on_chat_start:
|
|
258
|
+
await on_chat_start()
|
|
259
|
+
|
|
250
260
|
msg = Message(
|
|
251
261
|
content=text,
|
|
252
262
|
elements=file_elements,
|
|
@@ -256,11 +266,6 @@ async def process_teams_message(
|
|
|
256
266
|
|
|
257
267
|
await msg.send()
|
|
258
268
|
|
|
259
|
-
ctx.emitter.enabled = True
|
|
260
|
-
|
|
261
|
-
if on_chat_start := config.code.on_chat_start:
|
|
262
|
-
await on_chat_start()
|
|
263
|
-
|
|
264
269
|
if on_message := config.code.on_message:
|
|
265
270
|
await on_message(msg)
|
|
266
271
|
|
|
@@ -314,7 +319,7 @@ async def handle_message(turn_context: TurnContext):
|
|
|
314
319
|
conversation=turn_context.activity.conversation,
|
|
315
320
|
)
|
|
316
321
|
await turn_context.send_activity(typing_activity)
|
|
317
|
-
thread_name = f"{turn_context.activity.from_property.name} Teams DM"
|
|
322
|
+
thread_name = f"{turn_context.activity.from_property.name} Teams DM {datetime.today().strftime('%Y-%m-%d')}"
|
|
318
323
|
await process_teams_message(turn_context, thread_name)
|
|
319
324
|
|
|
320
325
|
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
{
|
|
2
|
+
"components": {
|
|
3
|
+
"atoms": {
|
|
4
|
+
"buttons": {
|
|
5
|
+
"userButton": {
|
|
6
|
+
"menu": {
|
|
7
|
+
"settings": "设置",
|
|
8
|
+
"settingsKey": "S",
|
|
9
|
+
"APIKeys": "API 密钥",
|
|
10
|
+
"logout": "登出"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"molecules": {
|
|
16
|
+
"newChatButton": {
|
|
17
|
+
"newChat": "新建对话"
|
|
18
|
+
},
|
|
19
|
+
"tasklist": {
|
|
20
|
+
"TaskList": {
|
|
21
|
+
"title": "\ud83d\uddd2\ufe0f 任务列表",
|
|
22
|
+
"loading": "加载中...",
|
|
23
|
+
"error": "发生错误"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"attachments": {
|
|
27
|
+
"cancelUpload": "取消上传",
|
|
28
|
+
"removeAttachment": "移除附件"
|
|
29
|
+
},
|
|
30
|
+
"newChatDialog": {
|
|
31
|
+
"createNewChat": "创建新对话?",
|
|
32
|
+
"clearChat": "这将清除当前消息并开始新的对话。",
|
|
33
|
+
"cancel": "取消",
|
|
34
|
+
"confirm": "确认"
|
|
35
|
+
},
|
|
36
|
+
"settingsModal": {
|
|
37
|
+
"settings": "设置",
|
|
38
|
+
"expandMessages": "展开消息",
|
|
39
|
+
"hideChainOfThought": "隐藏思考链",
|
|
40
|
+
"darkMode": "暗色模式"
|
|
41
|
+
},
|
|
42
|
+
"detailsButton": {
|
|
43
|
+
"using": "使用",
|
|
44
|
+
"used": "已用"
|
|
45
|
+
},
|
|
46
|
+
"auth": {
|
|
47
|
+
"authLogin": {
|
|
48
|
+
"title": "登录以访问应用。",
|
|
49
|
+
"form": {
|
|
50
|
+
"email": "电子邮箱地址",
|
|
51
|
+
"password": "密码",
|
|
52
|
+
"noAccount": "没有账户?",
|
|
53
|
+
"alreadyHaveAccount": "已有账户?",
|
|
54
|
+
"signup": "注册",
|
|
55
|
+
"signin": "登录",
|
|
56
|
+
"or": "或者",
|
|
57
|
+
"continue": "继续",
|
|
58
|
+
"forgotPassword": "忘记密码?",
|
|
59
|
+
"passwordMustContain": "您的密码必须包含:",
|
|
60
|
+
"emailRequired": "电子邮箱是必填项",
|
|
61
|
+
"passwordRequired": "密码是必填项"
|
|
62
|
+
},
|
|
63
|
+
"error": {
|
|
64
|
+
"default": "无法登录。",
|
|
65
|
+
"signin": "尝试使用不同的账户登录。",
|
|
66
|
+
"oauthsignin": "尝试使用不同的账户登录。",
|
|
67
|
+
"redirect_uri_mismatch": "重定向URI与OAuth应用配置不匹配。",
|
|
68
|
+
"oauthcallbackerror": "尝试使用不同的账户登录。",
|
|
69
|
+
"oauthcreateaccount": "尝试使用不同的账户登录。",
|
|
70
|
+
"emailcreateaccount": "尝试使用不同的账户登录。",
|
|
71
|
+
"callback": "尝试使用不同的账户登录。",
|
|
72
|
+
"oauthaccountnotlinked": "为了验证您的身份,请使用最初使用的同一账户登录。",
|
|
73
|
+
"emailsignin": "无法发送邮件。",
|
|
74
|
+
"emailverify": "请验证您的电子邮件,已发送一封新邮件。",
|
|
75
|
+
"credentialssignin": "登录失败。请检查您提供的详细信息是否正确。",
|
|
76
|
+
"sessionrequired": "请登录以访问此页面。"
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"authVerifyEmail": {
|
|
80
|
+
"almostThere": "您快成功了!我们已向 ",
|
|
81
|
+
"verifyEmailLink": "请单击该邮件中的链接以完成注册。",
|
|
82
|
+
"didNotReceive": "没找到邮件?",
|
|
83
|
+
"resendEmail": "重新发送邮件",
|
|
84
|
+
"goBack": "返回",
|
|
85
|
+
"emailSent": "邮件已成功发送。",
|
|
86
|
+
"verifyEmail": "验证您的电子邮件地址"
|
|
87
|
+
},
|
|
88
|
+
"providerButton": {
|
|
89
|
+
"continue": "使用{{provider}}继续",
|
|
90
|
+
"signup": "使用{{provider}}注册"
|
|
91
|
+
},
|
|
92
|
+
"authResetPassword": {
|
|
93
|
+
"newPasswordRequired": "新密码是必填项",
|
|
94
|
+
"passwordsMustMatch": "密码必须一致",
|
|
95
|
+
"confirmPasswordRequired": "确认密码是必填项",
|
|
96
|
+
"newPassword": "新密码",
|
|
97
|
+
"confirmPassword": "确认密码",
|
|
98
|
+
"resetPassword": "重置密码"
|
|
99
|
+
},
|
|
100
|
+
"authForgotPassword": {
|
|
101
|
+
"email": "电子邮箱地址",
|
|
102
|
+
"emailRequired": "电子邮箱是必填项",
|
|
103
|
+
"emailSent": "请检查电子邮箱{{email}}以获取重置密码的指示。",
|
|
104
|
+
"enterEmail": "请输入您的电子邮箱地址,我们将发送重置密码的指示。",
|
|
105
|
+
"resendEmail": "重新发送邮件",
|
|
106
|
+
"continue": "继续",
|
|
107
|
+
"goBack": "返回"
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"organisms": {
|
|
112
|
+
"chat": {
|
|
113
|
+
"history": {
|
|
114
|
+
"index": {
|
|
115
|
+
"showHistory": "显示历史",
|
|
116
|
+
"lastInputs": "最后输入",
|
|
117
|
+
"noInputs": "如此空旷...",
|
|
118
|
+
"loading": "加载中..."
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"inputBox": {
|
|
122
|
+
"input": {
|
|
123
|
+
"placeholder": "在这里输入您的消息..."
|
|
124
|
+
},
|
|
125
|
+
"speechButton": {
|
|
126
|
+
"start": "开始录音",
|
|
127
|
+
"stop": "停止录音"
|
|
128
|
+
},
|
|
129
|
+
"SubmitButton": {
|
|
130
|
+
"sendMessage": "发送消息",
|
|
131
|
+
"stopTask": "停止任务"
|
|
132
|
+
},
|
|
133
|
+
"UploadButton": {
|
|
134
|
+
"attachFiles": "附加文件"
|
|
135
|
+
},
|
|
136
|
+
"waterMark": {
|
|
137
|
+
"text": "使用"
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"Messages": {
|
|
141
|
+
"index": {
|
|
142
|
+
"running": "运行中",
|
|
143
|
+
"executedSuccessfully": "执行成功",
|
|
144
|
+
"failed": "失败",
|
|
145
|
+
"feedbackUpdated": "反馈更新",
|
|
146
|
+
"updating": "正在更新"
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
"dropScreen": {
|
|
150
|
+
"dropYourFilesHere": "在这里拖放您的文件"
|
|
151
|
+
},
|
|
152
|
+
"index": {
|
|
153
|
+
"failedToUpload": "上传失败",
|
|
154
|
+
"cancelledUploadOf": "取消上传",
|
|
155
|
+
"couldNotReachServer": "无法连接到服务器",
|
|
156
|
+
"continuingChat": "继续之前的对话"
|
|
157
|
+
},
|
|
158
|
+
"settings": {
|
|
159
|
+
"settingsPanel": "设置面板",
|
|
160
|
+
"reset": "重置",
|
|
161
|
+
"cancel": "取消",
|
|
162
|
+
"confirm": "确认"
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
"threadHistory": {
|
|
166
|
+
"sidebar": {
|
|
167
|
+
"filters": {
|
|
168
|
+
"FeedbackSelect": {
|
|
169
|
+
"feedbackAll": "反馈:全部",
|
|
170
|
+
"feedbackPositive": "反馈:正面",
|
|
171
|
+
"feedbackNegative": "反馈:负面"
|
|
172
|
+
},
|
|
173
|
+
"SearchBar": {
|
|
174
|
+
"search": "搜索"
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
"DeleteThreadButton": {
|
|
178
|
+
"confirmMessage": "这将删除线程及其消息和元素。",
|
|
179
|
+
"cancel": "取消",
|
|
180
|
+
"confirm": "确认",
|
|
181
|
+
"deletingChat": "删除对话",
|
|
182
|
+
"chatDeleted": "对话已删除"
|
|
183
|
+
},
|
|
184
|
+
"index": {
|
|
185
|
+
"pastChats": "过往对话"
|
|
186
|
+
},
|
|
187
|
+
"ThreadList": {
|
|
188
|
+
"empty": "空的...",
|
|
189
|
+
"today": "今天",
|
|
190
|
+
"yesterday": "昨天",
|
|
191
|
+
"previous7days": "前7天",
|
|
192
|
+
"previous30days": "前30天"
|
|
193
|
+
},
|
|
194
|
+
"TriggerButton": {
|
|
195
|
+
"closeSidebar": "关闭侧边栏",
|
|
196
|
+
"openSidebar": "打开侧边栏"
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
"Thread": {
|
|
200
|
+
"backToChat": "返回对话",
|
|
201
|
+
"chatCreatedOn": "此对话创建于"
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
"header": {
|
|
205
|
+
"chat": "对话",
|
|
206
|
+
"readme": "说明"
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
"hooks": {
|
|
211
|
+
"useLLMProviders": {
|
|
212
|
+
"failedToFetchProviders": "获取提供者失败:"
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
"pages": {
|
|
216
|
+
"Design": {},
|
|
217
|
+
"Env": {
|
|
218
|
+
"savedSuccessfully": "保存成功",
|
|
219
|
+
"requiredApiKeys": "必需的API密钥",
|
|
220
|
+
"requiredApiKeysInfo": "要使用此应用,需要以下API密钥。这些密钥存储在您的设备本地存储中。"
|
|
221
|
+
},
|
|
222
|
+
"Page": {
|
|
223
|
+
"notPartOfProject": "您不是此项目的一部分。"
|
|
224
|
+
},
|
|
225
|
+
"ResumeButton": {
|
|
226
|
+
"resumeChat": "恢复对话"
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
chainlit/user_session.py
CHANGED
|
@@ -33,9 +33,6 @@ class UserSession:
|
|
|
33
33
|
if isinstance(context.session, WebsocketSession):
|
|
34
34
|
user_session["languages"] = context.session.languages
|
|
35
35
|
|
|
36
|
-
if context.session.root_message:
|
|
37
|
-
user_session["root_message"] = context.session.root_message
|
|
38
|
-
|
|
39
36
|
return user_session.get(key, default)
|
|
40
37
|
|
|
41
38
|
def set(self, key, value):
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
chainlit/__init__.py,sha256=laUQKGzJ_98hLp_iPhV9vuIdVRw_hudVck4GdGXPswo,11702
|
|
2
|
+
chainlit/__main__.py,sha256=7Vg3w3T3qDuz4KDu5lQhLH6lQ3cYdume7gHH7Z1V97U,87
|
|
3
|
+
chainlit/action.py,sha256=k-GsblVHI4DnDWFyF-RZgq3KfdfAFICFh2OBeU4w8N8,1410
|
|
4
|
+
chainlit/auth.py,sha256=lLHePwmwKzX0LiWqpTAtKTdSecrDLqCMSY9Yw4c-TD8,2681
|
|
5
|
+
chainlit/cache.py,sha256=Bv3dT4eHhE6Fq3c6Do0ZTpiyoXgXYewdxTgpYghEd9g,1361
|
|
6
|
+
chainlit/chat_context.py,sha256=X1NInuCkhrfFhFUNIbipVaqf-90xXuyCAB9fvJlEUD4,1868
|
|
7
|
+
chainlit/chat_settings.py,sha256=2ByenmwS8O6jQjDVJjhhbLrBPGA5aY2F7R3VvQQxXPk,877
|
|
8
|
+
chainlit/cli/__init__.py,sha256=iLyxU_9db-2n_MaSr6V0VNoQDxhwRIT10-OGlENlq7o,6163
|
|
9
|
+
chainlit/config.py,sha256=sPcSSSg9aKD87-ajWkGfPE1KiRAso2dCpvLUvybdTQA,16807
|
|
10
|
+
chainlit/context.py,sha256=RdLGlRjx8nBW1onooQdCdcbtMyIBGFlxYkL95oHacdk,3338
|
|
11
|
+
chainlit/copilot/dist/assets/logo_dark-2a3cf740.svg,sha256=Kjz3QMh-oh-ag4YatjU0YCPqGF7F8nHh8VUQoJIs01E,8887
|
|
12
|
+
chainlit/copilot/dist/assets/logo_light-b078e7bc.svg,sha256=sHjnvEq1rfqh3bcexJNYUY7WEDdTQZq3aKZYpi4w4ck,8889
|
|
13
|
+
chainlit/copilot/dist/index.js,sha256=mwKWLQBoaR6kksVu_JSMqBkecev_lBDrGmJgdnfIxN0,6755716
|
|
14
|
+
chainlit/data/__init__.py,sha256=92v3onkoSSAANUHvaLKNWvru2cqEltOeCDd4DeVe45Q,16841
|
|
15
|
+
chainlit/data/acl.py,sha256=5EwZuKVcZediw77L661MohGce3JzGIaYmw6NutmMTw0,578
|
|
16
|
+
chainlit/data/dynamodb.py,sha256=u5L9xqp0FG6J2VuGqUjMiJmIddL5jXs4MUcoZb4mXsM,19420
|
|
17
|
+
chainlit/data/sql_alchemy.py,sha256=fjKSqJqKsy9CBpXSZi6CPg3mFqfs_roZ1t9Y1XFinOM,26600
|
|
18
|
+
chainlit/data/storage_clients.py,sha256=D9KY1XKDjZh2uuh01ECxeoEtjw-JlrCR-WCuOuePVQI,3007
|
|
19
|
+
chainlit/discord/__init__.py,sha256=kZ_AAMaCToqO-1FdeQ8_IHS2pqNT0QJ-yyd8bCMaHHs,198
|
|
20
|
+
chainlit/discord/app.py,sha256=-efl4v9wNvfidYPjS2kqNqaaUCvvfBlErZe6lyQF_IE,11174
|
|
21
|
+
chainlit/element.py,sha256=sjOgHjDaTuQ-t663dmBT-iBOgSVTn3mTlbSGjE42LjE,10990
|
|
22
|
+
chainlit/emitter.py,sha256=vfPtgqeHfm5CxZrMHIUXjw7U0wGWYCrQonaEC2SK0vo,13036
|
|
23
|
+
chainlit/frontend/dist/assets/DailyMotion-e2c926d0.js,sha256=1rrPfAkFr2jMx5hxJ76TY5gvc1m-4cGdELTzVsOuuM0,2961
|
|
24
|
+
chainlit/frontend/dist/assets/Facebook-88f80aba.js,sha256=8B714dXYo3oxwvgkQTOYupI6tFP1K-gJC2xhZRdI_JY,3216
|
|
25
|
+
chainlit/frontend/dist/assets/FilePlayer-febd1b0d.js,sha256=uTN2pHMArK-QH5nznG3E5kw5j7W8fHoy61W2XxNGmRE,9041
|
|
26
|
+
chainlit/frontend/dist/assets/Kaltura-606fe0bd.js,sha256=BHkisENMNVvb68dV1cPSzm06T3yfds5yWusZ4IaGd-s,2790
|
|
27
|
+
chainlit/frontend/dist/assets/Mixcloud-b3db090a.js,sha256=Nh6XOnGkuOFQpHJduKvuTsc84etCNLSOciQG64SJPZ0,2638
|
|
28
|
+
chainlit/frontend/dist/assets/Mux-ca847a7d.js,sha256=i0Td6XPdNlLtpgpjXy_19-us7IwvVfRKHuXp7a_z-2g,5360
|
|
29
|
+
chainlit/frontend/dist/assets/Preview-7a3747b5.js,sha256=O2Joif9qqZlqQy2h4R8k9TzXI7wxA-yxvk_aaLJBiTs,3011
|
|
30
|
+
chainlit/frontend/dist/assets/SoundCloud-0da01fb1.js,sha256=R7mcCa4sq4O8jHaer5t5VcYeMXpokMN-Myh-JKTvO5k,2923
|
|
31
|
+
chainlit/frontend/dist/assets/Streamable-4a6ab048.js,sha256=oVr10OO0xRyHvDWTcMrLsEGy2VFgRTeJXLw1VA0Rok8,2935
|
|
32
|
+
chainlit/frontend/dist/assets/Twitch-3e260619.js,sha256=b4ci82OaF-otHoRJ642M7fl6ntDy4FnWZ1E8LPBwzck,3083
|
|
33
|
+
chainlit/frontend/dist/assets/Vidyard-73692980.js,sha256=iNlqaCiGy2ICq0_7suqFyWrBHxaXAM1R_A1I5e29eX8,2857
|
|
34
|
+
chainlit/frontend/dist/assets/Vimeo-6627c7a8.js,sha256=u-xGsgsBt8LOnMNSWzNG7nTZZKIzX-bLNXz1J3NCy4Q,3627
|
|
35
|
+
chainlit/frontend/dist/assets/Wistia-27df9c66.js,sha256=NFy7sNGjSJh2kZ1xCd8PFHI8VhQMVl2RCvJhGrbwJb8,3514
|
|
36
|
+
chainlit/frontend/dist/assets/YouTube-a11d419d.js,sha256=FeAHVjMRJeB7wYlusKG2HX_6pEe0FJkVON7GhUX_VoE,4448
|
|
37
|
+
chainlit/frontend/dist/assets/index-aaf974a9.css,sha256=qvl0qUmR5u0JcmJAfkzaZpN-0ZKdQjzqCSE9cnrQpZQ,2559
|
|
38
|
+
chainlit/frontend/dist/assets/index-d66d1800.js,sha256=2Gr4Tmaic_xU4ftL-iYdRoRUFDM4CbvN1p1S1Thzx_8,2757239
|
|
39
|
+
chainlit/frontend/dist/assets/logo_dark-2a3cf740.svg,sha256=Kjz3QMh-oh-ag4YatjU0YCPqGF7F8nHh8VUQoJIs01E,8887
|
|
40
|
+
chainlit/frontend/dist/assets/logo_light-b078e7bc.svg,sha256=sHjnvEq1rfqh3bcexJNYUY7WEDdTQZq3aKZYpi4w4ck,8889
|
|
41
|
+
chainlit/frontend/dist/assets/react-plotly-012ed517.js,sha256=VI1Q4hLWuNFUeVE8yNrm1N7n1ceEv3oYK74RLIzanvc,3739251
|
|
42
|
+
chainlit/frontend/dist/favicon.svg,sha256=0Cy8x28obT5eWW3nxZRhsEvu6_zMqrqbg0y6hT3D0Q0,6455
|
|
43
|
+
chainlit/frontend/dist/index.html,sha256=dKEWYCXpdHMlWFqeevE_KCQzIPn-LtxWqVnW_D757C8,965
|
|
44
|
+
chainlit/haystack/__init__.py,sha256=uZ77YiPy-qleSTi3dQCDO9HE6S6F6GpJWmh7jO4cxXA,217
|
|
45
|
+
chainlit/haystack/callbacks.py,sha256=goF1_Ua_SB0u_yaiYcAvvXCf-t47-DObmeuqE4VWrQc,5074
|
|
46
|
+
chainlit/hello.py,sha256=LwENQWo5s5r8nNDn4iKSV77vX60Ky5r_qGjQhyi7qlY,416
|
|
47
|
+
chainlit/input_widget.py,sha256=KmOn1nPTBvnld3iIBHR0Vih0KsCxVnTbo2t_xBNANzo,4949
|
|
48
|
+
chainlit/langchain/__init__.py,sha256=zErMw0_3ufSGeF9ye7X0ZX3wDat4mTOx97T40ePDO2g,217
|
|
49
|
+
chainlit/langchain/callbacks.py,sha256=dUQMUcnYwOPmEZ8HKlLrRgVO1AHH2ovSb71GykcBrj8,21103
|
|
50
|
+
chainlit/langflow/__init__.py,sha256=wxhxdsl1yxdsRyNTgZticxFF_8VFtJJ4OdIy3tnEIyM,817
|
|
51
|
+
chainlit/llama_index/__init__.py,sha256=weRoIWCaRBGvA1LczCEfsqhWsltQSVlhtRnTovtdo8w,227
|
|
52
|
+
chainlit/llama_index/callbacks.py,sha256=ix9KGUbug10fZNnK02liq72I6oQlhpjEfbvVmAwNmbg,6547
|
|
53
|
+
chainlit/logger.py,sha256=wTwRSZsLfXwWy6U4351IgWAm4KCMThgxm9EZpjGUEr4,373
|
|
54
|
+
chainlit/markdown.py,sha256=VUpqW7MqgjiPIQYHU4funwqC4GmHZBu_TGZTjTI4B0k,2025
|
|
55
|
+
chainlit/message.py,sha256=HpgHcI8Fkoq5oQ-p2MylVaPzIuFZXetxOQo4gTfZEzQ,17315
|
|
56
|
+
chainlit/mistralai/__init__.py,sha256=m2T4zGo9qIbPNGk9qKGLT-pFpXva0TPrjIROvlLfT0w,1555
|
|
57
|
+
chainlit/oauth_providers.py,sha256=Mv31biQ84EBJfQGBxqhFfnbpl-jfQ_Zn6IxKY3XZg6Q,22972
|
|
58
|
+
chainlit/openai/__init__.py,sha256=aj8toIwvCktANU1TaH1verKS7ApS6tlhDZFtm1oTyCM,1715
|
|
59
|
+
chainlit/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
60
|
+
chainlit/secret.py,sha256=cQvIFGTQ7r2heC8EOGdgifSZZYqslh-qQxhUhKhD8vU,295
|
|
61
|
+
chainlit/server.py,sha256=4GquVYq6Zwn23Is3VJz8FDpML51QgC9l1gSkSkwoW7A,28281
|
|
62
|
+
chainlit/session.py,sha256=_f99uxAyiRea3nf_E3acfFnDdLZU7evk4WXKtplkwXU,9283
|
|
63
|
+
chainlit/slack/__init__.py,sha256=Q41ztJHeVmpoXVgVqAcwGOufQp_bjf7dDT7eEXDdhPI,207
|
|
64
|
+
chainlit/slack/app.py,sha256=jzy6Nz9kmnJ6j1wfoI94cweSNDjdv7X-ur_lWnq5oVE,11741
|
|
65
|
+
chainlit/socket.py,sha256=P9fDWYo0u1PPZO7HPao99USDC3Qs52gB3PUzLTSXWA0,12778
|
|
66
|
+
chainlit/step.py,sha256=nSHQWW4bLIszYtJzJ80MNiVB_LHGSE0YJZ2PCmY7b3c,14207
|
|
67
|
+
chainlit/sync.py,sha256=G1n-7-3WgXsN8y1bJkEyws_YwmHZIyDZoZUwhprigag,1235
|
|
68
|
+
chainlit/teams/__init__.py,sha256=ZSEbsRJHT_mKfGn6yuzM5NX-xItleSDS0af7vt8Z1OA,217
|
|
69
|
+
chainlit/teams/app.py,sha256=gJm_wBNzCawaTLIYtOEhDlpRwBDprnguTAIoWZhlO8o,10533
|
|
70
|
+
chainlit/telemetry.py,sha256=Rk4dnZv0OnGOgV4kD-VHdhgl4i7i3ypqhSE_R-LZceM,3060
|
|
71
|
+
chainlit/translations/en-US.json,sha256=J46wpkc01XLnytWNLSziillMvfmwXsc-mIUeYDIy59M,7741
|
|
72
|
+
chainlit/translations/zh-CN.json,sha256=Y3MhXUDFi4YMxX8-agpCM68efYXCGcHqyqRAen8LLfk,7508
|
|
73
|
+
chainlit/translations.py,sha256=WG_r7HzxBYns-zk9tVvoGdoofv71okTZx8k1RlcoTIg,2034
|
|
74
|
+
chainlit/types.py,sha256=494SAbZ2m46KVcpWmxdBtaPVIG1gvEt-1l3rxYlrMbU,5173
|
|
75
|
+
chainlit/user.py,sha256=8PgRJvv59b7BKTNguObo68gyFoOGNJfVkT3WW-fvhAM,671
|
|
76
|
+
chainlit/user_session.py,sha256=T1nQVN_weELXTrkDIV54YgdrA3zIvJGe1tN-nypunt4,1531
|
|
77
|
+
chainlit/utils.py,sha256=X-WVa0QOwpu8uuzOdGFByvzFieZu7aPpH9LG5UjJ4RI,4002
|
|
78
|
+
chainlit/version.py,sha256=iosXhlXclBwBqlADFKEilxAC2wWKbtuBKi87AmPi7s8,196
|
|
79
|
+
chainlit-1.1.400.dist-info/METADATA,sha256=7W9MsO983bbQUZwIXPP-DONh8ebwa9SxC0vyOuIsOlA,6291
|
|
80
|
+
chainlit-1.1.400.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
81
|
+
chainlit-1.1.400.dist-info/entry_points.txt,sha256=FrkqdjrFl8juSnvBndniyX7XuKojmUwO4ghRh-CFMQc,45
|
|
82
|
+
chainlit-1.1.400.dist-info/RECORD,,
|