File size: 6,243 Bytes
d714fad
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9d729e7
 
 
 
 
 
 
 
 
 
 
 
d714fad
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Agent = exports.GroqModel = void 0;
const typeorm_1 = require("typeorm");
const tenant_entity_1 = require("./tenant.entity");
const db_connection_entity_1 = require("./db-connection.entity");
const api_key_entity_1 = require("./api-key.entity");
const knowledge_item_entity_1 = require("./knowledge-item.entity");
const conversation_entity_1 = require("./conversation.entity");
var GroqModel;
(function (GroqModel) {
    GroqModel["LLAMA33_70B"] = "llama-3.3-70b-versatile";
    GroqModel["LLAMA31_8B"] = "llama-3.1-8b-instant";
    GroqModel["LLAMA3_8B"] = "llama3-8b-8192";
    GroqModel["GEMMA2_9B"] = "gemma2-9b-it";
    GroqModel["LLAMA31_70B"] = "llama-3.1-70b-versatile";
})(GroqModel || (exports.GroqModel = GroqModel = {}));
let Agent = class Agent {
};
exports.Agent = Agent;
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], Agent.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)(),
    __metadata("design:type", String)
], Agent.prototype, "tenant_id", void 0);
__decorate([
    (0, typeorm_1.Column)(),
    __metadata("design:type", String)
], Agent.prototype, "name", void 0);
__decorate([
    (0, typeorm_1.Column)({ nullable: true }),
    __metadata("design:type", String)
], Agent.prototype, "description", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'character varying', length: 100, default: 'llama-3.3-70b-versatile' }),
    __metadata("design:type", String)
], Agent.prototype, "model", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'character varying', length: 50, default: 'groq' }),
    __metadata("design:type", String)
], Agent.prototype, "ai_provider", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'text', nullable: true }),
    __metadata("design:type", String)
], Agent.prototype, "ai_api_key_encrypted", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'character varying', length: 16, default: 'api_key' }),
    __metadata("design:type", String)
], Agent.prototype, "ai_auth_mode", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'text', nullable: true }),
    __metadata("design:type", String)
], Agent.prototype, "ai_oauth_refresh_token_encrypted", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'bigint', nullable: true }),
    __metadata("design:type", String)
], Agent.prototype, "ai_oauth_expires_at", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'text', nullable: true }),
    __metadata("design:type", String)
], Agent.prototype, "system_prompt", void 0);
__decorate([
    (0, typeorm_1.Column)({ default: true }),
    __metadata("design:type", Boolean)
], Agent.prototype, "is_active", void 0);
__decorate([
    (0, typeorm_1.Column)({ default: true }),
    __metadata("design:type", Boolean)
], Agent.prototype, "multilingual", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'int', default: 10 }),
    __metadata("design:type", Number)
], Agent.prototype, "max_history_messages", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'boolean', default: false }),
    __metadata("design:type", Boolean)
], Agent.prototype, "use_langgraph", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'boolean', default: false }),
    __metadata("design:type", Boolean)
], Agent.prototype, "use_categories", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
    __metadata("design:type", Array)
], Agent.prototype, "categories", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'text', nullable: true }),
    __metadata("design:type", String)
], Agent.prototype, "core_prompt", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'text', nullable: true }),
    __metadata("design:type", String)
], Agent.prototype, "style_prompt", void 0);
__decorate([
    (0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
    __metadata("design:type", Object)
], Agent.prototype, "widget_config", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)(),
    __metadata("design:type", Date)
], Agent.prototype, "created_at", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)(),
    __metadata("design:type", Date)
], Agent.prototype, "updated_at", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(() => tenant_entity_1.Tenant, (tenant) => tenant.agents, { onDelete: 'CASCADE' }),
    (0, typeorm_1.JoinColumn)({ name: 'tenant_id' }),
    __metadata("design:type", tenant_entity_1.Tenant)
], Agent.prototype, "tenant", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => db_connection_entity_1.DbConnection, (db) => db.agent, { cascade: true }),
    __metadata("design:type", Array)
], Agent.prototype, "db_connections", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => api_key_entity_1.ApiKey, (key) => key.agent, { cascade: true }),
    __metadata("design:type", Array)
], Agent.prototype, "api_keys", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => knowledge_item_entity_1.KnowledgeItem, (item) => item.agent, { cascade: true }),
    __metadata("design:type", Array)
], Agent.prototype, "knowledge_items", void 0);
__decorate([
    (0, typeorm_1.OneToMany)(() => conversation_entity_1.Conversation, (conv) => conv.agent, { cascade: true }),
    __metadata("design:type", Array)
], Agent.prototype, "conversations", void 0);
exports.Agent = Agent = __decorate([
    (0, typeorm_1.Entity)('agents')
], Agent);
//# sourceMappingURL=agent.entity.js.map