mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-28 00:56:26 +00:00
fix: gpt35 4k
This commit is contained in:
@@ -87,7 +87,7 @@ export async function generateQA(): Promise<any> {
|
||||
// 请求 chatgpt 获取回答
|
||||
const response = await Promise.all(
|
||||
[data.q].map((text) =>
|
||||
modelServiceToolMap[OpenAiChatEnum.GPT35]
|
||||
modelServiceToolMap[OpenAiChatEnum.GPT3516k]
|
||||
.chatCompletion({
|
||||
apiKey: systemAuthKey,
|
||||
temperature: 0.8,
|
||||
|
@@ -104,7 +104,7 @@ export const pushSplitDataBill = async ({
|
||||
await connectToDatabase();
|
||||
|
||||
// 获取模型单价格, 都是用 gpt35 拆分
|
||||
const unitPrice = ChatModelMap[OpenAiChatEnum.GPT35].price || 3;
|
||||
const unitPrice = ChatModelMap[OpenAiChatEnum.GPT3516k].price || 3;
|
||||
// 计算价格
|
||||
const price = unitPrice * totalTokens;
|
||||
|
||||
@@ -112,7 +112,7 @@ export const pushSplitDataBill = async ({
|
||||
const res = await Bill.create({
|
||||
userId,
|
||||
type,
|
||||
modelName: OpenAiChatEnum.GPT35,
|
||||
modelName: OpenAiChatEnum.GPT3516k,
|
||||
textLen,
|
||||
tokenLen: totalTokens,
|
||||
price
|
||||
|
@@ -57,7 +57,7 @@ const ModelSchema = new Schema({
|
||||
// 聊天时使用的模型
|
||||
type: String,
|
||||
enum: Object.keys(ChatModelMap),
|
||||
default: OpenAiChatEnum.GPT35
|
||||
default: OpenAiChatEnum.GPT3516k
|
||||
}
|
||||
},
|
||||
share: {
|
||||
|
@@ -162,6 +162,10 @@ export const getApiKey = async ({
|
||||
userOpenAiKey: user.openaiKey || '',
|
||||
systemAuthKey: getSystemOpenAiKey(type) as string
|
||||
},
|
||||
[OpenAiChatEnum.GPT3516k]: {
|
||||
userOpenAiKey: user.openaiKey || '',
|
||||
systemAuthKey: getSystemOpenAiKey(type) as string
|
||||
},
|
||||
[OpenAiChatEnum.GPT4]: {
|
||||
userOpenAiKey: user.openaiKey || '',
|
||||
systemAuthKey: getGpt4Key() as string
|
||||
|
@@ -48,6 +48,15 @@ export const modelServiceToolMap: Record<
|
||||
...data
|
||||
})
|
||||
},
|
||||
[OpenAiChatEnum.GPT3516k]: {
|
||||
chatCompletion: (data: ChatCompletionType) =>
|
||||
chatResponse({ model: OpenAiChatEnum.GPT3516k, ...data }),
|
||||
streamResponse: (data: StreamResponseType) =>
|
||||
openAiStreamResponse({
|
||||
model: OpenAiChatEnum.GPT3516k,
|
||||
...data
|
||||
})
|
||||
},
|
||||
[OpenAiChatEnum.GPT4]: {
|
||||
chatCompletion: (data: ChatCompletionType) =>
|
||||
chatResponse({ model: OpenAiChatEnum.GPT4, ...data }),
|
||||
|
Reference in New Issue
Block a user