|
3 | 3 | * Licensed under the MIT License. See License.txt in the project root for license information. |
4 | 4 | *--------------------------------------------------------------------------------------------*/ |
5 | 5 |
|
6 | | -import { BasePromptElementProps, PromptElement, PromptElementProps, PromptSizing } from '@vscode/prompt-tsx'; |
| 6 | +import { BasePromptElementProps, PromptElement, PromptElementProps, PromptPiece, PromptSizing } from '@vscode/prompt-tsx'; |
7 | 7 | import type { LanguageModelToolInformation } from 'vscode'; |
8 | 8 | import { ConfigKey, IConfigurationService } from '../../../../platform/configuration/common/configurationService'; |
9 | 9 | import { CUSTOM_TOOL_SEARCH_NAME, isAnthropicContextEditingEnabled, isAnthropicCustomToolSearchEnabled, isAnthropicToolSearchEnabled, nonDeferredToolNames, TOOL_SEARCH_TOOL_NAME } from '../../../../platform/networking/common/anthropic'; |
@@ -541,11 +541,11 @@ class Claude46OptimizedBasePrompt extends PromptElement<DefaultAgentPromptProps> |
541 | 541 | super(props); |
542 | 542 | } |
543 | 543 |
|
544 | | - protected renderExplorationGuidance(_tools: ReturnType<typeof detectToolCapabilities>): any { |
| 544 | + protected renderExplorationGuidance(_tools: ReturnType<typeof detectToolCapabilities>): PromptPiece | undefined { |
545 | 545 | return undefined; |
546 | 546 | } |
547 | 547 |
|
548 | | - protected renderParallelizationStrategy(): any { |
| 548 | + protected renderParallelizationStrategy(): PromptPiece | undefined { |
549 | 549 | return undefined; |
550 | 550 | } |
551 | 551 |
|
@@ -716,10 +716,10 @@ class AnthropicReminderInstructionsOptimized extends PromptElement<ReminderInstr |
716 | 716 | const contextEditingEnabled = isAnthropicContextEditingEnabled(this.props.endpoint, this.configurationService, this.experimentationService); |
717 | 717 |
|
718 | 718 | return <> |
719 | | - When using {ToolName.EditFile}, use line comments with `{EXISTING_CODE_MARKER}` to represent unchanged regions.<br /> |
720 | | - When using {ToolName.ReplaceString}, include 3-5 lines of unchanged context before and after the target string.<br /> |
721 | | - For multiple independent edits, use {ToolName.MultiReplaceString} simultaneously rather than sequential {ToolName.ReplaceString} calls.<br /> |
722 | | - Prefer {ToolName.ReplaceString} or {ToolName.MultiReplaceString} over {ToolName.EditFile}.<br /> |
| 719 | + {this.props.hasEditFileTool && <>When using {ToolName.EditFile}, use line comments with `{EXISTING_CODE_MARKER}` to represent unchanged regions.<br /></>} |
| 720 | + {this.props.hasReplaceStringTool && <>When using {ToolName.ReplaceString}, include 3-5 lines of unchanged context before and after the target string.<br /></>} |
| 721 | + {this.props.hasMultiReplaceStringTool && <>For multiple independent edits, use {ToolName.MultiReplaceString} simultaneously rather than sequential {ToolName.ReplaceString} calls.<br /></>} |
| 722 | + {this.props.hasEditFileTool && this.props.hasReplaceStringTool && <>Prefer {ToolName.ReplaceString}{this.props.hasMultiReplaceStringTool ? <> or {ToolName.MultiReplaceString}</> : ''} over {ToolName.EditFile}.<br /></>} |
723 | 723 | Do NOT create markdown files to document changes unless requested.<br /> |
724 | 724 | {contextEditingEnabled && <> |
725 | 725 | Do NOT view your memory directory before every task. Your context is managed automatically. Only use memory as described in memoryInstructions.<br /> |
|
0 commit comments