summaryrefslogtreecommitdiff
path: root/continuedev
diff options
context:
space:
mode:
authorNate Sesti <sestinj@gmail.com>2023-06-05 12:09:13 -0400
committerNate Sesti <sestinj@gmail.com>2023-06-05 12:09:13 -0400
commit9613750fd1ff48343e8d80ce5154733a4dbc55d7 (patch)
tree3bf81bdabf4a5232d99266a1e1a06ffbfc60a4d6 /continuedev
parent99d0cf12dcd1481e719e78483fc7df080dc95954 (diff)
downloadsncontinue-9613750fd1ff48343e8d80ce5154733a4dbc55d7.tar.gz
sncontinue-9613750fd1ff48343e8d80ce5154733a4dbc55d7.tar.bz2
sncontinue-9613750fd1ff48343e8d80ce5154733a4dbc55d7.zip
Enter button on user input
Diffstat (limited to 'continuedev')
-rw-r--r--continuedev/src/continuedev/core/policy.py5
-rw-r--r--continuedev/src/continuedev/recipes/CreatePipelineRecipe/main.py9
-rw-r--r--continuedev/src/continuedev/steps/core/core.py7
3 files changed, 16 insertions, 5 deletions
diff --git a/continuedev/src/continuedev/core/policy.py b/continuedev/src/continuedev/core/policy.py
index 4287bb6e..e65b6c9d 100644
--- a/continuedev/src/continuedev/core/policy.py
+++ b/continuedev/src/continuedev/core/policy.py
@@ -17,7 +17,10 @@ class DemoPolicy(Policy):
def next(self, history: History) -> Step:
# At the very start, run initial Steps spcecified in the config
if history.get_current() is None:
- return MessageStep(message="Welcome to Continue!") >> SetupContinueWorkspaceStep() >> CreateCodebaseIndexChroma() >> StepsOnStartupStep()
+ return (MessageStep(message="Welcome to Continue!") >>
+ SetupContinueWorkspaceStep() >>
+ CreateCodebaseIndexChroma() >>
+ StepsOnStartupStep())
observation = history.get_current().observation
if observation is not None and isinstance(observation, UserInputObservation):
diff --git a/continuedev/src/continuedev/recipes/CreatePipelineRecipe/main.py b/continuedev/src/continuedev/recipes/CreatePipelineRecipe/main.py
index 4a4604d6..55c25da4 100644
--- a/continuedev/src/continuedev/recipes/CreatePipelineRecipe/main.py
+++ b/continuedev/src/continuedev/recipes/CreatePipelineRecipe/main.py
@@ -11,7 +11,7 @@ class CreatePipelineRecipe(Step):
hide: bool = True
async def run(self, sdk: ContinueSDK):
- await sdk.run_step(
+ text_observation = await sdk.run_step(
MessageStep(message=dedent("""\
This recipe will walk you through the process of creating a dlt pipeline for your chosen data source. With the help of Continue, you will:
- Create a Python virtual environment with dlt installed
@@ -21,7 +21,10 @@ class CreatePipelineRecipe(Step):
- Test that the API call works
- Load the data into a local DuckDB instance
- Write a query to view the data""")) >>
- WaitForUserInputStep(prompt="What API do you want to load data from?") >>
- SetupPipelineStep(api_description="WeatherAPI.com API") >>
+ WaitForUserInputStep(
+ prompt="What API do you want to load data from?")
+ )
+ await sdk.run_step(
+ SetupPipelineStep(api_description=text_observation.text) >>
ValidatePipelineStep()
)
diff --git a/continuedev/src/continuedev/steps/core/core.py b/continuedev/src/continuedev/steps/core/core.py
index d7f7a307..04446787 100644
--- a/continuedev/src/continuedev/steps/core/core.py
+++ b/continuedev/src/continuedev/steps/core/core.py
@@ -191,13 +191,18 @@ class WaitForUserInputStep(Step):
name: str = "Waiting for user input"
_description: Union[str, None] = None
+ _response: Union[str, None] = None
async def describe(self, models: Models) -> Coroutine[str, None, None]:
- return self.prompt
+ if self._response is None:
+ return self.prompt
+ else:
+ return self.prompt + "\n\n" + self._response
async def run(self, sdk: ContinueSDK) -> Coroutine[Observation, None, None]:
self._description = self.prompt
resp = await sdk.wait_for_user_input()
+ self._response = resp
return TextObservation(text=resp)