-
Notifications
You must be signed in to change notification settings - Fork 1
[FEATURE] Dashboard for AI Integration #143
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
Changes from 14 commits
7d49e0d
a6746d3
d88648f
42b6272
d4bfc99
a863bc3
836969a
84080c2
1f5d580
d6c7241
afb112b
9763115
4f48c1d
9d5f77e
a54b0b7
47af60d
376b1ba
e33159a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please delete this file as discussed, should be another pull request
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, ill remove the file, but another pull request? could you please explain how? |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,7 +14,7 @@ backend/sessions | |
| backend/node_modules | ||
| backend/logs | ||
| backend/coverage | ||
|
|
||
| logs/ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We dont need this change we are already ignoring the logs in backend
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, I have seen this in the current commit |
||
| # ignore build files | ||
| dist/ | ||
| frontend/node_modules | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is that needed?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was added so that when we run
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dennis-zyska do we need that file though?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we usually don't use the command without the make file, so usually the envs are set. I wonder if it would always overwrite the current one with the .env (because we have multiple .env files), and the others would not work anymore |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ | |
| * | ||
| * @author Nils Dycke | ||
| */ | ||
|
|
||
| module.exports = { | ||
| development: { | ||
| username: 'postgres', | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| 'use strict'; | ||
|
|
||
| module.exports = { | ||
| async up(queryInterface, Sequelize) { | ||
| await queryInterface.createTable('llm_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: false, | ||
| }, | ||
| 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('llm_credential'); | ||
| }, | ||
| }; |
| 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('llm_model', { | ||
| id: { | ||
| type: Sequelize.INTEGER, | ||
| primaryKey: true, | ||
| autoIncrement: true, | ||
| allowNull: false, | ||
| }, | ||
| llmCredentialId: { | ||
| type: Sequelize.INTEGER, | ||
| allowNull: true, | ||
| defaultValue: null, | ||
| references: { | ||
| model: 'llm_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, | ||
| }, | ||
| provider: { | ||
| type: Sequelize.STRING, | ||
| allowNull: false, | ||
| }, | ||
| description: { | ||
| type: Sequelize.TEXT, | ||
| 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('llm_model'); | ||
| }, | ||
| }; |
| 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('llm_credential_share', { | ||
| id: { | ||
| type: Sequelize.INTEGER, | ||
| primaryKey: true, | ||
| autoIncrement: true, | ||
| allowNull: false, | ||
| }, | ||
| llmCredentialId: { | ||
| type: Sequelize.INTEGER, | ||
| allowNull: false, | ||
| references: { | ||
| model: 'llm_credential', | ||
| 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: 'study', | ||
| 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('llm_credential_share'); | ||
| }, | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,125 @@ | ||
| 'use strict'; | ||
|
|
||
| module.exports = { | ||
| async up(queryInterface, Sequelize) { | ||
| await queryInterface.createTable('llm_log', { | ||
| 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', | ||
| }, | ||
| llmModelId: { | ||
| type: Sequelize.INTEGER, | ||
| allowNull: false, | ||
| references: { | ||
| model: 'llm_model', | ||
| key: 'id', | ||
| }, | ||
| onDelete: 'CASCADE', | ||
| onUpdate: 'CASCADE', | ||
| }, | ||
| documentId: { | ||
| type: Sequelize.INTEGER, | ||
| allowNull: true, | ||
| defaultValue: null, | ||
| }, | ||
| studySessionId: { | ||
| type: Sequelize.INTEGER, | ||
| allowNull: true, | ||
| defaultValue: null, | ||
| }, | ||
| studyStepId: { | ||
| type: Sequelize.INTEGER, | ||
| allowNull: true, | ||
| defaultValue: null, | ||
| }, | ||
| requestId: { | ||
| type: Sequelize.STRING, | ||
| allowNull: true, | ||
| defaultValue: null, | ||
| }, | ||
| input: { | ||
| type: Sequelize.TEXT, | ||
| allowNull: true, | ||
| }, | ||
| output: { | ||
| type: Sequelize.TEXT, | ||
| allowNull: true, | ||
| }, | ||
| reasoning: { | ||
| type: Sequelize.TEXT, | ||
| allowNull: true, | ||
| }, | ||
| inputTokens: { | ||
| type: Sequelize.INTEGER, | ||
| allowNull: true, | ||
| defaultValue: null, | ||
| }, | ||
| outputTokens: { | ||
| type: Sequelize.INTEGER, | ||
| allowNull: true, | ||
| defaultValue: null, | ||
| }, | ||
| reasoningTokens: { | ||
| type: Sequelize.INTEGER, | ||
| allowNull: true, | ||
| defaultValue: null, | ||
| }, | ||
| total_tokens: { | ||
| type: Sequelize.INTEGER, | ||
| allowNull: true, | ||
| defaultValue: null, | ||
| }, | ||
| costs: { | ||
| type: Sequelize.FLOAT, | ||
| allowNull: true, | ||
| defaultValue: null, | ||
| }, | ||
| status: { | ||
| type: Sequelize.STRING, | ||
| allowNull: false, | ||
| defaultValue: 'success', | ||
| }, | ||
| requestStart: { | ||
| type: Sequelize.DATE, | ||
| allowNull: true, | ||
| defaultValue: null, | ||
| }, | ||
| 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('llm_log'); | ||
| }, | ||
| }; |
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.
please delete this file in this pull request, should be another pull request as discussed