mirror of
https://github.com/labring/FastGPT.git
synced 2025-08-02 12:48:30 +00:00
V4.6.6-2 (#673)
This commit is contained in:
@@ -136,7 +136,6 @@ ${replaceVariable(Prompt_AgentQA.fixedText, { text })}`;
|
||||
stream: false
|
||||
});
|
||||
const answer = chatResponse.choices?.[0].message?.content || '';
|
||||
const totalTokens = chatResponse.usage?.total_tokens || 0;
|
||||
|
||||
const qaArr = formatSplitText(answer, text); // 格式化后的QA对
|
||||
|
||||
@@ -167,7 +166,8 @@ ${replaceVariable(Prompt_AgentQA.fixedText, { text })}`;
|
||||
pushQABill({
|
||||
teamId: data.teamId,
|
||||
tmbId: data.tmbId,
|
||||
totalTokens,
|
||||
inputTokens: chatResponse.usage?.prompt_tokens || 0,
|
||||
outputTokens: chatResponse.usage?.completion_tokens || 0,
|
||||
billId: data.billId,
|
||||
model
|
||||
});
|
||||
|
@@ -129,7 +129,7 @@ export async function generateVector(): Promise<any> {
|
||||
}
|
||||
|
||||
// insert data to pg
|
||||
const { tokenLen } = await insertData2Dataset({
|
||||
const { tokens } = await insertData2Dataset({
|
||||
teamId: data.teamId,
|
||||
tmbId: data.tmbId,
|
||||
datasetId: data.datasetId,
|
||||
@@ -145,7 +145,7 @@ export async function generateVector(): Promise<any> {
|
||||
pushGenerateVectorBill({
|
||||
teamId: data.teamId,
|
||||
tmbId: data.tmbId,
|
||||
tokenLen: tokenLen,
|
||||
tokens,
|
||||
model: data.model,
|
||||
billId: data.billId
|
||||
});
|
||||
|
Reference in New Issue
Block a user