chainlit 1.1.202__tar.gz → 1.1.300rc0__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 (87) hide show
  1. {chainlit-1.1.202 → chainlit-1.1.300rc0}/PKG-INFO +6 -7
  2. {chainlit-1.1.202 → chainlit-1.1.300rc0}/README.md +4 -5
  3. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/__init__.py +19 -3
  4. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/config.py +21 -18
  5. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/copilot/dist/index.js +429 -396
  6. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/data/__init__.py +16 -5
  7. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/data/sql_alchemy.py +44 -25
  8. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/discord/app.py +4 -2
  9. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/element.py +4 -12
  10. chainlit-1.1.202/chainlit/frontend/dist/assets/DailyMotion-53376209.js → chainlit-1.1.300rc0/chainlit/frontend/dist/assets/DailyMotion-e54bf0dc.js +1 -1
  11. chainlit-1.1.202/chainlit/frontend/dist/assets/Facebook-aee41f5b.js → chainlit-1.1.300rc0/chainlit/frontend/dist/assets/Facebook-a767c817.js +1 -1
  12. chainlit-1.1.202/chainlit/frontend/dist/assets/FilePlayer-b2cdb30f.js → chainlit-1.1.300rc0/chainlit/frontend/dist/assets/FilePlayer-5d19f3d1.js +1 -1
  13. chainlit-1.1.202/chainlit/frontend/dist/assets/Kaltura-51db0377.js → chainlit-1.1.300rc0/chainlit/frontend/dist/assets/Kaltura-93bef413.js +1 -1
  14. chainlit-1.1.202/chainlit/frontend/dist/assets/Mixcloud-cb900886.js → chainlit-1.1.300rc0/chainlit/frontend/dist/assets/Mixcloud-d5d27c2a.js +1 -1
  15. chainlit-1.1.202/chainlit/frontend/dist/assets/Mux-79ac59e6.js → chainlit-1.1.300rc0/chainlit/frontend/dist/assets/Mux-ad063035.js +1 -1
  16. chainlit-1.1.202/chainlit/frontend/dist/assets/Preview-cfe7584c.js → chainlit-1.1.300rc0/chainlit/frontend/dist/assets/Preview-a9a0e47e.js +1 -1
  17. chainlit-1.1.202/chainlit/frontend/dist/assets/SoundCloud-a985707c.js → chainlit-1.1.300rc0/chainlit/frontend/dist/assets/SoundCloud-1698c4da.js +1 -1
  18. chainlit-1.1.202/chainlit/frontend/dist/assets/Streamable-3d89aab5.js → chainlit-1.1.300rc0/chainlit/frontend/dist/assets/Streamable-e5832da9.js +1 -1
  19. chainlit-1.1.202/chainlit/frontend/dist/assets/Twitch-bf016588.js → chainlit-1.1.300rc0/chainlit/frontend/dist/assets/Twitch-cd321ef4.js +1 -1
  20. chainlit-1.1.202/chainlit/frontend/dist/assets/Vidyard-1891ecd7.js → chainlit-1.1.300rc0/chainlit/frontend/dist/assets/Vidyard-8646c638.js +1 -1
  21. chainlit-1.1.202/chainlit/frontend/dist/assets/Vimeo-0645662c.js → chainlit-1.1.300rc0/chainlit/frontend/dist/assets/Vimeo-0e590e3a.js +1 -1
  22. chainlit-1.1.202/chainlit/frontend/dist/assets/Wistia-3b449fe2.js → chainlit-1.1.300rc0/chainlit/frontend/dist/assets/Wistia-76f0c9b0.js +1 -1
  23. chainlit-1.1.202/chainlit/frontend/dist/assets/YouTube-5ea2381e.js → chainlit-1.1.300rc0/chainlit/frontend/dist/assets/YouTube-a94756f4.js +1 -1
  24. chainlit-1.1.300rc0/chainlit/frontend/dist/assets/index-51fef15f.js +727 -0
  25. chainlit-1.1.300rc0/chainlit/frontend/dist/assets/index-53c62926.css +1 -0
  26. chainlit-1.1.202/chainlit/frontend/dist/assets/react-plotly-2ff19c9f.js → chainlit-1.1.300rc0/chainlit/frontend/dist/assets/react-plotly-d9ffbf69.js +1 -1
  27. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/frontend/dist/index.html +2 -2
  28. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/langchain/callbacks.py +4 -2
  29. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/llama_index/callbacks.py +2 -2
  30. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/message.py +17 -17
  31. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/server.py +38 -38
  32. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/slack/app.py +0 -1
  33. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/socket.py +1 -3
  34. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/step.py +24 -25
  35. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/translations/en-US.json +1 -3
  36. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/types.py +10 -0
  37. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/utils.py +4 -3
  38. {chainlit-1.1.202 → chainlit-1.1.300rc0}/pyproject.toml +21 -20
  39. chainlit-1.1.202/chainlit/frontend/dist/assets/index-a0c5a67e.js +0 -698
  40. chainlit-1.1.202/chainlit/frontend/dist/assets/index-d088547c.css +0 -1
  41. chainlit-1.1.202/chainlit/playground/__init__.py +0 -2
  42. chainlit-1.1.202/chainlit/playground/config.py +0 -36
  43. chainlit-1.1.202/chainlit/playground/provider.py +0 -108
  44. chainlit-1.1.202/chainlit/playground/providers/__init__.py +0 -11
  45. chainlit-1.1.202/chainlit/playground/providers/anthropic.py +0 -118
  46. chainlit-1.1.202/chainlit/playground/providers/huggingface.py +0 -75
  47. chainlit-1.1.202/chainlit/playground/providers/langchain.py +0 -89
  48. chainlit-1.1.202/chainlit/playground/providers/openai.py +0 -386
  49. chainlit-1.1.202/chainlit/playground/providers/vertexai.py +0 -171
  50. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/__main__.py +0 -0
  51. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/action.py +0 -0
  52. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/auth.py +0 -0
  53. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/cache.py +0 -0
  54. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/chat_settings.py +0 -0
  55. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/cli/__init__.py +0 -0
  56. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/cli/utils.py +0 -0
  57. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/context.py +0 -0
  58. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/copilot/dist/assets/logo_dark-2a3cf740.svg +0 -0
  59. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/copilot/dist/assets/logo_light-b078e7bc.svg +0 -0
  60. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/data/acl.py +0 -0
  61. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/data/storage_clients.py +0 -0
  62. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/discord/__init__.py +0 -0
  63. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/emitter.py +0 -0
  64. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/frontend/dist/assets/logo_dark-2a3cf740.svg +0 -0
  65. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/frontend/dist/assets/logo_light-b078e7bc.svg +0 -0
  66. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/frontend/dist/favicon.svg +0 -0
  67. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/haystack/__init__.py +0 -0
  68. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/haystack/callbacks.py +0 -0
  69. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/hello.py +0 -0
  70. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/input_widget.py +0 -0
  71. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/langchain/__init__.py +0 -0
  72. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/langflow/__init__.py +0 -0
  73. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/llama_index/__init__.py +0 -0
  74. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/logger.py +0 -0
  75. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/markdown.py +0 -0
  76. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/oauth_providers.py +0 -0
  77. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/openai/__init__.py +0 -0
  78. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/py.typed +0 -0
  79. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/secret.py +0 -0
  80. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/session.py +0 -0
  81. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/slack/__init__.py +0 -0
  82. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/sync.py +0 -0
  83. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/telemetry.py +0 -0
  84. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/translations.py +0 -0
  85. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/user.py +0 -0
  86. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/user_session.py +0 -0
  87. {chainlit-1.1.202 → chainlit-1.1.300rc0}/chainlit/version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: chainlit
3
- Version: 1.1.202
3
+ Version: 1.1.300rc0
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.601)
25
+ Requires-Dist: literalai (==0.0.602)
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)
@@ -46,9 +46,6 @@ Description-Content-Type: text/markdown
46
46
 
47
47
  **Build production-ready Conversational AI applications in minutes, not weeks ⚡️**
48
48
 
49
- > [!NOTE]
50
- > You can ask Chainlit related questions to [Chainlit Help](https://help.chainlit.io/)! Also available on the Discord `@Chainlit Help`. Proudly built with Chainlit!
51
-
52
49
  Chainlit is an open-source async Python framework which allows developers to build scalable Conversational AI or agentic applications.
53
50
 
54
51
  - ✅ ChatGPT-like application
@@ -57,9 +54,11 @@ Chainlit is an open-source async Python framework which allows developers to bui
57
54
  - ✅ Custom frontend (build your own agentic experience)
58
55
  - ✅ API Endpoint
59
56
 
60
- Full documentation is available [here](https://docs.chainlit.io).
57
+ 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!
61
58
 
62
- Contact us [here](https://forms.gle/BX3UNBLmTF75KgZVA) for **Enterprise Support** and to get early access to Literal AI, our product to evaluate and monitor LLM applications.
59
+ > [!NOTE]
60
+ > Contact us [here](https://forms.gle/BX3UNBLmTF75KgZVA) for **Enterprise Support**.
61
+ > 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.
63
62
 
64
63
  https://github.com/Chainlit/chainlit/assets/13104895/8882af90-fdfa-4b24-8200-1ee96c6c7490
65
64
 
@@ -6,9 +6,6 @@
6
6
 
7
7
  **Build production-ready Conversational AI applications in minutes, not weeks ⚡️**
8
8
 
9
- > [!NOTE]
10
- > You can ask Chainlit related questions to [Chainlit Help](https://help.chainlit.io/)! Also available on the Discord `@Chainlit Help`. Proudly built with Chainlit!
11
-
12
9
  Chainlit is an open-source async Python framework which allows developers to build scalable Conversational AI or agentic applications.
13
10
 
14
11
  - ✅ ChatGPT-like application
@@ -17,9 +14,11 @@ Chainlit is an open-source async Python framework which allows developers to bui
17
14
  - ✅ Custom frontend (build your own agentic experience)
18
15
  - ✅ API Endpoint
19
16
 
20
- Full documentation is available [here](https://docs.chainlit.io).
17
+ 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!
21
18
 
22
- Contact us [here](https://forms.gle/BX3UNBLmTF75KgZVA) for **Enterprise Support** and to get early access to Literal AI, our product to evaluate and monitor LLM applications.
19
+ > [!NOTE]
20
+ > Contact us [here](https://forms.gle/BX3UNBLmTF75KgZVA) for **Enterprise Support**.
21
+ > 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
22
 
24
23
  https://github.com/Chainlit/chainlit/assets/13104895/8882af90-fdfa-4b24-8200-1ee96c6c7490
25
24
 
@@ -28,7 +28,6 @@ from chainlit.config import config
28
28
  from chainlit.context import context
29
29
  from chainlit.element import (
30
30
  Audio,
31
- Avatar,
32
31
  File,
33
32
  Image,
34
33
  Pdf,
@@ -52,7 +51,7 @@ from chainlit.oauth_providers import get_configured_oauth_providers
52
51
  from chainlit.step import Step, step
53
52
  from chainlit.sync import make_async, run_sync
54
53
  from chainlit.telemetry import trace
55
- from chainlit.types import AudioChunk, ChatProfile, ThreadDict
54
+ from chainlit.types import AudioChunk, ChatProfile, Starter, ThreadDict
56
55
  from chainlit.user import PersistedUser, User
57
56
  from chainlit.user_session import user_session
58
57
  from chainlit.utils import make_module_getattr, wrap_user_function
@@ -208,6 +207,22 @@ def set_chat_profiles(
208
207
  return func
209
208
 
210
209
 
210
+ @trace
211
+ def set_starters(func: Callable[[Optional["User"]], List["Starter"]]) -> Callable:
212
+ """
213
+ Programmatic declaration of the available starter (can depend on the User from the session if authentication is setup).
214
+
215
+ Args:
216
+ func (Callable[[Optional["User"]], List["Starter"]]): The function declaring the starters.
217
+
218
+ Returns:
219
+ Callable[[Optional["User"]], List["Starter"]]: The decorated function.
220
+ """
221
+
222
+ config.code.set_starters = wrap_user_function(func)
223
+ return func
224
+
225
+
211
226
  @trace
212
227
  def on_chat_end(func: Callable) -> Callable:
213
228
  """
@@ -348,6 +363,8 @@ __getattr__ = make_module_getattr(
348
363
  )
349
364
 
350
365
  __all__ = [
366
+ "ChatProfile",
367
+ "Starter",
351
368
  "user_session",
352
369
  "CopilotFunction",
353
370
  "AudioChunk",
@@ -359,7 +376,6 @@ __all__ = [
359
376
  "Plotly",
360
377
  "Image",
361
378
  "Text",
362
- "Avatar",
363
379
  "Pyplot",
364
380
  "File",
365
381
  "Task",
@@ -4,7 +4,7 @@ import site
4
4
  import sys
5
5
  from importlib import util
6
6
  from pathlib import Path
7
- from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Union, Literal
7
+ from typing import TYPE_CHECKING, Any, Callable, Dict, List, Literal, Optional, Union
8
8
 
9
9
  import tomli
10
10
  from chainlit.logger import logger
@@ -18,7 +18,7 @@ if TYPE_CHECKING:
18
18
  from chainlit.action import Action
19
19
  from chainlit.element import ElementBased
20
20
  from chainlit.message import Message
21
- from chainlit.types import AudioChunk, ChatProfile, ThreadDict
21
+ from chainlit.types import AudioChunk, ChatProfile, Starter, ThreadDict
22
22
  from chainlit.user import User
23
23
  from fastapi import Request, Response
24
24
 
@@ -61,9 +61,6 @@ allow_origins = ["*"]
61
61
  # follow_symlink = false
62
62
 
63
63
  [features]
64
- # Show the prompt playground
65
- prompt_playground = true
66
-
67
64
  # 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)
68
65
  unsafe_allow_html = false
69
66
 
@@ -95,21 +92,15 @@ auto_tag_thread = true
95
92
  sample_rate = 44100
96
93
 
97
94
  [UI]
98
- # Name of the app and chatbot.
99
- name = "Chatbot"
100
-
101
- # Show the readme while the thread is empty.
102
- show_readme_as_default = true
95
+ # Name of the assistant.
96
+ name = "Assistant"
103
97
 
104
- # Description of the app and chatbot. This is used for HTML tags.
98
+ # Description of the assistant. This is used for HTML tags.
105
99
  # description = ""
106
100
 
107
101
  # Large size content are by default collapsed for a cleaner ui
108
102
  default_collapse_content = true
109
103
 
110
- # The default value for the expand messages settings.
111
- default_expand_messages = false
112
-
113
104
  # Hide the chain of thought details from the user in the UI.
114
105
  hide_cot = false
115
106
 
@@ -136,6 +127,7 @@ hide_cot = false
136
127
  # custom_build = "./public/build"
137
128
 
138
129
  [UI.theme]
130
+ default = "dark"
139
131
  #layout = "wide"
140
132
  #font_family = "Inter, sans-serif"
141
133
  # Override default MUI light theme. (Check theme.ts)
@@ -147,6 +139,9 @@ hide_cot = false
147
139
  #main = "#F80061"
148
140
  #dark = "#980039"
149
141
  #light = "#FFE7EB"
142
+ [UI.theme.light.text]
143
+ #primary = "#212121"
144
+ #secondary = "#616161"
150
145
 
151
146
  # Override default MUI dark theme. (Check theme.ts)
152
147
  [UI.theme.dark]
@@ -157,7 +152,9 @@ hide_cot = false
157
152
  #main = "#F80061"
158
153
  #dark = "#980039"
159
154
  #light = "#FFE7EB"
160
-
155
+ [UI.theme.dark.text]
156
+ #primary = "#EEEEEE"
157
+ #secondary = "#BDBDBD"
161
158
 
162
159
  [meta]
163
160
  generated_by = "{__version__}"
@@ -188,16 +185,24 @@ class PaletteOptions(DataClassJsonMixin):
188
185
  dark: Optional[str] = ""
189
186
 
190
187
 
188
+ @dataclass()
189
+ class TextOptions(DataClassJsonMixin):
190
+ primary: Optional[str] = ""
191
+ secondary: Optional[str] = ""
192
+
193
+
191
194
  @dataclass()
192
195
  class Palette(DataClassJsonMixin):
193
196
  primary: Optional[PaletteOptions] = None
194
197
  background: Optional[str] = ""
195
198
  paper: Optional[str] = ""
199
+ text: Optional[TextOptions] = None
196
200
 
197
201
 
198
202
  @dataclass()
199
203
  class Theme(DataClassJsonMixin):
200
204
  font_family: Optional[str] = None
205
+ default: Optional[Literal["light", "dark"]] = "dark"
201
206
  layout: Optional[Literal["default", "wide"]] = "default"
202
207
  light: Optional[Palette] = None
203
208
  dark: Optional[Palette] = None
@@ -224,7 +229,6 @@ class AudioFeature(DataClassJsonMixin):
224
229
 
225
230
  @dataclass()
226
231
  class FeaturesSettings(DataClassJsonMixin):
227
- prompt_playground: bool = True
228
232
  spontaneous_file_upload: Optional[SpontaneousFileUploadFeature] = None
229
233
  audio: Optional[AudioFeature] = Field(default_factory=AudioFeature)
230
234
  latex: bool = False
@@ -235,12 +239,10 @@ class FeaturesSettings(DataClassJsonMixin):
235
239
  @dataclass()
236
240
  class UISettings(DataClassJsonMixin):
237
241
  name: str
238
- show_readme_as_default: bool = True
239
242
  description: str = ""
240
243
  hide_cot: bool = False
241
244
  # Large size content are by default collapsed for a cleaner ui
242
245
  default_collapse_content: bool = True
243
- default_expand_messages: bool = False
244
246
  github: Optional[str] = None
245
247
  theme: Optional[Theme] = None
246
248
  # Optional custom CSS file that allows you to customize the UI
@@ -279,6 +281,7 @@ class CodeSettings:
279
281
  set_chat_profiles: Optional[Callable[[Optional["User"]], List["ChatProfile"]]] = (
280
282
  None
281
283
  )
284
+ set_starters: Optional[Callable[[Optional["User"]], List["Starter"]]] = None
282
285
 
283
286
 
284
287
  @dataclass()