fix: Proper formatting for anthropic vs non anthropic prompts (#570)

This commit is contained in:
Brace Sproul 2025-07-28 11:41:24 -07:00 • committed by GitHub
parent 8e5414ce2b
commit c99ec10514
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -80,15 +80,13 @@ const formatStaticInstructionsPrompt = (
state: GraphState, state: GraphState,
isAnthropicModel: boolean, isAnthropicModel: boolean,
) => { ) => {
return isAnthropicModel return (
? STATIC_ANTHROPIC_SYSTEM_INSTRUCTIONS isAnthropicModel
: STATIC_SYSTEM_INSTRUCTIONS.replaceAll( ? STATIC_ANTHROPIC_SYSTEM_INSTRUCTIONS
"{REPO_DIRECTORY}", : STATIC_SYSTEM_INSTRUCTIONS
getRepoAbsolutePath(state.targetRepository), )
).replaceAll( .replaceAll("{REPO_DIRECTORY}", getRepoAbsolutePath(state.targetRepository))
"{CUSTOM_RULES}", .replaceAll("{CUSTOM_RULES}", formatCustomRulesPrompt(state.customRules));
formatCustomRulesPrompt(state.customRules),
);
}; };
const formatCacheablePrompt = ( const formatCacheablePrompt = (