summaryrefslogtreecommitdiff
path: root/continuedev
diff options
context:
space:
mode:
authorNate Sesti <sestinj@gmail.com>2023-09-01 14:43:51 -0700
committerNate Sesti <sestinj@gmail.com>2023-09-01 14:43:51 -0700
commit5c8b28b7fddf5b214de61102c768ef44d4087870 (patch)
tree3c40b10b80afc3706ef6719b805dfe29c3827b0e /continuedev
parent040872381660e2b8e95e43b1cd762addc0e3706e (diff)
downloadsncontinue-5c8b28b7fddf5b214de61102c768ef44d4087870.tar.gz
sncontinue-5c8b28b7fddf5b214de61102c768ef44d4087870.tar.bz2
sncontinue-5c8b28b7fddf5b214de61102c768ef44d4087870.zip
feat: :sparkles: allow changing the summary prompt
Diffstat (limited to 'continuedev')
-rw-r--r--continuedev/src/continuedev/plugins/steps/core/core.py4
-rw-r--r--continuedev/src/continuedev/plugins/steps/main.py18
2 files changed, 14 insertions, 8 deletions
diff --git a/continuedev/src/continuedev/plugins/steps/core/core.py b/continuedev/src/continuedev/plugins/steps/core/core.py
index 1529fe1b..2c7416aa 100644
--- a/continuedev/src/continuedev/plugins/steps/core/core.py
+++ b/continuedev/src/continuedev/plugins/steps/core/core.py
@@ -208,6 +208,8 @@ class DefaultModelEditCodeStep(Step):
_new_contents: str = ""
_prompt_and_completion: str = ""
+ summary_prompt: str = "Please give brief a description of the changes made above using markdown bullet points. Be concise:"
+
async def describe(self, models: Models) -> Coroutine[str, None, None]:
if self._previous_contents.strip() == self._new_contents.strip():
description = "No edits were made"
@@ -227,7 +229,7 @@ class DefaultModelEditCodeStep(Step):
{changes}
```
- Please give brief a description of the changes made above using markdown bullet points. Be concise:"""
+ {self.summary_prompt}"""
)
)
name = await models.medium.complete(
diff --git a/continuedev/src/continuedev/plugins/steps/main.py b/continuedev/src/continuedev/plugins/steps/main.py
index 2ceb82c5..ca15aaab 100644
--- a/continuedev/src/continuedev/plugins/steps/main.py
+++ b/continuedev/src/continuedev/plugins/steps/main.py
@@ -245,6 +245,8 @@ class EditHighlightedCodeStep(Step):
hide = True
description: str = "Change the contents of the currently highlighted code or open file. You should call this function if the user asks seems to be asking for a code change."
+ summary_prompt: Optional[str] = None
+
async def describe(self, models: Models) -> Coroutine[str, None, None]:
return "Editing code"
@@ -293,13 +295,15 @@ class EditHighlightedCodeStep(Step):
self.description = "Please accept or reject the change before making another edit in this file."
return
- await sdk.run_step(
- DefaultModelEditCodeStep(
- user_input=self.user_input,
- range_in_files=range_in_files,
- model=self.model,
- )
- )
+ args = {
+ "user_input": self.user_input,
+ "range_in_files": range_in_files,
+ "model": self.model,
+ }
+ if self.summary_prompt:
+ args["summary_prompt"] = self.summary_prompt
+
+ await sdk.run_step(DefaultModelEditCodeStep(**args))
class UserInputStep(Step):