koishi-plugin-satori-ai 2.0.1 → 2.2.0
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/lib/api.d.ts +14 -3
- package/lib/index.js +1089 -362
- package/lib/memory/context.d.ts +34 -2
- package/lib/memory/delta.d.ts +20 -0
- package/lib/memory/heartbeat.d.ts +9 -0
- package/lib/memory/index.d.ts +5 -0
- package/lib/memory/profile.d.ts +43 -3
- package/lib/memory/prompts.d.ts +12 -0
- package/lib/memory/redact.d.ts +2 -0
- package/lib/memory/reject.d.ts +2 -0
- package/lib/memory/repository.d.ts +16 -0
- package/lib/memory/schema.d.ts +2 -0
- package/lib/memory/stats.d.ts +9 -0
- package/lib/memory/summarizer.d.ts +51 -1
- package/lib/types.d.ts +3 -0
- package/package.json +2 -2
- package/readme.md +164 -76
package/lib/api.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export declare class APIClient {
|
|
|
4
4
|
private ctx;
|
|
5
5
|
private config;
|
|
6
6
|
private currentKeyIndex;
|
|
7
|
+
private ticketFailedUntil;
|
|
7
8
|
constructor(ctx: Context, config: APIConfig);
|
|
8
9
|
chat(user: User, messages: Sat.Msg[]): Promise<{
|
|
9
10
|
content: string;
|
|
@@ -15,10 +16,20 @@ export declare class APIClient {
|
|
|
15
16
|
error: boolean;
|
|
16
17
|
}>;
|
|
17
18
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
19
|
+
* 辅助请求的实际发送与重试。
|
|
20
|
+
* 所有失败之间都有 retry_delay_time 的间隔;429/503 按指数退避并带抖动,
|
|
21
|
+
* 有 Retry-After 时优先遵守,避免并发 worker 在同一时刻再次冲击限流接口。
|
|
20
22
|
*/
|
|
21
|
-
private
|
|
23
|
+
private requestAuxiliary;
|
|
24
|
+
/** 指数退避,最高 30 秒;加 ±20% 抖动,避免多个 worker 同步重试。
|
|
25
|
+
* 服务端给了 Retry-After 就严格按它来,不再打折。 */
|
|
26
|
+
private retryDelayFor;
|
|
27
|
+
/** Retry-After 可能是秒数,也可能是 HTTP 日期。 */
|
|
28
|
+
private retryAfterMs;
|
|
29
|
+
private statusOf;
|
|
30
|
+
private pruneTicketFailures;
|
|
31
|
+
private ticketAuxiliaryRoute;
|
|
32
|
+
private defaultAuxiliaryRoute;
|
|
22
33
|
generateUserPortrait(user: User, messages: Sat.Msg[]): Promise<{
|
|
23
34
|
content: string;
|
|
24
35
|
error: boolean;
|