feat: gpt3流响应
This commit is contained in:
@@ -28,7 +28,9 @@ export const pushBill = async ({
|
||||
|
||||
// 计算价格
|
||||
const price = unitPrice * tokens.length;
|
||||
console.log('token len:', tokens.length, 'price: ', `${formatPrice(price)}元`);
|
||||
console.log('token len:', tokens.length);
|
||||
console.log('text len: ', text.length);
|
||||
console.log('price: ', `${formatPrice(price)}元`);
|
||||
|
||||
try {
|
||||
// 插入 Bill 记录
|
||||
|
||||
@@ -39,9 +39,9 @@ const ModelSchema = new Schema({
|
||||
},
|
||||
temperature: {
|
||||
type: Number,
|
||||
min: 1,
|
||||
min: 0,
|
||||
max: 10,
|
||||
default: 5
|
||||
default: 4
|
||||
},
|
||||
service: {
|
||||
company: {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Schema, model, models } from 'mongoose';
|
||||
import { hashPassword } from '@/service/utils/tools';
|
||||
import { PRICE_SCALE } from '@/utils/user';
|
||||
import { PRICE_SCALE } from '@/constants/common';
|
||||
|
||||
const UserSchema = new Schema({
|
||||
email: {
|
||||
|
||||
@@ -28,11 +28,11 @@ export const jsonRes = <T = any>(
|
||||
} else if (openaiError[error?.response?.statusText]) {
|
||||
msg = openaiError[error.response.statusText];
|
||||
}
|
||||
// console.log(error?.response);
|
||||
console.log('error->');
|
||||
console.log('code:', error.code);
|
||||
console.log('statusText:', error?.response?.statusText);
|
||||
console.log('msg:', msg);
|
||||
error?.response && console.log('chat err:', error?.response);
|
||||
}
|
||||
|
||||
res.json({
|
||||
|
||||
Reference in New Issue
Block a user