This commit is contained in:
2025-07-04 00:00:57 +08:00
parent 3fe31039da
commit 30514ceb84
8 changed files with 84 additions and 4 deletions

21
src/modules/ai.ts Normal file
View File

@@ -0,0 +1,21 @@
import { useContextKey } from '@kevisual/context';
import { BailianProvider } from '@kevisual/ai';
import { config } from './config.ts';
const createBaiLian = () => {
return new BailianProvider({
baseURL: 'https://dashscope.aliyuncs.com/compatible-mode/v1',
model: 'qwen3-235b-a22b',
apiKey: config.BAILIAN_API_KEY,
});
};
export const ai = useContextKey('ai', createBaiLian());
export const bailianModel = useContextKey('bailianModel', () => {
return {
turbo: 'qwen-turbo-2025-04-28',
plus: 'qwen-plus-2025-04-28',
a22b235: 'qwen3-235b-a22b',
};
});

View File

@@ -0,0 +1,27 @@
import { useContextKey } from '@kevisual/context';
import { App } from '@kevisual/router';
const app = await useContextKey<App>('app');
app
.route({
path: 'auth',
key: '',
id: 'auth',
description: '验证token不存在拒绝',
})
.define(async (ctx) => {
//
})
.addTo(app);
app
.route({
path: 'auth',
key: 'can',
id: 'auth-can',
description: '如果是登陆的设置tokenUser否者为null',
})
.define(async (ctx) => {
//
})
.addTo(app);

View File

@@ -3,4 +3,5 @@ import { useContextKey } from '@kevisual/context';
const init = () => {
return new App();
};
export const app = useContextKey('app', init);

View File

@@ -1,6 +1,6 @@
import { sequelize, User, UserInit, Org, OrgInit } from '@kevisual/code-center-module';
import { User, UserInit, Org, OrgInit } from '@kevisual/code-center-module/src/core-models.ts';
export { sequelize, User, UserInit, Org, OrgInit };
export { User, UserInit, Org, OrgInit };
export const init = () => {
UserInit();