temp
This commit is contained in:
21
src/modules/ai.ts
Normal file
21
src/modules/ai.ts
Normal 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',
|
||||
};
|
||||
});
|
||||
27
src/modules/dev/add-auth.ts
Normal file
27
src/modules/dev/add-auth.ts
Normal 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);
|
||||
@@ -3,4 +3,5 @@ import { useContextKey } from '@kevisual/context';
|
||||
const init = () => {
|
||||
return new App();
|
||||
};
|
||||
|
||||
export const app = useContextKey('app', init);
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user