chainlit 1.1.305__py3-none-any.whl → 1.1.400__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of chainlit might be problematic. Click here for more details.

Files changed (48) hide show
  1. chainlit/__init__.py +19 -5
  2. chainlit/chat_context.py +64 -0
  3. chainlit/config.py +6 -3
  4. chainlit/context.py +9 -0
  5. chainlit/copilot/dist/index.js +150 -147
  6. chainlit/data/__init__.py +8 -12
  7. chainlit/data/sql_alchemy.py +0 -4
  8. chainlit/discord/app.py +44 -24
  9. chainlit/emitter.py +9 -11
  10. chainlit/frontend/dist/assets/{DailyMotion-4f715d15.js → DailyMotion-e2c926d0.js} +1 -1
  11. chainlit/frontend/dist/assets/{Facebook-25f45c09.js → Facebook-88f80aba.js} +1 -1
  12. chainlit/frontend/dist/assets/{FilePlayer-04482650.js → FilePlayer-febd1b0d.js} +1 -1
  13. chainlit/frontend/dist/assets/{Kaltura-37152a96.js → Kaltura-606fe0bd.js} +1 -1
  14. chainlit/frontend/dist/assets/{Mixcloud-914b75ee.js → Mixcloud-b3db090a.js} +1 -1
  15. chainlit/frontend/dist/assets/{Mux-fb751398.js → Mux-ca847a7d.js} +1 -1
  16. chainlit/frontend/dist/assets/{Preview-85fbb8da.js → Preview-7a3747b5.js} +1 -1
  17. chainlit/frontend/dist/assets/{SoundCloud-8afad6c0.js → SoundCloud-0da01fb1.js} +1 -1
  18. chainlit/frontend/dist/assets/{Streamable-08844d93.js → Streamable-4a6ab048.js} +1 -1
  19. chainlit/frontend/dist/assets/{Twitch-1b95f5c8.js → Twitch-3e260619.js} +1 -1
  20. chainlit/frontend/dist/assets/{Vidyard-5028fa2f.js → Vidyard-73692980.js} +1 -1
  21. chainlit/frontend/dist/assets/{Vimeo-ca732959.js → Vimeo-6627c7a8.js} +1 -1
  22. chainlit/frontend/dist/assets/{Wistia-74e58d71.js → Wistia-27df9c66.js} +1 -1
  23. chainlit/frontend/dist/assets/{YouTube-bdf4ca10.js → YouTube-a11d419d.js} +1 -1
  24. chainlit/frontend/dist/assets/index-d66d1800.js +730 -0
  25. chainlit/frontend/dist/assets/{react-plotly-cf9b99cc.js → react-plotly-012ed517.js} +1 -1
  26. chainlit/frontend/dist/index.html +1 -1
  27. chainlit/haystack/callbacks.py +1 -3
  28. chainlit/langchain/callbacks.py +39 -20
  29. chainlit/llama_index/callbacks.py +8 -28
  30. chainlit/message.py +4 -17
  31. chainlit/mistralai/__init__.py +2 -5
  32. chainlit/openai/__init__.py +0 -2
  33. chainlit/server.py +1 -1
  34. chainlit/session.py +2 -12
  35. chainlit/slack/app.py +38 -31
  36. chainlit/socket.py +37 -1
  37. chainlit/step.py +37 -32
  38. chainlit/teams/app.py +23 -18
  39. chainlit/translations/zh-CN.json +229 -0
  40. chainlit/types.py +0 -1
  41. chainlit/user_session.py +0 -3
  42. chainlit/utils.py +1 -0
  43. {chainlit-1.1.305.dist-info → chainlit-1.1.400.dist-info}/METADATA +1 -1
  44. chainlit-1.1.400.dist-info/RECORD +82 -0
  45. chainlit/frontend/dist/assets/index-621140f9.js +0 -727
  46. chainlit-1.1.305.dist-info/RECORD +0 -80
  47. {chainlit-1.1.305.dist-info → chainlit-1.1.400.dist-info}/WHEEL +0 -0
  48. {chainlit-1.1.305.dist-info → chainlit-1.1.400.dist-info}/entry_points.txt +0 -0
@@ -1 +1 @@
1
- import{g as U,r as I,u as L,a as Y}from"./index-621140f9.js";function k(a,e){for(var t=0;t<e.length;t++){const s=e[t];if(typeof s!="string"&&!Array.isArray(s)){for(const r in s)if(r!=="default"&&!(r in a)){const n=Object.getOwnPropertyDescriptor(s,r);n&&Object.defineProperty(a,r,n.get?n:{enumerable:!0,get:()=>s[r]})}}}return Object.freeze(Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}))}var M=Object.create,u=Object.defineProperty,j=Object.getOwnPropertyDescriptor,N=Object.getOwnPropertyNames,V=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty,x=(a,e,t)=>e in a?u(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t,K=(a,e)=>{for(var t in e)u(a,t,{get:e[t],enumerable:!0})},v=(a,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of N(e))!B.call(a,r)&&r!==t&&u(a,r,{get:()=>e[r],enumerable:!(s=j(e,r))||s.enumerable});return a},F=(a,e,t)=>(t=a!=null?M(V(a)):{},v(e||!a||!a.__esModule?u(t,"default",{value:a,enumerable:!0}):t,a)),H=a=>v(u({},"__esModule",{value:!0}),a),o=(a,e,t)=>(x(a,typeof e!="symbol"?e+"":e,t),t),w={};K(w,{default:()=>O});var S=H(w),b=F(I),c=L,D=Y;const G="https://www.youtube.com/iframe_api",T="YT",z="onYouTubeIframeAPIReady",f=/[?&](?:list|channel)=([a-zA-Z0-9_-]+)/,m=/user\/([a-zA-Z0-9_-]+)\/?/,Q=/youtube-nocookie\.com/,Z="https://www.youtube-nocookie.com";class O extends b.Component{constructor(){super(...arguments),o(this,"callPlayer",c.callPlayer),o(this,"parsePlaylist",e=>{if(e instanceof Array)return{listType:"playlist",playlist:e.map(this.getID).join(",")};if(f.test(e)){const[,t]=e.match(f);return{listType:"playlist",list:t.replace(/^UC/,"UU")}}if(m.test(e)){const[,t]=e.match(m);return{listType:"user_uploads",list:t}}return{}}),o(this,"onStateChange",e=>{const{data:t}=e,{onPlay:s,onPause:r,onBuffer:n,onBufferEnd:P,onEnded:_,onReady:g,loop:y,config:{playerVars:l,onUnstarted:h}}=this.props,{UNSTARTED:d,PLAYING:p,PAUSED:i,BUFFERING:E,ENDED:A,CUED:C}=window[T].PlayerState;if(t===d&&h(),t===p&&(s(),P()),t===i&&r(),t===E&&n(),t===A){const R=!!this.callPlayer("getPlaylist");y&&!R&&(l.start?this.seekTo(l.start):this.play()),_()}t===C&&g()}),o(this,"mute",()=>{this.callPlayer("mute")}),o(this,"unmute",()=>{this.callPlayer("unMute")}),o(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}getID(e){return!e||e instanceof Array||f.test(e)?null:e.match(D.MATCH_URL_YOUTUBE)[1]}load(e,t){const{playing:s,muted:r,playsinline:n,controls:P,loop:_,config:g,onError:y}=this.props,{playerVars:l,embedOptions:h}=g,d=this.getID(e);if(t){if(f.test(e)||m.test(e)||e instanceof Array){this.player.loadPlaylist(this.parsePlaylist(e));return}this.player.cueVideoById({videoId:d,startSeconds:(0,c.parseStartTime)(e)||l.start,endSeconds:(0,c.parseEndTime)(e)||l.end});return}(0,c.getSDK)(G,T,z,p=>p.loaded).then(p=>{this.container&&(this.player=new p.Player(this.container,{width:"100%",height:"100%",videoId:d,playerVars:{autoplay:s?1:0,mute:r?1:0,controls:P?1:0,start:(0,c.parseStartTime)(e),end:(0,c.parseEndTime)(e),origin:window.location.origin,playsinline:n?1:0,...this.parsePlaylist(e),...l},events:{onReady:()=>{_&&this.player.setLoop(!0),this.props.onReady()},onPlaybackRateChange:i=>this.props.onPlaybackRateChange(i.data),onPlaybackQualityChange:i=>this.props.onPlaybackQualityChange(i),onStateChange:this.onStateChange,onError:i=>y(i.data)},host:Q.test(e)?Z:void 0,...h}))},y),h.events&&console.warn("Using `embedOptions.events` will likely break things. Use ReactPlayer’s callback props instead, eg onReady, onPlay, onPause")}play(){this.callPlayer("playVideo")}pause(){this.callPlayer("pauseVideo")}stop(){document.body.contains(this.callPlayer("getIframe"))&&this.callPlayer("stopVideo")}seekTo(e,t=!1){this.callPlayer("seekTo",e),!t&&!this.props.playing&&this.pause()}setVolume(e){this.callPlayer("setVolume",e*100)}setPlaybackRate(e){this.callPlayer("setPlaybackRate",e)}setLoop(e){this.callPlayer("setLoop",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentTime")}getSecondsLoaded(){return this.callPlayer("getVideoLoadedFraction")*this.getDuration()}render(){const{display:e}=this.props,t={width:"100%",height:"100%",display:e};return b.default.createElement("div",{style:t},b.default.createElement("div",{ref:this.ref}))}}o(O,"displayName","YouTube");o(O,"canPlay",D.canPlay.youtube);const $=U(S),q=k({__proto__:null,default:$},[S]);export{q as Y};
1
+ import{g as U,r as I,u as L,a as Y}from"./index-d66d1800.js";function k(a,e){for(var t=0;t<e.length;t++){const s=e[t];if(typeof s!="string"&&!Array.isArray(s)){for(const r in s)if(r!=="default"&&!(r in a)){const n=Object.getOwnPropertyDescriptor(s,r);n&&Object.defineProperty(a,r,n.get?n:{enumerable:!0,get:()=>s[r]})}}}return Object.freeze(Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}))}var M=Object.create,u=Object.defineProperty,j=Object.getOwnPropertyDescriptor,N=Object.getOwnPropertyNames,V=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty,x=(a,e,t)=>e in a?u(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t,K=(a,e)=>{for(var t in e)u(a,t,{get:e[t],enumerable:!0})},v=(a,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of N(e))!B.call(a,r)&&r!==t&&u(a,r,{get:()=>e[r],enumerable:!(s=j(e,r))||s.enumerable});return a},F=(a,e,t)=>(t=a!=null?M(V(a)):{},v(e||!a||!a.__esModule?u(t,"default",{value:a,enumerable:!0}):t,a)),H=a=>v(u({},"__esModule",{value:!0}),a),o=(a,e,t)=>(x(a,typeof e!="symbol"?e+"":e,t),t),w={};K(w,{default:()=>O});var S=H(w),b=F(I),c=L,D=Y;const G="https://www.youtube.com/iframe_api",T="YT",z="onYouTubeIframeAPIReady",f=/[?&](?:list|channel)=([a-zA-Z0-9_-]+)/,m=/user\/([a-zA-Z0-9_-]+)\/?/,Q=/youtube-nocookie\.com/,Z="https://www.youtube-nocookie.com";class O extends b.Component{constructor(){super(...arguments),o(this,"callPlayer",c.callPlayer),o(this,"parsePlaylist",e=>{if(e instanceof Array)return{listType:"playlist",playlist:e.map(this.getID).join(",")};if(f.test(e)){const[,t]=e.match(f);return{listType:"playlist",list:t.replace(/^UC/,"UU")}}if(m.test(e)){const[,t]=e.match(m);return{listType:"user_uploads",list:t}}return{}}),o(this,"onStateChange",e=>{const{data:t}=e,{onPlay:s,onPause:r,onBuffer:n,onBufferEnd:P,onEnded:_,onReady:g,loop:y,config:{playerVars:l,onUnstarted:h}}=this.props,{UNSTARTED:d,PLAYING:p,PAUSED:i,BUFFERING:E,ENDED:A,CUED:C}=window[T].PlayerState;if(t===d&&h(),t===p&&(s(),P()),t===i&&r(),t===E&&n(),t===A){const R=!!this.callPlayer("getPlaylist");y&&!R&&(l.start?this.seekTo(l.start):this.play()),_()}t===C&&g()}),o(this,"mute",()=>{this.callPlayer("mute")}),o(this,"unmute",()=>{this.callPlayer("unMute")}),o(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}getID(e){return!e||e instanceof Array||f.test(e)?null:e.match(D.MATCH_URL_YOUTUBE)[1]}load(e,t){const{playing:s,muted:r,playsinline:n,controls:P,loop:_,config:g,onError:y}=this.props,{playerVars:l,embedOptions:h}=g,d=this.getID(e);if(t){if(f.test(e)||m.test(e)||e instanceof Array){this.player.loadPlaylist(this.parsePlaylist(e));return}this.player.cueVideoById({videoId:d,startSeconds:(0,c.parseStartTime)(e)||l.start,endSeconds:(0,c.parseEndTime)(e)||l.end});return}(0,c.getSDK)(G,T,z,p=>p.loaded).then(p=>{this.container&&(this.player=new p.Player(this.container,{width:"100%",height:"100%",videoId:d,playerVars:{autoplay:s?1:0,mute:r?1:0,controls:P?1:0,start:(0,c.parseStartTime)(e),end:(0,c.parseEndTime)(e),origin:window.location.origin,playsinline:n?1:0,...this.parsePlaylist(e),...l},events:{onReady:()=>{_&&this.player.setLoop(!0),this.props.onReady()},onPlaybackRateChange:i=>this.props.onPlaybackRateChange(i.data),onPlaybackQualityChange:i=>this.props.onPlaybackQualityChange(i),onStateChange:this.onStateChange,onError:i=>y(i.data)},host:Q.test(e)?Z:void 0,...h}))},y),h.events&&console.warn("Using `embedOptions.events` will likely break things. Use ReactPlayer’s callback props instead, eg onReady, onPlay, onPause")}play(){this.callPlayer("playVideo")}pause(){this.callPlayer("pauseVideo")}stop(){document.body.contains(this.callPlayer("getIframe"))&&this.callPlayer("stopVideo")}seekTo(e,t=!1){this.callPlayer("seekTo",e),!t&&!this.props.playing&&this.pause()}setVolume(e){this.callPlayer("setVolume",e*100)}setPlaybackRate(e){this.callPlayer("setPlaybackRate",e)}setLoop(e){this.callPlayer("setLoop",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentTime")}getSecondsLoaded(){return this.callPlayer("getVideoLoadedFraction")*this.getDuration()}render(){const{display:e}=this.props,t={width:"100%",height:"100%",display:e};return b.default.createElement("div",{style:t},b.default.createElement("div",{ref:this.ref}))}}o(O,"displayName","YouTube");o(O,"canPlay",D.canPlay.youtube);const $=U(S),q=k({__proto__:null,default:$},[S]);export{q as Y};