feat: 添加系统提示词对模型的不同叫法

This commit is contained in:
A-Cepheus
2024-04-24 14:49:23 +08:00
parent d12cf44d06
commit 0d66756f61
2 changed files with 12 additions and 1 deletions

View File

@@ -13,6 +13,7 @@ import {
StoreKey,
SUMMARIZE_MODEL,
GEMINI_SUMMARIZE_MODEL,
ModelNameToName,
} from "../constant";
import { ClientApi, RequestMessage, MultimodalContent } from "../client/api";
import { ChatControllerPool } from "../client/controller";
@@ -105,6 +106,8 @@ function countMessages(msgs: ChatMessage[]) {
function fillTemplateWith(input: string, modelConfig: ModelConfig) {
const cutoff =
KnowledgeCutOffDate[modelConfig.model] ?? KnowledgeCutOffDate.default;
const modelname =
ModelNameToName[modelConfig.model] ?? ModelNameToName.default;
// Find the model in the DEFAULT_MODELS array that matches the modelConfig.model
const modelInfo = DEFAULT_MODELS.find((m) => m.name === modelConfig.model);
@@ -118,6 +121,7 @@ function fillTemplateWith(input: string, modelConfig: ModelConfig) {
const vars = {
ServiceProvider: serviceProvider,
modelname,
cutoff,
model: modelConfig.model,
time: new Date().toString(),