-
Notifications
You must be signed in to change notification settings - Fork 1
[Project] AI Standardization #239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
akash9676
wants to merge
245
commits into
dev
Choose a base branch
from
project-1-ai-standardization
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
245 commits
Select commit
Hold shift + click to select a range
5f8931b
feat: add LiteLLM RPC service and integration
akash9676 721b931
chore: update LiteLLM dependency to version 1.82.6
akash9676 8e6968d
Merge branch 'project-1-ai-standardization' into feat-138-litellm_rpc
akash9676 8f8a27f
docs: add author annotation to LiteLLMRPC.js file
akash9676 da9c540
feat: implement AIService for handling AI/LLM requests and integrate …
akash9676 ed479b5
refactor: rename RPC call tests and update health check implementatio…
akash9676 b275d49
Merge branch 'project-1-ai-standardization' into feat-138-litellm_rpc
akash9676 a654e9e
feat: add abortChatCompletion functionality to AIService and LiteLLMR…
akash9676 b707e58
Revert "feat: add abortChatCompletion functionality to AIService and …
akash9676 d832ce1
feat: implement abortChatCompletion method in LiteLLMRPC and AIServic…
2043473
Merge pull request #158 from UKPLab/feat-138-litellm_rpc
akash9676 f344b9a
feat(db): add AI credential, model, share, and log tables with Sequel…
junaidferoz a586c09
fix: removed redundant code and resolved defaultValue/allowNull issue
junaidferoz 529a0ba
changed autoTable value to false
junaidferoz da1c969
fix: converted variable to camelCase
junaidferoz ff7b5d1
Merge pull request #193 from UKPLab/feat-142-tables_and_schema
akash9676 5e62e7d
Merge branch 'dev' into project-1-ai-standardization
e0ef306
fix(migration): update foreign key reference from 'study' to 'user_role'
086a47e
feat(migration): add foreign key references for ai_log table
bb133df
feat(Socket): add 'apiKey' to default excludes in attribute filtering
027b045
feat(migration): add AI navigation elements and user role permissions
87debc0
feat(ai_model): implement credential ownership validation and add hoo…
6ae9059
feat(AIService): add testModel command for model usability validation…
e882698
feat(AI): enhance AI logging and dashboard components for better trac…
0aea285
fix(AiLog): enable autoTable for AiLog model and update status in AI …
2e24800
feat(AIService): implement #extractInputText method for improved mess…
c848888
refactor(AIModels): update button titles and styles for credential an…
803378f
feat(AIModelShare): implement model sharing functionality with user, …
408789d
feat(AIModels): refactor AI credential and model forms into separate …
416adeb
refactor(AIModelShareStepper): update selection handling and improve …
c217dc9
feat(AIOverview): add model overview component and integrate with AI …
36fa378
refactor(AIService): streamline command handling and enhance model ow…
e0af6e9
feat(AIService): implement cascading updates for AI credentials and e…
30c0e3b
feat(AIModelShareStepper): enhance selection handling and add refresh…
b048931
feat(AIService): add bulk update handling for AI credential transacti…
6aa8946
feat(LiteLLMRPC): add getValidModels method to fetch available models…
af3cabd
fix(chat): update status from "test_failed" to "failed" for improved …
5ccf4c3
feat(LiteLLMRPC): implement router functionality for model handling a…
59f554d
feat(LiteLLMRPC): enhance chatCompletion with async handling and canc…
94fc5e5
refactor(LiteLLMRPC): simplify credential management and enhance mode…
4468743
refactor(LiteLLMRPC): improve model retrieval robustness by handling …
cda15f0
refactor(AIService): streamline provider normalization and model reso…
7591a9c
refactor(AIService): replace response cost extraction and reasoning h…
300e01e
refactor(AIHelpers): simplify user display label and share recipient …
750f196
refactor(LiteLLMRPC, AIService): enforce __requestId presence in chat…
cc647e7
refactor(RPC, AI components): clean up unused code and improve loggin…
a48898c
refactor(AI components): remove unused credential properties and stre…
c2fe5f7
refactor(migration): update provider field to allow null values and s…
b204048
refactor(AI components): add provider field to credentials and update…
8c318f9
refactor(AI components): update credential label for improved user cl…
471d885
refactor(AI components): enhance input labels with tooltips for bette…
ca5618f
refactor(AI components): enhance AiCredential and AiModel classes for…
e9bf4ec
refactor(AI chat service): rename runtime and helpers imports for con…
c4dc372
refactor(AI components): add detailed JSDoc comments to models and se…
e3bfb0a
refactor(AI components): remove study-related functionality from ai_m…
40934f0
Merge branch 'dev' into project-1-ai-standardization
db038e2
Merge branch 'project-1-ai-standardization' into feat-139-ai-dashboard
738ee05
fix(AIModel.vue): update button label from "Create" to "Add" for clar…
13a9f02
feat(chat service): enhance chatCompletion and testModel functions wi…
akash9676 0c79262
refactor(ai_credential): update foreign key column naming to support …
akash9676 db6e6a8
feat(AIService): add getAiModelOwnerSummaries function and integrate …
akash9676 74d018f
Merge pull request #195 from UKPLab/feat-139-ai-dashboard
akash9676 805a20d
feat: added migrations for budge related columns
MRawhani 5aa9b4d
feat: update schema definitions to reflec migrations
MRawhani 186f397
feat: add budget relted functionalities
MRawhani e2586d8
feat: add prompt templates and placeholder resolution
mohammadsherif0 7a7dfbc
feat: add template placeholder editor preview mode
mohammadsherif0 f788107
fix: refresh detached templates before editing
mohammadsherif0 7e4efd6
docs: update template documentation for prompt placeholders
mohammadsherif0 d680b1b
fix : change the name of the file
MRawhani 7795338
feat: add sessionId migration to shares for limit
MRawhani 983cc26
feat: add budget limit fucntion on session, and on cap of study owner
MRawhani 0c1d72b
feat: add reset funcitonality and adapt share and chat functions to b…
MRawhani 7996842
feat: add budget guard for deleted share
MRawhani 11b8599
feat: append shares table with flag fro session
MRawhani 5864075
fix: bypass locks when testing + add test log to ai logs
MRawhani adea965
fix: flag test prompts
MRawhani 096ef72
feat: add mapping after creation and after find ai budget updates to …
MRawhani 86dd273
fix: remove enablaed from filtering
MRawhani 4cff3c3
feat: enable prefill study edit and adjust share service to recieve n…
MRawhani 38678ab
feat: add new frontend funcitonality for budget
MRawhani 260438e
Merge branch 'dev' into project-1-ai-standardization
akash9676 2139806
feat(Makefile): add docker-recompose target for rebuilding and starti…
akash9676 07fdc1e
feat(migrations): add trigger, trigger_event, trigger_action, and tri…
akash9676 22ba67c
feat(navigation): add triggers and trigger logs navigation components…
akash9676 5a43a72
fix: register the get study ai budget in cmd
MRawhani 35bd144
feat: add resetting functionality
MRawhani d77a4f4
feat: add last reset info
MRawhani ad8a17a
feat(trigger): implement trigger management system with dashboard con…
akash9676 2232f23
refactor(dashboard): streamline TriggerLogs and Triggers components b…
akash9676 e27e252
feat(migrations): update trigger actions to include AI preprocessing …
akash9676 b20e65f
Merge pull request #231 from UKPLab/feat-203-make-docker-recompose
dennis-zyska e190362
refactor(dashboard): remove legacy trigger dashboard configurations a…
akash9676 535dbeb
refactor(migrations): update label for submission uploaded trigger to…
akash9676 e4da8b9
feat(trigger): enhance submission trigger with group selection and up…
akash9676 2f8a2fe
refactor(dashboard): replace legacy dashboard configurations with int…
akash9676 2b2c9d1
feat(dashboard): introduce TriggerStepperModal for streamlined trigge…
akash9676 1630b48
refactor(dashboard): enhance validation logic in TriggerStepperModal …
akash9676 486f7dd
Merge branch 'dev' into project-1-ai-standardization
akash9676 dfa7f1b
Merge branch 'project-1-ai-standardization' into feat-224-triggers
akash9676 e6c5bba
refactor(trigger): update trigger event configuration to use assignme…
akash9676 f9d64b7
refactor(trigger): enforce required email template selection in migra…
akash9676 c39f4be
Merge branch 'dev' into project-1-ai-standardization
akash9676 72c61ee
Merge branch 'project-1-ai-standardization' into feat-224-triggers
akash9676 a90ae96
Merge branch 'dev' into project-1-ai-standardization
akash9676 163cb56
Merge branch 'project-1-ai-standardization' into feat-224-triggers
akash9676 c3544f6
feat(trigger): add review & confirm step in TriggerStepperModal with …
akash9676 ac2b5b2
feat(trigger): implement preprocessing configuration in TriggerSteppe…
akash9676 7aea4a8
refactor: change prompt template type from 7 to 8
mohammadsherif0 cba8bcd
docs: update prompt template type and editorText placeholder notes
mohammadsherif0 b42c264
Merge branch 'dev' into project-1-ai-standardization
akash9676 bf28cc8
feat: add AI hooks migration and navigation elements
akash9676 819b1b8
feat: implement AI hooks and output mode handling
akash9676 c2abd76
feat: enhance AIHookStepperModal with review step and validation impr…
akash9676 d414185
feat: implement AI hook fallback management in dashboard
akash9676 481db00
Merge branch 'project-1-ai-standardization' into feat-192-prompt_temp…
mohammadsherif0 69ad0e9
feat: enhance AIHookFallbackModal with fallback change detection
akash9676 8a06a05
Merge branch 'project-1-ai-standardization' into feat-192-prompt_temp…
mohammadsherif0 2e02a84
fix: lint error in placeholderExamplePreview.js
mohammadsherif0 b56e36a
add nodemon
MRawhani 6737dde
feat: refactor AI hook models and remove fallback model
akash9676 e403afb
feat: refactor AI hook model management and introduce new modals
akash9676 f4ba49c
feat: update AI hook model emission with aiHookId
akash9676 3e2cc8d
feat: remove IMAGE output mode from AI hook configurations
akash9676 2aaa895
docs: add author tag to studyNlpDocumentData.js
mohammadsherif0 cf8d537
feat: refactor AIHookModelOrder component to use BasicTable for model…
akash9676 9d31aaa
feat: implement AI hook sharing functionality
akash9676 3ca8b2d
feat: update AIHookModelOrder component layout and table options
akash9676 aab0ae8
feat: add hook overview functionality and refactor AI overview component
akash9676 9a9df60
feat: enhance sharing functionality for AI models and hooks
akash9676 23a28f1
Merge pull request #237 from UKPLab/feat-192-prompt_templates
MRawhani 0fe6b01
Merge branch 'project-1-ai-standardization' into feat-223-ai-hooks
MRawhani 3034ca9
Merge branch 'feat-223-ai-hooks' into feat-186-budget-management
MRawhani 9c9e858
feat: added runhook service request
MRawhani 8e877a4
fix: fix the null deleted column in table hook
MRawhani 6884621
feat: integrate ai hooks into study
MRawhani c109a90
feat: integrate ai hooks into loading modal and run hook
MRawhani 219bb40
feat: extend workflows with hooks
MRawhani 22d81e4
feat: oporimize the ai hook integration
MRawhani 0f5eabb
Merge branch 'feat-223-ai-hooks-integration' into feat-186-budget-man…
MRawhani 50c5792
feat: add 'enabled' field check in AppSocket update logic
akash9676 e9688fa
feat: update budget enforcement
MRawhani 09b4297
fix : add author name
MRawhani 62193ef
feat: refine prompt template visibility in AIHookStepperModal
akash9676 31150af
fix: update ownership fucniton
MRawhani 5e498ff
feat: optimize the budget into seprate table
MRawhani 6acaaf2
feat: map th new table to the budget enforcement pipeline
MRawhani 5b5f7dc
fix: add userid to the ai budget table
MRawhani 0b2157d
feat: add unzipping for submission selection in hook
MRawhani 4d56f5e
feat: add reset functionality
MRawhani e5ee698
fix: change checkbox into radio selection in submission input
MRawhani fc21d32
fix: optimize some UI
MRawhani c17b343
fix: enhance ui in budget related elements
MRawhani dc7de4d
fix: optemize the ai budgets table
MRawhani 0034a26
fix: remove unused userfilter
MRawhani e31ff7f
feat : add mirrored placeholder token helpers
mohammadsherif0 d6db09d
feat : resolve bracket placeholders in templateResolver
mohammadsherif0 e7e2792
feat : block duplicate bracket placeholders on template save
mohammadsherif0 68b18b4
feat : add bracket placeholder support in template editor
mohammadsherif0 c3715df
feat : expand hook input map rows per placeholder index
mohammadsherif0 044b2cf
docs : update submissionFiles placeholder copy for indexed slots
mohammadsherif0 9e29114
feat: enhance AI credential handling and model discovery
akash9676 9e0a84a
fix: update navigation element names for consistency
akash9676 cfd694c
fix: correct naming of AI Hooks in migration file
akash9676 ff4a11a
feat(trigger): add trigger handling for submission uploads and reuplo…
akash9676 10bff6f
feat(trigger): enhance trigger configuration by adding component sche…
akash9676 eb06f69
Merge branch 'dev' into project-1-ai-standardization
akash9676 4385b37
Merge branch 'project-1-ai-standardization' into feat-223-ai-hooks
akash9676 706033f
fix: update API key field to allow null values and adjust validation …
akash9676 6a9e4fc
Merge pull request #240 from UKPLab/feat-223-ai-hooks
akash9676 346fcca
Merge branch 'project-1-ai-standardization' into feat-224-triggers
akash9676 78b7d94
Merge branch 'project-1-ai-standardization' into feat-186-budget-mana…
MRawhani 692aefc
Merge branch 'feat-248-placeholder_numbering_extension' into feat-186…
MRawhani f77675e
fix: add basic form + fix assessment check bug
MRawhani 4e728aa
refactor: optimize the ai integration flow
MRawhani b353e7f
feat(trigger): enforce project ID requirement, add indexes to trigger…
akash9676 3a854d2
refactor(trigger): streamline transaction handling and improve query …
akash9676 bd3172b
feat(trigger): add status filter options to TriggerLogs component for…
akash9676 c22aa69
feat(trigger): enhance TriggerStepperModal to display detailed trigge…
akash9676 df88c93
fix: change bypass to free and make elements in ui into basic forms
MRawhani 7451a55
fix(trigger): update project ID field to allow null values and remove…
akash9676 8edcb63
feat(trigger): add soft-delete functionality to TriggerQueue model an…
akash9676 451993e
fix: revert extension migrations for ai models
MRawhani 0fe9dc4
Merge pull request #222 from UKPLab/feat-186-budget-management
MRawhani c5cba66
fix: generic bypasssing userId check for shareing models
MRawhani 1b8ad1f
Merge branch 'project-1-ai-standardization' into feat-224-triggers
akash9676 cc7ed07
refactor: remove share.js file and trigger subscribing
MRawhani 1cde84f
Merge branch 'dev' into project-1-ai-standardization
mohammadsherif0 d74a0f2
feat(trigger): implement AI hook execution in trigger handling and en…
7fea88a
feat(trigger): add rerun functionality for completed queue items in t…
akash9676 4719b21
feat: enhance AI hook integration across services, updating key gener…
akash9676 0dba4b4
fix(assignment): update template check to use optional chaining for s…
akash9676 c6ad2e9
feat: introduce document data key normalization and enhance key gener…
akash9676 0cfd9d5
feat: add getHookResultKeyCandidates function to streamline key gener…
akash9676 88a50c1
fix: update API key validation to require either apiKey or apiBaseUrl
akash9676 8512f2c
feat: add button-click event handling to form components for enhanced…
akash9676 6714a14
refactor: simplify AI credential form by integrating BasicForm compon…
akash9676 6a6ba7e
fix: enforce requirement for either API key or base URL in AI credent…
akash9676 3f13b4f
feat(trigger): add new steps for trigger configuration including sett…
akash9676 271fcdf
refactor(trigger): streamline trigger components by consolidating pro…
akash9676 23026ad
Merge branch 'project-1-ai-standardization' into feat-224-triggers
akash9676 2a81324
Merge pull request #258 from UKPLab/feat-224-triggers
akash9676 8e64c01
refactor: refactor the validate forign owner
MRawhani b046249
fix: fixed the role-base budget capping
MRawhani ec30892
Merge branch 'project-1-ai-standardization' into feat-264-enhance_sha…
MRawhani 8221717
Merge pull request #271 from UKPLab/feat-264-enhance_sharing_function…
MRawhani 876db72
fix: add study sessions associate into AI log model
MRawhani 957ebb0
fix: add hook access check in budget capping
MRawhani e2cb304
fix: add test informaiton to ai log output
MRawhani 2992063
fix: change cap type 0 bug
MRawhani a9f1f7f
feat: add testing file for budget caps 29 cases
MRawhani 89cd80a
Merge branch 'dev' into project-1-ai-standardization
MRawhani 8978704
refactor: standardize deleted field definition across AI models and a…
akash9676 4f7c42a
refactor: enhance associations and soft-delete logic in AI credential…
akash9676 de2799f
refactor: replace getOwnedById with requireOwnedCredential for improv…
akash9676 0eddb1e
refactor: remove unnecessary whitespace in study session model for cl…
akash9676 2ee5d26
refactor: improve foreign key value retrieval logic in MetaModel for …
akash9676 dad0e10
refactor: optimize post-upload email and trigger handling to run asyn…
akash9676 a9e12f8
refactor: implement execution queue for trigger handling to enforce p…
akash9676 4bcf288
Merge branch 'project-1-ai-standardization' of https://github.com/UKP…
MRawhani 95a59f6
refactor: change author name
MRawhani b4ff038
refactor: remove comments from models to ensure conistentcy
MRawhani c15224c
refactor: merge extenison migration to old one that is not merged int…
MRawhani 2d6e299
refactor: remove legacy limits types helper
MRawhani f027af7
refactor: clean docs and formatting
MRawhani 87d2cf6
refactor: fix default false in ai budget
MRawhani 09e5410
refactor: change opts to options
MRawhani 67f4ae4
refactor: remove legacy pdf extraction in server
MRawhani c33c368
refactor : clarify placeholder helpers and simplify early returns
mohammadsherif0 8fbae89
refactor: change comments in radio
MRawhani f65d371
Merge branch 'dev' into project-1-ai-standardization
akash9676 9fbabf0
feat: implement provider selection for LiteLLM integration
akash9676 5987268
refactor: update nav_group order in migration to position Settings last
akash9676 f24a362
fix: update trigger name display for deleted triggers in TriggerLogs …
akash9676 147fdf4
feat: add searchable select functionality to form component
akash9676 29cf498
fix: adjust input mapping logic for table-based sources in InputMap c…
akash9676 7c399df
fix: update Select component to improve value handling and emit logic
akash9676 fe2d275
Merge branch 'dev' into project-1-ai-standardization
akash9676 d910dc8
fix: improve fallback handling and skill loading in NLPService
akash9676 b356ba4
refactor: use fs.promises for asynchronous file operations in nlp.js
akash9676 d412eb9
refactor: remove the hook name from document data
MRawhani 2f6d208
Merge branch 'project-1-ai-standardization' of https://github.com/UKP…
MRawhani 8985f3b
refactor: remove hook name form document data
MRawhani d31ece2
refactor: change column namings to match patterns
MRawhani a2f2b69
refactor: change name of the budget js file
MRawhani File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 82 additions & 0 deletions
82
backend/db/migrations/20260331100037-create-ai_credential.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| 'use strict'; | ||
|
|
||
| module.exports = { | ||
| async up(queryInterface, Sequelize) { | ||
| await queryInterface.createTable('ai_credential', { | ||
| id: { | ||
| type: Sequelize.INTEGER, | ||
| primaryKey: true, | ||
| autoIncrement: true, | ||
| allowNull: false, | ||
| }, | ||
| userId: { | ||
| type: Sequelize.INTEGER, | ||
| allowNull: false, | ||
| references: { | ||
| model: 'user', | ||
| key: 'id', | ||
| }, | ||
| onDelete: 'CASCADE', | ||
| onUpdate: 'CASCADE', | ||
| }, | ||
| name: { | ||
| type: Sequelize.STRING, | ||
| allowNull: false, | ||
| }, | ||
| apiKey: { | ||
| type: Sequelize.TEXT, | ||
| allowNull: true, | ||
| defaultValue: null, | ||
| }, | ||
| provider: { | ||
| type: Sequelize.STRING, | ||
| allowNull: true, | ||
| defaultValue: null, | ||
| }, | ||
| apiBaseUrl: { | ||
| type: Sequelize.STRING, | ||
| allowNull: true, | ||
| defaultValue: null, | ||
| }, | ||
| apiVersion: { | ||
| type: Sequelize.STRING, | ||
| allowNull: true, | ||
| defaultValue: null, | ||
| }, | ||
| additionalParameters: { | ||
| type: Sequelize.JSONB, | ||
| allowNull: true, | ||
| defaultValue: {}, | ||
| }, | ||
| enabled: { | ||
| type: Sequelize.BOOLEAN, | ||
| allowNull: false, | ||
| defaultValue: true, | ||
| }, | ||
| deleted: { | ||
| type: Sequelize.BOOLEAN, | ||
| allowNull: false, | ||
| defaultValue: false, | ||
| }, | ||
| deletedAt: { | ||
| type: Sequelize.DATE, | ||
| allowNull: true, | ||
| defaultValue: null, | ||
| }, | ||
| createdAt: { | ||
| type: Sequelize.DATE, | ||
| allowNull: false, | ||
| defaultValue: Sequelize.fn('NOW'), | ||
| }, | ||
| updatedAt: { | ||
| type: Sequelize.DATE, | ||
| allowNull: false, | ||
| defaultValue: Sequelize.fn('NOW'), | ||
| }, | ||
| }); | ||
| }, | ||
|
|
||
| async down(queryInterface, Sequelize) { | ||
| await queryInterface.dropTable('ai_credential'); | ||
| }, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| 'use strict'; | ||
|
|
||
| module.exports = { | ||
| async up(queryInterface, Sequelize) { | ||
| await queryInterface.createTable('ai_model', { | ||
| id: { | ||
| type: Sequelize.INTEGER, | ||
| primaryKey: true, | ||
| autoIncrement: true, | ||
| allowNull: false, | ||
| }, | ||
| aiCredentialId: { | ||
| type: Sequelize.INTEGER, | ||
| allowNull: true, | ||
| defaultValue: null, | ||
| references: { | ||
| model: 'ai_credential', | ||
| key: 'id', | ||
| }, | ||
| onDelete: 'SET NULL', | ||
| onUpdate: 'CASCADE', | ||
| }, | ||
| userId: { | ||
| type: Sequelize.INTEGER, | ||
| allowNull: false, | ||
| references: { | ||
| model: 'user', | ||
| key: 'id', | ||
| }, | ||
| onDelete: 'CASCADE', | ||
| onUpdate: 'CASCADE', | ||
| }, | ||
| name: { | ||
| type: Sequelize.STRING, | ||
| allowNull: false, | ||
| }, | ||
| model: { | ||
| type: Sequelize.STRING, | ||
| allowNull: false, | ||
| }, | ||
| description: { | ||
| type: Sequelize.TEXT, | ||
| allowNull: true, | ||
| defaultValue: null, | ||
| }, | ||
| additionalParameters: { | ||
| type: Sequelize.JSONB, | ||
| defaultValue: {}, | ||
| }, | ||
| enabled: { | ||
| type: Sequelize.BOOLEAN, | ||
| allowNull: false, | ||
| defaultValue: true, | ||
| }, | ||
| freeModel: { | ||
| type: Sequelize.BOOLEAN, | ||
| allowNull: false, | ||
| defaultValue: false, | ||
| }, | ||
| deleted: { | ||
| type: Sequelize.BOOLEAN, | ||
| allowNull: false, | ||
| defaultValue: false, | ||
| }, | ||
| deletedAt: { | ||
| type: Sequelize.DATE, | ||
| allowNull: true, | ||
| defaultValue: null, | ||
| }, | ||
| createdAt: { | ||
| type: Sequelize.DATE, | ||
| allowNull: false, | ||
| defaultValue: Sequelize.fn('NOW'), | ||
| }, | ||
| updatedAt: { | ||
| type: Sequelize.DATE, | ||
| allowNull: false, | ||
| defaultValue: Sequelize.fn('NOW'), | ||
| }, | ||
| }); | ||
| }, | ||
|
|
||
| async down(queryInterface, Sequelize) { | ||
| await queryInterface.dropTable('ai_model'); | ||
| }, | ||
| }; | ||
74 changes: 74 additions & 0 deletions
74
backend/db/migrations/20260331102200-create-ai_model_share.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| 'use strict'; | ||
|
|
||
| module.exports = { | ||
| async up(queryInterface, Sequelize) { | ||
| await queryInterface.createTable('ai_model_share', { | ||
| id: { | ||
| type: Sequelize.INTEGER, | ||
| primaryKey: true, | ||
| autoIncrement: true, | ||
| allowNull: false, | ||
| }, | ||
| aiModelId: { | ||
| type: Sequelize.INTEGER, | ||
| allowNull: false, | ||
| references: { | ||
| model: 'ai_model', | ||
| key: 'id', | ||
| }, | ||
| onDelete: 'CASCADE', | ||
| onUpdate: 'CASCADE', | ||
| }, | ||
| userId: { | ||
| type: Sequelize.INTEGER, | ||
| allowNull: true, | ||
| defaultValue: null, | ||
| references: { | ||
| model: 'user', | ||
| key: 'id', | ||
| }, | ||
| onDelete: 'CASCADE', | ||
| onUpdate: 'CASCADE', | ||
| }, | ||
| roleId: { | ||
| type: Sequelize.INTEGER, | ||
| allowNull: true, | ||
| defaultValue: null, | ||
| references: { | ||
| model: 'user_role', | ||
| key: 'id', | ||
| }, | ||
| onDelete: 'CASCADE', | ||
| onUpdate: 'CASCADE', | ||
| }, | ||
| expiryDate: { | ||
| type: Sequelize.DATE, | ||
| allowNull: false, | ||
| }, | ||
| deleted: { | ||
| type: Sequelize.BOOLEAN, | ||
| allowNull: false, | ||
| defaultValue: false, | ||
| }, | ||
| deletedAt: { | ||
| type: Sequelize.DATE, | ||
| allowNull: true, | ||
| defaultValue: null, | ||
| }, | ||
| createdAt: { | ||
| type: Sequelize.DATE, | ||
| allowNull: false, | ||
| defaultValue: Sequelize.fn('NOW'), | ||
| }, | ||
| updatedAt: { | ||
| type: Sequelize.DATE, | ||
| allowNull: false, | ||
| defaultValue: Sequelize.fn('NOW'), | ||
| }, | ||
| }); | ||
| }, | ||
|
|
||
| async down(queryInterface, Sequelize) { | ||
| await queryInterface.dropTable('ai_model_share'); | ||
| }, | ||
| }; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add allowNull for consistency