@rapidaai/react 1.1.47 → 1.1.49

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/index.mjs CHANGED
@@ -111,7 +111,7 @@ import {
111
111
  toTextContent,
112
112
  useObservableState,
113
113
  useSelectInputDeviceAgent
114
- } from "./chunk-5UBYT2TF.mjs";
114
+ } from "./chunk-JA65S2AA.mjs";
115
115
  import {
116
116
  MultibandAudioVisualizerComponent
117
117
  } from "./chunk-CVATR327.mjs";
@@ -31108,54 +31108,54 @@ var require_integration_api_pb_service = __commonJS({
31108
31108
  };
31109
31109
  };
31110
31110
  exports.AzureServiceClient = AzureServiceClient2;
31111
- var GoogleService2 = function() {
31112
- function GoogleService3() {
31111
+ var GeminiService = function() {
31112
+ function GeminiService2() {
31113
31113
  }
31114
- GoogleService3.serviceName = "integration_api.GoogleService";
31115
- return GoogleService3;
31114
+ GeminiService2.serviceName = "integration_api.GeminiService";
31115
+ return GeminiService2;
31116
31116
  }();
31117
- GoogleService2.Embedding = {
31117
+ GeminiService.Embedding = {
31118
31118
  methodName: "Embedding",
31119
- service: GoogleService2,
31119
+ service: GeminiService,
31120
31120
  requestStream: false,
31121
31121
  responseStream: false,
31122
31122
  requestType: integration_api_pb.EmbeddingRequest,
31123
31123
  responseType: integration_api_pb.EmbeddingResponse
31124
31124
  };
31125
- GoogleService2.Chat = {
31125
+ GeminiService.Chat = {
31126
31126
  methodName: "Chat",
31127
- service: GoogleService2,
31127
+ service: GeminiService,
31128
31128
  requestStream: false,
31129
31129
  responseStream: false,
31130
31130
  requestType: integration_api_pb.ChatRequest,
31131
31131
  responseType: integration_api_pb.ChatResponse
31132
31132
  };
31133
- GoogleService2.StreamChat = {
31133
+ GeminiService.StreamChat = {
31134
31134
  methodName: "StreamChat",
31135
- service: GoogleService2,
31135
+ service: GeminiService,
31136
31136
  requestStream: false,
31137
31137
  responseStream: true,
31138
31138
  requestType: integration_api_pb.ChatRequest,
31139
31139
  responseType: integration_api_pb.ChatResponse
31140
31140
  };
31141
- GoogleService2.VerifyCredential = {
31141
+ GeminiService.VerifyCredential = {
31142
31142
  methodName: "VerifyCredential",
31143
- service: GoogleService2,
31143
+ service: GeminiService,
31144
31144
  requestStream: false,
31145
31145
  responseStream: false,
31146
31146
  requestType: integration_api_pb.VerifyCredentialRequest,
31147
31147
  responseType: integration_api_pb.VerifyCredentialResponse
31148
31148
  };
31149
- exports.GoogleService = GoogleService2;
31150
- function GoogleServiceClient2(serviceHost, options) {
31149
+ exports.GeminiService = GeminiService;
31150
+ function GeminiServiceClient(serviceHost, options) {
31151
31151
  this.serviceHost = serviceHost;
31152
31152
  this.options = options || {};
31153
31153
  }
31154
- GoogleServiceClient2.prototype.embedding = function embedding(requestMessage, metadata, callback) {
31154
+ GeminiServiceClient.prototype.embedding = function embedding(requestMessage, metadata, callback) {
31155
31155
  if (arguments.length === 2) {
31156
31156
  callback = arguments[1];
31157
31157
  }
31158
- var client = grpc2.unary(GoogleService2.Embedding, {
31158
+ var client = grpc2.unary(GeminiService.Embedding, {
31159
31159
  request: requestMessage,
31160
31160
  host: this.serviceHost,
31161
31161
  metadata,
@@ -31181,11 +31181,11 @@ var require_integration_api_pb_service = __commonJS({
31181
31181
  }
31182
31182
  };
31183
31183
  };
31184
- GoogleServiceClient2.prototype.chat = function chat(requestMessage, metadata, callback) {
31184
+ GeminiServiceClient.prototype.chat = function chat(requestMessage, metadata, callback) {
31185
31185
  if (arguments.length === 2) {
31186
31186
  callback = arguments[1];
31187
31187
  }
31188
- var client = grpc2.unary(GoogleService2.Chat, {
31188
+ var client = grpc2.unary(GeminiService.Chat, {
31189
31189
  request: requestMessage,
31190
31190
  host: this.serviceHost,
31191
31191
  metadata,
@@ -31211,13 +31211,13 @@ var require_integration_api_pb_service = __commonJS({
31211
31211
  }
31212
31212
  };
31213
31213
  };
31214
- GoogleServiceClient2.prototype.streamChat = function streamChat(requestMessage, metadata) {
31214
+ GeminiServiceClient.prototype.streamChat = function streamChat(requestMessage, metadata) {
31215
31215
  var listeners = {
31216
31216
  data: [],
31217
31217
  end: [],
31218
31218
  status: []
31219
31219
  };
31220
- var client = grpc2.invoke(GoogleService2.StreamChat, {
31220
+ var client = grpc2.invoke(GeminiService.StreamChat, {
31221
31221
  request: requestMessage,
31222
31222
  host: this.serviceHost,
31223
31223
  metadata,
@@ -31249,11 +31249,11 @@ var require_integration_api_pb_service = __commonJS({
31249
31249
  }
31250
31250
  };
31251
31251
  };
31252
- GoogleServiceClient2.prototype.verifyCredential = function verifyCredential(requestMessage, metadata, callback) {
31252
+ GeminiServiceClient.prototype.verifyCredential = function verifyCredential(requestMessage, metadata, callback) {
31253
31253
  if (arguments.length === 2) {
31254
31254
  callback = arguments[1];
31255
31255
  }
31256
- var client = grpc2.unary(GoogleService2.VerifyCredential, {
31256
+ var client = grpc2.unary(GeminiService.VerifyCredential, {
31257
31257
  request: requestMessage,
31258
31258
  host: this.serviceHost,
31259
31259
  metadata,
@@ -31279,7 +31279,179 @@ var require_integration_api_pb_service = __commonJS({
31279
31279
  }
31280
31280
  };
31281
31281
  };
31282
- exports.GoogleServiceClient = GoogleServiceClient2;
31282
+ exports.GeminiServiceClient = GeminiServiceClient;
31283
+ var VertexAiService = function() {
31284
+ function VertexAiService2() {
31285
+ }
31286
+ VertexAiService2.serviceName = "integration_api.VertexAiService";
31287
+ return VertexAiService2;
31288
+ }();
31289
+ VertexAiService.Embedding = {
31290
+ methodName: "Embedding",
31291
+ service: VertexAiService,
31292
+ requestStream: false,
31293
+ responseStream: false,
31294
+ requestType: integration_api_pb.EmbeddingRequest,
31295
+ responseType: integration_api_pb.EmbeddingResponse
31296
+ };
31297
+ VertexAiService.Chat = {
31298
+ methodName: "Chat",
31299
+ service: VertexAiService,
31300
+ requestStream: false,
31301
+ responseStream: false,
31302
+ requestType: integration_api_pb.ChatRequest,
31303
+ responseType: integration_api_pb.ChatResponse
31304
+ };
31305
+ VertexAiService.StreamChat = {
31306
+ methodName: "StreamChat",
31307
+ service: VertexAiService,
31308
+ requestStream: false,
31309
+ responseStream: true,
31310
+ requestType: integration_api_pb.ChatRequest,
31311
+ responseType: integration_api_pb.ChatResponse
31312
+ };
31313
+ VertexAiService.VerifyCredential = {
31314
+ methodName: "VerifyCredential",
31315
+ service: VertexAiService,
31316
+ requestStream: false,
31317
+ responseStream: false,
31318
+ requestType: integration_api_pb.VerifyCredentialRequest,
31319
+ responseType: integration_api_pb.VerifyCredentialResponse
31320
+ };
31321
+ exports.VertexAiService = VertexAiService;
31322
+ function VertexAiServiceClient(serviceHost, options) {
31323
+ this.serviceHost = serviceHost;
31324
+ this.options = options || {};
31325
+ }
31326
+ VertexAiServiceClient.prototype.embedding = function embedding(requestMessage, metadata, callback) {
31327
+ if (arguments.length === 2) {
31328
+ callback = arguments[1];
31329
+ }
31330
+ var client = grpc2.unary(VertexAiService.Embedding, {
31331
+ request: requestMessage,
31332
+ host: this.serviceHost,
31333
+ metadata,
31334
+ transport: this.options.transport,
31335
+ debug: this.options.debug,
31336
+ onEnd: function(response) {
31337
+ if (callback) {
31338
+ if (response.status !== grpc2.Code.OK) {
31339
+ var err = new Error(response.statusMessage);
31340
+ err.code = response.status;
31341
+ err.metadata = response.trailers;
31342
+ callback(err, null);
31343
+ } else {
31344
+ callback(null, response.message);
31345
+ }
31346
+ }
31347
+ }
31348
+ });
31349
+ return {
31350
+ cancel: function() {
31351
+ callback = null;
31352
+ client.close();
31353
+ }
31354
+ };
31355
+ };
31356
+ VertexAiServiceClient.prototype.chat = function chat(requestMessage, metadata, callback) {
31357
+ if (arguments.length === 2) {
31358
+ callback = arguments[1];
31359
+ }
31360
+ var client = grpc2.unary(VertexAiService.Chat, {
31361
+ request: requestMessage,
31362
+ host: this.serviceHost,
31363
+ metadata,
31364
+ transport: this.options.transport,
31365
+ debug: this.options.debug,
31366
+ onEnd: function(response) {
31367
+ if (callback) {
31368
+ if (response.status !== grpc2.Code.OK) {
31369
+ var err = new Error(response.statusMessage);
31370
+ err.code = response.status;
31371
+ err.metadata = response.trailers;
31372
+ callback(err, null);
31373
+ } else {
31374
+ callback(null, response.message);
31375
+ }
31376
+ }
31377
+ }
31378
+ });
31379
+ return {
31380
+ cancel: function() {
31381
+ callback = null;
31382
+ client.close();
31383
+ }
31384
+ };
31385
+ };
31386
+ VertexAiServiceClient.prototype.streamChat = function streamChat(requestMessage, metadata) {
31387
+ var listeners = {
31388
+ data: [],
31389
+ end: [],
31390
+ status: []
31391
+ };
31392
+ var client = grpc2.invoke(VertexAiService.StreamChat, {
31393
+ request: requestMessage,
31394
+ host: this.serviceHost,
31395
+ metadata,
31396
+ transport: this.options.transport,
31397
+ debug: this.options.debug,
31398
+ onMessage: function(responseMessage) {
31399
+ listeners.data.forEach(function(handler) {
31400
+ handler(responseMessage);
31401
+ });
31402
+ },
31403
+ onEnd: function(status, statusMessage, trailers) {
31404
+ listeners.status.forEach(function(handler) {
31405
+ handler({ code: status, details: statusMessage, metadata: trailers });
31406
+ });
31407
+ listeners.end.forEach(function(handler) {
31408
+ handler({ code: status, details: statusMessage, metadata: trailers });
31409
+ });
31410
+ listeners = null;
31411
+ }
31412
+ });
31413
+ return {
31414
+ on: function(type, handler) {
31415
+ listeners[type].push(handler);
31416
+ return this;
31417
+ },
31418
+ cancel: function() {
31419
+ listeners = null;
31420
+ client.close();
31421
+ }
31422
+ };
31423
+ };
31424
+ VertexAiServiceClient.prototype.verifyCredential = function verifyCredential(requestMessage, metadata, callback) {
31425
+ if (arguments.length === 2) {
31426
+ callback = arguments[1];
31427
+ }
31428
+ var client = grpc2.unary(VertexAiService.VerifyCredential, {
31429
+ request: requestMessage,
31430
+ host: this.serviceHost,
31431
+ metadata,
31432
+ transport: this.options.transport,
31433
+ debug: this.options.debug,
31434
+ onEnd: function(response) {
31435
+ if (callback) {
31436
+ if (response.status !== grpc2.Code.OK) {
31437
+ var err = new Error(response.statusMessage);
31438
+ err.code = response.status;
31439
+ err.metadata = response.trailers;
31440
+ callback(err, null);
31441
+ } else {
31442
+ callback(null, response.message);
31443
+ }
31444
+ }
31445
+ }
31446
+ });
31447
+ return {
31448
+ cancel: function() {
31449
+ callback = null;
31450
+ client.close();
31451
+ }
31452
+ };
31453
+ };
31454
+ exports.VertexAiServiceClient = VertexAiServiceClient;
31283
31455
  var ReplicateService2 = function() {
31284
31456
  function ReplicateService3() {
31285
31457
  }
@@ -32398,12 +32570,12 @@ function useInputModeToggleAgent(agent) {
32398
32570
  () => ({
32399
32571
  handleTextToggle: async () => {
32400
32572
  if (!agent) throw new Error("VoiceAgent instance not available");
32401
- if (agent.inputChannel === "text" /* Text */) return;
32573
+ if (agent.agentConfiguration.inputOptions.channel === "text" /* Text */) return;
32402
32574
  await agent.setInputChannel("text" /* Text */);
32403
32575
  },
32404
32576
  handleVoiceToggle: async () => {
32405
32577
  if (!agent) throw new Error("VoiceAgent instance not available");
32406
- if (agent.inputChannel === "audio" /* Audio */) {
32578
+ if (agent.agentConfiguration.inputOptions.channel === "audio" /* Audio */) {
32407
32579
  console.warn("Already in voice mode, ignoring toggle...");
32408
32580
  return;
32409
32581
  }
@@ -32417,7 +32589,7 @@ function useInputModeToggleAgent(agent) {
32417
32589
  [agent]
32418
32590
  );
32419
32591
  const { channel } = useObservableState(observable, {
32420
- channel: agent?.inputChannel ?? "text" /* Text */
32592
+ channel: agent.agentConfiguration.inputOptions.channel ?? "text" /* Text */
32421
32593
  });
32422
32594
  React4.useEffect(() => {
32423
32595
  if (observable && agent) {
@@ -32557,6 +32729,21 @@ var InputOptions = class {
32557
32729
  get defaultChannel() {
32558
32730
  return this.channel;
32559
32731
  }
32732
+ /**
32733
+ * stream config
32734
+ * define audio codacs and sample rate. these will be directly translated to stt
32735
+ */
32736
+ get defaultInputStreamOption() {
32737
+ const inputStreamConfig = new import_common_pb.StreamConfig();
32738
+ if (this.channel == "audio" /* Audio */) {
32739
+ const inputAudioConfig = new import_common_pb.AudioConfig();
32740
+ inputAudioConfig.setChannels(1);
32741
+ inputAudioConfig.setAudioformat(import_common_pb.AudioConfig.AudioFormat.LINEAR16);
32742
+ inputAudioConfig.setSamplerate(this.recorderOptions.sampleRate);
32743
+ inputStreamConfig.setAudio(inputAudioConfig);
32744
+ }
32745
+ return inputStreamConfig;
32746
+ }
32560
32747
  /**
32561
32748
  *
32562
32749
  * @param channels
@@ -32568,13 +32755,6 @@ var InputOptions = class {
32568
32755
  if (channel) this.channel = channel;
32569
32756
  if (deviceId) this.recorderOptions.device = deviceId;
32570
32757
  }
32571
- /**
32572
- *
32573
- * @param device
32574
- */
32575
- changeDevice(device) {
32576
- this.recorderOption.device = device;
32577
- }
32578
32758
  };
32579
32759
  var OutputOptions = class {
32580
32760
  /**
@@ -32595,9 +32775,6 @@ var OutputOptions = class {
32595
32775
  * channel for providing output
32596
32776
  */
32597
32777
  channel = "audio" /* Audio */;
32598
- get defaultChannel() {
32599
- return this.channel;
32600
- }
32601
32778
  /**
32602
32779
  *
32603
32780
  * @param channels
@@ -32610,18 +32787,19 @@ var OutputOptions = class {
32610
32787
  if (deviceId) this.playerOption.device = deviceId;
32611
32788
  }
32612
32789
  /**
32613
- *
32614
- * @param channel
32615
- */
32616
- changeChannel(channel) {
32617
- this.channel = channel;
32618
- }
32619
- /**
32620
- *
32621
- * @param device
32790
+ * stream config
32791
+ * define audio codacs and sample rate. these will be directly translated to tts
32622
32792
  */
32623
- changeDevice(device) {
32624
- this.playerOption.device = device;
32793
+ get defaultOutputStreamOption() {
32794
+ const inputStreamConfig = new import_common_pb.StreamConfig();
32795
+ if (this.channel == "audio" /* Audio */) {
32796
+ const inputAudioConfig = new import_common_pb.AudioConfig();
32797
+ inputAudioConfig.setChannels(1);
32798
+ inputAudioConfig.setAudioformat(import_common_pb.AudioConfig.AudioFormat.LINEAR16);
32799
+ inputAudioConfig.setSamplerate(this.playerOption.sampleRate);
32800
+ inputStreamConfig.setAudio(inputAudioConfig);
32801
+ }
32802
+ return inputStreamConfig;
32625
32803
  }
32626
32804
  };
32627
32805
  var AgentConfig = class {
@@ -32663,10 +32841,7 @@ var AgentConfig = class {
32663
32841
  constructor(id, inputOptions = new InputOptions([
32664
32842
  "audio" /* Audio */,
32665
32843
  "text" /* Text */
32666
- ]), outputOptions = new OutputOptions([
32667
- "audio" /* Audio */,
32668
- "text" /* Text */
32669
- ]), version, argument, options, metadata) {
32844
+ ], "text" /* Text */), outputOptions = new OutputOptions(["audio" /* Audio */, "text" /* Text */], "text" /* Text */), version, argument, options, metadata) {
32670
32845
  this.id = id;
32671
32846
  this.version = version;
32672
32847
  this.arguments = argument;
@@ -34273,8 +34448,6 @@ var export_GetProjectRequest = import_web_api_pb4.GetProjectRequest;
34273
34448
  var export_GetProjectResponse = import_web_api_pb4.GetProjectResponse;
34274
34449
  var export_GetUserRequest = import_web_api_pb4.GetUserRequest;
34275
34450
  var export_GetUserResponse = import_web_api_pb4.GetUserResponse;
34276
- var export_GoogleService = import_integration_api_pb_service.GoogleService;
34277
- var export_GoogleServiceClient = import_integration_api_pb_service.GoogleServiceClient;
34278
34451
  var export_HuggingfaceService = import_integration_api_pb_service.HuggingfaceService;
34279
34452
  var export_HuggingfaceServiceClient = import_integration_api_pb_service.HuggingfaceServiceClient;
34280
34453
  var export_IndexKnowledgeDocumentRequest = import_document_api_pb2.IndexKnowledgeDocumentRequest;
@@ -34717,8 +34890,6 @@ export {
34717
34890
  GetWebhookLog,
34718
34891
  Github,
34719
34892
  Google,
34720
- export_GoogleService as GoogleService,
34721
- export_GoogleServiceClient as GoogleServiceClient,
34722
34893
  HEADER_API_KEY,
34723
34894
  HEADER_AUTH_ID,
34724
34895
  HEADER_COLOR_DEPTH,