chainlit 1.2.0rc0__py3-none-any.whl → 1.3.0rc0__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/__init__.py +0 -10
- chainlit/auth.py +7 -7
- chainlit/callbacks.py +0 -32
- chainlit/cli/__init__.py +2 -0
- chainlit/config.py +7 -11
- chainlit/copilot/dist/index.js +253 -253
- chainlit/data/__init__.py +11 -6
- chainlit/data/dynamodb.py +7 -3
- chainlit/data/literalai.py +168 -59
- chainlit/data/sql_alchemy.py +89 -15
- chainlit/element.py +2 -1
- chainlit/emitter.py +0 -7
- chainlit/frontend/dist/assets/{DailyMotion-aa368b7e.js → DailyMotion-deaa038d.js} +1 -1
- chainlit/frontend/dist/assets/{Facebook-0335db46.js → Facebook-07c55425.js} +1 -1
- chainlit/frontend/dist/assets/{FilePlayer-8d04256c.js → FilePlayer-2acc46b1.js} +1 -1
- chainlit/frontend/dist/assets/{Kaltura-67c9dd31.js → Kaltura-c2689eb3.js} +1 -1
- chainlit/frontend/dist/assets/{Mixcloud-6bbaccf5.js → Mixcloud-79d681a7.js} +1 -1
- chainlit/frontend/dist/assets/{Mux-c2bcb757.js → Mux-549353dc.js} +1 -1
- chainlit/frontend/dist/assets/{Preview-210f3955.js → Preview-000efdea.js} +1 -1
- chainlit/frontend/dist/assets/{SoundCloud-a0276b84.js → SoundCloud-81b2bf43.js} +1 -1
- chainlit/frontend/dist/assets/{Streamable-a007323d.js → Streamable-032d3cc5.js} +1 -1
- chainlit/frontend/dist/assets/{Twitch-e6a88aa3.js → Twitch-43744e0a.js} +1 -1
- chainlit/frontend/dist/assets/{Vidyard-dfb88a35.js → Vidyard-4ac486dc.js} +1 -1
- chainlit/frontend/dist/assets/{Vimeo-3baa13d9.js → Vimeo-7f1f7543.js} +1 -1
- chainlit/frontend/dist/assets/{Wistia-e52f7bef.js → Wistia-d0d070c9.js} +1 -1
- chainlit/frontend/dist/assets/{YouTube-1715f22b.js → YouTube-8a2bf9cd.js} +1 -1
- chainlit/frontend/dist/assets/index-a0fa87f1.js +729 -0
- chainlit/frontend/dist/assets/{react-plotly-55648373.js → react-plotly-39a45803.js} +1 -1
- chainlit/frontend/dist/index.html +1 -1
- chainlit/haystack/callbacks.py +1 -3
- chainlit/input_widget.py +0 -22
- chainlit/langchain/callbacks.py +1 -2
- chainlit/message.py +1 -1
- chainlit/mistralai/__init__.py +0 -1
- chainlit/oauth_providers.py +12 -3
- chainlit/server.py +1 -23
- chainlit/session.py +5 -36
- chainlit/socket.py +2 -51
- chainlit/step.py +4 -3
- chainlit/translations/en-US.json +0 -6
- chainlit/types.py +1 -1
- chainlit/user_session.py +0 -4
- {chainlit-1.2.0rc0.dist-info → chainlit-1.3.0rc0.dist-info}/METADATA +6 -6
- chainlit-1.3.0rc0.dist-info/RECORD +96 -0
- chainlit/assistant.py +0 -16
- chainlit/assistant_settings.py +0 -35
- chainlit/frontend/dist/assets/index-bfdd8585.js +0 -729
- chainlit/translations/fr-FR.json +0 -236
- chainlit-1.2.0rc0.dist-info/RECORD +0 -99
- {chainlit-1.2.0rc0.dist-info → chainlit-1.3.0rc0.dist-info}/WHEEL +0 -0
- {chainlit-1.2.0rc0.dist-info → chainlit-1.3.0rc0.dist-info}/entry_points.txt +0 -0
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
<script>
|
|
22
22
|
const global = globalThis;
|
|
23
23
|
</script>
|
|
24
|
-
<script type="module" crossorigin src="/assets/index-
|
|
24
|
+
<script type="module" crossorigin src="/assets/index-a0fa87f1.js"></script>
|
|
25
25
|
<link rel="stylesheet" href="/assets/index-aaf974a9.css">
|
|
26
26
|
</head>
|
|
27
27
|
<body>
|
chainlit/haystack/callbacks.py
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import re
|
|
2
2
|
from typing import Any, Generic, List, Optional, TypeVar
|
|
3
3
|
|
|
4
|
-
from chainlit
|
|
4
|
+
from chainlit import Message
|
|
5
5
|
from chainlit.step import Step
|
|
6
6
|
from chainlit.sync import run_sync
|
|
7
7
|
from haystack.agents import Agent, Tool
|
|
8
8
|
from haystack.agents.agent_step import AgentStep
|
|
9
9
|
from literalai.helper import utc_now
|
|
10
10
|
|
|
11
|
-
from chainlit import Message
|
|
12
|
-
|
|
13
11
|
T = TypeVar("T")
|
|
14
12
|
|
|
15
13
|
|
chainlit/input_widget.py
CHANGED
|
@@ -161,28 +161,6 @@ class NumberInput(InputWidget):
|
|
|
161
161
|
"description": self.description,
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
-
@dataclass
|
|
165
|
-
class FileUploadInput(InputWidget):
|
|
166
|
-
"""Useful to create a file upload input."""
|
|
167
|
-
|
|
168
|
-
type: InputWidgetType = "fileupload"
|
|
169
|
-
initial: Optional[str] = None
|
|
170
|
-
placeholder: Optional[str] = None
|
|
171
|
-
accept: List[str] = Field(default_factory=lambda: [])
|
|
172
|
-
max_size_mb: Optional[int] = None
|
|
173
|
-
max_files: Optional[int] = None
|
|
174
|
-
|
|
175
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
176
|
-
return {
|
|
177
|
-
"type": self.type,
|
|
178
|
-
"id": self.id,
|
|
179
|
-
"label": self.label,
|
|
180
|
-
"initial": self.initial,
|
|
181
|
-
"placeholder": self.placeholder,
|
|
182
|
-
"tooltip": self.tooltip,
|
|
183
|
-
"description": self.description,
|
|
184
|
-
}
|
|
185
|
-
|
|
186
164
|
|
|
187
165
|
@dataclass
|
|
188
166
|
class Tags(InputWidget):
|
chainlit/langchain/callbacks.py
CHANGED
|
@@ -9,11 +9,10 @@ from chainlit.step import Step
|
|
|
9
9
|
from langchain.callbacks.tracers.base import BaseTracer
|
|
10
10
|
from langchain.callbacks.tracers.schemas import Run
|
|
11
11
|
from langchain.schema import BaseMessage
|
|
12
|
-
from langchain.schema.output import ChatGenerationChunk, GenerationChunk
|
|
13
12
|
from langchain_core.outputs import ChatGenerationChunk, GenerationChunk
|
|
14
13
|
from literalai import ChatGeneration, CompletionGeneration, GenerationMessage
|
|
15
14
|
from literalai.helper import utc_now
|
|
16
|
-
from literalai.step import TrueStepType
|
|
15
|
+
from literalai.observability.step import TrueStepType
|
|
17
16
|
|
|
18
17
|
DEFAULT_ANSWER_PREFIX_TOKENS = ["Final", "Answer", ":"]
|
|
19
18
|
|
chainlit/message.py
CHANGED
chainlit/mistralai/__init__.py
CHANGED
chainlit/oauth_providers.py
CHANGED
|
@@ -37,6 +37,7 @@ class GithubOAuthProvider(OAuthProvider):
|
|
|
37
37
|
self.client_secret = os.environ.get("OAUTH_GITHUB_CLIENT_SECRET")
|
|
38
38
|
self.authorize_params = {
|
|
39
39
|
"scope": "user:email",
|
|
40
|
+
"prompt": "consent",
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
async def get_token(self, code: str, url: str):
|
|
@@ -95,6 +96,7 @@ class GoogleOAuthProvider(OAuthProvider):
|
|
|
95
96
|
"scope": "https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email",
|
|
96
97
|
"response_type": "code",
|
|
97
98
|
"access_type": "offline",
|
|
99
|
+
"prompt": "login",
|
|
98
100
|
}
|
|
99
101
|
|
|
100
102
|
async def get_token(self, code: str, url: str):
|
|
@@ -162,6 +164,7 @@ class AzureADOAuthProvider(OAuthProvider):
|
|
|
162
164
|
"response_type": "code",
|
|
163
165
|
"scope": "https://graph.microsoft.com/User.Read",
|
|
164
166
|
"response_mode": "query",
|
|
167
|
+
"prompt": "login",
|
|
165
168
|
}
|
|
166
169
|
|
|
167
170
|
async def get_token(self, code: str, url: str):
|
|
@@ -207,7 +210,7 @@ class AzureADOAuthProvider(OAuthProvider):
|
|
|
207
210
|
azure_user["image"] = (
|
|
208
211
|
f"data:{photo_response.headers['Content-Type']};base64,{base64_image.decode('utf-8')}"
|
|
209
212
|
)
|
|
210
|
-
except Exception
|
|
213
|
+
except Exception:
|
|
211
214
|
# Ignore errors getting the photo
|
|
212
215
|
pass
|
|
213
216
|
|
|
@@ -246,6 +249,7 @@ class AzureADHybridOAuthProvider(OAuthProvider):
|
|
|
246
249
|
"scope": "https://graph.microsoft.com/User.Read https://graph.microsoft.com/openid",
|
|
247
250
|
"response_mode": "form_post",
|
|
248
251
|
"nonce": nonce,
|
|
252
|
+
"prompt": "login",
|
|
249
253
|
}
|
|
250
254
|
|
|
251
255
|
async def get_token(self, code: str, url: str):
|
|
@@ -291,7 +295,7 @@ class AzureADHybridOAuthProvider(OAuthProvider):
|
|
|
291
295
|
azure_user["image"] = (
|
|
292
296
|
f"data:{photo_response.headers['Content-Type']};base64,{base64_image.decode('utf-8')}"
|
|
293
297
|
)
|
|
294
|
-
except Exception
|
|
298
|
+
except Exception:
|
|
295
299
|
# Ignore errors getting the photo
|
|
296
300
|
pass
|
|
297
301
|
|
|
@@ -325,6 +329,7 @@ class OktaOAuthProvider(OAuthProvider):
|
|
|
325
329
|
"response_type": "code",
|
|
326
330
|
"scope": "openid profile email",
|
|
327
331
|
"response_mode": "query",
|
|
332
|
+
"prompt": "login",
|
|
328
333
|
}
|
|
329
334
|
|
|
330
335
|
def get_authorization_server_path(self):
|
|
@@ -396,6 +401,7 @@ class Auth0OAuthProvider(OAuthProvider):
|
|
|
396
401
|
"response_type": "code",
|
|
397
402
|
"scope": "openid profile email",
|
|
398
403
|
"audience": f"{self.original_domain}/userinfo",
|
|
404
|
+
"prompt": "login",
|
|
399
405
|
}
|
|
400
406
|
|
|
401
407
|
async def get_token(self, code: str, url: str):
|
|
@@ -442,7 +448,7 @@ class DescopeOAuthProvider(OAuthProvider):
|
|
|
442
448
|
id = "descope"
|
|
443
449
|
env = ["OAUTH_DESCOPE_CLIENT_ID", "OAUTH_DESCOPE_CLIENT_SECRET"]
|
|
444
450
|
# Ensure that the domain does not have a trailing slash
|
|
445
|
-
domain =
|
|
451
|
+
domain = "https://api.descope.com/oauth2/v1"
|
|
446
452
|
|
|
447
453
|
authorize_url = f"{domain}/authorize"
|
|
448
454
|
|
|
@@ -453,6 +459,7 @@ class DescopeOAuthProvider(OAuthProvider):
|
|
|
453
459
|
"response_type": "code",
|
|
454
460
|
"scope": "openid profile email",
|
|
455
461
|
"audience": f"{self.domain}/userinfo",
|
|
462
|
+
"prompt": "login",
|
|
456
463
|
}
|
|
457
464
|
|
|
458
465
|
async def get_token(self, code: str, url: str):
|
|
@@ -511,6 +518,7 @@ class AWSCognitoOAuthProvider(OAuthProvider):
|
|
|
511
518
|
"response_type": "code",
|
|
512
519
|
"client_id": self.client_id,
|
|
513
520
|
"scope": "openid profile email",
|
|
521
|
+
"prompt": "login",
|
|
514
522
|
}
|
|
515
523
|
|
|
516
524
|
async def get_token(self, code: str, url: str):
|
|
@@ -579,6 +587,7 @@ class GitlabOAuthProvider(OAuthProvider):
|
|
|
579
587
|
self.authorize_params = {
|
|
580
588
|
"scope": "openid profile email",
|
|
581
589
|
"response_type": "code",
|
|
590
|
+
"prompt": "login",
|
|
582
591
|
}
|
|
583
592
|
|
|
584
593
|
async def get_token(self, code: str, url: str):
|
chainlit/server.py
CHANGED
|
@@ -228,6 +228,7 @@ app.mount(
|
|
|
228
228
|
name="copilot",
|
|
229
229
|
)
|
|
230
230
|
|
|
231
|
+
|
|
231
232
|
# -------------------------------------------------------------------------------
|
|
232
233
|
# SLACK HANDLER
|
|
233
234
|
# -------------------------------------------------------------------------------
|
|
@@ -984,29 +985,6 @@ async def get_avatar(avatar_id: str):
|
|
|
984
985
|
return await get_favicon()
|
|
985
986
|
|
|
986
987
|
|
|
987
|
-
# post avatar/{avatar_id} (only for authenticated users)
|
|
988
|
-
@router.post("/avatars/{avatar_id}")
|
|
989
|
-
async def upload_avatar(
|
|
990
|
-
avatar_id: str,
|
|
991
|
-
file: UploadFile,
|
|
992
|
-
current_user: Annotated[
|
|
993
|
-
Union[None, User, PersistedUser], Depends(get_current_user)
|
|
994
|
-
],
|
|
995
|
-
):
|
|
996
|
-
try:
|
|
997
|
-
avatar_path = os.path.join(APP_ROOT, "public", "avatars", avatar_id)
|
|
998
|
-
|
|
999
|
-
# Ensure the avatars directory exists
|
|
1000
|
-
os.makedirs(os.path.dirname(avatar_path), exist_ok=True)
|
|
1001
|
-
|
|
1002
|
-
with open(avatar_path, "wb") as f:
|
|
1003
|
-
f.write(await file.read())
|
|
1004
|
-
except Exception as e:
|
|
1005
|
-
raise HTTPException(status_code=500, detail=str(e))
|
|
1006
|
-
|
|
1007
|
-
return {"id": avatar_id}
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
988
|
@router.head("/")
|
|
1011
989
|
def status_check():
|
|
1012
990
|
"""Check if the site is operational."""
|
chainlit/session.py
CHANGED
|
@@ -3,26 +3,14 @@ import json
|
|
|
3
3
|
import mimetypes
|
|
4
4
|
import shutil
|
|
5
5
|
import uuid
|
|
6
|
-
from typing import
|
|
7
|
-
TYPE_CHECKING,
|
|
8
|
-
Any,
|
|
9
|
-
Callable,
|
|
10
|
-
Deque,
|
|
11
|
-
Dict,
|
|
12
|
-
List,
|
|
13
|
-
Literal,
|
|
14
|
-
Optional,
|
|
15
|
-
Union,
|
|
16
|
-
)
|
|
6
|
+
from typing import TYPE_CHECKING, Any, Callable, Deque, Dict, Literal, Optional, Union
|
|
17
7
|
|
|
18
8
|
import aiofiles
|
|
19
|
-
from chainlit.assistant import Assistant
|
|
20
9
|
from chainlit.logger import logger
|
|
10
|
+
from chainlit.types import FileReference
|
|
21
11
|
|
|
22
12
|
if TYPE_CHECKING:
|
|
23
|
-
from chainlit.
|
|
24
|
-
from chainlit.step import Step
|
|
25
|
-
from chainlit.types import FileDict, FileReference
|
|
13
|
+
from chainlit.types import FileDict
|
|
26
14
|
from chainlit.user import PersistedUser, User
|
|
27
15
|
|
|
28
16
|
ClientType = Literal["webapp", "copilot", "teams", "slack", "discord"]
|
|
@@ -73,12 +61,8 @@ class BaseSession:
|
|
|
73
61
|
user_env: Optional[Dict[str, str]],
|
|
74
62
|
# Chat profile selected before the session was created
|
|
75
63
|
chat_profile: Optional[str] = None,
|
|
76
|
-
# Selected assistant
|
|
77
|
-
selected_assistant: Optional[Assistant] = None,
|
|
78
64
|
# Origin of the request
|
|
79
65
|
http_referer: Optional[str] = None,
|
|
80
|
-
# assistant settings
|
|
81
|
-
assistant_settings: Optional[Dict[str, Any]] = None,
|
|
82
66
|
):
|
|
83
67
|
if thread_id:
|
|
84
68
|
self.thread_id_to_resume = thread_id
|
|
@@ -91,13 +75,11 @@ class BaseSession:
|
|
|
91
75
|
self.chat_profile = chat_profile
|
|
92
76
|
self.http_referer = http_referer
|
|
93
77
|
|
|
94
|
-
self.files
|
|
78
|
+
self.files: Dict[str, FileDict] = {}
|
|
95
79
|
|
|
96
80
|
self.id = id
|
|
97
81
|
|
|
98
|
-
self.assistant_settings = assistant_settings
|
|
99
82
|
self.chat_settings: Dict[str, Any] = {}
|
|
100
|
-
self.selected_assistant = selected_assistant
|
|
101
83
|
|
|
102
84
|
@property
|
|
103
85
|
def files_dir(self):
|
|
@@ -111,7 +93,7 @@ class BaseSession:
|
|
|
111
93
|
mime: str,
|
|
112
94
|
path: Optional[str] = None,
|
|
113
95
|
content: Optional[Union[bytes, str]] = None,
|
|
114
|
-
) ->
|
|
96
|
+
) -> FileReference:
|
|
115
97
|
if not path and not content:
|
|
116
98
|
raise ValueError(
|
|
117
99
|
"Either path or content must be provided to persist a file"
|
|
@@ -160,7 +142,6 @@ class BaseSession:
|
|
|
160
142
|
user_session = user_sessions.get(self.id) or {} # type: Dict
|
|
161
143
|
user_session["chat_settings"] = self.chat_settings
|
|
162
144
|
user_session["chat_profile"] = self.chat_profile
|
|
163
|
-
user_session["selected_assistant"] = self.selected_assistant
|
|
164
145
|
user_session["http_referer"] = self.http_referer
|
|
165
146
|
user_session["client_type"] = self.client_type
|
|
166
147
|
metadata = clean_metadata(user_session)
|
|
@@ -184,10 +165,6 @@ class HTTPSession(BaseSession):
|
|
|
184
165
|
user_env: Optional[Dict[str, str]] = None,
|
|
185
166
|
# Origin of the request
|
|
186
167
|
http_referer: Optional[str] = None,
|
|
187
|
-
# assistant settings
|
|
188
|
-
assistant_settings: Optional[Dict[str, Any]] = None,
|
|
189
|
-
# selected assistant
|
|
190
|
-
selected_assistant: Optional[Assistant] = None,
|
|
191
168
|
):
|
|
192
169
|
super().__init__(
|
|
193
170
|
id=id,
|
|
@@ -197,8 +174,6 @@ class HTTPSession(BaseSession):
|
|
|
197
174
|
client_type=client_type,
|
|
198
175
|
user_env=user_env,
|
|
199
176
|
http_referer=http_referer,
|
|
200
|
-
assistant_settings=assistant_settings,
|
|
201
|
-
selected_assistant=selected_assistant,
|
|
202
177
|
)
|
|
203
178
|
|
|
204
179
|
def delete(self):
|
|
@@ -245,14 +220,10 @@ class WebsocketSession(BaseSession):
|
|
|
245
220
|
token: Optional[str] = None,
|
|
246
221
|
# Chat profile selected before the session was created
|
|
247
222
|
chat_profile: Optional[str] = None,
|
|
248
|
-
# Selected assistant
|
|
249
|
-
selected_assistant: Optional[Assistant] = None,
|
|
250
223
|
# Languages of the user's browser
|
|
251
224
|
languages: Optional[str] = None,
|
|
252
225
|
# Origin of the request
|
|
253
226
|
http_referer: Optional[str] = None,
|
|
254
|
-
# chat settings
|
|
255
|
-
assistant_settings: Optional[Dict[str, Any]] = None,
|
|
256
227
|
):
|
|
257
228
|
super().__init__(
|
|
258
229
|
id=id,
|
|
@@ -262,9 +233,7 @@ class WebsocketSession(BaseSession):
|
|
|
262
233
|
user_env=user_env,
|
|
263
234
|
client_type=client_type,
|
|
264
235
|
chat_profile=chat_profile,
|
|
265
|
-
selected_assistant=selected_assistant,
|
|
266
236
|
http_referer=http_referer,
|
|
267
|
-
assistant_settings=assistant_settings,
|
|
268
237
|
)
|
|
269
238
|
|
|
270
239
|
self.socket_id = socket_id
|
chainlit/socket.py
CHANGED
|
@@ -6,7 +6,6 @@ from typing import Any, Dict, Literal
|
|
|
6
6
|
from urllib.parse import unquote
|
|
7
7
|
|
|
8
8
|
from chainlit.action import Action
|
|
9
|
-
from chainlit.assistant import Assistant
|
|
10
9
|
from chainlit.auth import get_current_user, require_login
|
|
11
10
|
from chainlit.chat_context import chat_context
|
|
12
11
|
from chainlit.config import config
|
|
@@ -120,7 +119,7 @@ async def connect(sid, environ):
|
|
|
120
119
|
authorization_header = environ.get("HTTP_AUTHORIZATION")
|
|
121
120
|
token = authorization_header.split(" ")[1] if authorization_header else None
|
|
122
121
|
user = await get_current_user(token=token)
|
|
123
|
-
except Exception
|
|
122
|
+
except Exception:
|
|
124
123
|
logger.info("Authentication failed")
|
|
125
124
|
return False
|
|
126
125
|
|
|
@@ -146,7 +145,7 @@ async def connect(sid, environ):
|
|
|
146
145
|
unquote(url_encoded_chat_profile) if url_encoded_chat_profile else None
|
|
147
146
|
)
|
|
148
147
|
|
|
149
|
-
|
|
148
|
+
WebsocketSession(
|
|
150
149
|
id=session_id,
|
|
151
150
|
socket_id=sid,
|
|
152
151
|
emit=emit_fn,
|
|
@@ -407,51 +406,3 @@ async def change_settings(sid, settings: Dict[str, Any]):
|
|
|
407
406
|
|
|
408
407
|
if config.code.on_settings_update:
|
|
409
408
|
await config.code.on_settings_update(settings)
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
@sio.on("on_create_assistant")
|
|
413
|
-
async def on_create_assistant(sid, options):
|
|
414
|
-
context = init_ws_context(sid)
|
|
415
|
-
logger.info(f"Received request to create assistant {options['settings_values']}")
|
|
416
|
-
if not options["settings_values"].get("id"):
|
|
417
|
-
options["settings_values"]["id"] = str(uuid.uuid4())
|
|
418
|
-
if not options["settings_values"].get("created_by"):
|
|
419
|
-
options["settings_values"]["created_by"] = context.session.user.identifier
|
|
420
|
-
logger.info(
|
|
421
|
-
f"Added id: {options['settings_values']['id']} and created_by: {options['settings_values']['created_by']} to the assistant options"
|
|
422
|
-
)
|
|
423
|
-
if config.code.on_create_assistant:
|
|
424
|
-
new_assistant = Assistant(
|
|
425
|
-
input_widgets=options["input_widgets"],
|
|
426
|
-
settings_values=options["settings_values"],
|
|
427
|
-
)
|
|
428
|
-
await config.code.on_create_assistant(context.session.user, new_assistant)
|
|
429
|
-
return new_assistant.to_dict()
|
|
430
|
-
logger.info("Assistant creation process completed")
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
@sio.on("on_list_assistants")
|
|
434
|
-
async def on_list_assistants(sid):
|
|
435
|
-
context = init_ws_context(sid)
|
|
436
|
-
if config.code.on_list_assistants:
|
|
437
|
-
assistants = await config.code.on_list_assistants(context.session.user)
|
|
438
|
-
return [assistant.to_dict() for assistant in assistants]
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
@sio.on("select_assistant")
|
|
442
|
-
async def select_assistant(sid, selected_assistant: Dict):
|
|
443
|
-
session = WebsocketSession.require(sid)
|
|
444
|
-
|
|
445
|
-
new_assistant = Assistant(
|
|
446
|
-
input_widgets=selected_assistant.get("input_widgets", []),
|
|
447
|
-
settings_values=selected_assistant.get("settings_values", {}),
|
|
448
|
-
)
|
|
449
|
-
|
|
450
|
-
session.selected_assistant = new_assistant
|
|
451
|
-
|
|
452
|
-
user_identifier = session.user.identifier if session.user else "Anonymous user"
|
|
453
|
-
logger.info(
|
|
454
|
-
f"{user_identifier} selected assistant {new_assistant.settings_values.get('name', 'Unknown')} for session with id {session.id}"
|
|
455
|
-
)
|
|
456
|
-
|
|
457
|
-
return new_assistant.to_dict()
|
chainlit/step.py
CHANGED
|
@@ -16,7 +16,7 @@ from chainlit.telemetry import trace_event
|
|
|
16
16
|
from chainlit.types import FeedbackDict
|
|
17
17
|
from literalai import BaseGeneration
|
|
18
18
|
from literalai.helper import utc_now
|
|
19
|
-
from literalai.step import StepType, TrueStepType
|
|
19
|
+
from literalai.observability.step import StepType, TrueStepType
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
def check_add_step_in_cot(step: "Step"):
|
|
@@ -30,7 +30,7 @@ def check_add_step_in_cot(step: "Step"):
|
|
|
30
30
|
return True
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
def stub_step(step: "Step"):
|
|
33
|
+
def stub_step(step: "Step") -> "StepDict":
|
|
34
34
|
return {
|
|
35
35
|
"type": step.type,
|
|
36
36
|
"name": step.name,
|
|
@@ -189,12 +189,13 @@ class Step:
|
|
|
189
189
|
tags: Optional[List[str]] = None,
|
|
190
190
|
language: Optional[str] = None,
|
|
191
191
|
show_input: Union[bool, str] = "json",
|
|
192
|
+
thread_id: Optional[str] = None,
|
|
192
193
|
):
|
|
193
194
|
trace_event(f"init {self.__class__.__name__} {type}")
|
|
194
195
|
time.sleep(0.001)
|
|
195
196
|
self._input = ""
|
|
196
197
|
self._output = ""
|
|
197
|
-
self.thread_id = context.session.thread_id
|
|
198
|
+
self.thread_id = thread_id or context.session.thread_id
|
|
198
199
|
self.name = name or ""
|
|
199
200
|
self.type = type
|
|
200
201
|
self.id = id or str(uuid.uuid4())
|
chainlit/translations/en-US.json
CHANGED
|
@@ -16,9 +16,6 @@
|
|
|
16
16
|
"newChatButton": {
|
|
17
17
|
"newChat": "New Chat"
|
|
18
18
|
},
|
|
19
|
-
"newAssistantButton": {
|
|
20
|
-
"newAssistant": "New Assistant"
|
|
21
|
-
},
|
|
22
19
|
"tasklist": {
|
|
23
20
|
"TaskList": {
|
|
24
21
|
"title": "🗒️ Task List",
|
|
@@ -112,9 +109,6 @@
|
|
|
112
109
|
}
|
|
113
110
|
},
|
|
114
111
|
"organisms": {
|
|
115
|
-
"assistantCreationModal": {
|
|
116
|
-
"title": "Create new assistant"
|
|
117
|
-
},
|
|
118
112
|
"chat": {
|
|
119
113
|
"history": {
|
|
120
114
|
"index": {
|
chainlit/types.py
CHANGED
|
@@ -23,7 +23,7 @@ from pydantic import BaseModel
|
|
|
23
23
|
from pydantic.dataclasses import dataclass
|
|
24
24
|
|
|
25
25
|
InputWidgetType = Literal[
|
|
26
|
-
"switch", "slider", "select", "textinput", "tags", "numberinput"
|
|
26
|
+
"switch", "slider", "select", "textinput", "tags", "numberinput"
|
|
27
27
|
]
|
|
28
28
|
|
|
29
29
|
|
chainlit/user_session.py
CHANGED
|
@@ -30,10 +30,6 @@ class UserSession:
|
|
|
30
30
|
user_session["http_referer"] = context.session.http_referer
|
|
31
31
|
user_session["client_type"] = context.session.client_type
|
|
32
32
|
|
|
33
|
-
# store assistant selected by the user
|
|
34
|
-
user_session["selected_assistant"] = context.session.selected_assistant
|
|
35
|
-
user_session["assistant_settings"] = context.session.assistant_settings
|
|
36
|
-
|
|
37
33
|
if isinstance(context.session, WebsocketSession):
|
|
38
34
|
user_session["languages"] = context.session.languages
|
|
39
35
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: chainlit
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.3.0rc0
|
|
4
4
|
Summary: Build Conversational AI.
|
|
5
5
|
Home-page: https://github.com/Chainlit/chainlit
|
|
6
6
|
License: Apache-2.0 license
|
|
@@ -21,7 +21,7 @@ Requires-Dist: fastapi (>=0.110.1,<0.113)
|
|
|
21
21
|
Requires-Dist: filetype (>=1.2.0,<2.0.0)
|
|
22
22
|
Requires-Dist: httpx (>=0.23.0)
|
|
23
23
|
Requires-Dist: lazify (>=0.4.0,<0.5.0)
|
|
24
|
-
Requires-Dist: literalai (==0.0.
|
|
24
|
+
Requires-Dist: literalai (==0.0.623)
|
|
25
25
|
Requires-Dist: nest-asyncio (>=1.6.0,<2.0.0)
|
|
26
26
|
Requires-Dist: numpy (>=1.26,<2.0)
|
|
27
27
|
Requires-Dist: packaging (>=23.1,<24.0)
|
|
@@ -60,8 +60,9 @@ Chainlit is an open-source async Python framework which allows developers to bui
|
|
|
60
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!
|
|
61
61
|
|
|
62
62
|
> [!NOTE]
|
|
63
|
-
> Contact us [here](https://forms.gle/BX3UNBLmTF75KgZVA) for **Enterprise Support**.
|
|
64
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
|
|
|
66
67
|
<p align="center">
|
|
67
68
|
<img src="https://github.com/Chainlit/chainlit/assets/13104895/0c2cc7a9-766c-41d3-aae2-117a2d0eb8ed" alt="Chainlit user interface" width="80%"></img>
|
|
@@ -108,12 +109,11 @@ async def main(message: cl.Message):
|
|
|
108
109
|
None.
|
|
109
110
|
"""
|
|
110
111
|
|
|
111
|
-
final_answer = await cl.Message(content="").send()
|
|
112
112
|
|
|
113
113
|
# Call the tool
|
|
114
|
-
|
|
114
|
+
tool_res = await tool()
|
|
115
115
|
|
|
116
|
-
await
|
|
116
|
+
await cl.Message(content=tool_res).send()
|
|
117
117
|
```
|
|
118
118
|
|
|
119
119
|
Now run it!
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
chainlit/__init__.py,sha256=DS5myAgKWFdM2L2jlXDyKBrZiuCg9N9VmXDXs61YGiU,4324
|
|
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=3t5Z799SLN7CE23DhuXeOfEVA07Hs_1PJRb2WfXmXZI,8723
|
|
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=j6wAlRQG5Kr_2CcVLqm1za94pr0bcC5VY2vDqOHoQFM,17306
|
|
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=vz1SRtAoQcApK2DCF6XJ8IvGwvrXlsALkIzqZxmEgDs,6778390
|
|
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=vfPtgqeHfm5CxZrMHIUXjw7U0wGWYCrQonaEC2SK0vo,13036
|
|
28
|
+
chainlit/frontend/dist/assets/DailyMotion-deaa038d.js,sha256=feRBbCj80OH5TXXLoftE9UvvjOMvY_9ZRAqZcBCx0qQ,2961
|
|
29
|
+
chainlit/frontend/dist/assets/Facebook-07c55425.js,sha256=PUuh_xCwzfLxNbk7BUT9vNSCRCx8bStnXKBfM_x96nQ,3216
|
|
30
|
+
chainlit/frontend/dist/assets/FilePlayer-2acc46b1.js,sha256=2u_pzbCZFqU0qRPWKCoKLALM1rlrAaizV-vmXdrhKMg,9041
|
|
31
|
+
chainlit/frontend/dist/assets/Kaltura-c2689eb3.js,sha256=Wi4aknF-wjhVcc2_Hj6ljFiiGkzyZ8R0yZxdKR3eP3k,2790
|
|
32
|
+
chainlit/frontend/dist/assets/Mixcloud-79d681a7.js,sha256=4W4J5EbOTjhYzC101e__1QBwQackPwH2UUJlL2h_bsk,2638
|
|
33
|
+
chainlit/frontend/dist/assets/Mux-549353dc.js,sha256=rNkQcbcJKCn-DoHwrXM2iYlUl1pWMUBsjvAuWO_ZJg8,5360
|
|
34
|
+
chainlit/frontend/dist/assets/Preview-000efdea.js,sha256=ECr04U8M0q-oU659I_FUyCnHuWOqrFQc5o3hTsCH35E,3011
|
|
35
|
+
chainlit/frontend/dist/assets/SoundCloud-81b2bf43.js,sha256=gR2diUV83oieGtNf9FS4RVPD2spBmwIi3t8DdFfJZ3E,2923
|
|
36
|
+
chainlit/frontend/dist/assets/Streamable-032d3cc5.js,sha256=AFApk1KRKs4HKGvEqO6xN9rPVj3b8u7deIFbdwrHIbs,2935
|
|
37
|
+
chainlit/frontend/dist/assets/Twitch-43744e0a.js,sha256=mIqto5GPsxrPAXJYXBPIWRrSxal7-KkU2cpl1E7VUdo,3083
|
|
38
|
+
chainlit/frontend/dist/assets/Vidyard-4ac486dc.js,sha256=7fRrwfmEo0suQqidmb2DQC5ptjc8N3y6VP5VpTDRCyg,2857
|
|
39
|
+
chainlit/frontend/dist/assets/Vimeo-7f1f7543.js,sha256=7KWPiMrsUuNrR7yVxCEv8l2xbc-daXQICiryImqxWtA,3627
|
|
40
|
+
chainlit/frontend/dist/assets/Wistia-d0d070c9.js,sha256=VpJl5GAM7oMCUUPcszIKMpQ6apgW_vlxsm_lzrCZelI,3514
|
|
41
|
+
chainlit/frontend/dist/assets/YouTube-8a2bf9cd.js,sha256=gOjdnMzqpGL3MAWIEPlxu7A2yN97qpnR6tDblQwHq4Y,4448
|
|
42
|
+
chainlit/frontend/dist/assets/index-a0fa87f1.js,sha256=RzjMgOpp6FftEoFn1kWtqmQsuIfmIyd0Aou4btRoGt0,2755176
|
|
43
|
+
chainlit/frontend/dist/assets/index-aaf974a9.css,sha256=qvl0qUmR5u0JcmJAfkzaZpN-0ZKdQjzqCSE9cnrQpZQ,2559
|
|
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-39a45803.js,sha256=VueovMWAqa5Jk3KjA0NVtOZX6cArSjyjDpFzmAhJtm8,3763471
|
|
47
|
+
chainlit/frontend/dist/favicon.svg,sha256=0Cy8x28obT5eWW3nxZRhsEvu6_zMqrqbg0y6hT3D0Q0,6455
|
|
48
|
+
chainlit/frontend/dist/index.html,sha256=5hF1UYFz7dyJETcX9-ciY31EwO4fcdVIs5372xmHerA,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=CNrkIshIFm-S4MBq6XQaA3wj72w8pSJ4ND2ZuUS2-KE,12761
|
|
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=J46wpkc01XLnytWNLSziillMvfmwXsc-mIUeYDIy59M,7741
|
|
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=494SAbZ2m46KVcpWmxdBtaPVIG1gvEt-1l3rxYlrMbU,5173
|
|
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-1.3.0rc0.dist-info/METADATA,sha256=iRg2Az8XjpOnnCm1JgB3ROvG4w9bEqVi4rEk4Ht6ELQ,6398
|
|
94
|
+
chainlit-1.3.0rc0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
95
|
+
chainlit-1.3.0rc0.dist-info/entry_points.txt,sha256=FrkqdjrFl8juSnvBndniyX7XuKojmUwO4ghRh-CFMQc,45
|
|
96
|
+
chainlit-1.3.0rc0.dist-info/RECORD,,
|
chainlit/assistant.py
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
from typing import List, Dict
|
|
2
|
-
from chainlit.input_widget import InputWidget
|
|
3
|
-
|
|
4
|
-
class Assistant:
|
|
5
|
-
input_widgets: List[InputWidget] = []
|
|
6
|
-
settings_values: Dict = {}
|
|
7
|
-
|
|
8
|
-
def __init__(self, input_widgets: List[InputWidget], settings_values: Dict):
|
|
9
|
-
self.input_widgets = input_widgets
|
|
10
|
-
self.settings_values = settings_values
|
|
11
|
-
|
|
12
|
-
def to_dict(self):
|
|
13
|
-
return {
|
|
14
|
-
"input_widgets": [widget.__repr__() for widget in self.input_widgets],
|
|
15
|
-
"settings_values": self.settings_values
|
|
16
|
-
}
|