Download api/models/schema/transaction.js from Zhitomir/chat: direct link, hf CLI and curl.
- Browser
- Download file 685 Bytes
-
https://huggingface.co/spaces/Zhitomir/chat/resolve/main/api/models/schema/transaction.js
- Command line
-
hf download hf://spaces/Zhitomir/chat/api/models/schema/transaction.js
-
curl -L -o transaction.js https://huggingface.co/spaces/Zhitomir/chat/resolve/main/api/models/schema/transaction.js
685 Bytes
| 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, | |
| }, | |
| rate: Number, | |
| rawAmount: Number, | |
| tokenValue: Number, | |
| }, | |
| { | |
| timestamps: true, | |
| }, | |
| ); | |
| module.exports = transactionSchema; | |