chainlit 1.0.0rc1__py3-none-any.whl → 1.0.0rc2__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/data/__init__.py +3 -0
- chainlit/emitter.py +11 -3
- chainlit/frontend/dist/assets/{index-6aee009a.js → index-aac0232b.js} +117 -117
- chainlit/frontend/dist/assets/{index-8942cb2d.css → index-d088547c.css} +1 -1
- chainlit/frontend/dist/assets/{react-plotly-2f07c02a.js → react-plotly-ae26362f.js} +1 -1
- chainlit/frontend/dist/index.html +2 -2
- chainlit/message.py +2 -2
- chainlit/playground/providers/langchain.py +1 -1
- chainlit/server.py +5 -2
- chainlit/step.py +17 -2
- {chainlit-1.0.0rc1.dist-info → chainlit-1.0.0rc2.dist-info}/METADATA +4 -3
- {chainlit-1.0.0rc1.dist-info → chainlit-1.0.0rc2.dist-info}/RECORD +14 -14
- {chainlit-1.0.0rc1.dist-info → chainlit-1.0.0rc2.dist-info}/WHEEL +0 -0
- {chainlit-1.0.0rc1.dist-info → chainlit-1.0.0rc2.dist-info}/entry_points.txt +0 -0
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
<script>
|
|
21
21
|
const global = globalThis;
|
|
22
22
|
</script>
|
|
23
|
-
<script type="module" crossorigin src="/assets/index-
|
|
24
|
-
<link rel="stylesheet" href="/assets/index-
|
|
23
|
+
<script type="module" crossorigin src="/assets/index-aac0232b.js"></script>
|
|
24
|
+
<link rel="stylesheet" href="/assets/index-d088547c.css">
|
|
25
25
|
</head>
|
|
26
26
|
<body>
|
|
27
27
|
<div id="root"></div>
|
chainlit/message.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import asyncio
|
|
2
2
|
import json
|
|
3
|
+
import time
|
|
3
4
|
import uuid
|
|
4
5
|
from abc import ABC
|
|
5
6
|
from datetime import datetime
|
|
@@ -146,7 +147,6 @@ class MessageBase(ABC):
|
|
|
146
147
|
async def send(self):
|
|
147
148
|
if not self.created_at:
|
|
148
149
|
self.created_at = datetime.utcnow().isoformat()
|
|
149
|
-
|
|
150
150
|
if self.content is None:
|
|
151
151
|
self.content = ""
|
|
152
152
|
|
|
@@ -157,7 +157,6 @@ class MessageBase(ABC):
|
|
|
157
157
|
self.streaming = False
|
|
158
158
|
|
|
159
159
|
step_dict = await self._create()
|
|
160
|
-
|
|
161
160
|
await context.emitter.send_step(step_dict)
|
|
162
161
|
|
|
163
162
|
return self.id
|
|
@@ -209,6 +208,7 @@ class Message(MessageBase):
|
|
|
209
208
|
id: Optional[str] = None,
|
|
210
209
|
created_at: Union[str, None] = None,
|
|
211
210
|
):
|
|
211
|
+
time.sleep(0.001)
|
|
212
212
|
self.language = language
|
|
213
213
|
|
|
214
214
|
if isinstance(content, dict):
|
|
@@ -56,7 +56,7 @@ class LangchainGenericProvider(BaseProvider):
|
|
|
56
56
|
return self.prompt_message_to_langchain_message(message)
|
|
57
57
|
|
|
58
58
|
def message_to_string(self, message: BaseMessage) -> str: # type: ignore[override]
|
|
59
|
-
return message.content
|
|
59
|
+
return str(message.content)
|
|
60
60
|
|
|
61
61
|
async def create_completion(self, request):
|
|
62
62
|
from langchain.schema.messages import BaseMessageChunk
|
chainlit/server.py
CHANGED
|
@@ -3,7 +3,7 @@ import json
|
|
|
3
3
|
import mimetypes
|
|
4
4
|
import shutil
|
|
5
5
|
import urllib.parse
|
|
6
|
-
from typing import Optional, Union
|
|
6
|
+
from typing import Any, Optional, Union
|
|
7
7
|
|
|
8
8
|
from chainlit.oauth_providers import get_oauth_provider
|
|
9
9
|
from chainlit.secret import random_secret
|
|
@@ -317,7 +317,10 @@ async def oauth_login(provider_id: str, request: Request):
|
|
|
317
317
|
response = RedirectResponse(
|
|
318
318
|
url=f"{provider.authorize_url}?{params}",
|
|
319
319
|
)
|
|
320
|
-
|
|
320
|
+
samesite = os.environ.get("CHAINLIT_COOKIE_SAMESITE", "lax") # type: Any
|
|
321
|
+
response.set_cookie(
|
|
322
|
+
"oauth_state", random, httponly=True, samesite=samesite, max_age=3 * 60
|
|
323
|
+
)
|
|
321
324
|
return response
|
|
322
325
|
|
|
323
326
|
|
chainlit/step.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import asyncio
|
|
2
2
|
import inspect
|
|
3
3
|
import json
|
|
4
|
+
import time
|
|
4
5
|
import uuid
|
|
5
6
|
from datetime import datetime
|
|
6
7
|
from functools import wraps
|
|
@@ -158,6 +159,7 @@ class Step:
|
|
|
158
159
|
show_input: Union[bool, str] = False,
|
|
159
160
|
):
|
|
160
161
|
trace_event(f"init {self.__class__.__name__} {type}")
|
|
162
|
+
time.sleep(0.001)
|
|
161
163
|
self._input = ""
|
|
162
164
|
self._output = ""
|
|
163
165
|
self.thread_id = context.session.thread_id
|
|
@@ -264,6 +266,9 @@ class Step:
|
|
|
264
266
|
tasks = [el.send(for_id=self.id) for el in self.elements]
|
|
265
267
|
await asyncio.gather(*tasks)
|
|
266
268
|
|
|
269
|
+
if config.ui.hide_cot and self.parent_id:
|
|
270
|
+
return
|
|
271
|
+
|
|
267
272
|
if not config.features.prompt_playground and "generation" in step_dict:
|
|
268
273
|
step_dict.pop("generation", None)
|
|
269
274
|
|
|
@@ -318,6 +323,9 @@ class Step:
|
|
|
318
323
|
tasks = [el.send(for_id=self.id) for el in self.elements]
|
|
319
324
|
await asyncio.gather(*tasks)
|
|
320
325
|
|
|
326
|
+
if config.ui.hide_cot and self.parent_id:
|
|
327
|
+
return self.id
|
|
328
|
+
|
|
321
329
|
if not config.features.prompt_playground and "generation" in step_dict:
|
|
322
330
|
step_dict.pop("generation", None)
|
|
323
331
|
|
|
@@ -342,6 +350,10 @@ class Step:
|
|
|
342
350
|
self.output += token
|
|
343
351
|
|
|
344
352
|
assert self.id
|
|
353
|
+
|
|
354
|
+
if config.ui.hide_cot and self.parent_id:
|
|
355
|
+
return
|
|
356
|
+
|
|
345
357
|
await context.emitter.send_token(
|
|
346
358
|
id=self.id, token=token, is_sequence=is_sequence
|
|
347
359
|
)
|
|
@@ -372,7 +384,9 @@ class Step:
|
|
|
372
384
|
|
|
373
385
|
async def __aexit__(self, exc_type, exc_val, exc_tb):
|
|
374
386
|
self.end = datetime.utcnow().isoformat()
|
|
375
|
-
|
|
387
|
+
|
|
388
|
+
if self in context.session.active_steps:
|
|
389
|
+
context.session.active_steps.remove(self)
|
|
376
390
|
await self.update()
|
|
377
391
|
|
|
378
392
|
def __enter__(self):
|
|
@@ -389,5 +403,6 @@ class Step:
|
|
|
389
403
|
|
|
390
404
|
def __exit__(self, exc_type, exc_val, exc_tb):
|
|
391
405
|
self.end = datetime.utcnow().isoformat()
|
|
392
|
-
context.session.active_steps
|
|
406
|
+
if self in context.session.active_steps:
|
|
407
|
+
context.session.active_steps.remove(self)
|
|
393
408
|
asyncio.create_task(self.update())
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: chainlit
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.0rc2
|
|
4
4
|
Summary: A faster way to build chatbot UIs.
|
|
5
5
|
Home-page: https://github.com/Chainlit/chainlit
|
|
6
6
|
License: Apache-2.0 license
|
|
7
7
|
Keywords: LLM,Agents,gen ai,chat ui,chatbot ui,langchain
|
|
8
8
|
Author: Chainlit
|
|
9
|
-
Requires-Python: >=3.8.1,<
|
|
9
|
+
Requires-Python: >=3.8.1,<4.0.0
|
|
10
10
|
Classifier: License :: Other/Proprietary License
|
|
11
11
|
Classifier: Programming Language :: Python :: 3
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.9
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.10
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
16
|
Requires-Dist: aiofiles (>=23.1.0,<24.0.0)
|
|
16
17
|
Requires-Dist: asyncer (>=0.0.2,<0.0.3)
|
|
17
|
-
Requires-Dist: chainlit_client (==0.1.
|
|
18
|
+
Requires-Dist: chainlit_client (==0.1.0rc7)
|
|
18
19
|
Requires-Dist: click (>=8.1.3,<9.0.0)
|
|
19
20
|
Requires-Dist: dataclasses_json (>=0.5.7,<0.6.0)
|
|
20
21
|
Requires-Dist: fastapi (>=0.100,<0.101)
|
|
@@ -8,17 +8,17 @@ chainlit/cli/__init__.py,sha256=aMynTbqbJEvxkoIzDjsdKL6wJ0HFgLfVrbxFkwqp1FU,4733
|
|
|
8
8
|
chainlit/cli/utils.py,sha256=mE2d9oOk-B2b9ZvDV1zENoDWxjfMriGP7bVwEFduZP4,717
|
|
9
9
|
chainlit/config.py,sha256=2DaQ51jHKHdwAH0yNbB3HkJhccU99eOqDXxvk19A1jU,10577
|
|
10
10
|
chainlit/context.py,sha256=Su3eabnD2sgLNx5IwlxEpG4pev64GLi-GlvbE5Mw7sM,2264
|
|
11
|
-
chainlit/data/__init__.py,sha256=
|
|
11
|
+
chainlit/data/__init__.py,sha256=eSe43GzxTVP76S_gqlt0_Dx-OI1oawTPj6Xflzl_tu0,12998
|
|
12
12
|
chainlit/data/acl.py,sha256=hx7Othkx12EitonyZD4iFIRVHwxBmBY2TKdwjPuZMSo,461
|
|
13
13
|
chainlit/element.py,sha256=9dVK7frFjJvmmONWAZTU1LWvim3c4woisy9zX9iEH-s,10010
|
|
14
|
-
chainlit/emitter.py,sha256=
|
|
15
|
-
chainlit/frontend/dist/assets/index-
|
|
16
|
-
chainlit/frontend/dist/assets/index-
|
|
14
|
+
chainlit/emitter.py,sha256=jlspcgybqohJWXi7LpYJb8olTjapaS5hap2DpAFEzTQ,11073
|
|
15
|
+
chainlit/frontend/dist/assets/index-aac0232b.js,sha256=XKLNntNzRIkMPYgrvVdNXzPBvIN_2IscdjKS9kACH2k,3096833
|
|
16
|
+
chainlit/frontend/dist/assets/index-d088547c.css,sha256=0IhUfCm_IY1kjvlTR2edW1qKXAFDya3LZ6mnZnP6ovk,6605
|
|
17
17
|
chainlit/frontend/dist/assets/logo_dark-bc7401f6.svg,sha256=vHQB9g-n5OqOmuH3Fduuc7ZMg0EmMsGyO9cEnYwLbHg,8889
|
|
18
18
|
chainlit/frontend/dist/assets/logo_light-f19fc2ea.svg,sha256=8Z_C6t-0V9QL9ldmLjaLfp2REcGDuaTeNynj6-6muNI,8891
|
|
19
|
-
chainlit/frontend/dist/assets/react-plotly-
|
|
19
|
+
chainlit/frontend/dist/assets/react-plotly-ae26362f.js,sha256=3v7FFla-SjPPNhN8By6T0H5YqdmGCepH4qeJ6OGhv48,3739251
|
|
20
20
|
chainlit/frontend/dist/favicon.svg,sha256=0Cy8x28obT5eWW3nxZRhsEvu6_zMqrqbg0y6hT3D0Q0,6455
|
|
21
|
-
chainlit/frontend/dist/index.html,sha256=
|
|
21
|
+
chainlit/frontend/dist/index.html,sha256=w1KFM0tp-QkuHE7jgjU-37gdspcYp2Aln02mEoGwy_0,959
|
|
22
22
|
chainlit/haystack/__init__.py,sha256=uZ77YiPy-qleSTi3dQCDO9HE6S6F6GpJWmh7jO4cxXA,217
|
|
23
23
|
chainlit/haystack/callbacks.py,sha256=0tbevNVa5hqN7Num6PGwm_DU_-ZdhfsVp9srKciotNE,4055
|
|
24
24
|
chainlit/hello.py,sha256=LwENQWo5s5r8nNDn4iKSV77vX60Ky5r_qGjQhyi7qlY,416
|
|
@@ -30,7 +30,7 @@ chainlit/llama_index/__init__.py,sha256=c7wIUZmKTtZPU9zpdGpKTHctQaBWTuRGqTN0kkIk
|
|
|
30
30
|
chainlit/llama_index/callbacks.py,sha256=BAFyoL2VkoG5pt6_GHMJ58Xu39_T-trhBYL14XVsvWU,5595
|
|
31
31
|
chainlit/logger.py,sha256=wTwRSZsLfXwWy6U4351IgWAm4KCMThgxm9EZpjGUEr4,373
|
|
32
32
|
chainlit/markdown.py,sha256=L2IPPWxIlrhJZcKPfO1akomHdN3sgC2EvC2ilxR8MQs,1624
|
|
33
|
-
chainlit/message.py,sha256
|
|
33
|
+
chainlit/message.py,sha256=UGT22iZgWi99IfgXwvbbc7_HOEfQxZYOHynOZClaeUc,17506
|
|
34
34
|
chainlit/oauth_providers.py,sha256=M-kV0rq4HwhDHvzdVc7YvAV4xPj5ecHvWniMMUTJAOM,15209
|
|
35
35
|
chainlit/playground/__init__.py,sha256=igNRcBgqLKPTjOQtTNhhGNJFmZn-Dl1fHRQzQSjDGTQ,80
|
|
36
36
|
chainlit/playground/config.py,sha256=a6fnIU2IrYQDKU6zHF8qUD3ssUBD9UiTEN10pMxgnGY,998
|
|
@@ -38,15 +38,15 @@ chainlit/playground/provider.py,sha256=mO4mC--c4LXOYWBvNWse90iTD3288yd5TVuIeqSVO
|
|
|
38
38
|
chainlit/playground/providers/__init__.py,sha256=L4Y7Udpexm769Jnf-mIeN-YGh6xaaMjF3rPxSfReiN4,225
|
|
39
39
|
chainlit/playground/providers/anthropic.py,sha256=Fcozvo4I_hguOuQbI4XgdR8Y03SNNv9PhHZrVXm_4ZE,3447
|
|
40
40
|
chainlit/playground/providers/huggingface.py,sha256=AmBmIzvfqBjswEI40jifb0OrMQkTk5rXCkGX7nMJ-bk,2130
|
|
41
|
-
chainlit/playground/providers/langchain.py,sha256=
|
|
41
|
+
chainlit/playground/providers/langchain.py,sha256=tS4z66CZKdT9ZzwbyrfcpBIzpjD3vS0r6kp8v0xjlMY,2818
|
|
42
42
|
chainlit/playground/providers/openai.py,sha256=61Rr_JqfrI5x3CoTdQUvcMm_Q2aXwIuD9aHKvfXvlEY,12593
|
|
43
43
|
chainlit/playground/providers/vertexai.py,sha256=TwFyhNmbStUso0ShvoRzOQ5b4l8ErG1szxqjv4IRXE0,3678
|
|
44
44
|
chainlit/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
45
45
|
chainlit/secret.py,sha256=0MXq8YxTeL93K8IyAew5UgZmIIw9_yJ_Kg4iML6cdVM,296
|
|
46
|
-
chainlit/server.py,sha256=
|
|
46
|
+
chainlit/server.py,sha256=CEA1pt_RKhDxkE9tWvYvfOGRZ2A0oWMnPEsOO0Y-3eY,20788
|
|
47
47
|
chainlit/session.py,sha256=x5Wsid7yO3O6tbQCKLP-cP19wRK-NsnX0bkftL9S8ls,8336
|
|
48
48
|
chainlit/socket.py,sha256=vPdAkSoIEKvGu3LuG7y7JP6IZFgFAk5dPW-t1aK6DB8,9066
|
|
49
|
-
chainlit/step.py,sha256=
|
|
49
|
+
chainlit/step.py,sha256=MrdylfS6ZEjmpBKoOyJga7MrCB7x2gv1YT1cUjsBLtg,12184
|
|
50
50
|
chainlit/sync.py,sha256=G1n-7-3WgXsN8y1bJkEyws_YwmHZIyDZoZUwhprigag,1235
|
|
51
51
|
chainlit/telemetry.py,sha256=sIZzYk0YEmtWbOS8B5tf6aQfW-uKzwvVtajpbj8bLMw,3210
|
|
52
52
|
chainlit/types.py,sha256=zEuxivoNAZg_3BzcWwGPpqz1xX8AoZQYpyWm9e8ZGTk,3361
|
|
@@ -54,7 +54,7 @@ chainlit/user.py,sha256=Cw4uGz0ffivWFszv8W__EHwkvTHQ3Lj9hqpRCPxFujo,619
|
|
|
54
54
|
chainlit/user_session.py,sha256=nyPx8vSICP8BhpPcW5h9vbHVf9ixj39SrkvJBUI_6zs,1368
|
|
55
55
|
chainlit/utils.py,sha256=3HzhfZ4XJhBIe9sJ_3Lxv3lMH4mFXsi6nLBGqm8Gtdw,2571
|
|
56
56
|
chainlit/version.py,sha256=iosXhlXclBwBqlADFKEilxAC2wWKbtuBKi87AmPi7s8,196
|
|
57
|
-
chainlit-1.0.
|
|
58
|
-
chainlit-1.0.
|
|
59
|
-
chainlit-1.0.
|
|
60
|
-
chainlit-1.0.
|
|
57
|
+
chainlit-1.0.0rc2.dist-info/METADATA,sha256=K2pUT8ICwvINenTZp0mDUbyemfQLCxUhpfPGrdbRbIc,5560
|
|
58
|
+
chainlit-1.0.0rc2.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
|
59
|
+
chainlit-1.0.0rc2.dist-info/entry_points.txt,sha256=FrkqdjrFl8juSnvBndniyX7XuKojmUwO4ghRh-CFMQc,45
|
|
60
|
+
chainlit-1.0.0rc2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|