koishi-plugin-chatluna 1.0.0-rc.2 → 1.0.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/chains/chain.d.ts +1 -1
- package/lib/chains/index.cjs +2 -2
- package/lib/chains/index.mjs +2 -2
- package/lib/config.d.ts +1 -5
- package/lib/index.cjs +247 -475
- package/lib/index.mjs +251 -474
- package/lib/llm-core/agent/openai/index.d.ts +1 -1
- package/lib/llm-core/chain/prompt.cjs +3 -1
- package/lib/llm-core/chain/prompt.mjs +3 -1
- package/lib/llm-core/chat/app.cjs +10 -13
- package/lib/llm-core/chat/app.d.ts +0 -1
- package/lib/llm-core/chat/app.mjs +10 -13
- package/lib/llm-core/memory/message/index.cjs +5 -2
- package/lib/llm-core/memory/message/index.mjs +5 -2
- package/lib/llm-core/model/base.cjs +35 -2
- package/lib/llm-core/model/base.d.ts +8 -1
- package/lib/llm-core/model/base.mjs +35 -2
- package/lib/llm-core/platform/model.cjs +32 -21
- package/lib/llm-core/platform/model.mjs +26 -22
- package/lib/llm-core/platform/service.cjs +7 -1
- package/lib/llm-core/platform/service.d.ts +1 -0
- package/lib/llm-core/platform/service.mjs +7 -1
- package/lib/llm-core/prompt/type.d.ts +4 -0
- package/lib/llm-core/utils/count_tokens.cjs +32 -21
- package/lib/llm-core/utils/count_tokens.mjs +26 -22
- package/lib/middlewares/restart.d.ts +9 -0
- package/lib/services/chat.cjs +6 -12
- package/lib/services/chat.d.ts +1 -1
- package/lib/services/chat.mjs +6 -12
- package/lib/services/types.d.ts +1 -1
- package/lib/utils/error.cjs +0 -1
- package/lib/utils/error.d.ts +0 -1
- package/lib/utils/error.mjs +0 -1
- package/lib/utils/lock.cjs +33 -60
- package/lib/utils/lock.d.ts +2 -7
- package/lib/utils/lock.mjs +33 -60
- package/lib/utils/request.cjs +79 -33
- package/lib/utils/request.d.ts +2 -3
- package/lib/utils/request.mjs +79 -33
- package/package.json +2 -2
package/lib/chains/chain.d.ts
CHANGED
|
@@ -43,7 +43,7 @@ export declare class ChainMiddleware {
|
|
|
43
43
|
constructor(name: string, execute: ChainMiddlewareFunction, graph: ChatChainDependencyGraph);
|
|
44
44
|
before<T extends keyof ChainMiddlewareName>(name: T): this;
|
|
45
45
|
after<T extends keyof ChainMiddlewareName>(name: T): this;
|
|
46
|
-
run(session: Session, options: ChainMiddlewareContext): Promise<string | h[] |
|
|
46
|
+
run(session: Session, options: ChainMiddlewareContext): Promise<string | h[] | h[][] | ChainMiddlewareRunStatus>;
|
|
47
47
|
}
|
|
48
48
|
export interface ChainMiddlewareContext {
|
|
49
49
|
config: Config;
|
package/lib/chains/index.cjs
CHANGED
|
@@ -665,14 +665,14 @@ async function getTemplateConversationRoom(ctx, config) {
|
|
|
665
665
|
}
|
|
666
666
|
if (config.defaultModel === "无" || config.defaultModel == null) {
|
|
667
667
|
const models = ctx.chatluna.platform.getAllModels(import_types.ModelType.llm);
|
|
668
|
-
const model = models.find((model2) => model2.includes("
|
|
668
|
+
const model = models.find((model2) => model2.includes("4o")) ?? models[0];
|
|
669
669
|
config.defaultModel = model;
|
|
670
670
|
}
|
|
671
671
|
if (config.defaultPreset == null) {
|
|
672
672
|
const preset = await ctx.chatluna.preset.getDefaultPreset();
|
|
673
673
|
config.defaultPreset = preset.triggerKeyword[0];
|
|
674
674
|
}
|
|
675
|
-
ctx.
|
|
675
|
+
ctx.scope.parent.scope.update(config, true);
|
|
676
676
|
}
|
|
677
677
|
const room = {
|
|
678
678
|
roomId: 0,
|
package/lib/chains/index.mjs
CHANGED
|
@@ -623,14 +623,14 @@ async function getTemplateConversationRoom(ctx, config) {
|
|
|
623
623
|
}
|
|
624
624
|
if (config.defaultModel === "无" || config.defaultModel == null) {
|
|
625
625
|
const models = ctx.chatluna.platform.getAllModels(ModelType.llm);
|
|
626
|
-
const model = models.find((model2) => model2.includes("
|
|
626
|
+
const model = models.find((model2) => model2.includes("4o")) ?? models[0];
|
|
627
627
|
config.defaultModel = model;
|
|
628
628
|
}
|
|
629
629
|
if (config.defaultPreset == null) {
|
|
630
630
|
const preset = await ctx.chatluna.preset.getDefaultPreset();
|
|
631
631
|
config.defaultPreset = preset.triggerKeyword[0];
|
|
632
632
|
}
|
|
633
|
-
ctx.
|
|
633
|
+
ctx.scope.parent.scope.update(config, true);
|
|
634
634
|
}
|
|
635
635
|
const room = {
|
|
636
636
|
roomId: 0,
|
package/lib/config.d.ts
CHANGED
|
@@ -23,7 +23,6 @@ export interface Config {
|
|
|
23
23
|
autoDelete: boolean;
|
|
24
24
|
autoDeleteTimeout: number;
|
|
25
25
|
messageDelay: number;
|
|
26
|
-
longMemory: boolean;
|
|
27
26
|
privateChatWithoutCommand: boolean;
|
|
28
27
|
allowAtReply: boolean;
|
|
29
28
|
streamResponse: boolean;
|
|
@@ -36,9 +35,6 @@ export interface Config {
|
|
|
36
35
|
authUserDefaultGroup: Computed<Awaitable<[number, number, string]>>;
|
|
37
36
|
authSystem: boolean;
|
|
38
37
|
voiceSpeakId: number;
|
|
39
|
-
|
|
40
|
-
longMemoryAddSimilarity: number;
|
|
41
|
-
longMemoryInterval: number;
|
|
42
|
-
longMemoryExtractModel: string;
|
|
38
|
+
enableSimilarityCheck: boolean;
|
|
43
39
|
}
|
|
44
40
|
export declare const Config: Schema<Config>;
|