chainlit 2.0rc1__tar.gz → 2.0.2__tar.gz

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 (111) hide show
  1. {chainlit-2.0rc1 → chainlit-2.0.2}/PKG-INFO +4 -35
  2. {chainlit-2.0rc1 → chainlit-2.0.2}/README.md +1 -31
  3. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/__init__.py +47 -57
  4. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/action.py +8 -8
  5. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/auth/__init__.py +1 -1
  6. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/auth/cookie.py +7 -9
  7. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/auth/jwt.py +5 -3
  8. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/callbacks.py +1 -1
  9. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/config.py +8 -59
  10. chainlit-2.0.2/chainlit/copilot/dist/index.js +12200 -0
  11. chainlit-2.0.2/chainlit/data/__init__.py +113 -0
  12. chainlit-2.0.2/chainlit/data/chainlit_data_layer.py +608 -0
  13. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/data/literalai.py +1 -1
  14. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/data/sql_alchemy.py +26 -2
  15. chainlit-2.0.2/chainlit/data/storage_clients/azure_blob.py +89 -0
  16. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/data/storage_clients/base.py +10 -0
  17. chainlit-2.0.2/chainlit/data/storage_clients/gcs.py +88 -0
  18. chainlit-2.0.2/chainlit/data/storage_clients/s3.py +75 -0
  19. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/element.py +7 -4
  20. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/emitter.py +9 -14
  21. chainlit-2.0rc1/chainlit/frontend/dist/assets/DailyMotion-C-_sjrtO.js → chainlit-2.0.2/chainlit/frontend/dist/assets/DailyMotion-DFvM941y.js +1 -1
  22. chainlit-2.0.2/chainlit/frontend/dist/assets/Dataframe-CA6SlUSB.js +22 -0
  23. chainlit-2.0rc1/chainlit/frontend/dist/assets/Facebook-bB34P03l.js → chainlit-2.0.2/chainlit/frontend/dist/assets/Facebook-BM4MwXR1.js +1 -1
  24. chainlit-2.0rc1/chainlit/frontend/dist/assets/FilePlayer-BWgqGrXv.js → chainlit-2.0.2/chainlit/frontend/dist/assets/FilePlayer-CfjB8iXr.js +1 -1
  25. chainlit-2.0rc1/chainlit/frontend/dist/assets/Kaltura-OY4P9Ofd.js → chainlit-2.0.2/chainlit/frontend/dist/assets/Kaltura-Bg-U6Xkz.js +1 -1
  26. chainlit-2.0rc1/chainlit/frontend/dist/assets/Mixcloud-9CtT8w5Y.js → chainlit-2.0.2/chainlit/frontend/dist/assets/Mixcloud-xJrfoMTv.js +1 -1
  27. chainlit-2.0rc1/chainlit/frontend/dist/assets/Mux-BH9A0qEi.js → chainlit-2.0.2/chainlit/frontend/dist/assets/Mux-CKnKDBmk.js +1 -1
  28. chainlit-2.0rc1/chainlit/frontend/dist/assets/Preview-Og00EJ05.js → chainlit-2.0.2/chainlit/frontend/dist/assets/Preview-DwHPdmIg.js +1 -1
  29. chainlit-2.0rc1/chainlit/frontend/dist/assets/SoundCloud-D7resGfn.js → chainlit-2.0.2/chainlit/frontend/dist/assets/SoundCloud-Crd5dwXV.js +1 -1
  30. chainlit-2.0rc1/chainlit/frontend/dist/assets/Streamable-6f_6bYz1.js → chainlit-2.0.2/chainlit/frontend/dist/assets/Streamable-Dq0c8lyx.js +1 -1
  31. chainlit-2.0rc1/chainlit/frontend/dist/assets/Twitch-BZJl3peM.js → chainlit-2.0.2/chainlit/frontend/dist/assets/Twitch-DIDvP936.js +1 -1
  32. chainlit-2.0rc1/chainlit/frontend/dist/assets/Vidyard-B7tv4b8_.js → chainlit-2.0.2/chainlit/frontend/dist/assets/Vidyard-B1dz9WN4.js +1 -1
  33. chainlit-2.0rc1/chainlit/frontend/dist/assets/Vimeo-F-eA4zQI.js → chainlit-2.0.2/chainlit/frontend/dist/assets/Vimeo-22Su6q2w.js +1 -1
  34. chainlit-2.0.2/chainlit/frontend/dist/assets/Wistia-C7adXRjN.js +1 -0
  35. chainlit-2.0rc1/chainlit/frontend/dist/assets/YouTube-aFdJGjI1.js → chainlit-2.0.2/chainlit/frontend/dist/assets/YouTube-Dt4UMtQI.js +1 -1
  36. chainlit-2.0.2/chainlit/frontend/dist/assets/index-DbdLVHtZ.js +8665 -0
  37. chainlit-2.0.2/chainlit/frontend/dist/assets/index-g8LTJwwr.css +1 -0
  38. chainlit-2.0rc1/chainlit/frontend/dist/assets/react-plotly-DoUJXMgz.js → chainlit-2.0.2/chainlit/frontend/dist/assets/react-plotly-DvpXYYRJ.js +1 -1
  39. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/frontend/dist/index.html +2 -2
  40. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/message.py +1 -3
  41. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/server.py +297 -78
  42. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/session.py +9 -0
  43. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/socket.py +5 -53
  44. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/step.py +0 -1
  45. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/translations/en-US.json +1 -1
  46. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/types.py +17 -3
  47. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/user_session.py +1 -0
  48. {chainlit-2.0rc1 → chainlit-2.0.2}/pyproject.toml +8 -6
  49. chainlit-2.0rc1/chainlit/copilot/dist/index.js +0 -4900
  50. chainlit-2.0rc1/chainlit/data/__init__.py +0 -44
  51. chainlit-2.0rc1/chainlit/data/storage_clients/s3.py +0 -37
  52. chainlit-2.0rc1/chainlit/frontend/dist/assets/Wistia-Dhxhn3IB.js +0 -1
  53. chainlit-2.0rc1/chainlit/frontend/dist/assets/index-Ba33_hdJ.js +0 -1091
  54. chainlit-2.0rc1/chainlit/frontend/dist/assets/index-CwmincdQ.css +0 -1
  55. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/__main__.py +0 -0
  56. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/_utils.py +0 -0
  57. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/cache.py +0 -0
  58. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/chat_context.py +0 -0
  59. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/chat_settings.py +0 -0
  60. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/cli/__init__.py +0 -0
  61. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/context.py +0 -0
  62. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/copilot/dist/assets/logo_dark-IkGJ_IwC.svg +0 -0
  63. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/copilot/dist/assets/logo_light-Bb_IPh6r.svg +0 -0
  64. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/data/acl.py +0 -0
  65. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/data/base.py +0 -0
  66. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/data/dynamodb.py +0 -0
  67. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/data/storage_clients/__init__.py +0 -0
  68. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/data/storage_clients/azure.py +0 -0
  69. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/data/utils.py +0 -0
  70. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/discord/__init__.py +0 -0
  71. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/discord/app.py +0 -0
  72. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/frontend/dist/assets/logo_dark-IkGJ_IwC.svg +0 -0
  73. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/frontend/dist/assets/logo_light-Bb_IPh6r.svg +0 -0
  74. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/frontend/dist/favicon.svg +0 -0
  75. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/haystack/__init__.py +0 -0
  76. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/haystack/callbacks.py +0 -0
  77. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/hello.py +0 -0
  78. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/input_widget.py +0 -0
  79. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/langchain/__init__.py +0 -0
  80. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/langchain/callbacks.py +0 -0
  81. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/langflow/__init__.py +0 -0
  82. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/llama_index/__init__.py +0 -0
  83. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/llama_index/callbacks.py +0 -0
  84. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/logger.py +0 -0
  85. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/markdown.py +0 -0
  86. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/mistralai/__init__.py +0 -0
  87. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/oauth_providers.py +0 -0
  88. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/openai/__init__.py +0 -0
  89. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/py.typed +0 -0
  90. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/secret.py +0 -0
  91. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/slack/__init__.py +0 -0
  92. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/slack/app.py +0 -0
  93. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/sync.py +0 -0
  94. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/teams/__init__.py +0 -0
  95. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/teams/app.py +0 -0
  96. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/telemetry.py +0 -0
  97. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/translations/bn.json +0 -0
  98. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/translations/gu.json +0 -0
  99. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/translations/he-IL.json +0 -0
  100. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/translations/hi.json +0 -0
  101. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/translations/kn.json +0 -0
  102. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/translations/ml.json +0 -0
  103. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/translations/mr.json +0 -0
  104. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/translations/nl-NL.json +0 -0
  105. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/translations/ta.json +0 -0
  106. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/translations/te.json +0 -0
  107. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/translations/zh-CN.json +0 -0
  108. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/translations.py +0 -0
  109. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/user.py +0 -0
  110. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/utils.py +0 -0
  111. {chainlit-2.0rc1 → chainlit-2.0.2}/chainlit/version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: chainlit
3
- Version: 2.0rc1
3
+ Version: 2.0.2
4
4
  Summary: Build Conversational AI.
5
5
  Home-page: https://chainlit.io/
6
6
  License: Apache-2.0
@@ -28,14 +28,13 @@ Requires-Dist: fastapi (>=0.115.3,<0.116)
28
28
  Requires-Dist: filetype (>=1.2.0,<2.0.0)
29
29
  Requires-Dist: httpx (>=0.23.0)
30
30
  Requires-Dist: lazify (>=0.4.0,<0.5.0)
31
- Requires-Dist: literalai (==0.0.623)
31
+ Requires-Dist: literalai (==0.1.103)
32
32
  Requires-Dist: nest-asyncio (>=1.6.0,<2.0.0)
33
- Requires-Dist: numpy (>=1.26,<2.0)
34
33
  Requires-Dist: packaging (>=23.1,<24.0)
35
34
  Requires-Dist: pydantic (>=1,<3)
36
35
  Requires-Dist: pyjwt (>=2.8.0,<3.0.0)
37
36
  Requires-Dist: python-dotenv (>=1.0.0,<2.0.0)
38
- Requires-Dist: python-multipart (>=0.0.9,<0.0.10)
37
+ Requires-Dist: python-multipart (>=0.0.18,<0.0.19)
39
38
  Requires-Dist: python-socketio (>=5.11.0,<6.0.0)
40
39
  Requires-Dist: starlette (>=0.41.2,<0.42.0)
41
40
  Requires-Dist: syncer (>=2.0.3,<3.0.0)
@@ -59,22 +58,10 @@ Description-Content-Type: text/markdown
59
58
 
60
59
  Chainlit is an open-source async Python framework which allows developers to build scalable Conversational AI or agentic applications.
61
60
 
62
- - ✅ ChatGPT-like application
63
- - ✅ Embedded Chatbot & Software Copilot
64
- - ✅ Slack & Discord
65
- - ✅ Custom frontend (build your own agentic experience)
66
- - ✅ API Endpoint
67
-
68
61
  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!
69
62
 
70
- > [!NOTE]
71
- > 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.
72
- >
73
- > 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.
63
+ https://github.com/user-attachments/assets/b3738aba-55c0-42fa-ac00-6efd1ee0d148
74
64
 
75
- <p align="center">
76
- <img src="https://github.com/Chainlit/chainlit/assets/13104895/0c2cc7a9-766c-41d3-aae2-117a2d0eb8ed" alt="Chainlit user interface" width="80%"></img>
77
- </p>
78
65
 
79
66
  ## Installation
80
67
 
@@ -142,24 +129,6 @@ chainlit run demo.py -w
142
129
 
143
130
  <img src="/images/quick-start.png" alt="Quick Start"></img>
144
131
 
145
- ## 🎉 Key Features and Integrations
146
-
147
- Full documentation is available [here](https://docs.chainlit.io). Key features:
148
-
149
- - [💬 Multi Modal chats](https://docs.chainlit.io/advanced-features/multi-modal)
150
- - [💭 Chain of Thought visualization](https://docs.chainlit.io/concepts/step)
151
- - [💾 Data persistence + human feedback](https://docs.chainlit.io/data-persistence/overview)
152
- - [🐛 Debug Mode](https://docs.chainlit.io/data-persistence/enterprise#debug-mode)
153
- - [👤 Authentication](https://docs.chainlit.io/authentication/overview)
154
-
155
- Chainlit is compatible with all Python programs and libraries. That being said, it comes with integrations for:
156
-
157
- - [LangChain](https://docs.chainlit.io/integrations/langchain)
158
- - [Llama Index](https://docs.chainlit.io/integrations/llama-index)
159
- - [Autogen](https://github.com/Chainlit/cookbook/tree/main/pyautogen)
160
- - [OpenAI Assistant](https://github.com/Chainlit/cookbook/tree/main/openai-assistant)
161
- - [Haystack](https://docs.chainlit.io/integrations/haystack)
162
-
163
132
  ## 📚 More Examples - Cookbook
164
133
 
165
134
  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.
@@ -10,22 +10,10 @@
10
10
 
11
11
  Chainlit is an open-source async Python framework which allows developers to build scalable Conversational AI or agentic applications.
12
12
 
13
- - ✅ ChatGPT-like application
14
- - ✅ Embedded Chatbot & Software Copilot
15
- - ✅ Slack & Discord
16
- - ✅ Custom frontend (build your own agentic experience)
17
- - ✅ API Endpoint
18
-
19
13
  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!
20
14
 
21
- > [!NOTE]
22
- > 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.
23
- >
24
- > 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.
15
+ https://github.com/user-attachments/assets/b3738aba-55c0-42fa-ac00-6efd1ee0d148
25
16
 
26
- <p align="center">
27
- <img src="https://github.com/Chainlit/chainlit/assets/13104895/0c2cc7a9-766c-41d3-aae2-117a2d0eb8ed" alt="Chainlit user interface" width="80%"></img>
28
- </p>
29
17
 
30
18
  ## Installation
31
19
 
@@ -93,24 +81,6 @@ chainlit run demo.py -w
93
81
 
94
82
  <img src="/images/quick-start.png" alt="Quick Start"></img>
95
83
 
96
- ## 🎉 Key Features and Integrations
97
-
98
- Full documentation is available [here](https://docs.chainlit.io). Key features:
99
-
100
- - [💬 Multi Modal chats](https://docs.chainlit.io/advanced-features/multi-modal)
101
- - [💭 Chain of Thought visualization](https://docs.chainlit.io/concepts/step)
102
- - [💾 Data persistence + human feedback](https://docs.chainlit.io/data-persistence/overview)
103
- - [🐛 Debug Mode](https://docs.chainlit.io/data-persistence/enterprise#debug-mode)
104
- - [👤 Authentication](https://docs.chainlit.io/authentication/overview)
105
-
106
- Chainlit is compatible with all Python programs and libraries. That being said, it comes with integrations for:
107
-
108
- - [LangChain](https://docs.chainlit.io/integrations/langchain)
109
- - [Llama Index](https://docs.chainlit.io/integrations/llama-index)
110
- - [Autogen](https://github.com/Chainlit/cookbook/tree/main/pyautogen)
111
- - [OpenAI Assistant](https://github.com/Chainlit/cookbook/tree/main/openai-assistant)
112
- - [Haystack](https://docs.chainlit.io/integrations/haystack)
113
-
114
84
  ## 📚 More Examples - Cookbook
115
85
 
116
86
  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.
@@ -25,7 +25,7 @@ from chainlit.chat_settings import ChatSettings
25
25
  from chainlit.context import context
26
26
  from chainlit.element import (
27
27
  Audio,
28
- Component,
28
+ CustomElement,
29
29
  Dataframe,
30
30
  File,
31
31
  Image,
@@ -117,83 +117,73 @@ __getattr__ = make_module_getattr(
117
117
  )
118
118
 
119
119
  __all__ = [
120
- "__version__",
120
+ "Action",
121
+ "AskActionMessage",
122
+ "AskFileMessage",
123
+ "AskUserMessage",
124
+ "AsyncLangchainCallbackHandler",
125
+ "Audio",
126
+ "ChatGeneration",
121
127
  "ChatProfile",
122
- "Starter",
123
- "user_session",
124
- "chat_context",
128
+ "ChatSettings",
129
+ "CompletionGeneration",
125
130
  "CopilotFunction",
131
+ "CustomElement",
132
+ "Dataframe",
133
+ "ErrorMessage",
134
+ "File",
135
+ "GenerationMessage",
136
+ "HaystackAgentCallbackHandler",
137
+ "Image",
126
138
  "InputAudioChunk",
139
+ "LangchainCallbackHandler",
140
+ "LlamaIndexCallbackHandler",
141
+ "Message",
127
142
  "OutputAudioChunk",
128
- "Action",
129
- "User",
130
- "PersistedUser",
131
- "Audio",
132
143
  "Pdf",
144
+ "PersistedUser",
133
145
  "Plotly",
134
- "Image",
135
- "Text",
136
- "Component",
137
- "Dataframe",
138
146
  "Pyplot",
139
- "File",
147
+ "Starter",
148
+ "Step",
140
149
  "Task",
141
150
  "TaskList",
142
151
  "TaskStatus",
152
+ "Text",
153
+ "User",
143
154
  "Video",
144
- "ChatSettings",
145
- "input_widget",
146
- "Message",
147
- "ErrorMessage",
148
- "AskUserMessage",
149
- "AskActionMessage",
150
- "AskFileMessage",
151
- "Step",
152
- "step",
153
- "ChatGeneration",
154
- "CompletionGeneration",
155
- "GenerationMessage",
156
- "on_logout",
157
- "on_window_message",
158
- "send_window_message",
159
- "on_chat_start",
160
- "on_chat_end",
161
- "on_chat_resume",
162
- "on_stop",
155
+ "__version__",
163
156
  "action_callback",
164
157
  "author_rename",
165
- "on_settings_update",
166
- "password_auth_callback",
167
- "header_auth_callback",
168
- "sleep",
169
- "run_sync",
170
- "make_async",
171
158
  "cache",
159
+ "chat_context",
172
160
  "context",
173
- "LangchainCallbackHandler",
174
- "AsyncLangchainCallbackHandler",
175
- "LlamaIndexCallbackHandler",
176
- "HaystackAgentCallbackHandler",
177
- "instrument_openai",
178
- "instrument_mistralai",
179
- "password_auth_callback",
161
+ "data_layer",
180
162
  "header_auth_callback",
163
+ "input_widget",
164
+ "instrument_mistralai",
165
+ "instrument_openai",
166
+ "make_async",
181
167
  "oauth_callback",
168
+ "on_audio_chunk",
169
+ "on_audio_end",
170
+ "on_audio_start",
171
+ "on_chat_end",
172
+ "on_chat_resume",
173
+ "on_chat_start",
182
174
  "on_logout",
183
175
  "on_message",
184
- "on_chat_start",
185
- "on_chat_resume",
176
+ "on_settings_update",
177
+ "on_stop",
178
+ "on_window_message",
179
+ "password_auth_callback",
180
+ "run_sync",
181
+ "send_window_message",
186
182
  "set_chat_profiles",
187
183
  "set_starters",
188
- "on_chat_end",
189
- "on_audio_start",
190
- "on_audio_chunk",
191
- "on_audio_end",
192
- "author_rename",
193
- "on_stop",
194
- "action_callback",
195
- "on_settings_update",
196
- "data_layer",
184
+ "sleep",
185
+ "step",
186
+ "user_session",
197
187
  ]
198
188
 
199
189
 
@@ -1,5 +1,5 @@
1
1
  import uuid
2
- from typing import Optional
2
+ from typing import Dict, Optional
3
3
 
4
4
  from dataclasses_json import DataClassJsonMixin
5
5
  from pydantic import Field
@@ -13,18 +13,18 @@ from chainlit.telemetry import trace_event
13
13
  class Action(DataClassJsonMixin):
14
14
  # Name of the action, this should be used in the action_callback
15
15
  name: str
16
- # The value associated with the action. This is useful to differentiate between multiple actions with the same name.
17
- value: str
18
- # The label of the action. This is what the user will see. If not provided the name will be used.
16
+ # The parameters to call this action with.
17
+ payload: Dict
18
+ # The label of the action. This is what the user will see.
19
19
  label: str = ""
20
- # The description of the action. This is what the user will see when they hover the action.
21
- description: str = ""
20
+ # The tooltip of the action button. This is what the user will see when they hover the action.
21
+ tooltip: str = ""
22
+ # The lucid icon name for this action.
23
+ icon: Optional[str] = None
22
24
  # This should not be set manually, only used internally.
23
25
  forId: Optional[str] = None
24
26
  # The ID of the action
25
27
  id: str = Field(default_factory=lambda: str(uuid.uuid4()))
26
- # Show the action in a drawer menu
27
- collapsed: bool = False
28
28
 
29
29
  def __post_init__(self) -> None:
30
30
  trace_event(f"init {self.__class__.__name__}")
@@ -38,10 +38,10 @@ def get_configuration():
38
38
  "requireLogin": require_login(),
39
39
  "passwordAuth": config.code.password_auth_callback is not None,
40
40
  "headerAuth": config.code.header_auth_callback is not None,
41
- "cookieAuth": config.project.cookie_auth,
42
41
  "oauthProviders": (
43
42
  get_configured_oauth_providers() if is_oauth_enabled() else []
44
43
  ),
44
+ "default_theme": config.ui.default_theme,
45
45
  }
46
46
 
47
47
 
@@ -13,14 +13,13 @@ _cookie_samesite = cast(
13
13
  os.environ.get("CHAINLIT_COOKIE_SAMESITE", "lax"),
14
14
  )
15
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'."
16
+ assert _cookie_samesite in [
17
+ "lax",
18
+ "strict",
19
+ "none",
20
+ ], (
21
+ "Invalid value for CHAINLIT_COOKIE_SAMESITE. Must be one of 'lax', 'strict' or 'none'."
22
+ )
24
23
  _cookie_secure = _cookie_samesite == "none"
25
24
 
26
25
  _auth_cookie_lifetime = 60 * 60 # 1 hour
@@ -88,7 +87,6 @@ def set_auth_cookie(response: Response, token: str):
88
87
  secure=_cookie_secure,
89
88
  samesite=_cookie_samesite,
90
89
  max_age=_auth_cookie_lifetime,
91
- path="/", # Why is path set here and not below?
92
90
  )
93
91
 
94
92
 
@@ -1,5 +1,5 @@
1
- import datetime
2
1
  import os
2
+ from datetime import datetime, timedelta, timezone
3
3
  from typing import Any, Dict, Optional
4
4
 
5
5
  import jwt as pyjwt
@@ -16,10 +16,12 @@ def create_jwt(data: User) -> str:
16
16
  to_encode: Dict[str, Any] = data.to_dict()
17
17
  to_encode.update(
18
18
  {
19
- "exp": datetime.datetime.utcnow()
20
- + datetime.timedelta(seconds=config.project.user_session_timeout),
19
+ "exp": datetime.now(timezone.utc)
20
+ + timedelta(seconds=config.project.user_session_timeout),
21
+ "iat": datetime.now(timezone.utc), # Add issued at time
21
22
  }
22
23
  )
24
+
23
25
  secret = get_jwt_secret()
24
26
  assert secret
25
27
  encoded_jwt = pyjwt.encode(to_encode, secret, algorithm="HS256")
@@ -325,7 +325,7 @@ def action_callback(name: str) -> Callable:
325
325
  """
326
326
 
327
327
  def decorator(func: Callable[[Action], Any]):
328
- config.code.action_callbacks[name] = wrap_user_function(func, with_task=True)
328
+ config.code.action_callbacks[name] = wrap_user_function(func, with_task=False)
329
329
  return func
330
330
 
331
331
  return decorator
@@ -55,6 +55,7 @@ FILES_DIRECTORY = Path(APP_ROOT) / ".files"
55
55
  FILES_DIRECTORY.mkdir(exist_ok=True)
56
56
 
57
57
  config_dir = os.path.join(APP_ROOT, ".chainlit")
58
+ public_dir = os.path.join(APP_ROOT, "public")
58
59
  config_file = os.path.join(config_dir, "config.toml")
59
60
  config_translation_dir = os.path.join(config_dir, "translations")
60
61
 
@@ -79,9 +80,6 @@ cache = false
79
80
  # Authorized origins
80
81
  allow_origins = ["*"]
81
82
 
82
- # Follow symlink for asset mount (see https://github.com/Chainlit/chainlit/issues/317)
83
- # follow_symlink = false
84
-
85
83
  [features]
86
84
  # Process and display HTML in messages. This can be a security risk (see https://stackoverflow.com/questions/19603097/why-is-it-dangerous-to-render-user-generated-html-or-javascript)
87
85
  unsafe_allow_html = false
@@ -95,9 +93,6 @@ auto_tag_thread = true
95
93
  # Allow users to edit their own messages
96
94
  edit_message = true
97
95
 
98
- # Use httponly cookie for client->server authentication, required to be able to use file upload and elements.
99
- cookie_auth = true
100
-
101
96
  # Authorize users to spontaneously upload files with messages
102
97
  [features.spontaneous_file_upload]
103
98
  enabled = true
@@ -113,12 +108,13 @@ cookie_auth = true
113
108
  # Name of the assistant.
114
109
  name = "Assistant"
115
110
 
111
+ # default_theme = "dark"
112
+
113
+ # layout = "wide"
114
+
116
115
  # Description of the assistant. This is used for HTML tags.
117
116
  # description = ""
118
117
 
119
- # Large size content are by default collapsed for a cleaner ui
120
- default_collapse_content = true
121
-
122
118
  # Chain of Thought (CoT) display mode. Can be "hidden", "tool_call" or "full".
123
119
  cot = "full"
124
120
 
@@ -133,9 +129,6 @@ cot = "full"
133
129
  # The Javascript file can be served from the public directory.
134
130
  # custom_js = "/public/test.js"
135
131
 
136
- # Specify a custom font url.
137
- # custom_font = "https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap"
138
-
139
132
  # Specify a custom meta image url.
140
133
  # custom_meta_image_url = "https://chainlit-cloud.s3.eu-west-3.amazonaws.com/logo/chainlit_banner.png"
141
134
 
@@ -144,36 +137,6 @@ cot = "full"
144
137
  # Be careful: If this is a relative path, it should not start with a slash.
145
138
  # custom_build = "./public/build"
146
139
 
147
- [UI.theme]
148
- default = "dark"
149
- #layout = "wide"
150
- #font_family = "Inter, sans-serif"
151
- # Override default MUI light theme. (Check theme.ts)
152
- [UI.theme.light]
153
- #background = "#FAFAFA"
154
- #paper = "#FFFFFF"
155
-
156
- [UI.theme.light.primary]
157
- #main = "#F80061"
158
- #dark = "#980039"
159
- #light = "#FFE7EB"
160
- [UI.theme.light.text]
161
- #primary = "#212121"
162
- #secondary = "#616161"
163
-
164
- # Override default MUI dark theme. (Check theme.ts)
165
- [UI.theme.dark]
166
- #background = "#FAFAFA"
167
- #paper = "#FFFFFF"
168
-
169
- [UI.theme.dark.primary]
170
- #main = "#F80061"
171
- #dark = "#980039"
172
- #light = "#FFE7EB"
173
- [UI.theme.dark.text]
174
- #primary = "#EEEEEE"
175
- #secondary = "#BDBDBD"
176
-
177
140
  [meta]
178
141
  generated_by = "{__version__}"
179
142
  """
@@ -221,15 +184,6 @@ class Palette(DataClassJsonMixin):
221
184
  text: Optional[TextOptions] = None
222
185
 
223
186
 
224
- @dataclass()
225
- class Theme(DataClassJsonMixin):
226
- font_family: Optional[str] = None
227
- default: Optional[Literal["light", "dark"]] = "dark"
228
- layout: Optional[Literal["default", "wide"]] = "default"
229
- light: Optional[Palette] = None
230
- dark: Optional[Palette] = None
231
-
232
-
233
187
  @dataclass
234
188
  class SpontaneousFileUploadFeature(DataClassJsonMixin):
235
189
  enabled: Optional[bool] = None
@@ -259,14 +213,13 @@ class UISettings(DataClassJsonMixin):
259
213
  name: str
260
214
  description: str = ""
261
215
  cot: Literal["hidden", "tool_call", "full"] = "full"
262
- # Large size content are by default collapsed for a cleaner ui
263
- default_collapse_content: bool = True
216
+ font_family: Optional[str] = None
217
+ default_theme: Optional[Literal["light", "dark"]] = "dark"
218
+ layout: Optional[Literal["default", "wide"]] = "default"
264
219
  github: Optional[str] = None
265
- theme: Optional[Theme] = None
266
220
  # Optional custom CSS file that allows you to customize the UI
267
221
  custom_css: Optional[str] = None
268
222
  custom_js: Optional[str] = None
269
- custom_font: Optional[str] = None
270
223
  # Optional custom meta tag for image preview
271
224
  custom_meta_image_url: Optional[str] = None
272
225
  # Optional custom build directory for the frontend
@@ -328,10 +281,6 @@ class ProjectSettings(DataClassJsonMixin):
328
281
  user_session_timeout: int = 1296000 # 15 days
329
282
  # Enable third parties caching (e.g LangChain cache)
330
283
  cache: bool = False
331
- # Follow symlink for asset mount (see https://github.com/Chainlit/chainlit/issues/317)
332
- follow_symlink: bool = False
333
- # Use httponly cookie for client->server authentication, required to be able to use file upload and elements.
334
- cookie_auth: bool = True
335
284
 
336
285
 
337
286
  @dataclass()