matvenus-cli 0.1.0
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/CHANGELOG.md +22 -0
- package/LICENSE +201 -0
- package/README.md +408 -0
- package/bin/cli.js +3 -0
- package/dist/client.d.ts +13 -0
- package/dist/client.js +62 -0
- package/dist/commands/alphafold_protein_folding.d.ts +2 -0
- package/dist/commands/alphafold_protein_folding.js +262 -0
- package/dist/commands/cancel_tool_result.d.ts +2 -0
- package/dist/commands/cancel_tool_result.js +388 -0
- package/dist/commands/diffdock_protein_ligand_docking.d.ts +2 -0
- package/dist/commands/diffdock_protein_ligand_docking.js +252 -0
- package/dist/commands/esmfold_protein_folding.d.ts +2 -0
- package/dist/commands/esmfold_protein_folding.js +219 -0
- package/dist/commands/get_tool_result.d.ts +2 -0
- package/dist/commands/get_tool_result.js +388 -0
- package/dist/commands/gromacs_analysis.d.ts +2 -0
- package/dist/commands/gromacs_analysis.js +212 -0
- package/dist/commands/gromacs_md.d.ts +2 -0
- package/dist/commands/gromacs_md.js +236 -0
- package/dist/commands/index.d.ts +2 -0
- package/dist/commands/index.js +39 -0
- package/dist/commands/predict_functional_residue.d.ts +2 -0
- package/dist/commands/predict_functional_residue.js +234 -0
- package/dist/commands/predict_protein_properties.d.ts +2 -0
- package/dist/commands/predict_protein_properties.js +228 -0
- package/dist/commands/proteinmpnn_sequence_design.d.ts +2 -0
- package/dist/commands/proteinmpnn_sequence_design.js +271 -0
- package/dist/commands/rfdiffusion_protein_design.d.ts +2 -0
- package/dist/commands/rfdiffusion_protein_design.js +333 -0
- package/dist/commands/upload_file_base_64.d.ts +2 -0
- package/dist/commands/upload_file_base_64.js +212 -0
- package/dist/commands/venusg_protein_function_prediction.d.ts +2 -0
- package/dist/commands/venusg_protein_function_prediction.js +234 -0
- package/dist/commands/venusmine_protein_mining.d.ts +2 -0
- package/dist/commands/venusmine_protein_mining.js +212 -0
- package/dist/commands/venusprime_multipoint_prediction.d.ts +2 -0
- package/dist/commands/venusprime_multipoint_prediction.js +322 -0
- package/dist/commands/venusrem_mutation_prediction.d.ts +2 -0
- package/dist/commands/venusrem_mutation_prediction.js +260 -0
- package/dist/commands/venusx_functional_residue_prediction.d.ts +2 -0
- package/dist/commands/venusx_functional_residue_prediction.js +234 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +125 -0
- package/dist/types.d.ts +12 -0
- package/dist/types.js +6 -0
- package/package.json +41 -0
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.register = register;
|
|
4
|
+
const client_1 = require("../client");
|
|
5
|
+
function register(program, baseUrl) {
|
|
6
|
+
program
|
|
7
|
+
.command('upload-file-base-64')
|
|
8
|
+
.description('Upload File Base64')
|
|
9
|
+
.option('--body <json>', 'Request body as JSON string', (value) => value)
|
|
10
|
+
.option('--base-url <url>', 'Override base URL')
|
|
11
|
+
.option('--output <format>', 'Output format: json, table', 'json')
|
|
12
|
+
.option('--schema', 'Show API schema and exit')
|
|
13
|
+
.action(async (options) => {
|
|
14
|
+
if (options.schema) {
|
|
15
|
+
console.log(JSON.stringify({
|
|
16
|
+
"method": "post",
|
|
17
|
+
"operationId": "upload_file_base64",
|
|
18
|
+
"summary": "Upload File Base64",
|
|
19
|
+
"description": "上传 Base64 编码的文件到存储系统。\n用于 Agent 在调用分析工具前上传本地文件并获取 URL。",
|
|
20
|
+
"tags": [
|
|
21
|
+
"tools-upload"
|
|
22
|
+
],
|
|
23
|
+
"parameters": [],
|
|
24
|
+
"requestBody": {
|
|
25
|
+
"required": true,
|
|
26
|
+
"contentType": "application/json",
|
|
27
|
+
"schema": {
|
|
28
|
+
"properties": {
|
|
29
|
+
"filename": {
|
|
30
|
+
"type": "string",
|
|
31
|
+
"title": "Filename",
|
|
32
|
+
"description": "文件名,例如 'protein.fasta'"
|
|
33
|
+
},
|
|
34
|
+
"content_base64": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"title": "Content Base64",
|
|
37
|
+
"description": "文件的 Base64 编码内容"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"type": "object",
|
|
41
|
+
"required": [
|
|
42
|
+
"filename",
|
|
43
|
+
"content_base64"
|
|
44
|
+
],
|
|
45
|
+
"title": "MCPUploadFileRequest"
|
|
46
|
+
},
|
|
47
|
+
"isBinary": false
|
|
48
|
+
},
|
|
49
|
+
"responses": [
|
|
50
|
+
{
|
|
51
|
+
"statusCode": "200",
|
|
52
|
+
"description": "Successful Response",
|
|
53
|
+
"contentType": "application/json",
|
|
54
|
+
"schema": {
|
|
55
|
+
"properties": {
|
|
56
|
+
"tool_call_id": {
|
|
57
|
+
"type": "string",
|
|
58
|
+
"title": "Tool Call Id",
|
|
59
|
+
"description": "系统生成的调用唯一ID"
|
|
60
|
+
},
|
|
61
|
+
"status": {
|
|
62
|
+
"description": "调用状态: running, success, error 等",
|
|
63
|
+
"type": "string",
|
|
64
|
+
"enum": [
|
|
65
|
+
"pending",
|
|
66
|
+
"running",
|
|
67
|
+
"success",
|
|
68
|
+
"error"
|
|
69
|
+
],
|
|
70
|
+
"title": "ToolResultStatus"
|
|
71
|
+
},
|
|
72
|
+
"result": {
|
|
73
|
+
"anyOf": [
|
|
74
|
+
{},
|
|
75
|
+
{
|
|
76
|
+
"type": "null"
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
"title": "Result",
|
|
80
|
+
"description": "如果即时成功,这里是工具的返回结果字典"
|
|
81
|
+
},
|
|
82
|
+
"error_message": {
|
|
83
|
+
"anyOf": [
|
|
84
|
+
{
|
|
85
|
+
"type": "string"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"type": "null"
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
"title": "Error Message",
|
|
92
|
+
"description": "如果有错误,提供错误信息"
|
|
93
|
+
},
|
|
94
|
+
"credits_cost": {
|
|
95
|
+
"anyOf": [
|
|
96
|
+
{
|
|
97
|
+
"type": "number"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"type": "null"
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
"title": "Credits Cost",
|
|
104
|
+
"description": "消费积分"
|
|
105
|
+
},
|
|
106
|
+
"tool_name": {
|
|
107
|
+
"type": "string",
|
|
108
|
+
"title": "Tool Name",
|
|
109
|
+
"description": "执行的工具名"
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"type": "object",
|
|
113
|
+
"required": [
|
|
114
|
+
"tool_call_id",
|
|
115
|
+
"status",
|
|
116
|
+
"tool_name"
|
|
117
|
+
],
|
|
118
|
+
"title": "ToolInvokeResponse"
|
|
119
|
+
},
|
|
120
|
+
"isBinary": false
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"statusCode": "422",
|
|
124
|
+
"description": "Validation Error",
|
|
125
|
+
"contentType": "application/json",
|
|
126
|
+
"schema": {
|
|
127
|
+
"properties": {
|
|
128
|
+
"detail": {
|
|
129
|
+
"items": {
|
|
130
|
+
"properties": {
|
|
131
|
+
"loc": {
|
|
132
|
+
"items": {
|
|
133
|
+
"anyOf": [
|
|
134
|
+
{
|
|
135
|
+
"type": "string"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"type": "integer"
|
|
139
|
+
}
|
|
140
|
+
]
|
|
141
|
+
},
|
|
142
|
+
"type": "array",
|
|
143
|
+
"title": "Location"
|
|
144
|
+
},
|
|
145
|
+
"msg": {
|
|
146
|
+
"type": "string",
|
|
147
|
+
"title": "Message"
|
|
148
|
+
},
|
|
149
|
+
"type": {
|
|
150
|
+
"type": "string",
|
|
151
|
+
"title": "Error Type"
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"type": "object",
|
|
155
|
+
"required": [
|
|
156
|
+
"loc",
|
|
157
|
+
"msg",
|
|
158
|
+
"type"
|
|
159
|
+
],
|
|
160
|
+
"title": "ValidationError"
|
|
161
|
+
},
|
|
162
|
+
"type": "array",
|
|
163
|
+
"title": "Detail"
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
"type": "object",
|
|
167
|
+
"title": "HTTPValidationError"
|
|
168
|
+
},
|
|
169
|
+
"isBinary": false
|
|
170
|
+
}
|
|
171
|
+
],
|
|
172
|
+
"security": [
|
|
173
|
+
"HTTPBearer"
|
|
174
|
+
]
|
|
175
|
+
}, null, 2));
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
try {
|
|
179
|
+
const currentBaseUrl = options.baseUrl || baseUrl;
|
|
180
|
+
const config = { baseUrl: currentBaseUrl };
|
|
181
|
+
const path = '/api/tools/upload/base64';
|
|
182
|
+
const url = path;
|
|
183
|
+
const body = options.body ? JSON.parse(options.body) : undefined;
|
|
184
|
+
const response = await (0, client_1.request)(config, {
|
|
185
|
+
method: 'post',
|
|
186
|
+
path: url,
|
|
187
|
+
headers: undefined,
|
|
188
|
+
body: body,
|
|
189
|
+
isBinary: false,
|
|
190
|
+
});
|
|
191
|
+
const data = response;
|
|
192
|
+
if (options.output === 'json') {
|
|
193
|
+
console.log(JSON.stringify(data, null, 2));
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
console.log(data);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
catch (error) {
|
|
200
|
+
if (error.status) {
|
|
201
|
+
console.error('API Error:', error.status, error.message);
|
|
202
|
+
if (error.data) {
|
|
203
|
+
console.error(JSON.stringify(error.data, null, 2));
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
console.error('Error:', error.message);
|
|
208
|
+
}
|
|
209
|
+
process.exit(1);
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
}
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.register = register;
|
|
4
|
+
const client_1 = require("../client");
|
|
5
|
+
function register(program, baseUrl) {
|
|
6
|
+
program
|
|
7
|
+
.command('venusg-protein-function-prediction')
|
|
8
|
+
.description('Venusg Protein Function')
|
|
9
|
+
.option('--body <json>', 'Request body as JSON string', (value) => value)
|
|
10
|
+
.option('--base-url <url>', 'Override base URL')
|
|
11
|
+
.option('--output <format>', 'Output format: json, table', 'json')
|
|
12
|
+
.option('--schema', 'Show API schema and exit')
|
|
13
|
+
.action(async (options) => {
|
|
14
|
+
if (options.schema) {
|
|
15
|
+
console.log(JSON.stringify({
|
|
16
|
+
"method": "post",
|
|
17
|
+
"operationId": "venusg_protein_function_prediction",
|
|
18
|
+
"summary": "Venusg Protein Function",
|
|
19
|
+
"tags": [
|
|
20
|
+
"tools-predict"
|
|
21
|
+
],
|
|
22
|
+
"parameters": [],
|
|
23
|
+
"requestBody": {
|
|
24
|
+
"required": true,
|
|
25
|
+
"contentType": "application/json",
|
|
26
|
+
"schema": {
|
|
27
|
+
"properties": {
|
|
28
|
+
"sequence": {
|
|
29
|
+
"anyOf": [
|
|
30
|
+
{
|
|
31
|
+
"type": "string"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"type": "null"
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"title": "Sequence",
|
|
38
|
+
"description": "Protein sequence in single letter amino acid code"
|
|
39
|
+
},
|
|
40
|
+
"fasta_file": {
|
|
41
|
+
"anyOf": [
|
|
42
|
+
{
|
|
43
|
+
"type": "string"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"type": "null"
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"title": "Fasta File",
|
|
50
|
+
"description": "OSS URL to FASTA file"
|
|
51
|
+
},
|
|
52
|
+
"task": {
|
|
53
|
+
"type": "string",
|
|
54
|
+
"title": "Task",
|
|
55
|
+
"description": "VenusG task: VenusG-Solubility, VenusG-SubcellularLocalization, VenusG-MembraneProtein, VenusG-Metalionbinding, VenusG-Stability, VenusG-Sortingsignal, VenusG-OptimumTemperature, VenusG-Kcat, VenusG-OptimalPH",
|
|
56
|
+
"default": "VenusG-Solubility"
|
|
57
|
+
},
|
|
58
|
+
"mode": {
|
|
59
|
+
"type": "string",
|
|
60
|
+
"title": "Mode",
|
|
61
|
+
"description": "Model mode: pro uses ESM2-650M, light uses ProtBert (default). Model is read from venusg_config.yaml",
|
|
62
|
+
"default": "light"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"type": "object",
|
|
66
|
+
"title": "VenusGProteinFunctionPredictionInput",
|
|
67
|
+
"description": "Input for VenusG protein-level function prediction. Uses venusg_config.yaml; pro=ESM2-650M, light=ProtBert."
|
|
68
|
+
},
|
|
69
|
+
"isBinary": false
|
|
70
|
+
},
|
|
71
|
+
"responses": [
|
|
72
|
+
{
|
|
73
|
+
"statusCode": "200",
|
|
74
|
+
"description": "Successful Response",
|
|
75
|
+
"contentType": "application/json",
|
|
76
|
+
"schema": {
|
|
77
|
+
"properties": {
|
|
78
|
+
"tool_call_id": {
|
|
79
|
+
"type": "string",
|
|
80
|
+
"title": "Tool Call Id",
|
|
81
|
+
"description": "系统生成的调用唯一ID"
|
|
82
|
+
},
|
|
83
|
+
"status": {
|
|
84
|
+
"description": "调用状态: running, success, error 等",
|
|
85
|
+
"type": "string",
|
|
86
|
+
"enum": [
|
|
87
|
+
"pending",
|
|
88
|
+
"running",
|
|
89
|
+
"success",
|
|
90
|
+
"error"
|
|
91
|
+
],
|
|
92
|
+
"title": "ToolResultStatus"
|
|
93
|
+
},
|
|
94
|
+
"result": {
|
|
95
|
+
"anyOf": [
|
|
96
|
+
{},
|
|
97
|
+
{
|
|
98
|
+
"type": "null"
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
"title": "Result",
|
|
102
|
+
"description": "如果即时成功,这里是工具的返回结果字典"
|
|
103
|
+
},
|
|
104
|
+
"error_message": {
|
|
105
|
+
"anyOf": [
|
|
106
|
+
{
|
|
107
|
+
"type": "string"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"type": "null"
|
|
111
|
+
}
|
|
112
|
+
],
|
|
113
|
+
"title": "Error Message",
|
|
114
|
+
"description": "如果有错误,提供错误信息"
|
|
115
|
+
},
|
|
116
|
+
"credits_cost": {
|
|
117
|
+
"anyOf": [
|
|
118
|
+
{
|
|
119
|
+
"type": "number"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"type": "null"
|
|
123
|
+
}
|
|
124
|
+
],
|
|
125
|
+
"title": "Credits Cost",
|
|
126
|
+
"description": "消费积分"
|
|
127
|
+
},
|
|
128
|
+
"tool_name": {
|
|
129
|
+
"type": "string",
|
|
130
|
+
"title": "Tool Name",
|
|
131
|
+
"description": "执行的工具名"
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
"type": "object",
|
|
135
|
+
"required": [
|
|
136
|
+
"tool_call_id",
|
|
137
|
+
"status",
|
|
138
|
+
"tool_name"
|
|
139
|
+
],
|
|
140
|
+
"title": "ToolInvokeResponse"
|
|
141
|
+
},
|
|
142
|
+
"isBinary": false
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"statusCode": "422",
|
|
146
|
+
"description": "Validation Error",
|
|
147
|
+
"contentType": "application/json",
|
|
148
|
+
"schema": {
|
|
149
|
+
"properties": {
|
|
150
|
+
"detail": {
|
|
151
|
+
"items": {
|
|
152
|
+
"properties": {
|
|
153
|
+
"loc": {
|
|
154
|
+
"items": {
|
|
155
|
+
"anyOf": [
|
|
156
|
+
{
|
|
157
|
+
"type": "string"
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"type": "integer"
|
|
161
|
+
}
|
|
162
|
+
]
|
|
163
|
+
},
|
|
164
|
+
"type": "array",
|
|
165
|
+
"title": "Location"
|
|
166
|
+
},
|
|
167
|
+
"msg": {
|
|
168
|
+
"type": "string",
|
|
169
|
+
"title": "Message"
|
|
170
|
+
},
|
|
171
|
+
"type": {
|
|
172
|
+
"type": "string",
|
|
173
|
+
"title": "Error Type"
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
"type": "object",
|
|
177
|
+
"required": [
|
|
178
|
+
"loc",
|
|
179
|
+
"msg",
|
|
180
|
+
"type"
|
|
181
|
+
],
|
|
182
|
+
"title": "ValidationError"
|
|
183
|
+
},
|
|
184
|
+
"type": "array",
|
|
185
|
+
"title": "Detail"
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
"type": "object",
|
|
189
|
+
"title": "HTTPValidationError"
|
|
190
|
+
},
|
|
191
|
+
"isBinary": false
|
|
192
|
+
}
|
|
193
|
+
],
|
|
194
|
+
"security": [
|
|
195
|
+
"HTTPBearer"
|
|
196
|
+
]
|
|
197
|
+
}, null, 2));
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
try {
|
|
201
|
+
const currentBaseUrl = options.baseUrl || baseUrl;
|
|
202
|
+
const config = { baseUrl: currentBaseUrl };
|
|
203
|
+
const path = '/api/tools/predict/venusg-protein-function';
|
|
204
|
+
const url = path;
|
|
205
|
+
const body = options.body ? JSON.parse(options.body) : undefined;
|
|
206
|
+
const response = await (0, client_1.request)(config, {
|
|
207
|
+
method: 'post',
|
|
208
|
+
path: url,
|
|
209
|
+
headers: undefined,
|
|
210
|
+
body: body,
|
|
211
|
+
isBinary: false,
|
|
212
|
+
});
|
|
213
|
+
const data = response;
|
|
214
|
+
if (options.output === 'json') {
|
|
215
|
+
console.log(JSON.stringify(data, null, 2));
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
console.log(data);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
catch (error) {
|
|
222
|
+
if (error.status) {
|
|
223
|
+
console.error('API Error:', error.status, error.message);
|
|
224
|
+
if (error.data) {
|
|
225
|
+
console.error(JSON.stringify(error.data, null, 2));
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
console.error('Error:', error.message);
|
|
230
|
+
}
|
|
231
|
+
process.exit(1);
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.register = register;
|
|
4
|
+
const client_1 = require("../client");
|
|
5
|
+
function register(program, baseUrl) {
|
|
6
|
+
program
|
|
7
|
+
.command('venusmine-protein-mining')
|
|
8
|
+
.description('Venusmine Mining')
|
|
9
|
+
.option('--body <json>', 'Request body as JSON string', (value) => value)
|
|
10
|
+
.option('--base-url <url>', 'Override base URL')
|
|
11
|
+
.option('--output <format>', 'Output format: json, table', 'json')
|
|
12
|
+
.option('--schema', 'Show API schema and exit')
|
|
13
|
+
.action(async (options) => {
|
|
14
|
+
if (options.schema) {
|
|
15
|
+
console.log(JSON.stringify({
|
|
16
|
+
"method": "post",
|
|
17
|
+
"operationId": "venusmine_protein_mining",
|
|
18
|
+
"summary": "Venusmine Mining",
|
|
19
|
+
"tags": [
|
|
20
|
+
"tools-predict"
|
|
21
|
+
],
|
|
22
|
+
"parameters": [],
|
|
23
|
+
"requestBody": {
|
|
24
|
+
"required": true,
|
|
25
|
+
"contentType": "application/json",
|
|
26
|
+
"schema": {
|
|
27
|
+
"properties": {
|
|
28
|
+
"pdb_file": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"title": "Pdb File",
|
|
31
|
+
"description": "OSS URL to input PDB file"
|
|
32
|
+
},
|
|
33
|
+
"target_server": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"title": "Target Server",
|
|
36
|
+
"description": "Target server: 'slurm' for local Slurm cluster, 'paracloud' for remote Paracloud execution (default: 'slurm')",
|
|
37
|
+
"default": "slurm"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"type": "object",
|
|
41
|
+
"required": [
|
|
42
|
+
"pdb_file"
|
|
43
|
+
],
|
|
44
|
+
"title": "VenusMineInput",
|
|
45
|
+
"description": "Input for VenusMine protein mining pipeline"
|
|
46
|
+
},
|
|
47
|
+
"isBinary": false
|
|
48
|
+
},
|
|
49
|
+
"responses": [
|
|
50
|
+
{
|
|
51
|
+
"statusCode": "200",
|
|
52
|
+
"description": "Successful Response",
|
|
53
|
+
"contentType": "application/json",
|
|
54
|
+
"schema": {
|
|
55
|
+
"properties": {
|
|
56
|
+
"tool_call_id": {
|
|
57
|
+
"type": "string",
|
|
58
|
+
"title": "Tool Call Id",
|
|
59
|
+
"description": "系统生成的调用唯一ID"
|
|
60
|
+
},
|
|
61
|
+
"status": {
|
|
62
|
+
"description": "调用状态: running, success, error 等",
|
|
63
|
+
"type": "string",
|
|
64
|
+
"enum": [
|
|
65
|
+
"pending",
|
|
66
|
+
"running",
|
|
67
|
+
"success",
|
|
68
|
+
"error"
|
|
69
|
+
],
|
|
70
|
+
"title": "ToolResultStatus"
|
|
71
|
+
},
|
|
72
|
+
"result": {
|
|
73
|
+
"anyOf": [
|
|
74
|
+
{},
|
|
75
|
+
{
|
|
76
|
+
"type": "null"
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
"title": "Result",
|
|
80
|
+
"description": "如果即时成功,这里是工具的返回结果字典"
|
|
81
|
+
},
|
|
82
|
+
"error_message": {
|
|
83
|
+
"anyOf": [
|
|
84
|
+
{
|
|
85
|
+
"type": "string"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"type": "null"
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
"title": "Error Message",
|
|
92
|
+
"description": "如果有错误,提供错误信息"
|
|
93
|
+
},
|
|
94
|
+
"credits_cost": {
|
|
95
|
+
"anyOf": [
|
|
96
|
+
{
|
|
97
|
+
"type": "number"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"type": "null"
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
"title": "Credits Cost",
|
|
104
|
+
"description": "消费积分"
|
|
105
|
+
},
|
|
106
|
+
"tool_name": {
|
|
107
|
+
"type": "string",
|
|
108
|
+
"title": "Tool Name",
|
|
109
|
+
"description": "执行的工具名"
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"type": "object",
|
|
113
|
+
"required": [
|
|
114
|
+
"tool_call_id",
|
|
115
|
+
"status",
|
|
116
|
+
"tool_name"
|
|
117
|
+
],
|
|
118
|
+
"title": "ToolInvokeResponse"
|
|
119
|
+
},
|
|
120
|
+
"isBinary": false
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"statusCode": "422",
|
|
124
|
+
"description": "Validation Error",
|
|
125
|
+
"contentType": "application/json",
|
|
126
|
+
"schema": {
|
|
127
|
+
"properties": {
|
|
128
|
+
"detail": {
|
|
129
|
+
"items": {
|
|
130
|
+
"properties": {
|
|
131
|
+
"loc": {
|
|
132
|
+
"items": {
|
|
133
|
+
"anyOf": [
|
|
134
|
+
{
|
|
135
|
+
"type": "string"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"type": "integer"
|
|
139
|
+
}
|
|
140
|
+
]
|
|
141
|
+
},
|
|
142
|
+
"type": "array",
|
|
143
|
+
"title": "Location"
|
|
144
|
+
},
|
|
145
|
+
"msg": {
|
|
146
|
+
"type": "string",
|
|
147
|
+
"title": "Message"
|
|
148
|
+
},
|
|
149
|
+
"type": {
|
|
150
|
+
"type": "string",
|
|
151
|
+
"title": "Error Type"
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"type": "object",
|
|
155
|
+
"required": [
|
|
156
|
+
"loc",
|
|
157
|
+
"msg",
|
|
158
|
+
"type"
|
|
159
|
+
],
|
|
160
|
+
"title": "ValidationError"
|
|
161
|
+
},
|
|
162
|
+
"type": "array",
|
|
163
|
+
"title": "Detail"
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
"type": "object",
|
|
167
|
+
"title": "HTTPValidationError"
|
|
168
|
+
},
|
|
169
|
+
"isBinary": false
|
|
170
|
+
}
|
|
171
|
+
],
|
|
172
|
+
"security": [
|
|
173
|
+
"HTTPBearer"
|
|
174
|
+
]
|
|
175
|
+
}, null, 2));
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
try {
|
|
179
|
+
const currentBaseUrl = options.baseUrl || baseUrl;
|
|
180
|
+
const config = { baseUrl: currentBaseUrl };
|
|
181
|
+
const path = '/api/tools/predict/venusmine-mining';
|
|
182
|
+
const url = path;
|
|
183
|
+
const body = options.body ? JSON.parse(options.body) : undefined;
|
|
184
|
+
const response = await (0, client_1.request)(config, {
|
|
185
|
+
method: 'post',
|
|
186
|
+
path: url,
|
|
187
|
+
headers: undefined,
|
|
188
|
+
body: body,
|
|
189
|
+
isBinary: false,
|
|
190
|
+
});
|
|
191
|
+
const data = response;
|
|
192
|
+
if (options.output === 'json') {
|
|
193
|
+
console.log(JSON.stringify(data, null, 2));
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
console.log(data);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
catch (error) {
|
|
200
|
+
if (error.status) {
|
|
201
|
+
console.error('API Error:', error.status, error.message);
|
|
202
|
+
if (error.data) {
|
|
203
|
+
console.error(JSON.stringify(error.data, null, 2));
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
console.error('Error:', error.message);
|
|
208
|
+
}
|
|
209
|
+
process.exit(1);
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
}
|