@openloaf-saas/sdk 0.1.34 → 0.1.35
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/dist/index.d.ts +45 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -741,11 +741,13 @@ declare class SaaSContract {
|
|
|
741
741
|
variant: string;
|
|
742
742
|
inputs?: Record<string, unknown> | undefined;
|
|
743
743
|
params?: Record<string, unknown> | undefined;
|
|
744
|
+
stream?: boolean | undefined;
|
|
744
745
|
}, {
|
|
745
746
|
success: true;
|
|
746
747
|
data: {
|
|
747
748
|
text: string;
|
|
748
749
|
creditsConsumed?: number | undefined;
|
|
750
|
+
taskId?: string | undefined;
|
|
749
751
|
};
|
|
750
752
|
}>;
|
|
751
753
|
readonly v3Generate: Endpoint<{
|
|
@@ -2020,17 +2022,19 @@ declare const aiEndpoints: {
|
|
|
2020
2022
|
updatedAt?: string | undefined;
|
|
2021
2023
|
};
|
|
2022
2024
|
}>;
|
|
2023
|
-
/** Submit a v3 text generate request (sync
|
|
2025
|
+
/** Submit a v3 text generate request (sync JSON or streaming SSE). */
|
|
2024
2026
|
readonly v3TextGenerate: Endpoint<{
|
|
2025
2027
|
feature: string;
|
|
2026
2028
|
variant: string;
|
|
2027
2029
|
inputs?: Record<string, unknown> | undefined;
|
|
2028
2030
|
params?: Record<string, unknown> | undefined;
|
|
2031
|
+
stream?: boolean | undefined;
|
|
2029
2032
|
}, {
|
|
2030
2033
|
success: true;
|
|
2031
2034
|
data: {
|
|
2032
2035
|
text: string;
|
|
2033
2036
|
creditsConsumed?: number | undefined;
|
|
2037
|
+
taskId?: string | undefined;
|
|
2034
2038
|
};
|
|
2035
2039
|
}>;
|
|
2036
2040
|
/** Submit a v3 generate request. */
|
|
@@ -3712,6 +3716,7 @@ declare const v3TextGenerateRequestSchema: z.ZodObject<{
|
|
|
3712
3716
|
variant: z.ZodString;
|
|
3713
3717
|
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
3714
3718
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
3719
|
+
stream: z.ZodOptional<z.ZodBoolean>;
|
|
3715
3720
|
}, z.core.$strip>;
|
|
3716
3721
|
/** v3 text generate response. */
|
|
3717
3722
|
declare const v3TextGenerateResponseSchema: z.ZodObject<{
|
|
@@ -3719,6 +3724,7 @@ declare const v3TextGenerateResponseSchema: z.ZodObject<{
|
|
|
3719
3724
|
data: z.ZodObject<{
|
|
3720
3725
|
text: z.ZodString;
|
|
3721
3726
|
creditsConsumed: z.ZodOptional<z.ZodNumber>;
|
|
3727
|
+
taskId: z.ZodOptional<z.ZodString>;
|
|
3722
3728
|
}, z.core.$strip>;
|
|
3723
3729
|
}, z.core.$strip>;
|
|
3724
3730
|
/** Individual task item within a v3 response. */
|
|
@@ -4651,8 +4657,15 @@ declare class AiClient {
|
|
|
4651
4657
|
updatedAt?: string | undefined;
|
|
4652
4658
|
};
|
|
4653
4659
|
}>;
|
|
4654
|
-
/** Submit a v3 text generate request (sync,
|
|
4660
|
+
/** Submit a v3 text generate request (sync mode, returns parsed JSON). */
|
|
4655
4661
|
v3TextGenerate(payload: V3TextGenerateRequest): Promise<V3TextGenerateResponse>;
|
|
4662
|
+
/**
|
|
4663
|
+
* Submit a v3 text generate request in streaming mode.
|
|
4664
|
+
* 返回原始 Response,调用方通过 response.body (ReadableStream) 消费 SSE 事件。
|
|
4665
|
+
* 每个 SSE event 的 data 字段是 OpenAI chat completions chunk 格式。
|
|
4666
|
+
* taskId 通过响应头 x-task-id 返回。
|
|
4667
|
+
*/
|
|
4668
|
+
v3TextGenerateStream(payload: Omit<V3TextGenerateRequest, "stream">): Promise<Response>;
|
|
4656
4669
|
/** Submit a v3 generate request (unified for all media types). */
|
|
4657
4670
|
v3Generate(payload: V3GenerateRequest): Promise<{
|
|
4658
4671
|
success: true;
|
|
@@ -5178,6 +5191,21 @@ declare const MEDIA_FEATURES: {
|
|
|
5178
5191
|
readonly ja: "画像内のテキストを認識";
|
|
5179
5192
|
};
|
|
5180
5193
|
};
|
|
5194
|
+
readonly audioRecognize: {
|
|
5195
|
+
readonly id: "audioRecognize";
|
|
5196
|
+
readonly label: {
|
|
5197
|
+
readonly zh: "音频识别";
|
|
5198
|
+
readonly "zh-TW": "音訊辨識";
|
|
5199
|
+
readonly en: "Audio Recognition";
|
|
5200
|
+
readonly ja: "音声認識";
|
|
5201
|
+
};
|
|
5202
|
+
readonly description: {
|
|
5203
|
+
readonly zh: "识别音频中的语音内容并转录为文字";
|
|
5204
|
+
readonly "zh-TW": "辨識音訊中的語音內容並轉錄為文字";
|
|
5205
|
+
readonly en: "Recognize speech in audio and transcribe to text";
|
|
5206
|
+
readonly ja: "音声の内容を認識してテキストに書き起こす";
|
|
5207
|
+
};
|
|
5208
|
+
};
|
|
5181
5209
|
readonly imageCaption: {
|
|
5182
5210
|
readonly id: "imageCaption";
|
|
5183
5211
|
readonly label: {
|
|
@@ -5193,6 +5221,21 @@ declare const MEDIA_FEATURES: {
|
|
|
5193
5221
|
readonly ja: "画像のテキスト説明を自動生成";
|
|
5194
5222
|
};
|
|
5195
5223
|
};
|
|
5224
|
+
readonly videoCaption: {
|
|
5225
|
+
readonly id: "videoCaption";
|
|
5226
|
+
readonly label: {
|
|
5227
|
+
readonly zh: "视频描述";
|
|
5228
|
+
readonly "zh-TW": "影片描述";
|
|
5229
|
+
readonly en: "Video Caption";
|
|
5230
|
+
readonly ja: "動画キャプション";
|
|
5231
|
+
};
|
|
5232
|
+
readonly description: {
|
|
5233
|
+
readonly zh: "自动生成视频的文字描述";
|
|
5234
|
+
readonly "zh-TW": "自動生成影片的文字描述";
|
|
5235
|
+
readonly en: "Automatically generate text descriptions for videos";
|
|
5236
|
+
readonly ja: "動画のテキスト説明を自動生成";
|
|
5237
|
+
};
|
|
5238
|
+
};
|
|
5196
5239
|
readonly musicGenerate: {
|
|
5197
5240
|
readonly id: "musicGenerate";
|
|
5198
5241
|
readonly label: {
|