ideas-generator/server/models/VectorStore.js
DJP ca4ed4976d Add dual-agent system with file upload support and compact UI
- Implement dual-agent architecture supporting both Chat Completions and Responses API
- Add comprehensive file upload functionality for responses agents with image and PDF support
- Integrate OpenAI Conversations API for persistent file context across messages
- Add compact UI design with reduced font sizes and tighter spacing for better chat focus
- Include vector store management, document upload system, and admin dashboard enhancements
- Fix conversation persistence ensuring uploaded files remain accessible in follow-up questions

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 14:45:25 -04:00

62 lines
No EOL
1.4 KiB
JavaScript

const { DataTypes } = require('sequelize');
const { sequelize } = require('../config/database');
const VectorStore = sequelize.define('VectorStore', {
id: {
type: DataTypes.UUID,
defaultValue: DataTypes.UUIDV4,
primaryKey: true,
},
openaiVectorStoreId: {
type: DataTypes.STRING,
allowNull: false,
unique: true,
comment: 'OpenAI vector store ID from their API'
},
name: {
type: DataTypes.STRING,
allowNull: false,
},
description: {
type: DataTypes.TEXT,
allowNull: true,
},
fileCount: {
type: DataTypes.INTEGER,
defaultValue: 0,
allowNull: false,
},
bytesUsed: {
type: DataTypes.BIGINT,
defaultValue: 0,
allowNull: false,
},
status: {
type: DataTypes.ENUM('in_progress', 'completed', 'failed', 'cancelled'),
defaultValue: 'in_progress',
allowNull: false,
},
expiresAfter: {
type: DataTypes.JSONB,
allowNull: true,
comment: 'Expiration configuration object'
},
lastActiveAt: {
type: DataTypes.DATE,
allowNull: true,
},
metadata: {
type: DataTypes.JSONB,
defaultValue: {},
},
}, {
tableName: 'vector_stores',
timestamps: true,
indexes: [
{ fields: ['openaiVectorStoreId'], unique: true },
{ fields: ['status'] },
{ fields: ['createdAt'] },
],
});
module.exports = VectorStore;