Merge pull request #3177 from continuedev/pe/sys-msg-updates
feat: use lazy edit sys msg for `gpt-4o` and `mistral-large` families
This commit is contained in:
commit
c2caf8529b
1 changed files with 4 additions and 1 deletions
|
|
@ -1,7 +1,10 @@
|
|||
import { ChatHistoryItem, ChatMessage, MessagePart } from "../index.js";
|
||||
import { normalizeToMessageParts } from "../util/messageContent.js";
|
||||
|
||||
import { modelSupportsTools } from "./autodetect.js";
|
||||
|
||||
const CUSTOM_SYS_MSG_MODEL_FAMILIES = ["sonnet", "gpt-4o", "mistral-large"];
|
||||
|
||||
const SYSTEM_MESSAGE = `When generating new code:
|
||||
|
||||
1. Always produce a single code block.
|
||||
|
|
@ -64,7 +67,7 @@ const TOOL_USE_RULES = `When using tools, follow the following guidelines:
|
|||
- Avoid calling tools unless they are absolutely necessary. For example, if you are asked a simple programming question you do not need web search. As another example, if the user asks you to explain something about code, do not create a new file.`;
|
||||
|
||||
function constructSystemPrompt(model: string): string | null {
|
||||
if (model.includes("sonnet")) {
|
||||
if (CUSTOM_SYS_MSG_MODEL_FAMILIES.some((family) => model.includes(family))) {
|
||||
return SYSTEM_MESSAGE + "\n\n" + TOOL_USE_RULES;
|
||||
}
|
||||
if (modelSupportsTools(model)) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue