mirror of
https://github.com/labring/FastGPT.git
synced 2025-08-01 20:27:45 +00:00
fix: apikey
This commit is contained in:
@@ -39,7 +39,12 @@ export async function openaiEmbedding({
|
||||
input,
|
||||
mustPay = false
|
||||
}: { userId: string; mustPay?: boolean } & Props) {
|
||||
const apiKey = getSystemOpenAiKey();
|
||||
const { userOpenAiKey, systemAuthKey } = await getApiKey({
|
||||
model: 'gpt-3.5-turbo',
|
||||
userId,
|
||||
mustPay
|
||||
});
|
||||
const apiKey = userOpenAiKey || systemAuthKey;
|
||||
|
||||
// 获取 chatAPI
|
||||
const chatAPI = getOpenAIApi(apiKey);
|
||||
@@ -68,7 +73,7 @@ export async function openaiEmbedding({
|
||||
});
|
||||
|
||||
pushGenerateVectorBill({
|
||||
isPay: mustPay,
|
||||
isPay: !userOpenAiKey,
|
||||
userId,
|
||||
text: input.join(''),
|
||||
tokenLen: result.tokenLen
|
||||
|
Reference in New Issue
Block a user