Skip to content

Commit ae7cf50

Browse files
committed
Support API ModelTypeDetermine.
1 parent f35fc75 commit ae7cf50

File tree

7 files changed

+304
-1
lines changed

7 files changed

+304
-1
lines changed

bailianmodelonchip-20240816/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@alicloud/bailianmodelonchip20240816",
3-
"version": "1.1.0",
3+
"version": "1.2.0",
44
"description": "",
55
"main": "dist/client.js",
66
"scripts": {

bailianmodelonchip-20240816/src/client.ts

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,4 +200,59 @@ export default class Client extends OpenApi {
200200
return await this.getTokenWithOptions(request, headers, runtime);
201201
}
202202

203+
/**
204+
* 模型类型识别
205+
*
206+
* @param tmpReq - ModelTypeDetermineRequest
207+
* @param headers - map
208+
* @param runtime - runtime options for this request RuntimeOptions
209+
* @returns ModelTypeDetermineResponse
210+
*/
211+
async modelTypeDetermineWithOptions(tmpReq: $_model.ModelTypeDetermineRequest, headers: {[key: string ]: string}, runtime: $dara.RuntimeOptions): Promise<$_model.ModelTypeDetermineResponse> {
212+
tmpReq.validate();
213+
let request = new $_model.ModelTypeDetermineShrinkRequest({ });
214+
OpenApiUtil.convert(tmpReq, request);
215+
if (!$dara.isNull(tmpReq.history)) {
216+
request.historyShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.history, "history", "json");
217+
}
218+
219+
let body : {[key: string ]: any} = { };
220+
if (!$dara.isNull(request.historyShrink)) {
221+
body["history"] = request.historyShrink;
222+
}
223+
224+
if (!$dara.isNull(request.inputText)) {
225+
body["inputText"] = request.inputText;
226+
}
227+
228+
let req = new $OpenApiUtil.OpenApiRequest({
229+
headers: headers,
230+
body: OpenApiUtil.parseToMap(body),
231+
});
232+
let params = new $OpenApiUtil.Params({
233+
action: "ModelTypeDetermine",
234+
version: "2024-08-16",
235+
protocol: "HTTPS",
236+
pathname: `/open/api/v1/model/type/determine`,
237+
method: "POST",
238+
authType: "AK",
239+
style: "ROA",
240+
reqBodyType: "formData",
241+
bodyType: "json",
242+
});
243+
return $dara.cast<$_model.ModelTypeDetermineResponse>(await this.callApi(params, req, runtime), new $_model.ModelTypeDetermineResponse({}));
244+
}
245+
246+
/**
247+
* 模型类型识别
248+
*
249+
* @param request - ModelTypeDetermineRequest
250+
* @returns ModelTypeDetermineResponse
251+
*/
252+
async modelTypeDetermine(request: $_model.ModelTypeDetermineRequest): Promise<$_model.ModelTypeDetermineResponse> {
253+
let runtime = new $dara.RuntimeOptions({ });
254+
let headers : {[key: string ]: string} = { };
255+
return await this.modelTypeDetermineWithOptions(request, headers, runtime);
256+
}
257+
203258
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
// This file is auto-generated, don't edit it
2+
import * as $dara from '@darabonba/typescript';
3+
4+
5+
export class ModelTypeDetermineRequestHistory extends $dara.Model {
6+
content?: string;
7+
role?: string;
8+
static names(): { [key: string]: string } {
9+
return {
10+
content: 'content',
11+
role: 'role',
12+
};
13+
}
14+
15+
static types(): { [key: string]: any } {
16+
return {
17+
content: 'string',
18+
role: 'string',
19+
};
20+
}
21+
22+
validate() {
23+
super.validate();
24+
}
25+
26+
constructor(map?: { [key: string]: any }) {
27+
super(map);
28+
}
29+
}
30+
31+
export class ModelTypeDetermineRequest extends $dara.Model {
32+
history?: ModelTypeDetermineRequestHistory[];
33+
/**
34+
* @remarks
35+
* This parameter is required.
36+
*/
37+
inputText?: string;
38+
static names(): { [key: string]: string } {
39+
return {
40+
history: 'history',
41+
inputText: 'inputText',
42+
};
43+
}
44+
45+
static types(): { [key: string]: any } {
46+
return {
47+
history: { 'type': 'array', 'itemType': ModelTypeDetermineRequestHistory },
48+
inputText: 'string',
49+
};
50+
}
51+
52+
validate() {
53+
if(Array.isArray(this.history)) {
54+
$dara.Model.validateArray(this.history);
55+
}
56+
super.validate();
57+
}
58+
59+
constructor(map?: { [key: string]: any }) {
60+
super(map);
61+
}
62+
}
63+
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// This file is auto-generated, don't edit it
2+
import * as $dara from '@darabonba/typescript';
3+
import { ModelTypeDetermineResponseBody } from "./ModelTypeDetermineResponseBody";
4+
5+
6+
export class ModelTypeDetermineResponse extends $dara.Model {
7+
headers?: { [key: string]: string };
8+
statusCode?: number;
9+
body?: ModelTypeDetermineResponseBody;
10+
static names(): { [key: string]: string } {
11+
return {
12+
headers: 'headers',
13+
statusCode: 'statusCode',
14+
body: 'body',
15+
};
16+
}
17+
18+
static types(): { [key: string]: any } {
19+
return {
20+
headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
21+
statusCode: 'number',
22+
body: ModelTypeDetermineResponseBody,
23+
};
24+
}
25+
26+
validate() {
27+
if(this.headers) {
28+
$dara.Model.validateMap(this.headers);
29+
}
30+
if(this.body && typeof (this.body as any).validate === 'function') {
31+
(this.body as any).validate();
32+
}
33+
super.validate();
34+
}
35+
36+
constructor(map?: { [key: string]: any }) {
37+
super(map);
38+
}
39+
}
40+
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
// This file is auto-generated, don't edit it
2+
import * as $dara from '@darabonba/typescript';
3+
4+
5+
export class ModelTypeDetermineResponseBodyData extends $dara.Model {
6+
/**
7+
* @example
8+
* false
9+
*/
10+
followUp?: boolean;
11+
rewriteText?: string;
12+
/**
13+
* @example
14+
* true
15+
*/
16+
vl?: boolean;
17+
static names(): { [key: string]: string } {
18+
return {
19+
followUp: 'followUp',
20+
rewriteText: 'rewriteText',
21+
vl: 'vl',
22+
};
23+
}
24+
25+
static types(): { [key: string]: any } {
26+
return {
27+
followUp: 'boolean',
28+
rewriteText: 'string',
29+
vl: 'boolean',
30+
};
31+
}
32+
33+
validate() {
34+
super.validate();
35+
}
36+
37+
constructor(map?: { [key: string]: any }) {
38+
super(map);
39+
}
40+
}
41+
42+
export class ModelTypeDetermineResponseBody extends $dara.Model {
43+
/**
44+
* @example
45+
* success
46+
*/
47+
code?: string;
48+
data?: ModelTypeDetermineResponseBodyData;
49+
/**
50+
* @example
51+
* 200
52+
*/
53+
httpStatusCode?: number;
54+
/**
55+
* @example
56+
* success
57+
*/
58+
message?: string;
59+
/**
60+
* @remarks
61+
* Id of the request
62+
*
63+
* @example
64+
* 7B0FC4BC-9E4B-5AD7-9D35-6559BDC0788E
65+
*/
66+
requestId?: string;
67+
/**
68+
* @example
69+
* True
70+
*/
71+
success?: string;
72+
static names(): { [key: string]: string } {
73+
return {
74+
code: 'code',
75+
data: 'data',
76+
httpStatusCode: 'httpStatusCode',
77+
message: 'message',
78+
requestId: 'requestId',
79+
success: 'success',
80+
};
81+
}
82+
83+
static types(): { [key: string]: any } {
84+
return {
85+
code: 'string',
86+
data: ModelTypeDetermineResponseBodyData,
87+
httpStatusCode: 'number',
88+
message: 'string',
89+
requestId: 'string',
90+
success: 'string',
91+
};
92+
}
93+
94+
validate() {
95+
if(this.data && typeof (this.data as any).validate === 'function') {
96+
(this.data as any).validate();
97+
}
98+
super.validate();
99+
}
100+
101+
constructor(map?: { [key: string]: any }) {
102+
super(map);
103+
}
104+
}
105+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// This file is auto-generated, don't edit it
2+
import * as $dara from '@darabonba/typescript';
3+
4+
5+
export class ModelTypeDetermineShrinkRequest extends $dara.Model {
6+
historyShrink?: string;
7+
/**
8+
* @remarks
9+
* This parameter is required.
10+
*/
11+
inputText?: string;
12+
static names(): { [key: string]: string } {
13+
return {
14+
historyShrink: 'history',
15+
inputText: 'inputText',
16+
};
17+
}
18+
19+
static types(): { [key: string]: any } {
20+
return {
21+
historyShrink: 'string',
22+
inputText: 'string',
23+
};
24+
}
25+
26+
validate() {
27+
super.validate();
28+
}
29+
30+
constructor(map?: { [key: string]: any }) {
31+
super(map);
32+
}
33+
}
34+

bailianmodelonchip-20240816/src/models/model.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
export { ActiveInteractionCreateResponseBodyData } from './ActiveInteractionCreateResponseBody';
22
export { DeviceRegisterResponseBodyData } from './DeviceRegisterResponseBody';
33
export { GetTokenResponseBodyData } from './GetTokenResponseBody';
4+
export { ModelTypeDetermineRequestHistory } from './ModelTypeDetermineRequest';
5+
export { ModelTypeDetermineResponseBodyData } from './ModelTypeDetermineResponseBody';
46
export { ActiveInteractionCreateRequest } from './ActiveInteractionCreateRequest';
57
export { ActiveInteractionCreateResponseBody } from './ActiveInteractionCreateResponseBody';
68
export { ActiveInteractionCreateResponse } from './ActiveInteractionCreateResponse';
@@ -10,3 +12,7 @@ export { DeviceRegisterResponse } from './DeviceRegisterResponse';
1012
export { GetTokenRequest } from './GetTokenRequest';
1113
export { GetTokenResponseBody } from './GetTokenResponseBody';
1214
export { GetTokenResponse } from './GetTokenResponse';
15+
export { ModelTypeDetermineRequest } from './ModelTypeDetermineRequest';
16+
export { ModelTypeDetermineShrinkRequest } from './ModelTypeDetermineShrinkRequest';
17+
export { ModelTypeDetermineResponseBody } from './ModelTypeDetermineResponseBody';
18+
export { ModelTypeDetermineResponse } from './ModelTypeDetermineResponse';

0 commit comments

Comments
 (0)