don't use tools system message when tools off

This commit is contained in:
Nate 2024-12-18 20:06:15 -08:00
parent 1549fd77aa
commit 0f05f580ef

View file

@ -71,10 +71,16 @@ function constructSystemPrompt(
provider: string,
useTools: boolean,
): string | null {
if (CUSTOM_SYS_MSG_MODEL_FAMILIES.some((family) => model.includes(family))) {
if (
useTools &&
CUSTOM_SYS_MSG_MODEL_FAMILIES.some((family) => model.includes(family))
) {
return SYSTEM_MESSAGE + "\n\n" + TOOL_USE_RULES;
}
if (useTools && modelSupportsTools(model, provider)) {
} else if (
CUSTOM_SYS_MSG_MODEL_FAMILIES.some((family) => model.includes(family))
) {
return SYSTEM_MESSAGE;
} else if (useTools && modelSupportsTools(model, provider)) {
return TOOL_USE_RULES;
}