Merge pull request #180 from continuedev/slash-cmd

adding config slash command
This commit is contained in:
Ty Dunn 2023-07-03 21:47:20 -07:00 • committed by GitHub
commit 022cbb382b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 1 deletions

View file

@ -43,6 +43,11 @@ class ContinueConfig(BaseModel):
description="Reply to instructions or a question with previous steps and the highlighted code or current file as context",
step_name="SimpleChatStep",
),
SlashCommand(
name="config",
description="Open the config file to create new and edit existing slash commands",
step_name="OpenConfigStep",
),
SlashCommand(
name="comment",
description="Write comments for the current file or highlighted code",

View file

@ -12,6 +12,7 @@ from ...recipes.DDtoBQRecipe.main import DDtoBQRecipe
from ...recipes.DeployPipelineAirflowRecipe.main import DeployPipelineAirflowRecipe
from ...steps.on_traceback import DefaultOnTracebackStep
from ...steps.clear_history import ClearHistoryStep
from ...steps.open_config import OpenConfigStep
# This mapping is used to convert from string in ContinueConfig json to corresponding Step class.
# Used for example in slash_commands and steps_on_startup
@ -27,6 +28,7 @@ step_name_to_step_class = {
"DeployPipelineAirflowRecipe": DeployPipelineAirflowRecipe,
"DefaultOnTracebackStep": DefaultOnTracebackStep,
"ClearHistoryStep": ClearHistoryStep,
"OpenConfigStep": OpenConfigStep
}

View file

@ -148,7 +148,7 @@ async def websocket_endpoint(websocket: WebSocket, session: Session = Depends(we
# Update any history that may have happened before connection
await protocol.send_available_slash_commands()
# await protocol.send_state_update() THIS WAS CAUSING A LOT OF ISSUES. Don't uncomment.
await protocol.send_state_update()
while AppStatus.should_exit is False:
message = await websocket.receive_text()