obi-sdk 0.12.0 → 0.12.1
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.
- package/dist/modular/chunks/index-74e2d1b3.js +6 -0
- package/dist/modular/chunks/index-74e2d1b3.js.map +1 -0
- package/dist/modular/chunks/{obi-widget-6b2916f1.js → obi-widget-b64f0c73.js} +8 -3
- package/dist/modular/chunks/obi-widget-b64f0c73.js.map +1 -0
- package/dist/modular/index.js +1 -1
- package/dist/modular/ui.js +10 -10
- package/dist/obi-sdk.standalone.iife.js +1 -1
- package/dist/obi-sdk.standalone.iife.js.map +1 -1
- package/dist/react.es.js +7 -4
- package/dist/react.es.js.map +1 -1
- package/dist/react.umd.js +1 -1
- package/dist/react.umd.js.map +1 -1
- package/package.json +3 -3
- package/dist/modular/chunks/index-21eeed74.js +0 -6
- package/dist/modular/chunks/index-21eeed74.js.map +0 -1
- package/dist/modular/chunks/obi-widget-6b2916f1.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-74e2d1b3.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -629,19 +629,21 @@ class ObiClient {
|
|
|
629
629
|
}
|
|
630
630
|
const DEFAULT_API_BASE_URL = "https://app.coragents.ai/api";
|
|
631
631
|
class ObiSession {
|
|
632
|
-
constructor({ sessionId, apiBaseUrl }) {
|
|
632
|
+
constructor({ sessionId, apiBaseUrl, user }) {
|
|
633
633
|
this.currentState = SDKState.READY;
|
|
634
634
|
this.livekitState = "speaking";
|
|
635
635
|
this.assistantAudioContext = null;
|
|
636
636
|
this.userAudioContext = null;
|
|
637
637
|
this._assistantAudioTimer = null;
|
|
638
638
|
this._userAudioTimer = null;
|
|
639
|
+
this.user = void 0;
|
|
639
640
|
this.sessionId = sessionId;
|
|
640
641
|
this.apiBaseUrl = apiBaseUrl || DEFAULT_API_BASE_URL;
|
|
641
642
|
this.client = new ObiClient({
|
|
642
643
|
baseUrl: this.apiBaseUrl
|
|
643
644
|
});
|
|
644
645
|
this.emitter = new EventEmitter();
|
|
646
|
+
this.user = user;
|
|
645
647
|
}
|
|
646
648
|
emit(event, data) {
|
|
647
649
|
this.emitter.emit(event, data);
|
|
@@ -768,7 +770,10 @@ class ObiSession {
|
|
|
768
770
|
dynacast: true
|
|
769
771
|
});
|
|
770
772
|
this.setupRoomEventListeners();
|
|
771
|
-
const joinToken = await this.client.getJoinToken(this.sessionId, {
|
|
773
|
+
const joinToken = await this.client.getJoinToken(this.sessionId, {
|
|
774
|
+
skipIntro: true,
|
|
775
|
+
...this.user && { user: JSON.stringify(this.user) }
|
|
776
|
+
});
|
|
772
777
|
await this.room.connect(joinToken.data.url, joinToken.data.token);
|
|
773
778
|
if (this.microphoneStream) {
|
|
774
779
|
const micTrack = this.microphoneStream.getAudioTracks()[0];
|
|
@@ -18967,4 +18972,4 @@ export {
|
|
|
18967
18972
|
withSentryAsyncHandler as w,
|
|
18968
18973
|
x
|
|
18969
18974
|
};
|
|
18970
|
-
//# sourceMappingURL=obi-widget-
|
|
18975
|
+
//# sourceMappingURL=obi-widget-b64f0c73.js.map
|