notdiamond 0.3.5 → 0.3.8

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.cjs CHANGED
@@ -16,7 +16,7 @@ function _interopNamespaceCompat(e) {
16
16
 
17
17
  const dotenv__namespace = /*#__PURE__*/_interopNamespaceCompat(dotenv);
18
18
 
19
- const version = "0.3.4";
19
+ const version = "0.3.7";
20
20
 
21
21
  var __defProp = Object.defineProperty;
22
22
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
@@ -27,14 +27,16 @@ var __publicField = (obj, key, value) => {
27
27
  dotenv__namespace.config();
28
28
  const DEFAULT_TIMEOUT = 5;
29
29
  const BASE_URL = "https://not-diamond-server.onrender.com";
30
- const MODEL_SELECT_URL = `${BASE_URL}/v2/modelRouter/modelSelect`;
31
- const FEEDBACK_URL = `${BASE_URL}/v2/report/metrics/feedback`;
32
30
  class NotDiamond {
33
31
  constructor(options = {}) {
34
32
  __publicField(this, "apiKey");
35
33
  __publicField(this, "apiUrl");
34
+ __publicField(this, "modelSelectUrl");
35
+ __publicField(this, "feedbackUrl");
36
36
  this.apiKey = options.apiKey || process.env.NOTDIAMOND_API_KEY || "";
37
37
  this.apiUrl = options.apiUrl || process.env.NOTDIAMOND_API_URL || BASE_URL;
38
+ this.modelSelectUrl = `${this.apiUrl}/v2/modelRouter/modelSelect`;
39
+ this.feedbackUrl = `${this.apiUrl}/v2/report/metrics/feedback`;
38
40
  }
39
41
  getAuthHeader() {
40
42
  return `Bearer ${this.apiKey}`;
@@ -97,12 +99,12 @@ class NotDiamond {
97
99
  }
98
100
  };
99
101
  return this.postRequest(
100
- MODEL_SELECT_URL,
102
+ this.modelSelectUrl,
101
103
  requestBody
102
104
  );
103
105
  }
104
106
  async feedback(options) {
105
- return this.postRequest(FEEDBACK_URL, {
107
+ return this.postRequest(this.feedbackUrl, {
106
108
  session_id: options.sessionId,
107
109
  feedback: options.feedback,
108
110
  provider: options.provider
package/dist/index.d.cts CHANGED
@@ -57,6 +57,8 @@ interface FeedbackSuccessResponse {
57
57
  declare class NotDiamond {
58
58
  private apiKey;
59
59
  private apiUrl;
60
+ private modelSelectUrl;
61
+ private feedbackUrl;
60
62
  constructor(options?: NotDiamondOptions);
61
63
  private getAuthHeader;
62
64
  private postRequest;
package/dist/index.d.mts CHANGED
@@ -57,6 +57,8 @@ interface FeedbackSuccessResponse {
57
57
  declare class NotDiamond {
58
58
  private apiKey;
59
59
  private apiUrl;
60
+ private modelSelectUrl;
61
+ private feedbackUrl;
60
62
  constructor(options?: NotDiamondOptions);
61
63
  private getAuthHeader;
62
64
  private postRequest;
package/dist/index.d.ts CHANGED
@@ -57,6 +57,8 @@ interface FeedbackSuccessResponse {
57
57
  declare class NotDiamond {
58
58
  private apiKey;
59
59
  private apiUrl;
60
+ private modelSelectUrl;
61
+ private feedbackUrl;
60
62
  constructor(options?: NotDiamondOptions);
61
63
  private getAuthHeader;
62
64
  private postRequest;
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as dotenv from 'dotenv';
2
2
 
3
- const version = "0.3.4";
3
+ const version = "0.3.7";
4
4
 
5
5
  var __defProp = Object.defineProperty;
6
6
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
@@ -11,14 +11,16 @@ var __publicField = (obj, key, value) => {
11
11
  dotenv.config();
12
12
  const DEFAULT_TIMEOUT = 5;
13
13
  const BASE_URL = "https://not-diamond-server.onrender.com";
14
- const MODEL_SELECT_URL = `${BASE_URL}/v2/modelRouter/modelSelect`;
15
- const FEEDBACK_URL = `${BASE_URL}/v2/report/metrics/feedback`;
16
14
  class NotDiamond {
17
15
  constructor(options = {}) {
18
16
  __publicField(this, "apiKey");
19
17
  __publicField(this, "apiUrl");
18
+ __publicField(this, "modelSelectUrl");
19
+ __publicField(this, "feedbackUrl");
20
20
  this.apiKey = options.apiKey || process.env.NOTDIAMOND_API_KEY || "";
21
21
  this.apiUrl = options.apiUrl || process.env.NOTDIAMOND_API_URL || BASE_URL;
22
+ this.modelSelectUrl = `${this.apiUrl}/v2/modelRouter/modelSelect`;
23
+ this.feedbackUrl = `${this.apiUrl}/v2/report/metrics/feedback`;
22
24
  }
23
25
  getAuthHeader() {
24
26
  return `Bearer ${this.apiKey}`;
@@ -81,12 +83,12 @@ class NotDiamond {
81
83
  }
82
84
  };
83
85
  return this.postRequest(
84
- MODEL_SELECT_URL,
86
+ this.modelSelectUrl,
85
87
  requestBody
86
88
  );
87
89
  }
88
90
  async feedback(options) {
89
- return this.postRequest(FEEDBACK_URL, {
91
+ return this.postRequest(this.feedbackUrl, {
90
92
  session_id: options.sessionId,
91
93
  feedback: options.feedback,
92
94
  provider: options.provider
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "notdiamond",
3
3
  "type": "module",
4
- "version": "0.3.5",
4
+ "version": "0.3.8",
5
5
  "author": "not-diamond",
6
6
  "license": "MIT",
7
7
  "description": "TS/JS client for the NotDiamond API",
package/CHANGELOG.md DELETED
@@ -1,11 +0,0 @@
1
- ## [0.0.2](https://github.com/Not-Diamond/notdiamond-node/pull/4) (2024-05-22)
2
-
3
- ### Bug Fixes
4
-
5
- - Cleaned up readme [4c33bd8be65850ef4c5ca34aa9d18c60ee44ead5](https://github.com/Not-Diamond/notdiamond-node/pull/4/commits/4c33bd8be65850ef4c5ca34aa9d18c60ee44ead5)
6
-
7
- ## [0.0.1](https://github.com/Not-Diamond/notdiamond-node/tree/32bccf352544414e1486c170b90cf00f75041190) (2024-05-22)
8
-
9
- ### Initial release
10
-
11
- - Code setup