summaryrefslogtreecommitdiff
path: root/continuedev
diff options
context:
space:
mode:
authorTy Dunn <ty@tydunn.com>2023-06-15 11:36:13 -0700
committerGitHub <noreply@github.com>2023-06-15 11:36:13 -0700
commitcdd04fc41edc6af6321c6e992228a09210944634 (patch)
treee2a20544cfe316e1ca6f5c7471c85b7e98e047c1 /continuedev
parenta947148bb726cda4bff68605661680e6041b0094 (diff)
parent9cf110602621f80d0971f698ee40e7d73d0fa2b7 (diff)
downloadsncontinue-cdd04fc41edc6af6321c6e992228a09210944634.tar.gz
sncontinue-cdd04fc41edc6af6321c6e992228a09210944634.tar.bz2
sncontinue-cdd04fc41edc6af6321c6e992228a09210944634.zip
Merge pull request #98 from continuedev/slash-commands
adds /edit and /explain commands
Diffstat (limited to 'continuedev')
-rw-r--r--continuedev/src/continuedev/core/config.py28
-rw-r--r--continuedev/src/continuedev/core/policy.py8
-rw-r--r--continuedev/src/continuedev/libs/util/step_name_to_steps.py18
3 files changed, 12 insertions, 42 deletions
diff --git a/continuedev/src/continuedev/core/config.py b/continuedev/src/continuedev/core/config.py
index 8ebdc145..a1c58399 100644
--- a/continuedev/src/continuedev/core/config.py
+++ b/continuedev/src/continuedev/core/config.py
@@ -27,26 +27,15 @@ class ContinueConfig(BaseModel):
# description="Write pytest unit tests for the current file",
# step_name="WritePytestsRecipe",
# params=??)
-
- SlashCommand(
- name="dlt",
- description="Create a dlt pipeline",
- step_name="CreatePipelineRecipe",
- ),
SlashCommand(
- name="ddtobq",
- description="Adjust a dlt pipeline to load data into BigQuery",
- step_name="DDtoBQRecipe",
+ name="edit",
+ description="Edit code in the current file or the highlighted code",
+ step_name="EditHighlightedCodeStep",
),
SlashCommand(
- name="addtransform",
- description="Add transforms to the chess.com API dlt pipeline.",
- step_name="AddTransformRecipe",
- ),
- SlashCommand(
- name="deployairflow",
- description="Deploy a dlt pipeline to Airflow",
- step_name="DeployPipelineAirflowRecipe",
+ name="explain",
+ description="Reply to instructions or a question with previous steps as context",
+ step_name="SimpleChatStep",
),
SlashCommand(
name="comment",
@@ -54,11 +43,6 @@ class ContinueConfig(BaseModel):
step_name="CommentCodeStep",
),
SlashCommand(
- name="pytest",
- description="Write pytest unit tests for the current file",
- step_name="WritePytestsRecipe",
- ),
- SlashCommand(
name="feedback",
description="Send feedback to improve Continue",
step_name="FeedbackStep",
diff --git a/continuedev/src/continuedev/core/policy.py b/continuedev/src/continuedev/core/policy.py
index 9fcda882..255f598d 100644
--- a/continuedev/src/continuedev/core/policy.py
+++ b/continuedev/src/continuedev/core/policy.py
@@ -26,7 +26,7 @@ class DemoPolicy(Policy):
# At the very start, run initial Steps spcecified in the config
if history.get_current() is None:
return (
- MessageStep(name="Welcome to Continue!", message="You can type a question or instructions for a file edit in the text box. If you highlight code, edits will be localized to the highlighted range. Otherwise, the currently open file is taken as context. If you type '/', you can see the list of available slash commands.") >>
+ MessageStep(name="Welcome to Continue!", message="Type '/' to see the list of available slash commands. If you highlight code, edits and explanations will be localized to the highlighted range. Otherwise, the currently open file is used. In both cases, the code is combined with the previous steps to construct the context.") >>
# SetupContinueWorkspaceStep() >>
# CreateCodebaseIndexChroma() >>
StepsOnStartupStep())
@@ -45,12 +45,6 @@ class DemoPolicy(Policy):
params["user_input"] = after_command
return get_step_from_name(slash_command.step_name, params)
- if "/ask" in user_input:
- return AnswerQuestionChroma(question=" ".join(user_input.split(" ")[1:]))
- elif "/edit" in user_input:
- return EditFileChroma(request=" ".join(user_input.split(" ")[1:]))
- elif "/step" in user_input:
- return ContinueStepStep(prompt=" ".join(user_input.split(" ")[1:]))
# return EditHighlightedCodeStep(user_input=user_input)
return NLDecisionStep(user_input=user_input, steps=[
(EditHighlightedCodeStep(user_input=user_input),
diff --git a/continuedev/src/continuedev/libs/util/step_name_to_steps.py b/continuedev/src/continuedev/libs/util/step_name_to_steps.py
index fd1aab5b..4dd9c430 100644
--- a/continuedev/src/continuedev/libs/util/step_name_to_steps.py
+++ b/continuedev/src/continuedev/libs/util/step_name_to_steps.py
@@ -2,23 +2,15 @@ from typing import Dict
from ...core.main import Step
from ...steps.core.core import UserInputStep
-from ...recipes.CreatePipelineRecipe.main import CreatePipelineRecipe
-from ...recipes.DDtoBQRecipe.main import DDtoBQRecipe
-from ...recipes.DeployPipelineAirflowRecipe.main import DeployPipelineAirflowRecipe
-from ...recipes.DDtoBQRecipe.main import DDtoBQRecipe
-from ...recipes.AddTransformRecipe.main import AddTransformRecipe
-from ...recipes.WritePytestsRecipe.main import WritePytestsRecipe
+from ...steps.main import EditHighlightedCodeStep
+from ...steps.chat import SimpleChatStep
from ...steps.comment_code import CommentCodeStep
from ...steps.feedback import FeedbackStep
step_name_to_step_class = {
"UserInputStep": UserInputStep,
- "CreatePipelineRecipe": CreatePipelineRecipe,
- "DDtoBQRecipe": DDtoBQRecipe,
- "DeployPipelineAirflowRecipe": DeployPipelineAirflowRecipe,
- "AddTransformRecipe": AddTransformRecipe,
- "DDtoBQRecipe": DDtoBQRecipe,
- "WritePytestsRecipe": WritePytestsRecipe,
+ "EditHighlightedCodeStep": EditHighlightedCodeStep,
+ "SimpleChatStep": SimpleChatStep,
"CommentCodeStep": CommentCodeStep,
"FeedbackStep": FeedbackStep,
}
@@ -30,4 +22,4 @@ def get_step_from_name(step_name: str, params: Dict) -> Step:
except:
print(
f"Incorrect parameters for step {step_name}. Parameters provided were: {params}")
- raise
+ raise \ No newline at end of file