chainlit 2.0rc0__py3-none-any.whl → 2.0.1__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 +49 -54
- chainlit/action.py +12 -10
- chainlit/{auth.py → auth/__init__.py} +20 -34
- chainlit/auth/cookie.py +123 -0
- chainlit/auth/jwt.py +37 -0
- chainlit/callbacks.py +29 -1
- chainlit/chat_context.py +2 -2
- chainlit/chat_settings.py +3 -1
- chainlit/cli/__init__.py +14 -1
- chainlit/config.py +21 -59
- chainlit/context.py +3 -2
- chainlit/copilot/dist/index.js +8319 -1019
- chainlit/data/__init__.py +98 -17
- chainlit/data/acl.py +3 -2
- chainlit/data/base.py +1 -1
- chainlit/data/chainlit_data_layer.py +584 -0
- chainlit/data/dynamodb.py +5 -3
- chainlit/data/literalai.py +4 -6
- chainlit/data/sql_alchemy.py +8 -7
- chainlit/data/storage_clients/azure.py +1 -0
- chainlit/data/storage_clients/azure_blob.py +80 -0
- chainlit/data/storage_clients/base.py +6 -0
- chainlit/data/storage_clients/gcs.py +78 -0
- chainlit/data/storage_clients/s3.py +16 -3
- chainlit/discord/app.py +2 -1
- chainlit/element.py +13 -9
- chainlit/emitter.py +17 -21
- chainlit/frontend/dist/assets/{DailyMotion-CleI-8Dh.js → DailyMotion-B8XgmoRm.js} +1 -1
- chainlit/frontend/dist/assets/Dataframe-VU4lXMbv.js +22 -0
- chainlit/frontend/dist/assets/{Facebook-C4PuTowX.js → Facebook-fVIMi9h_.js} +1 -1
- chainlit/frontend/dist/assets/{FilePlayer-D49YToZz.js → FilePlayer-DlXvvaZa.js} +1 -1
- chainlit/frontend/dist/assets/{Kaltura-BkZcQEIs.js → Kaltura-C48Ui_4V.js} +1 -1
- chainlit/frontend/dist/assets/{Mixcloud-DzvBFYsm.js → Mixcloud-Dmjz7RrS.js} +1 -1
- chainlit/frontend/dist/assets/{Mux-UXPyWWYv.js → Mux-Bqaa3ZzG.js} +1 -1
- chainlit/frontend/dist/assets/{Preview-0YXzpiVm.js → Preview-B2d1Ugq4.js} +1 -1
- chainlit/frontend/dist/assets/{SoundCloud-CS54COex.js → SoundCloud-BGuk87T3.js} +1 -1
- chainlit/frontend/dist/assets/{Streamable-DYYShO6Q.js → Streamable-DOe4rXrG.js} +1 -1
- chainlit/frontend/dist/assets/{Twitch-DG7403Hm.js → Twitch-TA7I2UEi.js} +1 -1
- chainlit/frontend/dist/assets/{Vidyard-C5JbOHIQ.js → Vidyard-B5F6Dk_y.js} +1 -1
- chainlit/frontend/dist/assets/{Vimeo-dFLZbhqH.js → Vimeo-DP_Y98tQ.js} +1 -1
- chainlit/frontend/dist/assets/Wistia-DB26BTg8.js +1 -0
- chainlit/frontend/dist/assets/{YouTube-Dct4gpfH.js → YouTube-CMwwf2TN.js} +1 -1
- chainlit/frontend/dist/assets/index-88S3ZtD5.css +1 -0
- chainlit/frontend/dist/assets/index-D7lZEN9m.js +8665 -0
- chainlit/frontend/dist/assets/{react-plotly-CFHBSMgg.js → react-plotly-28_xImPF.js} +1 -1
- chainlit/frontend/dist/index.html +2 -2
- chainlit/haystack/callbacks.py +5 -4
- chainlit/input_widget.py +6 -4
- chainlit/langchain/callbacks.py +56 -47
- chainlit/langflow/__init__.py +1 -0
- chainlit/llama_index/callbacks.py +7 -7
- chainlit/message.py +6 -7
- chainlit/mistralai/__init__.py +3 -2
- chainlit/oauth_providers.py +70 -3
- chainlit/openai/__init__.py +3 -2
- chainlit/secret.py +1 -1
- chainlit/server.py +483 -199
- chainlit/session.py +7 -5
- chainlit/slack/app.py +3 -2
- chainlit/socket.py +79 -106
- chainlit/step.py +11 -11
- chainlit/sync.py +2 -1
- chainlit/teams/app.py +1 -0
- chainlit/translations/en-US.json +1 -1
- chainlit/translations/nl-NL.json +229 -0
- chainlit/types.py +20 -4
- chainlit/user.py +2 -1
- chainlit/utils.py +3 -2
- {chainlit-2.0rc0.dist-info → chainlit-2.0.1.dist-info}/METADATA +3 -34
- chainlit-2.0.1.dist-info/RECORD +106 -0
- chainlit/frontend/dist/assets/Wistia-143Q9V9c.js +0 -1
- chainlit/frontend/dist/assets/index-2yAiK0R5.js +0 -1091
- chainlit/frontend/dist/assets/index-CwmincdQ.css +0 -1
- chainlit-2.0rc0.dist-info/RECORD +0 -99
- {chainlit-2.0rc0.dist-info → chainlit-2.0.1.dist-info}/WHEEL +0 -0
- {chainlit-2.0rc0.dist-info → chainlit-2.0.1.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
{
|
|
2
|
+
"components": {
|
|
3
|
+
"atoms": {
|
|
4
|
+
"buttons": {
|
|
5
|
+
"userButton": {
|
|
6
|
+
"menu": {
|
|
7
|
+
"settings": "Instellingen",
|
|
8
|
+
"settingsKey": "I",
|
|
9
|
+
"APIKeys": "API-sleutels",
|
|
10
|
+
"logout": "Uitloggen"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"molecules": {
|
|
16
|
+
"newChatButton": {
|
|
17
|
+
"newChat": "Nieuwe Chat"
|
|
18
|
+
},
|
|
19
|
+
"tasklist": {
|
|
20
|
+
"TaskList": {
|
|
21
|
+
"title": "\ud83d\uddd2\ufe0f Takenlijst",
|
|
22
|
+
"loading": "Laden...",
|
|
23
|
+
"error": "Er is een fout opgetreden"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"attachments": {
|
|
27
|
+
"cancelUpload": "Upload annuleren",
|
|
28
|
+
"removeAttachment": "Bijlage verwijderen"
|
|
29
|
+
},
|
|
30
|
+
"newChatDialog": {
|
|
31
|
+
"createNewChat": "Nieuwe chat maken?",
|
|
32
|
+
"clearChat": "Dit zal de huidige berichten wissen en een nieuwe chat starten.",
|
|
33
|
+
"cancel": "Annuleren",
|
|
34
|
+
"confirm": "Bevestigen"
|
|
35
|
+
},
|
|
36
|
+
"settingsModal": {
|
|
37
|
+
"settings": "Instellingen",
|
|
38
|
+
"expandMessages": "Berichten uitbreiden",
|
|
39
|
+
"hideChainOfThought": "Gedachtenketen verbergen",
|
|
40
|
+
"darkMode": "Donkere modus"
|
|
41
|
+
},
|
|
42
|
+
"detailsButton": {
|
|
43
|
+
"using": "Gebruikt",
|
|
44
|
+
"used": "Gebruikt"
|
|
45
|
+
},
|
|
46
|
+
"auth": {
|
|
47
|
+
"authLogin": {
|
|
48
|
+
"title": "Log in om toegang te krijgen tot de app.",
|
|
49
|
+
"form": {
|
|
50
|
+
"email": "E-mailadres",
|
|
51
|
+
"password": "Wachtwoord",
|
|
52
|
+
"noAccount": "Nog geen account?",
|
|
53
|
+
"alreadyHaveAccount": "Al een account?",
|
|
54
|
+
"signup": "Registreren",
|
|
55
|
+
"signin": "Inloggen",
|
|
56
|
+
"or": "OF",
|
|
57
|
+
"continue": "Doorgaan",
|
|
58
|
+
"forgotPassword": "Wachtwoord vergeten?",
|
|
59
|
+
"passwordMustContain": "Uw wachtwoord moet bevatten:",
|
|
60
|
+
"emailRequired": "e-mail is een verplicht veld",
|
|
61
|
+
"passwordRequired": "wachtwoord is een verplicht veld"
|
|
62
|
+
},
|
|
63
|
+
"error": {
|
|
64
|
+
"default": "Inloggen niet mogelijk.",
|
|
65
|
+
"signin": "Probeer in te loggen met een ander account.",
|
|
66
|
+
"oauthsignin": "Probeer in te loggen met een ander account.",
|
|
67
|
+
"redirect_uri_mismatch": "De omleidings-URI komt niet overeen met de oauth-appconfiguratie.",
|
|
68
|
+
"oauthcallbackerror": "Probeer in te loggen met een ander account.",
|
|
69
|
+
"oauthcreateaccount": "Probeer in te loggen met een ander account.",
|
|
70
|
+
"emailcreateaccount": "Probeer in te loggen met een ander account.",
|
|
71
|
+
"callback": "Probeer in te loggen met een ander account.",
|
|
72
|
+
"oauthaccountnotlinked": "Om uw identiteit te bevestigen, log in met hetzelfde account dat u oorspronkelijk gebruikte.",
|
|
73
|
+
"emailsignin": "De e-mail kon niet worden verzonden.",
|
|
74
|
+
"emailverify": "Verifieer uw e-mail, een nieuwe e-mail is verzonden.",
|
|
75
|
+
"credentialssignin": "Inloggen mislukt. Controleer of de verstrekte gegevens correct zijn.",
|
|
76
|
+
"sessionrequired": "Log in om toegang te krijgen tot deze pagina."
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"authVerifyEmail": {
|
|
80
|
+
"almostThere": "Bijna daar! We hebben een e-mail gestuurd naar ",
|
|
81
|
+
"verifyEmailLink": "Klik op de link in die e-mail om uw registratie te voltooien.",
|
|
82
|
+
"didNotReceive": "Kun je de e-mail niet vinden?",
|
|
83
|
+
"resendEmail": "E-mail opnieuw verzenden",
|
|
84
|
+
"goBack": "Ga terug",
|
|
85
|
+
"emailSent": "E-mail succesvol verzonden.",
|
|
86
|
+
"verifyEmail": "Verifieer uw e-mailadres"
|
|
87
|
+
},
|
|
88
|
+
"providerButton": {
|
|
89
|
+
"continue": "Doorgaan met {{provider}}",
|
|
90
|
+
"signup": "Aanmelden met {{provider}}"
|
|
91
|
+
},
|
|
92
|
+
"authResetPassword": {
|
|
93
|
+
"newPasswordRequired": "Nieuw wachtwoord is een verplicht veld",
|
|
94
|
+
"passwordsMustMatch": "Wachtwoorden moeten overeenkomen",
|
|
95
|
+
"confirmPasswordRequired": "Bevestig wachtwoord is een verplicht veld",
|
|
96
|
+
"newPassword": "Nieuw wachtwoord",
|
|
97
|
+
"confirmPassword": "Bevestig wachtwoord",
|
|
98
|
+
"resetPassword": "Wachtwoord resetten"
|
|
99
|
+
},
|
|
100
|
+
"authForgotPassword": {
|
|
101
|
+
"email": "E-mailadres",
|
|
102
|
+
"emailRequired": "e-mail is een verplicht veld",
|
|
103
|
+
"emailSent": "Controleer het e-mailadres {{email}} voor instructies om uw wachtwoord te resetten.",
|
|
104
|
+
"enterEmail": "Voer uw e-mailadres in en we sturen u instructies om uw wachtwoord te resetten.",
|
|
105
|
+
"resendEmail": "E-mail opnieuw verzenden",
|
|
106
|
+
"continue": "Doorgaan",
|
|
107
|
+
"goBack": "Ga terug"
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"organisms": {
|
|
112
|
+
"chat": {
|
|
113
|
+
"history": {
|
|
114
|
+
"index": {
|
|
115
|
+
"showHistory": "Geschiedenis tonen",
|
|
116
|
+
"lastInputs": "Laatste invoer",
|
|
117
|
+
"noInputs": "Zo leeg...",
|
|
118
|
+
"loading": "Laden..."
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"inputBox": {
|
|
122
|
+
"input": {
|
|
123
|
+
"placeholder": "Typ uw bericht hier..."
|
|
124
|
+
},
|
|
125
|
+
"speechButton": {
|
|
126
|
+
"start": "Opname starten",
|
|
127
|
+
"stop": "Opname stoppen"
|
|
128
|
+
},
|
|
129
|
+
"SubmitButton": {
|
|
130
|
+
"sendMessage": "Bericht verzenden",
|
|
131
|
+
"stopTask": "Taak stoppen"
|
|
132
|
+
},
|
|
133
|
+
"UploadButton": {
|
|
134
|
+
"attachFiles": "Bestanden toevoegen"
|
|
135
|
+
},
|
|
136
|
+
"waterMark": {
|
|
137
|
+
"text": "Gebouwd met"
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"Messages": {
|
|
141
|
+
"index": {
|
|
142
|
+
"running": "Bezig",
|
|
143
|
+
"executedSuccessfully": "succesvol uitgevoerd",
|
|
144
|
+
"failed": "mislukt",
|
|
145
|
+
"feedbackUpdated": "Feedback bijgewerkt",
|
|
146
|
+
"updating": "Bijwerken"
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
"dropScreen": {
|
|
150
|
+
"dropYourFilesHere": "Sleep uw bestanden hierheen"
|
|
151
|
+
},
|
|
152
|
+
"index": {
|
|
153
|
+
"failedToUpload": "Uploaden mislukt",
|
|
154
|
+
"cancelledUploadOf": "Upload geannuleerd van",
|
|
155
|
+
"couldNotReachServer": "Server niet bereikbaar",
|
|
156
|
+
"continuingChat": "Vervolg van eerdere chat"
|
|
157
|
+
},
|
|
158
|
+
"settings": {
|
|
159
|
+
"settingsPanel": "Instellingenpaneel",
|
|
160
|
+
"reset": "Resetten",
|
|
161
|
+
"cancel": "Annuleren",
|
|
162
|
+
"confirm": "Bevestigen"
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
"threadHistory": {
|
|
166
|
+
"sidebar": {
|
|
167
|
+
"filters": {
|
|
168
|
+
"FeedbackSelect": {
|
|
169
|
+
"feedbackAll": "Feedback: Alles",
|
|
170
|
+
"feedbackPositive": "Feedback: Positief",
|
|
171
|
+
"feedbackNegative": "Feedback: Negatief"
|
|
172
|
+
},
|
|
173
|
+
"SearchBar": {
|
|
174
|
+
"search": "Zoeken"
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
"DeleteThreadButton": {
|
|
178
|
+
"confirmMessage": "Dit verwijdert de thread evenals de berichten en elementen.",
|
|
179
|
+
"cancel": "Annuleren",
|
|
180
|
+
"confirm": "Bevestigen",
|
|
181
|
+
"deletingChat": "Chat verwijderen",
|
|
182
|
+
"chatDeleted": "Chat verwijderd"
|
|
183
|
+
},
|
|
184
|
+
"index": {
|
|
185
|
+
"pastChats": "Vorige Chats"
|
|
186
|
+
},
|
|
187
|
+
"ThreadList": {
|
|
188
|
+
"empty": "Leeg...",
|
|
189
|
+
"today": "Vandaag",
|
|
190
|
+
"yesterday": "Gisteren",
|
|
191
|
+
"previous7days": "Afgelopen 7 dagen",
|
|
192
|
+
"previous30days": "Afgelopen 30 dagen"
|
|
193
|
+
},
|
|
194
|
+
"TriggerButton": {
|
|
195
|
+
"closeSidebar": "Zijbalk sluiten",
|
|
196
|
+
"openSidebar": "Zijbalk openen"
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
"Thread": {
|
|
200
|
+
"backToChat": "Terug naar chat",
|
|
201
|
+
"chatCreatedOn": "Deze chat is aangemaakt op"
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
"header": {
|
|
205
|
+
"chat": "Chat",
|
|
206
|
+
"readme": "Readme"
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
"hooks": {
|
|
211
|
+
"useLLMProviders": {
|
|
212
|
+
"failedToFetchProviders": "Kan providers niet ophalen:"
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
"pages": {
|
|
216
|
+
"Design": {},
|
|
217
|
+
"Env": {
|
|
218
|
+
"savedSuccessfully": "Succesvol opgeslagen",
|
|
219
|
+
"requiredApiKeys": "Vereiste API-sleutels",
|
|
220
|
+
"requiredApiKeysInfo": "Om deze app te gebruiken, zijn de volgende API-sleutels vereist. De sleutels worden opgeslagen in de lokale opslag van uw apparaat."
|
|
221
|
+
},
|
|
222
|
+
"Page": {
|
|
223
|
+
"notPartOfProject": "U maakt geen deel uit van dit project."
|
|
224
|
+
},
|
|
225
|
+
"ResumeButton": {
|
|
226
|
+
"resumeChat": "Chat hervatten"
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
chainlit/types.py
CHANGED
|
@@ -79,7 +79,7 @@ T = TypeVar("T", covariant=True)
|
|
|
79
79
|
class HasFromDict(Protocol[T]):
|
|
80
80
|
@classmethod
|
|
81
81
|
def from_dict(cls, obj_dict: Any) -> T:
|
|
82
|
-
raise NotImplementedError
|
|
82
|
+
raise NotImplementedError
|
|
83
83
|
|
|
84
84
|
|
|
85
85
|
@dataclass
|
|
@@ -168,11 +168,13 @@ class InputAudioChunk:
|
|
|
168
168
|
elapsedTime: float
|
|
169
169
|
data: bytes
|
|
170
170
|
|
|
171
|
+
|
|
171
172
|
class OutputAudioChunk(TypedDict):
|
|
172
173
|
track: str
|
|
173
174
|
mimeType: str
|
|
174
175
|
data: bytes
|
|
175
176
|
|
|
177
|
+
|
|
176
178
|
@dataclass
|
|
177
179
|
class AskFileResponse:
|
|
178
180
|
id: str
|
|
@@ -184,12 +186,16 @@ class AskFileResponse:
|
|
|
184
186
|
|
|
185
187
|
class AskActionResponse(TypedDict):
|
|
186
188
|
name: str
|
|
187
|
-
|
|
189
|
+
payload: Dict
|
|
188
190
|
label: str
|
|
189
|
-
|
|
191
|
+
tooltip: str
|
|
190
192
|
forId: str
|
|
191
193
|
id: str
|
|
192
|
-
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
class UpdateThreadRequest(BaseModel):
|
|
197
|
+
threadId: str
|
|
198
|
+
name: str
|
|
193
199
|
|
|
194
200
|
|
|
195
201
|
class DeleteThreadRequest(BaseModel):
|
|
@@ -205,6 +211,16 @@ class GetThreadsRequest(BaseModel):
|
|
|
205
211
|
filter: ThreadFilter
|
|
206
212
|
|
|
207
213
|
|
|
214
|
+
class CallActionRequest(BaseModel):
|
|
215
|
+
action: Dict
|
|
216
|
+
sessionId: str
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
class ElementRequest(BaseModel):
|
|
220
|
+
element: Dict
|
|
221
|
+
sessionId: str
|
|
222
|
+
|
|
223
|
+
|
|
208
224
|
class Theme(str, Enum):
|
|
209
225
|
light = "light"
|
|
210
226
|
dark = "dark"
|
chainlit/user.py
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
from typing import Dict, Literal, Optional, TypedDict
|
|
2
2
|
|
|
3
3
|
from dataclasses_json import DataClassJsonMixin
|
|
4
|
-
from pydantic
|
|
4
|
+
from pydantic import Field
|
|
5
|
+
from pydantic.dataclasses import dataclass
|
|
5
6
|
|
|
6
7
|
Provider = Literal[
|
|
7
8
|
"credentials",
|
chainlit/utils.py
CHANGED
|
@@ -6,12 +6,13 @@ from asyncio import CancelledError
|
|
|
6
6
|
from typing import Callable
|
|
7
7
|
|
|
8
8
|
import click
|
|
9
|
+
from fastapi import FastAPI
|
|
10
|
+
from packaging import version
|
|
11
|
+
|
|
9
12
|
from chainlit.auth import ensure_jwt_secret
|
|
10
13
|
from chainlit.context import context
|
|
11
14
|
from chainlit.logger import logger
|
|
12
15
|
from chainlit.message import ErrorMessage
|
|
13
|
-
from fastapi import FastAPI
|
|
14
|
-
from packaging import version
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
def wrap_user_function(user_function: Callable, with_task=False) -> Callable:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: chainlit
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.0.1
|
|
4
4
|
Summary: Build Conversational AI.
|
|
5
5
|
Home-page: https://chainlit.io/
|
|
6
6
|
License: Apache-2.0
|
|
@@ -30,12 +30,11 @@ Requires-Dist: httpx (>=0.23.0)
|
|
|
30
30
|
Requires-Dist: lazify (>=0.4.0,<0.5.0)
|
|
31
31
|
Requires-Dist: literalai (==0.0.623)
|
|
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.
|
|
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
|
-
|
|
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.
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
chainlit/__init__.py,sha256=ZfEoaKPb53KVkzNvnsJLH2NWNaMyYvf0cPCZTAOsiNo,4371
|
|
2
|
+
chainlit/__main__.py,sha256=7Vg3w3T3qDuz4KDu5lQhLH6lQ3cYdume7gHH7Z1V97U,87
|
|
3
|
+
chainlit/_utils.py,sha256=vaKfEpXcL4kXktp54IRQWZRK4L_HGK8gJuAoIM29YYc,289
|
|
4
|
+
chainlit/action.py,sha256=ljtpsPYRtFYigw2G6VbBworRHDL2fq8hE9A4H_fEijw,1333
|
|
5
|
+
chainlit/auth/__init__.py,sha256=RB7rw0-fa4gVh6cAKieqFVGB7F-cr84IOBvx1yoKU1g,2613
|
|
6
|
+
chainlit/auth/cookie.py,sha256=VQOYgLKWz-obtSL4bWLHM7yE2XM2t13fe4q-7izI0K0,3829
|
|
7
|
+
chainlit/auth/jwt.py,sha256=4WIauNNR4WH42L8np6A-stS1lxxZ96eYjHfgsA0bDl0,869
|
|
8
|
+
chainlit/cache.py,sha256=tPWzO4UHMgNnAnKolKdW0pm08ceZykrs25kvpWJHhN8,1389
|
|
9
|
+
chainlit/callbacks.py,sha256=_77KLfR2tXHOLpmDZbWsXWRquXlMvPRpeBPGY1rohKM,10151
|
|
10
|
+
chainlit/chat_context.py,sha256=rVA4t2Df8YzMg-gNVArhDTZZ3wX83nOyKmgyHo8sJjQ,1848
|
|
11
|
+
chainlit/chat_settings.py,sha256=iZ2vSUUz9UIBwrRBTelTJFzvNMDZ5vX2f16BuSDThEY,898
|
|
12
|
+
chainlit/cli/__init__.py,sha256=00uuJPlSinXAV2WuHLIVQOQlZfOEUrwb1PD8coIFG6U,6582
|
|
13
|
+
chainlit/config.py,sha256=QVFTkgjoEjf1oxq2hOVd40rPH_taEEc-7E1XApFRbMw,16131
|
|
14
|
+
chainlit/context.py,sha256=BtbGRdmRRqOC5Vbz8zijkgiN0gyKuDamkPPNrscOgo4,3317
|
|
15
|
+
chainlit/copilot/dist/assets/logo_dark-IkGJ_IwC.svg,sha256=Kjz3QMh-oh-ag4YatjU0YCPqGF7F8nHh8VUQoJIs01E,8887
|
|
16
|
+
chainlit/copilot/dist/assets/logo_light-Bb_IPh6r.svg,sha256=sHjnvEq1rfqh3bcexJNYUY7WEDdTQZq3aKZYpi4w4ck,8889
|
|
17
|
+
chainlit/copilot/dist/index.js,sha256=eSroJmXAS-YpvLK1hHoLVBOZwijj9r9S-96xvfHFBms,7737322
|
|
18
|
+
chainlit/data/__init__.py,sha256=u9s1XLiryEW9t0PuJOSbIjOHqgOQ8_BbtAwJcJmZyXI,4729
|
|
19
|
+
chainlit/data/acl.py,sha256=1g9fWxq3K2n06g1Ngb_QNBhyKNXUpKEGiUW6VnAfqtg,575
|
|
20
|
+
chainlit/data/base.py,sha256=CmqWc9BtqGk79UUqJJIni81vAJFaV_UFpaFCw7gTkR0,2527
|
|
21
|
+
chainlit/data/chainlit_data_layer.py,sha256=ZjLy7ngoQrdtWStIiYjk_AsymIBtOoi0TjleYy4uyuA,20686
|
|
22
|
+
chainlit/data/dynamodb.py,sha256=UP3-3KZHFOCWxWQ-PL1VecLLSi0mKwFM-RiEfPtbVWE,19413
|
|
23
|
+
chainlit/data/literalai.py,sha256=qIuwBnOxvO4BAbKrRAg9h4UiYEcGkDMXKHux5Z1jO1Y,17202
|
|
24
|
+
chainlit/data/sql_alchemy.py,sha256=66XK8VXg7VWK2rADfEUo7-RKtDRktI_L-gF1Wg51orc,29562
|
|
25
|
+
chainlit/data/storage_clients/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
26
|
+
chainlit/data/storage_clients/azure.py,sha256=QQYX6J60kbYmQTggQQFaHdsVw61skh1FCL3V0X-Qy30,2531
|
|
27
|
+
chainlit/data/storage_clients/azure_blob.py,sha256=veAXFpOXdLmgj_F9Dw9gcxTyFnVsB0NVmcEjj_Jz-Dk,2933
|
|
28
|
+
chainlit/data/storage_clients/base.py,sha256=oJCq3XiZBPvM6Z_KJUVqNfC5Bkc2yYDTGrsj8BfVLIE,552
|
|
29
|
+
chainlit/data/storage_clients/gcs.py,sha256=ci29lQ8Oqv0QFO370BHCPtzokSxjkIjW8e2adhXTOQs,2569
|
|
30
|
+
chainlit/data/storage_clients/s3.py,sha256=vblM4vg-nEXVArAdxVHlYGBouRe7PIAa8fkuYDXOrvU,1626
|
|
31
|
+
chainlit/data/utils.py,sha256=cVe8p9F-lITgmAD2xhON_h0nKJVrh1P0AUoLCq6JCWs,966
|
|
32
|
+
chainlit/discord/__init__.py,sha256=lTHHcYQmfa2wpJ35m3eveEpUbp6ti2YSA7AdopfsREs,219
|
|
33
|
+
chainlit/discord/app.py,sha256=Kx0Y48Isy1BbwtoVM16tXqAIYtf_j8y1z2kXS5zIkuk,11175
|
|
34
|
+
chainlit/element.py,sha256=7YVgbeST8qRAYO2kM8LrNvI2q4c_3xgZJL6paCn2n08,11731
|
|
35
|
+
chainlit/emitter.py,sha256=b5DnVVTD_6s0xxjMuBbG5_i3d2yieJt-zZRcWEhqNCg,13800
|
|
36
|
+
chainlit/frontend/dist/assets/DailyMotion-B8XgmoRm.js,sha256=_8qJ5TQ0dTi-Dv4Tk4T8Rf3JNNYV1h8wKwRgu4TXK30,2958
|
|
37
|
+
chainlit/frontend/dist/assets/Dataframe-VU4lXMbv.js,sha256=tdjLRmPP3PFjJP4QhzBKBEujhE5h_6LySi0fYRj4Q44,53932
|
|
38
|
+
chainlit/frontend/dist/assets/Facebook-fVIMi9h_.js,sha256=TB9M8bVQLJAb88kRGmyg2cZGU2Oy5wqu4DY04bFUi5I,3213
|
|
39
|
+
chainlit/frontend/dist/assets/FilePlayer-DlXvvaZa.js,sha256=DLUaAd_sVd5RSdX9hgwoeb8M5HRtv0XRvhI7d4q97iA,9038
|
|
40
|
+
chainlit/frontend/dist/assets/Kaltura-C48Ui_4V.js,sha256=yMTkvso-wIwUBJ0FYr17d4sM8Z1bE2_7UoLSEuUUG0Y,2787
|
|
41
|
+
chainlit/frontend/dist/assets/Mixcloud-Dmjz7RrS.js,sha256=FB-v0pCYLIoDtxjkN_1w_NWX4VGd2i0s4oVfXj6O0XU,2635
|
|
42
|
+
chainlit/frontend/dist/assets/Mux-Bqaa3ZzG.js,sha256=UUipyYQWnFKnP-gmxWZI6kQJ1T4z4AxOmYYdBS4u8jo,5357
|
|
43
|
+
chainlit/frontend/dist/assets/Preview-B2d1Ugq4.js,sha256=tSNo9RDlwkBj_qZ37MjQqDkRrqs4LEe1LePIPxizJCc,3008
|
|
44
|
+
chainlit/frontend/dist/assets/SoundCloud-BGuk87T3.js,sha256=4PbgxXL2G4ULvLGm-6Ov0KfdzsfprTgGM5NdBN3S67M,2920
|
|
45
|
+
chainlit/frontend/dist/assets/Streamable-DOe4rXrG.js,sha256=VCTfJZZQTGliSFgbz_ph7OpM8_KFuCAIZJyceaG0p5Y,2932
|
|
46
|
+
chainlit/frontend/dist/assets/Twitch-TA7I2UEi.js,sha256=OdPkg0YOzE-kw6fksD52xPIjRyDJbOlDlwnAPrxjUS4,3080
|
|
47
|
+
chainlit/frontend/dist/assets/Vidyard-B5F6Dk_y.js,sha256=k3BJR1RunFxp9RRXXz4hEzg8Y49F8UU8okP4GfBV6Jo,2854
|
|
48
|
+
chainlit/frontend/dist/assets/Vimeo-DP_Y98tQ.js,sha256=YCdp1Ek-QpIO_0fljo__j6UgUOqx-bPT-4cO0guss0g,3624
|
|
49
|
+
chainlit/frontend/dist/assets/Wistia-DB26BTg8.js,sha256=iXsIFfL6QB2dgUsB_YFSAJtzwldPZkLvp05LqXcejkw,3516
|
|
50
|
+
chainlit/frontend/dist/assets/YouTube-CMwwf2TN.js,sha256=uzepL7xqsjpqAbPv7ghPy5KQJAmvQk2y38D98bA6flo,4445
|
|
51
|
+
chainlit/frontend/dist/assets/index-88S3ZtD5.css,sha256=cGKXp2DE2llUmsf2tCmYD2_dY300GVhkn_2PoUKehkg,60346
|
|
52
|
+
chainlit/frontend/dist/assets/index-D7lZEN9m.js,sha256=mvEIPYd3SDhM3UeWdlamXnORToJzss5tw7K-UnCZLYc,3729516
|
|
53
|
+
chainlit/frontend/dist/assets/logo_dark-IkGJ_IwC.svg,sha256=Kjz3QMh-oh-ag4YatjU0YCPqGF7F8nHh8VUQoJIs01E,8887
|
|
54
|
+
chainlit/frontend/dist/assets/logo_light-Bb_IPh6r.svg,sha256=sHjnvEq1rfqh3bcexJNYUY7WEDdTQZq3aKZYpi4w4ck,8889
|
|
55
|
+
chainlit/frontend/dist/assets/react-plotly-28_xImPF.js,sha256=shPBhBub-l1mYohRwus3M2ltDJ4ceClItw5ll5gy_iA,3762918
|
|
56
|
+
chainlit/frontend/dist/favicon.svg,sha256=0Cy8x28obT5eWW3nxZRhsEvu6_zMqrqbg0y6hT3D0Q0,6455
|
|
57
|
+
chainlit/frontend/dist/index.html,sha256=pUY9ZjTRzY_35GNLFlN2HcNe_Rc9xJKPNuJSbtCaovA,972
|
|
58
|
+
chainlit/haystack/__init__.py,sha256=uZ77YiPy-qleSTi3dQCDO9HE6S6F6GpJWmh7jO4cxXA,217
|
|
59
|
+
chainlit/haystack/callbacks.py,sha256=J5t6YL3QoxyT0sg8t08nPA7b4VOGKIkmWtkbmFZXjBI,5038
|
|
60
|
+
chainlit/hello.py,sha256=LwENQWo5s5r8nNDn4iKSV77vX60Ky5r_qGjQhyi7qlY,416
|
|
61
|
+
chainlit/input_widget.py,sha256=crASWi5cijqVt90pnpWpe8fQI5TFXrS0Oj87VO1N0P4,4952
|
|
62
|
+
chainlit/langchain/__init__.py,sha256=zErMw0_3ufSGeF9ye7X0ZX3wDat4mTOx97T40ePDO2g,217
|
|
63
|
+
chainlit/langchain/callbacks.py,sha256=5TKjiHE3Ix2AgFyTq19PPMdlMvLx1bF6M4fuGAPZfP4,21535
|
|
64
|
+
chainlit/langflow/__init__.py,sha256=xXEWofu5NexIO-zBo_2p18w2rO6JMBntZjTfakKxxAM,818
|
|
65
|
+
chainlit/llama_index/__init__.py,sha256=weRoIWCaRBGvA1LczCEfsqhWsltQSVlhtRnTovtdo8w,227
|
|
66
|
+
chainlit/llama_index/callbacks.py,sha256=aCi39G4Sbh_MjuSZbBv3_PM5190YA5UqNTN7DrdtT1I,7282
|
|
67
|
+
chainlit/logger.py,sha256=wTwRSZsLfXwWy6U4351IgWAm4KCMThgxm9EZpjGUEr4,373
|
|
68
|
+
chainlit/markdown.py,sha256=V-Op4hyqyTTvXInU5QrHfxs0nb71lBMU8trOSAlast8,2142
|
|
69
|
+
chainlit/message.py,sha256=rEjxhNkKuRdMsYKHLU5_Q0TCme87VqkK5IDbjOMpKT4,17232
|
|
70
|
+
chainlit/mistralai/__init__.py,sha256=BeH3LRmJ5mUgMlOA8XS61nhoQwVreW6sENJdIrlfDXw,1508
|
|
71
|
+
chainlit/oauth_providers.py,sha256=AnH-bqeCnS7VgyIhgAHDI5-XkVWsFr52yo65ldePxxw,26653
|
|
72
|
+
chainlit/openai/__init__.py,sha256=qGC9yJydzlZffrC1oCPZwpuWwJkittDq74o6U2J_-Ho,1691
|
|
73
|
+
chainlit/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
74
|
+
chainlit/secret.py,sha256=eYbDDENGfk1XcQ-hIOT2kEejZeLi6Y3Y3qWD5Y7JbCg,293
|
|
75
|
+
chainlit/server.py,sha256=UAoKQlF423190accZuXKg-oUaoEysj8RlFXJXaKbzuE,38950
|
|
76
|
+
chainlit/session.py,sha256=8FtqFu31BQKjrHdo_VrrBkSqPqxudoi2bnC8Lifyu-8,9197
|
|
77
|
+
chainlit/slack/__init__.py,sha256=gkC1iYlQrWHDN8bbsWOquwwlyW9DtKAe22GizJJzY7A,226
|
|
78
|
+
chainlit/slack/app.py,sha256=OvbbGZARI1mHOEdVvxh8KTZ35Ryi4AbdP7grjr-VU1k,11742
|
|
79
|
+
chainlit/socket.py,sha256=yDVlTXeeCCCeBy9RrcJQWCktACMYQciX9ql6o1yg3Zo,12042
|
|
80
|
+
chainlit/step.py,sha256=_bJZ3EuPEcLmtvpfJGpgixQcz6aTUqXEil40-BuS5xE,14312
|
|
81
|
+
chainlit/sync.py,sha256=pEaqdEoOp4W26p9-E11BiXemVTN4_OsYEcYyjLBEj7E,1236
|
|
82
|
+
chainlit/teams/__init__.py,sha256=_lUcuc5R4bYwUoC15jyKES10KTeH8ciSWqV5JyLrW6M,236
|
|
83
|
+
chainlit/teams/app.py,sha256=PAvlGkfF-KGe9PYT6rL8UXu4OYzsPjfTiNsysH1X8NY,10534
|
|
84
|
+
chainlit/telemetry.py,sha256=Rk4dnZv0OnGOgV4kD-VHdhgl4i7i3ypqhSE_R-LZceM,3060
|
|
85
|
+
chainlit/translations/bn.json,sha256=_44si0jO2AFZytfH9sBcINpOveQ4OZs77yf-_VlUtjs,13172
|
|
86
|
+
chainlit/translations/en-US.json,sha256=1eyiwtp68DPSTdSQzSPjyMilqija1IUc0SA9TtSVJSo,7777
|
|
87
|
+
chainlit/translations/gu.json,sha256=CkhAowZ0mgMJhQUMrUADfKPfsDgj5mvHlC3WtQ0UjQE,12699
|
|
88
|
+
chainlit/translations/he-IL.json,sha256=fu6FXfoqYqydSh_NcDpS6ZN7byQ-WZkr4zU0qXznqwc,8789
|
|
89
|
+
chainlit/translations/hi.json,sha256=J15GBkMu45RJMj1p5sFVnlackwAp_jKySRsKN-wRCUg,12397
|
|
90
|
+
chainlit/translations/kn.json,sha256=koYH5mEcX4ZfacgmiTu_UfKgNbDXXUwcEV7v6uq92eY,13575
|
|
91
|
+
chainlit/translations/ml.json,sha256=x_QV-3H0vCoijszWrjHajaTBtZzAdQ0y4V2uJgLf0S4,14270
|
|
92
|
+
chainlit/translations/mr.json,sha256=pUr540hPG3Vq-Nts7Pnj-oor_scw1Rx2gaIBnGOyPZU,12495
|
|
93
|
+
chainlit/translations/nl-NL.json,sha256=3ISUFgUdAF7NTceLY0ldWM0hjoNJeQJwbMKaEYq8O2U,10141
|
|
94
|
+
chainlit/translations/ta.json,sha256=kLXucUlMCD3jXlPhmOZ3FFZNdXfGDaqVxwqGqJqVF78,14152
|
|
95
|
+
chainlit/translations/te.json,sha256=spOs9mYNITEUy_mKp4_9qmXP2yACVrruiQKb1zlRIWU,13608
|
|
96
|
+
chainlit/translations/zh-CN.json,sha256=Y3MhXUDFi4YMxX8-agpCM68efYXCGcHqyqRAen8LLfk,7508
|
|
97
|
+
chainlit/translations.py,sha256=WG_r7HzxBYns-zk9tVvoGdoofv71okTZx8k1RlcoTIg,2034
|
|
98
|
+
chainlit/types.py,sha256=Kx3G-gWd6LeGQweBo5kfC6HaXYysjJT_wU7ztC784Lg,5378
|
|
99
|
+
chainlit/user.py,sha256=yC9WvWYogoAa-6-mBR2HNHuZdE5rejGQD4vqQixIckA,772
|
|
100
|
+
chainlit/user_session.py,sha256=T1nQVN_weELXTrkDIV54YgdrA3zIvJGe1tN-nypunt4,1531
|
|
101
|
+
chainlit/utils.py,sha256=ht6S0RM0-51_EyKZ128yRYAT294Bf3gwgMBzIHv1xRI,3990
|
|
102
|
+
chainlit/version.py,sha256=VcRO6Iwchkv80BWb4hRGkOnBgDhj87-Yjorcv1u5Z3g,276
|
|
103
|
+
chainlit-2.0.1.dist-info/METADATA,sha256=dnq1qFApnABnmOxt80twDulFYIi9dc9VfDWvxOJXQ2M,5150
|
|
104
|
+
chainlit-2.0.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
105
|
+
chainlit-2.0.1.dist-info/entry_points.txt,sha256=FrkqdjrFl8juSnvBndniyX7XuKojmUwO4ghRh-CFMQc,45
|
|
106
|
+
chainlit-2.0.1.dist-info/RECORD,,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g,r as m,u as v,a as w}from"./index-2yAiK0R5.js";function O(t,e){for(var a=0;a<e.length;a++){const s=e[a];if(typeof s!="string"&&!Array.isArray(s)){for(const r in s)if(r!=="default"&&!(r in t)){const o=Object.getOwnPropertyDescriptor(s,r);o&&Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>s[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var C=Object.create,i=Object.defineProperty,k=Object.getOwnPropertyDescriptor,D=Object.getOwnPropertyNames,E=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty,R=(t,e,a)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,j=(t,e)=>{for(var a in e)i(t,a,{get:e[a],enumerable:!0})},h=(t,e,a,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of D(e))!S.call(t,r)&&r!==a&&i(t,r,{get:()=>e[r],enumerable:!(s=k(e,r))||s.enumerable});return t},I=(t,e,a)=>(a=t!=null?C(E(t)):{},h(!t||!t.__esModule?i(a,"default",{value:t,enumerable:!0}):a,t)),M=t=>h(i({},"__esModule",{value:!0}),t),n=(t,e,a)=>(R(t,typeof e!="symbol"?e+"":e,a),a),d={};j(d,{default:()=>l});var _=M(d),y=I(m),c=v,P=w;const W="https://fast.wistia.com/assets/external/E-v1.js",x="Wistia",A="wistia-player-";class l extends y.Component{constructor(){super(...arguments),n(this,"callPlayer",c.callPlayer),n(this,"playerID",this.props.config.playerId||`${A}${(0,c.randomString)()}`),n(this,"onPlay",(...e)=>this.props.onPlay(...e)),n(this,"onPause",(...e)=>this.props.onPause(...e)),n(this,"onSeek",(...e)=>this.props.onSeek(...e)),n(this,"onEnded",(...e)=>this.props.onEnded(...e)),n(this,"onPlaybackRateChange",(...e)=>this.props.onPlaybackRateChange(...e)),n(this,"mute",()=>{this.callPlayer("mute")}),n(this,"unmute",()=>{this.callPlayer("unmute")})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){const{playing:a,muted:s,controls:r,onReady:o,config:p,onError:b}=this.props;(0,c.getSDK)(W,x).then(f=>{p.customControls&&p.customControls.forEach(u=>f.defineControl(u)),window._wq=window._wq||[],window._wq.push({id:this.playerID,options:{autoPlay:a,silentAutoPlay:"allow",muted:s,controlsVisibleOnLoad:r,fullscreenButton:r,playbar:r,playbackRateControl:r,qualityControl:r,volumeControl:r,settingsControl:r,smallPlayButton:r,...p.options},onReady:u=>{this.player=u,this.unbind(),this.player.bind("play",this.onPlay),this.player.bind("pause",this.onPause),this.player.bind("seek",this.onSeek),this.player.bind("end",this.onEnded),this.player.bind("playbackratechange",this.onPlaybackRateChange),o()}})},b)}unbind(){this.player.unbind("play",this.onPlay),this.player.unbind("pause",this.onPause),this.player.unbind("seek",this.onSeek),this.player.unbind("end",this.onEnded),this.player.unbind("playbackratechange",this.onPlaybackRateChange)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){this.unbind(),this.callPlayer("remove")}seekTo(e,a=!0){this.callPlayer("time",e),a||this.pause()}setVolume(e){this.callPlayer("volume",e)}setPlaybackRate(e){this.callPlayer("playbackRate",e)}getDuration(){return this.callPlayer("duration")}getCurrentTime(){return this.callPlayer("time")}getSecondsLoaded(){return null}render(){const{url:e}=this.props,a=e&&e.match(P.MATCH_URL_WISTIA)[1],s=`wistia_embed wistia_async_${a}`,r={width:"100%",height:"100%"};return y.default.createElement("div",{id:this.playerID,key:a,className:s,style:r})}}n(l,"displayName","Wistia");n(l,"canPlay",P.canPlay.wistia);n(l,"loopOnEnded",!0);const L=g(_),T=O({__proto__:null,default:L},[_]);export{T as W};
|