update user input step to see input for cust cmds

This commit is contained in:
Nate Sesti 2023-07-06 23:42:26 -07:00
parent 19accc4d4f
commit d29b53522c
4 changed files with 8 additions and 12 deletions

View file

@ -82,6 +82,6 @@ class DemoPolicy(Policy):
if custom_command is not None:
return custom_command
return SimpleChatStep(user_input=user_input)
return SimpleChatStep()
return None

View file

@ -19,17 +19,11 @@ openai.api_key = OPENAI_API_KEY
class SimpleChatStep(Step):
user_input: str
name: str = "Generating Response..."
manage_own_chat_context: bool = True
description: str = ""
async def run(self, sdk: ContinueSDK):
if self.user_input.strip() == "":
self.user_input = "Explain this code's function is a concise list of markdown bullets."
self.description = ""
await sdk.update_ui()
completion = ""
async for chunk in sdk.models.gpt4.stream_chat(await sdk.get_chat_context()):
if sdk.current_step_was_deleted():

View file

@ -1,5 +1,6 @@
from ..core.main import Step
from ..core.sdk import ContinueSDK
from ..steps.core.core import UserInputStep
from ..steps.chat import ChatWithFunctions, SimpleChatStep
@ -14,4 +15,5 @@ class CustomCommandStep(Step):
async def run(self, sdk: ContinueSDK):
prompt_user_input = f"Task: {self.prompt}. Additional info: {self.user_input}"
await sdk.run_step(SimpleChatStep(user_input=prompt_user_input))
await sdk.run_step(UserInputStep(user_input=self.user_input))
await sdk.run_step(SimpleChatStep())

View file

@ -1,4 +1,6 @@
import os
from .core.core import UserInputStep
from ..core.main import ChatMessage, Step
from ..core.sdk import ContinueSDK
from .chat import SimpleChatStep
@ -21,7 +23,5 @@ class DefaultOnTracebackStep(Step):
content=f"The contents of {seg}:\n```\n{file_contents}\n```",
summary=""
))
await sdk.run_step(SimpleChatStep(
name="Help With Traceback",
user_input=f"""I got the following error, can you please help explain how to fix it?\n\n{self.output}"""))
await sdk.run_step(UserInputStep(user_input=f"""I got the following error, can you please help explain how to fix it?\n\n{self.output}"""))
await sdk.run_step(SimpleChatStep(name="Help With Traceback"))