feat: change agent and container add tags
This commit is contained in:
@@ -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}`);
|
||||
});
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -112,6 +112,7 @@ const initManager = async () => {
|
||||
where: {
|
||||
status: 'open',
|
||||
},
|
||||
logging: false,
|
||||
});
|
||||
const data = list.map((item) => {
|
||||
return {
|
||||
|
||||
@@ -45,12 +45,7 @@ add.run = async (ctx) => {
|
||||
source: '',
|
||||
type: '',
|
||||
sourceType: '',
|
||||
data: {
|
||||
className: '',
|
||||
style: {},
|
||||
showChild: true,
|
||||
shadowRoot: false,
|
||||
},
|
||||
data: {},
|
||||
};
|
||||
const container = {
|
||||
..._data,
|
||||
|
||||
@@ -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: '',
|
||||
|
||||
Reference in New Issue
Block a user