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\" ",
"build": "cross-env ENV=production webpack --mode=production ",
"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": "",
"clean": "rm -rf dist",
"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 { app };
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';
export class AiAgent extends Model {
id: string;
type: string;
model: string;
baseUrl: string;
apiKey: string;
temperature: number;
cache: string;
cacheName: string;
status: string;
data: any;
key: string;
declare id: string;
declare type: string;
declare model: string;
declare baseUrl: string;
declare apiKey: string;
declare temperature: number;
declare cache: string;
declare cacheName: string;
declare status: string;
declare data: any;
declare description: string;
declare key: string;
}
// 获取AIAgent的属性
@ -26,6 +27,7 @@ export type AiProperties = {
cache?: string;
cacheName?: string;
data?: any;
description?: string;
};
AiAgent.init(
{
@ -38,6 +40,10 @@ AiAgent.init(
type: DataTypes.STRING,
allowNull: false,
},
description: {
type: DataTypes.TEXT,
allowNull: true,
},
status: {
type: DataTypes.STRING,
defaultValue: 'open',
@ -56,6 +62,8 @@ AiAgent.init(
},
key: {
type: DataTypes.STRING,
allowNull: false,
unique: true,
},
temperature: {
type: DataTypes.FLOAT,

View File

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

View File

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

View File

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

View File

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