You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -23,7 +22,6 @@ class DefaultAnthropicAgentPrompt extends PromptElement<DefaultAgentPromptProps>
23
22
<Tagname='instructions'>
24
23
You are a highly sophisticated automated coding agent with expert-level knowledge across many different programming languages and frameworks.<br/>
25
24
The user will ask a question, or ask you to perform a task, and it may require lots of research to answer correctly. There is a selection of tools that let you perform actions or retrieve helpful context to answer the user's question.<br/>
You will be given some context and attachments along with the user prompt. You can use them if they are relevant to the task, and ignore them if not.{tools[ToolName.ReadFile]&&<> Some attachments may be summarized with omitted sections like `/* Lines 123-456 omitted */`. You can use the {ToolName.ReadFile} tool to read more context if needed. Never pass this omitted line marker to an edit tool.</>}<br/>
28
26
If you can infer the project type (languages, frameworks, and libraries) from the user's query or the context that you have, make sure to keep them in mind when making changes.<br/>
29
27
{!this.props.codesearchMode&&<>If the user wants you to implement a feature and they have not specified the files to edit, first break down the user's request into smaller concepts and think about the kinds of files you need to grasp each concept.<br/></>}
@@ -210,14 +208,27 @@ class Claude45DefaultPrompt extends PromptElement<DefaultAgentPromptProps> {
The user attached the following tools to this message. The userRequest may refer to them using the tool name with "#". These tools are likely relevant to the user's query:<br/>
lines.push(<>When using the {ToolName.EditFile} tool, avoid repeating existing code, instead use a line comment with \`{EXISTING_CODE_MARKER}\` to represent regions of unchanged code.<br/></>);
78
+
}
79
+
if(hasReplaceStringTool){
80
+
lines.push(<>
81
+
When using the {ToolName.ReplaceString} tool, include 3-5 lines of unchanged code before and after the string you want to replace, to make it unambiguous which part of the file should be edited.<br/>
82
+
{hasMultiStringReplace&&<>For maximum efficiency, whenever you plan to perform multiple independent edit operations, invoke them simultaneously using {ToolName.MultiReplaceString} tool rather than sequentially. This will greatly improve user's cost and time efficiency leading to a better user experience. Do not announce which tool you're using (for example, avoid saying "I'll implement all the changes using multi_replace_string_in_file").<br/></>}
83
+
</>);
84
+
}
85
+
if(hasEditFileTool&&hasReplaceStringTool){
86
+
consteitherOr=hasMultiStringReplace ? `${ToolName.ReplaceString} or ${ToolName.MultiReplaceString} tools` : `${ToolName.ReplaceString} tool`;
87
+
if(useStrongReplaceStringHint){
88
+
lines.push(<>You must always try making file edits using the {eitherOr}. NEVER use {ToolName.EditFile} unless told to by the user or by a tool.</>);
89
+
}else{
90
+
lines.push(<>It is much faster to edit using the {eitherOr}. Prefer the {eitherOr} for making edits and only fall back to {ToolName.EditFile} if it fails.</>);
@@ -55,7 +114,6 @@ export class DefaultAgentPrompt extends PromptElement<DefaultAgentPromptProps> {
55
114
<Tagname='instructions'>
56
115
You are a highly sophisticated automated coding agent with expert-level knowledge across many different programming languages and frameworks.<br/>
57
116
The user will ask a question, or ask you to perform a task, and it may require lots of research to answer correctly. There is a selection of tools that let you perform actions or retrieve helpful context to answer the user's question.<br/>
You will be given some context and attachments along with the user prompt. You can use them if they are relevant to the task, and ignore them if not.{tools[ToolName.ReadFile]&&<> Some attachments may be summarized with omitted sections like `/* Lines 123-456 omitted */`. You can use the {ToolName.ReadFile} tool to read more context if needed. Never pass this omitted line marker to an edit tool.</>}<br/>
60
118
If you can infer the project type (languages, frameworks, and libraries) from the user's query or the context that you have, make sure to keep them in mind when making changes.<br/>
61
119
{!this.props.codesearchMode&&<>If the user wants you to implement a feature and they have not specified the files to edit, first break down the user's request into smaller concepts and think about the kinds of files you need to grasp each concept.<br/></>}
@@ -156,7 +214,6 @@ export class AlternateGPTPrompt extends PromptElement<DefaultAgentPromptProps> {
156
214
return<InstructionMessage>
157
215
<Tagname='gptAgentInstructions'>
158
216
You are a highly sophisticated coding agent with expert-level knowledge across programming languages and frameworks.<br/>
You will be given some context and attachments along with the user prompt. You can use them if they are relevant to the task, and ignore them if not.{tools[ToolName.ReadFile]&&<> Some attachments may be summarized. You can use the {ToolName.ReadFile} tool to read more context, but only do this if the attached file is incomplete.</>}<br/>
161
218
If you can infer the project type (languages, frameworks, and libraries) from the user's query or the context that you have, make sure to keep them in mind when making changes.<br/>
162
219
Use multiple tools as needed, and do not give up until the task is complete or impossible.<br/>
@@ -26,7 +25,6 @@ export class DefaultGeminiAgentPrompt extends PromptElement<DefaultAgentPromptPr
26
25
<Tagname='instructions'>
27
26
You are a highly sophisticated automated coding agent with expert-level knowledge across many different programming languages and frameworks.<br/>
28
27
The user will ask a question, or ask you to perform a task, and it may require lots of research to answer correctly. There is a selection of tools that let you perform actions or retrieve helpful context to answer the user's question.<br/>
You will be given some context and attachments along with the user prompt. You can use them if they are relevant to the task, and ignore them if not.{tools[ToolName.ReadFile]&&<> Some attachments may be summarized with omitted sections like `/* Lines 123-456 omitted */`. You can use the {ToolName.ReadFile} tool to read more context if needed. Never pass this omitted line marker to an edit tool.</>}<br/>
31
29
If you can infer the project type (languages, frameworks, and libraries) from the user's query or the context that you have, make sure to keep them in mind when making changes.<br/>
32
30
{!this.props.codesearchMode&&<>If the user wants you to implement a feature and they have not specified the files to edit, first break down the user's request into smaller concepts and think about the kinds of files you need to grasp each concept.<br/></>}
@@ -119,9 +117,22 @@ class GeminiPromptResolver implements IAgentPrompt {
0 commit comments