chainlit 1.1.101__py3-none-any.whl → 1.1.201__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/config.py +6 -0
- chainlit/copilot/dist/index.js +218 -222
- chainlit/discord/app.py +18 -9
- chainlit/frontend/dist/assets/{index-37c9a5a9.js → index-bf0451c6.js} +125 -129
- chainlit/frontend/dist/assets/{react-plotly-c55d0c95.js → react-plotly-1ca97c0e.js} +1 -1
- chainlit/frontend/dist/index.html +1 -1
- chainlit/message.py +2 -2
- chainlit/server.py +3 -1
- chainlit/slack/app.py +18 -7
- chainlit/step.py +11 -12
- chainlit/types.py +1 -0
- {chainlit-1.1.101.dist-info → chainlit-1.1.201.dist-info}/METADATA +4 -1
- {chainlit-1.1.101.dist-info → chainlit-1.1.201.dist-info}/RECORD +15 -15
- {chainlit-1.1.101.dist-info → chainlit-1.1.201.dist-info}/WHEEL +0 -0
- {chainlit-1.1.101.dist-info → chainlit-1.1.201.dist-info}/entry_points.txt +0 -0
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
<script>
|
|
23
23
|
const global = globalThis;
|
|
24
24
|
</script>
|
|
25
|
-
<script type="module" crossorigin src="/assets/index-
|
|
25
|
+
<script type="module" crossorigin src="/assets/index-bf0451c6.js"></script>
|
|
26
26
|
<link rel="stylesheet" href="/assets/index-d088547c.css">
|
|
27
27
|
</head>
|
|
28
28
|
<body>
|
chainlit/message.py
CHANGED
|
@@ -206,7 +206,7 @@ class Message(MessageBase):
|
|
|
206
206
|
def __init__(
|
|
207
207
|
self,
|
|
208
208
|
content: Union[str, Dict],
|
|
209
|
-
author: str =
|
|
209
|
+
author: Optional[str] = None,
|
|
210
210
|
language: Optional[str] = None,
|
|
211
211
|
actions: Optional[List[Action]] = None,
|
|
212
212
|
elements: Optional[List[ElementBased]] = None,
|
|
@@ -243,7 +243,7 @@ class Message(MessageBase):
|
|
|
243
243
|
self.metadata = metadata
|
|
244
244
|
self.tags = tags
|
|
245
245
|
|
|
246
|
-
self.author = author
|
|
246
|
+
self.author = author or config.ui.name
|
|
247
247
|
self.type = type
|
|
248
248
|
self.actions = actions if actions is not None else []
|
|
249
249
|
self.elements = elements if elements is not None else []
|
chainlit/server.py
CHANGED
|
@@ -234,14 +234,16 @@ def get_html_template():
|
|
|
234
234
|
CSS_PLACEHOLDER = "<!-- CSS INJECTION PLACEHOLDER -->"
|
|
235
235
|
|
|
236
236
|
default_url = "https://github.com/Chainlit/chainlit"
|
|
237
|
+
default_meta_image_url = "https://chainlit-cloud.s3.eu-west-3.amazonaws.com/logo/chainlit_banner.png"
|
|
237
238
|
url = config.ui.github or default_url
|
|
239
|
+
meta_image_url = config.ui.custom_meta_image_url or default_meta_image_url
|
|
238
240
|
|
|
239
241
|
tags = f"""<title>{config.ui.name}</title>
|
|
240
242
|
<meta name="description" content="{config.ui.description}">
|
|
241
243
|
<meta property="og:type" content="website">
|
|
242
244
|
<meta property="og:title" content="{config.ui.name}">
|
|
243
245
|
<meta property="og:description" content="{config.ui.description}">
|
|
244
|
-
<meta property="og:image" content="
|
|
246
|
+
<meta property="og:image" content="{meta_image_url}">
|
|
245
247
|
<meta property="og:url" content="{url}">"""
|
|
246
248
|
|
|
247
249
|
js = f"""<script>{f"window.theme = {json.dumps(config.ui.theme.to_dict())}; " if config.ui.theme else ""}</script>"""
|
chainlit/slack/app.py
CHANGED
|
@@ -11,12 +11,12 @@ from chainlit.context import ChainlitContext, HTTPSession, context_var
|
|
|
11
11
|
from chainlit.data import get_data_layer
|
|
12
12
|
from chainlit.element import Element, ElementDict
|
|
13
13
|
from chainlit.emitter import BaseChainlitEmitter
|
|
14
|
+
from chainlit.logger import logger
|
|
14
15
|
from chainlit.message import Message, StepDict
|
|
16
|
+
from chainlit.telemetry import trace
|
|
15
17
|
from chainlit.types import Feedback
|
|
16
18
|
from chainlit.user import PersistedUser, User
|
|
17
19
|
from chainlit.user_session import user_session
|
|
18
|
-
from chainlit.logger import logger
|
|
19
|
-
from chainlit.telemetry import trace
|
|
20
20
|
from slack_bolt.adapter.fastapi.async_handler import AsyncSlackRequestHandler
|
|
21
21
|
from slack_bolt.async_app import AsyncApp
|
|
22
22
|
|
|
@@ -67,10 +67,16 @@ class SlackEmitter(BaseChainlitEmitter):
|
|
|
67
67
|
if not self.enabled:
|
|
68
68
|
return
|
|
69
69
|
|
|
70
|
+
step_type = step_dict.get("type")
|
|
71
|
+
is_message = step_type in [
|
|
72
|
+
"user_message",
|
|
73
|
+
"assistant_message",
|
|
74
|
+
"system_message",
|
|
75
|
+
]
|
|
70
76
|
is_chain_of_thought = bool(step_dict.get("parentId"))
|
|
71
77
|
is_empty_output = not step_dict.get("output")
|
|
72
78
|
|
|
73
|
-
if is_chain_of_thought or is_empty_output:
|
|
79
|
+
if is_chain_of_thought or is_empty_output or not is_message:
|
|
74
80
|
return
|
|
75
81
|
|
|
76
82
|
enable_feedback = not step_dict.get("disableFeedback") and get_data_layer()
|
|
@@ -124,6 +130,7 @@ slack_app = AsyncApp(
|
|
|
124
130
|
signing_secret=os.environ.get("SLACK_SIGNING_SECRET"),
|
|
125
131
|
)
|
|
126
132
|
|
|
133
|
+
|
|
127
134
|
@trace
|
|
128
135
|
def init_slack_context(
|
|
129
136
|
session: HTTPSession,
|
|
@@ -166,7 +173,7 @@ def clean_content(message: str):
|
|
|
166
173
|
async def get_user(slack_user_id: str):
|
|
167
174
|
if slack_user_id in users_by_slack_id:
|
|
168
175
|
return users_by_slack_id[slack_user_id]
|
|
169
|
-
|
|
176
|
+
|
|
170
177
|
slack_user = await slack_app.client.users_info(user=slack_user_id)
|
|
171
178
|
slack_user_profile = slack_user["user"]["profile"]
|
|
172
179
|
|
|
@@ -303,7 +310,7 @@ async def process_slack_message(
|
|
|
303
310
|
thread_id=thread_id,
|
|
304
311
|
name=thread_name or msg.content,
|
|
305
312
|
metadata=ctx.session.to_persistable(),
|
|
306
|
-
user_id=user_id
|
|
313
|
+
user_id=user_id,
|
|
307
314
|
)
|
|
308
315
|
except Exception as e:
|
|
309
316
|
logger.error(f"Error updating thread: {e}")
|
|
@@ -335,7 +342,9 @@ async def thumb_down(ack, context, body):
|
|
|
335
342
|
step_id = body["actions"][0]["value"]
|
|
336
343
|
|
|
337
344
|
if data_layer := get_data_layer():
|
|
338
|
-
|
|
345
|
+
thread_id = context_var.get().session.thread_id
|
|
346
|
+
feedback = Feedback(forId=step_id, threadId=thread_id, value=0)
|
|
347
|
+
await data_layer.upsert_feedback(feedback)
|
|
339
348
|
|
|
340
349
|
text = body["message"]["text"]
|
|
341
350
|
blocks = body["message"]["blocks"]
|
|
@@ -360,7 +369,9 @@ async def thumb_up(ack, context, body):
|
|
|
360
369
|
step_id = body["actions"][0]["value"]
|
|
361
370
|
|
|
362
371
|
if data_layer := get_data_layer():
|
|
363
|
-
|
|
372
|
+
thread_id = context_var.get().session.thread_id
|
|
373
|
+
feedback = Feedback(forId=step_id, threadId=thread_id, value=1)
|
|
374
|
+
await data_layer.upsert_feedback(feedback)
|
|
364
375
|
|
|
365
376
|
text = body["message"]["text"]
|
|
366
377
|
blocks = body["message"]["blocks"]
|
chainlit/step.py
CHANGED
|
@@ -299,7 +299,7 @@ class Step:
|
|
|
299
299
|
tasks = [el.send(for_id=self.id) for el in self.elements]
|
|
300
300
|
await asyncio.gather(*tasks)
|
|
301
301
|
|
|
302
|
-
if config.ui.hide_cot and self.parent_id:
|
|
302
|
+
if config.ui.hide_cot and (self.parent_id or not self.root):
|
|
303
303
|
return
|
|
304
304
|
|
|
305
305
|
if not config.features.prompt_playground and "generation" in step_dict:
|
|
@@ -332,7 +332,7 @@ class Step:
|
|
|
332
332
|
|
|
333
333
|
async def send(self):
|
|
334
334
|
if self.persisted:
|
|
335
|
-
return
|
|
335
|
+
return self
|
|
336
336
|
|
|
337
337
|
if config.code.author_rename:
|
|
338
338
|
self.name = await config.code.author_rename(self.name)
|
|
@@ -356,27 +356,21 @@ class Step:
|
|
|
356
356
|
tasks = [el.send(for_id=self.id) for el in self.elements]
|
|
357
357
|
await asyncio.gather(*tasks)
|
|
358
358
|
|
|
359
|
-
if config.ui.hide_cot and self.parent_id:
|
|
360
|
-
return self
|
|
359
|
+
if config.ui.hide_cot and (self.parent_id or not self.root):
|
|
360
|
+
return self
|
|
361
361
|
|
|
362
362
|
if not config.features.prompt_playground and "generation" in step_dict:
|
|
363
363
|
step_dict.pop("generation", None)
|
|
364
364
|
|
|
365
365
|
await context.emitter.send_step(step_dict)
|
|
366
366
|
|
|
367
|
-
return self
|
|
367
|
+
return self
|
|
368
368
|
|
|
369
369
|
async def stream_token(self, token: str, is_sequence=False):
|
|
370
370
|
"""
|
|
371
371
|
Sends a token to the UI.
|
|
372
372
|
Once all tokens have been streamed, call .send() to end the stream and persist the step if persistence is enabled.
|
|
373
373
|
"""
|
|
374
|
-
|
|
375
|
-
if not self.streaming:
|
|
376
|
-
self.streaming = True
|
|
377
|
-
step_dict = self.to_dict()
|
|
378
|
-
await context.emitter.stream_start(step_dict)
|
|
379
|
-
|
|
380
374
|
if is_sequence:
|
|
381
375
|
self.output = token
|
|
382
376
|
else:
|
|
@@ -384,9 +378,14 @@ class Step:
|
|
|
384
378
|
|
|
385
379
|
assert self.id
|
|
386
380
|
|
|
387
|
-
if config.ui.hide_cot and self.parent_id:
|
|
381
|
+
if config.ui.hide_cot and (self.parent_id or not self.root):
|
|
388
382
|
return
|
|
389
383
|
|
|
384
|
+
if not self.streaming:
|
|
385
|
+
self.streaming = True
|
|
386
|
+
step_dict = self.to_dict()
|
|
387
|
+
await context.emitter.stream_start(step_dict)
|
|
388
|
+
|
|
390
389
|
await context.emitter.send_token(
|
|
391
390
|
id=self.id, token=token, is_sequence=is_sequence
|
|
392
391
|
)
|
chainlit/types.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: chainlit
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.201
|
|
4
4
|
Summary: Build Conversational AI.
|
|
5
5
|
Home-page: https://github.com/Chainlit/chainlit
|
|
6
6
|
License: Apache-2.0 license
|
|
@@ -46,6 +46,9 @@ Description-Content-Type: text/markdown
|
|
|
46
46
|
|
|
47
47
|
**Build production-ready Conversational AI applications in minutes, not weeks ⚡️**
|
|
48
48
|
|
|
49
|
+
> [!NOTE]
|
|
50
|
+
> You can ask Chainlit related questions to [Chainlit Help](https://help.chainlit.io/)! Also available on the Discord `@Chainlit Help`. Proudly built with Chainlit!
|
|
51
|
+
|
|
49
52
|
Chainlit is an open-source async Python framework which allows developers to build scalable Conversational AI or agentic applications.
|
|
50
53
|
|
|
51
54
|
- ✅ ChatGPT-like application
|
|
@@ -6,26 +6,26 @@ chainlit/cache.py,sha256=Bv3dT4eHhE6Fq3c6Do0ZTpiyoXgXYewdxTgpYghEd9g,1361
|
|
|
6
6
|
chainlit/chat_settings.py,sha256=2ByenmwS8O6jQjDVJjhhbLrBPGA5aY2F7R3VvQQxXPk,877
|
|
7
7
|
chainlit/cli/__init__.py,sha256=JEB3Z3VWpzPgcfdSOQ6Z-L7dHdl7A1y47KUZP8H08GQ,4951
|
|
8
8
|
chainlit/cli/utils.py,sha256=mE2d9oOk-B2b9ZvDV1zENoDWxjfMriGP7bVwEFduZP4,717
|
|
9
|
-
chainlit/config.py,sha256=
|
|
9
|
+
chainlit/config.py,sha256=nm4e-v_rDDGwVSGwyqk2NjQOQ07yWUF7E7J24BgcifA,16429
|
|
10
10
|
chainlit/context.py,sha256=kBnJiKKNhft1nrXFLQnAW6M-_mzMpYqDEFAG5-lrHyo,2813
|
|
11
11
|
chainlit/copilot/dist/assets/logo_dark-2a3cf740.svg,sha256=Kjz3QMh-oh-ag4YatjU0YCPqGF7F8nHh8VUQoJIs01E,8887
|
|
12
12
|
chainlit/copilot/dist/assets/logo_light-b078e7bc.svg,sha256=sHjnvEq1rfqh3bcexJNYUY7WEDdTQZq3aKZYpi4w4ck,8889
|
|
13
|
-
chainlit/copilot/dist/index.js,sha256=
|
|
13
|
+
chainlit/copilot/dist/index.js,sha256=T077mTQ_RMMp7HURWSqQqaR45ll7NoXHKoOepo6mHzY,6958201
|
|
14
14
|
chainlit/data/__init__.py,sha256=CUkwYx9GYqIbgrLh7gmQm4qvO1mu4D0Es-z31dc00DU,16486
|
|
15
15
|
chainlit/data/acl.py,sha256=5EwZuKVcZediw77L661MohGce3JzGIaYmw6NutmMTw0,578
|
|
16
16
|
chainlit/data/sql_alchemy.py,sha256=XGiqUWnT64qv9tg08C7evCRoZolv8XtqtqJno3wg9H0,26524
|
|
17
17
|
chainlit/data/storage_clients.py,sha256=D9KY1XKDjZh2uuh01ECxeoEtjw-JlrCR-WCuOuePVQI,3007
|
|
18
18
|
chainlit/discord/__init__.py,sha256=kZ_AAMaCToqO-1FdeQ8_IHS2pqNT0QJ-yyd8bCMaHHs,198
|
|
19
|
-
chainlit/discord/app.py,sha256=
|
|
19
|
+
chainlit/discord/app.py,sha256=LGYjjqhwdNnWwBokRbXScEJI-IiJNrfHd1zVtDSv2ls,10385
|
|
20
20
|
chainlit/element.py,sha256=MIp-iyvsnK2iJ6Z_1Q-9JGZz_j_rrIxMM_L1LPA_5hw,10414
|
|
21
21
|
chainlit/emitter.py,sha256=54MPYoYHkOCKJvT30Vvg9mWYzWunGN9I3cFaqIoQ8oU,13037
|
|
22
|
-
chainlit/frontend/dist/assets/index-
|
|
22
|
+
chainlit/frontend/dist/assets/index-bf0451c6.js,sha256=7nvN8OTlVmL5cxo_mG6KsUISwqBWl6Vif8Jsq6ry7NY,3034523
|
|
23
23
|
chainlit/frontend/dist/assets/index-d088547c.css,sha256=0IhUfCm_IY1kjvlTR2edW1qKXAFDya3LZ6mnZnP6ovk,6605
|
|
24
24
|
chainlit/frontend/dist/assets/logo_dark-2a3cf740.svg,sha256=Kjz3QMh-oh-ag4YatjU0YCPqGF7F8nHh8VUQoJIs01E,8887
|
|
25
25
|
chainlit/frontend/dist/assets/logo_light-b078e7bc.svg,sha256=sHjnvEq1rfqh3bcexJNYUY7WEDdTQZq3aKZYpi4w4ck,8889
|
|
26
|
-
chainlit/frontend/dist/assets/react-plotly-
|
|
26
|
+
chainlit/frontend/dist/assets/react-plotly-1ca97c0e.js,sha256=ugfIUjrMk9zOCpWEYgNOL3XVBO-x8UIFoMYIbAeeWc4,3739251
|
|
27
27
|
chainlit/frontend/dist/favicon.svg,sha256=0Cy8x28obT5eWW3nxZRhsEvu6_zMqrqbg0y6hT3D0Q0,6455
|
|
28
|
-
chainlit/frontend/dist/index.html,sha256=
|
|
28
|
+
chainlit/frontend/dist/index.html,sha256=SSSUpTCEjUHtVwqXMRVKq8JOo_PMSFrdRKydrzEuj5Y,1005
|
|
29
29
|
chainlit/haystack/__init__.py,sha256=uZ77YiPy-qleSTi3dQCDO9HE6S6F6GpJWmh7jO4cxXA,217
|
|
30
30
|
chainlit/haystack/callbacks.py,sha256=tItLc6OmskPeDEJH2Qjtg7KgAgIy1TuYQYHTZm9cr3U,5209
|
|
31
31
|
chainlit/hello.py,sha256=LwENQWo5s5r8nNDn4iKSV77vX60Ky5r_qGjQhyi7qlY,416
|
|
@@ -37,7 +37,7 @@ chainlit/llama_index/__init__.py,sha256=weRoIWCaRBGvA1LczCEfsqhWsltQSVlhtRnTovtd
|
|
|
37
37
|
chainlit/llama_index/callbacks.py,sha256=nvmLTdKPV-WFjTTXnkIb-sPa7ZvQ49DrKH7UUQ_AGdg,7277
|
|
38
38
|
chainlit/logger.py,sha256=wTwRSZsLfXwWy6U4351IgWAm4KCMThgxm9EZpjGUEr4,373
|
|
39
39
|
chainlit/markdown.py,sha256=VUpqW7MqgjiPIQYHU4funwqC4GmHZBu_TGZTjTI4B0k,2025
|
|
40
|
-
chainlit/message.py,sha256=
|
|
40
|
+
chainlit/message.py,sha256=aeeijWL4-iNW6TOzNIv0QQHM2wO5LXk8QFsa4Q8P8ss,17979
|
|
41
41
|
chainlit/oauth_providers.py,sha256=WiKUFpNp0RRN5Vq6LHCR9V-9td_1YEn2yD8iGu8atvY,17459
|
|
42
42
|
chainlit/openai/__init__.py,sha256=DJP_ptclLUM5Zylr4RO1Vk0lCufo3yDqXyH5J9izYS8,1814
|
|
43
43
|
chainlit/playground/__init__.py,sha256=igNRcBgqLKPTjOQtTNhhGNJFmZn-Dl1fHRQzQSjDGTQ,80
|
|
@@ -51,22 +51,22 @@ chainlit/playground/providers/openai.py,sha256=9aDSgXVW3sW-gaybBBWMIE8cJPyk9ZuGv
|
|
|
51
51
|
chainlit/playground/providers/vertexai.py,sha256=zKy501f-MHnLrvuRzN50FqgB3xoHzfQFTVbw83Nsj20,5084
|
|
52
52
|
chainlit/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
53
53
|
chainlit/secret.py,sha256=cQvIFGTQ7r2heC8EOGdgifSZZYqslh-qQxhUhKhD8vU,295
|
|
54
|
-
chainlit/server.py,sha256=
|
|
54
|
+
chainlit/server.py,sha256=b1xeAknQrPICkPaLvpvQO5VRK4yhgq2HoCqCs6N788o,24757
|
|
55
55
|
chainlit/session.py,sha256=SOX2zFct3apiSNcIzCDWgDRsUFgUG_6hewqWU8gfIZE,9694
|
|
56
56
|
chainlit/slack/__init__.py,sha256=Q41ztJHeVmpoXVgVqAcwGOufQp_bjf7dDT7eEXDdhPI,207
|
|
57
|
-
chainlit/slack/app.py,sha256=
|
|
57
|
+
chainlit/slack/app.py,sha256=biQIOOM_--XeB_rvPMXdiYy6fKvcADcp6MZUP1Lfhfk,11649
|
|
58
58
|
chainlit/socket.py,sha256=KHabfdproCBlzF4VzLgtvqDA1xMB6_Xai6Ih6MZXogg,11703
|
|
59
|
-
chainlit/step.py,sha256=
|
|
59
|
+
chainlit/step.py,sha256=0uDQE0zTrhtvCQ3kdPuE2Uj6TYtIaWfzAGsyHmKEQl4,13931
|
|
60
60
|
chainlit/sync.py,sha256=G1n-7-3WgXsN8y1bJkEyws_YwmHZIyDZoZUwhprigag,1235
|
|
61
61
|
chainlit/telemetry.py,sha256=Rk4dnZv0OnGOgV4kD-VHdhgl4i7i3ypqhSE_R-LZceM,3060
|
|
62
62
|
chainlit/translations/en-US.json,sha256=uUuS4hlNoYSlDp0DZGTAlPZxwLfsP4Jiu4ckrfr-fI0,7835
|
|
63
63
|
chainlit/translations.py,sha256=WG_r7HzxBYns-zk9tVvoGdoofv71okTZx8k1RlcoTIg,2034
|
|
64
|
-
chainlit/types.py,sha256=
|
|
64
|
+
chainlit/types.py,sha256=drgPqbBMLlfHuMEkvRJSafahlS4DeBf4BnLKBWPh-vA,5386
|
|
65
65
|
chainlit/user.py,sha256=Cw4uGz0ffivWFszv8W__EHwkvTHQ3Lj9hqpRCPxFujo,619
|
|
66
66
|
chainlit/user_session.py,sha256=G1amgs1_h2tVn4mtAXZmunm9nlBHQ_rCYvJQh3nsVwQ,1645
|
|
67
67
|
chainlit/utils.py,sha256=ObNTLIhRDWcx1tHhpULUkpgWSJBlsi2USat2TLaaiTM,2604
|
|
68
68
|
chainlit/version.py,sha256=iosXhlXclBwBqlADFKEilxAC2wWKbtuBKi87AmPi7s8,196
|
|
69
|
-
chainlit-1.1.
|
|
70
|
-
chainlit-1.1.
|
|
71
|
-
chainlit-1.1.
|
|
72
|
-
chainlit-1.1.
|
|
69
|
+
chainlit-1.1.201.dist-info/METADATA,sha256=c0fGTuNmRXVDFiO8_76gmnMP6ojYiN4ZCefwvDSUmdc,5707
|
|
70
|
+
chainlit-1.1.201.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
71
|
+
chainlit-1.1.201.dist-info/entry_points.txt,sha256=FrkqdjrFl8juSnvBndniyX7XuKojmUwO4ghRh-CFMQc,45
|
|
72
|
+
chainlit-1.1.201.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|