mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-09-22 08:12:00 +02:00
34 lines
575 B
JavaScript
34 lines
575 B
JavaScript
![]() |
const mongoose = require('mongoose');
|
||
|
|
||
|
const transactionSchema = mongoose.Schema({
|
||
|
user: {
|
||
|
type: mongoose.Schema.Types.ObjectId,
|
||
|
ref: 'User',
|
||
|
index: true,
|
||
|
required: true,
|
||
|
},
|
||
|
conversationId: {
|
||
|
type: String,
|
||
|
ref: 'Conversation',
|
||
|
index: true,
|
||
|
},
|
||
|
tokenType: {
|
||
|
type: String,
|
||
|
enum: ['prompt', 'completion', 'credits'],
|
||
|
required: true,
|
||
|
},
|
||
|
model: {
|
||
|
type: String,
|
||
|
},
|
||
|
context: {
|
||
|
type: String,
|
||
|
},
|
||
|
valueKey: {
|
||
|
type: String,
|
||
|
},
|
||
|
rawAmount: Number,
|
||
|
tokenValue: Number,
|
||
|
});
|
||
|
|
||
|
module.exports = transactionSchema;
|