feat: change agent and container add tags

This commit is contained in:
xion 2024-09-28 03:01:10 +08:00
parent 718322ae47
commit 1505c25166
7 changed files with 32 additions and 25 deletions

View File

@ -12,7 +12,7 @@
"dev:watch": "concurrently -n \"Watch,Dev\" -c \"green,blue\" \"npm run watch\" \"sleep 1 && npm run dev\" ", "dev:watch": "concurrently -n \"Watch,Dev\" -c \"green,blue\" \"npm run watch\" \"sleep 1 && npm run dev\" ",
"build": "cross-env ENV=production webpack --mode=production ", "build": "cross-env ENV=production webpack --mode=production ",
"build:sh": "cross-env webpack --mode=production -c ./webpack.shell.config.cjs", "build:sh": "cross-env webpack --mode=production -c ./webpack.shell.config.cjs",
"deploy": "scp ./dist/app.cjs light:~/apps/codeflow/backend", "deploy": "rsync -avz --delete ./dist/ light:~/apps/codeflow/backend",
"deploy:sh": "", "deploy:sh": "",
"clean": "rm -rf dist", "clean": "rm -rf dist",
"reload": "ssh light pm2 restart codeflow", "reload": "ssh light pm2 restart codeflow",

View File

@ -7,5 +7,5 @@ import { app as aiApp } from '@kevisual/ai-lang/src/index.ts';
export { aiApp }; export { aiApp };
export { app }; export { app };
app.listen(config.port, () => { app.listen(config.port, () => {
console.log(`server2 is running at http://localhost:${config.port}`); console.log(`server is running at http://localhost:${config.port}`);
}); });

View File

@ -2,17 +2,18 @@ import { sequelize } from '@/modules/sequelize.ts';
import { DataTypes, Model } from 'sequelize'; import { DataTypes, Model } from 'sequelize';
export class AiAgent extends Model { export class AiAgent extends Model {
id: string; declare id: string;
type: string; declare type: string;
model: string; declare model: string;
baseUrl: string; declare baseUrl: string;
apiKey: string; declare apiKey: string;
temperature: number; declare temperature: number;
cache: string; declare cache: string;
cacheName: string; declare cacheName: string;
status: string; declare status: string;
data: any; declare data: any;
key: string; declare description: string;
declare key: string;
} }
// 获取AIAgent的属性 // 获取AIAgent的属性
@ -26,6 +27,7 @@ export type AiProperties = {
cache?: string; cache?: string;
cacheName?: string; cacheName?: string;
data?: any; data?: any;
description?: string;
}; };
AiAgent.init( AiAgent.init(
{ {
@ -38,6 +40,10 @@ AiAgent.init(
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: false, allowNull: false,
}, },
description: {
type: DataTypes.TEXT,
allowNull: true,
},
status: { status: {
type: DataTypes.STRING, type: DataTypes.STRING,
defaultValue: 'open', defaultValue: 'open',
@ -56,6 +62,8 @@ AiAgent.init(
}, },
key: { key: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: false,
unique: true,
}, },
temperature: { temperature: {
type: DataTypes.FLOAT, type: DataTypes.FLOAT,

View File

@ -112,6 +112,7 @@ const initManager = async () => {
where: { where: {
status: 'open', status: 'open',
}, },
logging: false,
}); });
const data = list.map((item) => { const data = list.map((item) => {
return { return {

View File

@ -45,12 +45,7 @@ add.run = async (ctx) => {
source: '', source: '',
type: '', type: '',
sourceType: '', sourceType: '',
data: { data: {},
className: '',
style: {},
showChild: true,
shadowRoot: false,
},
}; };
const container = { const container = {
..._data, ..._data,

View File

@ -1,12 +1,7 @@
import { sequelize } from '../../../modules/sequelize.ts'; import { sequelize } from '../../../modules/sequelize.ts';
import { DataTypes, Model } from 'sequelize'; import { DataTypes, Model } from 'sequelize';
export interface ContainerData { export interface ContainerData {}
style?: { [key: string]: string };
className?: string;
showChild?: boolean;
shadowRoot?: boolean;
}
export type ContainerPublish = { export type ContainerPublish = {
rid?: string; // resource id rid?: string; // resource id
name?: string; name?: string;
@ -20,6 +15,7 @@ export class ContainerModel extends Model {
declare title: string; declare title: string;
declare description: string; declare description: string;
declare type: string; declare type: string;
declare tags: string[];
declare code: string; declare code: string;
declare source: string; declare source: string;
declare sourceType: string; declare sourceType: string;
@ -43,6 +39,10 @@ ContainerModel.init(
type: DataTypes.STRING, type: DataTypes.STRING,
defaultValue: '', defaultValue: '',
}, },
tags: {
type: DataTypes.JSON,
defaultValue: [],
},
type: { type: {
type: DataTypes.STRING, type: DataTypes.STRING,
defaultValue: '', defaultValue: '',

View File

@ -59,6 +59,9 @@ module.exports = {
{ {
message: /Critical dependency: the request of a dependency is an expression/, message: /Critical dependency: the request of a dependency is an expression/,
}, },
{
message: /[DEP0040] DeprecationWarning: The `punycode`/
}
], ],
resolve: { resolve: {