@yushaw/sanqian-chat 0.2.18 → 0.2.20

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.
@@ -152,6 +152,16 @@ interface AppAgentConfig {
152
152
  name: string;
153
153
  /** Agent description */
154
154
  description?: string;
155
+ /** Localized display name: { zh: "...", en: "..." } */
156
+ display?: {
157
+ zh?: string;
158
+ en?: string;
159
+ };
160
+ /** Localized short description: { zh: "...", en: "..." } */
161
+ shortDesc?: {
162
+ zh?: string;
163
+ en?: string;
164
+ };
155
165
  /** System prompt */
156
166
  systemPrompt?: string;
157
167
  /**
@@ -189,6 +199,19 @@ interface AppEmbeddingConfig {
189
199
  /** Embedding dimensions */
190
200
  dimensions?: number;
191
201
  }
202
+ /**
203
+ * Rerank configuration from Sanqian
204
+ */
205
+ interface AppRerankConfig {
206
+ /** Whether rerank is available */
207
+ available: boolean;
208
+ /** Rerank API URL */
209
+ apiUrl?: string;
210
+ /** API key */
211
+ apiKey?: string;
212
+ /** Model name */
213
+ modelName?: string;
214
+ }
192
215
  /**
193
216
  * Events emitted by SanqianAppClient
194
217
  */
@@ -282,6 +305,11 @@ declare class SanqianAppClient {
282
305
  * @returns Embedding config or null if not available
283
306
  */
284
307
  getEmbeddingConfig(): Promise<AppEmbeddingConfig | null>;
308
+ /**
309
+ * Get rerank configuration from Sanqian
310
+ * @returns Rerank config or null if not available
311
+ */
312
+ getRerankConfig(): Promise<AppRerankConfig | null>;
285
313
  /**
286
314
  * Subscribe to client events
287
315
  */
@@ -1005,4 +1033,4 @@ declare class WindowAttachment {
1005
1033
  */
1006
1034
  declare function getPreloadPath(): string;
1007
1035
 
1008
- export { type AppAgentConfig, type AppClientEvent, type AppClientEventHandlers, type AppConfig, type AppContextData, type AppContextListItem, type AppContextProvider, type AppEmbeddingConfig, type AppJsonSchemaProperty, type AppResourceListOptions, type AppResourceListResult, type AppResourceType, type AppToolDefinition, type AttachConfig, type AttachPosition, type AttachState, ChatPanel, type ChatPanelConfig, type ChatPanelMode, type ChatPanelPosition, type ChatUiConfigSerializable, FloatingWindow, type FloatingWindowConfig, type FloatingWindowOptions, SanqianAppClient, WindowAttachment, type WindowPosition, getPreloadPath };
1036
+ export { type AppAgentConfig, type AppClientEvent, type AppClientEventHandlers, type AppConfig, type AppContextData, type AppContextListItem, type AppContextProvider, type AppEmbeddingConfig, type AppJsonSchemaProperty, type AppRerankConfig, type AppResourceListOptions, type AppResourceListResult, type AppResourceType, type AppToolDefinition, type AttachConfig, type AttachPosition, type AttachState, ChatPanel, type ChatPanelConfig, type ChatPanelMode, type ChatPanelPosition, type ChatUiConfigSerializable, FloatingWindow, type FloatingWindowConfig, type FloatingWindowOptions, SanqianAppClient, WindowAttachment, type WindowPosition, getPreloadPath };
@@ -152,6 +152,16 @@ interface AppAgentConfig {
152
152
  name: string;
153
153
  /** Agent description */
154
154
  description?: string;
155
+ /** Localized display name: { zh: "...", en: "..." } */
156
+ display?: {
157
+ zh?: string;
158
+ en?: string;
159
+ };
160
+ /** Localized short description: { zh: "...", en: "..." } */
161
+ shortDesc?: {
162
+ zh?: string;
163
+ en?: string;
164
+ };
155
165
  /** System prompt */
156
166
  systemPrompt?: string;
157
167
  /**
@@ -189,6 +199,19 @@ interface AppEmbeddingConfig {
189
199
  /** Embedding dimensions */
190
200
  dimensions?: number;
191
201
  }
202
+ /**
203
+ * Rerank configuration from Sanqian
204
+ */
205
+ interface AppRerankConfig {
206
+ /** Whether rerank is available */
207
+ available: boolean;
208
+ /** Rerank API URL */
209
+ apiUrl?: string;
210
+ /** API key */
211
+ apiKey?: string;
212
+ /** Model name */
213
+ modelName?: string;
214
+ }
192
215
  /**
193
216
  * Events emitted by SanqianAppClient
194
217
  */
@@ -282,6 +305,11 @@ declare class SanqianAppClient {
282
305
  * @returns Embedding config or null if not available
283
306
  */
284
307
  getEmbeddingConfig(): Promise<AppEmbeddingConfig | null>;
308
+ /**
309
+ * Get rerank configuration from Sanqian
310
+ * @returns Rerank config or null if not available
311
+ */
312
+ getRerankConfig(): Promise<AppRerankConfig | null>;
285
313
  /**
286
314
  * Subscribe to client events
287
315
  */
@@ -1005,4 +1033,4 @@ declare class WindowAttachment {
1005
1033
  */
1006
1034
  declare function getPreloadPath(): string;
1007
1035
 
1008
- export { type AppAgentConfig, type AppClientEvent, type AppClientEventHandlers, type AppConfig, type AppContextData, type AppContextListItem, type AppContextProvider, type AppEmbeddingConfig, type AppJsonSchemaProperty, type AppResourceListOptions, type AppResourceListResult, type AppResourceType, type AppToolDefinition, type AttachConfig, type AttachPosition, type AttachState, ChatPanel, type ChatPanelConfig, type ChatPanelMode, type ChatPanelPosition, type ChatUiConfigSerializable, FloatingWindow, type FloatingWindowConfig, type FloatingWindowOptions, SanqianAppClient, WindowAttachment, type WindowPosition, getPreloadPath };
1036
+ export { type AppAgentConfig, type AppClientEvent, type AppClientEventHandlers, type AppConfig, type AppContextData, type AppContextListItem, type AppContextProvider, type AppEmbeddingConfig, type AppJsonSchemaProperty, type AppRerankConfig, type AppResourceListOptions, type AppResourceListResult, type AppResourceType, type AppToolDefinition, type AttachConfig, type AttachPosition, type AttachState, ChatPanel, type ChatPanelConfig, type ChatPanelMode, type ChatPanelPosition, type ChatUiConfigSerializable, FloatingWindow, type FloatingWindowConfig, type FloatingWindowOptions, SanqianAppClient, WindowAttachment, type WindowPosition, getPreloadPath };
@@ -177,6 +177,26 @@ var SanqianAppClient = class {
177
177
  }
178
178
  }
179
179
  // ============================================================
180
+ // Rerank
181
+ // ============================================================
182
+ /**
183
+ * Get rerank configuration from Sanqian
184
+ * @returns Rerank config or null if not available
185
+ */
186
+ async getRerankConfig() {
187
+ try {
188
+ const config = await this.sdk.getRerankConfig();
189
+ return {
190
+ available: config.available,
191
+ apiUrl: config.apiUrl,
192
+ apiKey: config.apiKey,
193
+ modelName: config.modelName
194
+ };
195
+ } catch {
196
+ return null;
197
+ }
198
+ }
199
+ // ============================================================
180
200
  // Events
181
201
  // ============================================================
182
202
  /**
@@ -146,6 +146,26 @@ var SanqianAppClient = class {
146
146
  }
147
147
  }
148
148
  // ============================================================
149
+ // Rerank
150
+ // ============================================================
151
+ /**
152
+ * Get rerank configuration from Sanqian
153
+ * @returns Rerank config or null if not available
154
+ */
155
+ async getRerankConfig() {
156
+ try {
157
+ const config = await this.sdk.getRerankConfig();
158
+ return {
159
+ available: config.available,
160
+ apiUrl: config.apiUrl,
161
+ apiKey: config.apiKey,
162
+ modelName: config.modelName
163
+ };
164
+ } catch {
165
+ return null;
166
+ }
167
+ }
168
+ // ============================================================
149
169
  // Events
150
170
  // ============================================================
151
171
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yushaw/sanqian-chat",
3
- "version": "0.2.18",
3
+ "version": "0.2.20",
4
4
  "description": "Floating chat window SDK for Sanqian AI Assistant",
5
5
  "main": "./dist/main/index.js",
6
6
  "types": "./dist/main/index.d.ts",
@@ -44,7 +44,7 @@
44
44
  "test:watch": "vitest"
45
45
  },
46
46
  "dependencies": {
47
- "@yushaw/sanqian-sdk": "^0.3.7",
47
+ "@yushaw/sanqian-sdk": "^0.3.13",
48
48
  "react-virtuoso": "^4.15.0",
49
49
  "rehype-harden": "^1.1.6",
50
50
  "remark-gfm": "^4.0.1",