@saplingai/sapling-js 1.0.9 → 1.0.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saplingai/sapling-js",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "JavaScript library for using the Sapling.ai API.",
5
5
  "type": "module",
6
6
  "dependencies": {
@@ -13,6 +13,10 @@ type EditOptions = {
13
13
  medical?: boolean,
14
14
  }
15
15
 
16
+ type AIDetectOptions = {
17
+ sent_scores?: boolean,
18
+ }
19
+
16
20
  type SpellcheckOptions = {
17
21
  minLength?: number,
18
22
  multipleEdits?: boolean,
@@ -34,4 +38,6 @@ declare class Client {
34
38
  complete(query: string, sessionId: string): Promise<AxiosResponse>;
35
39
  acceptComplete(completeUUID: string, query: string, completion: string, sessionId: string): Promise<AxiosResponse>;
36
40
  tone(text: string): Promise<AxiosResponse>;
41
+
42
+ aidetect(text: string, options?: AIDetectOptions): Promise<AxiosResponse>;
37
43
  }
package/sapling/client.js CHANGED
@@ -152,4 +152,18 @@ export class Client {
152
152
  return this.axiosPromise(url, 'post', data);
153
153
  }
154
154
 
155
+ aidetect(text, options = {}) {
156
+ const url = `${this.urlEndpoint}aidetect`;
157
+
158
+ let data = {
159
+ text,
160
+ key: this.apiKey,
161
+ }
162
+
163
+ if (options.sent_scores != null) {
164
+ data.sent_scores = options.sent_scores;
165
+ }
166
+
167
+ return this.axiosPromise(url, 'post', data);
168
+ }
155
169
  }
@@ -1,3 +1,3 @@
1
- import { SaplingModule } from './sapling-sdk-v1.0.4.min.js';
1
+ import { SaplingModule } from './sapling-sdk-v1.0.5.min.js';
2
2
 
3
3
  export const Sapling = SaplingModule.SaplingModule;