@butlerbot/sdk 0.0.1 → 0.0.2

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.d.ts CHANGED
@@ -22,7 +22,4 @@ export declare class ButlerBotClient {
22
22
  createConversation(config?: OptionalApiKey<ConversationOptions>): Conversation;
23
23
  }
24
24
  export { Conversation, ConversationOptions };
25
- export * from "./types/ai_response_v3";
26
- export * from "./types/dialogue_response_v3";
27
- export * from "./types/error";
28
- export * from "./types/ai_tools_v3";
25
+ export * from "./types/type_registry";
package/dist/index.js CHANGED
@@ -54,8 +54,4 @@ class ButlerBotClient {
54
54
  }
55
55
  }
56
56
  exports.ButlerBotClient = ButlerBotClient;
57
- // Expose types from /types
58
- __exportStar(require("./types/ai_response_v3"), exports); // ai_response_v3.ts
59
- __exportStar(require("./types/dialogue_response_v3"), exports); // dialogue_response_v3.ts
60
- __exportStar(require("./types/error"), exports); // error.ts
61
- __exportStar(require("./types/ai_tools_v3"), exports); // ai_tools_v3.ts
57
+ __exportStar(require("./types/type_registry"), exports);
@@ -13,6 +13,7 @@ export type DialogueRequestParams = {
13
13
  /** Custom personality configuration for the AI */
14
14
  personality?: string;
15
15
  };
16
+ export type DialogueRequestOptions = Omit<Omit<DialogueRequestParams, "message">, "chatId">;
16
17
  export type ConversationOptions = {
17
18
  /** The conversation ID to load the conversation from, server will error if this convo id doesn't exist */
18
19
  convoId?: string;
@@ -32,5 +33,5 @@ export declare class Conversation {
32
33
  private debug;
33
34
  constructor(config: ConversationOptions);
34
35
  /** Sends a message into the conversation */
35
- send(message: string, cb: (chunk: RequestResponse) => any): Promise<void>;
36
+ send(message: string, cb: (chunk: RequestResponse) => any, options?: DialogueRequestOptions): Promise<void>;
36
37
  }
@@ -20,12 +20,9 @@ class Conversation {
20
20
  this.debug = config.debug || false;
21
21
  }
22
22
  /** Sends a message into the conversation */
23
- send(message, cb) {
23
+ send(message, cb, options) {
24
24
  return __awaiter(this, void 0, void 0, function* () {
25
- const params = {
26
- message,
27
- api_key: this.apiKey
28
- };
25
+ const params = Object.assign({ message, api_key: this.apiKey }, options);
29
26
  if (this.convoId)
30
27
  params.chatId = this.convoId;
31
28
  const paramQuery = new URLSearchParams(params).toString();
@@ -17,7 +17,7 @@ export type RequestFailResponse = {
17
17
  message: string;
18
18
  } & RequestBaseResponsePayload;
19
19
  };
20
- export type RequestSucessResponse = {
20
+ export type RequestSuccessResponse = {
21
21
  success: true;
22
22
  data: {
23
23
  /** The AI's response */
@@ -26,4 +26,4 @@ export type RequestSucessResponse = {
26
26
  convoId?: string;
27
27
  } & RequestBaseResponsePayload;
28
28
  };
29
- export type RequestResponse = RequestFailResponse | RequestSucessResponse;
29
+ export type RequestResponse = RequestFailResponse | RequestSuccessResponse;
@@ -0,0 +1,4 @@
1
+ export * from "./ai_response_v3";
2
+ export * from "./dialogue_response_v3";
3
+ export * from "./error";
4
+ export * from "./ai_tools_v3";
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./ai_response_v3"), exports);
18
+ __exportStar(require("./dialogue_response_v3"), exports);
19
+ __exportStar(require("./error"), exports);
20
+ __exportStar(require("./ai_tools_v3"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@butlerbot/sdk",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "The official ButlerBot SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",