chainlit 1.0.504__py3-none-any.whl → 1.0.505__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 +7 -3
- chainlit/copilot/dist/index.js +262 -262
- chainlit/data/__init__.py +36 -8
- chainlit/data/sql_alchemy.py +246 -144
- chainlit/emitter.py +19 -9
- chainlit/frontend/dist/assets/{index-a8e1b559.js → index-d200e7ad.js} +119 -119
- chainlit/frontend/dist/assets/{react-plotly-b225b63c.js → react-plotly-10f4012e.js} +1 -1
- chainlit/frontend/dist/index.html +1 -1
- chainlit/llama_index/callbacks.py +2 -3
- chainlit/openai/__init__.py +5 -9
- chainlit/session.py +4 -0
- chainlit/socket.py +5 -1
- chainlit/types.py +19 -1
- chainlit/user_session.py +1 -0
- {chainlit-1.0.504.dist-info → chainlit-1.0.505.dist-info}/METADATA +2 -2
- {chainlit-1.0.504.dist-info → chainlit-1.0.505.dist-info}/RECORD +18 -18
- {chainlit-1.0.504.dist-info → chainlit-1.0.505.dist-info}/WHEEL +0 -0
- {chainlit-1.0.504.dist-info → chainlit-1.0.505.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-d200e7ad.js"></script>
|
|
26
26
|
<link rel="stylesheet" href="/assets/index-d088547c.css">
|
|
27
27
|
</head>
|
|
28
28
|
<body>
|
|
@@ -196,10 +196,9 @@ class LlamaIndexCallbackHandler(TokenCountingHandler):
|
|
|
196
196
|
self.context.loop.create_task(step.update())
|
|
197
197
|
|
|
198
198
|
else:
|
|
199
|
-
step.output = payload
|
|
199
|
+
step.output = payload
|
|
200
200
|
self.context.loop.create_task(step.update())
|
|
201
|
-
|
|
202
|
-
|
|
201
|
+
|
|
203
202
|
self.steps.pop(event_id, None)
|
|
204
203
|
|
|
205
204
|
def _noop(self, *args, **kwargs):
|
chainlit/openai/__init__.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
from typing import Union
|
|
2
1
|
import asyncio
|
|
2
|
+
from typing import Union
|
|
3
|
+
|
|
3
4
|
from chainlit.context import get_context
|
|
4
5
|
from chainlit.step import Step
|
|
5
6
|
from chainlit.utils import check_module_version
|
|
@@ -15,7 +16,7 @@ def instrument_openai():
|
|
|
15
16
|
|
|
16
17
|
from literalai.instrumentation.openai import instrument_openai
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
def on_new_generation(
|
|
19
20
|
generation: Union["ChatGeneration", "CompletionGeneration"], timing
|
|
20
21
|
):
|
|
21
22
|
context = get_context()
|
|
@@ -51,11 +52,6 @@ def instrument_openai():
|
|
|
51
52
|
step.input = generation.prompt
|
|
52
53
|
step.output = generation.completion
|
|
53
54
|
|
|
54
|
-
|
|
55
|
+
asyncio.create_task(step.send())
|
|
55
56
|
|
|
56
|
-
|
|
57
|
-
generation: Union["ChatGeneration", "CompletionGeneration"], timing
|
|
58
|
-
):
|
|
59
|
-
asyncio.create_task(on_new_generation(generation, timing))
|
|
60
|
-
|
|
61
|
-
instrument_openai(None, on_new_generation_sync)
|
|
57
|
+
instrument_openai(None, on_new_generation)
|
chainlit/session.py
CHANGED
|
@@ -163,6 +163,8 @@ class WebsocketSession(BaseSession):
|
|
|
163
163
|
root_message: Optional["Message"] = None,
|
|
164
164
|
# Chat profile selected before the session was created
|
|
165
165
|
chat_profile: Optional[str] = None,
|
|
166
|
+
# Languages of the user's browser
|
|
167
|
+
languages: Optional[str] = None,
|
|
166
168
|
):
|
|
167
169
|
super().__init__(
|
|
168
170
|
id=id,
|
|
@@ -188,6 +190,8 @@ class WebsocketSession(BaseSession):
|
|
|
188
190
|
ws_sessions_id[self.id] = self
|
|
189
191
|
ws_sessions_sid[socket_id] = self
|
|
190
192
|
|
|
193
|
+
self.languages = languages
|
|
194
|
+
|
|
191
195
|
@property
|
|
192
196
|
def files_dir(self):
|
|
193
197
|
from chainlit.config import FILES_DIRECTORY
|
chainlit/socket.py
CHANGED
|
@@ -147,6 +147,7 @@ async def connect(sid, environ, auth):
|
|
|
147
147
|
token=token,
|
|
148
148
|
chat_profile=environ.get("HTTP_X_CHAINLIT_CHAT_PROFILE"),
|
|
149
149
|
thread_id=environ.get("HTTP_X_CHAINLIT_THREAD_ID"),
|
|
150
|
+
languages=environ.get("HTTP_ACCEPT_LANGUAGE"),
|
|
150
151
|
)
|
|
151
152
|
|
|
152
153
|
trace_event("connection_successful")
|
|
@@ -168,7 +169,10 @@ async def connection_successful(sid):
|
|
|
168
169
|
thread = await resume_thread(context.session)
|
|
169
170
|
if thread:
|
|
170
171
|
context.session.has_first_interaction = True
|
|
171
|
-
await context.emitter.emit(
|
|
172
|
+
await context.emitter.emit(
|
|
173
|
+
"first_interaction",
|
|
174
|
+
{"interaction": "resume", "thread_id": thread.get("id")},
|
|
175
|
+
)
|
|
172
176
|
await context.emitter.resume_thread(thread)
|
|
173
177
|
await config.code.on_chat_resume(thread)
|
|
174
178
|
return
|
chainlit/types.py
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
from enum import Enum
|
|
2
|
-
from typing import
|
|
2
|
+
from typing import (
|
|
3
|
+
TYPE_CHECKING,
|
|
4
|
+
Any,
|
|
5
|
+
Dict,
|
|
6
|
+
Generic,
|
|
7
|
+
List,
|
|
8
|
+
Literal,
|
|
9
|
+
Optional,
|
|
10
|
+
Protocol,
|
|
11
|
+
TypedDict,
|
|
12
|
+
TypeVar,
|
|
13
|
+
Union,
|
|
14
|
+
)
|
|
3
15
|
|
|
4
16
|
if TYPE_CHECKING:
|
|
5
17
|
from chainlit.element import ElementDict
|
|
@@ -37,6 +49,7 @@ class ThreadFilter(BaseModel):
|
|
|
37
49
|
userId: Optional[str] = None
|
|
38
50
|
search: Optional[str] = None
|
|
39
51
|
|
|
52
|
+
|
|
40
53
|
@dataclass
|
|
41
54
|
class PageInfo:
|
|
42
55
|
hasNextPage: bool
|
|
@@ -59,13 +72,16 @@ class PageInfo:
|
|
|
59
72
|
hasNextPage=hasNextPage, startCursor=startCursor, endCursor=endCursor
|
|
60
73
|
)
|
|
61
74
|
|
|
75
|
+
|
|
62
76
|
T = TypeVar("T", covariant=True)
|
|
63
77
|
|
|
78
|
+
|
|
64
79
|
class HasFromDict(Protocol[T]):
|
|
65
80
|
@classmethod
|
|
66
81
|
def from_dict(cls, obj_dict: Any) -> T:
|
|
67
82
|
raise NotImplementedError()
|
|
68
83
|
|
|
84
|
+
|
|
69
85
|
@dataclass
|
|
70
86
|
class PaginatedResponse(Generic[T]):
|
|
71
87
|
pageInfo: PageInfo
|
|
@@ -90,6 +106,7 @@ class PaginatedResponse(Generic[T]):
|
|
|
90
106
|
|
|
91
107
|
return cls(pageInfo=pageInfo, data=data)
|
|
92
108
|
|
|
109
|
+
|
|
93
110
|
@dataclass
|
|
94
111
|
class FileSpec(DataClassJsonMixin):
|
|
95
112
|
accept: Union[List[str], Dict[str, List[str]]]
|
|
@@ -196,6 +213,7 @@ class ChatProfile(DataClassJsonMixin):
|
|
|
196
213
|
name: str
|
|
197
214
|
markdown_description: str
|
|
198
215
|
icon: Optional[str] = None
|
|
216
|
+
default: bool = False
|
|
199
217
|
|
|
200
218
|
|
|
201
219
|
FeedbackStrategy = Literal["BINARY"]
|
chainlit/user_session.py
CHANGED
|
@@ -27,6 +27,7 @@ class UserSession:
|
|
|
27
27
|
user_session["chat_settings"] = context.session.chat_settings
|
|
28
28
|
user_session["user"] = context.session.user
|
|
29
29
|
user_session["chat_profile"] = context.session.chat_profile
|
|
30
|
+
user_session["languages"] = context.session.languages
|
|
30
31
|
|
|
31
32
|
if context.session.root_message:
|
|
32
33
|
user_session["root_message"] = context.session.root_message
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: chainlit
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.505
|
|
4
4
|
Summary: Build Conversational AI.
|
|
5
5
|
Home-page: https://github.com/Chainlit/chainlit
|
|
6
6
|
License: Apache-2.0 license
|
|
@@ -22,7 +22,7 @@ Requires-Dist: fastapi-socketio (>=0.0.10,<0.0.11)
|
|
|
22
22
|
Requires-Dist: filetype (>=1.2.0,<2.0.0)
|
|
23
23
|
Requires-Dist: httpx (>=0.23.0)
|
|
24
24
|
Requires-Dist: lazify (>=0.4.0,<0.5.0)
|
|
25
|
-
Requires-Dist: literalai (==0.0.
|
|
25
|
+
Requires-Dist: literalai (==0.0.507)
|
|
26
26
|
Requires-Dist: nest-asyncio (>=1.5.6,<2.0.0)
|
|
27
27
|
Requires-Dist: packaging (>=23.1,<24.0)
|
|
28
28
|
Requires-Dist: pydantic (>=1,<3)
|
|
@@ -6,24 +6,24 @@ 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=BH1YHdb7AMVCZzicN2-_bVFxqFxx6WeJanuabevIudo,15211
|
|
10
10
|
chainlit/context.py,sha256=CecWdRuRCTr4jfXlOiU3Mh41j3B-p40c1jC7mhToVzk,2476
|
|
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=
|
|
14
|
-
chainlit/data/__init__.py,sha256=
|
|
13
|
+
chainlit/copilot/dist/index.js,sha256=uexumeV5f43gVDofU-96FO0oul6XaZyMfz0g8ALtmlM,7016549
|
|
14
|
+
chainlit/data/__init__.py,sha256=oV4oRS9W3Yq4eyWQmxdfe3weN4S5XzoiyQo2U6Hkn78,16408
|
|
15
15
|
chainlit/data/acl.py,sha256=hx7Othkx12EitonyZD4iFIRVHwxBmBY2TKdwjPuZMSo,461
|
|
16
|
-
chainlit/data/sql_alchemy.py,sha256=
|
|
16
|
+
chainlit/data/sql_alchemy.py,sha256=7lSRR90MFkZAKX3FgRvj8lO1304irPI7x1rWeS6ZFcY,25867
|
|
17
17
|
chainlit/data/storage_clients.py,sha256=D9KY1XKDjZh2uuh01ECxeoEtjw-JlrCR-WCuOuePVQI,3007
|
|
18
18
|
chainlit/element.py,sha256=K5-yxiO2E0ZMRARKcXCNPnxsDKeLcBsXiZ5L-CGNp0A,10162
|
|
19
|
-
chainlit/emitter.py,sha256=
|
|
20
|
-
chainlit/frontend/dist/assets/index-a8e1b559.js,sha256=8D7TQaMsKRQrmhY2nNlZqwk5v5GsrlhKqjm4fiXnIv8,3072953
|
|
19
|
+
chainlit/emitter.py,sha256=JK9aQ6qbaY1G0eqwshMcLFS6T198LwZ7soXXQOFNvT4,12688
|
|
21
20
|
chainlit/frontend/dist/assets/index-d088547c.css,sha256=0IhUfCm_IY1kjvlTR2edW1qKXAFDya3LZ6mnZnP6ovk,6605
|
|
21
|
+
chainlit/frontend/dist/assets/index-d200e7ad.js,sha256=P4UpOBfxf0USRsqgTlpm_s1vgUiCLXuxX0YaHqrgPGM,3073876
|
|
22
22
|
chainlit/frontend/dist/assets/logo_dark-2a3cf740.svg,sha256=Kjz3QMh-oh-ag4YatjU0YCPqGF7F8nHh8VUQoJIs01E,8887
|
|
23
23
|
chainlit/frontend/dist/assets/logo_light-b078e7bc.svg,sha256=sHjnvEq1rfqh3bcexJNYUY7WEDdTQZq3aKZYpi4w4ck,8889
|
|
24
|
-
chainlit/frontend/dist/assets/react-plotly-
|
|
24
|
+
chainlit/frontend/dist/assets/react-plotly-10f4012e.js,sha256=ca9rlaKgMXi6TIMVfZVruS3biLS35obabzarJxRdk3w,3763471
|
|
25
25
|
chainlit/frontend/dist/favicon.svg,sha256=0Cy8x28obT5eWW3nxZRhsEvu6_zMqrqbg0y6hT3D0Q0,6455
|
|
26
|
-
chainlit/frontend/dist/index.html,sha256=
|
|
26
|
+
chainlit/frontend/dist/index.html,sha256=aUXd6qLUiHMPc9v2Lm4dyC83wVWvutapsN9oV8pf9ZI,1005
|
|
27
27
|
chainlit/haystack/__init__.py,sha256=uZ77YiPy-qleSTi3dQCDO9HE6S6F6GpJWmh7jO4cxXA,217
|
|
28
28
|
chainlit/haystack/callbacks.py,sha256=tItLc6OmskPeDEJH2Qjtg7KgAgIy1TuYQYHTZm9cr3U,5209
|
|
29
29
|
chainlit/hello.py,sha256=LwENQWo5s5r8nNDn4iKSV77vX60Ky5r_qGjQhyi7qlY,416
|
|
@@ -32,12 +32,12 @@ chainlit/langchain/__init__.py,sha256=zErMw0_3ufSGeF9ye7X0ZX3wDat4mTOx97T40ePDO2
|
|
|
32
32
|
chainlit/langchain/callbacks.py,sha256=bABLMuLx0h-It0zfB9tqcSeCAu_-uxMLgm2gPIGb4VY,20484
|
|
33
33
|
chainlit/langflow/__init__.py,sha256=wxhxdsl1yxdsRyNTgZticxFF_8VFtJJ4OdIy3tnEIyM,817
|
|
34
34
|
chainlit/llama_index/__init__.py,sha256=weRoIWCaRBGvA1LczCEfsqhWsltQSVlhtRnTovtdo8w,227
|
|
35
|
-
chainlit/llama_index/callbacks.py,sha256
|
|
35
|
+
chainlit/llama_index/callbacks.py,sha256=D3WAJ-Y-sj6JFo84mbbALh6ibuQS11bXvxe9_iIQcw4,7203
|
|
36
36
|
chainlit/logger.py,sha256=wTwRSZsLfXwWy6U4351IgWAm4KCMThgxm9EZpjGUEr4,373
|
|
37
37
|
chainlit/markdown.py,sha256=VUpqW7MqgjiPIQYHU4funwqC4GmHZBu_TGZTjTI4B0k,2025
|
|
38
38
|
chainlit/message.py,sha256=O9Qtw_5cDYA3TQVGyfbGwEeLLjpOoRIFe9LOedAkF_c,17974
|
|
39
39
|
chainlit/oauth_providers.py,sha256=WiKUFpNp0RRN5Vq6LHCR9V-9td_1YEn2yD8iGu8atvY,17459
|
|
40
|
-
chainlit/openai/__init__.py,sha256=
|
|
40
|
+
chainlit/openai/__init__.py,sha256=DJP_ptclLUM5Zylr4RO1Vk0lCufo3yDqXyH5J9izYS8,1814
|
|
41
41
|
chainlit/playground/__init__.py,sha256=igNRcBgqLKPTjOQtTNhhGNJFmZn-Dl1fHRQzQSjDGTQ,80
|
|
42
42
|
chainlit/playground/config.py,sha256=XtTXYqFfv0JnygZcywurXyY62v7zukVwxxpnYiZIQRs,948
|
|
43
43
|
chainlit/playground/provider.py,sha256=tU805uWOX6Tgh8rMoqVWdWqVq0nyylkrI8l2KZv2biw,3858
|
|
@@ -50,19 +50,19 @@ chainlit/playground/providers/vertexai.py,sha256=zKy501f-MHnLrvuRzN50FqgB3xoHzfQ
|
|
|
50
50
|
chainlit/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
51
51
|
chainlit/secret.py,sha256=cQvIFGTQ7r2heC8EOGdgifSZZYqslh-qQxhUhKhD8vU,295
|
|
52
52
|
chainlit/server.py,sha256=uhSAB3DdBmtuNnov2dFevdY_x_Pxa0148K16ut0uLEM,23856
|
|
53
|
-
chainlit/session.py,sha256=
|
|
54
|
-
chainlit/socket.py,sha256=
|
|
53
|
+
chainlit/session.py,sha256=zive8e9ZZggHoU6VQpS40fMIKwvmhI6p_pEO_S5slis,8963
|
|
54
|
+
chainlit/socket.py,sha256=tTKbOwcoDffTedQAHjb9tMX2I-pDiXF0pkJmAd26eTk,10145
|
|
55
55
|
chainlit/step.py,sha256=JdXVqG73d9kNtHJjLhmfo1mqkCYtgqfF3jm08uGaCMs,13102
|
|
56
56
|
chainlit/sync.py,sha256=G1n-7-3WgXsN8y1bJkEyws_YwmHZIyDZoZUwhprigag,1235
|
|
57
57
|
chainlit/telemetry.py,sha256=Rk4dnZv0OnGOgV4kD-VHdhgl4i7i3ypqhSE_R-LZceM,3060
|
|
58
58
|
chainlit/translations/en-US.json,sha256=uUuS4hlNoYSlDp0DZGTAlPZxwLfsP4Jiu4ckrfr-fI0,7835
|
|
59
59
|
chainlit/translations.py,sha256=WG_r7HzxBYns-zk9tVvoGdoofv71okTZx8k1RlcoTIg,2034
|
|
60
|
-
chainlit/types.py,sha256=
|
|
60
|
+
chainlit/types.py,sha256=1Z3hRc8zHO5E1zy4hYOPfSfUOugDQDAEQz5WCGXwBtc,5027
|
|
61
61
|
chainlit/user.py,sha256=Cw4uGz0ffivWFszv8W__EHwkvTHQ3Lj9hqpRCPxFujo,619
|
|
62
|
-
chainlit/user_session.py,sha256=
|
|
62
|
+
chainlit/user_session.py,sha256=BOpkDC7cxjmkCVS9QOBMMAQiQlhQ2iar7LnzuNI8Nfk,1430
|
|
63
63
|
chainlit/utils.py,sha256=3HzhfZ4XJhBIe9sJ_3Lxv3lMH4mFXsi6nLBGqm8Gtdw,2571
|
|
64
64
|
chainlit/version.py,sha256=iosXhlXclBwBqlADFKEilxAC2wWKbtuBKi87AmPi7s8,196
|
|
65
|
-
chainlit-1.0.
|
|
66
|
-
chainlit-1.0.
|
|
67
|
-
chainlit-1.0.
|
|
68
|
-
chainlit-1.0.
|
|
65
|
+
chainlit-1.0.505.dist-info/METADATA,sha256=V2robReLxXrHKYkkvoAl6jreJHzKFSHbN0loW3YMcGs,5560
|
|
66
|
+
chainlit-1.0.505.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
67
|
+
chainlit-1.0.505.dist-info/entry_points.txt,sha256=FrkqdjrFl8juSnvBndniyX7XuKojmUwO4ghRh-CFMQc,45
|
|
68
|
+
chainlit-1.0.505.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|