Skip to content

Commit

Permalink
解决合并冲突
Browse files Browse the repository at this point in the history
  • Loading branch information
HydroGest committed Jan 25, 2025
1 parent dfc3678 commit d18ebe1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/core/src/extensions/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,15 @@ export function getExtensions(ctx: Context, bot: Bot): Extension[] {
let extensions: Extension[] = [];

fs.readdirSync(__dirname)
.filter((file) => file.startsWith("ext_") && !file.endsWith(".d.ts")) // 不指定 .js 是为了兼容dev模式
.filter((file) => file.startsWith("ext_") && !file.endsWith(".d.ts")) // 不指定 .js 是为了兼容dev模式
.forEach((file) => {
try {
// @ts-ignore
if (!ctx?.memory && file.startsWith("ext_memory")) {
ctx.logger.warn(`当前未启用 Memory 模块,跳过扩展:${file}`)
return
}
// @ts-ignore
if (!ctx?.memory && file.startsWith("ext_memory")) {
ctx.logger.warn(`当前未启用 Memory 模块,跳过扩展:${file}`)
Expand Down
5 changes: 5 additions & 0 deletions packages/core/src/utils/factory.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { CloudflareAdapter, CustomAdapter, GeminiAdapter, OllamaAdapter, OpenAIAdapter } from "../adapters";

Check failure on line 1 in packages/core/src/utils/factory.ts

View workflow job for this annotation

GitHub Actions / build

Duplicate identifier 'CloudflareAdapter'.

Check failure on line 1 in packages/core/src/utils/factory.ts

View workflow job for this annotation

GitHub Actions / build

Duplicate identifier 'CustomAdapter'.

Check failure on line 1 in packages/core/src/utils/factory.ts

View workflow job for this annotation

GitHub Actions / build

Duplicate identifier 'GeminiAdapter'.

Check failure on line 1 in packages/core/src/utils/factory.ts

View workflow job for this annotation

GitHub Actions / build

Duplicate identifier 'OllamaAdapter'.

Check failure on line 1 in packages/core/src/utils/factory.ts

View workflow job for this annotation

GitHub Actions / build

Duplicate identifier 'OpenAIAdapter'.

Check failure on line 1 in packages/core/src/utils/factory.ts

View workflow job for this annotation

GitHub Actions / build

Duplicate identifier 'CloudflareAdapter'.

Check failure on line 1 in packages/core/src/utils/factory.ts

View workflow job for this annotation

GitHub Actions / build

Duplicate identifier 'CustomAdapter'.

Check failure on line 1 in packages/core/src/utils/factory.ts

View workflow job for this annotation

GitHub Actions / build

Duplicate identifier 'GeminiAdapter'.

Check failure on line 1 in packages/core/src/utils/factory.ts

View workflow job for this annotation

GitHub Actions / build

Duplicate identifier 'OllamaAdapter'.

Check failure on line 1 in packages/core/src/utils/factory.ts

View workflow job for this annotation

GitHub Actions / build

Duplicate identifier 'OpenAIAdapter'.
import { BaseAdapter } from "../adapters/base";

Check failure on line 2 in packages/core/src/utils/factory.ts

View workflow job for this annotation

GitHub Actions / build

Duplicate identifier 'BaseAdapter'.

Check failure on line 2 in packages/core/src/utils/factory.ts

View workflow job for this annotation

GitHub Actions / build

Duplicate identifier 'BaseAdapter'.
import { LLM } from "../adapters/config";

Check failure on line 3 in packages/core/src/utils/factory.ts

View workflow job for this annotation

GitHub Actions / build

Duplicate identifier 'LLM'.

Check failure on line 3 in packages/core/src/utils/factory.ts

View workflow job for this annotation

GitHub Actions / build

Duplicate identifier 'LLM'.
import { CloudflareAdapter, CustomAdapter, GeminiAdapter, OllamaAdapter, OpenAIAdapter } from "../adapters";

Check failure on line 4 in packages/core/src/utils/factory.ts

View workflow job for this annotation

GitHub Actions / build

Duplicate identifier 'CloudflareAdapter'.

Check failure on line 4 in packages/core/src/utils/factory.ts

View workflow job for this annotation

GitHub Actions / build

Duplicate identifier 'CustomAdapter'.

Check failure on line 4 in packages/core/src/utils/factory.ts

View workflow job for this annotation

GitHub Actions / build

Duplicate identifier 'GeminiAdapter'.

Check failure on line 4 in packages/core/src/utils/factory.ts

View workflow job for this annotation

GitHub Actions / build

Duplicate identifier 'CloudflareAdapter'.

Check failure on line 4 in packages/core/src/utils/factory.ts

View workflow job for this annotation

GitHub Actions / build

Duplicate identifier 'CustomAdapter'.

Check failure on line 4 in packages/core/src/utils/factory.ts

View workflow job for this annotation

GitHub Actions / build

Duplicate identifier 'GeminiAdapter'.
import { BaseAdapter } from "../adapters/base";
import { LLM } from "../adapters/config";
import { Config } from "../config";
import { CustomEmbedding, OllamaEmbedding, OpenAIEmbedding } from "../embeddings";
import { EnabledEmbeddingConfig } from "../embeddings/config";
Expand All @@ -18,6 +21,8 @@ export function getAdapter(config: LLM, parameters?: Config["Parameters"]): Base
return new OpenAIAdapter(config, parameters);
case "Gemini":
return new GeminiAdapter(config, parameters);
case "Gemini":
return new GeminiAdapter(config, parameters);
default:
throw new Error(`不支持的 API 类型: ${config.APIType}`);
}
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/utils/toolkit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export function containsFilter(content: string, FilterList: string[]): boolean {
//return re.test(content);

for (const filter of FilterList) {
if (isEmpty(filter)) continue;
if (isEmpty(filter)) continue;
let regex = new RegExp(filter, "gi");
if (regex.test(content))
Expand Down Expand Up @@ -279,6 +280,7 @@ export function downloadFile(url, filePath, debug) {
};

/**
*
*
* @param date
* @returns 2024年12月3日星期二17:34:00
Expand Down

0 comments on commit d18ebe1

Please sign in to comment.