@rapidaai/react 1.1.51 → 1.1.52

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
@@ -108,7 +108,7 @@ import {
108
108
  require_talk_api_pb,
109
109
  useObservableState,
110
110
  useSelectInputDeviceAgent
111
- } from "./chunk-A2PCWS4P.mjs";
111
+ } from "./chunk-ZLKWKS6B.mjs";
112
112
  import {
113
113
  MultibandAudioVisualizerComponent
114
114
  } from "./chunk-CVATR327.mjs";
@@ -417,6 +417,70 @@ var require_talk_api_pb_service = __commonJS({
417
417
  };
418
418
  };
419
419
  exports.TalkServiceClient = TalkServiceClient3;
420
+ var AgentKit = function() {
421
+ function AgentKit2() {
422
+ }
423
+ AgentKit2.serviceName = "talk_api.AgentKit";
424
+ return AgentKit2;
425
+ }();
426
+ AgentKit.Talk = {
427
+ methodName: "Talk",
428
+ service: AgentKit,
429
+ requestStream: true,
430
+ responseStream: true,
431
+ requestType: talk_api_pb.AssistantMessagingRequest,
432
+ responseType: talk_api_pb.AssistantMessagingResponse
433
+ };
434
+ exports.AgentKit = AgentKit;
435
+ function AgentKitClient(serviceHost, options) {
436
+ this.serviceHost = serviceHost;
437
+ this.options = options || {};
438
+ }
439
+ AgentKitClient.prototype.talk = function talk(metadata) {
440
+ var listeners = {
441
+ data: [],
442
+ end: [],
443
+ status: []
444
+ };
445
+ var client = grpc2.client(AgentKit.Talk, {
446
+ host: this.serviceHost,
447
+ metadata,
448
+ transport: this.options.transport
449
+ });
450
+ client.onEnd(function(status, statusMessage, trailers) {
451
+ listeners.status.forEach(function(handler) {
452
+ handler({ code: status, details: statusMessage, metadata: trailers });
453
+ });
454
+ listeners.end.forEach(function(handler) {
455
+ handler({ code: status, details: statusMessage, metadata: trailers });
456
+ });
457
+ listeners = null;
458
+ });
459
+ client.onMessage(function(message) {
460
+ listeners.data.forEach(function(handler) {
461
+ handler(message);
462
+ });
463
+ });
464
+ client.start(metadata);
465
+ return {
466
+ on: function(type, handler) {
467
+ listeners[type].push(handler);
468
+ return this;
469
+ },
470
+ write: function(requestMessage) {
471
+ client.send(requestMessage);
472
+ return this;
473
+ },
474
+ end: function() {
475
+ client.finishSend();
476
+ },
477
+ cancel: function() {
478
+ listeners = null;
479
+ client.close();
480
+ }
481
+ };
482
+ };
483
+ exports.AgentKitClient = AgentKitClient;
420
484
  }
421
485
  });
422
486