chainlit 2.0.0__py3-none-any.whl → 2.0.dev0__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.

Files changed (98) hide show
  1. chainlit/__init__.py +57 -56
  2. chainlit/action.py +10 -12
  3. chainlit/{auth/__init__.py → auth.py} +34 -26
  4. chainlit/cache.py +6 -4
  5. chainlit/callbacks.py +7 -52
  6. chainlit/chat_context.py +2 -2
  7. chainlit/chat_settings.py +1 -3
  8. chainlit/cli/__init__.py +2 -15
  9. chainlit/config.py +70 -41
  10. chainlit/context.py +9 -8
  11. chainlit/copilot/dist/index.js +874 -8533
  12. chainlit/data/__init__.py +8 -96
  13. chainlit/data/acl.py +2 -3
  14. chainlit/data/base.py +15 -1
  15. chainlit/data/dynamodb.py +4 -7
  16. chainlit/data/literalai.py +6 -4
  17. chainlit/data/sql_alchemy.py +9 -10
  18. chainlit/data/{storage_clients/azure.py → storage_clients.py} +33 -2
  19. chainlit/discord/__init__.py +4 -4
  20. chainlit/discord/app.py +1 -2
  21. chainlit/element.py +9 -41
  22. chainlit/emitter.py +21 -17
  23. chainlit/frontend/dist/assets/DailyMotion-b4b7af47.js +1 -0
  24. chainlit/frontend/dist/assets/Facebook-572972a0.js +1 -0
  25. chainlit/frontend/dist/assets/FilePlayer-85c69ca8.js +1 -0
  26. chainlit/frontend/dist/assets/Kaltura-dfc24672.js +1 -0
  27. chainlit/frontend/dist/assets/Mixcloud-705011f4.js +1 -0
  28. chainlit/frontend/dist/assets/Mux-4201a9e6.js +1 -0
  29. chainlit/frontend/dist/assets/Preview-23ba40a6.js +1 -0
  30. chainlit/frontend/dist/assets/SoundCloud-1a582d51.js +1 -0
  31. chainlit/frontend/dist/assets/Streamable-5017c4ba.js +1 -0
  32. chainlit/frontend/dist/assets/Twitch-bb2de2fa.js +1 -0
  33. chainlit/frontend/dist/assets/Vidyard-54e269b1.js +1 -0
  34. chainlit/frontend/dist/assets/Vimeo-d92c37dd.js +1 -0
  35. chainlit/frontend/dist/assets/Wistia-25a1363b.js +1 -0
  36. chainlit/frontend/dist/assets/YouTube-616e8cb7.js +1 -0
  37. chainlit/frontend/dist/assets/index-aaf974a9.css +1 -0
  38. chainlit/frontend/dist/assets/index-f5df2072.js +1027 -0
  39. chainlit/frontend/dist/assets/{react-plotly-BpxUS-ab.js → react-plotly-f0315f86.js} +94 -94
  40. chainlit/frontend/dist/index.html +3 -2
  41. chainlit/haystack/callbacks.py +4 -5
  42. chainlit/input_widget.py +4 -6
  43. chainlit/langchain/callbacks.py +47 -56
  44. chainlit/langflow/__init__.py +0 -1
  45. chainlit/llama_index/callbacks.py +7 -7
  46. chainlit/message.py +10 -8
  47. chainlit/mistralai/__init__.py +2 -3
  48. chainlit/oauth_providers.py +12 -113
  49. chainlit/openai/__init__.py +7 -6
  50. chainlit/secret.py +1 -1
  51. chainlit/server.py +181 -491
  52. chainlit/session.py +5 -7
  53. chainlit/slack/__init__.py +3 -3
  54. chainlit/slack/app.py +2 -3
  55. chainlit/socket.py +103 -78
  56. chainlit/step.py +29 -21
  57. chainlit/sync.py +1 -2
  58. chainlit/teams/__init__.py +3 -3
  59. chainlit/teams/app.py +0 -1
  60. chainlit/types.py +4 -20
  61. chainlit/user.py +1 -2
  62. chainlit/utils.py +2 -3
  63. chainlit/version.py +2 -3
  64. {chainlit-2.0.0.dist-info → chainlit-2.0.dev0.dist-info}/METADATA +39 -27
  65. chainlit-2.0.dev0.dist-info/RECORD +96 -0
  66. chainlit/auth/cookie.py +0 -123
  67. chainlit/auth/jwt.py +0 -37
  68. chainlit/data/chainlit_data_layer.py +0 -584
  69. chainlit/data/storage_clients/__init__.py +0 -0
  70. chainlit/data/storage_clients/azure_blob.py +0 -80
  71. chainlit/data/storage_clients/base.py +0 -22
  72. chainlit/data/storage_clients/gcs.py +0 -78
  73. chainlit/data/storage_clients/s3.py +0 -49
  74. chainlit/frontend/dist/assets/DailyMotion-DgRzV5GZ.js +0 -1
  75. chainlit/frontend/dist/assets/Dataframe-DVgwSMU2.js +0 -22
  76. chainlit/frontend/dist/assets/Facebook-C0vx6HWv.js +0 -1
  77. chainlit/frontend/dist/assets/FilePlayer-CdhzeHPP.js +0 -1
  78. chainlit/frontend/dist/assets/Kaltura-5iVmeUct.js +0 -1
  79. chainlit/frontend/dist/assets/Mixcloud-C2zi77Ex.js +0 -1
  80. chainlit/frontend/dist/assets/Mux-Vkebogdf.js +0 -1
  81. chainlit/frontend/dist/assets/Preview-DwY_sEIl.js +0 -1
  82. chainlit/frontend/dist/assets/SoundCloud-CREBXAWo.js +0 -1
  83. chainlit/frontend/dist/assets/Streamable-B5Lu25uy.js +0 -1
  84. chainlit/frontend/dist/assets/Twitch-y9iKCcM1.js +0 -1
  85. chainlit/frontend/dist/assets/Vidyard-ClYvcuEu.js +0 -1
  86. chainlit/frontend/dist/assets/Vimeo-D6HvM2jt.js +0 -1
  87. chainlit/frontend/dist/assets/Wistia-Cu4zZ2Ci.js +0 -1
  88. chainlit/frontend/dist/assets/YouTube-D10tR6CJ.js +0 -1
  89. chainlit/frontend/dist/assets/index-CI4qFOt5.js +0 -8665
  90. chainlit/frontend/dist/assets/index-CrrqM0nZ.css +0 -1
  91. chainlit/translations/nl-NL.json +0 -229
  92. chainlit-2.0.0.dist-info/RECORD +0 -106
  93. /chainlit/copilot/dist/assets/{logo_dark-IkGJ_IwC.svg → logo_dark-2a3cf740.svg} +0 -0
  94. /chainlit/copilot/dist/assets/{logo_light-Bb_IPh6r.svg → logo_light-b078e7bc.svg} +0 -0
  95. /chainlit/frontend/dist/assets/{logo_dark-IkGJ_IwC.svg → logo_dark-2a3cf740.svg} +0 -0
  96. /chainlit/frontend/dist/assets/{logo_light-Bb_IPh6r.svg → logo_light-b078e7bc.svg} +0 -0
  97. {chainlit-2.0.0.dist-info → chainlit-2.0.dev0.dist-info}/WHEEL +0 -0
  98. {chainlit-2.0.0.dist-info → chainlit-2.0.dev0.dist-info}/entry_points.txt +0 -0
@@ -1,30 +1,23 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: chainlit
3
- Version: 2.0.0
3
+ Version: 2.0.dev0
4
4
  Summary: Build Conversational AI.
5
- Home-page: https://chainlit.io/
6
- License: Apache-2.0
5
+ Home-page: https://github.com/Chainlit/chainlit
6
+ License: Apache-2.0 license
7
7
  Keywords: LLM,Agents,gen ai,chat ui,chatbot ui,openai,copilot,langchain,conversational ai
8
- Author: Willy Douhard
8
+ Author: Chainlit
9
9
  Requires-Python: >=3.9,<4.0.0
10
- Classifier: Environment :: Web Environment
11
- Classifier: Framework :: FastAPI
12
- Classifier: License :: OSI Approved :: Apache Software License
13
- Classifier: Programming Language :: JavaScript
10
+ Classifier: License :: Other/Proprietary License
14
11
  Classifier: Programming Language :: Python :: 3
15
12
  Classifier: Programming Language :: Python :: 3.9
16
13
  Classifier: Programming Language :: Python :: 3.10
17
14
  Classifier: Programming Language :: Python :: 3.11
18
15
  Classifier: Programming Language :: Python :: 3.12
19
- Classifier: Topic :: Communications :: Chat
20
- Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
21
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
- Classifier: Topic :: Software Development :: User Interfaces
23
16
  Requires-Dist: aiofiles (>=23.1.0,<24.0.0)
24
17
  Requires-Dist: asyncer (>=0.0.7,<0.0.8)
25
18
  Requires-Dist: click (>=8.1.3,<9.0.0)
26
19
  Requires-Dist: dataclasses_json (>=0.6.7,<0.7.0)
27
- Requires-Dist: fastapi (>=0.115.3,<0.116)
20
+ Requires-Dist: fastapi (>=0.110.1,<0.113)
28
21
  Requires-Dist: filetype (>=1.2.0,<2.0.0)
29
22
  Requires-Dist: httpx (>=0.23.0)
30
23
  Requires-Dist: lazify (>=0.4.0,<0.5.0)
@@ -35,15 +28,14 @@ Requires-Dist: packaging (>=23.1,<24.0)
35
28
  Requires-Dist: pydantic (>=1,<3)
36
29
  Requires-Dist: pyjwt (>=2.8.0,<3.0.0)
37
30
  Requires-Dist: python-dotenv (>=1.0.0,<2.0.0)
38
- Requires-Dist: python-multipart (>=0.0.18,<0.0.19)
31
+ Requires-Dist: python-multipart (>=0.0.9,<0.0.10)
39
32
  Requires-Dist: python-socketio (>=5.11.0,<6.0.0)
40
- Requires-Dist: starlette (>=0.41.2,<0.42.0)
33
+ Requires-Dist: starlette (>=0.37.2,<0.38.0)
41
34
  Requires-Dist: syncer (>=2.0.3,<3.0.0)
42
35
  Requires-Dist: tomli (>=2.0.1,<3.0.0)
43
36
  Requires-Dist: uptrace (>=1.22.0,<2.0.0)
44
37
  Requires-Dist: uvicorn (>=0.25.0,<0.26.0)
45
38
  Requires-Dist: watchfiles (>=0.20.0,<0.21.0)
46
- Project-URL: Documentation, https://docs.chainlit.io/
47
39
  Project-URL: Repository, https://github.com/Chainlit/chainlit
48
40
  Description-Content-Type: text/markdown
49
41
 
@@ -59,10 +51,22 @@ Description-Content-Type: text/markdown
59
51
 
60
52
  Chainlit is an open-source async Python framework which allows developers to build scalable Conversational AI or agentic applications.
61
53
 
54
+ - ✅ ChatGPT-like application
55
+ - ✅ Embedded Chatbot & Software Copilot
56
+ - ✅ Slack & Discord
57
+ - ✅ Custom frontend (build your own agentic experience)
58
+ - ✅ API Endpoint
59
+
62
60
  Full documentation is available [here](https://docs.chainlit.io). You can ask Chainlit related questions to [Chainlit Help](https://help.chainlit.io/), an app built using Chainlit!
63
61
 
64
- https://github.com/user-attachments/assets/b3738aba-55c0-42fa-ac00-6efd1ee0d148
62
+ > [!NOTE]
63
+ > Check out [Literal AI](https://literalai.com), our product to monitor and evaluate LLM applications! It works with any Python or TypeScript applications and [seamlessly](https://docs.chainlit.io/data-persistence/overview) with Chainlit by adding a `LITERAL_API_KEY` in your project.
64
+ >
65
+ > Chainlit is developed and maintained by the Literal AI team, which is currently focused on expanding the capabilities of Literal AI. While we continue to support and maintain Chainlit, we are also committed to enabling the community to contribute, particularly in areas like integrations and data layers.
65
66
 
67
+ <p align="center">
68
+ <img src="https://github.com/Chainlit/chainlit/assets/13104895/0c2cc7a9-766c-41d3-aae2-117a2d0eb8ed" alt="Chainlit user interface" width="80%"></img>
69
+ </p>
66
70
 
67
71
  ## Installation
68
72
 
@@ -75,16 +79,6 @@ chainlit hello
75
79
 
76
80
  If this opens the `hello app` in your browser, you're all set!
77
81
 
78
- ### Development version
79
-
80
- The latest in-development version can be installed straight from GitHub with:
81
-
82
- ```sh
83
- pip install git+https://github.com/Chainlit/chainlit.git#subdirectory=backend/
84
- ```
85
-
86
- (Requires Node and pnpm installed on the system.)
87
-
88
82
  ## 🚀 Quickstart
89
83
 
90
84
  ### 🐍 Pure Python
@@ -130,6 +124,24 @@ chainlit run demo.py -w
130
124
 
131
125
  <img src="/images/quick-start.png" alt="Quick Start"></img>
132
126
 
127
+ ## 🎉 Key Features and Integrations
128
+
129
+ Full documentation is available [here](https://docs.chainlit.io). Key features:
130
+
131
+ - [💬 Multi Modal chats](https://docs.chainlit.io/advanced-features/multi-modal)
132
+ - [💭 Chain of Thought visualization](https://docs.chainlit.io/concepts/step)
133
+ - [💾 Data persistence + human feedback](https://docs.chainlit.io/data-persistence/overview)
134
+ - [🐛 Debug Mode](https://docs.chainlit.io/data-persistence/enterprise#debug-mode)
135
+ - [👤 Authentication](https://docs.chainlit.io/authentication/overview)
136
+
137
+ Chainlit is compatible with all Python programs and libraries. That being said, it comes with integrations for:
138
+
139
+ - [LangChain](https://docs.chainlit.io/integrations/langchain)
140
+ - [Llama Index](https://docs.chainlit.io/integrations/llama-index)
141
+ - [Autogen](https://github.com/Chainlit/cookbook/tree/main/pyautogen)
142
+ - [OpenAI Assistant](https://github.com/Chainlit/cookbook/tree/main/openai-assistant)
143
+ - [Haystack](https://docs.chainlit.io/integrations/haystack)
144
+
133
145
  ## 📚 More Examples - Cookbook
134
146
 
135
147
  You can find various examples of Chainlit apps [here](https://github.com/Chainlit/cookbook) that leverage tools and services such as OpenAI, Anthropiс, LangChain, LlamaIndex, ChromaDB, Pinecone and more.
@@ -0,0 +1,96 @@
1
+ chainlit/__init__.py,sha256=hzSPlB5Syel5sQ5H_pEr5ffZur9rbvxIJMZ2PvVftBQ,4418
2
+ chainlit/__main__.py,sha256=7Vg3w3T3qDuz4KDu5lQhLH6lQ3cYdume7gHH7Z1V97U,87
3
+ chainlit/_utils.py,sha256=vaKfEpXcL4kXktp54IRQWZRK4L_HGK8gJuAoIM29YYc,289
4
+ chainlit/action.py,sha256=k-GsblVHI4DnDWFyF-RZgq3KfdfAFICFh2OBeU4w8N8,1410
5
+ chainlit/auth.py,sha256=5G7H0khUaXxLkxvJotHFYJMQgDlXkHgJrv9s8rtDuP4,2671
6
+ chainlit/cache.py,sha256=Bv3dT4eHhE6Fq3c6Do0ZTpiyoXgXYewdxTgpYghEd9g,1361
7
+ chainlit/callbacks.py,sha256=cz8RBC4yT2M8mK--lrazMFt4ZPrdPKwca4iSLZFm_mI,8886
8
+ chainlit/chat_context.py,sha256=X1NInuCkhrfFhFUNIbipVaqf-90xXuyCAB9fvJlEUD4,1868
9
+ chainlit/chat_settings.py,sha256=2ByenmwS8O6jQjDVJjhhbLrBPGA5aY2F7R3VvQQxXPk,877
10
+ chainlit/cli/__init__.py,sha256=s-2SkMzIpo4ifEAJ0p1VARGM5F7fkb1so6G8Enj5iHs,6230
11
+ chainlit/config.py,sha256=2w1dL_0oBsiQH6YOmAEMg4sP_VibQtM8_ZgeOWkpd5k,16690
12
+ chainlit/context.py,sha256=RdLGlRjx8nBW1onooQdCdcbtMyIBGFlxYkL95oHacdk,3338
13
+ chainlit/copilot/dist/assets/logo_dark-2a3cf740.svg,sha256=Kjz3QMh-oh-ag4YatjU0YCPqGF7F8nHh8VUQoJIs01E,8887
14
+ chainlit/copilot/dist/assets/logo_light-b078e7bc.svg,sha256=sHjnvEq1rfqh3bcexJNYUY7WEDdTQZq3aKZYpi4w4ck,8889
15
+ chainlit/copilot/dist/index.js,sha256=BNvRUAhhwKmSeZijOKldJS5xOQBfKvRhcbdTfBCb_4Y,6801851
16
+ chainlit/data/__init__.py,sha256=oaKft5-ejrduen95fTMVmqLMLXVyEa97mQI72oDDSlE,751
17
+ chainlit/data/acl.py,sha256=5EwZuKVcZediw77L661MohGce3JzGIaYmw6NutmMTw0,578
18
+ chainlit/data/base.py,sha256=08CYstw0heUBfBzIjD6i-G3-83JMlhjxOxMEuoD0Epk,2907
19
+ chainlit/data/dynamodb.py,sha256=EgeYOeREswvtx7nfYJALh58u5ARJfWnIqk5H00sdwfw,19410
20
+ chainlit/data/literalai.py,sha256=H6fxhqwJVeA6movnmlcB_TToD7jslY1X8u2vg3gIku0,17256
21
+ chainlit/data/sql_alchemy.py,sha256=cspyQOz5IVs1TrFnujxW1_Zil_sUpGUoa11DnAbEkGE,29511
22
+ chainlit/data/storage_clients.py,sha256=uKVsl6oUSclj4h7QrBz13K46RZWtaHbpzf8ZdJg7bVo,3535
23
+ chainlit/data/utils.py,sha256=cVe8p9F-lITgmAD2xhON_h0nKJVrh1P0AUoLCq6JCWs,966
24
+ chainlit/discord/__init__.py,sha256=kZ_AAMaCToqO-1FdeQ8_IHS2pqNT0QJ-yyd8bCMaHHs,198
25
+ chainlit/discord/app.py,sha256=-efl4v9wNvfidYPjS2kqNqaaUCvvfBlErZe6lyQF_IE,11174
26
+ chainlit/element.py,sha256=CbpWgqeLAeyC0TONmzUc57cVg55a0cEnUDAxoa7qwB4,10954
27
+ chainlit/emitter.py,sha256=DvxpQYS_BKPHQ6WUEOOhAOkl9M14Tm1FQ8uFI2xi75E,13946
28
+ chainlit/frontend/dist/assets/DailyMotion-b4b7af47.js,sha256=mF1G6OZEaT2dqEVN2GbaTBsZmF0ghLUIA5go88bWMm8,2961
29
+ chainlit/frontend/dist/assets/Facebook-572972a0.js,sha256=_kfF7EMy96FalQIrGG4_MT4uB-1nfU1FPL_hgsdGx7A,3216
30
+ chainlit/frontend/dist/assets/FilePlayer-85c69ca8.js,sha256=CgrZxYliskov_av6t2VjkdblF12fVfVDlXtvn_Ienz0,9041
31
+ chainlit/frontend/dist/assets/Kaltura-dfc24672.js,sha256=wBtFsX3zn_ac-qqdl_YOBm2kEkSlXEbc4ypNJyqax0g,2790
32
+ chainlit/frontend/dist/assets/Mixcloud-705011f4.js,sha256=yI_MccqrCRJeoYtCw7yWGz1_VOCkRoHOm_wIAM5MPW4,2638
33
+ chainlit/frontend/dist/assets/Mux-4201a9e6.js,sha256=sBpsVAF5G--UaLBSCZnPjjmh7p_FicDuij9NnneVNp4,5360
34
+ chainlit/frontend/dist/assets/Preview-23ba40a6.js,sha256=beMjX5SVh1B2whxzKuTHi70jy7U0vBp2hYOvoNyrjSk,3011
35
+ chainlit/frontend/dist/assets/SoundCloud-1a582d51.js,sha256=JiiTaH1uNDDxU5weaUHnULLCKudFNP-br9a5W2gX5RU,2923
36
+ chainlit/frontend/dist/assets/Streamable-5017c4ba.js,sha256=G2jTT7srmzxlx6HLpuLM5pIdJuh7gW6ThwK_gnxHVRQ,2935
37
+ chainlit/frontend/dist/assets/Twitch-bb2de2fa.js,sha256=glTKOp7yBfBfa-Qhp7lKJiasPm7VQbiJkFyKiRXO1vU,3083
38
+ chainlit/frontend/dist/assets/Vidyard-54e269b1.js,sha256=9_OQkR2hr2sOQPYfVq9SgQ2bUq-ylbeB9EpJI5pCwHo,2857
39
+ chainlit/frontend/dist/assets/Vimeo-d92c37dd.js,sha256=zHmHzNx7M7y9cWvlhWjc-UxdgxYuX_Ggqyz6oQaZHik,3627
40
+ chainlit/frontend/dist/assets/Wistia-25a1363b.js,sha256=3cAZegM4xwgG6luxPafQTpYi-CY1-57obmoTlG6-VJg,3514
41
+ chainlit/frontend/dist/assets/YouTube-616e8cb7.js,sha256=xbfKpJbq0khfLpEghQxgGdRrewYzOK0BXE1xgXObvm0,4448
42
+ chainlit/frontend/dist/assets/index-aaf974a9.css,sha256=qvl0qUmR5u0JcmJAfkzaZpN-0ZKdQjzqCSE9cnrQpZQ,2559
43
+ chainlit/frontend/dist/assets/index-f5df2072.js,sha256=mcUQs_jSYtrw_JpGj5wy3MV90HYMi3nfCAA-iqlKA-c,2778550
44
+ chainlit/frontend/dist/assets/logo_dark-2a3cf740.svg,sha256=Kjz3QMh-oh-ag4YatjU0YCPqGF7F8nHh8VUQoJIs01E,8887
45
+ chainlit/frontend/dist/assets/logo_light-b078e7bc.svg,sha256=sHjnvEq1rfqh3bcexJNYUY7WEDdTQZq3aKZYpi4w4ck,8889
46
+ chainlit/frontend/dist/assets/react-plotly-f0315f86.js,sha256=neB_TetN5T1RABT3M0hsKFfAaCCryheqq7tgdLGyeS8,3763471
47
+ chainlit/frontend/dist/favicon.svg,sha256=0Cy8x28obT5eWW3nxZRhsEvu6_zMqrqbg0y6hT3D0Q0,6455
48
+ chainlit/frontend/dist/index.html,sha256=mjv-9AYkyZr_OTwTY0VOXR8x9PssCmyDy4Ul_onLUmo,965
49
+ chainlit/haystack/__init__.py,sha256=uZ77YiPy-qleSTi3dQCDO9HE6S6F6GpJWmh7jO4cxXA,217
50
+ chainlit/haystack/callbacks.py,sha256=mh6CS6n0Z70u9B1s72iF0kSl-qi2N55T-AgaMtUvq9Y,5036
51
+ chainlit/hello.py,sha256=LwENQWo5s5r8nNDn4iKSV77vX60Ky5r_qGjQhyi7qlY,416
52
+ chainlit/input_widget.py,sha256=KmOn1nPTBvnld3iIBHR0Vih0KsCxVnTbo2t_xBNANzo,4949
53
+ chainlit/langchain/__init__.py,sha256=zErMw0_3ufSGeF9ye7X0ZX3wDat4mTOx97T40ePDO2g,217
54
+ chainlit/langchain/callbacks.py,sha256=qC9p_XKYOVEszy2gdRr2QTHVtKHBzK07OXfcoxmqMOE,21242
55
+ chainlit/langflow/__init__.py,sha256=wxhxdsl1yxdsRyNTgZticxFF_8VFtJJ4OdIy3tnEIyM,817
56
+ chainlit/llama_index/__init__.py,sha256=weRoIWCaRBGvA1LczCEfsqhWsltQSVlhtRnTovtdo8w,227
57
+ chainlit/llama_index/callbacks.py,sha256=HtxBRkfjHnwEBmhcuYDFsAD2gUVpsOi4ET39l4afh1M,7286
58
+ chainlit/logger.py,sha256=wTwRSZsLfXwWy6U4351IgWAm4KCMThgxm9EZpjGUEr4,373
59
+ chainlit/markdown.py,sha256=V-Op4hyqyTTvXInU5QrHfxs0nb71lBMU8trOSAlast8,2142
60
+ chainlit/message.py,sha256=kMPRE0L10WhJKcyPUNg3FRVPviby0LOn1KHAI4pGszM,17287
61
+ chainlit/mistralai/__init__.py,sha256=Zr3-mb-3ycNXR1e5ui_yX_7ZxGB0cu5d9E80ir7t-2w,1507
62
+ chainlit/oauth_providers.py,sha256=T17iFZdDXClzscki2v7AEgSGvrGYSiq2QG4MrgqgBzg,23242
63
+ chainlit/openai/__init__.py,sha256=aj8toIwvCktANU1TaH1verKS7ApS6tlhDZFtm1oTyCM,1715
64
+ chainlit/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
65
+ chainlit/secret.py,sha256=cQvIFGTQ7r2heC8EOGdgifSZZYqslh-qQxhUhKhD8vU,295
66
+ chainlit/server.py,sha256=vCTBPiFfJYTM3vxkrmCuZJwbh3lszGdBEP_wjsZ8CZM,29961
67
+ chainlit/session.py,sha256=dU56wmJ9LSuSAOwKBpYF8ZofV5SoN1oPmWycHWEN85k,9219
68
+ chainlit/slack/__init__.py,sha256=Q41ztJHeVmpoXVgVqAcwGOufQp_bjf7dDT7eEXDdhPI,207
69
+ chainlit/slack/app.py,sha256=jzy6Nz9kmnJ6j1wfoI94cweSNDjdv7X-ur_lWnq5oVE,11741
70
+ chainlit/socket.py,sha256=Hg1OC0diVii9o_KZjo1mqnFbgZjezrF3r60D1-UfoBs,12762
71
+ chainlit/step.py,sha256=YI6O_-FoJ24r1aAIMr7X_9floR_9RIwP4TuvEQlaz7s,14584
72
+ chainlit/sync.py,sha256=G1n-7-3WgXsN8y1bJkEyws_YwmHZIyDZoZUwhprigag,1235
73
+ chainlit/teams/__init__.py,sha256=ZSEbsRJHT_mKfGn6yuzM5NX-xItleSDS0af7vt8Z1OA,217
74
+ chainlit/teams/app.py,sha256=gJm_wBNzCawaTLIYtOEhDlpRwBDprnguTAIoWZhlO8o,10533
75
+ chainlit/telemetry.py,sha256=Rk4dnZv0OnGOgV4kD-VHdhgl4i7i3ypqhSE_R-LZceM,3060
76
+ chainlit/translations/bn.json,sha256=_44si0jO2AFZytfH9sBcINpOveQ4OZs77yf-_VlUtjs,13172
77
+ chainlit/translations/en-US.json,sha256=eS9YSnca-MFpWeZI4JhI0Yl0YBQlrsxB-yFM62K03bI,7778
78
+ chainlit/translations/gu.json,sha256=CkhAowZ0mgMJhQUMrUADfKPfsDgj5mvHlC3WtQ0UjQE,12699
79
+ chainlit/translations/he-IL.json,sha256=fu6FXfoqYqydSh_NcDpS6ZN7byQ-WZkr4zU0qXznqwc,8789
80
+ chainlit/translations/hi.json,sha256=J15GBkMu45RJMj1p5sFVnlackwAp_jKySRsKN-wRCUg,12397
81
+ chainlit/translations/kn.json,sha256=koYH5mEcX4ZfacgmiTu_UfKgNbDXXUwcEV7v6uq92eY,13575
82
+ chainlit/translations/ml.json,sha256=x_QV-3H0vCoijszWrjHajaTBtZzAdQ0y4V2uJgLf0S4,14270
83
+ chainlit/translations/mr.json,sha256=pUr540hPG3Vq-Nts7Pnj-oor_scw1Rx2gaIBnGOyPZU,12495
84
+ chainlit/translations/ta.json,sha256=kLXucUlMCD3jXlPhmOZ3FFZNdXfGDaqVxwqGqJqVF78,14152
85
+ chainlit/translations/te.json,sha256=spOs9mYNITEUy_mKp4_9qmXP2yACVrruiQKb1zlRIWU,13608
86
+ chainlit/translations/zh-CN.json,sha256=Y3MhXUDFi4YMxX8-agpCM68efYXCGcHqyqRAen8LLfk,7508
87
+ chainlit/translations.py,sha256=WG_r7HzxBYns-zk9tVvoGdoofv71okTZx8k1RlcoTIg,2034
88
+ chainlit/types.py,sha256=7pY4iePG2s5nPxU9LnmKbmNI3vT6l5gs6jy9VEH3P4A,5181
89
+ chainlit/user.py,sha256=mUhnGhYQ__qEx8YzigHhF2Z9xxuqQo5C2U8opKpiVRs,752
90
+ chainlit/user_session.py,sha256=T1nQVN_weELXTrkDIV54YgdrA3zIvJGe1tN-nypunt4,1531
91
+ chainlit/utils.py,sha256=hXb5z3jb2syJP0P_jTz3zjDEuIfl0IAmQbA3MooSCTs,3989
92
+ chainlit/version.py,sha256=iosXhlXclBwBqlADFKEilxAC2wWKbtuBKi87AmPi7s8,196
93
+ chainlit-2.0.dev0.dist-info/METADATA,sha256=QvwMpFAbM2mNStdbEHe3Unw6e2NWxoykAhnoULDahsI,6398
94
+ chainlit-2.0.dev0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
95
+ chainlit-2.0.dev0.dist-info/entry_points.txt,sha256=FrkqdjrFl8juSnvBndniyX7XuKojmUwO4ghRh-CFMQc,45
96
+ chainlit-2.0.dev0.dist-info/RECORD,,
chainlit/auth/cookie.py DELETED
@@ -1,123 +0,0 @@
1
- import os
2
- from typing import Literal, Optional, cast
3
-
4
- from fastapi import Request, Response
5
- from fastapi.exceptions import HTTPException
6
- from fastapi.security.base import SecurityBase
7
- from fastapi.security.utils import get_authorization_scheme_param
8
- from starlette.status import HTTP_401_UNAUTHORIZED
9
-
10
- """ Module level cookie settings. """
11
- _cookie_samesite = cast(
12
- Literal["lax", "strict", "none"],
13
- os.environ.get("CHAINLIT_COOKIE_SAMESITE", "lax"),
14
- )
15
-
16
- assert (
17
- _cookie_samesite
18
- in [
19
- "lax",
20
- "strict",
21
- "none",
22
- ]
23
- ), "Invalid value for CHAINLIT_COOKIE_SAMESITE. Must be one of 'lax', 'strict' or 'none'."
24
- _cookie_secure = _cookie_samesite == "none"
25
-
26
- _auth_cookie_lifetime = 60 * 60 # 1 hour
27
- _state_cookie_lifetime = 3 * 60 # 3m
28
- _auth_cookie_name = "access_token"
29
- _state_cookie_name = "oauth_state"
30
-
31
-
32
- class OAuth2PasswordBearerWithCookie(SecurityBase):
33
- """
34
- OAuth2 password flow with cookie support with fallback to bearer token.
35
- """
36
-
37
- def __init__(
38
- self,
39
- tokenUrl: str,
40
- scheme_name: Optional[str] = None,
41
- auto_error: bool = True,
42
- ):
43
- self.tokenUrl = tokenUrl
44
- self.scheme_name = scheme_name or self.__class__.__name__
45
- self.auto_error = auto_error
46
-
47
- async def __call__(self, request: Request) -> Optional[str]:
48
- # First try to get the token from the cookie
49
- token = request.cookies.get(_auth_cookie_name)
50
-
51
- # If no cookie, try the Authorization header as fallback
52
- if not token:
53
- # TODO: Only bother to check if cookie auth is explicitly disabled.
54
- authorization = request.headers.get("Authorization")
55
- if authorization:
56
- scheme, token = get_authorization_scheme_param(authorization)
57
- if scheme.lower() != "bearer":
58
- if self.auto_error:
59
- raise HTTPException(
60
- status_code=HTTP_401_UNAUTHORIZED,
61
- detail="Invalid authentication credentials",
62
- headers={"WWW-Authenticate": "Bearer"},
63
- )
64
- else:
65
- return None
66
- else:
67
- if self.auto_error:
68
- raise HTTPException(
69
- status_code=HTTP_401_UNAUTHORIZED,
70
- detail="Not authenticated",
71
- headers={"WWW-Authenticate": "Bearer"},
72
- )
73
- else:
74
- return None
75
-
76
- return token
77
-
78
-
79
- def set_auth_cookie(response: Response, token: str):
80
- """
81
- Helper function to set the authentication cookie with secure parameters
82
- """
83
-
84
- response.set_cookie(
85
- key=_auth_cookie_name,
86
- value=token,
87
- httponly=True,
88
- secure=_cookie_secure,
89
- samesite=_cookie_samesite,
90
- max_age=_auth_cookie_lifetime,
91
- )
92
-
93
-
94
- def clear_auth_cookie(response: Response):
95
- """
96
- Helper function to clear the authentication cookie
97
- """
98
- response.delete_cookie(key=_auth_cookie_name, path="/")
99
-
100
-
101
- def set_oauth_state_cookie(response: Response, token: str):
102
- response.set_cookie(
103
- _state_cookie_name,
104
- token,
105
- httponly=True,
106
- samesite=_cookie_samesite,
107
- secure=_cookie_secure,
108
- max_age=_state_cookie_lifetime,
109
- )
110
-
111
-
112
- def validate_oauth_state_cookie(request: Request, state: str):
113
- """Check the state from the oauth provider against the browser cookie."""
114
-
115
- oauth_state = request.cookies.get(_state_cookie_name)
116
-
117
- if oauth_state != state:
118
- raise Exception("oauth state does not correspond")
119
-
120
-
121
- def clear_oauth_state_cookie(response: Response):
122
- """Oauth complete, delete state token."""
123
- response.delete_cookie(_state_cookie_name) # Do we set path here?
chainlit/auth/jwt.py DELETED
@@ -1,37 +0,0 @@
1
- import datetime
2
- import os
3
- from typing import Any, Dict, Optional
4
-
5
- import jwt as pyjwt
6
-
7
- from chainlit.config import config
8
- from chainlit.user import User
9
-
10
-
11
- def get_jwt_secret() -> Optional[str]:
12
- return os.environ.get("CHAINLIT_AUTH_SECRET")
13
-
14
-
15
- def create_jwt(data: User) -> str:
16
- to_encode: Dict[str, Any] = data.to_dict()
17
- to_encode.update(
18
- {
19
- "exp": datetime.datetime.utcnow()
20
- + datetime.timedelta(seconds=config.project.user_session_timeout),
21
- }
22
- )
23
- secret = get_jwt_secret()
24
- assert secret
25
- encoded_jwt = pyjwt.encode(to_encode, secret, algorithm="HS256")
26
- return encoded_jwt
27
-
28
-
29
- def decode_jwt(token: str) -> User:
30
- dict = pyjwt.decode(
31
- token,
32
- get_jwt_secret(),
33
- algorithms=["HS256"],
34
- options={"verify_signature": True},
35
- )
36
- del dict["exp"]
37
- return User(**dict)