@h-ai/ai 0.1.0-alpha.41 → 0.1.0-alpha.43
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/README.md +40 -2
- package/dist/{ai-audio-ws-protocol-DE4WxxHM.d.ts → ai-audio-ws-protocol-CUIXMEkt.d.ts} +67 -2
- package/dist/{ai-reasoning-types-B8PH0w2_.d.ts → ai-reasoning-types-DsVJ4CE8.d.ts} +122 -18
- package/dist/browser.d.ts +2 -2
- package/dist/browser.js +3 -3
- package/dist/{chunk-ELH2IPOE.js → chunk-6RWS5OWJ.js} +3 -3
- package/dist/{chunk-ELH2IPOE.js.map → chunk-6RWS5OWJ.js.map} +1 -1
- package/dist/{chunk-DRSZFSCT.js → chunk-E3W2H6FL.js} +108 -13
- package/dist/chunk-E3W2H6FL.js.map +1 -0
- package/dist/{chunk-P3GND76X.js → chunk-JC7QBT3C.js} +9 -2
- package/dist/chunk-JC7QBT3C.js.map +1 -0
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.js +2 -2
- package/dist/index.d.ts +4 -4
- package/dist/index.js +639 -158
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
- package/dist/chunk-DRSZFSCT.js.map +0 -1
- package/dist/chunk-P3GND76X.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @h-ai/ai
|
|
2
2
|
|
|
3
|
-
AI 能力模块,提供统一的 `ai` 服务对象,覆盖 LLM
|
|
3
|
+
AI 能力模块,提供统一的 `ai` 服务对象,覆盖 LLM 对话、文生图、工具调用、MCP、Embedding、记忆、检索/RAG、知识库、上下文管理、文件解析、Rerank、语音(ASR/TTS)与 A2A。Node.js 侧通过 `ai.init()` 初始化,浏览器侧通过 API/client 代理访问。
|
|
4
4
|
|
|
5
5
|
## 能力概览
|
|
6
6
|
|
|
@@ -16,6 +16,7 @@ AI 能力模块,提供统一的 `ai` 服务对象,覆盖 LLM 对话、工具
|
|
|
16
16
|
- `ai.context`:LLM + Memory + RAG + 压缩的一体化会话管理。
|
|
17
17
|
- `ai.file` / `ai.rerank`:文件解析/OCR 与文本重排序。
|
|
18
18
|
- `ai.audio`:语音识别(ASR)与语音合成(TTS),支持完整与流式调用,覆盖 OpenAI / MiMo / Qwen / 豆包平台。
|
|
19
|
+
- `ai.image`:文生图,覆盖 OpenAI GPT Image、Google Gemini Image / Nano Banana、Qwen-Image 2.0/3.0、Seedream 4.x/5.x 与 Pollinations 免费额度模型。
|
|
19
20
|
- `ai.a2a`:Agent-to-Agent 请求处理与远端调用。
|
|
20
21
|
- `@h-ai/ai/client`:前端轻量客户端(配合 API 服务)。
|
|
21
22
|
- `AIStoreProvider`:统一存储抽象;无数据库时默认使用进程内临时 Store,已初始化 reldb + vecdb 时自动使用持久化 DB Provider。
|
|
@@ -210,11 +211,15 @@ if (setup.success) {
|
|
|
210
211
|
|
|
211
212
|
### 语音(Audio)
|
|
212
213
|
|
|
213
|
-
先在 `ai.init()`
|
|
214
|
+
先在 `ai.init()` 中注册语音模型并映射默认识别/合成模型。凭据默认回退到平台环境变量;只有 LLM 与语音模型确认使用同一凭据时,才显式启用 `inheritLlmApiKey`:
|
|
214
215
|
|
|
215
216
|
```ts
|
|
216
217
|
await ai.init({
|
|
218
|
+
llm: {
|
|
219
|
+
apiKey: process.env.HAI_AI_LLM_API_KEY,
|
|
220
|
+
},
|
|
217
221
|
audio: {
|
|
222
|
+
inheritLlmApiKey: true,
|
|
218
223
|
models: [
|
|
219
224
|
{ id: 'asr', provider: 'qwen', model: 'qwen3-asr-flash-realtime', operations: ['transcribe'] },
|
|
220
225
|
{ id: 'tts', provider: 'qwen', model: 'qwen3-tts-flash-realtime', operations: ['synthesize'] },
|
|
@@ -261,12 +266,44 @@ const caps = ai.audio.getCapabilities({ operation: 'synthesize', model: 'tts' })
|
|
|
261
266
|
if (caps.success && caps.data.synthesize?.streamingAudioOutput) { /* 可实时 TTS */ }
|
|
262
267
|
```
|
|
263
268
|
|
|
269
|
+
`OptionalSecretSchema` 统一用于 LLM、Audio 与 Image 的可选密钥字段:YAML `null`、空字符串和纯空白字符串都会规范化为 `undefined`。语音密钥优先级为模型条目 `apiKey` → 启用继承后的 LLM `apiKey` → 对应平台环境变量;`inheritLlmApiKey` 默认关闭,避免跨供应商误用密钥。
|
|
270
|
+
|
|
264
271
|
> `synthesizeStream` 严格按 `segment_started → audio* → segment_done` 产出事件。`segment_started` 携带服务端解析 Provider 后的**真实输出音频参数**(`format` / `sampleRate` / `channels`),播放器据此正确解码,不应按请求参数猜测格式。播放器只有在对应音频真正播放完成后才应把该段文本计入 `spokenText`;播放状态仍由应用管理。
|
|
265
272
|
|
|
266
273
|
取消/超时/连接错误统一为领域错误:`AbortSignal` 触发 → `AUDIO_CANCELLED`(超时 → `AUDIO_TIMEOUT`),连接失败或 `end` 前异常断连 → `AUDIO_CONNECTION_FAILED`。实时连接时长受 `audio.maxStreamDurationMs`(默认 5 分钟)限制。
|
|
267
274
|
|
|
268
275
|
浏览器 / 移动端通过 `@h-ai/serv` 暴露的统一语音 WebSocket 入口访问,`@h-ai/ai/client` 提供与 Node 端一致的 `audio.*` API(传输细节内部隐藏)。浏览器客户端严格区分正常结束、取消(`AUDIO_CANCELLED`)与异常断连(`AUDIO_CONNECTION_FAILED`):取消或在 `end` 前断连会抛出对应领域错误码,`synthesize` 不会把未完成的部分音频当作成功结果返回。
|
|
269
276
|
|
|
277
|
+
### 文生图(Image)
|
|
278
|
+
|
|
279
|
+
在 `ai.init()` 注册模型后,调用方只接收标准化图片字节,不感知厂商 Base64、内联数据或临时 URL:
|
|
280
|
+
|
|
281
|
+
```ts
|
|
282
|
+
await ai.init({
|
|
283
|
+
image: {
|
|
284
|
+
models: [
|
|
285
|
+
{ id: 'image', provider: 'openai', model: 'gpt-image-2' },
|
|
286
|
+
{ id: 'free', provider: 'pollinations', model: 'zimage' },
|
|
287
|
+
],
|
|
288
|
+
generateModel: 'image',
|
|
289
|
+
},
|
|
290
|
+
})
|
|
291
|
+
|
|
292
|
+
const result = await ai.image.generate({
|
|
293
|
+
prompt: '一个正在构建开源框架的友好机器人',
|
|
294
|
+
size: { width: 1024, height: 1024 },
|
|
295
|
+
referenceImages: [
|
|
296
|
+
{ data: await readImage('character.png'), mimeType: 'image/png' },
|
|
297
|
+
],
|
|
298
|
+
})
|
|
299
|
+
if (result.success) {
|
|
300
|
+
const { data, mimeType } = result.data.images[0]!
|
|
301
|
+
await saveImage(data, mimeType)
|
|
302
|
+
}
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
`referenceImages` 可省略;公共层只接受图片字节与 MIME,multipart、`inlineData`、Data URL 等差异由 Provider 转换。凭据可在模型条目传入,或使用 `HAI_AI_IMAGE_<PROVIDER>_API_KEY` / 厂商环境变量。Qwen 与 Seedream 返回的临时 URL 会在 Provider 内立即下载,不会泄漏到公共返回值。完整接口差异与模型说明见 [REFERENCE.md](./REFERENCE.md#image)。
|
|
306
|
+
|
|
270
307
|
### Context 管理器
|
|
271
308
|
|
|
272
309
|
```ts
|
|
@@ -460,6 +497,7 @@ if (!result.success) {
|
|
|
460
497
|
- `hai:ai:600-701`:Retrieval/RAG。
|
|
461
498
|
- `hai:ai:800-805`:Knowledge。
|
|
462
499
|
- `hai:ai:050-059`:Audio。
|
|
500
|
+
- `hai:ai:060-065`:Image。
|
|
463
501
|
- `hai:ai:900-905`:Memory。
|
|
464
502
|
- `hai:ai:980-984`:A2A。
|
|
465
503
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _h_ai_core from '@h-ai/core';
|
|
2
2
|
import { HaiResult } from '@h-ai/core';
|
|
3
|
-
import {
|
|
3
|
+
import { aP as ChatMessage, ao as InteractionScope, U as MemoryType, bA as RagOptions, bE as ReasoningOptions, cb as ToolRegistryOperations, bm as MemoryEntry, bT as SessionInfo, bf as LLMOperations, bs as MemoryOperations, bz as RagOperations, bD as ReasoningOperations, c as AIConfig, d as AIConfigInput, aE as AIStoreProvider, cd as ToolsOperations, bX as StreamOperations, bK as RetrievalOperations, b9 as KnowledgeOperations, ay as A2AOperations, q as AudioOperations, l as AudioFormat } from './ai-reasoning-types-DsVJ4CE8.js';
|
|
4
4
|
import * as zod from 'zod';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
import { Buffer } from 'node:buffer';
|
|
@@ -918,6 +918,63 @@ interface FileOperations {
|
|
|
918
918
|
parseText: (content: Buffer | string, filename?: string) => Promise<HaiResult<string>>;
|
|
919
919
|
}
|
|
920
920
|
|
|
921
|
+
/**
|
|
922
|
+
* @h-ai/ai — 文生图公共类型
|
|
923
|
+
*
|
|
924
|
+
* 公共契约只暴露业务需要的提示词、尺寸和标准化图片字节。
|
|
925
|
+
* 厂商请求字段、临时 URL 与响应中间态由 Provider 内部处理。
|
|
926
|
+
* @module image/ai-image-types
|
|
927
|
+
*/
|
|
928
|
+
|
|
929
|
+
/** 图片像素尺寸 */
|
|
930
|
+
interface ImageSize {
|
|
931
|
+
/** 宽度(像素) */
|
|
932
|
+
width: number;
|
|
933
|
+
/** 高度(像素) */
|
|
934
|
+
height: number;
|
|
935
|
+
}
|
|
936
|
+
/** 可选参考图;Provider 会转换为对应厂商的传输格式 */
|
|
937
|
+
interface ReferenceImage {
|
|
938
|
+
/** 图片二进制内容 */
|
|
939
|
+
data: Uint8Array;
|
|
940
|
+
/** 图片 MIME 类型,例如 `image/png`、`image/jpeg` */
|
|
941
|
+
mimeType: string;
|
|
942
|
+
}
|
|
943
|
+
/** 文生图请求 */
|
|
944
|
+
interface GenerateImageRequest {
|
|
945
|
+
/** 图片内容与风格提示词 */
|
|
946
|
+
prompt: string;
|
|
947
|
+
/** 模型 ID;不传时使用配置中的默认文生图模型 */
|
|
948
|
+
model?: string;
|
|
949
|
+
/** 输出像素尺寸;不传时由模型决定 */
|
|
950
|
+
size?: ImageSize;
|
|
951
|
+
/** 用于图生图、编辑或风格参考的一张或多张图片 */
|
|
952
|
+
referenceImages?: ReferenceImage[];
|
|
953
|
+
/** 请求取消信号 */
|
|
954
|
+
signal?: AbortSignal;
|
|
955
|
+
}
|
|
956
|
+
/** 标准化后的单张图片 */
|
|
957
|
+
interface GeneratedImage {
|
|
958
|
+
/** 图片二进制内容 */
|
|
959
|
+
data: Uint8Array;
|
|
960
|
+
/** 图片 MIME 类型 */
|
|
961
|
+
mimeType: string;
|
|
962
|
+
/** 实际宽度(厂商返回时提供) */
|
|
963
|
+
width?: number;
|
|
964
|
+
/** 实际高度(厂商返回时提供) */
|
|
965
|
+
height?: number;
|
|
966
|
+
}
|
|
967
|
+
/** 文生图结果 */
|
|
968
|
+
interface GenerateImageResult {
|
|
969
|
+
/** 厂商实际返回的图片;通常为一张 */
|
|
970
|
+
images: GeneratedImage[];
|
|
971
|
+
}
|
|
972
|
+
/** 文生图操作接口(通过 `ai.image` 访问) */
|
|
973
|
+
interface ImageOperations {
|
|
974
|
+
/** 根据文本提示生成图片 */
|
|
975
|
+
generate: (request: GenerateImageRequest) => Promise<HaiResult<GenerateImageResult>>;
|
|
976
|
+
}
|
|
977
|
+
|
|
921
978
|
/**
|
|
922
979
|
* @h-ai/ai — MCP 子功能类型
|
|
923
980
|
*
|
|
@@ -1414,6 +1471,12 @@ declare const HaiAIError: {
|
|
|
1414
1471
|
readonly AUDIO_TIMEOUT: _h_ai_core.HaiErrorDef;
|
|
1415
1472
|
readonly AUDIO_INPUT_TOO_LARGE: _h_ai_core.HaiErrorDef;
|
|
1416
1473
|
readonly AUDIO_CANCELLED: _h_ai_core.HaiErrorDef;
|
|
1474
|
+
readonly IMAGE_INVALID_REQUEST: _h_ai_core.HaiErrorDef;
|
|
1475
|
+
readonly IMAGE_MODEL_NOT_FOUND: _h_ai_core.HaiErrorDef;
|
|
1476
|
+
readonly IMAGE_PROVIDER_NOT_FOUND: _h_ai_core.HaiErrorDef;
|
|
1477
|
+
readonly IMAGE_UPSTREAM_ERROR: _h_ai_core.HaiErrorDef;
|
|
1478
|
+
readonly IMAGE_PROTOCOL_ERROR: _h_ai_core.HaiErrorDef;
|
|
1479
|
+
readonly IMAGE_CANCELLED: _h_ai_core.HaiErrorDef;
|
|
1417
1480
|
readonly CONTEXT_COMPRESS_FAILED: _h_ai_core.HaiErrorDef;
|
|
1418
1481
|
readonly CONTEXT_SUMMARIZE_FAILED: _h_ai_core.HaiErrorDef;
|
|
1419
1482
|
readonly CONTEXT_TOKEN_ESTIMATE_FAILED: _h_ai_core.HaiErrorDef;
|
|
@@ -1522,6 +1585,8 @@ interface AIFunctions {
|
|
|
1522
1585
|
readonly a2a: A2AOperations;
|
|
1523
1586
|
/** Audio 操作(语音识别 / 语音合成),需要先调用 `init()` 并配置 `audio` */
|
|
1524
1587
|
readonly audio: AudioOperations;
|
|
1588
|
+
/** Image 操作(文生图),需要先调用 `init()` 并配置 `image` */
|
|
1589
|
+
readonly image: ImageOperations;
|
|
1525
1590
|
}
|
|
1526
1591
|
|
|
1527
1592
|
/** 统一语音入口的默认路径(相对 API 前缀) */
|
|
@@ -1689,4 +1754,4 @@ interface AudioWsEndMessage {
|
|
|
1689
1754
|
/** 服务端 JSON 消息(合成音频以二进制帧返回,不走 JSON) */
|
|
1690
1755
|
type AudioWsServerMessage = AudioWsSpeechMessage | AudioWsTranscriptMessage | AudioWsSegmentStartedMessage | AudioWsSegmentDoneMessage | AudioWsErrorMessage | AudioWsEndMessage;
|
|
1691
1756
|
|
|
1692
|
-
export { type
|
|
1757
|
+
export { type FileParseOptions as $, type AIFunctions as A, type CompressResult as B, type CompressionStrategy as C, type ConsolidateOptions as D, type ConsolidateResult as E, type ContextChatOptions as F, type GenerateImageRequest as G, HaiAIError as H, type ImageOperations as I, type ContextChatResult as J, type ContextDeps as K, type ContextManager as L, type McpServerOptions as M, type ContextManagerOptions as N, type ContextOperations as O, type ContextResetOptions as P, type ContextStreamEvent as Q, type ReferenceImage as R, type ConversationTurn as S, type ConversationTurnStatus as T, type EmbeddingItem as U, type EmbeddingOperations as V, type EmbeddingProvider as W, type EmbeddingRequest as X, type EmbeddingResponse as Y, type FileOperations as Z, type FileParseMethod as _, type AIInitOptions as a, type FileParseRequest as a0, type FileParseResult as a1, type MCPContext as a2, type MCPOperations as a3, type MCPPrompt as a4, type MCPPromptArgument as a5, type MCPPromptContent as a6, type MCPPromptMessage as a7, type MCPProvider as a8, type MCPResource as a9, type MCPResourceContent as aa, type MCPToolDefinition as ab, type MCPToolHandler as ac, type OutputFormat as ad, type PersonaOperations as ae, type PersonaProfile as af, type PersonaProfileInput as ag, type PersonaProfileUpdate as ah, type PersonaScopeOptions as ai, type RerankDocument as aj, type RerankItem as ak, type RerankOperations as al, type RerankRequest as am, type RerankResponse as an, type SummaryOperations as ao, type SummaryOptions as ap, type SummaryResult as aq, type TokenOperations as ar, AUDIO_WS_PATH as b, AudioFormatSchema as c, type AudioWsClientMessage as d, AudioWsClientMessageSchema as e, type AudioWsDoneMessage as f, AudioWsDoneMessageSchema as g, type AudioWsEndMessage as h, type AudioWsErrorMessage as i, type AudioWsSegmentDoneMessage as j, type AudioWsSegmentStartedMessage as k, type AudioWsServerMessage as l, type AudioWsSpeechMessage as m, type AudioWsStartMessage as n, AudioWsStartMessageSchema as o, type AudioWsTextMessage as p, AudioWsTextMessageSchema as q, type AudioWsTranscriptMessage as r, CompressionStrategySchema as s, type GenerateImageResult as t, type GeneratedImage as u, type ImageSize as v, type AIMCPFunctionsDeps as w, type CommitTurnInput as x, type CompressOperations as y, type CompressOptions as z };
|
|
@@ -2214,6 +2214,13 @@ interface MemoryOperations extends MemoryCoreOperations {
|
|
|
2214
2214
|
* @module ai-config
|
|
2215
2215
|
*/
|
|
2216
2216
|
|
|
2217
|
+
/**
|
|
2218
|
+
* 可选密钥 Schema。
|
|
2219
|
+
*
|
|
2220
|
+
* 配置文件中的空插值、空白字符串或 YAML null 都表示“未配置”,输出统一为 undefined;
|
|
2221
|
+
* 非空密钥保持原值,避免模块调用方重复编写兼容清洗逻辑。
|
|
2222
|
+
*/
|
|
2223
|
+
declare const OptionalSecretSchema: z.ZodOptional<z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string | undefined, string | null>>>;
|
|
2217
2224
|
/**
|
|
2218
2225
|
* 模型场景枚举
|
|
2219
2226
|
*
|
|
@@ -2285,7 +2292,7 @@ declare const ModelEntrySchema: z.ZodObject<{
|
|
|
2285
2292
|
responses: "responses";
|
|
2286
2293
|
anthropic: "anthropic";
|
|
2287
2294
|
}>>;
|
|
2288
|
-
apiKey: z.ZodOptional<z.ZodString
|
|
2295
|
+
apiKey: z.ZodOptional<z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string | undefined, string | null>>>;
|
|
2289
2296
|
baseUrl: z.ZodOptional<z.ZodURL>;
|
|
2290
2297
|
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
2291
2298
|
temperature: z.ZodOptional<z.ZodNumber>;
|
|
@@ -2325,7 +2332,7 @@ type ModelEntry = z.infer<typeof ModelEntrySchema>;
|
|
|
2325
2332
|
* ```
|
|
2326
2333
|
*/
|
|
2327
2334
|
declare const LLMConfigSchema: z.ZodObject<{
|
|
2328
|
-
apiKey: z.ZodOptional<z.ZodString
|
|
2335
|
+
apiKey: z.ZodOptional<z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string | undefined, string | null>>>;
|
|
2329
2336
|
baseUrl: z.ZodOptional<z.ZodURL>;
|
|
2330
2337
|
model: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
2331
2338
|
api: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
@@ -2345,7 +2352,7 @@ declare const LLMConfigSchema: z.ZodObject<{
|
|
|
2345
2352
|
responses: "responses";
|
|
2346
2353
|
anthropic: "anthropic";
|
|
2347
2354
|
}>>;
|
|
2348
|
-
apiKey: z.ZodOptional<z.ZodString
|
|
2355
|
+
apiKey: z.ZodOptional<z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string | undefined, string | null>>>;
|
|
2349
2356
|
baseUrl: z.ZodOptional<z.ZodURL>;
|
|
2350
2357
|
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
2351
2358
|
temperature: z.ZodOptional<z.ZodNumber>;
|
|
@@ -2787,10 +2794,10 @@ declare const AudioModelEntrySchema: z.ZodObject<{
|
|
|
2787
2794
|
}>;
|
|
2788
2795
|
model: z.ZodString;
|
|
2789
2796
|
operations: z.ZodUnion<readonly [z.ZodTuple<[z.ZodLiteral<"transcribe">], null>, z.ZodTuple<[z.ZodLiteral<"synthesize">], null>, z.ZodTuple<[z.ZodLiteral<"transcribe">, z.ZodLiteral<"synthesize">], null>]>;
|
|
2790
|
-
apiKey: z.ZodOptional<z.ZodString
|
|
2797
|
+
apiKey: z.ZodOptional<z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string | undefined, string | null>>>;
|
|
2791
2798
|
baseUrl: z.ZodOptional<z.ZodString>;
|
|
2792
|
-
appKey: z.ZodOptional<z.ZodString
|
|
2793
|
-
accessKey: z.ZodOptional<z.ZodString
|
|
2799
|
+
appKey: z.ZodOptional<z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string | undefined, string | null>>>;
|
|
2800
|
+
accessKey: z.ZodOptional<z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string | undefined, string | null>>>;
|
|
2794
2801
|
resourceId: z.ZodOptional<z.ZodString>;
|
|
2795
2802
|
workspaceId: z.ZodOptional<z.ZodString>;
|
|
2796
2803
|
timeout: z.ZodOptional<z.ZodNumber>;
|
|
@@ -2827,14 +2834,15 @@ declare const AudioConfigSchema: z.ZodObject<{
|
|
|
2827
2834
|
}>;
|
|
2828
2835
|
model: z.ZodString;
|
|
2829
2836
|
operations: z.ZodUnion<readonly [z.ZodTuple<[z.ZodLiteral<"transcribe">], null>, z.ZodTuple<[z.ZodLiteral<"synthesize">], null>, z.ZodTuple<[z.ZodLiteral<"transcribe">, z.ZodLiteral<"synthesize">], null>]>;
|
|
2830
|
-
apiKey: z.ZodOptional<z.ZodString
|
|
2837
|
+
apiKey: z.ZodOptional<z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string | undefined, string | null>>>;
|
|
2831
2838
|
baseUrl: z.ZodOptional<z.ZodString>;
|
|
2832
|
-
appKey: z.ZodOptional<z.ZodString
|
|
2833
|
-
accessKey: z.ZodOptional<z.ZodString
|
|
2839
|
+
appKey: z.ZodOptional<z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string | undefined, string | null>>>;
|
|
2840
|
+
accessKey: z.ZodOptional<z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string | undefined, string | null>>>;
|
|
2834
2841
|
resourceId: z.ZodOptional<z.ZodString>;
|
|
2835
2842
|
workspaceId: z.ZodOptional<z.ZodString>;
|
|
2836
2843
|
timeout: z.ZodOptional<z.ZodNumber>;
|
|
2837
2844
|
}, z.core.$strip>>>;
|
|
2845
|
+
inheritLlmApiKey: z.ZodDefault<z.ZodBoolean>;
|
|
2838
2846
|
transcribeModel: z.ZodOptional<z.ZodString>;
|
|
2839
2847
|
synthesizeModel: z.ZodOptional<z.ZodString>;
|
|
2840
2848
|
maxAudioBytes: z.ZodDefault<z.ZodNumber>;
|
|
@@ -2845,7 +2853,8 @@ type AudioConfig = z.infer<typeof AudioConfigSchema>;
|
|
|
2845
2853
|
/**
|
|
2846
2854
|
* 已解析的语音模型配置
|
|
2847
2855
|
*
|
|
2848
|
-
* 由 `resolveAudioModel()`
|
|
2856
|
+
* 由 `resolveAudioModel()` 返回,凭据已按模型条目、显式 LLM 继承、平台环境变量的顺序解析,
|
|
2857
|
+
* 端点已应用平台默认值。
|
|
2849
2858
|
*/
|
|
2850
2859
|
interface ResolvedAudioModel {
|
|
2851
2860
|
/** 模型条目 ID */
|
|
@@ -2854,7 +2863,7 @@ interface ResolvedAudioModel {
|
|
|
2854
2863
|
provider: AudioProviderName;
|
|
2855
2864
|
/** 厂商模型名 */
|
|
2856
2865
|
model: string;
|
|
2857
|
-
/** API Key
|
|
2866
|
+
/** API Key(模型条目 > 显式启用的 LLM 密钥继承 > 平台环境变量) */
|
|
2858
2867
|
apiKey: string | undefined;
|
|
2859
2868
|
/** 端点(条目 > 平台默认) */
|
|
2860
2869
|
baseUrl: string;
|
|
@@ -2877,9 +2886,85 @@ interface ResolvedAudioModel {
|
|
|
2877
2886
|
* @param audioConfig - Audio 配置
|
|
2878
2887
|
* @param operation - 操作类型(识别 / 合成),决定使用哪个默认模型
|
|
2879
2888
|
* @param explicit - 请求显式指定的模型 ID(最高优先级)
|
|
2889
|
+
* @param llmApiKey - LLM 全局密钥,仅在 `inheritLlmApiKey` 启用时参与解析
|
|
2880
2890
|
* @returns 成功返回已解析模型;无匹配模型返回 `AUDIO_MODEL_NOT_FOUND`;缺少凭据返回 `CONFIGURATION_ERROR`
|
|
2881
2891
|
*/
|
|
2882
|
-
declare function resolveAudioModel(audioConfig: AudioConfig, operation: 'transcribe' | 'synthesize', explicit?: string): HaiResult<ResolvedAudioModel>;
|
|
2892
|
+
declare function resolveAudioModel(audioConfig: AudioConfig, operation: 'transcribe' | 'synthesize', explicit?: string, llmApiKey?: string): HaiResult<ResolvedAudioModel>;
|
|
2893
|
+
/**
|
|
2894
|
+
* 文生图平台枚举
|
|
2895
|
+
*
|
|
2896
|
+
* - `openai` — OpenAI GPT Image(Image API)
|
|
2897
|
+
* - `google` — Google Gemini Image / Nano Banana(Generate Content API)
|
|
2898
|
+
* - `qwen` — 阿里云百炼 Qwen-Image 2.0 / 3.0
|
|
2899
|
+
* - `seedream` — 火山方舟 Seedream 4.x / 5.x
|
|
2900
|
+
* - `pollinations` — Pollinations 免费额度图片 API
|
|
2901
|
+
*/
|
|
2902
|
+
declare const ImageProviderSchema: z.ZodEnum<{
|
|
2903
|
+
openai: "openai";
|
|
2904
|
+
qwen: "qwen";
|
|
2905
|
+
google: "google";
|
|
2906
|
+
seedream: "seedream";
|
|
2907
|
+
pollinations: "pollinations";
|
|
2908
|
+
}>;
|
|
2909
|
+
/** 文生图平台类型 */
|
|
2910
|
+
type ImageProviderName = z.infer<typeof ImageProviderSchema>;
|
|
2911
|
+
/** 文生图模型条目 Schema */
|
|
2912
|
+
declare const ImageModelEntrySchema: z.ZodObject<{
|
|
2913
|
+
id: z.ZodString;
|
|
2914
|
+
provider: z.ZodEnum<{
|
|
2915
|
+
openai: "openai";
|
|
2916
|
+
qwen: "qwen";
|
|
2917
|
+
google: "google";
|
|
2918
|
+
seedream: "seedream";
|
|
2919
|
+
pollinations: "pollinations";
|
|
2920
|
+
}>;
|
|
2921
|
+
model: z.ZodString;
|
|
2922
|
+
apiKey: z.ZodOptional<z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string | undefined, string | null>>>;
|
|
2923
|
+
baseUrl: z.ZodOptional<z.ZodURL>;
|
|
2924
|
+
workspaceId: z.ZodOptional<z.ZodString>;
|
|
2925
|
+
timeout: z.ZodDefault<z.ZodNumber>;
|
|
2926
|
+
}, z.core.$strip>;
|
|
2927
|
+
/** 文生图模型条目类型 */
|
|
2928
|
+
type ImageModelEntry = z.infer<typeof ImageModelEntrySchema>;
|
|
2929
|
+
/** 文生图配置 Schema */
|
|
2930
|
+
declare const ImageConfigSchema: z.ZodObject<{
|
|
2931
|
+
models: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2932
|
+
id: z.ZodString;
|
|
2933
|
+
provider: z.ZodEnum<{
|
|
2934
|
+
openai: "openai";
|
|
2935
|
+
qwen: "qwen";
|
|
2936
|
+
google: "google";
|
|
2937
|
+
seedream: "seedream";
|
|
2938
|
+
pollinations: "pollinations";
|
|
2939
|
+
}>;
|
|
2940
|
+
model: z.ZodString;
|
|
2941
|
+
apiKey: z.ZodOptional<z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string | undefined, string | null>>>;
|
|
2942
|
+
baseUrl: z.ZodOptional<z.ZodURL>;
|
|
2943
|
+
workspaceId: z.ZodOptional<z.ZodString>;
|
|
2944
|
+
timeout: z.ZodDefault<z.ZodNumber>;
|
|
2945
|
+
}, z.core.$strip>>>;
|
|
2946
|
+
generateModel: z.ZodOptional<z.ZodString>;
|
|
2947
|
+
}, z.core.$strip>;
|
|
2948
|
+
/** 文生图配置类型 */
|
|
2949
|
+
type ImageConfig = z.infer<typeof ImageConfigSchema>;
|
|
2950
|
+
/** 已解析的文生图模型 */
|
|
2951
|
+
interface ResolvedImageModel {
|
|
2952
|
+
id: string;
|
|
2953
|
+
provider: ImageProviderName;
|
|
2954
|
+
model: string;
|
|
2955
|
+
apiKey: string;
|
|
2956
|
+
baseUrl: string;
|
|
2957
|
+
workspaceId?: string;
|
|
2958
|
+
timeout: number;
|
|
2959
|
+
}
|
|
2960
|
+
/**
|
|
2961
|
+
* 解析文生图模型配置
|
|
2962
|
+
*
|
|
2963
|
+
* @param imageConfig - 文生图配置
|
|
2964
|
+
* @param explicit - 请求显式模型 ID 或厂商模型名
|
|
2965
|
+
* @returns 已解析模型;模型或凭据缺失时返回 HaiResult 错误
|
|
2966
|
+
*/
|
|
2967
|
+
declare function resolveImageModel(imageConfig: ImageConfig, explicit?: string): HaiResult<ResolvedImageModel>;
|
|
2883
2968
|
/**
|
|
2884
2969
|
* AI 配置 Schema
|
|
2885
2970
|
*
|
|
@@ -2925,7 +3010,7 @@ declare function resolveAudioModel(audioConfig: AudioConfig, operation: 'transcr
|
|
|
2925
3010
|
*/
|
|
2926
3011
|
declare const AIConfigSchema: z.ZodObject<{
|
|
2927
3012
|
llm: z.ZodDefault<z.ZodObject<{
|
|
2928
|
-
apiKey: z.ZodOptional<z.ZodString
|
|
3013
|
+
apiKey: z.ZodOptional<z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string | undefined, string | null>>>;
|
|
2929
3014
|
baseUrl: z.ZodOptional<z.ZodURL>;
|
|
2930
3015
|
model: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
2931
3016
|
api: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
@@ -2945,7 +3030,7 @@ declare const AIConfigSchema: z.ZodObject<{
|
|
|
2945
3030
|
responses: "responses";
|
|
2946
3031
|
anthropic: "anthropic";
|
|
2947
3032
|
}>>;
|
|
2948
|
-
apiKey: z.ZodOptional<z.ZodString
|
|
3033
|
+
apiKey: z.ZodOptional<z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string | undefined, string | null>>>;
|
|
2949
3034
|
baseUrl: z.ZodOptional<z.ZodURL>;
|
|
2950
3035
|
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
2951
3036
|
temperature: z.ZodOptional<z.ZodNumber>;
|
|
@@ -3093,19 +3178,38 @@ declare const AIConfigSchema: z.ZodObject<{
|
|
|
3093
3178
|
}>;
|
|
3094
3179
|
model: z.ZodString;
|
|
3095
3180
|
operations: z.ZodUnion<readonly [z.ZodTuple<[z.ZodLiteral<"transcribe">], null>, z.ZodTuple<[z.ZodLiteral<"synthesize">], null>, z.ZodTuple<[z.ZodLiteral<"transcribe">, z.ZodLiteral<"synthesize">], null>]>;
|
|
3096
|
-
apiKey: z.ZodOptional<z.ZodString
|
|
3181
|
+
apiKey: z.ZodOptional<z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string | undefined, string | null>>>;
|
|
3097
3182
|
baseUrl: z.ZodOptional<z.ZodString>;
|
|
3098
|
-
appKey: z.ZodOptional<z.ZodString
|
|
3099
|
-
accessKey: z.ZodOptional<z.ZodString
|
|
3183
|
+
appKey: z.ZodOptional<z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string | undefined, string | null>>>;
|
|
3184
|
+
accessKey: z.ZodOptional<z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string | undefined, string | null>>>;
|
|
3100
3185
|
resourceId: z.ZodOptional<z.ZodString>;
|
|
3101
3186
|
workspaceId: z.ZodOptional<z.ZodString>;
|
|
3102
3187
|
timeout: z.ZodOptional<z.ZodNumber>;
|
|
3103
3188
|
}, z.core.$strip>>>;
|
|
3189
|
+
inheritLlmApiKey: z.ZodDefault<z.ZodBoolean>;
|
|
3104
3190
|
transcribeModel: z.ZodOptional<z.ZodString>;
|
|
3105
3191
|
synthesizeModel: z.ZodOptional<z.ZodString>;
|
|
3106
3192
|
maxAudioBytes: z.ZodDefault<z.ZodNumber>;
|
|
3107
3193
|
maxStreamDurationMs: z.ZodDefault<z.ZodNumber>;
|
|
3108
3194
|
}, z.core.$strip>>;
|
|
3195
|
+
image: z.ZodOptional<z.ZodObject<{
|
|
3196
|
+
models: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
3197
|
+
id: z.ZodString;
|
|
3198
|
+
provider: z.ZodEnum<{
|
|
3199
|
+
openai: "openai";
|
|
3200
|
+
qwen: "qwen";
|
|
3201
|
+
google: "google";
|
|
3202
|
+
seedream: "seedream";
|
|
3203
|
+
pollinations: "pollinations";
|
|
3204
|
+
}>;
|
|
3205
|
+
model: z.ZodString;
|
|
3206
|
+
apiKey: z.ZodOptional<z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string | undefined, string | null>>>;
|
|
3207
|
+
baseUrl: z.ZodOptional<z.ZodURL>;
|
|
3208
|
+
workspaceId: z.ZodOptional<z.ZodString>;
|
|
3209
|
+
timeout: z.ZodDefault<z.ZodNumber>;
|
|
3210
|
+
}, z.core.$strip>>>;
|
|
3211
|
+
generateModel: z.ZodOptional<z.ZodString>;
|
|
3212
|
+
}, z.core.$strip>>;
|
|
3109
3213
|
}, z.core.$strip>;
|
|
3110
3214
|
/** AI 配置类型(校验后的完整类型) */
|
|
3111
3215
|
type AIConfig = z.infer<typeof AIConfigSchema>;
|
|
@@ -3643,4 +3747,4 @@ interface ReasoningOperations {
|
|
|
3643
3747
|
runStream: (query: string, options?: ReasoningOptions) => AsyncIterable<ReasoningStreamEvent>;
|
|
3644
3748
|
}
|
|
3645
3749
|
|
|
3646
|
-
export { type
|
|
3750
|
+
export { type ResolveRequiredModelEntryOptions as $, type A2AConfig as A, ImageModelEntrySchema as B, type CompressConfig as C, type ImageProviderName as D, type EmbeddingConfig as E, type FileConfig as F, ImageProviderSchema as G, KnowledgeConfigSchema as H, type ImageConfig as I, LLMConfigSchema as J, type KnowledgeConfig as K, type LLMConfig as L, type MCPConfig as M, MCPConfigSchema as N, type MCPServerCapabilities as O, MCPServerCapabilitiesSchema as P, type MCPServerConfig as Q, MCPServerConfigSchema as R, type MemoryConfig as S, MemoryConfigSchema as T, type MemoryType as U, MemoryTypeSchema as V, type ModelEntry as W, ModelEntrySchema as X, type ModelScenario as Y, ModelScenarioSchema as Z, OptionalSecretSchema as _, A2AConfigSchema as a, type KnowledgeAskResult as a$, type ResolvedAudioModel as a0, type ResolvedImageModel as a1, type ResolvedModelConfig as a2, type RetrievalConfig as a3, RetrievalConfigSchema as a4, type RetrievalSourceConfig as a5, RetrievalSourceSchema as a6, type SummaryConfig as a7, SummaryConfigSchema as a8, type SynthesisEvent as a9, type A2ATaskFilter as aA, type AILLMFunctionsDeps as aB, type AIRelStore as aC, type AIRelStoreOptions as aD, type AIStoreProvider as aE, type AIVectorBackend as aF, type AIVectorStore as aG, type AskOptions as aH, type AssistantMessage as aI, type ChatCompletionChoice as aJ, type ChatCompletionChunk as aK, type ChatCompletionDelta as aL, type ChatCompletionRequest as aM, type ChatCompletionResponse as aN, type ChatHistoryOptions as aO, type ChatMessage as aP, type ChatRecord as aQ, type Citation as aR, type DefineToolOptions as aS, type DeveloperMessage as aT, type EntityDocumentRelation as aU, type EntityDocumentResult as aV, type EntityListOptions as aW, type EntityQueryOptions as aX, type GenerateObjectRequest as aY, type ImageContent as aZ, type KnowledgeAskOptions as a_, type SynthesisRequest as aa, type SynthesisResult as ab, type SynthesisStreamRequest as ac, type SynthesisTextSegment as ad, type TokenConfig as ae, TokenConfigSchema as af, type TranscriptionEvent as ag, type TranscriptionRequest as ah, type TranscriptionResult as ai, type TranscriptionStreamRequest as aj, resolveAudioModel as ak, resolveImageModel as al, resolveModelApi as am, resolveModelEntry as an, type InteractionScope as ao, type A2AAgentCardConfig as ap, type A2AApiKeySecurity as aq, type A2AAuthenticator as ar, type A2ACallOptions as as, type A2ACallResult as at, type A2ACallerIdentity as au, type A2AContextInfo as av, type A2AHandleResult as aw, type A2AMessageRecord as ax, type A2AOperations as ay, type A2ASecurityConfig as az, A2ASkillConfigSchema as b, type TempModelConfig as b$, type KnowledgeDocumentInfo as b0, type KnowledgeDocumentListOptions as b1, type KnowledgeDocumentRemoveOptions as b2, type KnowledgeEntity as b3, type KnowledgeIngestBatchProgress as b4, type KnowledgeIngestBatchResult as b5, type KnowledgeIngestFileInput as b6, type KnowledgeIngestInput as b7, type KnowledgeIngestResult as b8, type KnowledgeOperations as b9, type RagOptions as bA, type RagResult as bB, type RagStreamEvent as bC, type ReasoningOperations as bD, type ReasoningOptions as bE, type ReasoningResult as bF, type ReasoningStep as bG, type ReasoningStepType as bH, type ReasoningStrategy as bI, type ReasoningStreamEvent as bJ, type RetrievalOperations as bK, type RetrievalRequest as bL, type RetrievalResult as bM, type RetrievalResultItem as bN, type RetrievalSource as bO, type SSEDecoder as bP, type SSEEvent as bQ, type ScopedMemoryBinding as bR, type ScopedMemoryOperations as bS, type SessionInfo as bT, type StoreFilter as bU, type StorePage as bV, type StoreScope as bW, type StreamOperations as bX, type StreamProcessor as bY, type StreamResult as bZ, type SystemMessage as b_, type KnowledgeRetrieveItem as ba, type KnowledgeRetrieveOptions as bb, type KnowledgeRetrieveResult as bc, type KnowledgeSetupOptions as bd, type KnowledgeStore as be, type LLMOperations as bf, type LLMProvider as bg, type MemoryAccessScope as bh, type MemoryAdminOperations as bi, type MemoryClearAllOptions as bj, type MemoryClearOptions as bk, type MemoryCoreOperations as bl, type MemoryEntry as bm, type MemoryEntryInput as bn, type MemoryExtractOptions as bo, type MemoryInjectionOptions as bp, type MemoryListOptions as bq, type MemoryListPageOptions as br, type MemoryOperations as bs, type MemoryRecallOptions as bt, type MemoryUpdateInput as bu, type MessageContent as bv, type MessageRole as bw, type ObjectRef as bx, type RagContextItem as by, type RagOperations as bz, type AIConfig as c, type TextContent as c0, type TokenUsage as c1, type Tool as c2, type ToolAuthorizationRequest as c3, type ToolAuthorizer as c4, type ToolCall as c5, type ToolDefinition as c6, type ToolErrorType as c7, type ToolExecutionContext as c8, type ToolExecutionOptions as c9, type ToolMessage as ca, type ToolRegistryOperations as cb, type ToolRegistryOptions as cc, type ToolsOperations as cd, type UserMessage as ce, type WhereClause as cf, type WhereOperator as cg, type WhereValue as ch, type AIConfigInput as d, AIConfigSchema as e, type ApiType as f, ApiTypeSchema as g, type AudioCapabilitiesRequest as h, type AudioConfig as i, AudioConfigSchema as j, type AudioContent as k, type AudioFormat as l, type AudioInputStream as m, type AudioModelCapabilities as n, type AudioModelEntry as o, AudioModelEntrySchema as p, type AudioOperations as q, type AudioProviderName as r, AudioProviderSchema as s, CompressConfigSchema as t, EmbeddingConfigSchema as u, type EntityType as v, EntityTypeSchema as w, FileConfigSchema as x, ImageConfigSchema as y, type ImageModelEntry as z };
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { A as A2AConfig, a as A2AConfigSchema, b as A2ASkillConfigSchema, c as AIConfig, d as AIConfigInput, e as AIConfigSchema, f as ApiType, g as ApiTypeSchema, h as AudioCapabilitiesRequest, i as AudioConfig, j as AudioConfigSchema, k as AudioContent, l as AudioFormat, m as AudioInputStream, n as AudioModelCapabilities, o as AudioModelEntry, p as AudioModelEntrySchema, q as AudioOperations, r as AudioProviderName, s as AudioProviderSchema, C as CompressConfig, t as CompressConfigSchema, E as EmbeddingConfig, u as EmbeddingConfigSchema, v as EntityType, w as EntityTypeSchema, F as FileConfig, x as FileConfigSchema, K as KnowledgeConfig,
|
|
2
|
-
export { A as AIFunctions, a as AIInitOptions, b as AUDIO_WS_PATH, c as AudioFormatSchema, d as AudioWsClientMessage, e as AudioWsClientMessageSchema, f as AudioWsDoneMessage, g as AudioWsDoneMessageSchema, h as AudioWsEndMessage, i as AudioWsErrorMessage, j as AudioWsSegmentDoneMessage, k as AudioWsSegmentStartedMessage, l as AudioWsServerMessage, m as AudioWsSpeechMessage, n as AudioWsStartMessage, o as AudioWsStartMessageSchema, p as AudioWsTextMessage, q as AudioWsTextMessageSchema, r as AudioWsTranscriptMessage, C as CompressionStrategy, s as CompressionStrategySchema, H as HaiAIError } from './ai-audio-ws-protocol-
|
|
1
|
+
export { A as A2AConfig, a as A2AConfigSchema, b as A2ASkillConfigSchema, c as AIConfig, d as AIConfigInput, e as AIConfigSchema, f as ApiType, g as ApiTypeSchema, h as AudioCapabilitiesRequest, i as AudioConfig, j as AudioConfigSchema, k as AudioContent, l as AudioFormat, m as AudioInputStream, n as AudioModelCapabilities, o as AudioModelEntry, p as AudioModelEntrySchema, q as AudioOperations, r as AudioProviderName, s as AudioProviderSchema, C as CompressConfig, t as CompressConfigSchema, E as EmbeddingConfig, u as EmbeddingConfigSchema, v as EntityType, w as EntityTypeSchema, F as FileConfig, x as FileConfigSchema, I as ImageConfig, y as ImageConfigSchema, z as ImageModelEntry, B as ImageModelEntrySchema, D as ImageProviderName, G as ImageProviderSchema, K as KnowledgeConfig, H as KnowledgeConfigSchema, L as LLMConfig, J as LLMConfigSchema, M as MCPConfig, N as MCPConfigSchema, O as MCPServerCapabilities, P as MCPServerCapabilitiesSchema, Q as MCPServerConfig, R as MCPServerConfigSchema, S as MemoryConfig, T as MemoryConfigSchema, U as MemoryType, V as MemoryTypeSchema, W as ModelEntry, X as ModelEntrySchema, Y as ModelScenario, Z as ModelScenarioSchema, _ as OptionalSecretSchema, $ as ResolveRequiredModelEntryOptions, a0 as ResolvedAudioModel, a1 as ResolvedImageModel, a2 as ResolvedModelConfig, a3 as RetrievalConfig, a4 as RetrievalConfigSchema, a5 as RetrievalSourceConfig, a6 as RetrievalSourceSchema, a7 as SummaryConfig, a8 as SummaryConfigSchema, a9 as SynthesisEvent, aa as SynthesisRequest, ab as SynthesisResult, ac as SynthesisStreamRequest, ad as SynthesisTextSegment, ae as TokenConfig, af as TokenConfigSchema, ag as TranscriptionEvent, ah as TranscriptionRequest, ai as TranscriptionResult, aj as TranscriptionStreamRequest, ak as resolveAudioModel, al as resolveImageModel, am as resolveModelApi, an as resolveModelEntry } from './ai-reasoning-types-DsVJ4CE8.js';
|
|
2
|
+
export { A as AIFunctions, a as AIInitOptions, b as AUDIO_WS_PATH, c as AudioFormatSchema, d as AudioWsClientMessage, e as AudioWsClientMessageSchema, f as AudioWsDoneMessage, g as AudioWsDoneMessageSchema, h as AudioWsEndMessage, i as AudioWsErrorMessage, j as AudioWsSegmentDoneMessage, k as AudioWsSegmentStartedMessage, l as AudioWsServerMessage, m as AudioWsSpeechMessage, n as AudioWsStartMessage, o as AudioWsStartMessageSchema, p as AudioWsTextMessage, q as AudioWsTextMessageSchema, r as AudioWsTranscriptMessage, C as CompressionStrategy, s as CompressionStrategySchema, G as GenerateImageRequest, t as GenerateImageResult, u as GeneratedImage, H as HaiAIError, I as ImageOperations, v as ImageSize, R as ReferenceImage } from './ai-audio-ws-protocol-CUIXMEkt.js';
|
|
3
3
|
export { A2AClientOperations, AIApiAdapter, AIClient, AIClientConfig, AudioClientConfig, AudioClientOperations, AudioTicketRequest, StreamOptions, StreamProgress, collectStreamContent, createA2AClient, createAIClient, createAudioClient, createUnconfiguredAudioClient, parseSSE } from './client/index.js';
|
|
4
4
|
import '@a2a-js/sdk/server';
|
|
5
5
|
import '@h-ai/core';
|
package/dist/browser.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { A2AConfigSchema, A2ASkillConfigSchema, AIConfigSchema, AUDIO_WS_PATH, ApiTypeSchema, AudioConfigSchema, AudioFormatSchema, AudioModelEntrySchema, AudioProviderSchema, AudioWsClientMessageSchema, AudioWsDoneMessageSchema, AudioWsStartMessageSchema, AudioWsTextMessageSchema, CompressConfigSchema, CompressionStrategySchema, EmbeddingConfigSchema, EntityTypeSchema, FileConfigSchema, KnowledgeConfigSchema, LLMConfigSchema, MCPConfigSchema, MCPServerCapabilitiesSchema, MCPServerConfigSchema, MemoryConfigSchema, MemoryTypeSchema, ModelEntrySchema, ModelScenarioSchema, RetrievalConfigSchema, RetrievalSourceSchema, SummaryConfigSchema, TokenConfigSchema, resolveAudioModel, resolveModelApi, resolveModelEntry } from './chunk-
|
|
2
|
-
export { collectStreamContent, createA2AClient, createAIClient, createAudioClient, createUnconfiguredAudioClient, parseSSE } from './chunk-
|
|
3
|
-
export { HaiAIError } from './chunk-
|
|
1
|
+
export { A2AConfigSchema, A2ASkillConfigSchema, AIConfigSchema, AUDIO_WS_PATH, ApiTypeSchema, AudioConfigSchema, AudioFormatSchema, AudioModelEntrySchema, AudioProviderSchema, AudioWsClientMessageSchema, AudioWsDoneMessageSchema, AudioWsStartMessageSchema, AudioWsTextMessageSchema, CompressConfigSchema, CompressionStrategySchema, EmbeddingConfigSchema, EntityTypeSchema, FileConfigSchema, ImageConfigSchema, ImageModelEntrySchema, ImageProviderSchema, KnowledgeConfigSchema, LLMConfigSchema, MCPConfigSchema, MCPServerCapabilitiesSchema, MCPServerConfigSchema, MemoryConfigSchema, MemoryTypeSchema, ModelEntrySchema, ModelScenarioSchema, OptionalSecretSchema, RetrievalConfigSchema, RetrievalSourceSchema, SummaryConfigSchema, TokenConfigSchema, resolveAudioModel, resolveImageModel, resolveModelApi, resolveModelEntry } from './chunk-E3W2H6FL.js';
|
|
2
|
+
export { collectStreamContent, createA2AClient, createAIClient, createAudioClient, createUnconfiguredAudioClient, parseSSE } from './chunk-6RWS5OWJ.js';
|
|
3
|
+
export { HaiAIError } from './chunk-JC7QBT3C.js';
|
|
4
4
|
//# sourceMappingURL=browser.js.map
|
|
5
5
|
//# sourceMappingURL=browser.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HaiAIError } from './chunk-
|
|
1
|
+
import { HaiAIError } from './chunk-JC7QBT3C.js';
|
|
2
2
|
|
|
3
3
|
// src/client/ai-a2a-client.ts
|
|
4
4
|
var A2A_PATH = {
|
|
@@ -574,5 +574,5 @@ async function collectStreamContent(stream) {
|
|
|
574
574
|
}
|
|
575
575
|
|
|
576
576
|
export { collectStreamContent, createA2AClient, createAIClient, createAudioClient, createUnconfiguredAudioClient, parseSSE };
|
|
577
|
-
//# sourceMappingURL=chunk-
|
|
578
|
-
//# sourceMappingURL=chunk-
|
|
577
|
+
//# sourceMappingURL=chunk-6RWS5OWJ.js.map
|
|
578
|
+
//# sourceMappingURL=chunk-6RWS5OWJ.js.map
|