@maxim_mazurok/gapi.client.language-v1 0.0.20220902 → 0.0.20220916

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.
Files changed (3) hide show
  1. package/index.d.ts +18 -1
  2. package/package.json +1 -1
  3. package/tests.ts +15 -1
package/index.d.ts CHANGED
@@ -10,7 +10,7 @@
10
10
  // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
11
11
  // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
12
12
  // Generated from: https://language.googleapis.com/$discovery/rest?version=v1
13
- // Revision: 20220902
13
+ // Revision: 20220916
14
14
 
15
15
  /// <reference types="gapi.client" />
16
16
 
@@ -118,7 +118,15 @@ declare namespace gapi.client {
118
118
  /** The name of the category representing the document, from the [predefined taxonomy](https://cloud.google.com/natural-language/docs/categories). */
119
119
  name?: string;
120
120
  }
121
+ interface ClassificationModelOptions {
122
+ /** Setting this field will use the V1 model and V1 content categories version. The V1 model is a legacy model; support for this will be discontinued in the future. */
123
+ v1Model?: any;
124
+ /** Setting this field will use the V2 model with the appropriate content categories version. The V2 model is a better performing model. */
125
+ v2Model?: V2Model;
126
+ }
121
127
  interface ClassifyTextRequest {
128
+ /** Model options to use for classification. Defaults to v1 options if not specified. */
129
+ classificationModelOptions?: ClassificationModelOptions;
122
130
  /** Required. Input document. */
123
131
  document?: Document;
124
132
  }
@@ -187,6 +195,8 @@ declare namespace gapi.client {
187
195
  type?: string;
188
196
  }
189
197
  interface Features {
198
+ /** The model options to use for classification. Defaults to v1 options if not specified. Only used if `classify_text` is set to true. */
199
+ classificationModelOptions?: ClassificationModelOptions;
190
200
  /** Classify the full document into categories. */
191
201
  classifyText?: boolean;
192
202
  /** Extract document-level sentiment. */
@@ -263,6 +273,13 @@ declare namespace gapi.client {
263
273
  /** The token text. */
264
274
  text?: TextSpan;
265
275
  }
276
+ // tslint:disable-next-line:no-empty-interface
277
+ interface V1Model {
278
+ }
279
+ interface V2Model {
280
+ /** The content categories used for classification. */
281
+ contentCategoriesVersion?: string;
282
+ }
266
283
  interface DocumentsResource {
267
284
  /** Finds named entities (currently proper names and common nouns) in the text along with entity types, salience, mentions for each entity, and other properties. */
268
285
  analyzeEntities(request: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maxim_mazurok/gapi.client.language-v1",
3
- "version": "0.0.20220902",
3
+ "version": "0.0.20220916",
4
4
  "description": "TypeScript typings for Cloud Natural Language API v1",
5
5
  "license": "MIT",
6
6
  "author": {
package/tests.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
4
4
  // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
5
5
 
6
- // Revision: 20220902
6
+ // Revision: 20220916
7
7
 
8
8
  gapi.load('client', async () => {
9
9
  /** now we can use gapi.client */
@@ -86,6 +86,13 @@ gapi.load('client', async () => {
86
86
  },
87
87
  encodingType: "Test string",
88
88
  features: {
89
+ classificationModelOptions: {
90
+ v1Model: {
91
+ },
92
+ v2Model: {
93
+ contentCategoriesVersion: "Test string",
94
+ },
95
+ },
89
96
  classifyText: true,
90
97
  extractDocumentSentiment: true,
91
98
  extractEntities: true,
@@ -96,6 +103,13 @@ gapi.load('client', async () => {
96
103
  /** Classifies a document into categories. */
97
104
  await gapi.client.language.documents.classifyText({
98
105
  }, {
106
+ classificationModelOptions: {
107
+ v1Model: {
108
+ },
109
+ v2Model: {
110
+ contentCategoriesVersion: "Test string",
111
+ },
112
+ },
99
113
  document: {
100
114
  content: "Test string",
101
115
  gcsContentUri: "Test string",