chainlit 1.0.401__py3-none-any.whl → 1.0.501__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.

@@ -0,0 +1,60 @@
1
+ # TODO:
2
+ # - Support linting plural
3
+ # - Support interpolation
4
+
5
+
6
+ def compare_json_structures(truth, to_compare, path=""):
7
+ """
8
+ Compare the structure of two deeply nested JSON objects.
9
+ Args:
10
+ truth (dict): The 'truth' JSON object.
11
+ to_compare (dict): The 'to_compare' JSON object.
12
+ path (str): The current path for error reporting (used internally).
13
+ Returns:
14
+ A list of differences found.
15
+ """
16
+ if not isinstance(truth, dict) or not isinstance(to_compare, dict):
17
+ raise ValueError("Both inputs must be dictionaries.")
18
+
19
+ errors = []
20
+
21
+ truth_keys = set(truth.keys())
22
+ to_compare_keys = set(to_compare.keys())
23
+
24
+ extra_keys = to_compare_keys - truth_keys
25
+ missing_keys = truth_keys - to_compare_keys
26
+
27
+ for key in extra_keys:
28
+ errors.append(f"⚠️ Extra key: '{path + '.' + key if path else key}'")
29
+
30
+ for key in missing_keys:
31
+ errors.append(f"❌ Missing key: '{path + '.' + key if path else key}'")
32
+
33
+ for key in truth_keys & to_compare_keys:
34
+ if isinstance(truth[key], dict) and isinstance(to_compare[key], dict):
35
+ # Recursive call to navigate through nested dictionaries
36
+ errors += compare_json_structures(
37
+ truth[key], to_compare[key], path + "." + key if path else key
38
+ )
39
+ elif not isinstance(truth[key], dict) and not isinstance(to_compare[key], dict):
40
+ # If both are not dicts, we are at leaf nodes and structure matches; skip value comparison
41
+ continue
42
+ else:
43
+ # Structure mismatch: one is a dict, the other is not
44
+ errors.append(
45
+ f"❌ Structure mismatch at: '{path + '.' + key if path else key}'"
46
+ )
47
+
48
+ return errors
49
+
50
+
51
+ def lint_translation_json(file, truth, to_compare):
52
+ print(f"\nLinting {file}...")
53
+
54
+ errors = compare_json_structures(truth, to_compare)
55
+
56
+ if errors:
57
+ for error in errors:
58
+ print(f"{error}")
59
+ else:
60
+ print(f"✅ No errors found in {file}")
chainlit/types.py CHANGED
@@ -3,7 +3,6 @@ from typing import TYPE_CHECKING, Dict, List, Literal, Optional, TypedDict, Unio
3
3
 
4
4
  if TYPE_CHECKING:
5
5
  from chainlit.element import ElementDict
6
- from chainlit.user import UserDict
7
6
  from chainlit.step import StepDict
8
7
 
9
8
  from dataclasses_json import DataClassJsonMixin
@@ -20,7 +19,8 @@ class ThreadDict(TypedDict):
20
19
  id: str
21
20
  createdAt: str
22
21
  name: Optional[str]
23
- user: Optional["UserDict"]
22
+ userId: Optional[str]
23
+ userIdentifier: Optional[str]
24
24
  tags: Optional[List[str]]
25
25
  metadata: Optional[Dict]
26
26
  steps: List["StepDict"]
@@ -33,8 +33,8 @@ class Pagination(BaseModel):
33
33
 
34
34
 
35
35
  class ThreadFilter(BaseModel):
36
- feedback: Optional[Literal[-1, 0, 1]] = None
37
- userIdentifier: Optional[str] = None
36
+ feedback: Optional[Literal[0, 1]] = None
37
+ userId: Optional[str] = None
38
38
  search: Optional[str] = None
39
39
 
40
40
 
@@ -123,6 +123,10 @@ class DeleteThreadRequest(BaseModel):
123
123
  threadId: str
124
124
 
125
125
 
126
+ class DeleteFeedbackRequest(BaseModel):
127
+ feedbackId: str
128
+
129
+
126
130
  class GetThreadsRequest(BaseModel):
127
131
  pagination: Pagination
128
132
  filter: ThreadFilter
@@ -146,16 +150,16 @@ FeedbackStrategy = Literal["BINARY"]
146
150
 
147
151
 
148
152
  class FeedbackDict(TypedDict):
149
- value: Literal[-1, 0, 1]
150
- strategy: FeedbackStrategy
153
+ forId: str
154
+ id: Optional[str]
155
+ value: Literal[0, 1]
151
156
  comment: Optional[str]
152
157
 
153
158
 
154
159
  @dataclass
155
160
  class Feedback:
156
161
  forId: str
157
- value: Literal[-1, 0, 1]
158
- strategy: FeedbackStrategy = "BINARY"
162
+ value: Literal[0, 1]
159
163
  id: Optional[str] = None
160
164
  comment: Optional[str] = None
161
165
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: chainlit
3
- Version: 1.0.401
3
+ Version: 1.0.501
4
4
  Summary: Build Conversational AI.
5
5
  Home-page: https://github.com/Chainlit/chainlit
6
6
  License: Apache-2.0 license
@@ -17,12 +17,12 @@ Requires-Dist: aiofiles (>=23.1.0,<24.0.0)
17
17
  Requires-Dist: asyncer (>=0.0.2,<0.0.3)
18
18
  Requires-Dist: click (>=8.1.3,<9.0.0)
19
19
  Requires-Dist: dataclasses_json (>=0.5.7,<0.6.0)
20
- Requires-Dist: fastapi (>=0.100)
20
+ Requires-Dist: fastapi (>=0.110.1,<0.111.0)
21
21
  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.300)
25
+ Requires-Dist: literalai (==0.0.500)
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)
@@ -30,7 +30,7 @@ Requires-Dist: pyjwt (>=2.8.0,<3.0.0)
30
30
  Requires-Dist: python-dotenv (>=1.0.0,<2.0.0)
31
31
  Requires-Dist: python-graphql-client (>=0.4.3,<0.5.0)
32
32
  Requires-Dist: python-multipart (>=0.0.9,<0.0.10)
33
- Requires-Dist: starlette (<0.33.0)
33
+ Requires-Dist: starlette (>=0.37.2,<0.38.0)
34
34
  Requires-Dist: syncer (>=2.0.3,<3.0.0)
35
35
  Requires-Dist: tomli (>=2.0.1,<3.0.0)
36
36
  Requires-Dist: uptrace (>=1.22.0,<2.0.0)
@@ -4,63 +4,63 @@ chainlit/action.py,sha256=k-GsblVHI4DnDWFyF-RZgq3KfdfAFICFh2OBeU4w8N8,1410
4
4
  chainlit/auth.py,sha256=lLHePwmwKzX0LiWqpTAtKTdSecrDLqCMSY9Yw4c-TD8,2681
5
5
  chainlit/cache.py,sha256=Bv3dT4eHhE6Fq3c6Do0ZTpiyoXgXYewdxTgpYghEd9g,1361
6
6
  chainlit/chat_settings.py,sha256=2ByenmwS8O6jQjDVJjhhbLrBPGA5aY2F7R3VvQQxXPk,877
7
- chainlit/cli/__init__.py,sha256=aMynTbqbJEvxkoIzDjsdKL6wJ0HFgLfVrbxFkwqp1FU,4733
7
+ chainlit/cli/__init__.py,sha256=xlvuod2i42fmC-6Ge3EomOi-CFpE77rxoBoI-tWm4uI,4949
8
8
  chainlit/cli/utils.py,sha256=mE2d9oOk-B2b9ZvDV1zENoDWxjfMriGP7bVwEFduZP4,717
9
- chainlit/config.py,sha256=hTy3JaWgmk8eraVgxVFgvGE29NOOkYQYum6hzey8v9E,12881
9
+ chainlit/config.py,sha256=5vGp8rPIMZhO58cd1mNn2O5lZF2lcBbpq5rGDMIUJVk,15066
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=LpDTMaqn4ucf2wnaQDn2F4mJ-lPl2OnqaXbNiqgFTAQ,7174819
14
- chainlit/data/__init__.py,sha256=dTtCuPz7Y56q5-n7v4IzIU4EkkemiEUChxMIl8h8mqk,14683
13
+ chainlit/copilot/dist/index.js,sha256=5fpVkoFSGS8HybSjPvjWJBLSjGKCN1uFuMtufy78ZfQ,7015695
14
+ chainlit/data/__init__.py,sha256=BpLeWSEMOsMN9JuyKxc4LSzXviNt68RDBayu_c7ccV4,15588
15
15
  chainlit/data/acl.py,sha256=hx7Othkx12EitonyZD4iFIRVHwxBmBY2TKdwjPuZMSo,461
16
16
  chainlit/element.py,sha256=K5-yxiO2E0ZMRARKcXCNPnxsDKeLcBsXiZ5L-CGNp0A,10162
17
17
  chainlit/emitter.py,sha256=QOB4HNCOwL5x1EVBwuKceiGDtcml8Nr9TsvpSFCntoU,12178
18
- chainlit/frontend/dist/assets/index-9711593e.js,sha256=LX03YcrVpCc-pMoW6K87XH3gghJz380ulVfsB8iaoHg,3250320
19
18
  chainlit/frontend/dist/assets/index-d088547c.css,sha256=0IhUfCm_IY1kjvlTR2edW1qKXAFDya3LZ6mnZnP6ovk,6605
19
+ chainlit/frontend/dist/assets/index-e306c2e5.js,sha256=xr7IyXFh4_dNdnVp9tJxtyLXysHW_1DVpyK8BD0JDXM,3072941
20
20
  chainlit/frontend/dist/assets/logo_dark-2a3cf740.svg,sha256=Kjz3QMh-oh-ag4YatjU0YCPqGF7F8nHh8VUQoJIs01E,8887
21
21
  chainlit/frontend/dist/assets/logo_light-b078e7bc.svg,sha256=sHjnvEq1rfqh3bcexJNYUY7WEDdTQZq3aKZYpi4w4ck,8889
22
- chainlit/frontend/dist/assets/react-plotly-d8762cc2.js,sha256=9cWjlf_pouDsP2Bgwna7C94cuCvD_zwr4zq29E-hedk,3739251
22
+ chainlit/frontend/dist/assets/react-plotly-cc656f1c.js,sha256=8qygrxBoKy-nEkZ6r1iYUVgDPsc5F9FIHR03uQSe35E,3763471
23
23
  chainlit/frontend/dist/favicon.svg,sha256=0Cy8x28obT5eWW3nxZRhsEvu6_zMqrqbg0y6hT3D0Q0,6455
24
- chainlit/frontend/dist/index.html,sha256=MMFp2Ha-jsBtRF2hc4_k_i5r-coAyaoX9pOXpiMvHPw,1005
24
+ chainlit/frontend/dist/index.html,sha256=xvVRWHyL7YkrPGKt7-UO8Qzso0AHsR1rCfA3rXKNPeU,1005
25
25
  chainlit/haystack/__init__.py,sha256=uZ77YiPy-qleSTi3dQCDO9HE6S6F6GpJWmh7jO4cxXA,217
26
26
  chainlit/haystack/callbacks.py,sha256=tItLc6OmskPeDEJH2Qjtg7KgAgIy1TuYQYHTZm9cr3U,5209
27
27
  chainlit/hello.py,sha256=LwENQWo5s5r8nNDn4iKSV77vX60Ky5r_qGjQhyi7qlY,416
28
28
  chainlit/input_widget.py,sha256=1Z1qn3YwaZ7upqqxZXtbfDxBlVobDjbZ3HtlNOj-U3E,4880
29
29
  chainlit/langchain/__init__.py,sha256=zErMw0_3ufSGeF9ye7X0ZX3wDat4mTOx97T40ePDO2g,217
30
- chainlit/langchain/callbacks.py,sha256=LqmbFL41jpTR4T89RLQYriwAptCDMt1s_ak5JPOKLCM,20454
30
+ chainlit/langchain/callbacks.py,sha256=bABLMuLx0h-It0zfB9tqcSeCAu_-uxMLgm2gPIGb4VY,20484
31
31
  chainlit/langflow/__init__.py,sha256=wxhxdsl1yxdsRyNTgZticxFF_8VFtJJ4OdIy3tnEIyM,817
32
32
  chainlit/llama_index/__init__.py,sha256=weRoIWCaRBGvA1LczCEfsqhWsltQSVlhtRnTovtdo8w,227
33
- chainlit/llama_index/callbacks.py,sha256=K2PpqA2w9UBVwq2R1DAzPBMMUBHDjhUvsQBagjZexZI,6078
33
+ chainlit/llama_index/callbacks.py,sha256=-qCTM6GlFr1VYFMeorGxVX6iHHJYQ4XreTe7qw5w9bc,7225
34
34
  chainlit/logger.py,sha256=wTwRSZsLfXwWy6U4351IgWAm4KCMThgxm9EZpjGUEr4,373
35
- chainlit/markdown.py,sha256=L2IPPWxIlrhJZcKPfO1akomHdN3sgC2EvC2ilxR8MQs,1624
36
- chainlit/message.py,sha256=Lta7vQ3S3Zn1cNobypKOBVXDIAKMCOLLsRnNE4G2oZU,17690
35
+ chainlit/markdown.py,sha256=VUpqW7MqgjiPIQYHU4funwqC4GmHZBu_TGZTjTI4B0k,2025
36
+ chainlit/message.py,sha256=O9Qtw_5cDYA3TQVGyfbGwEeLLjpOoRIFe9LOedAkF_c,17974
37
37
  chainlit/oauth_providers.py,sha256=WiKUFpNp0RRN5Vq6LHCR9V-9td_1YEn2yD8iGu8atvY,17459
38
- chainlit/openai/__init__.py,sha256=ASiUNEvsFaDJeXGjZHbLTHhSyjGFvjhT0TRPu0_HpT4,2002
38
+ chainlit/openai/__init__.py,sha256=wYxag9R0LjUw4K6_XxV_7_6C5Q-hKZANEP6My8goGBs,1993
39
39
  chainlit/playground/__init__.py,sha256=igNRcBgqLKPTjOQtTNhhGNJFmZn-Dl1fHRQzQSjDGTQ,80
40
- chainlit/playground/config.py,sha256=_T0ELFRfBVUIOlaNvp3Af3X7wfMEQjxZPh26X_6mXYY,1033
40
+ chainlit/playground/config.py,sha256=XtTXYqFfv0JnygZcywurXyY62v7zukVwxxpnYiZIQRs,948
41
41
  chainlit/playground/provider.py,sha256=tU805uWOX6Tgh8rMoqVWdWqVq0nyylkrI8l2KZv2biw,3858
42
- chainlit/playground/providers/__init__.py,sha256=DxVp9BbQUdAPstpDTg2koNUTMS3tJa84iPTt_gQoHGM,236
42
+ chainlit/playground/providers/__init__.py,sha256=-Tx93fy4N3knLVF0fssaJb7e_aSYk8hXAaW9NsvZ0lI,207
43
43
  chainlit/playground/providers/anthropic.py,sha256=M9I0-RpKAmEJzGnH4-XW7n8yvNtr9phlPGnjr_32lfs,3495
44
44
  chainlit/playground/providers/huggingface.py,sha256=AmBmIzvfqBjswEI40jifb0OrMQkTk5rXCkGX7nMJ-bk,2130
45
45
  chainlit/playground/providers/langchain.py,sha256=8_gfZr3iEHhyFiR1X1bo-yfxZWjJkHaw_76MvWLZTYc,3103
46
- chainlit/playground/providers/openai.py,sha256=_Gnzfk9UHrDS83y3_OdhLWO13E800Z0RrIUsUv00syo,12397
46
+ chainlit/playground/providers/openai.py,sha256=9aDSgXVW3sW-gaybBBWMIE8cJPyk9ZuGvBmWwrddcMM,11956
47
47
  chainlit/playground/providers/vertexai.py,sha256=zKy501f-MHnLrvuRzN50FqgB3xoHzfQFTVbw83Nsj20,5084
48
48
  chainlit/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
49
49
  chainlit/secret.py,sha256=cQvIFGTQ7r2heC8EOGdgifSZZYqslh-qQxhUhKhD8vU,295
50
- chainlit/server.py,sha256=BECuGx0jgcYRFVaHLGf2GWT70XYitVzAN6rmcflxwVc,22294
50
+ chainlit/server.py,sha256=5HY4W6-iUYriEfgndYMcilTHTow1YsdrDewiGD0dWcY,23716
51
51
  chainlit/session.py,sha256=AP9xhIM0HuvlOrPgcWR6sg161rSmZZ-iDPvJF0f6pZg,8844
52
- chainlit/socket.py,sha256=h5IRgFgY5JcwpAiSHGylVDKwx0J-zEjd_wUhEyTnNTM,9846
53
- chainlit/step.py,sha256=Pk19uKmw0rcDaB3e-Bu5a269zV9DsyOg3A_bj0aw9I0,12749
52
+ chainlit/socket.py,sha256=1-w2uRyGzDNK3v-0Lk6O9eRIJoVjPkyG285pAGePx5E,9810
53
+ chainlit/step.py,sha256=JdXVqG73d9kNtHJjLhmfo1mqkCYtgqfF3jm08uGaCMs,13102
54
54
  chainlit/sync.py,sha256=G1n-7-3WgXsN8y1bJkEyws_YwmHZIyDZoZUwhprigag,1235
55
55
  chainlit/telemetry.py,sha256=Rk4dnZv0OnGOgV4kD-VHdhgl4i7i3ypqhSE_R-LZceM,3060
56
- chainlit/translations/en-US.json,sha256=PZftP1AeDhMWsXf81uHBhoewAryv0X0RJeAWw55G-LU,4272
57
- chainlit/translations/pt-BR.json,sha256=vTVGrrvT6amFloS_o0WH1n2xpGJmZ14INQ08MDDuxq8,4526
58
- chainlit/types.py,sha256=PnmLl8oBwoYVrohyY1e6YQzBIap3utjSN_rLeNuO_xY,3379
56
+ chainlit/translations/en-US.json,sha256=uUuS4hlNoYSlDp0DZGTAlPZxwLfsP4Jiu4ckrfr-fI0,7835
57
+ chainlit/translations.py,sha256=WG_r7HzxBYns-zk9tVvoGdoofv71okTZx8k1RlcoTIg,2034
58
+ chainlit/types.py,sha256=0DVObo9zKnT4hG9Diqp0rwBf0RFtu22TJCNoViOY3hE,3375
59
59
  chainlit/user.py,sha256=Cw4uGz0ffivWFszv8W__EHwkvTHQ3Lj9hqpRCPxFujo,619
60
60
  chainlit/user_session.py,sha256=nyPx8vSICP8BhpPcW5h9vbHVf9ixj39SrkvJBUI_6zs,1368
61
61
  chainlit/utils.py,sha256=3HzhfZ4XJhBIe9sJ_3Lxv3lMH4mFXsi6nLBGqm8Gtdw,2571
62
62
  chainlit/version.py,sha256=iosXhlXclBwBqlADFKEilxAC2wWKbtuBKi87AmPi7s8,196
63
- chainlit-1.0.401.dist-info/METADATA,sha256=T2_CQnavoiFYLPVIHkzqoZYJpEfIM4hLO3jrPhoqwWM,5540
64
- chainlit-1.0.401.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
65
- chainlit-1.0.401.dist-info/entry_points.txt,sha256=FrkqdjrFl8juSnvBndniyX7XuKojmUwO4ghRh-CFMQc,45
66
- chainlit-1.0.401.dist-info/RECORD,,
63
+ chainlit-1.0.501.dist-info/METADATA,sha256=U8cztrSQt_TwKjJOs3eqD1ZP5Y1L9o0wBwTPmDqRtdk,5560
64
+ chainlit-1.0.501.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
65
+ chainlit-1.0.501.dist-info/entry_points.txt,sha256=FrkqdjrFl8juSnvBndniyX7XuKojmUwO4ghRh-CFMQc,45
66
+ chainlit-1.0.501.dist-info/RECORD,,