tevrocsdk 0.1.48 → 0.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/tevroc-sdk.esm.js CHANGED
@@ -41524,6 +41524,16 @@ function buildRealtimeRoomName(value, appId = "") {
41524
41524
  function createClient(options = {}) {
41525
41525
  return new TevrocClient(options);
41526
41526
  }
41527
+ function createChatbotClient(options = {}) {
41528
+ if (!options.apiKey) throw new TevrocError("apiKey is required to create a chatbot client");
41529
+ const client = new TevrocClient({ ...options, appId: void 0, token: null, headers: { ...options.headers || {}, "x-api-key": options.apiKey } });
41530
+ const request = (path, requestOptions = {}) => client.request(path, { ...requestOptions, auth: false });
41531
+ return {
41532
+ getConfig: () => request("/chatbot/config"),
41533
+ createConversation: (input = {}) => request("/chatbot/conversations", { method: "POST", body: input }),
41534
+ sendMessage: (conversationId, input) => request(`/chatbot/conversations/${encodeURIComponent(conversationId)}/messages`, { method: "POST", body: input })
41535
+ };
41536
+ }
41527
41537
  var TevrocClient = class {
41528
41538
  constructor(options = {}) {
41529
41539
  const baseUrl = options.baseUrl ?? options.url;
@@ -42178,6 +42188,7 @@ function isJsonBody(body) {
42178
42188
  export {
42179
42189
  TevrocClient,
42180
42190
  TevrocError,
42191
+ createChatbotClient,
42181
42192
  createClient
42182
42193
  };
42183
42194
  /*! Bundled license information: