perf: log和向量对话

This commit is contained in:
archer
2023-04-06 22:24:23 +08:00
parent 87d35042de
commit fc7edcb54f
4 changed files with 8 additions and 53 deletions

View File

@@ -34,7 +34,6 @@ export const pushChatBill = async ({
// 计算价格
const unitPrice = modelItem?.price || 5;
const price = unitPrice * tokens;
console.log(`unit price: ${unitPrice}, price: ${formatPrice(price)}`);
try {
// 插入 Bill 记录
@@ -91,8 +90,6 @@ export const pushSplitDataBill = async ({
// 计算价格
const price = unitPrice * tokenLen;
console.log(`price: ${formatPrice(price)}`);
// 插入 Bill 记录
const res = await Bill.create({
userId,
@@ -143,8 +140,6 @@ export const pushGenerateVectorBill = async ({
let price = unitPrice * tokenLen;
price = price > 1 ? price : 1;
console.log(`price: ${formatPrice(price)}`);
// 插入 Bill 记录
const res = await Bill.create({
userId,

View File

@@ -30,13 +30,11 @@ export const jsonRes = <T = any>(
} else if (openaiError[error?.response?.statusText]) {
msg = openaiError[error.response.statusText];
}
console.log('error->');
console.log('code:', error.code);
console.log('msg:', msg);
console.log(`error-> msg:${msg}`);
// request 时候报错
if (error?.response) {
console.log('statusText:', error?.response?.statusText);
console.log('type:', error?.response?.data?.error?.type);
console.log('error data:', error?.response?.data);
}
}