seacloud-sdk 0.10.2 → 0.10.3

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.
Files changed (2) hide show
  1. package/README.md +51 -51
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,38 +1,38 @@
1
1
  # SeaCloud SDK
2
2
 
3
- SeaCloud SDK for JavaScript/TypeScript - 用于调用 SeaCloud AI 服务的官方 SDK。
3
+ Official SeaCloud SDK for JavaScript/TypeScript - Call SeaCloud AI services with ease.
4
4
 
5
- ## 功能特性
5
+ ## Features
6
6
 
7
- - 🤖 **Agent Chat API** - 多轮对话、工具调用、流式输出
8
- - 🎨 **图像生成** - 支持多种 AI 图像生成模型
9
- - 🎬 **视频生成** - Text-to-VideoImage-to-Video
10
- - 🎵 **音乐生成** - 歌曲、歌词生成
11
- - 🔄 **流式响应** - 实时获取 AI 响应
12
- - 📦 **TypeScript 支持** - 完整的类型定义
7
+ - 🤖 **Agent Chat API** - Multi-turn conversations, tool calling, streaming output
8
+ - 🎨 **Image Generation** - Support for multiple AI image generation models
9
+ - 🎬 **Video Generation** - Text-to-Video, Image-to-Video
10
+ - 🎵 **Music Generation** - Song and lyrics generation
11
+ - 🔄 **Streaming Response** - Real-time AI responses
12
+ - 📦 **TypeScript Support** - Complete type definitions
13
13
 
14
- ## 安装
14
+ ## Installation
15
15
 
16
16
  ```bash
17
17
  pnpm install seacloud-sdk
18
18
  ```
19
19
 
20
- ## 快速开始
20
+ ## Quick Start
21
21
 
22
- ### 初始化 SDK
22
+ ### Initialize SDK
23
23
 
24
24
  ```typescript
25
25
  import { initSeacloud, agentChatCompletions, createTextMessage } from 'seacloud-sdk';
26
26
 
27
- // 初始化 SDK
27
+ // Initialize SDK
28
28
  initSeacloud({
29
29
  apiKey: 'your-api-key',
30
30
  baseUrl: 'https://proxy-rs.seaverse.ai',
31
- xProject: 'SeaArt', // 可选,默认为 'SeaVerse'
31
+ xProject: 'SeaArt', // Optional, defaults to 'SeaVerse'
32
32
  });
33
33
  ```
34
34
 
35
- ### 简单对话
35
+ ### Simple Chat
36
36
 
37
37
  ```typescript
38
38
  const response = await agentChatCompletions({
@@ -46,7 +46,7 @@ const response = await agentChatCompletions({
46
46
  console.log(response.choices[0].message.content);
47
47
  ```
48
48
 
49
- ### 流式对话
49
+ ### Streaming Chat
50
50
 
51
51
  ```typescript
52
52
  const stream = await agentChatCompletions({
@@ -66,102 +66,102 @@ for await (const chunk of stream) {
66
66
  }
67
67
  ```
68
68
 
69
- ## 配置选项
69
+ ## Configuration Options
70
70
 
71
71
  ### initSeacloud(options)
72
72
 
73
- | 参数 | 类型 | 默认值 | 描述 |
74
- |------|------|--------|------|
75
- | `apiKey` | `string` | - | API 密钥,也可通过环境变量 `API_SERVICE_TOKEN` 设置 |
76
- | `baseUrl` | `string` | `https://proxy-rs.seaverse.ai` | API 服务器地址 |
77
- | `timeout` | `number` | `30000` | 请求超时时间(毫秒) |
78
- | `intervalMs` | `number` | `3000` | 轮询间隔(毫秒) |
79
- | `maxAttempts` | `number` | `100` | 最大轮询次数 |
80
- | `xProject` | `string` | `'SeaVerse'` | X-Project header 值,用于项目标识 |
73
+ | Parameter | Type | Default | Description |
74
+ |-----------|------|---------|-------------|
75
+ | `apiKey` | `string` | - | API key, can also be set via `API_SERVICE_TOKEN` environment variable |
76
+ | `baseUrl` | `string` | `https://proxy-rs.seaverse.ai` | API server URL |
77
+ | `timeout` | `number` | `30000` | Request timeout in milliseconds |
78
+ | `intervalMs` | `number` | `3000` | Polling interval in milliseconds |
79
+ | `maxAttempts` | `number` | `100` | Maximum polling attempts |
80
+ | `xProject` | `string` | `'SeaVerse'` | X-Project header value for project identification |
81
81
 
82
- ### xProject 参数说明
82
+ ### xProject Parameter
83
83
 
84
- `xProject` 参数用于设置请求头 `X-Project`,标识请求来源的项目。不同项目可能有不同的配额和权限:
84
+ The `xProject` parameter sets the `X-Project` request header to identify the source project. Different projects may have different quotas and permissions:
85
85
 
86
86
  ```typescript
87
- // SeaArt 项目
87
+ // SeaArt project
88
88
  initSeacloud({
89
89
  apiKey: 'your-api-key',
90
90
  xProject: 'SeaArt',
91
91
  });
92
92
 
93
- // KIIRA 项目
93
+ // KIIRA project
94
94
  initSeacloud({
95
95
  apiKey: 'your-api-key',
96
96
  xProject: 'KIIRA',
97
97
  });
98
98
 
99
- // 默认使用 SeaVerse
99
+ // Default: SeaVerse
100
100
  initSeacloud({
101
101
  apiKey: 'your-api-key',
102
- // xProject 默认为 'SeaVerse'
102
+ // xProject defaults to 'SeaVerse'
103
103
  });
104
104
  ```
105
105
 
106
- ## Token 获取优先级
106
+ ## Token Priority
107
107
 
108
- SDK 会按以下优先级获取 API Token:
108
+ The SDK retrieves API tokens in the following priority order:
109
109
 
110
- 1. `initSeacloud({ apiKey: '...' })` 传入的 apiKey
111
- 2. 浏览器环境:`localStorage.getItem('auth_token')`
112
- 3. Node.js 环境:`process.env.API_SERVICE_TOKEN`
110
+ 1. `apiKey` passed to `initSeacloud({ apiKey: '...' })`
111
+ 2. Browser environment: `localStorage.getItem('auth_token')`
112
+ 3. Node.js environment: `process.env.API_SERVICE_TOKEN`
113
113
 
114
- ## 环境变量
114
+ ## Environment Variables
115
115
 
116
- | 变量名 | 描述 |
117
- |--------|------|
118
- | `API_SERVICE_TOKEN` | API 密钥 |
119
- | `SEACLOUD_BASE_URL` | API 服务器地址 |
116
+ | Variable | Description |
117
+ |----------|-------------|
118
+ | `API_SERVICE_TOKEN` | API key |
119
+ | `SEACLOUD_BASE_URL` | API server URL |
120
120
 
121
- ## API 参考
121
+ ## API Reference
122
122
 
123
123
  ### Agent Chat API
124
124
 
125
125
  ```typescript
126
126
  import { agentChatCompletions, createTextMessage, createImageMessage, createTool } from 'seacloud-sdk';
127
127
 
128
- // 文本消息
128
+ // Text message
129
129
  const textMessage = createTextMessage('user', 'Hello!');
130
130
 
131
- // 图片消息
131
+ // Image message
132
132
  const imageMessage = createImageMessage('user', 'What is this?', 'https://example.com/image.jpg');
133
133
 
134
- // 创建工具
134
+ // Create tool
135
135
  const tool = createTool('seagen_text2image_flux1d_artifact_tool');
136
136
  ```
137
137
 
138
- ### 可用工具列表
138
+ ### Available Tools
139
139
 
140
- **图像生成:**
140
+ **Image Generation:**
141
141
  - `seagen_text2image_flux1d_artifact_tool`
142
142
  - `seagen_text2image_seedream40_artifact_tool`
143
143
  - `seagen_text2image_google_gemini3_pro_image_artifact_tool`
144
144
  - `seagen_blackforestlabs_flux_2_pro_tool`
145
145
  - `mm_volces_seedream_4_5_gateway_tool`
146
146
 
147
- **图像编辑:**
147
+ **Image Editing:**
148
148
  - `seagen_edit_image_google_artifact_tool`
149
149
  - `seagen_blackforestlabs_flux_2_pro_edit_tool`
150
150
 
151
- **视频生成:**
151
+ **Video Generation:**
152
152
  - `seagen_image2video_wanx26_artifact_tool`
153
153
  - `seagen_text2video_wanx26_artifact_tool`
154
154
  - `seagen_image2video_seedance_pro_fast_artifact_tool`
155
155
  - `mm_text2video_kling_v2_6_gateway_tool`
156
156
  - `mm_image2video_kling_v2_6_i2v_gateway_tool`
157
157
 
158
- **音乐生成:**
158
+ **Music Generation:**
159
159
  - `seagen_text2song_mureka_artifact_tool`
160
160
  - `seagen_text2lyrics_mureka_artifact_tool`
161
161
 
162
- ## 示例
162
+ ## Examples
163
163
 
164
- 更多示例请查看 [examples_agent.ts](./examples_agent.ts)
164
+ For more examples, see [examples_agent.ts](./examples_agent.ts)
165
165
 
166
166
  ## License
167
167
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "seacloud-sdk",
3
- "version": "0.10.2",
3
+ "version": "0.10.3",
4
4
  "description": "SeaCloud SDK for JavaScript/TypeScript",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",