buckyos 0.7.121 → 0.7.123
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/cli/dist/cli.mjs +1 -1
- package/cli/dist/cli.mjs.map +1 -1
- package/cli/version.ts +1 -1
- package/dist/aicc_client.d.ts +1001 -483
- package/dist/aicc_client.d.ts.map +1 -1
- package/dist/browser.cjs +1 -1
- package/dist/browser.mjs +39 -44
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +39 -44
- package/dist/{ndm_proxy-8f547002.mjs → ndm_proxy-3fce55e8.mjs} +276 -392
- package/dist/ndm_proxy-3fce55e8.mjs.map +1 -0
- package/dist/ndm_proxy-9c7d8565.js +13 -0
- package/dist/ndm_proxy-9c7d8565.js.map +1 -0
- package/dist/node.cjs +1 -1
- package/dist/node.mjs +39 -44
- package/dist/provision.cjs +1 -1
- package/dist/provision.cjs.map +1 -1
- package/dist/provision.d.ts.map +1 -1
- package/dist/provision.mjs +1 -2
- package/dist/provision.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/ndm_proxy-8f547002.mjs.map +0 -1
- package/dist/ndm_proxy-93a8869b.js +0 -13
- package/dist/ndm_proxy-93a8869b.js.map +0 -1
package/dist/aicc_client.d.ts
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { kRPCClient } from './krpc_client';
|
|
2
|
-
export declare const AICC_SERVICE_NAME = "aicc";
|
|
3
2
|
export declare const AICC_SERVICE_UNIQUE_ID = "aicc";
|
|
4
3
|
export declare const AICC_SERVICE_SERVICE_NAME = "aicc";
|
|
5
4
|
export declare const AICC_SERVICE_SERVICE_PORT = 4040;
|
|
6
5
|
export declare const AICC_AI_METHODS: {
|
|
7
|
-
readonly
|
|
8
|
-
readonly
|
|
6
|
+
readonly CHAT_COMPLETIONS_CREATE: "chat.completions.create";
|
|
7
|
+
readonly IMAGES_GENERATE: "images.generate";
|
|
9
8
|
readonly EMBEDDING_TEXT: "embedding.text";
|
|
10
9
|
readonly EMBEDDING_MULTIMODAL: "embedding.multimodal";
|
|
11
10
|
readonly RERANK: "rerank";
|
|
12
|
-
readonly IMAGE_TXT2IMG: "image.txt2img";
|
|
13
11
|
readonly IMAGE_IMG2IMG: "image.img2img";
|
|
14
12
|
readonly IMAGE_INPAINT: "image.inpaint";
|
|
15
13
|
readonly IMAGE_UPSCALE: "image.upscale";
|
|
@@ -29,396 +27,546 @@ export declare const AICC_AI_METHODS: {
|
|
|
29
27
|
readonly VIDEO_UPSCALE: "video.upscale";
|
|
30
28
|
readonly AGENT_COMPUTER_USE: "agent.computer_use";
|
|
31
29
|
};
|
|
32
|
-
export declare const
|
|
30
|
+
export declare const AICC_CORE_METHODS: {
|
|
31
|
+
readonly ROUTE_RESOLVE: "route.resolve";
|
|
32
|
+
readonly HELPER_LLM_CHAT: "helper.llm_chat";
|
|
33
|
+
readonly HELPER_TEXT_TO_IMAGE: "helper.text_to_image";
|
|
33
34
|
readonly CANCEL: "cancel";
|
|
34
|
-
|
|
35
|
+
};
|
|
36
|
+
export declare const AICC_MANAGEMENT_METHODS: {
|
|
35
37
|
readonly SERVICE_RELOAD_SETTINGS: "service.reload_settings";
|
|
36
38
|
readonly QUOTA_QUERY: "quota.query";
|
|
39
|
+
readonly USAGE_QUERY: "usage.query";
|
|
40
|
+
readonly TRACE_QUERY: "trace.query";
|
|
41
|
+
readonly ROUTING_GET: "routing.get";
|
|
42
|
+
readonly ROUTING_UPDATE: "routing.update";
|
|
43
|
+
readonly PROVIDER_CATALOG: "provider.catalog";
|
|
44
|
+
readonly PROTOCOL_ADAPTER_LIST: "protocol_adapter.list";
|
|
45
|
+
readonly PROVIDER_VALIDATE: "provider.validate";
|
|
46
|
+
readonly PROVIDER_ADD: "provider.add";
|
|
37
47
|
readonly PROVIDER_LIST: "provider.list";
|
|
38
48
|
readonly PROVIDER_HEALTH: "provider.health";
|
|
49
|
+
readonly PROVIDER_UPDATE: "provider.update";
|
|
50
|
+
readonly PROVIDER_DELETE: "provider.delete";
|
|
51
|
+
readonly PROVIDER_REFRESH_MODELS: "provider.refresh_models";
|
|
52
|
+
readonly MODELS_LIST: "models.list";
|
|
53
|
+
readonly DRIVER_METADATA_UPDATE_GET: "driver_metadata_update.get";
|
|
54
|
+
readonly DRIVER_METADATA_UPDATE_SET: "driver_metadata_update.set";
|
|
39
55
|
};
|
|
56
|
+
export declare const AICC_METHODS: {
|
|
57
|
+
readonly SERVICE_RELOAD_SETTINGS: "service.reload_settings";
|
|
58
|
+
readonly QUOTA_QUERY: "quota.query";
|
|
59
|
+
readonly USAGE_QUERY: "usage.query";
|
|
60
|
+
readonly TRACE_QUERY: "trace.query";
|
|
61
|
+
readonly ROUTING_GET: "routing.get";
|
|
62
|
+
readonly ROUTING_UPDATE: "routing.update";
|
|
63
|
+
readonly PROVIDER_CATALOG: "provider.catalog";
|
|
64
|
+
readonly PROTOCOL_ADAPTER_LIST: "protocol_adapter.list";
|
|
65
|
+
readonly PROVIDER_VALIDATE: "provider.validate";
|
|
66
|
+
readonly PROVIDER_ADD: "provider.add";
|
|
67
|
+
readonly PROVIDER_LIST: "provider.list";
|
|
68
|
+
readonly PROVIDER_HEALTH: "provider.health";
|
|
69
|
+
readonly PROVIDER_UPDATE: "provider.update";
|
|
70
|
+
readonly PROVIDER_DELETE: "provider.delete";
|
|
71
|
+
readonly PROVIDER_REFRESH_MODELS: "provider.refresh_models";
|
|
72
|
+
readonly MODELS_LIST: "models.list";
|
|
73
|
+
readonly DRIVER_METADATA_UPDATE_GET: "driver_metadata_update.get";
|
|
74
|
+
readonly DRIVER_METADATA_UPDATE_SET: "driver_metadata_update.set";
|
|
75
|
+
readonly ROUTE_RESOLVE: "route.resolve";
|
|
76
|
+
readonly HELPER_LLM_CHAT: "helper.llm_chat";
|
|
77
|
+
readonly HELPER_TEXT_TO_IMAGE: "helper.text_to_image";
|
|
78
|
+
readonly CANCEL: "cancel";
|
|
79
|
+
readonly CHAT_COMPLETIONS_CREATE: "chat.completions.create";
|
|
80
|
+
readonly IMAGES_GENERATE: "images.generate";
|
|
81
|
+
readonly EMBEDDING_TEXT: "embedding.text";
|
|
82
|
+
readonly EMBEDDING_MULTIMODAL: "embedding.multimodal";
|
|
83
|
+
readonly RERANK: "rerank";
|
|
84
|
+
readonly IMAGE_IMG2IMG: "image.img2img";
|
|
85
|
+
readonly IMAGE_INPAINT: "image.inpaint";
|
|
86
|
+
readonly IMAGE_UPSCALE: "image.upscale";
|
|
87
|
+
readonly IMAGE_BG_REMOVE: "image.bg_remove";
|
|
88
|
+
readonly VISION_OCR: "vision.ocr";
|
|
89
|
+
readonly VISION_CAPTION: "vision.caption";
|
|
90
|
+
readonly VISION_DETECT: "vision.detect";
|
|
91
|
+
readonly VISION_SEGMENT: "vision.segment";
|
|
92
|
+
readonly AUDIO_TTS: "audio.tts";
|
|
93
|
+
readonly AUDIO_ASR: "audio.asr";
|
|
94
|
+
readonly AUDIO_MUSIC: "audio.music";
|
|
95
|
+
readonly AUDIO_ENHANCE: "audio.enhance";
|
|
96
|
+
readonly VIDEO_TXT2VIDEO: "video.txt2video";
|
|
97
|
+
readonly VIDEO_IMG2VIDEO: "video.img2video";
|
|
98
|
+
readonly VIDEO_VIDEO2VIDEO: "video.video2video";
|
|
99
|
+
readonly VIDEO_EXTEND: "video.extend";
|
|
100
|
+
readonly VIDEO_UPSCALE: "video.upscale";
|
|
101
|
+
readonly AGENT_COMPUTER_USE: "agent.computer_use";
|
|
102
|
+
};
|
|
103
|
+
export type AiccAiMethod = typeof AICC_AI_METHODS[keyof typeof AICC_AI_METHODS];
|
|
104
|
+
export type AiccMethod = typeof AICC_METHODS[keyof typeof AICC_METHODS];
|
|
105
|
+
export type JsonValue = null | boolean | number | string | JsonValue[] | {
|
|
106
|
+
[key: string]: JsonValue;
|
|
107
|
+
};
|
|
108
|
+
export type ApiType = 'llm' | 'embedding.text' | 'embedding.multimodal' | 'rerank' | 'image.txt2img' | 'image.img2img' | 'image.inpaint' | 'image.upscale' | 'image.bg_remove' | 'vision.ocr' | 'vision.caption' | 'vision.detect' | 'vision.segment' | 'audio.tts' | 'audio.asr' | 'audio.music' | 'audio.enhance' | 'video.txt2video' | 'video.img2video' | 'video.video2video' | 'video.extend' | 'video.upscale' | 'agent.computer_use';
|
|
109
|
+
export type Capability = 'llm' | 'embedding' | 'rerank' | 'image' | 'vision' | 'audio' | 'video' | 'agent';
|
|
110
|
+
export type Feature = string;
|
|
40
111
|
export declare const AICC_FEATURES: {
|
|
41
112
|
readonly PLAN: "plan";
|
|
42
|
-
readonly
|
|
43
|
-
readonly
|
|
113
|
+
readonly TOOL_CALL: "tool_call";
|
|
114
|
+
readonly JSON_SCHEMA: "json_schema";
|
|
44
115
|
readonly WEB_SEARCH: "web_search";
|
|
45
116
|
readonly VISION: "vision";
|
|
117
|
+
readonly IMAGE_GENERATION: "image_generation";
|
|
46
118
|
readonly ASR: "asr";
|
|
47
119
|
readonly VIDEO_UNDERSTAND: "video_understand";
|
|
48
120
|
};
|
|
49
|
-
export
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
export type
|
|
54
|
-
export type
|
|
55
|
-
export type AiccMethodStatus = 'succeeded' | 'running' | 'failed';
|
|
56
|
-
export interface AiccResourceUrl {
|
|
121
|
+
export declare const AICC_EXECUTION_MODES: {
|
|
122
|
+
readonly IMMEDIATE: "immediate";
|
|
123
|
+
readonly STREAM: "stream";
|
|
124
|
+
};
|
|
125
|
+
export type AiccExecutionMode = typeof AICC_EXECUTION_MODES[keyof typeof AICC_EXECUTION_MODES];
|
|
126
|
+
export type ResourceRef = {
|
|
57
127
|
kind: 'url';
|
|
58
128
|
url: string;
|
|
59
|
-
mime_hint?: string
|
|
60
|
-
}
|
|
61
|
-
export interface AiccResourceBase64 {
|
|
129
|
+
mime_hint?: string;
|
|
130
|
+
} | {
|
|
62
131
|
kind: 'base64';
|
|
63
132
|
mime: string;
|
|
64
133
|
data_base64: string;
|
|
65
|
-
}
|
|
66
|
-
export interface AiccResourceNamedObject {
|
|
134
|
+
} | {
|
|
67
135
|
kind: 'named_object';
|
|
68
136
|
obj_id: string;
|
|
69
|
-
}
|
|
70
|
-
export type AiccResourceRef = AiccResourceUrl | AiccResourceBase64 | AiccResourceNamedObject;
|
|
71
|
-
export type AiccAiRole = 'system' | 'user' | 'assistant' | 'tool' | 'developer';
|
|
72
|
-
export type AiccToolResultContent = {
|
|
73
|
-
type: 'text';
|
|
74
|
-
text: string;
|
|
75
|
-
} | {
|
|
76
|
-
type: 'image';
|
|
77
|
-
source: AiccResourceRef;
|
|
78
|
-
} | {
|
|
79
|
-
type: 'document';
|
|
80
|
-
source: AiccResourceRef;
|
|
81
|
-
title?: string | null;
|
|
82
137
|
};
|
|
83
|
-
export type
|
|
138
|
+
export type AiRole = 'system' | 'user' | 'assistant' | 'tool' | 'developer';
|
|
139
|
+
export type AiToolResultContent = {
|
|
84
140
|
type: 'text';
|
|
85
141
|
text: string;
|
|
86
142
|
} | {
|
|
87
143
|
type: 'image';
|
|
88
|
-
source:
|
|
144
|
+
source: ResourceRef;
|
|
89
145
|
} | {
|
|
90
146
|
type: 'document';
|
|
91
|
-
source:
|
|
92
|
-
title?: string
|
|
93
|
-
}
|
|
147
|
+
source: ResourceRef;
|
|
148
|
+
title?: string;
|
|
149
|
+
};
|
|
150
|
+
export type AiContent = AiToolResultContent | {
|
|
94
151
|
type: 'tool_use';
|
|
95
152
|
call_id: string;
|
|
96
153
|
name: string;
|
|
97
|
-
args: Record<string,
|
|
154
|
+
args: Record<string, JsonValue>;
|
|
98
155
|
} | {
|
|
99
156
|
type: 'tool_result';
|
|
100
157
|
call_id: string;
|
|
101
|
-
content:
|
|
158
|
+
content: AiToolResultContent[];
|
|
102
159
|
is_error?: boolean;
|
|
103
160
|
} | {
|
|
104
161
|
type: 'thinking';
|
|
105
|
-
summary?: string
|
|
106
|
-
text?: string
|
|
107
|
-
provider_metadata?:
|
|
162
|
+
summary?: string;
|
|
163
|
+
text?: string;
|
|
164
|
+
provider_metadata?: JsonValue;
|
|
108
165
|
} | {
|
|
109
166
|
type: 'provider_state';
|
|
110
167
|
provider: string;
|
|
111
|
-
value:
|
|
168
|
+
value: JsonValue;
|
|
112
169
|
};
|
|
113
|
-
export interface
|
|
114
|
-
role:
|
|
115
|
-
content:
|
|
170
|
+
export interface AiMessage {
|
|
171
|
+
role: AiRole;
|
|
172
|
+
content: AiContent[];
|
|
116
173
|
}
|
|
117
|
-
export interface
|
|
174
|
+
export interface AiToolSpec {
|
|
175
|
+
type?: string;
|
|
118
176
|
name: string;
|
|
119
177
|
description: string;
|
|
120
|
-
|
|
121
|
-
output_schema
|
|
178
|
+
args_json_schema: JsonValue;
|
|
179
|
+
output_schema?: JsonValue;
|
|
122
180
|
}
|
|
123
|
-
export interface
|
|
124
|
-
|
|
125
|
-
|
|
181
|
+
export interface LlmJsonSchema {
|
|
182
|
+
name?: string;
|
|
183
|
+
schema: JsonValue;
|
|
184
|
+
strict?: boolean;
|
|
126
185
|
}
|
|
127
|
-
export interface
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
max_cost_usd?: number;
|
|
131
|
-
resp_format?: AiccRespFormat;
|
|
132
|
-
extra?: unknown;
|
|
133
|
-
}
|
|
134
|
-
export interface AiccPayload {
|
|
135
|
-
input_json?: unknown;
|
|
136
|
-
resources?: AiccResourceRef[];
|
|
137
|
-
options?: unknown;
|
|
138
|
-
}
|
|
139
|
-
export interface AiccRoutePolicy {
|
|
140
|
-
profile?: AiccRoutePolicyProfile;
|
|
141
|
-
allow_fallback?: boolean;
|
|
142
|
-
runtime_failover?: boolean;
|
|
143
|
-
explain?: boolean;
|
|
144
|
-
}
|
|
145
|
-
export interface AiccTaskOptions {
|
|
146
|
-
parent_id?: number | null;
|
|
147
|
-
}
|
|
148
|
-
export interface AiccMethodRequest {
|
|
149
|
-
capability: AiccCapability;
|
|
150
|
-
model: AiccModelSpec;
|
|
151
|
-
requirements: AiccRequirements;
|
|
152
|
-
payload: AiccPayload;
|
|
153
|
-
policy?: AiccRoutePolicy | null;
|
|
154
|
-
idempotency_key?: string | null;
|
|
155
|
-
task_options?: AiccTaskOptions | null;
|
|
186
|
+
export interface LlmResponseFormat {
|
|
187
|
+
type: 'text' | 'json' | 'json_object' | 'json_schema';
|
|
188
|
+
json_schema?: LlmJsonSchema;
|
|
156
189
|
}
|
|
157
|
-
export interface
|
|
158
|
-
input_tokens?: number
|
|
159
|
-
output_tokens?: number
|
|
160
|
-
total_tokens?: number
|
|
190
|
+
export interface AiUsage {
|
|
191
|
+
input_tokens?: number;
|
|
192
|
+
output_tokens?: number;
|
|
193
|
+
total_tokens?: number;
|
|
194
|
+
request_units?: number;
|
|
161
195
|
}
|
|
162
|
-
export interface
|
|
196
|
+
export interface Money {
|
|
163
197
|
amount: number;
|
|
164
198
|
currency: string;
|
|
165
199
|
}
|
|
166
|
-
export
|
|
200
|
+
export type AiCost = Money;
|
|
201
|
+
export interface AiArtifact {
|
|
167
202
|
name: string;
|
|
168
|
-
resource:
|
|
169
|
-
mime?: string
|
|
170
|
-
metadata?:
|
|
203
|
+
resource: ResourceRef;
|
|
204
|
+
mime?: string;
|
|
205
|
+
metadata?: JsonValue;
|
|
206
|
+
}
|
|
207
|
+
export type AiccErrorCode = 'invalid_request' | 'invalid_method' | 'schema_validation_failed' | 'invalid_model_name' | 'resource_invalid' | 'no_provider_available' | 'no_candidate_model' | 'fallback_not_allowed' | 'provider_start_failed' | 'provider_error' | 'unsupported_execution_mode' | 'timeout' | 'budget_exceeded' | 'policy_denied' | 'idempotency_conflict' | 'settings_revision_conflict' | 'cancelled' | 'internal_error';
|
|
208
|
+
export interface AiccError {
|
|
209
|
+
code: AiccErrorCode;
|
|
210
|
+
message: string;
|
|
211
|
+
provider_code?: string;
|
|
212
|
+
retriable?: boolean;
|
|
213
|
+
details?: JsonValue;
|
|
214
|
+
}
|
|
215
|
+
export interface SettingsRevisionConflictDetails {
|
|
216
|
+
expected_revision: number;
|
|
217
|
+
actual_revision: number;
|
|
218
|
+
}
|
|
219
|
+
export interface RouteTraceAttempt {
|
|
220
|
+
step: number;
|
|
221
|
+
exact_model: string;
|
|
222
|
+
started_at: string;
|
|
223
|
+
ended_at?: string;
|
|
224
|
+
outcome: 'succeeded' | 'failed' | 'skipped';
|
|
225
|
+
error_code?: AiccErrorCode;
|
|
226
|
+
fallback_reason?: string;
|
|
171
227
|
}
|
|
172
|
-
export interface
|
|
228
|
+
export interface RouteTrace {
|
|
229
|
+
attempts: RouteTraceAttempt[];
|
|
230
|
+
final_model?: string;
|
|
231
|
+
}
|
|
232
|
+
export interface AiToolCall {
|
|
173
233
|
name: string;
|
|
174
|
-
args: Record<string,
|
|
234
|
+
args: Record<string, JsonValue>;
|
|
175
235
|
call_id: string;
|
|
176
236
|
}
|
|
177
|
-
export
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
cost?: AiccCost;
|
|
181
|
-
finish_reason?: string;
|
|
182
|
-
provider_task_ref?: string | null;
|
|
183
|
-
extra?: unknown;
|
|
237
|
+
export type AiMethodStatus = 'succeeded' | 'running' | 'failed';
|
|
238
|
+
export interface AiTaskOptions {
|
|
239
|
+
parent_id?: string;
|
|
184
240
|
}
|
|
185
|
-
export interface
|
|
186
|
-
task_id: string;
|
|
187
|
-
status: AiccMethodStatus;
|
|
188
|
-
result?: AiccResponse | null;
|
|
189
|
-
event_ref?: string | null;
|
|
190
|
-
}
|
|
191
|
-
export interface AiccCancelResponse {
|
|
192
|
-
task_id: string;
|
|
193
|
-
accepted: boolean;
|
|
194
|
-
}
|
|
195
|
-
export interface AiccQuotaQueryRequest {
|
|
196
|
-
capability?: AiccCapability;
|
|
197
|
-
method?: AiccAiMethod | string;
|
|
198
|
-
}
|
|
199
|
-
export interface AiccQuotaQueryResponse {
|
|
200
|
-
quota: {
|
|
201
|
-
state: string;
|
|
202
|
-
remaining_request_units?: number;
|
|
203
|
-
remaining_cost_usd?: number;
|
|
204
|
-
reset_at?: string;
|
|
205
|
-
[key: string]: unknown;
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
export interface AiccProviderListRequest {
|
|
209
|
-
method?: AiccAiMethod | string;
|
|
210
|
-
}
|
|
211
|
-
export interface AiccProviderHealthRequest {
|
|
212
|
-
exact_model?: string;
|
|
213
|
-
provider?: string;
|
|
214
|
-
}
|
|
215
|
-
export type AiccModelInput = string | AiccModelSpec;
|
|
216
|
-
export interface AiccTypedMethodCall<TInput> {
|
|
217
|
-
model: AiccModelInput;
|
|
218
|
-
input: TInput;
|
|
219
|
-
requirements?: AiccRequirements;
|
|
220
|
-
resources?: AiccResourceRef[];
|
|
221
|
-
options?: unknown;
|
|
222
|
-
policy?: AiccRoutePolicy | null;
|
|
223
|
-
idempotency_key?: string | null;
|
|
224
|
-
task_options?: AiccTaskOptions | null;
|
|
225
|
-
}
|
|
226
|
-
export type AiccTypedResponse<TExtra = unknown> = Omit<AiccResponse, 'extra'> & {
|
|
227
|
-
extra?: TExtra;
|
|
228
|
-
};
|
|
229
|
-
export type AiccTypedMethodResponse<TExtra = unknown> = Omit<AiccMethodResponse, 'result'> & {
|
|
230
|
-
result?: AiccTypedResponse<TExtra> | null;
|
|
231
|
-
};
|
|
232
|
-
export interface AiccGenerationOutputOptions {
|
|
241
|
+
export interface AiOutputOptions {
|
|
233
242
|
media_type?: string;
|
|
234
243
|
size?: string;
|
|
235
244
|
sample_rate?: number;
|
|
236
245
|
fps?: number;
|
|
237
246
|
}
|
|
238
|
-
export interface
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
export interface AiccJsonSchemaResponseFormat {
|
|
247
|
-
type: 'json_schema';
|
|
248
|
-
json_schema: {
|
|
249
|
-
name: string;
|
|
250
|
-
schema: Record<string, unknown>;
|
|
251
|
-
strict?: boolean;
|
|
252
|
-
};
|
|
247
|
+
export interface ModelRequirement {
|
|
248
|
+
streaming?: boolean;
|
|
249
|
+
tool_call?: boolean;
|
|
250
|
+
json_schema?: boolean;
|
|
251
|
+
web_search?: boolean;
|
|
252
|
+
vision?: boolean;
|
|
253
|
+
image_generation?: boolean;
|
|
254
|
+
min_context_tokens?: number;
|
|
253
255
|
}
|
|
254
|
-
export
|
|
255
|
-
type: 'text';
|
|
256
|
-
} | {
|
|
257
|
-
type: 'json_object';
|
|
258
|
-
} | AiccJsonSchemaResponseFormat;
|
|
259
|
-
export interface AiccLlmTool {
|
|
260
|
-
type: 'function';
|
|
261
|
-
name: string;
|
|
262
|
-
description?: string;
|
|
263
|
-
args_json_schema: Record<string, unknown>;
|
|
256
|
+
export interface ModelDisable extends ModelRequirement {
|
|
264
257
|
}
|
|
265
|
-
export interface
|
|
266
|
-
messages: AiccMessage[];
|
|
267
|
-
tools?: AiccLlmTool[];
|
|
268
|
-
response_format?: AiccLlmResponseFormat;
|
|
258
|
+
export interface HelperModelRequirement extends ModelRequirement {
|
|
269
259
|
}
|
|
270
|
-
export interface
|
|
271
|
-
|
|
272
|
-
|
|
260
|
+
export interface RoutePolicy {
|
|
261
|
+
profile?: 'cheap' | 'fast' | 'balanced' | 'quality';
|
|
262
|
+
local_only?: boolean;
|
|
263
|
+
allow_fallback?: boolean;
|
|
264
|
+
runtime_failover?: boolean;
|
|
265
|
+
explain?: boolean;
|
|
266
|
+
allowed_provider_instances?: string[];
|
|
267
|
+
blocked_provider_instances?: string[];
|
|
268
|
+
max_cost?: Money;
|
|
269
|
+
max_latency_ms?: number;
|
|
273
270
|
}
|
|
274
|
-
export interface
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
started_at?: string;
|
|
278
|
-
ended_at?: string | null;
|
|
279
|
-
outcome: 'succeeded' | 'failed' | 'skipped';
|
|
280
|
-
error_code?: string | null;
|
|
281
|
-
fallback_reason?: string | null;
|
|
271
|
+
export interface ModelItem {
|
|
272
|
+
target: string;
|
|
273
|
+
weight?: number;
|
|
282
274
|
}
|
|
283
|
-
export interface
|
|
284
|
-
|
|
285
|
-
|
|
275
|
+
export interface ModelItemPatch {
|
|
276
|
+
target?: string;
|
|
277
|
+
weight?: number;
|
|
278
|
+
}
|
|
279
|
+
export type OverlayMergeMode = 'inherit' | 'replace';
|
|
280
|
+
export type AiccFallbackMode = 'strict' | 'parent' | 'target_exact' | 'target_logical' | 'disabled';
|
|
281
|
+
export interface AiccFallbackRule {
|
|
282
|
+
mode: AiccFallbackMode;
|
|
283
|
+
target?: string;
|
|
284
|
+
}
|
|
285
|
+
export type AiccSchedulerProfile = 'cost_first' | 'latency_first' | 'quality_first' | 'balanced' | 'local_first' | 'strict_local';
|
|
286
|
+
export type LockedValue<T> = T | {
|
|
287
|
+
value: T;
|
|
288
|
+
locked?: boolean;
|
|
289
|
+
};
|
|
290
|
+
export interface AiccSchedulerProfileWeights {
|
|
291
|
+
cost?: number;
|
|
292
|
+
latency?: number;
|
|
293
|
+
reliability?: number;
|
|
294
|
+
quality?: number;
|
|
295
|
+
preference?: number;
|
|
296
|
+
cache?: number;
|
|
297
|
+
local?: number;
|
|
298
|
+
}
|
|
299
|
+
export interface AiccSchedulerProfileConfig {
|
|
300
|
+
cost_first?: AiccSchedulerProfileWeights;
|
|
301
|
+
latency_first?: AiccSchedulerProfileWeights;
|
|
302
|
+
quality_first?: AiccSchedulerProfileWeights;
|
|
303
|
+
balanced?: AiccSchedulerProfileWeights;
|
|
304
|
+
local_first?: AiccSchedulerProfileWeights;
|
|
305
|
+
strict_local?: AiccSchedulerProfileWeights;
|
|
306
|
+
}
|
|
307
|
+
export interface AiccPolicyConfig {
|
|
308
|
+
profile?: LockedValue<AiccSchedulerProfile>;
|
|
309
|
+
scheduler_profiles?: LockedValue<AiccSchedulerProfileConfig>;
|
|
310
|
+
local_only?: LockedValue<boolean>;
|
|
311
|
+
allow_fallback?: LockedValue<boolean>;
|
|
312
|
+
allow_exact_model_fallback?: LockedValue<boolean>;
|
|
313
|
+
runtime_failover?: LockedValue<boolean>;
|
|
314
|
+
explain?: LockedValue<boolean>;
|
|
315
|
+
blocked_provider_instances?: LockedValue<string[]>;
|
|
316
|
+
allowed_provider_instances?: LockedValue<string[]>;
|
|
317
|
+
max_estimated_cost?: LockedValue<Money>;
|
|
318
|
+
}
|
|
319
|
+
export interface AiccLogicalNodeOverlay {
|
|
320
|
+
children?: Record<string, AiccLogicalNodeOverlay>;
|
|
321
|
+
source?: string;
|
|
322
|
+
items?: Record<string, ModelItem>;
|
|
323
|
+
item_overrides?: Record<string, ModelItemPatch>;
|
|
324
|
+
exact_model_weights?: Record<string, number>;
|
|
325
|
+
disable_line?: ModelDisable;
|
|
326
|
+
fallback?: AiccFallbackRule;
|
|
327
|
+
policy?: AiccPolicyConfig;
|
|
328
|
+
route_policy_override?: AiccPolicyConfig;
|
|
329
|
+
}
|
|
330
|
+
export interface AiccLogicalTreeOverlay {
|
|
331
|
+
path: string;
|
|
332
|
+
merge_mode?: OverlayMergeMode;
|
|
333
|
+
items?: Record<string, ModelItem>;
|
|
334
|
+
item_overrides?: Record<string, ModelItemPatch>;
|
|
335
|
+
exact_model_weights?: Record<string, number>;
|
|
336
|
+
disable_line?: ModelDisable;
|
|
337
|
+
fallback?: AiccFallbackRule;
|
|
338
|
+
route_policy_override?: AiccPolicyConfig;
|
|
339
|
+
source?: string;
|
|
340
|
+
}
|
|
341
|
+
export interface AiccSessionLogicalProfile {
|
|
342
|
+
name?: string;
|
|
343
|
+
overlays?: AiccLogicalTreeOverlay[];
|
|
344
|
+
route_policy_override?: AiccPolicyConfig;
|
|
345
|
+
}
|
|
346
|
+
export interface AiccRouteOverlay {
|
|
347
|
+
inherit?: string;
|
|
348
|
+
logical_tree?: Record<string, AiccLogicalNodeOverlay>;
|
|
349
|
+
logical_profile?: AiccSessionLogicalProfile;
|
|
350
|
+
logical_profiles?: Record<string, AiccSessionLogicalProfile>;
|
|
351
|
+
active_logical_profile?: string;
|
|
352
|
+
global_exact_model_weights?: Record<string, number>;
|
|
353
|
+
provider_weights?: Record<string, number>;
|
|
354
|
+
policy?: AiccPolicyConfig;
|
|
355
|
+
revision?: string;
|
|
356
|
+
ttl_seconds?: number;
|
|
357
|
+
}
|
|
358
|
+
export interface RouteResolveRequest {
|
|
359
|
+
trace_id?: string;
|
|
360
|
+
execution_mode?: AiccExecutionMode;
|
|
361
|
+
request_id?: string;
|
|
362
|
+
api_type: ApiType;
|
|
363
|
+
logical_model: string;
|
|
364
|
+
requirements?: ModelRequirement;
|
|
365
|
+
disable?: ModelDisable;
|
|
366
|
+
policy?: RoutePolicy;
|
|
367
|
+
estimated_input_tokens?: number;
|
|
368
|
+
estimated_output_tokens?: number;
|
|
369
|
+
session_overlay?: AiccRouteOverlay;
|
|
370
|
+
session_id?: string;
|
|
371
|
+
}
|
|
372
|
+
export interface RouteResolveResponse {
|
|
373
|
+
selected_exact_model: string;
|
|
374
|
+
selected_model_uid: string;
|
|
375
|
+
provider_instance_name: string;
|
|
376
|
+
provider_profile_id: string;
|
|
377
|
+
protocol_adapter_id: string;
|
|
378
|
+
model_driver_id: string;
|
|
379
|
+
provider_driver?: string;
|
|
380
|
+
origin_model_id: string;
|
|
381
|
+
provider_model_id: string;
|
|
382
|
+
operation: string;
|
|
383
|
+
enabled_capabilities?: Feature[];
|
|
384
|
+
disabled_capabilities?: Feature[];
|
|
385
|
+
fallback_attempts?: Array<{
|
|
386
|
+
exact_model: string;
|
|
387
|
+
provider_instance_name: string;
|
|
388
|
+
provider_model_id: string;
|
|
389
|
+
}>;
|
|
390
|
+
route_trace?: RouteTrace;
|
|
391
|
+
inventory_revision: string;
|
|
392
|
+
}
|
|
393
|
+
export interface InferenceRequest {
|
|
394
|
+
exact_model: string;
|
|
395
|
+
trace_id?: string;
|
|
396
|
+
execution_mode?: AiccExecutionMode;
|
|
397
|
+
idempotency_key?: string;
|
|
398
|
+
task_options?: AiTaskOptions;
|
|
399
|
+
session_id?: string;
|
|
286
400
|
}
|
|
287
|
-
export interface
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
401
|
+
export interface InferenceResponse {
|
|
402
|
+
task_id: string;
|
|
403
|
+
status: AiMethodStatus;
|
|
404
|
+
usage?: AiUsage;
|
|
405
|
+
cost?: AiCost;
|
|
406
|
+
finish_reason?: string;
|
|
407
|
+
provider_task_ref?: string;
|
|
408
|
+
route_trace?: RouteTrace;
|
|
409
|
+
event_ref?: string;
|
|
410
|
+
error?: AiccError;
|
|
411
|
+
}
|
|
412
|
+
interface ChatFields {
|
|
413
|
+
messages: AiMessage[];
|
|
414
|
+
tools?: AiToolSpec[];
|
|
415
|
+
response_format?: LlmResponseFormat;
|
|
416
|
+
temperature?: number;
|
|
417
|
+
top_p?: number;
|
|
418
|
+
max_output_tokens?: number;
|
|
419
|
+
seed?: number;
|
|
420
|
+
stop?: string[];
|
|
421
|
+
output?: AiOutputOptions;
|
|
291
422
|
}
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
423
|
+
interface ImageGenerationFields {
|
|
424
|
+
prompt: string;
|
|
425
|
+
negative_prompt?: string;
|
|
426
|
+
n?: number;
|
|
427
|
+
aspect_ratio?: string;
|
|
428
|
+
size?: string;
|
|
429
|
+
quality?: string;
|
|
430
|
+
style?: string;
|
|
431
|
+
seed?: number;
|
|
432
|
+
output?: AiOutputOptions;
|
|
433
|
+
}
|
|
434
|
+
export interface LlmChatInvokeRequest extends InferenceRequest, ChatFields {
|
|
435
|
+
}
|
|
436
|
+
export interface LlmChatHelperRequest extends ChatFields {
|
|
437
|
+
logical_model: string;
|
|
438
|
+
requirements?: HelperModelRequirement;
|
|
439
|
+
disable?: ModelDisable;
|
|
440
|
+
trace_id?: string;
|
|
441
|
+
execution_mode?: AiccExecutionMode;
|
|
442
|
+
policy?: RoutePolicy;
|
|
443
|
+
idempotency_key?: string;
|
|
444
|
+
task_options?: AiTaskOptions;
|
|
445
|
+
session_overlay?: AiccRouteOverlay;
|
|
446
|
+
session_id?: string;
|
|
447
|
+
}
|
|
448
|
+
export interface LlmChatInvokeResponse extends InferenceResponse {
|
|
449
|
+
message?: AiMessage;
|
|
450
|
+
tool_calls?: AiToolCall[];
|
|
451
|
+
}
|
|
452
|
+
export interface TextToImageInvokeRequest extends InferenceRequest, ImageGenerationFields {
|
|
453
|
+
}
|
|
454
|
+
export interface TextToImageHelperRequest extends ImageGenerationFields {
|
|
455
|
+
logical_model: string;
|
|
456
|
+
requirements?: HelperModelRequirement;
|
|
457
|
+
trace_id?: string;
|
|
458
|
+
execution_mode?: AiccExecutionMode;
|
|
459
|
+
disable?: ModelDisable;
|
|
460
|
+
policy?: RoutePolicy;
|
|
461
|
+
idempotency_key?: string;
|
|
462
|
+
task_options?: AiTaskOptions;
|
|
463
|
+
session_overlay?: AiccRouteOverlay;
|
|
464
|
+
session_id?: string;
|
|
465
|
+
}
|
|
466
|
+
export interface TextToImageInvokeResponse extends InferenceResponse {
|
|
467
|
+
images?: ResourceRef[];
|
|
468
|
+
provider_states?: AiContent[];
|
|
469
|
+
}
|
|
470
|
+
export type EmbeddingTextItem = {
|
|
295
471
|
type: 'text';
|
|
296
472
|
text: string;
|
|
297
473
|
id?: string;
|
|
298
474
|
} | {
|
|
299
475
|
type: 'resource';
|
|
300
|
-
resource:
|
|
476
|
+
resource: ResourceRef;
|
|
301
477
|
id?: string;
|
|
302
478
|
};
|
|
303
|
-
export interface
|
|
304
|
-
|
|
479
|
+
export interface EmbeddingMultimodalItem {
|
|
480
|
+
id: string;
|
|
481
|
+
text?: string;
|
|
482
|
+
image?: ResourceRef;
|
|
483
|
+
}
|
|
484
|
+
export interface EmbeddingChunking {
|
|
485
|
+
strategy?: string;
|
|
305
486
|
max_tokens?: number;
|
|
306
487
|
overlap_tokens?: number;
|
|
307
488
|
}
|
|
308
|
-
export interface
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
489
|
+
export interface EmbeddingValue {
|
|
490
|
+
index: number;
|
|
491
|
+
id?: string;
|
|
492
|
+
embedding: number[];
|
|
493
|
+
embedding_space_id: string;
|
|
494
|
+
}
|
|
495
|
+
export interface EmbeddingTextRequest extends InferenceRequest {
|
|
496
|
+
items: EmbeddingTextItem[];
|
|
497
|
+
chunking?: EmbeddingChunking;
|
|
498
|
+
embedding_space_id?: string;
|
|
312
499
|
dimensions?: number;
|
|
313
500
|
normalize?: boolean;
|
|
314
|
-
prefer_artifact?:
|
|
501
|
+
prefer_artifact?: JsonValue;
|
|
315
502
|
}
|
|
316
|
-
export interface
|
|
317
|
-
|
|
318
|
-
text?: string;
|
|
319
|
-
image?: AiccResourceRef;
|
|
320
|
-
audio?: AiccResourceRef;
|
|
321
|
-
video?: AiccResourceRef;
|
|
322
|
-
}
|
|
323
|
-
export interface AiccEmbeddingMultimodalInput {
|
|
324
|
-
items: AiccEmbeddingMultimodalItem[];
|
|
503
|
+
export interface EmbeddingMultimodalRequest extends InferenceRequest {
|
|
504
|
+
items: EmbeddingMultimodalItem[];
|
|
325
505
|
dimensions?: number;
|
|
326
506
|
normalize?: boolean;
|
|
327
|
-
embedding_space_id?: string | null;
|
|
328
|
-
prefer_artifact?: boolean | 'auto';
|
|
329
507
|
}
|
|
330
|
-
export interface
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
embedding: number[];
|
|
334
|
-
embedding_space_id?: string;
|
|
508
|
+
export interface EmbeddingTextResponse extends InferenceResponse {
|
|
509
|
+
data?: EmbeddingValue[];
|
|
510
|
+
data_resource?: ResourceRef;
|
|
335
511
|
}
|
|
336
|
-
export
|
|
337
|
-
|
|
338
|
-
|
|
512
|
+
export type EmbeddingMultimodalResponse = EmbeddingTextResponse;
|
|
513
|
+
export interface RerankDocument {
|
|
514
|
+
id: string;
|
|
515
|
+
text?: string;
|
|
516
|
+
resource?: ResourceRef;
|
|
517
|
+
metadata?: JsonValue;
|
|
339
518
|
}
|
|
340
|
-
export interface
|
|
341
|
-
|
|
342
|
-
|
|
519
|
+
export interface RerankResult {
|
|
520
|
+
index: number;
|
|
521
|
+
id: string;
|
|
522
|
+
score: number;
|
|
523
|
+
document?: RerankDocument;
|
|
343
524
|
}
|
|
344
|
-
export
|
|
345
|
-
export type AiccEmbeddingMultimodalResponse = AiccTypedMethodResponse<AiccEmbeddingExtra>;
|
|
346
|
-
export type AiccRerankDocument = {
|
|
347
|
-
id?: string;
|
|
348
|
-
text: string;
|
|
349
|
-
metadata?: Record<string, unknown>;
|
|
350
|
-
} | {
|
|
351
|
-
id?: string;
|
|
352
|
-
resource: AiccResourceRef;
|
|
353
|
-
metadata?: Record<string, unknown>;
|
|
354
|
-
};
|
|
355
|
-
export interface AiccRerankInput {
|
|
525
|
+
export interface RerankRequest extends InferenceRequest {
|
|
356
526
|
query: string;
|
|
357
|
-
documents:
|
|
527
|
+
documents: RerankDocument[];
|
|
358
528
|
n?: number;
|
|
359
529
|
return_documents?: boolean;
|
|
360
530
|
}
|
|
361
|
-
export interface
|
|
362
|
-
|
|
363
|
-
id?: string;
|
|
364
|
-
score: number;
|
|
365
|
-
document?: AiccRerankDocument;
|
|
366
|
-
}
|
|
367
|
-
export interface AiccRerankResult {
|
|
368
|
-
results: AiccRerankResultItem[];
|
|
369
|
-
}
|
|
370
|
-
export interface AiccRerankExtra {
|
|
371
|
-
rerank?: AiccRerankResult;
|
|
372
|
-
[key: string]: unknown;
|
|
373
|
-
}
|
|
374
|
-
export type AiccRerankResponse = AiccTypedMethodResponse<AiccRerankExtra>;
|
|
375
|
-
export interface AiccImageOutputOptions {
|
|
376
|
-
media_type?: string;
|
|
377
|
-
size?: string;
|
|
531
|
+
export interface RerankResponse extends InferenceResponse {
|
|
532
|
+
results?: RerankResult[];
|
|
378
533
|
}
|
|
379
|
-
export interface
|
|
534
|
+
export interface ImageToImageRequest extends InferenceRequest {
|
|
535
|
+
images: ResourceRef[];
|
|
380
536
|
prompt: string;
|
|
381
|
-
negative_prompt?: string;
|
|
382
|
-
n?: number;
|
|
383
|
-
aspect_ratio?: string;
|
|
384
|
-
quality?: 'low' | 'medium' | 'high' | string;
|
|
385
|
-
seed?: number;
|
|
386
|
-
output?: AiccImageOutputOptions;
|
|
387
|
-
}
|
|
388
|
-
export interface AiccImageImg2imgInput {
|
|
389
|
-
images: AiccResourceRef[];
|
|
390
|
-
prompt?: string;
|
|
391
537
|
strength?: number;
|
|
392
|
-
output?:
|
|
538
|
+
output?: AiOutputOptions;
|
|
393
539
|
}
|
|
394
|
-
export
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
mask: AiccResourceRef;
|
|
540
|
+
export interface ImageInpaintRequest extends InferenceRequest {
|
|
541
|
+
image: ResourceRef;
|
|
542
|
+
mask: ResourceRef;
|
|
398
543
|
prompt: string;
|
|
399
|
-
mask_semantics?:
|
|
400
|
-
output?:
|
|
544
|
+
mask_semantics?: 'white_area_is_edit_area' | 'black_area_is_edit_area' | 'alpha_zero_is_edit_area';
|
|
545
|
+
output?: AiOutputOptions;
|
|
401
546
|
}
|
|
402
|
-
export interface
|
|
403
|
-
image:
|
|
547
|
+
export interface ImageUpscaleRequest extends InferenceRequest {
|
|
548
|
+
image: ResourceRef;
|
|
404
549
|
scale?: number;
|
|
405
550
|
target_width?: number;
|
|
406
551
|
target_height?: number;
|
|
407
552
|
preserve_faces?: boolean;
|
|
408
|
-
output?:
|
|
553
|
+
output?: AiOutputOptions;
|
|
554
|
+
}
|
|
555
|
+
export interface ImageBackgroundRemoveRequest extends InferenceRequest {
|
|
556
|
+
image: ResourceRef;
|
|
557
|
+
mode?: string;
|
|
558
|
+
output?: AiOutputOptions;
|
|
409
559
|
}
|
|
410
|
-
export interface
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
output?: AiccImageOutputOptions;
|
|
560
|
+
export interface ImageToImageResponse extends InferenceResponse {
|
|
561
|
+
images?: ResourceRef[];
|
|
562
|
+
provider_states?: AiContent[];
|
|
414
563
|
}
|
|
415
|
-
export
|
|
416
|
-
|
|
417
|
-
image?:
|
|
418
|
-
[key: string]: unknown;
|
|
564
|
+
export type ImageInpaintResponse = ImageToImageResponse;
|
|
565
|
+
export interface ImageUpscaleResponse extends InferenceResponse {
|
|
566
|
+
image?: ResourceRef;
|
|
419
567
|
}
|
|
420
|
-
export type
|
|
421
|
-
export interface
|
|
568
|
+
export type ImageBackgroundRemoveResponse = ImageUpscaleResponse;
|
|
569
|
+
export interface BoundingBox {
|
|
422
570
|
format: 'xywh';
|
|
423
571
|
unit: 'px' | 'relative';
|
|
424
572
|
x: number;
|
|
@@ -426,43 +574,67 @@ export interface AiccBoundingBox {
|
|
|
426
574
|
width: number;
|
|
427
575
|
height: number;
|
|
428
576
|
}
|
|
429
|
-
export interface
|
|
430
|
-
|
|
431
|
-
|
|
577
|
+
export interface OcrLine {
|
|
578
|
+
text: string;
|
|
579
|
+
confidence?: number;
|
|
432
580
|
}
|
|
433
|
-
export
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
}
|
|
444
|
-
export interface
|
|
445
|
-
document:
|
|
446
|
-
level?:
|
|
581
|
+
export interface OcrBlock {
|
|
582
|
+
type: string;
|
|
583
|
+
bbox: BoundingBox;
|
|
584
|
+
lines?: OcrLine[];
|
|
585
|
+
}
|
|
586
|
+
export interface OcrPage {
|
|
587
|
+
page_index: number;
|
|
588
|
+
width: number;
|
|
589
|
+
height: number;
|
|
590
|
+
blocks?: OcrBlock[];
|
|
591
|
+
}
|
|
592
|
+
export interface VisionOcrRequest extends InferenceRequest {
|
|
593
|
+
document: ResourceRef;
|
|
594
|
+
level?: string;
|
|
447
595
|
language_hints?: string[];
|
|
448
596
|
return_layout?: boolean;
|
|
449
597
|
return_artifacts?: string[];
|
|
450
598
|
}
|
|
451
|
-
export interface
|
|
452
|
-
|
|
453
|
-
|
|
599
|
+
export interface VisionOcrResponse extends InferenceResponse {
|
|
600
|
+
text?: string;
|
|
601
|
+
pages?: OcrPage[];
|
|
602
|
+
artifacts?: Record<string, ResourceRef>;
|
|
603
|
+
}
|
|
604
|
+
export interface Caption {
|
|
605
|
+
text: string;
|
|
606
|
+
confidence?: number;
|
|
607
|
+
}
|
|
608
|
+
export interface VisionCaptionRequest extends InferenceRequest {
|
|
609
|
+
image: ResourceRef;
|
|
610
|
+
style?: string;
|
|
454
611
|
language?: string;
|
|
455
612
|
n?: number;
|
|
456
613
|
}
|
|
457
|
-
export interface
|
|
458
|
-
|
|
614
|
+
export interface VisionCaptionResponse extends InferenceResponse {
|
|
615
|
+
captions?: Caption[];
|
|
616
|
+
}
|
|
617
|
+
export interface Detection {
|
|
618
|
+
label: string;
|
|
619
|
+
class_id?: string;
|
|
620
|
+
score: number;
|
|
621
|
+
bbox: BoundingBox;
|
|
622
|
+
}
|
|
623
|
+
export interface VisionDetectRequest extends InferenceRequest {
|
|
624
|
+
image: ResourceRef;
|
|
459
625
|
classes?: string[];
|
|
460
626
|
score_threshold?: number;
|
|
461
|
-
bbox_spec?:
|
|
627
|
+
bbox_spec?: {
|
|
628
|
+
format: 'xywh';
|
|
629
|
+
unit: 'px' | 'relative';
|
|
630
|
+
};
|
|
462
631
|
}
|
|
463
|
-
export
|
|
632
|
+
export interface VisionDetectResponse extends InferenceResponse {
|
|
633
|
+
detections?: Detection[];
|
|
634
|
+
}
|
|
635
|
+
export type SegmentationPrompt = {
|
|
464
636
|
type: 'box';
|
|
465
|
-
bbox:
|
|
637
|
+
bbox: BoundingBox;
|
|
466
638
|
} | {
|
|
467
639
|
type: 'point';
|
|
468
640
|
x: number;
|
|
@@ -472,170 +644,158 @@ export type AiccVisionSegmentPrompt = {
|
|
|
472
644
|
type: 'text';
|
|
473
645
|
text: string;
|
|
474
646
|
};
|
|
475
|
-
export
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
}
|
|
489
|
-
export interface AiccVisionCaptionExtra {
|
|
490
|
-
captions?: AiccVisionCaption[];
|
|
491
|
-
[key: string]: unknown;
|
|
492
|
-
}
|
|
493
|
-
export interface AiccVisionDetection {
|
|
494
|
-
label: string;
|
|
495
|
-
class_id?: string;
|
|
647
|
+
export type AiMask = {
|
|
648
|
+
format: 'rle';
|
|
649
|
+
size: [number, number];
|
|
650
|
+
counts: string;
|
|
651
|
+
} | {
|
|
652
|
+
format: 'polygon';
|
|
653
|
+
points: [number, number][];
|
|
654
|
+
} | {
|
|
655
|
+
format: 'bitmap_resource';
|
|
656
|
+
resource: ResourceRef;
|
|
657
|
+
};
|
|
658
|
+
export interface SegmentationMask {
|
|
659
|
+
id: string;
|
|
496
660
|
score: number;
|
|
497
|
-
bbox
|
|
498
|
-
|
|
499
|
-
export interface AiccVisionDetectExtra {
|
|
500
|
-
detections?: AiccVisionDetection[];
|
|
501
|
-
[key: string]: unknown;
|
|
502
|
-
}
|
|
503
|
-
export interface AiccVisionMaskResult {
|
|
504
|
-
id?: string;
|
|
505
|
-
score?: number;
|
|
506
|
-
bbox?: AiccBoundingBox;
|
|
507
|
-
mask: AiccMask;
|
|
661
|
+
bbox?: BoundingBox;
|
|
662
|
+
mask: AiMask;
|
|
508
663
|
}
|
|
509
|
-
export interface
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
664
|
+
export interface VisionSegmentRequest extends InferenceRequest {
|
|
665
|
+
image: ResourceRef;
|
|
666
|
+
prompt: SegmentationPrompt;
|
|
667
|
+
mask_format?: string;
|
|
668
|
+
return_bitmap_mask?: boolean;
|
|
514
669
|
}
|
|
515
|
-
export
|
|
516
|
-
|
|
517
|
-
export type AiccVisionDetectResponse = AiccTypedMethodResponse<AiccVisionDetectExtra>;
|
|
518
|
-
export type AiccVisionSegmentResponse = AiccTypedMethodResponse<AiccVisionSegmentExtra>;
|
|
519
|
-
export interface AiccAudioOutputOptions {
|
|
520
|
-
media_type?: string;
|
|
521
|
-
sample_rate?: number;
|
|
670
|
+
export interface VisionSegmentResponse extends InferenceResponse {
|
|
671
|
+
masks?: SegmentationMask[];
|
|
522
672
|
}
|
|
523
|
-
export interface
|
|
673
|
+
export interface VoiceSpec {
|
|
524
674
|
voice_id?: string;
|
|
525
675
|
language?: string;
|
|
526
|
-
gender?:
|
|
676
|
+
gender?: string;
|
|
527
677
|
style?: string;
|
|
528
678
|
speaker_similarity_required?: boolean;
|
|
529
679
|
}
|
|
530
|
-
export interface
|
|
680
|
+
export interface AudioTextToSpeechRequest extends InferenceRequest {
|
|
531
681
|
text: string;
|
|
532
|
-
voice
|
|
682
|
+
voice: VoiceSpec;
|
|
533
683
|
speed?: number;
|
|
534
|
-
output?:
|
|
684
|
+
output?: AiOutputOptions;
|
|
685
|
+
}
|
|
686
|
+
export interface AudioTextToSpeechResponse extends InferenceResponse {
|
|
687
|
+
audio?: ResourceRef;
|
|
688
|
+
}
|
|
689
|
+
export interface AsrSegment {
|
|
690
|
+
id: string;
|
|
691
|
+
start_seconds: number;
|
|
692
|
+
end_seconds: number;
|
|
693
|
+
text: string;
|
|
694
|
+
speaker?: string;
|
|
695
|
+
confidence?: number;
|
|
535
696
|
}
|
|
536
|
-
export interface
|
|
537
|
-
audio:
|
|
697
|
+
export interface AudioSpeechRecognitionRequest extends InferenceRequest {
|
|
698
|
+
audio: ResourceRef;
|
|
538
699
|
language?: string;
|
|
539
|
-
timestamps?:
|
|
700
|
+
timestamps?: string;
|
|
540
701
|
diarization?: boolean;
|
|
541
|
-
output_formats?:
|
|
702
|
+
output_formats?: string[];
|
|
542
703
|
}
|
|
543
|
-
export interface
|
|
704
|
+
export interface AudioSpeechRecognitionResponse extends InferenceResponse {
|
|
705
|
+
text?: string;
|
|
706
|
+
segments?: AsrSegment[];
|
|
707
|
+
artifacts?: Record<string, ResourceRef>;
|
|
708
|
+
diagnostic?: JsonValue;
|
|
709
|
+
}
|
|
710
|
+
export interface MusicSection {
|
|
711
|
+
name: string;
|
|
712
|
+
start_seconds: number;
|
|
713
|
+
end_seconds: number;
|
|
714
|
+
}
|
|
715
|
+
export interface MusicStructure {
|
|
716
|
+
lyrics?: string;
|
|
717
|
+
sections?: MusicSection[];
|
|
718
|
+
}
|
|
719
|
+
export interface AudioMusicRequest extends InferenceRequest {
|
|
544
720
|
prompt: string;
|
|
545
721
|
duration_seconds?: number;
|
|
546
722
|
instrumental?: boolean;
|
|
547
|
-
lyrics?: string
|
|
723
|
+
lyrics?: string;
|
|
548
724
|
seed?: number;
|
|
549
|
-
output?:
|
|
725
|
+
output?: AiOutputOptions;
|
|
726
|
+
}
|
|
727
|
+
export interface AudioMusicResponse extends InferenceResponse {
|
|
728
|
+
audio?: ResourceRef;
|
|
729
|
+
structure?: MusicStructure;
|
|
550
730
|
}
|
|
551
|
-
export interface
|
|
552
|
-
audio:
|
|
553
|
-
task:
|
|
731
|
+
export interface AudioEnhanceRequest extends InferenceRequest {
|
|
732
|
+
audio: ResourceRef;
|
|
733
|
+
task: string;
|
|
554
734
|
strength?: number;
|
|
555
735
|
return_stems?: boolean;
|
|
556
736
|
}
|
|
557
|
-
export interface
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
end_seconds: number;
|
|
561
|
-
text: string;
|
|
562
|
-
speaker?: string;
|
|
563
|
-
confidence?: number;
|
|
564
|
-
}
|
|
565
|
-
export interface AiccAudioExtra {
|
|
566
|
-
asr?: {
|
|
567
|
-
segments?: AiccAudioSegment[];
|
|
568
|
-
};
|
|
569
|
-
audio?: AiccResourceRef;
|
|
570
|
-
stems?: AiccResourceRef[];
|
|
571
|
-
structure?: unknown;
|
|
572
|
-
[key: string]: unknown;
|
|
737
|
+
export interface AudioEnhanceResponse extends InferenceResponse {
|
|
738
|
+
audio?: ResourceRef;
|
|
739
|
+
stems?: ResourceRef[];
|
|
573
740
|
}
|
|
574
|
-
export
|
|
575
|
-
export interface AiccVideoOutputOptions {
|
|
576
|
-
media_type?: string;
|
|
577
|
-
fps?: number;
|
|
578
|
-
}
|
|
579
|
-
export interface AiccVideoTxt2videoInput {
|
|
741
|
+
export interface VideoTextToVideoRequest extends InferenceRequest {
|
|
580
742
|
prompt: string;
|
|
581
743
|
duration_seconds?: number;
|
|
582
744
|
aspect_ratio?: string;
|
|
583
745
|
resolution?: string;
|
|
584
746
|
generate_audio?: boolean;
|
|
585
747
|
seed?: number;
|
|
586
|
-
output?:
|
|
748
|
+
output?: AiOutputOptions;
|
|
587
749
|
}
|
|
588
|
-
export interface
|
|
589
|
-
image:
|
|
590
|
-
prompt
|
|
750
|
+
export interface VideoImageToVideoRequest extends InferenceRequest {
|
|
751
|
+
image: ResourceRef;
|
|
752
|
+
prompt: string;
|
|
591
753
|
duration_seconds?: number;
|
|
592
754
|
aspect_ratio?: string;
|
|
593
755
|
resolution?: string;
|
|
594
756
|
}
|
|
595
|
-
export interface
|
|
757
|
+
export interface TimeRange {
|
|
596
758
|
start_seconds: number;
|
|
597
759
|
end_seconds: number;
|
|
598
760
|
}
|
|
599
|
-
export interface
|
|
600
|
-
video:
|
|
601
|
-
prompt
|
|
761
|
+
export interface VideoToVideoRequest extends InferenceRequest {
|
|
762
|
+
video: ResourceRef;
|
|
763
|
+
prompt: string;
|
|
602
764
|
preserve_motion?: boolean;
|
|
603
|
-
time_range?:
|
|
765
|
+
time_range?: TimeRange;
|
|
604
766
|
}
|
|
605
|
-
export interface
|
|
606
|
-
video:
|
|
607
|
-
prompt
|
|
767
|
+
export interface VideoExtendRequest extends InferenceRequest {
|
|
768
|
+
video: ResourceRef;
|
|
769
|
+
prompt: string;
|
|
608
770
|
continuation_handle?: string;
|
|
609
771
|
duration_seconds?: number;
|
|
610
772
|
resolution?: string;
|
|
611
773
|
}
|
|
612
|
-
export interface
|
|
613
|
-
video:
|
|
614
|
-
target_resolution
|
|
774
|
+
export interface VideoUpscaleRequest extends InferenceRequest {
|
|
775
|
+
video: ResourceRef;
|
|
776
|
+
target_resolution: string;
|
|
615
777
|
denoise?: boolean;
|
|
616
778
|
sharpen?: number;
|
|
617
|
-
output?:
|
|
618
|
-
}
|
|
619
|
-
export interface
|
|
620
|
-
video?:
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
export type
|
|
624
|
-
export type
|
|
625
|
-
export
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
};
|
|
779
|
+
output?: AiOutputOptions;
|
|
780
|
+
}
|
|
781
|
+
export interface VideoResponse extends InferenceResponse {
|
|
782
|
+
video?: ResourceRef;
|
|
783
|
+
}
|
|
784
|
+
export type VideoTextToVideoResponse = VideoResponse;
|
|
785
|
+
export type VideoImageToVideoResponse = VideoResponse;
|
|
786
|
+
export type VideoToVideoResponse = VideoResponse;
|
|
787
|
+
export type VideoExtendResponse = VideoResponse;
|
|
788
|
+
export type VideoUpscaleResponse = VideoResponse;
|
|
789
|
+
export interface ComputerEnvironment {
|
|
790
|
+
environment_id: string;
|
|
791
|
+
session_id: string;
|
|
792
|
+
screenshot: ResourceRef;
|
|
793
|
+
viewport: {
|
|
794
|
+
width: number;
|
|
795
|
+
height: number;
|
|
635
796
|
};
|
|
636
|
-
allowed_actions?: AiccAgentComputerActionName[];
|
|
637
797
|
}
|
|
638
|
-
export type
|
|
798
|
+
export type ComputerAction = {
|
|
639
799
|
type: 'screenshot';
|
|
640
800
|
} | {
|
|
641
801
|
type: 'left_click' | 'right_click';
|
|
@@ -649,66 +809,424 @@ export type AiccAgentComputerAction = {
|
|
|
649
809
|
key: string;
|
|
650
810
|
} | {
|
|
651
811
|
type: 'scroll';
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
delta_x?: number;
|
|
655
|
-
delta_y?: number;
|
|
812
|
+
delta_x: number;
|
|
813
|
+
delta_y: number;
|
|
656
814
|
} | {
|
|
657
815
|
type: 'wait';
|
|
658
|
-
|
|
816
|
+
duration_ms: number;
|
|
659
817
|
};
|
|
660
|
-
export interface
|
|
661
|
-
|
|
818
|
+
export interface ComputerUseRequest extends InferenceRequest {
|
|
819
|
+
task: string;
|
|
820
|
+
environment: ComputerEnvironment;
|
|
821
|
+
allowed_actions: string[];
|
|
822
|
+
}
|
|
823
|
+
export interface ComputerUseResponse extends InferenceResponse {
|
|
824
|
+
actions?: ComputerAction[];
|
|
662
825
|
requires_next_observation?: boolean;
|
|
663
|
-
[key: string]: unknown;
|
|
664
826
|
}
|
|
665
|
-
export type
|
|
827
|
+
export type EmptyRequest = Record<string, never>;
|
|
828
|
+
export type ServiceReloadSettingsRequest = EmptyRequest;
|
|
829
|
+
export type RoutingGetRequest = EmptyRequest;
|
|
830
|
+
export type ListModelsRequest = EmptyRequest;
|
|
831
|
+
export type ProviderCatalogRequest = EmptyRequest;
|
|
832
|
+
export type ProtocolAdapterListRequest = EmptyRequest;
|
|
833
|
+
export type DriverMetadataUpdateGetReq = EmptyRequest;
|
|
834
|
+
export interface CancelRequest {
|
|
835
|
+
task_id: string;
|
|
836
|
+
}
|
|
837
|
+
export interface ServiceReloadSettingsResponse {
|
|
838
|
+
ok: boolean;
|
|
839
|
+
settings_revision: number;
|
|
840
|
+
}
|
|
841
|
+
export interface QuotaQueryRequest {
|
|
842
|
+
capability?: Capability;
|
|
843
|
+
method?: string;
|
|
844
|
+
}
|
|
845
|
+
export interface QuotaView {
|
|
846
|
+
state: 'normal' | 'near_limit' | 'exhausted';
|
|
847
|
+
remaining_request_units?: number;
|
|
848
|
+
remaining_cost?: Money;
|
|
849
|
+
reset_at?: string;
|
|
850
|
+
}
|
|
851
|
+
export interface QuotaQueryResponse {
|
|
852
|
+
quota: QuotaView;
|
|
853
|
+
}
|
|
854
|
+
export interface ProviderCatalogEntry {
|
|
855
|
+
provider_profile_id: string;
|
|
856
|
+
display_name: string;
|
|
857
|
+
base_url: string;
|
|
858
|
+
protocol_adapter_id: string;
|
|
859
|
+
provider_rules_id?: string;
|
|
860
|
+
ui_hints?: Record<string, JsonValue>;
|
|
861
|
+
}
|
|
862
|
+
export interface ProviderCatalogResponse {
|
|
863
|
+
catalog_revision: number;
|
|
864
|
+
providers: ProviderCatalogEntry[];
|
|
865
|
+
}
|
|
866
|
+
export type ProtocolAdapterStatus = 'stable' | 'preview' | 'deprecated';
|
|
867
|
+
export type ProtocolExecutionMode = 'immediate' | 'stream' | 'native_task';
|
|
868
|
+
export interface ProtocolAdapterOperation {
|
|
869
|
+
operation_id: string;
|
|
870
|
+
api_types: ApiType[];
|
|
871
|
+
capabilities: Capability[];
|
|
872
|
+
supported_features: string[];
|
|
873
|
+
execution_modes: ProtocolExecutionMode[];
|
|
874
|
+
supports_cancel: boolean;
|
|
875
|
+
supports_webhook: boolean;
|
|
876
|
+
}
|
|
877
|
+
export interface ProtocolAdapterView {
|
|
878
|
+
protocol_family_id: string;
|
|
879
|
+
protocol_adapter_id: string;
|
|
880
|
+
interface_generation: string;
|
|
881
|
+
status: ProtocolAdapterStatus;
|
|
882
|
+
probe_priority: number;
|
|
883
|
+
base_adapter_id?: string;
|
|
884
|
+
operations: ProtocolAdapterOperation[];
|
|
885
|
+
}
|
|
886
|
+
export interface ProtocolAdapterListResponse {
|
|
887
|
+
adapters: ProtocolAdapterView[];
|
|
888
|
+
}
|
|
889
|
+
interface ProviderConfig {
|
|
890
|
+
provider_type: string;
|
|
891
|
+
provider_profile_id: string;
|
|
892
|
+
protocol_family_id?: string;
|
|
893
|
+
protocol_adapter_id?: string;
|
|
894
|
+
base_url: string;
|
|
895
|
+
credentials: JsonValue;
|
|
896
|
+
region?: string;
|
|
897
|
+
workspace?: string;
|
|
898
|
+
account?: string;
|
|
899
|
+
provider_rules_id?: string;
|
|
900
|
+
auth?: JsonValue;
|
|
901
|
+
discovery?: JsonValue;
|
|
902
|
+
instance_rules?: JsonValue;
|
|
903
|
+
timeout_ms?: number;
|
|
904
|
+
auto_sync_models?: boolean;
|
|
905
|
+
}
|
|
906
|
+
export interface ProviderValidateRequest extends ProviderConfig {
|
|
907
|
+
provider_instance_name?: string;
|
|
908
|
+
}
|
|
909
|
+
export type ProviderValidationErrorKind = 'configuration' | 'base_url' | 'authentication' | 'protocol' | 'models' | 'balance';
|
|
910
|
+
export interface ProviderValidationErrorDetail {
|
|
911
|
+
kind: ProviderValidationErrorKind;
|
|
912
|
+
message: string;
|
|
913
|
+
}
|
|
914
|
+
export interface ProviderValidateResponse {
|
|
915
|
+
base_url_reachable: boolean;
|
|
916
|
+
auth_valid: boolean;
|
|
917
|
+
models_discovered: string[];
|
|
918
|
+
balance_available: boolean;
|
|
919
|
+
errors: string[];
|
|
920
|
+
error_details: ProviderValidationErrorDetail[];
|
|
921
|
+
resolved_protocol_adapter_id?: string;
|
|
922
|
+
}
|
|
923
|
+
export interface ProviderAddRequest extends ProviderConfig {
|
|
924
|
+
provider_instance_name: string;
|
|
925
|
+
}
|
|
926
|
+
export interface ProviderReloadResult {
|
|
927
|
+
ok: boolean;
|
|
928
|
+
providers_registered: number;
|
|
929
|
+
}
|
|
930
|
+
export interface ProviderAddResponse {
|
|
931
|
+
ok: boolean;
|
|
932
|
+
provider_instance_name: string;
|
|
933
|
+
settings_revision: number;
|
|
934
|
+
reload: ProviderReloadResult;
|
|
935
|
+
}
|
|
936
|
+
export interface ProviderDeleteRequest {
|
|
937
|
+
provider_instance_name: string;
|
|
938
|
+
}
|
|
939
|
+
export interface ProviderDeleteResponse {
|
|
940
|
+
ok: boolean;
|
|
941
|
+
provider_instance_name?: string;
|
|
942
|
+
settings_revision?: number;
|
|
943
|
+
reload?: ProviderReloadResult;
|
|
944
|
+
reason?: string;
|
|
945
|
+
}
|
|
946
|
+
export interface ProviderRefreshModelsRequest {
|
|
947
|
+
provider_instance_name: string;
|
|
948
|
+
}
|
|
949
|
+
export interface ProviderRefreshModelsResponse {
|
|
950
|
+
ok: boolean;
|
|
951
|
+
provider_instance_name: string;
|
|
952
|
+
inventory_revision: string;
|
|
953
|
+
}
|
|
954
|
+
export interface ProviderListRequest {
|
|
955
|
+
method?: string;
|
|
956
|
+
}
|
|
957
|
+
export type ProviderInstanceAuthMode = 'api_key' | 'dynamic_login';
|
|
958
|
+
export interface ProviderInstanceAuthView {
|
|
959
|
+
mode?: ProviderInstanceAuthMode;
|
|
960
|
+
credential_kind?: string;
|
|
961
|
+
configured: boolean;
|
|
962
|
+
}
|
|
963
|
+
export type ProviderInstanceInventoryState = 'disabled' | 'not_loaded' | 'loaded';
|
|
964
|
+
export interface ProviderInstanceInventoryView {
|
|
965
|
+
state: ProviderInstanceInventoryState;
|
|
966
|
+
revision?: string;
|
|
967
|
+
model_count: number;
|
|
968
|
+
updated_at_ms?: number;
|
|
969
|
+
}
|
|
970
|
+
export type ProviderInstanceHealthState = 'disabled' | 'not_loaded' | 'unknown' | 'healthy' | 'degraded' | 'unavailable';
|
|
971
|
+
export interface ProviderInstanceHealthView {
|
|
972
|
+
state: ProviderInstanceHealthState;
|
|
973
|
+
checked_at_ms?: number;
|
|
974
|
+
}
|
|
975
|
+
export interface ProviderInstanceView {
|
|
976
|
+
provider_instance_name: string;
|
|
977
|
+
provider_type: string;
|
|
978
|
+
provider_profile_id: string;
|
|
979
|
+
protocol_adapter_id: string;
|
|
980
|
+
base_url: string;
|
|
981
|
+
enabled: boolean;
|
|
982
|
+
auth: ProviderInstanceAuthView;
|
|
983
|
+
inventory: ProviderInstanceInventoryView;
|
|
984
|
+
health: ProviderInstanceHealthView;
|
|
985
|
+
}
|
|
986
|
+
export interface ProviderListResponse {
|
|
987
|
+
providers: ProviderInstanceView[];
|
|
988
|
+
settings_revision: number;
|
|
989
|
+
inventory_revision: string;
|
|
990
|
+
}
|
|
991
|
+
export interface ProviderHealthRequest {
|
|
992
|
+
exact_model: string;
|
|
993
|
+
}
|
|
994
|
+
export interface ProviderHealthResponse {
|
|
995
|
+
health: JsonValue;
|
|
996
|
+
}
|
|
997
|
+
export interface ProviderUpdateRequest {
|
|
998
|
+
provider_instance_name: string;
|
|
999
|
+
settings_revision: number;
|
|
1000
|
+
enabled?: boolean;
|
|
1001
|
+
base_url?: string;
|
|
1002
|
+
credential?: JsonValue;
|
|
1003
|
+
provider_profile_id?: string;
|
|
1004
|
+
protocol_adapter_id?: string;
|
|
1005
|
+
discovery?: JsonValue;
|
|
1006
|
+
instance_rules?: JsonValue;
|
|
1007
|
+
}
|
|
1008
|
+
export interface ProviderUpdateResponse {
|
|
1009
|
+
ok: boolean;
|
|
1010
|
+
settings_revision: number;
|
|
1011
|
+
provider?: JsonValue;
|
|
1012
|
+
}
|
|
1013
|
+
export interface CancelResponse {
|
|
1014
|
+
task_id: string;
|
|
1015
|
+
accepted: boolean;
|
|
1016
|
+
}
|
|
1017
|
+
export type UsageQueryTimeRange = {
|
|
1018
|
+
kind: 'last1d' | 'last7d' | 'last30d';
|
|
1019
|
+
} | {
|
|
1020
|
+
kind: 'explicit';
|
|
1021
|
+
start_time_ms: number;
|
|
1022
|
+
end_time_ms: number;
|
|
1023
|
+
};
|
|
1024
|
+
export interface UsageQueryFilters {
|
|
1025
|
+
tenant_ids?: string[];
|
|
1026
|
+
user_ids?: string[];
|
|
1027
|
+
caller_app_ids?: string[];
|
|
1028
|
+
caller_app_query?: string;
|
|
1029
|
+
request_models?: string[];
|
|
1030
|
+
provider_models?: string[];
|
|
1031
|
+
provider_model_query?: string;
|
|
1032
|
+
provider_instance_names?: string[];
|
|
1033
|
+
provider_instance_query?: string;
|
|
1034
|
+
capabilities?: string[];
|
|
1035
|
+
task_ids?: string[];
|
|
1036
|
+
idempotency_keys?: string[];
|
|
1037
|
+
methods?: string[];
|
|
1038
|
+
}
|
|
1039
|
+
export type UsageQueryGroup = 'provider_model' | 'provider_instance_name' | 'request_model' | 'method' | 'capability' | 'caller_app_id' | 'user_id' | 'tenant_id';
|
|
1040
|
+
export interface QueryUsageRequest {
|
|
1041
|
+
time_range: UsageQueryTimeRange;
|
|
1042
|
+
filters?: UsageQueryFilters;
|
|
1043
|
+
group_by?: UsageQueryGroup[];
|
|
1044
|
+
time_bucket?: 'hour' | 'day';
|
|
1045
|
+
output_mode?: 'summary' | 'events' | 'summary_and_events';
|
|
1046
|
+
limit?: number;
|
|
1047
|
+
cursor?: string;
|
|
1048
|
+
}
|
|
1049
|
+
export interface UsageAggregate {
|
|
1050
|
+
total_requests: number;
|
|
1051
|
+
input_tokens: number;
|
|
1052
|
+
output_tokens: number;
|
|
1053
|
+
total_tokens: number;
|
|
1054
|
+
consumed_request_units: number;
|
|
1055
|
+
finance_totals: Money[];
|
|
1056
|
+
finance_complete: boolean;
|
|
1057
|
+
}
|
|
1058
|
+
export interface AiccUsageEvent {
|
|
1059
|
+
event_id: string;
|
|
1060
|
+
tenant_id: string;
|
|
1061
|
+
user_id: string;
|
|
1062
|
+
caller_app_id?: string;
|
|
1063
|
+
task_id: string;
|
|
1064
|
+
trace_id?: string;
|
|
1065
|
+
idempotency_key?: string;
|
|
1066
|
+
method: AiccAiMethod;
|
|
1067
|
+
capability: string;
|
|
1068
|
+
request_model: string;
|
|
1069
|
+
provider_instance_name: string;
|
|
1070
|
+
provider_model: string;
|
|
1071
|
+
input_tokens?: number;
|
|
1072
|
+
output_tokens?: number;
|
|
1073
|
+
total_tokens?: number;
|
|
1074
|
+
request_units?: number;
|
|
1075
|
+
usage_json: AiUsage;
|
|
1076
|
+
finance_snapshot_json?: JsonValue;
|
|
1077
|
+
created_at_ms: number;
|
|
1078
|
+
}
|
|
1079
|
+
export interface UsageGroupedRow {
|
|
1080
|
+
group: Record<string, string>;
|
|
1081
|
+
aggregate: UsageAggregate;
|
|
1082
|
+
}
|
|
1083
|
+
export interface UsageBucketedRow {
|
|
1084
|
+
bucket_start_ms: number;
|
|
1085
|
+
group?: Record<string, string>;
|
|
1086
|
+
aggregate: UsageAggregate;
|
|
1087
|
+
}
|
|
1088
|
+
export interface QueryUsageResponse {
|
|
1089
|
+
total: UsageAggregate;
|
|
1090
|
+
grouped?: UsageGroupedRow[];
|
|
1091
|
+
buckets?: UsageBucketedRow[];
|
|
1092
|
+
events?: AiccUsageEvent[];
|
|
1093
|
+
next_cursor?: string;
|
|
1094
|
+
}
|
|
1095
|
+
export interface AiccRouteTraceEvent {
|
|
1096
|
+
trace_id: string;
|
|
1097
|
+
tenant_id: string;
|
|
1098
|
+
caller_app_id?: string;
|
|
1099
|
+
task_id: string;
|
|
1100
|
+
request_model: string;
|
|
1101
|
+
selected_exact_model?: string;
|
|
1102
|
+
provider_instance_name?: string;
|
|
1103
|
+
api_type: string;
|
|
1104
|
+
route_trace_json: RouteTrace;
|
|
1105
|
+
created_at_ms: number;
|
|
1106
|
+
}
|
|
1107
|
+
export interface QueryRouteTraceRequest {
|
|
1108
|
+
limit?: number;
|
|
1109
|
+
cursor?: string;
|
|
1110
|
+
start_time_ms?: number;
|
|
1111
|
+
end_time_ms?: number;
|
|
1112
|
+
task_ids?: string[];
|
|
1113
|
+
request_ids?: string[];
|
|
1114
|
+
api_types?: string[];
|
|
1115
|
+
provider_instance_names?: string[];
|
|
1116
|
+
selected_exact_models?: string[];
|
|
1117
|
+
scheduler_profiles?: string[];
|
|
1118
|
+
query?: string;
|
|
1119
|
+
outcome?: string;
|
|
1120
|
+
}
|
|
1121
|
+
export interface QueryRouteTraceResponse {
|
|
1122
|
+
traces?: JsonValue[];
|
|
1123
|
+
next_cursor?: string;
|
|
1124
|
+
total_count?: number;
|
|
1125
|
+
}
|
|
1126
|
+
export interface RoutingGetResponse {
|
|
1127
|
+
settings_revision: number;
|
|
1128
|
+
routing: AiccRouteOverlay;
|
|
1129
|
+
}
|
|
1130
|
+
export interface RoutingUpdateRequest {
|
|
1131
|
+
settings_revision: number;
|
|
1132
|
+
provider_weights: Record<string, number>;
|
|
1133
|
+
}
|
|
1134
|
+
export interface RoutingUpdateResponse {
|
|
1135
|
+
ok: boolean;
|
|
1136
|
+
settings_revision: number;
|
|
1137
|
+
routing: AiccRouteOverlay;
|
|
1138
|
+
}
|
|
1139
|
+
export interface DriverMetadataUpdateSetReq {
|
|
1140
|
+
enabled: boolean;
|
|
1141
|
+
source_url?: string;
|
|
1142
|
+
interval_secs?: number;
|
|
1143
|
+
}
|
|
1144
|
+
export type DriverMetadataUpdateStatus = 'disabled' | 'idle' | 'updating' | 'healthy' | 'degraded' | 'error';
|
|
1145
|
+
export interface DriverMetadataProviderStatus {
|
|
1146
|
+
provider_instance_name: string;
|
|
1147
|
+
metadata_applied_seq: number;
|
|
1148
|
+
}
|
|
1149
|
+
export interface DriverMetadataUpdateView {
|
|
1150
|
+
enabled: boolean;
|
|
1151
|
+
source_url?: string | null;
|
|
1152
|
+
source_configured: boolean;
|
|
1153
|
+
interval_secs: number;
|
|
1154
|
+
metadata_target_seq: number;
|
|
1155
|
+
providers: DriverMetadataProviderStatus[];
|
|
1156
|
+
status: DriverMetadataUpdateStatus;
|
|
1157
|
+
active_revision?: number | null;
|
|
1158
|
+
last_attempt_at_ms?: number | null;
|
|
1159
|
+
last_success_at_ms?: number | null;
|
|
1160
|
+
last_error?: string | null;
|
|
1161
|
+
consecutive_failures: number;
|
|
1162
|
+
}
|
|
1163
|
+
export interface DriverMetadataRuntimeApply {
|
|
1164
|
+
ok: boolean;
|
|
1165
|
+
refresh_scheduled?: boolean;
|
|
1166
|
+
error?: string;
|
|
1167
|
+
}
|
|
1168
|
+
export interface DriverMetadataUpdateSetResponse {
|
|
1169
|
+
ok: boolean;
|
|
1170
|
+
settings_revision: number;
|
|
1171
|
+
settings: DriverMetadataUpdateView;
|
|
1172
|
+
runtime_apply: DriverMetadataRuntimeApply;
|
|
1173
|
+
}
|
|
666
1174
|
export declare function isAiccAiMethod(method: string): method is AiccAiMethod;
|
|
667
|
-
export declare function aiccTextMessage(role:
|
|
668
|
-
export declare function aiccMessageTextContent(message:
|
|
669
|
-
export declare function aiccMessageFirstText(message:
|
|
670
|
-
export declare function
|
|
671
|
-
export declare function aiccResponseToolCalls(response: AiccResponse): AiccToolCall[];
|
|
672
|
-
export declare function aiccResponseArtifacts(response: AiccResponse): AiccArtifact[];
|
|
673
|
-
export declare function aiccRenderMessageForDebug(message: AiccMessage): string;
|
|
674
|
-
export declare function aiccEstimateMessageTextLen(message: AiccMessage): number;
|
|
675
|
-
export declare function validateAiccMessage(message: AiccMessage): void;
|
|
676
|
-
export declare function validateAiccMessages(messages: AiccMessage[]): void;
|
|
677
|
-
export declare function validateAiccResponse(response: AiccResponse): void;
|
|
1175
|
+
export declare function aiccTextMessage(role: AiRole, text: string): AiMessage;
|
|
1176
|
+
export declare function aiccMessageTextContent(message: AiMessage): string;
|
|
1177
|
+
export declare function aiccMessageFirstText(message: AiMessage): string | undefined;
|
|
1178
|
+
export declare function validateAiccMessage(message: AiMessage): void;
|
|
678
1179
|
export declare class AiccClient {
|
|
679
1180
|
private rpcClient;
|
|
680
1181
|
constructor(rpcClient: kRPCClient);
|
|
681
1182
|
setSeq(seq: number): void;
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
1183
|
+
private call;
|
|
1184
|
+
private inference;
|
|
1185
|
+
routeResolve(r: RouteResolveRequest): Promise<RouteResolveResponse>;
|
|
1186
|
+
chatCompletionsCreate(r: LlmChatInvokeRequest): Promise<LlmChatInvokeResponse>;
|
|
1187
|
+
imagesGenerate(r: TextToImageInvokeRequest): Promise<TextToImageInvokeResponse>;
|
|
1188
|
+
helperLlmChat(r: LlmChatHelperRequest): Promise<LlmChatInvokeResponse>;
|
|
1189
|
+
helperTextToImage(r: TextToImageHelperRequest): Promise<TextToImageInvokeResponse>;
|
|
1190
|
+
embeddingText(r: EmbeddingTextRequest): Promise<EmbeddingTextResponse>;
|
|
1191
|
+
embeddingMultimodal(r: EmbeddingMultimodalRequest): Promise<EmbeddingTextResponse>;
|
|
1192
|
+
rerank(r: RerankRequest): Promise<RerankResponse>;
|
|
1193
|
+
imageToImage(r: ImageToImageRequest): Promise<ImageToImageResponse>;
|
|
1194
|
+
imageInpaint(r: ImageInpaintRequest): Promise<ImageToImageResponse>;
|
|
1195
|
+
imageUpscale(r: ImageUpscaleRequest): Promise<ImageUpscaleResponse>;
|
|
1196
|
+
imageBackgroundRemove(r: ImageBackgroundRemoveRequest): Promise<ImageUpscaleResponse>;
|
|
1197
|
+
visionOcr(r: VisionOcrRequest): Promise<VisionOcrResponse>;
|
|
1198
|
+
visionCaption(r: VisionCaptionRequest): Promise<VisionCaptionResponse>;
|
|
1199
|
+
visionDetect(r: VisionDetectRequest): Promise<VisionDetectResponse>;
|
|
1200
|
+
visionSegment(r: VisionSegmentRequest): Promise<VisionSegmentResponse>;
|
|
1201
|
+
audioTextToSpeech(r: AudioTextToSpeechRequest): Promise<AudioTextToSpeechResponse>;
|
|
1202
|
+
audioSpeechRecognition(r: AudioSpeechRecognitionRequest): Promise<AudioSpeechRecognitionResponse>;
|
|
1203
|
+
audioMusic(r: AudioMusicRequest): Promise<AudioMusicResponse>;
|
|
1204
|
+
audioEnhance(r: AudioEnhanceRequest): Promise<AudioEnhanceResponse>;
|
|
1205
|
+
videoTextToVideo(r: VideoTextToVideoRequest): Promise<VideoResponse>;
|
|
1206
|
+
videoImageToVideo(r: VideoImageToVideoRequest): Promise<VideoResponse>;
|
|
1207
|
+
videoToVideo(r: VideoToVideoRequest): Promise<VideoResponse>;
|
|
1208
|
+
videoExtend(r: VideoExtendRequest): Promise<VideoResponse>;
|
|
1209
|
+
videoUpscale(r: VideoUpscaleRequest): Promise<VideoResponse>;
|
|
1210
|
+
computerUse(r: ComputerUseRequest): Promise<ComputerUseResponse>;
|
|
1211
|
+
cancel(taskId: string): Promise<CancelResponse>;
|
|
1212
|
+
reloadSettings(): Promise<ServiceReloadSettingsResponse>;
|
|
1213
|
+
queryQuota(r?: QuotaQueryRequest): Promise<QuotaQueryResponse>;
|
|
1214
|
+
queryUsage(r: QueryUsageRequest): Promise<QueryUsageResponse>;
|
|
1215
|
+
queryTrace(r?: QueryRouteTraceRequest): Promise<QueryRouteTraceResponse>;
|
|
1216
|
+
getRouting(): Promise<RoutingGetResponse>;
|
|
1217
|
+
updateRouting(r: RoutingUpdateRequest): Promise<RoutingUpdateResponse>;
|
|
1218
|
+
providerCatalog(): Promise<ProviderCatalogResponse>;
|
|
1219
|
+
listProtocolAdapters(): Promise<ProtocolAdapterListResponse>;
|
|
1220
|
+
validateProvider(r: ProviderValidateRequest): Promise<ProviderValidateResponse>;
|
|
1221
|
+
addProvider(r: ProviderAddRequest): Promise<ProviderAddResponse>;
|
|
1222
|
+
listProviders(r?: ProviderListRequest): Promise<ProviderListResponse>;
|
|
1223
|
+
providerHealth(r: ProviderHealthRequest): Promise<ProviderHealthResponse>;
|
|
1224
|
+
updateProvider(r: ProviderUpdateRequest): Promise<ProviderUpdateResponse>;
|
|
1225
|
+
deleteProvider(r: ProviderDeleteRequest): Promise<ProviderDeleteResponse>;
|
|
1226
|
+
refreshProviderModels(r: ProviderRefreshModelsRequest): Promise<ProviderRefreshModelsResponse>;
|
|
1227
|
+
listModels(): Promise<JsonValue>;
|
|
1228
|
+
getDriverMetadataUpdate(): Promise<DriverMetadataUpdateView>;
|
|
1229
|
+
setDriverMetadataUpdate(r: DriverMetadataUpdateSetReq): Promise<DriverMetadataUpdateSetResponse>;
|
|
1230
|
+
}
|
|
1231
|
+
export {};
|
|
714
1232
|
//# sourceMappingURL=aicc_client.d.ts.map
|