From 636fdb176c77297e608a7153f0ab670f71be3434 Mon Sep 17 00:00:00 2001 From: Ty Dunn Date: Mon, 29 May 2023 15:29:28 +0200 Subject: initial structure --- docs/docs/create-a-recipe.md | 64 ------------------------------- docs/docs/getting-started.md | 1 + docs/docs/how-continue-works.md | 9 +++++ docs/docs/install.md | 1 + docs/docs/intro.md | 4 +- docs/docs/sdk.md | 1 + docs/docs/telemetry.md | 1 + docs/docs/walkthroughs/create-a-recipe.md | 64 +++++++++++++++++++++++++++++++ docs/docs/walkthroughs/share-a-recipe.md | 1 + docs/docs/walkthroughs/use-a-recipe.md | 1 + docs/docs/walkthroughs/use-the-gui.md | 1 + docs/sidebars.js | 18 ++++++++- 12 files changed, 98 insertions(+), 68 deletions(-) delete mode 100644 docs/docs/create-a-recipe.md create mode 100644 docs/docs/getting-started.md create mode 100644 docs/docs/how-continue-works.md create mode 100644 docs/docs/install.md create mode 100644 docs/docs/sdk.md create mode 100644 docs/docs/telemetry.md create mode 100644 docs/docs/walkthroughs/create-a-recipe.md create mode 100644 docs/docs/walkthroughs/share-a-recipe.md create mode 100644 docs/docs/walkthroughs/use-a-recipe.md create mode 100644 docs/docs/walkthroughs/use-the-gui.md diff --git a/docs/docs/create-a-recipe.md b/docs/docs/create-a-recipe.md deleted file mode 100644 index 21d937b5..00000000 --- a/docs/docs/create-a-recipe.md +++ /dev/null @@ -1,64 +0,0 @@ -# Create a Recipe - -## 1. Create a step - -### Using the SDK - -You will want to use the SDK when you are opening directories, editing files, using models, etc. - -This will ensure that these actions are recorded as steps, so they are reviewable, reversable, and rerunnable. - -### Allow for configurability - -Steps can include optional parameters that allow users to configure them - -```python -from continueos import ContinueSDK - -class CreatePytestsStep(Step): - - input_file_path: str - output_file_prefix: str - output_dir_path: str - - async def run(self, sdk: ContinueSDK): - - code = await sdk.ide.readFile(self.input_file_path) - sdk.run_step(CreateDirStep(output_dir_path)) - sdk.run_step(WritePytestsStep(code, output_file_prefix, output_dir_path)) -``` - -### Adjust for different OS - -You might want to implement your steps, so that they can run on Linux, MacOS, and Windows. - -```python -from continueos import ContinueSDK -import platform - -class SetUpVenvStep(Step): - - async def run(self, sdk: ContinueSDK): - - os = platform.system() - - if os == "Windows": - await sdk.run("python -m venv env; .\\env\\Scripts\\activate") - else: - await sdk.run("python3 -m venv env && source env/bin/activate") # MacOS and Linux -``` - -## 2. Compose steps together - -By convention, the name of every recipe ends with `Recipe`. - -```python -class CreatePipelineRecipe(Step): - - async def run(self, sdk: ContinueSDK): - await sdk.run_step( - WaitForUserInputStep(prompt="What API do you want to load data from?") >> - SetupPipelineStep() >> - ValidatePipelineStep() - ) -``` \ No newline at end of file diff --git a/docs/docs/getting-started.md b/docs/docs/getting-started.md new file mode 100644 index 00000000..8b3a7945 --- /dev/null +++ b/docs/docs/getting-started.md @@ -0,0 +1 @@ +# Getting Started \ No newline at end of file diff --git a/docs/docs/how-continue-works.md b/docs/docs/how-continue-works.md new file mode 100644 index 00000000..e29faef8 --- /dev/null +++ b/docs/docs/how-continue-works.md @@ -0,0 +1,9 @@ +# How Continue works + +The Continue library consists of a `SDK`, a `GUI`, and a `Core` that brings everything together. + +The `SDK` gives you access to tools (e.g. open a directory, edit a file, call a model, etc), which you can use when defining how a step should work and composing them with other steps. + +The `GUI` enables you to guide steps and makes everything transparent, so you can review all steps that were automated, giving you the opportunity to undo and rerun any that ran incorrectly. + +The `Core` connects the SDK and GUI with the IDE (i.e. in VS Code, a web browser, etc), enabling the steps to make changes to your code and accelerate your software development workflows. \ No newline at end of file diff --git a/docs/docs/install.md b/docs/docs/install.md new file mode 100644 index 00000000..f34d65bd --- /dev/null +++ b/docs/docs/install.md @@ -0,0 +1 @@ +# Installation \ No newline at end of file diff --git a/docs/docs/intro.md b/docs/docs/intro.md index 854385af..286fbd2d 100644 --- a/docs/docs/intro.md +++ b/docs/docs/intro.md @@ -4,11 +4,11 @@ ### Automate more steps of your software development workflows using LLMs -#### An open-source framework to accelerate your use of LLMs while coding +#### An open-source framework to accelerate your use of models like GPT-4 while coding 1. Leverage steps created by others in your workflows as you code. 2. Customize steps and compose them together to fit your workflows. -3. Review, reverse, and rerun steps to use LLMs with confidence. +3. Review, reverse, and rerun steps to use models with confidence. ## How Continue works diff --git a/docs/docs/sdk.md b/docs/docs/sdk.md new file mode 100644 index 00000000..c7e10e85 --- /dev/null +++ b/docs/docs/sdk.md @@ -0,0 +1 @@ +# SDK \ No newline at end of file diff --git a/docs/docs/telemetry.md b/docs/docs/telemetry.md new file mode 100644 index 00000000..cf53d631 --- /dev/null +++ b/docs/docs/telemetry.md @@ -0,0 +1 @@ +# Telemetry \ No newline at end of file diff --git a/docs/docs/walkthroughs/create-a-recipe.md b/docs/docs/walkthroughs/create-a-recipe.md new file mode 100644 index 00000000..21d937b5 --- /dev/null +++ b/docs/docs/walkthroughs/create-a-recipe.md @@ -0,0 +1,64 @@ +# Create a Recipe + +## 1. Create a step + +### Using the SDK + +You will want to use the SDK when you are opening directories, editing files, using models, etc. + +This will ensure that these actions are recorded as steps, so they are reviewable, reversable, and rerunnable. + +### Allow for configurability + +Steps can include optional parameters that allow users to configure them + +```python +from continueos import ContinueSDK + +class CreatePytestsStep(Step): + + input_file_path: str + output_file_prefix: str + output_dir_path: str + + async def run(self, sdk: ContinueSDK): + + code = await sdk.ide.readFile(self.input_file_path) + sdk.run_step(CreateDirStep(output_dir_path)) + sdk.run_step(WritePytestsStep(code, output_file_prefix, output_dir_path)) +``` + +### Adjust for different OS + +You might want to implement your steps, so that they can run on Linux, MacOS, and Windows. + +```python +from continueos import ContinueSDK +import platform + +class SetUpVenvStep(Step): + + async def run(self, sdk: ContinueSDK): + + os = platform.system() + + if os == "Windows": + await sdk.run("python -m venv env; .\\env\\Scripts\\activate") + else: + await sdk.run("python3 -m venv env && source env/bin/activate") # MacOS and Linux +``` + +## 2. Compose steps together + +By convention, the name of every recipe ends with `Recipe`. + +```python +class CreatePipelineRecipe(Step): + + async def run(self, sdk: ContinueSDK): + await sdk.run_step( + WaitForUserInputStep(prompt="What API do you want to load data from?") >> + SetupPipelineStep() >> + ValidatePipelineStep() + ) +``` \ No newline at end of file diff --git a/docs/docs/walkthroughs/share-a-recipe.md b/docs/docs/walkthroughs/share-a-recipe.md new file mode 100644 index 00000000..4082d207 --- /dev/null +++ b/docs/docs/walkthroughs/share-a-recipe.md @@ -0,0 +1 @@ +# Share a recipe \ No newline at end of file diff --git a/docs/docs/walkthroughs/use-a-recipe.md b/docs/docs/walkthroughs/use-a-recipe.md new file mode 100644 index 00000000..40dc9da1 --- /dev/null +++ b/docs/docs/walkthroughs/use-a-recipe.md @@ -0,0 +1 @@ +# Use a Recipe \ No newline at end of file diff --git a/docs/docs/walkthroughs/use-the-gui.md b/docs/docs/walkthroughs/use-the-gui.md new file mode 100644 index 00000000..cfd5f214 --- /dev/null +++ b/docs/docs/walkthroughs/use-the-gui.md @@ -0,0 +1 @@ +# Use the GUI \ No newline at end of file diff --git a/docs/sidebars.js b/docs/sidebars.js index db9ae662..befe4feb 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -16,7 +16,19 @@ const sidebars = { docsSidebar: [ 'intro', - 'create-a-recipe', + 'getting-started', + 'install', + 'how-continue-works', + { + type: 'category', + label: 'Walkthroughs', + items: [ + 'walkthroughs/use-the-gui', + 'walkthroughs/use-a-recipe', + 'walkthroughs/create-a-recipe', + 'walkthroughs/share-a-recipe', + ], + }, { type: 'category', label: 'Concepts', @@ -28,11 +40,13 @@ const sidebars = { 'concepts/ide', 'concepts/llm', 'concepts/policy', - 'concepts/recipes', + 'concepts/recipe', 'concepts/sdk', 'concepts/step', ], }, + 'sdk', + 'telemetry', ], }; -- cgit v1.2.3-70-g09d2 From 00e41868a861adff099f1200c63e015503bcccd1 Mon Sep 17 00:00:00 2001 From: Ty Dunn Date: Tue, 30 May 2023 09:42:06 +0200 Subject: landing page things --- docs/docs/intro.md | 23 +++++----------------- docs/docusaurus.config.js | 2 +- docs/src/components/HomepageFeatures/index.js | 18 ++++++++--------- docs/src/css/custom.css | 28 +++++++++++++-------------- docs/src/pages/index.js | 2 +- 5 files changed, 30 insertions(+), 43 deletions(-) diff --git a/docs/docs/intro.md b/docs/docs/intro.md index 286fbd2d..04a50b86 100644 --- a/docs/docs/intro.md +++ b/docs/docs/intro.md @@ -1,21 +1,8 @@ # Introduction -## Scripts reimagined in the age of LLMs +## An open-source library to accelerate your use of models like GPT-4 while coding -### Automate more steps of your software development workflows using LLMs - -#### An open-source framework to accelerate your use of models like GPT-4 while coding - -1. Leverage steps created by others in your workflows as you code. -2. Customize steps and compose them together to fit your workflows. -3. Review, reverse, and rerun steps to use models with confidence. - -## How Continue works - -The Continue framework consists of a `SDK`, a `GUI`, and a `Core` that brings everything together. - -The `SDK` gives you access to tools (e.g. open a directory, edit a file, call an LLM, etc), which you can use when defining how a step should work and composing them with other steps. - -The `GUI` enables you to guide steps and makes everything transparent, so you can review all steps that were automated, giving you the opportunity to undo and rerun any that ran incorrectly. - -The `Core` connects the SDK and GUI with the IDE (i.e. in VS Code, a web browser, etc), enabling the steps to make changes to your code and accelerate your software development workflows. \ No newline at end of file +Automate more steps of your software development workflows using LLMs: +1. Leverage steps created by others in your workflows as you code +2. Customize steps and compose them together to fit your workflows +3. Review, reverse, and rerun steps to use models with confidence \ No newline at end of file diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index ef19f090..e3f633dc 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -7,7 +7,7 @@ const darkCodeTheme = require('prism-react-renderer/themes/dracula'); /** @type {import('@docusaurus/types').Config} */ const config = { title: 'Continue', - tagline: 'an open source autopilot for refining software', + tagline: 'an open-source library to accelerate your use of models like GPT-4 while coding', favicon: 'img/favicon.ico', // Set the production url of your site here diff --git a/docs/src/components/HomepageFeatures/index.js b/docs/src/components/HomepageFeatures/index.js index 78f410ba..d6d381fb 100644 --- a/docs/src/components/HomepageFeatures/index.js +++ b/docs/src/components/HomepageFeatures/index.js @@ -4,32 +4,32 @@ import styles from './styles.module.css'; const FeatureList = [ { - title: 'Easy to Use', + title: 'Define the scenarios where LLMs should step into accelerate you', Svg: require('@site/static/img/undraw_docusaurus_mountain.svg').default, description: ( <> - Docusaurus was designed from the ground up to be easily installed and - used to get your website up and running quickly. + Enable LLMs to be an autopilot for parts of your software development tasks by + leveraging steps and recipes created by others in your workflows as you code ), }, { - title: 'Focus on What Matters', + title: 'Create your own workflows to show LLMs exactly what to do', Svg: require('@site/static/img/undraw_docusaurus_tree.svg').default, description: ( <> - Docusaurus lets you focus on your docs, and we'll do the chores. Go - ahead and move your docs into the docs directory. + Use the Continue SDK to create your own custom steps and compose them together + into personalized recipes, so that using LLMs actually fits into your workflows ), }, { - title: 'Powered by React', + title: 'Guide the work done by LLMs to learn when to use and trust them', Svg: require('@site/static/img/undraw_docusaurus_react.svg').default, description: ( <> - Extend or customize your website layout by reusing React. Docusaurus can - be extended while reusing the same header and footer. + Use the Continue GUI to review, reverse, and rerun some steps or even entire recipes, + incorporating LLMs with confidence into the workflows you use to create software ), }, diff --git a/docs/src/css/custom.css b/docs/src/css/custom.css index 2bc6a4cf..4f3d7f86 100644 --- a/docs/src/css/custom.css +++ b/docs/src/css/custom.css @@ -6,25 +6,25 @@ /* You can override the default Infima variables here. */ :root { - --ifm-color-primary: #2e8555; - --ifm-color-primary-dark: #29784c; - --ifm-color-primary-darker: #277148; - --ifm-color-primary-darkest: #205d3b; - --ifm-color-primary-light: #33925d; - --ifm-color-primary-lighter: #359962; - --ifm-color-primary-lightest: #3cad6e; + --ifm-color-primary: #87245C; + --ifm-color-primary-dark: #87245C; + --ifm-color-primary-darker: #87245C; + --ifm-color-primary-darkest: #87245C; + --ifm-color-primary-light: #87245C; + --ifm-color-primary-lighter: #87245C; + --ifm-color-primary-lightest: #87245C; --ifm-code-font-size: 95%; --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1); } /* For readability concerns, you should choose a lighter palette in dark mode. */ [data-theme='dark'] { - --ifm-color-primary: #25c2a0; - --ifm-color-primary-dark: #21af90; - --ifm-color-primary-darker: #1fa588; - --ifm-color-primary-darkest: #1a8870; - --ifm-color-primary-light: #29d5b0; - --ifm-color-primary-lighter: #32d8b4; - --ifm-color-primary-lightest: #4fddbf; + --ifm-color-primary: #87245C; + --ifm-color-primary-dark: #87245C; + --ifm-color-primary-darker: #87245C; + --ifm-color-primary-darkest: #87245C; + --ifm-color-primary-light: #87245C; + --ifm-color-primary-lighter: #87245C; + --ifm-color-primary-lightest: #87245C; --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3); } diff --git a/docs/src/pages/index.js b/docs/src/pages/index.js index affcd909..1167a97a 100644 --- a/docs/src/pages/index.js +++ b/docs/src/pages/index.js @@ -18,7 +18,7 @@ function HomepageHeader() { - Docusaurus Tutorial - 5min ⏱️ + Test drive it in Codespaces -- cgit v1.2.3-70-g09d2 From 5d389d24123466e228fc39d9a8157ee9067336f6 Mon Sep 17 00:00:00 2001 From: Ty Dunn Date: Tue, 30 May 2023 13:19:48 +0200 Subject: initial docs styling --- docs/docs/concepts/agent.md | 9 -- docs/docs/concepts/autopilot.md | 11 ++ docs/docs/concepts/core.md | 2 + docs/docs/concepts/history.md | 2 + docs/docs/concepts/ide.md | 4 + docs/docs/concepts/llm.md | 2 + docs/docs/concepts/policy.md | 2 + docs/docs/concepts/recipe.md | 2 + docs/docs/concepts/sdk.md | 4 + docs/docs/concepts/state.md | 9 -- docs/docs/concepts/step.md | 2 + docs/docs/getting-started.md | 16 ++- docs/docs/how-continue-works.md | 12 +- docs/docs/install.md | 18 ++- docs/docs/intro.md | 22 ++- docs/docs/sdk.md | 1 - docs/docs/telemetry.md | 18 ++- docs/docs/walkthroughs/create-a-recipe.md | 8 +- docs/docs/walkthroughs/share-a-recipe.md | 4 +- docs/docs/walkthroughs/use-a-recipe.md | 4 +- docs/docs/walkthroughs/use-the-gui.md | 4 +- docs/docusaurus.config.js | 4 +- docs/sidebars.js | 3 +- docs/src/components/HomepageFeatures/index.js | 14 +- docs/src/pages/index.js | 6 +- docs/static/img/continue-cover-logo.png | Bin 0 -> 3556107 bytes docs/static/img/favicon.ico | Bin 3626 -> 4286 bytes docs/static/img/logo.svg | 12 +- docs/static/img/undraw_docusaurus_mountain.svg | 180 ++----------------------- docs/static/img/undraw_docusaurus_react.svg | 179 ++---------------------- docs/static/img/undraw_docusaurus_tree.svg | 49 ++----- 31 files changed, 173 insertions(+), 430 deletions(-) delete mode 100644 docs/docs/concepts/agent.md create mode 100644 docs/docs/concepts/autopilot.md delete mode 100644 docs/docs/concepts/state.md delete mode 100644 docs/docs/sdk.md create mode 100644 docs/static/img/continue-cover-logo.png diff --git a/docs/docs/concepts/agent.md b/docs/docs/concepts/agent.md deleted file mode 100644 index 0528b305..00000000 --- a/docs/docs/concepts/agent.md +++ /dev/null @@ -1,9 +0,0 @@ -# Agent - -`Agent` contains the -- History -- LLM -- Policy -- IDE - -**Q: should we really call this abstraction agent?** \ No newline at end of file diff --git a/docs/docs/concepts/autopilot.md b/docs/docs/concepts/autopilot.md new file mode 100644 index 00000000..5fc2a220 --- /dev/null +++ b/docs/docs/concepts/autopilot.md @@ -0,0 +1,11 @@ +# Autopilot + +*TODO: Explain in detail what this is and what its purpose is* + +`Autopilot` contains the +- History +- LLM +- Policy +- IDE + +**We should rename agent to autopilot in the code** \ No newline at end of file diff --git a/docs/docs/concepts/core.md b/docs/docs/concepts/core.md index ee58cbb2..cd5f6d00 100644 --- a/docs/docs/concepts/core.md +++ b/docs/docs/concepts/core.md @@ -1,5 +1,7 @@ # Core +*TODO: Explain in detail what this is and what its purpose is* + The `Core` connects the SDK and GUI with the IDE (i.e. in VS Code, a web browser, etc), enabling the steps to make changes to your code and accelerate your software development workflows. The `Core` includes diff --git a/docs/docs/concepts/history.md b/docs/docs/concepts/history.md index e6c2a5ea..5c52e158 100644 --- a/docs/docs/concepts/history.md +++ b/docs/docs/concepts/history.md @@ -1,5 +1,7 @@ # History +*TODO: Explain in detail what this is and what its purpose is* + `History` is the ordered record of all past steps. **Q: What step data and metadata is stored in the history?** \ No newline at end of file diff --git a/docs/docs/concepts/ide.md b/docs/docs/concepts/ide.md index 980b589d..4f30995f 100644 --- a/docs/docs/concepts/ide.md +++ b/docs/docs/concepts/ide.md @@ -1,11 +1,15 @@ # IDE +*TODO: Explain in detail what this is and what its purpose is* + ## Supported IDEs ### VS Code The VS Code extension implementation can be found at `/continue/extension/src` +### GitHub Codespaces + ## IDE Protocol methods ### handle_json diff --git a/docs/docs/concepts/llm.md b/docs/docs/concepts/llm.md index 11bbacc7..226a49eb 100644 --- a/docs/docs/concepts/llm.md +++ b/docs/docs/concepts/llm.md @@ -1,5 +1,7 @@ # LLM +*TODO: Explain in detail what this is and what its purpose is* + `LLM` is the large language model that can be used in steps to automate that require some judgement based on context (e.g. generating code based on docs, explaining an error given a stack trace, etc) **Q: should we call this LLM? Perhaps just model?** diff --git a/docs/docs/concepts/policy.md b/docs/docs/concepts/policy.md index 6fbbc8d7..58de2606 100644 --- a/docs/docs/concepts/policy.md +++ b/docs/docs/concepts/policy.md @@ -1,5 +1,7 @@ # Policy +*TODO: Explain in detail what this is and what its purpose is* + The policy determines what step to run next **Q: what else do folks need to understand about policies?** diff --git a/docs/docs/concepts/recipe.md b/docs/docs/concepts/recipe.md index bc171b1d..3f051a4d 100644 --- a/docs/docs/concepts/recipe.md +++ b/docs/docs/concepts/recipe.md @@ -1,5 +1,7 @@ # Recipe +*TODO: Explain in detail what this is and what its purpose is* + An ordered sequence of steps that are intended to accomplish some complete task Actually just a step that is composed of only other steps / recipes. diff --git a/docs/docs/concepts/sdk.md b/docs/docs/concepts/sdk.md index e5ca2f99..3316d2d0 100644 --- a/docs/docs/concepts/sdk.md +++ b/docs/docs/concepts/sdk.md @@ -1,5 +1,9 @@ # SDK +*TODO: Explain in detail what this is and what its purpose is* + +*TODO: Detail all the SDK methods and how to use them* + The `SDK` gives you access to tools (e.g. open a directory, edit a file, call an LLM, etc), which you can use when defining how a step should work and composing them with other steps. ## SDK methods diff --git a/docs/docs/concepts/state.md b/docs/docs/concepts/state.md deleted file mode 100644 index d48dbe88..00000000 --- a/docs/docs/concepts/state.md +++ /dev/null @@ -1,9 +0,0 @@ -# State - -*Note: this is only a proposed concept at this point* - -Steps can add, edit, and remove observations / memories stored in state. - -Allows you to pass context of previous steps, other files, etc. - -Alternative names: memory, observation store \ No newline at end of file diff --git a/docs/docs/concepts/step.md b/docs/docs/concepts/step.md index d381f06e..1f33a955 100644 --- a/docs/docs/concepts/step.md +++ b/docs/docs/concepts/step.md @@ -1,5 +1,7 @@ # Step +*TODO: Explain in detail what this is and what its purpose is* + A step is ## Step methods diff --git a/docs/docs/getting-started.md b/docs/docs/getting-started.md index 8b3a7945..0324f89e 100644 --- a/docs/docs/getting-started.md +++ b/docs/docs/getting-started.md @@ -1 +1,15 @@ -# Getting Started \ No newline at end of file +# Getting started + +## GitHub Codespaces Demo + +*TODO: Describe step-by-step how to try the GitHub Codespaces Demo* + +## Next Steps + +If you would prefer to use Continue locally, we reccommend installing `Continue` packaged as a VS Code extension as described [here](./install.md). + +Otherwise, if you would like to continue to use GitHub Codespaces, then you should now go through the walkthroughs: +- How to [use the GUI](./walkthroughs/use-the-gui.md) +- How to [use a recipe](./walkthroughs/use-a-recipe.md) +- How to [create a recipe](./walkthroughs/create-a-recipe.md) +- How to [share a recipe](./walkthroughs/share-a-recipe.md) \ No newline at end of file diff --git a/docs/docs/how-continue-works.md b/docs/docs/how-continue-works.md index e29faef8..a41986d0 100644 --- a/docs/docs/how-continue-works.md +++ b/docs/docs/how-continue-works.md @@ -1,9 +1,11 @@ -# How Continue works +# How `Continue` works -The Continue library consists of a `SDK`, a `GUI`, and a `Core` that brings everything together. +*TODO: Describe in more detail how `Continue` works* -The `SDK` gives you access to tools (e.g. open a directory, edit a file, call a model, etc), which you can use when defining how a step should work and composing them with other steps. +The `Continue` library consists of a [SDK](./concepts/sdk.md), a [GUI](./concepts/gui.md), and a [Core](./concepts/core.md) that brings everything together. -The `GUI` enables you to guide steps and makes everything transparent, so you can review all steps that were automated, giving you the opportunity to undo and rerun any that ran incorrectly. +The [SDK](./concepts/sdk.md) gives you access to tools (e.g. open a directory, edit a file, call a model, etc), which you can use when defining how a step should work and composing them with other steps. -The `Core` connects the SDK and GUI with the IDE (i.e. in VS Code, a web browser, etc), enabling the steps to make changes to your code and accelerate your software development workflows. \ No newline at end of file +The [GUI](./concepts/gui.md) enables you to guide steps and makes everything transparent, so you can review all steps that were automated, giving you the opportunity to undo and rerun any that ran incorrectly. + +The [Core](./concepts/core.md) connects the SDK and GUI with the IDE (i.e. in VS Code, a web browser, etc), enabling the steps to make changes to your code and accelerate your software development workflows. \ No newline at end of file diff --git a/docs/docs/install.md b/docs/docs/install.md index f34d65bd..923e7bd1 100644 --- a/docs/docs/install.md +++ b/docs/docs/install.md @@ -1 +1,17 @@ -# Installation \ No newline at end of file +# Installation + +If you want to try out `Continue` without having to install it, check out the [GitHub Codespaces Demo](./getting-started.md) + +## Install `Continue` packaged as a VS Code extension + +Steps for installing `Continue` packaged as a VS Code extension... + +*TODO: Describe step-by-step how to install `Continue` packaged as a VS Code extension* + +## Next steps + +Now that you have installed the VS Code extension, you should go through the walkthroughs: +- How to [use the GUI](./walkthroughs/use-the-gui.md) +- How to [use a recipe](./walkthroughs/use-a-recipe.md) +- How to [create a recipe](./walkthroughs/create-a-recipe.md) +- How to [share a recipe](./walkthroughs/share-a-recipe.md) \ No newline at end of file diff --git a/docs/docs/intro.md b/docs/docs/intro.md index 04a50b86..2d92d777 100644 --- a/docs/docs/intro.md +++ b/docs/docs/intro.md @@ -1,8 +1,20 @@ # Introduction -## An open-source library to accelerate your use of models like GPT-4 while coding +![continue-cover-logo](/img/continue-cover-logo.png) -Automate more steps of your software development workflows using LLMs: -1. Leverage steps created by others in your workflows as you code -2. Customize steps and compose them together to fit your workflows -3. Review, reverse, and rerun steps to use models with confidence \ No newline at end of file +## What is `Continue`? + +**`Continue` is the open-source library for accelerating your use of LLMs while coding.** + +You define the scenarios where Large Language Models ([LLMs](./concepts/llm.md)) like GPT-4 and StarCoder should act as an autopilot that helps you complete software development tasks. You use [recipes](./concepts/recipe.md) created by others to automate more steps in your development workflows. If a [recipe](./concepts/recipe.md) does not exist or work exactly like you want, you can use the [Continue SDK](./concepts/sdk.md) to create custom [steps](./concepts/step.md) and compose them into personalized [recipes](./concepts/recipe.md). Whether you are using a [recipe](./concepts/recipe.md) created by yourself or someone else, you can also review, reverse, and rerun [steps](./concepts/step.md) with the [Continue GUI](./concepts/gui.md), which helps guide the work done by LLMs and learn when to use and trust them. + +## Why do developers use `Continue`? + +Many developers have begun to use models like [GPT-4](https://openai.com/research/gpt-4) through [ChatGPT](https://openai.com/blog/chatgpt) while coding; however, this is quite a painful experience because of how much manual copy, paste, and editing is required to construct context for LLMs and then incorporate the generations from LLMs. Many other developers prefer to use open source models or work at organizations where they are unable to use ChatGPT, so they are using [StarCoder](https://huggingface.co/blog/starcoder) [Chat](https://huggingface.co/chat/) and running into the same issues. + +`Continue` eliminates the manual copy, paste, and editing required when using LLMs while coding. This accelerates how developers build, ship, and maintain software, while giving them the control to define when LLMs should take actions and the confidence to trust LLMs. In short, it enables developers to do what they have always done: work together to create better and better abstractions that make it easier and easier to automate the repetitive work that people want computers to do. + +## Getting started + +1. Try out `Continue` in the [GitHub Codespaces Demo](./getting-started.md) +2. Install `Continue` packaged as a [VS Code extension](./install.md) \ No newline at end of file diff --git a/docs/docs/sdk.md b/docs/docs/sdk.md deleted file mode 100644 index c7e10e85..00000000 --- a/docs/docs/sdk.md +++ /dev/null @@ -1 +0,0 @@ -# SDK \ No newline at end of file diff --git a/docs/docs/telemetry.md b/docs/docs/telemetry.md index cf53d631..be0c7666 100644 --- a/docs/docs/telemetry.md +++ b/docs/docs/telemetry.md @@ -1 +1,17 @@ -# Telemetry \ No newline at end of file +# Telemetry + +## Overview + +`Continue` collects and reports **anonymous** usage information. This data is essential to understanding how we should improve the library. You can opt out of it at any time. + +## What we track + +We track the following... + +*TODO: Detail exactly what we track* + +## How to opt out + +Here are the instructions for turning off telemetry... + +*TODO: Describe step-by-step how to opt out of telemetry* \ No newline at end of file diff --git a/docs/docs/walkthroughs/create-a-recipe.md b/docs/docs/walkthroughs/create-a-recipe.md index 21d937b5..74800531 100644 --- a/docs/docs/walkthroughs/create-a-recipe.md +++ b/docs/docs/walkthroughs/create-a-recipe.md @@ -1,4 +1,6 @@ -# Create a Recipe +# Create a recipe + +*TODO: Describe step-by-step how to create a recipe* ## 1. Create a step @@ -48,7 +50,9 @@ class SetUpVenvStep(Step): await sdk.run("python3 -m venv env && source env/bin/activate") # MacOS and Linux ``` -## 2. Compose steps together +## 2. Compose steps together into a complete recipe + +R By convention, the name of every recipe ends with `Recipe`. diff --git a/docs/docs/walkthroughs/share-a-recipe.md b/docs/docs/walkthroughs/share-a-recipe.md index 4082d207..1d5e2f60 100644 --- a/docs/docs/walkthroughs/share-a-recipe.md +++ b/docs/docs/walkthroughs/share-a-recipe.md @@ -1 +1,3 @@ -# Share a recipe \ No newline at end of file +# Share a recipe + +*TODO: Describe step-by-step how to share a recipe* \ No newline at end of file diff --git a/docs/docs/walkthroughs/use-a-recipe.md b/docs/docs/walkthroughs/use-a-recipe.md index 40dc9da1..fc653eea 100644 --- a/docs/docs/walkthroughs/use-a-recipe.md +++ b/docs/docs/walkthroughs/use-a-recipe.md @@ -1 +1,3 @@ -# Use a Recipe \ No newline at end of file +# Use a recipe + +*TODO: Describe step-by-step how to use a recipe* \ No newline at end of file diff --git a/docs/docs/walkthroughs/use-the-gui.md b/docs/docs/walkthroughs/use-the-gui.md index cfd5f214..a7263159 100644 --- a/docs/docs/walkthroughs/use-the-gui.md +++ b/docs/docs/walkthroughs/use-the-gui.md @@ -1 +1,3 @@ -# Use the GUI \ No newline at end of file +# Use the GUI + +*TODO: Describe step-by-step how to use the `Continue GUI`* \ No newline at end of file diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index e3f633dc..7ca00f8d 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -7,7 +7,7 @@ const darkCodeTheme = require('prism-react-renderer/themes/dracula'); /** @type {import('@docusaurus/types').Config} */ const config = { title: 'Continue', - tagline: 'an open-source library to accelerate your use of models like GPT-4 while coding', + tagline: 'the open-source library for accelerating your use of LLMs while coding', favicon: 'img/favicon.ico', // Set the production url of your site here @@ -105,7 +105,7 @@ const config = { ], }, ], - copyright: `Copyright © ${new Date().getFullYear()} Continue, Inc.`, + copyright: `Copyright © ${new Date().getFullYear()} Continue Dev, Inc.`, }, prism: { theme: lightCodeTheme, diff --git a/docs/sidebars.js b/docs/sidebars.js index befe4feb..a8138432 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -33,7 +33,7 @@ const sidebars = { type: 'category', label: 'Concepts', items: [ - 'concepts/agent', + 'concepts/autopilot', 'concepts/core', 'concepts/gui', 'concepts/history', @@ -45,7 +45,6 @@ const sidebars = { 'concepts/step', ], }, - 'sdk', 'telemetry', ], }; diff --git a/docs/src/components/HomepageFeatures/index.js b/docs/src/components/HomepageFeatures/index.js index d6d381fb..764ca891 100644 --- a/docs/src/components/HomepageFeatures/index.js +++ b/docs/src/components/HomepageFeatures/index.js @@ -8,8 +8,8 @@ const FeatureList = [ Svg: require('@site/static/img/undraw_docusaurus_mountain.svg').default, description: ( <> - Enable LLMs to be an autopilot for parts of your software development tasks by - leveraging steps and recipes created by others in your workflows as you code + Enable LLMs to be an autopilot for parts of your software development tasks + by leveraging recipes created by others in the workflows you use when coding ), }, @@ -18,18 +18,18 @@ const FeatureList = [ Svg: require('@site/static/img/undraw_docusaurus_tree.svg').default, description: ( <> - Use the Continue SDK to create your own custom steps and compose them together - into personalized recipes, so that using LLMs actually fits into your workflows + Use the Continue SDK to create your own custom steps and compose them into + personalized recipes, so that using LLMs seamlessly fits into your workflows ), }, { - title: 'Guide the work done by LLMs to learn when to use and trust them', + title: 'Guide the steps taken by LLMs to learn when to use and trust them', Svg: require('@site/static/img/undraw_docusaurus_react.svg').default, description: ( <> - Use the Continue GUI to review, reverse, and rerun some steps or even entire recipes, - incorporating LLMs with confidence into the workflows you use to create software + Use the Continue GUI to review, reverse, and rerun steps or even entire recipes, + incorporating LLMs with confidence into your software development workflows ), }, diff --git a/docs/src/pages/index.js b/docs/src/pages/index.js index 1167a97a..a17ffc4d 100644 --- a/docs/src/pages/index.js +++ b/docs/src/pages/index.js @@ -17,8 +17,8 @@ function HomepageHeader() {
- Test drive it in Codespaces + to="/docs/getting-started"> + GitHub Codespaces Demo
@@ -30,7 +30,7 @@ export default function Home() { const {siteConfig} = useDocusaurusContext(); return (
diff --git a/docs/static/img/continue-cover-logo.png b/docs/static/img/continue-cover-logo.png new file mode 100644 index 00000000..de52f6f5 Binary files /dev/null and b/docs/static/img/continue-cover-logo.png differ diff --git a/docs/static/img/favicon.ico b/docs/static/img/favicon.ico index c01d54bc..0c361979 100644 Binary files a/docs/static/img/favicon.ico and b/docs/static/img/favicon.ico differ diff --git a/docs/static/img/logo.svg b/docs/static/img/logo.svg index 9db6d0d0..cf6cfeba 100644 --- a/docs/static/img/logo.svg +++ b/docs/static/img/logo.svg @@ -1 +1,11 @@ - \ No newline at end of file + + + + + + + + + + + diff --git a/docs/static/img/undraw_docusaurus_mountain.svg b/docs/static/img/undraw_docusaurus_mountain.svg index af961c49..77cd4b54 100644 --- a/docs/static/img/undraw_docusaurus_mountain.svg +++ b/docs/static/img/undraw_docusaurus_mountain.svg @@ -1,171 +1,11 @@ - - Easy to Use - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + diff --git a/docs/static/img/undraw_docusaurus_react.svg b/docs/static/img/undraw_docusaurus_react.svg index 94b5cf08..ba158585 100644 --- a/docs/static/img/undraw_docusaurus_react.svg +++ b/docs/static/img/undraw_docusaurus_react.svg @@ -1,170 +1,11 @@ - - Powered by React - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + diff --git a/docs/static/img/undraw_docusaurus_tree.svg b/docs/static/img/undraw_docusaurus_tree.svg index d9161d33..7e45e3ef 100644 --- a/docs/static/img/undraw_docusaurus_tree.svg +++ b/docs/static/img/undraw_docusaurus_tree.svg @@ -1,40 +1,11 @@ - - Focus on What Matters - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + -- cgit v1.2.3-70-g09d2 From 7ac9e5f57c566e3cf2979bac3df4999427538a54 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Tue, 30 May 2023 08:41:56 -0400 Subject: rename agent to autopilot --- continuedev/src/continuedev/core/agent.py | 180 +++++++++++++++++++++ continuedev/src/continuedev/libs/core.py | 22 +-- .../src/continuedev/libs/util/copy_codebase.py | 16 +- continuedev/src/continuedev/server/ide.py | 16 +- continuedev/src/continuedev/server/notebook.py | 40 ++--- docs/docs/concepts/agent.md | 7 +- docs/docs/concepts/core.md | 5 +- docs/docs/concepts/llm.md | 2 +- docs/sidebars.js | 51 +++--- 9 files changed, 260 insertions(+), 79 deletions(-) create mode 100644 continuedev/src/continuedev/core/agent.py diff --git a/continuedev/src/continuedev/core/agent.py b/continuedev/src/continuedev/core/agent.py new file mode 100644 index 00000000..1996abb1 --- /dev/null +++ b/continuedev/src/continuedev/core/agent.py @@ -0,0 +1,180 @@ +import traceback +import time +from typing import Callable, Coroutine, List +from ..models.filesystem_edit import FileEditWithFullContents +from ..libs.llm import LLM +from .observation import Observation +from ..server.ide_protocol import AbstractIdeProtocolServer +from ..libs.util.queue import AsyncSubscriptionQueue +from ..models.main import ContinueBaseModel +from .main import Policy, History, FullState, Step, HistoryNode +from ..libs.steps.core.core import ReversibleStep, ManualEditStep, UserInputStep +from .sdk import ContinueSDK + + +class Autopilot(ContinueBaseModel): + llm: LLM + policy: Policy + ide: AbstractIdeProtocolServer + history: History = History.from_empty() + _on_update_callbacks: List[Callable[[FullState], None]] = [] + + _active: bool = False + _should_halt: bool = False + _main_user_input_queue: List[str] = [] + + _user_input_queue = AsyncSubscriptionQueue() + + class Config: + arbitrary_types_allowed = True + + def get_full_state(self) -> FullState: + return FullState(history=self.history, active=self._active, user_input_queue=self._main_user_input_queue) + + def on_update(self, callback: Callable[["FullState"], None]): + """Subscribe to changes to state""" + self._on_update_callbacks.append(callback) + + def update_subscribers(self): + full_state = self.get_full_state() + for callback in self._on_update_callbacks: + callback(full_state) + + def __get_step_params(self, step: "Step"): + return ContinueSDK(autopilot=self, llm=self.llm.with_system_message(step.system_message)) + + def give_user_input(self, input: str, index: int): + self._user_input_queue.post(index, input) + + async def wait_for_user_input(self) -> str: + self._active = False + self.update_subscribers() + user_input = await self._user_input_queue.get(self.history.current_index) + self._active = True + self.update_subscribers() + return user_input + + _manual_edits_buffer: List[FileEditWithFullContents] = [] + + async def reverse_to_index(self, index: int): + try: + while self.history.get_current_index() >= index: + current_step = self.history.get_current().step + self.history.step_back() + if issubclass(current_step.__class__, ReversibleStep): + await current_step.reverse(self.__get_step_params(current_step)) + + self.update_subscribers() + except Exception as e: + print(e) + + def handle_manual_edits(self, edits: List[FileEditWithFullContents]): + for edit in edits: + self._manual_edits_buffer.append(edit) + # TODO: You're storing a lot of unecessary data here. Can compress into EditDiffs on the spot, and merge. + # self._manual_edits_buffer = merge_file_edit(self._manual_edits_buffer, edit) + + def handle_traceback(self, traceback: str): + raise NotImplementedError + + _step_depth: int = 0 + + async def _run_singular_step(self, step: "Step", is_future_step: bool = False) -> Coroutine[Observation, None, None]: + if not is_future_step: + # Check manual edits buffer, clear out if needed by creating a ManualEditStep + if len(self._manual_edits_buffer) > 0: + manualEditsStep = ManualEditStep.from_sequence( + self._manual_edits_buffer) + self._manual_edits_buffer = [] + await self._run_singular_step(manualEditsStep) + + # Update history - do this first so we get top-first tree ordering + self.history.add_node(HistoryNode( + step=step, observation=None, depth=self._step_depth)) + + # Run step + self._step_depth += 1 + observation = await step(self.__get_step_params(step)) + self._step_depth -= 1 + + # Add observation to history + self.history.get_current().observation = observation + + # Update its description + step._set_description(await step.describe(self.llm)) + + # Call all subscribed callbacks + self.update_subscribers() + + return observation + + async def run_from_step(self, step: "Step"): + # if self._active: + # raise RuntimeError("Autopilot is already running") + self._active = True + + next_step = step + is_future_step = False + while not (next_step is None or self._should_halt): + try: + if is_future_step: + # If future step, then we are replaying and need to delete the step from history so it can be replaced + self.history.remove_current_and_substeps() + + observation = await self._run_singular_step(next_step, is_future_step) + if next_step := self.policy.next(self.history): + is_future_step = False + elif next_step := self.history.take_next_step(): + is_future_step = True + else: + next_step = None + + except Exception as e: + print( + f"Error while running step: \n{''.join(traceback.format_tb(e.__traceback__))}\n{e}") + next_step = None + + self._active = False + + # Doing this so active can make it to the frontend after steps are done. But want better state syncing tools + for callback in self._on_update_callbacks: + callback(None) + + async def run_from_observation(self, observation: Observation): + next_step = self.policy.next(self.history) + await self.run_from_step(next_step) + + async def run_policy(self): + first_step = self.policy.next(self.history) + await self.run_from_step(first_step) + + async def _request_halt(self): + if self._active: + self._should_halt = True + while self._active: + time.sleep(0.1) + self._should_halt = False + return None + + async def accept_user_input(self, user_input: str): + self._main_user_input_queue.append(user_input) + self.update_subscribers() + + if len(self._main_user_input_queue) > 1: + return + + # await self._request_halt() + # Just run the step that takes user input, and + # then up to the policy to decide how to deal with it. + self._main_user_input_queue.pop(0) + self.update_subscribers() + await self.run_from_step(UserInputStep(user_input=user_input)) + + while len(self._main_user_input_queue) > 0: + await self.run_from_step(UserInputStep( + user_input=self._main_user_input_queue.pop(0))) + + async def accept_refinement_input(self, user_input: str, index: int): + await self._request_halt() + await self.reverse_to_index(index) + await self.run_from_step(UserInputStep(user_input=user_input)) diff --git a/continuedev/src/continuedev/libs/core.py b/continuedev/src/continuedev/libs/core.py index 6a8a83ba..36d94ad1 100644 --- a/continuedev/src/continuedev/libs/core.py +++ b/continuedev/src/continuedev/libs/core.py @@ -89,31 +89,31 @@ class ContinueSDK: """The SDK provided as parameters to a step""" llm: LLM ide: AbstractIdeProtocolServer - __agent: "Agent" + __autopilot: "Autopilot" - def __init__(self, agent: "Agent", llm: Union[LLM, None] = None): + def __init__(self, autopilot: "Autopilot", llm: Union[LLM, None] = None): if llm is None: - self.llm = agent.llm + self.llm = autopilot.llm else: self.llm = llm - self.ide = agent.ide - self.__agent = agent + self.ide = autopilot.ide + self.__autopilot = autopilot @property def history(self) -> History: - return self.__agent.history + return self.__autopilot.history async def run_step(self, step: "Step") -> Coroutine[Observation, None, None]: - return await self.__agent._run_singular_step(step) + return await self.__autopilot._run_singular_step(step) async def apply_filesystem_edit(self, edit: FileSystemEdit): await self.run_step(FileSystemEditStep(edit=edit)) async def wait_for_user_input(self) -> str: - return await self.__agent.wait_for_user_input() + return await self.__autopilot.wait_for_user_input() -class Agent(ContinueBaseModel): +class Autopilot(ContinueBaseModel): llm: LLM policy: Policy ide: AbstractIdeProtocolServer @@ -142,7 +142,7 @@ class Agent(ContinueBaseModel): callback(full_state) def __get_step_params(self, step: "Step"): - return ContinueSDK(agent=self, llm=self.llm.with_system_message(step.system_message)) + return ContinueSDK(autopilot=self, llm=self.llm.with_system_message(step.system_message)) def give_user_input(self, input: str, index: int): self._user_input_queue.post(index, input) @@ -210,7 +210,7 @@ class Agent(ContinueBaseModel): async def run_from_step(self, step: "Step"): # if self._active: - # raise RuntimeError("Agent is already running") + # raise RuntimeError("Autopilot is already running") self._active = True next_step = step diff --git a/continuedev/src/continuedev/libs/util/copy_codebase.py b/continuedev/src/continuedev/libs/util/copy_codebase.py index ef1db72b..af957a34 100644 --- a/continuedev/src/continuedev/libs/util/copy_codebase.py +++ b/continuedev/src/continuedev/libs/util/copy_codebase.py @@ -5,7 +5,7 @@ from watchdog.observers import Observer from watchdog.events import PatternMatchingEventHandler from ..models.main import FileEdit, DeleteDirectory, DeleteFile, AddDirectory, AddFile, FileSystemEdit, Position, Range, RenameFile, RenameDirectory, SequentialFileSystemEdit from ..models.filesystem import FileSystem -from ..libs.main import Agent +from ..libs.main import Autopilot from ..libs.map_path import map_path from ..libs.steps.main import ManualEditAction import shutil @@ -65,15 +65,15 @@ def calculate_diff(filepath: str, original: str, updated: str) -> List[FileEdit] # The whole usage of watchdog here should only be specific to RealFileSystem, you want to have a different "Observer" class for VirtualFileSystem, which would depend on being sent notifications class CopyCodebaseEventHandler(PatternMatchingEventHandler): - def __init__(self, ignore_directories: List[str], ignore_patterns: List[str], agent: Agent, orig_root: str, copy_root: str, filesystem: FileSystem): + def __init__(self, ignore_directories: List[str], ignore_patterns: List[str], autopilot: Autopilot, orig_root: str, copy_root: str, filesystem: FileSystem): super().__init__(ignore_directories=ignore_directories, ignore_patterns=ignore_patterns) - self.agent = agent + self.autopilot = autopilot self.orig_root = orig_root self.copy_root = copy_root self.filesystem = filesystem - # For now, we'll just make the update immediately, but eventually need to sync with agent. - # It should be the agent that makes the update right? It's just another action, everything comes from a single stream. + # For now, we'll just make the update immediately, but eventually need to sync with autopilot. + # It should be the autopilot that makes the update right? It's just another action, everything comes from a single stream. def _event_to_edit(self, event) -> Union[FileSystemEdit, None]: # NOTE: You'll need to map paths to create both an action within the copy filesystem (the one you take) and one in the original fileystem (the one you'll record and allow the user to accept). Basically just need a converter built in to the FileSystemEdit class @@ -110,13 +110,13 @@ class CopyCodebaseEventHandler(PatternMatchingEventHandler): return edit = edit.with_mapped_paths(self.orig_root, self.copy_root) action = ManualEditAction(edit) - self.agent.act(action) + self.autopilot.act(action) -def maintain_copy_workspace(agent: Agent, filesystem: FileSystem, orig_root: str, copy_root: str): +def maintain_copy_workspace(autopilot: Autopilot, filesystem: FileSystem, orig_root: str, copy_root: str): observer = Observer() event_handler = CopyCodebaseEventHandler( - [".git"], [], agent, orig_root, copy_root, filesystem) + [".git"], [], autopilot, orig_root, copy_root, filesystem) observer.schedule(event_handler, orig_root, recursive=True) observer.start() try: diff --git a/continuedev/src/continuedev/server/ide.py b/continuedev/src/continuedev/server/ide.py index dd1dc463..167d9483 100644 --- a/continuedev/src/continuedev/server/ide.py +++ b/continuedev/src/continuedev/server/ide.py @@ -122,7 +122,7 @@ class IdeProtocolServer(AbstractIdeProtocolServer): pass async def setFileOpen(self, filepath: str, open: bool = True): - # Agent needs access to this. + # Autopilot needs access to this. await self.websocket.send_json({ "messageType": "setFileOpen", "filepath": filepath, @@ -147,12 +147,12 @@ class IdeProtocolServer(AbstractIdeProtocolServer): responses = await asyncio.gather(*[ self._receive_json(ShowSuggestionResponse) for i in range(len(suggestions)) - ]) # WORKING ON THIS FLOW HERE. Fine now to just await for response, instead of doing something fancy with a "waiting" state on the agent. + ]) # WORKING ON THIS FLOW HERE. Fine now to just await for response, instead of doing something fancy with a "waiting" state on the autopilot. # Just need connect the suggestionId to the IDE (and the notebook) return any([r.accepted for r in responses]) # ------------------------------- # - # Here needs to pass message onto the Agent OR Agent just subscribes. + # Here needs to pass message onto the Autopilot OR Autopilot just subscribes. # This is where you might have triggers: plugins can subscribe to certian events # like file changes, tracebacks, etc... @@ -160,12 +160,12 @@ class IdeProtocolServer(AbstractIdeProtocolServer): pass def onTraceback(self, traceback: Traceback): - # Same as below, maybe not every agent? + # Same as below, maybe not every autopilot? for _, session in self.session_manager.sessions.items(): - session.agent.handle_traceback(traceback) + session.autopilot.handle_traceback(traceback) def onFileSystemUpdate(self, update: FileSystemEdit): - # Access to Agent (so SessionManager) + # Access to Autopilot (so SessionManager) pass def onCloseNotebook(self, session_id: str): @@ -176,10 +176,10 @@ class IdeProtocolServer(AbstractIdeProtocolServer): pass def onFileEdits(self, edits: List[FileEditWithFullContents]): - # Send the file edits to ALL agents. + # Send the file edits to ALL autopilots. # Maybe not ideal behavior for _, session in self.session_manager.sessions.items(): - session.agent.handle_manual_edits(edits) + session.autopilot.handle_manual_edits(edits) # Request information. Session doesn't matter. async def getOpenFiles(self) -> List[str]: diff --git a/continuedev/src/continuedev/server/notebook.py b/continuedev/src/continuedev/server/notebook.py index c9d4edc5..c26920f5 100644 --- a/continuedev/src/continuedev/server/notebook.py +++ b/continuedev/src/continuedev/server/notebook.py @@ -6,7 +6,7 @@ from uvicorn.main import Server from ..models.filesystem_edit import FileEditWithFullContents from ..libs.policy import DemoPolicy -from ..libs.core import Agent, FullState, History, Step +from ..libs.core import Autopilot, FullState, History, Step from ..libs.steps.nate import ImplementAbstractMethodStep from ..libs.observation import Observation from dotenv import load_dotenv @@ -41,16 +41,16 @@ Server.handle_exit = AppStatus.handle_exit class Session: session_id: str - agent: Agent + autopilot: Autopilot ws: Union[WebSocket, None] - def __init__(self, session_id: str, agent: Agent): + def __init__(self, session_id: str, autopilot: Autopilot): self.session_id = session_id - self.agent = agent + self.autopilot = autopilot self.ws = None -class DemoAgent(Agent): +class DemoAutopilot(Autopilot): first_seen: bool = False cumulative_edit_string = "" @@ -78,20 +78,20 @@ class SessionManager: def new_session(self, ide: AbstractIdeProtocolServer) -> str: cmd = "python3 /Users/natesesti/Desktop/continue/extension/examples/python/main.py" - agent = DemoAgent(llm=OpenAI(api_key=openai_api_key), - policy=DemoPolicy(cmd=cmd), ide=ide) + autopilot = DemoAutopilot(llm=OpenAI(api_key=openai_api_key), + policy=DemoPolicy(cmd=cmd), ide=ide) session_id = str(uuid4()) - session = Session(session_id=session_id, agent=agent) + session = Session(session_id=session_id, autopilot=autopilot) self.sessions[session_id] = session def on_update(state: FullState): session_manager.send_ws_data(session_id, { "messageType": "state", - "state": agent.get_full_state().dict() + "state": autopilot.get_full_state().dict() }) - agent.on_update(on_update) - asyncio.create_task(agent.run_policy()) + autopilot.on_update(on_update) + asyncio.create_task(autopilot.run_policy()) return session_id def remove_session(self, session_id: str): @@ -147,7 +147,7 @@ async def websocket_endpoint(websocket: WebSocket, session: Session = Depends(we # Update any history that may have happened before connection await websocket.send_json({ "messageType": "state", - "state": session_manager.get_session(session.session_id).agent.get_full_state().dict() + "state": session_manager.get_session(session.session_id).autopilot.get_full_state().dict() }) print("Session started", data) while AppStatus.should_exit is False: @@ -162,17 +162,17 @@ async def websocket_endpoint(websocket: WebSocket, session: Session = Depends(we if messageType == "main_input": # Do something with user input asyncio.create_task( - session.agent.accept_user_input(data["value"])) + session.autopilot.accept_user_input(data["value"])) elif messageType == "step_user_input": asyncio.create_task( - session.agent.give_user_input(data["value"], data["index"])) + session.autopilot.give_user_input(data["value"], data["index"])) elif messageType == "refinement_input": asyncio.create_task( - session.agent.accept_refinement_input(data["value"], data["index"])) + session.autopilot.accept_refinement_input(data["value"], data["index"])) elif messageType == "reverse": # Reverse the history to the given index asyncio.create_task( - session.agent.reverse_to_index(data["index"])) + session.autopilot.reverse_to_index(data["index"])) except Exception as e: print(e) @@ -182,17 +182,17 @@ async def websocket_endpoint(websocket: WebSocket, session: Session = Depends(we @router.post("/run") def request_run(step: Step, session=Depends(session)): - """Tell an agent to take a specific action.""" - asyncio.create_task(session.agent.run_from_step(step)) + """Tell an autopilot to take a specific action.""" + asyncio.create_task(session.autopilot.run_from_step(step)) return "Success" @router.get("/history") def get_history(session=Depends(session)) -> History: - return session.agent.history + return session.autopilot.history @router.post("/observation") def post_observation(observation: Observation, session=Depends(session)): - asyncio.create_task(session.agent.run_from_observation(observation)) + asyncio.create_task(session.autopilot.run_from_observation(observation)) return "Success" diff --git a/docs/docs/concepts/agent.md b/docs/docs/concepts/agent.md index 0528b305..e2fa6832 100644 --- a/docs/docs/concepts/agent.md +++ b/docs/docs/concepts/agent.md @@ -1,9 +1,10 @@ -# Agent +# Autopilot + +`Autopilot` contains the -`Agent` contains the - History - LLM - Policy - IDE -**Q: should we really call this abstraction agent?** \ No newline at end of file +**Q: should we really call this abstraction autopilot?** diff --git a/docs/docs/concepts/core.md b/docs/docs/concepts/core.md index ee58cbb2..d60f46ac 100644 --- a/docs/docs/concepts/core.md +++ b/docs/docs/concepts/core.md @@ -3,11 +3,12 @@ The `Core` connects the SDK and GUI with the IDE (i.e. in VS Code, a web browser, etc), enabling the steps to make changes to your code and accelerate your software development workflows. The `Core` includes + - IDE protocol - GUI protocol - SDK -- Agent +- Autopilot There is a two-way sync between an IDE and the GUI that happens through Core. -**Q: does this make sense as a concept?** \ No newline at end of file +**Q: does this make sense as a concept?** diff --git a/docs/docs/concepts/llm.md b/docs/docs/concepts/llm.md index 11bbacc7..8c2dbcba 100644 --- a/docs/docs/concepts/llm.md +++ b/docs/docs/concepts/llm.md @@ -4,4 +4,4 @@ **Q: should we call this LLM? Perhaps just model?** -**Q: should this abstraction be connected to agent?** \ No newline at end of file +**Q: should this abstraction be connected to autopilot?** diff --git a/docs/sidebars.js b/docs/sidebars.js index befe4feb..d2c91388 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -13,41 +13,40 @@ /** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ const sidebars = { - docsSidebar: [ - 'intro', - 'getting-started', - 'install', - 'how-continue-works', + "intro", + "getting-started", + "install", + "how-continue-works", { - type: 'category', - label: 'Walkthroughs', + type: "category", + label: "Walkthroughs", items: [ - 'walkthroughs/use-the-gui', - 'walkthroughs/use-a-recipe', - 'walkthroughs/create-a-recipe', - 'walkthroughs/share-a-recipe', + "walkthroughs/use-the-gui", + "walkthroughs/use-a-recipe", + "walkthroughs/create-a-recipe", + "walkthroughs/share-a-recipe", ], }, { - type: 'category', - label: 'Concepts', + type: "category", + label: "Concepts", items: [ - 'concepts/agent', - 'concepts/core', - 'concepts/gui', - 'concepts/history', - 'concepts/ide', - 'concepts/llm', - 'concepts/policy', - 'concepts/recipe', - 'concepts/sdk', - 'concepts/step', + "concepts/autopilot", + "concepts/core", + "concepts/gui", + "concepts/history", + "concepts/ide", + "concepts/llm", + "concepts/policy", + "concepts/recipe", + "concepts/sdk", + "concepts/step", ], }, - 'sdk', - 'telemetry', + "sdk", + "telemetry", ], }; -module.exports = sidebars; \ No newline at end of file +module.exports = sidebars; -- cgit v1.2.3-70-g09d2 From 3dc31f7ae4aa3d618e28045f3e0585ef2875c8d6 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Tue, 30 May 2023 08:48:27 -0400 Subject: delete plugin directory --- continuedev/src/continuedev/plugins/__init__.py | 26 ---------------------- continuedev/src/continuedev/plugins/load.py | 21 ----------------- .../src/continuedev/plugins/policy/__init__.py | 4 ---- .../src/continuedev/plugins/policy/hookspecs.py | 10 --------- .../continuedev/plugins/policy/libs/__init__.py | 0 .../continuedev/plugins/policy/libs/alternate.py | 22 ------------------ .../src/continuedev/plugins/step/__init__.py | 4 ---- .../src/continuedev/plugins/step/hookspecs.py | 13 ----------- .../src/continuedev/plugins/step/libs/__init__.py | 0 .../continuedev/plugins/step/libs/hello_world.py | 9 -------- 10 files changed, 109 deletions(-) delete mode 100644 continuedev/src/continuedev/plugins/__init__.py delete mode 100644 continuedev/src/continuedev/plugins/load.py delete mode 100644 continuedev/src/continuedev/plugins/policy/__init__.py delete mode 100644 continuedev/src/continuedev/plugins/policy/hookspecs.py delete mode 100644 continuedev/src/continuedev/plugins/policy/libs/__init__.py delete mode 100644 continuedev/src/continuedev/plugins/policy/libs/alternate.py delete mode 100644 continuedev/src/continuedev/plugins/step/__init__.py delete mode 100644 continuedev/src/continuedev/plugins/step/hookspecs.py delete mode 100644 continuedev/src/continuedev/plugins/step/libs/__init__.py delete mode 100644 continuedev/src/continuedev/plugins/step/libs/hello_world.py diff --git a/continuedev/src/continuedev/plugins/__init__.py b/continuedev/src/continuedev/plugins/__init__.py deleted file mode 100644 index 0ce6d079..00000000 --- a/continuedev/src/continuedev/plugins/__init__.py +++ /dev/null @@ -1,26 +0,0 @@ -from typing import List -import pluggy -from .step import hookspecs -from .step.libs import hello_world - -builtin_libs = [hello_world] - -def get_plugin_manager(use_plugins: List[str]) -> pluggy.PluginManager: - pm = pluggy.PluginManager("continue.step") - pm.add_hookspecs(hookspecs) - pm.load_setuptools_entrypoints("continue.step") - - # Only use plugins that are specified in the config file - for plugin, name in pm.list_name_plugin(): - if name not in use_plugins: - pm.set_blocked(plugin) - - # Print warning if plugin not found - for name in use_plugins: - if not pm.has_plugin(name): - print(f"Plugin {name} not found.") - - for lib in builtin_libs: - pm.register(lib) - - return pm \ No newline at end of file diff --git a/continuedev/src/continuedev/plugins/load.py b/continuedev/src/continuedev/plugins/load.py deleted file mode 100644 index adbaad09..00000000 --- a/continuedev/src/continuedev/plugins/load.py +++ /dev/null @@ -1,21 +0,0 @@ -def load_validator_plugin(config: ValidatorPluginConfig) -> Validator: - if config.name == "continue.tb_validator": - return PythonTracebackValidator(config.cmd, config.cwd) - elif config.name == "continue.pytest_validator": - return PytestValidator(cwd=config.cwd) - else: - raise KeyError("Unknown validator plugin name") - -def load_llm_plugin(config: LLMPluginConfig) -> LLM: - if config.provider == "openai": - return OpenAI(api_key=config.api_key) - else: - raise KeyError("Unknown LLM provider: " + config.provider) - -def load_policy_plugin(config: PolicyPluginConfig) -> Policy: - if config.name == "continue.random_policy": - return RandomPolicy() - elif config.name == "continue.dfs_policy": - return DFSPolicy() - else: - raise KeyError("Unknown policy plugin name") \ No newline at end of file diff --git a/continuedev/src/continuedev/plugins/policy/__init__.py b/continuedev/src/continuedev/plugins/policy/__init__.py deleted file mode 100644 index b9722bae..00000000 --- a/continuedev/src/continuedev/plugins/policy/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -import pluggy - -hookimpl = pluggy.HookimplMarker("continue.policy") -"""Marker to be imported and used in plugins (and for own implementations)""" \ No newline at end of file diff --git a/continuedev/src/continuedev/plugins/policy/hookspecs.py b/continuedev/src/continuedev/plugins/policy/hookspecs.py deleted file mode 100644 index abe932d3..00000000 --- a/continuedev/src/continuedev/plugins/policy/hookspecs.py +++ /dev/null @@ -1,10 +0,0 @@ -from typing import List, Tuple -import pluggy -from ...libs.policy import Policy, Step - -hookspec = pluggy.HookspecMarker("continue.policy") - -class PolicyPlugin(Policy): - @hookspec - def next(self) -> Step: - """Get the next step to run""" \ No newline at end of file diff --git a/continuedev/src/continuedev/plugins/policy/libs/__init__.py b/continuedev/src/continuedev/plugins/policy/libs/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/continuedev/src/continuedev/plugins/policy/libs/alternate.py b/continuedev/src/continuedev/plugins/policy/libs/alternate.py deleted file mode 100644 index 5bfbb821..00000000 --- a/continuedev/src/continuedev/plugins/policy/libs/alternate.py +++ /dev/null @@ -1,22 +0,0 @@ -from plugins import policy -from ....libs.observation import Observation -from ....libs.steps import Step -from ....libs.core import History - - -class AlternatingPolicy: - """A Policy that alternates between two steps.""" - - def __init__(self, first: Step, second: Step): - self.first = first - self.second = second - self.last_was_first = False - - @policy.hookimpl - def next(self, history: History) -> Step: - if self.last_was_first: - self.last_was_first = False - return self.second - else: - self.last_was_first = True - return self.first diff --git a/continuedev/src/continuedev/plugins/step/__init__.py b/continuedev/src/continuedev/plugins/step/__init__.py deleted file mode 100644 index e6d8cd3b..00000000 --- a/continuedev/src/continuedev/plugins/step/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -import pluggy - -hookimpl = pluggy.HookimplMarker("continue.step") -"""Marker to be imported and used in plugins (and for own implementations)""" \ No newline at end of file diff --git a/continuedev/src/continuedev/plugins/step/hookspecs.py b/continuedev/src/continuedev/plugins/step/hookspecs.py deleted file mode 100644 index 4309bad3..00000000 --- a/continuedev/src/continuedev/plugins/step/hookspecs.py +++ /dev/null @@ -1,13 +0,0 @@ -from typing import Coroutine -import pluggy -from ...libs.core import ContinueSDK, Step, Observation - -hookspec = pluggy.HookspecMarker("continue.step") - -# Perhaps Actions should be generic about what their inputs must be. - - -class StepPlugin(Step): - @hookspec - async def run(self, sdk: ContinueSDK) -> Coroutine[Observation, None, None]: - """Run""" diff --git a/continuedev/src/continuedev/plugins/step/libs/__init__.py b/continuedev/src/continuedev/plugins/step/libs/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/continuedev/src/continuedev/plugins/step/libs/hello_world.py b/continuedev/src/continuedev/plugins/step/libs/hello_world.py deleted file mode 100644 index 72255bfd..00000000 --- a/continuedev/src/continuedev/plugins/step/libs/hello_world.py +++ /dev/null @@ -1,9 +0,0 @@ -from ....plugins import step -from ....libs.steps import ContinueSDK - - -class HelloWorldStep: - """A Step that prints "Hello World!".""" - @step.hookimpl - def run(sdk: ContinueSDK): - print("Hello World!") -- cgit v1.2.3-70-g09d2 From f7d9d1b2f4e3a2187a93f3e8d1e10bdc9b03fbc8 Mon Sep 17 00:00:00 2001 From: Ty Dunn Date: Tue, 30 May 2023 16:03:49 +0200 Subject: some more work --- docs/docs/concepts/autopilot.md | 6 ++++++ docs/docs/concepts/core.md | 6 +++++- docs/docs/concepts/gui.md | 8 +++++++- docs/docs/concepts/history.md | 6 +++++- docs/docs/concepts/ide.md | 6 ++++++ docs/docs/concepts/llm.md | 7 +++++++ docs/docs/concepts/policy.md | 6 ++++++ docs/docs/concepts/recipe.md | 10 ++++++++++ docs/docs/concepts/sdk.md | 8 ++++++-- docs/docs/concepts/step.md | 28 ++++++++++++++++++---------- docs/docs/how-continue-works.md | 38 +++++++++++++++++++++++++++++++++++++- docs/docs/install.md | 2 +- docs/src/pages/index.js | 4 ++-- 13 files changed, 116 insertions(+), 19 deletions(-) diff --git a/docs/docs/concepts/autopilot.md b/docs/docs/concepts/autopilot.md index 5fc2a220..70c15905 100644 --- a/docs/docs/concepts/autopilot.md +++ b/docs/docs/concepts/autopilot.md @@ -2,6 +2,12 @@ *TODO: Explain in detail what this is and what its purpose is* +## One sentence definition + +The `autopilot` is + +## What else to know + `Autopilot` contains the - History - LLM diff --git a/docs/docs/concepts/core.md b/docs/docs/concepts/core.md index cd5f6d00..eb7ab15c 100644 --- a/docs/docs/concepts/core.md +++ b/docs/docs/concepts/core.md @@ -2,7 +2,11 @@ *TODO: Explain in detail what this is and what its purpose is* -The `Core` connects the SDK and GUI with the IDE (i.e. in VS Code, a web browser, etc), enabling the steps to make changes to your code and accelerate your software development workflows. +## One sentence definition + +The `Continue Core` connects the [SDK](./sdk.md) and [GUI](./gui.md) with the [IDE](./ide.md) (i.e. in VS Code, GitHub Codespaces, a web browser text editor, etc), enabling the steps to make changes to your code and accelerate your software development workflows. + +## What else to know The `Core` includes - IDE protocol diff --git a/docs/docs/concepts/gui.md b/docs/docs/concepts/gui.md index dfdc2a7a..81d6fbbf 100644 --- a/docs/docs/concepts/gui.md +++ b/docs/docs/concepts/gui.md @@ -1,6 +1,12 @@ # GUI -The `GUI` enables you to guide steps and makes everything transparent, so you can review all steps that were automated, giving you the opportunity to undo and rerun any that ran incorrectly. +*TODO: Explain in detail what this is and what its purpose is* + +## One sentence definition + +The `Continue GUI` enables you to guide steps and makes everything transparent, so you can review all steps that were automated, giving you the opportunity to undo and rerun any that ran incorrectly. + +## What else to know **From GUI to Core** - Natural language instructions from the developer diff --git a/docs/docs/concepts/history.md b/docs/docs/concepts/history.md index 5c52e158..518e847c 100644 --- a/docs/docs/concepts/history.md +++ b/docs/docs/concepts/history.md @@ -2,6 +2,10 @@ *TODO: Explain in detail what this is and what its purpose is* -`History` is the ordered record of all past steps. +## One sentence definition + +The `history` is the ordered record of all past steps. + +## What else to know **Q: What step data and metadata is stored in the history?** \ No newline at end of file diff --git a/docs/docs/concepts/ide.md b/docs/docs/concepts/ide.md index 4f30995f..b9bb8dbe 100644 --- a/docs/docs/concepts/ide.md +++ b/docs/docs/concepts/ide.md @@ -1,5 +1,11 @@ # IDE +## One sentence definition + +The `IDE` is + +## What else to know + *TODO: Explain in detail what this is and what its purpose is* ## Supported IDEs diff --git a/docs/docs/concepts/llm.md b/docs/docs/concepts/llm.md index 226a49eb..ec938877 100644 --- a/docs/docs/concepts/llm.md +++ b/docs/docs/concepts/llm.md @@ -1,5 +1,12 @@ # LLM +## One sentence definition + +An `LLM` is short for Large Language Model, which includes models like GPT-4, StarCoder, and others. + +## What else to know + + *TODO: Explain in detail what this is and what its purpose is* `LLM` is the large language model that can be used in steps to automate that require some judgement based on context (e.g. generating code based on docs, explaining an error given a stack trace, etc) diff --git a/docs/docs/concepts/policy.md b/docs/docs/concepts/policy.md index 58de2606..36d52616 100644 --- a/docs/docs/concepts/policy.md +++ b/docs/docs/concepts/policy.md @@ -1,5 +1,11 @@ # Policy +## One sentence definition + +A `policy` is + +## What else to know + *TODO: Explain in detail what this is and what its purpose is* The policy determines what step to run next diff --git a/docs/docs/concepts/recipe.md b/docs/docs/concepts/recipe.md index 3f051a4d..886843a0 100644 --- a/docs/docs/concepts/recipe.md +++ b/docs/docs/concepts/recipe.md @@ -1,5 +1,15 @@ # Recipe +## One sentence definition + +A `recipe` is a sequence of [steps](./step.md) composed into a workflow that developers use and share with others. + +## What else to know + +Although technically just a step itself, since they also subclass the Step class, recipes differentiate themselves from normal steps by ending their name with `Recipe` by convention. + +Technically, everything is a step since everything subclasses the step class. Steps can be composed together. Once steps are composed into a workflow that developers use and share with others, that step is called a recipe and, by convention, it ends with Recipe to signal this + *TODO: Explain in detail what this is and what its purpose is* An ordered sequence of steps that are intended to accomplish some complete task diff --git a/docs/docs/concepts/sdk.md b/docs/docs/concepts/sdk.md index 3316d2d0..18c6ca79 100644 --- a/docs/docs/concepts/sdk.md +++ b/docs/docs/concepts/sdk.md @@ -1,11 +1,15 @@ # SDK +## One sentence definition + +The `Continue SDK` gives you access to tools (e.g. open a directory, edit a file, call an LLM, etc), which you can use when defining how a step should work and composing them with other steps. + +## What else to know + *TODO: Explain in detail what this is and what its purpose is* *TODO: Detail all the SDK methods and how to use them* -The `SDK` gives you access to tools (e.g. open a directory, edit a file, call an LLM, etc), which you can use when defining how a step should work and composing them with other steps. - ## SDK methods ### run_step diff --git a/docs/docs/concepts/step.md b/docs/docs/concepts/step.md index 1f33a955..a32cdc1d 100644 --- a/docs/docs/concepts/step.md +++ b/docs/docs/concepts/step.md @@ -2,33 +2,41 @@ *TODO: Explain in detail what this is and what its purpose is* -A step is +## One sentence definition -## Step methods +A `step` is -### `run` (required) +## What else to know + +Steps can be composed together + +### Step methods + +#### `run` (required) the code that should run when executed by the policy -### `description` (optional) +#### `description` (optional) the definition of what the step does in natural language -### `reverse` (optional) +#### `reverse` (optional) the code that should run when the step is reversed -### `modify` (optional) +#### `modify` (optional) the code that should run when the step is rerun with feedback -## Steps +*TODO: Move list / description of all steps and recipes to the place where people will be able to use and update them* + +### Steps & recipes -### Core +#### Core -#### RunCommandStep +##### RunCommandStep -#### EditCodeStep +##### EditCodeStep #### ManualEditStep diff --git a/docs/docs/how-continue-works.md b/docs/docs/how-continue-works.md index a41986d0..f09c8221 100644 --- a/docs/docs/how-continue-works.md +++ b/docs/docs/how-continue-works.md @@ -8,4 +8,40 @@ The [SDK](./concepts/sdk.md) gives you access to tools (e.g. open a directory, e The [GUI](./concepts/gui.md) enables you to guide steps and makes everything transparent, so you can review all steps that were automated, giving you the opportunity to undo and rerun any that ran incorrectly. -The [Core](./concepts/core.md) connects the SDK and GUI with the IDE (i.e. in VS Code, a web browser, etc), enabling the steps to make changes to your code and accelerate your software development workflows. \ No newline at end of file +The [Core](./concepts/core.md) connects the SDK and GUI with the IDE (i.e. in VS Code, a web browser, etc), enabling the steps to make changes to your code and accelerate your software development workflows. + +### continuedev + +`core` folder contains major concepts, including Agent, Observation (sunsetting this potentially), Policy, SDK (all so far in their own files), and in `main.py`, History, HistoryNode, Step, and others. `env.py` is a common place to load environment variables, which can then be imported from here. + +`libs` contains misc. stuff. `llm` for language model utilities. `steps` for builtin Continue steps. `util` for very misc. stuff. `chroma` for chroma code that deals with codebase embeddings. + +`models` contains all the Pydantic models and `generate_json_schema.py`, a script that converts them to JSONSchema .json files in `schema/json`. + +`plugins` not really used, was from when I was using pluggy. I'll delete. + +`server` runs the servers that communicate with a) the React app (`notebook.py`) and b) the IDE (`ide.py`). `ide_protocol.py` is just the abstract version of what is implemented in `ide.py`, and `main.py` runs both `notebook.py` and `ide.py` as a single FastAPI server. This is the entry point to the Continue server, and acts as a bridge between IDE and React app. + +### docs + +Self-explanatory, but Docusaurus + +### extension + +Contains 1. The VS Code extension, whose code is in `extension/src`, with `extension.ts` being the entry point, and 2. the Continue React app, in the `extension/react-app` folder. This is displayed in the sidebar of VSCode, but is designed to work with any IDE that implements the protocol as is done in `extension/src/continueIdeClient.ts`. + +### schema + +We use OpenAPI/JSONSchema to define types so that it's really easy to bring them across language barriers. Use Pydantic types, then run `poetry run typegen` from the root of continuedev folder to generate JSONSchema json files in the `schema/json` folder. Then `npm run typegen` from the extension folder generates the types that are used within the extension. + +--- + +### GENERAL INFORMATION + +The Continue `Agent` class is the main loop, completing Steps and then deciding the next step and repeating. An Agent has a `Policy`, which decides what step to take next. An Agent takes user input from the React app. You can see this happening in `server/notebook.py`. It basically queues user inputs, pops off the most recent, runs that as a "UserInputStep", uses its Policy to run other steps until the next step is None, and then pops off the next user input. When nothing left, just waits for more. + +The Policy is where slash commands are defined. The Policy is a global thing, so probably something we'll want to make user-configurable if we don't significantly change it. + +A `Step` is a Pydantic class inheriting from `Step`. Steps implement the `run` method, which takes a ContinueSDK as its only parameter. The ContinueSDK gives all the utilities you need to easily write recipes (Steps). It also implements the `describe` method, which just computes a textual description of what happened when the `run` method was called. Can save attributes in `run` if you want, or just have a default `describe`, or not even implement it, in which case the name of the class is used. Any parameters to a Step are defined as attributes to the class without a double leading underscore (those with this are private). + +The ContinueSDK has a `run_step` method, which allows Steps to be composable. The reason you want to run it with `run_step` instead of creating a Step and calling `step.run(...)` is so Continue can automatically keep track of the order of all steps run, and allow for reversibility, etc... The ContinueSDK also contains functions for very common steps, like `edit_file`, `add_file`, `run` (to run shell commands), and a few others. `sdk.history` lets you access the history of past steps. `sdk.llm` lets you use the Agent's language model like `sdk.llm.complete`. `sdk.ide` lets you take any action within the connected IDE (this is where the IDE protocol is called). \ No newline at end of file diff --git a/docs/docs/install.md b/docs/docs/install.md index 923e7bd1..fdce84b0 100644 --- a/docs/docs/install.md +++ b/docs/docs/install.md @@ -1,6 +1,6 @@ # Installation -If you want to try out `Continue` without having to install it, check out the [GitHub Codespaces Demo](./getting-started.md) +If you want to try `Continue` before installing, check out the [GitHub Codespaces Demo](./getting-started.md) ## Install `Continue` packaged as a VS Code extension diff --git a/docs/src/pages/index.js b/docs/src/pages/index.js index a17ffc4d..e974e52a 100644 --- a/docs/src/pages/index.js +++ b/docs/src/pages/index.js @@ -30,8 +30,8 @@ export default function Home() { const {siteConfig} = useDocusaurusContext(); return ( + title={`Docs`} + description="Documentation for the `Continue` library">
-- cgit v1.2.3-70-g09d2 From 78ded638343874f84ce7336aa2f93d1d56c11977 Mon Sep 17 00:00:00 2001 From: Ty Dunn Date: Tue, 30 May 2023 16:05:43 +0200 Subject: a bit more --- docs/docs/concepts/autopilot.md | 4 +--- docs/docs/concepts/core.md | 2 +- docs/docs/concepts/llm.md | 2 +- docs/docs/concepts/recipe.md | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/docs/docs/concepts/autopilot.md b/docs/docs/concepts/autopilot.md index 70c15905..8d0d3231 100644 --- a/docs/docs/concepts/autopilot.md +++ b/docs/docs/concepts/autopilot.md @@ -12,6 +12,4 @@ The `autopilot` is - History - LLM - Policy -- IDE - -**We should rename agent to autopilot in the code** \ No newline at end of file +- IDE \ No newline at end of file diff --git a/docs/docs/concepts/core.md b/docs/docs/concepts/core.md index d6f6d7f7..eaadd5ff 100644 --- a/docs/docs/concepts/core.md +++ b/docs/docs/concepts/core.md @@ -17,4 +17,4 @@ The `Core` includes There is a two-way sync between an IDE and the GUI that happens through Core. -**Q: does this make sense as a concept?** +**Q: does this make sense as a concept?** \ No newline at end of file diff --git a/docs/docs/concepts/llm.md b/docs/docs/concepts/llm.md index 3389771b..b3a0fca2 100644 --- a/docs/docs/concepts/llm.md +++ b/docs/docs/concepts/llm.md @@ -13,4 +13,4 @@ An `LLM` is short for Large Language Model, which includes models like GPT-4, St **Q: should we call this LLM? Perhaps just model?** -**Q: should this abstraction be connected to autopilot?** +**Q: should this abstraction be connected to autopilot?** \ No newline at end of file diff --git a/docs/docs/concepts/recipe.md b/docs/docs/concepts/recipe.md index 886843a0..aa48a2a5 100644 --- a/docs/docs/concepts/recipe.md +++ b/docs/docs/concepts/recipe.md @@ -6,7 +6,7 @@ A `recipe` is a sequence of [steps](./step.md) composed into a workflow that dev ## What else to know -Although technically just a step itself, since they also subclass the Step class, recipes differentiate themselves from normal steps by ending their name with `Recipe` by convention. +Although technically just a step itself, since they also subclass the Step class, recipes differentiate themselves from normal steps by ending their name with `Recipe` by Technically, everything is a step since everything subclasses the step class. Steps can be composed together. Once steps are composed into a workflow that developers use and share with others, that step is called a recipe and, by convention, it ends with Recipe to signal this -- cgit v1.2.3-70-g09d2 From f406769c88321d30069a628d48156e8cea91fea6 Mon Sep 17 00:00:00 2001 From: Ty Dunn Date: Tue, 30 May 2023 17:08:33 +0200 Subject: splitting up nate's brain dump --- docs/docs/concepts/autopilot.md | 4 +++- docs/docs/concepts/ide.md | 3 +++ docs/docs/concepts/policy.md | 4 +++- docs/docs/concepts/sdk.md | 2 ++ docs/docs/concepts/step.md | 2 ++ docs/docs/how-continue-works.md | 52 ++++++++++++++--------------------------- 6 files changed, 30 insertions(+), 37 deletions(-) diff --git a/docs/docs/concepts/autopilot.md b/docs/docs/concepts/autopilot.md index 8d0d3231..c49e221e 100644 --- a/docs/docs/concepts/autopilot.md +++ b/docs/docs/concepts/autopilot.md @@ -4,10 +4,12 @@ ## One sentence definition -The `autopilot` is +The `autopilot` class is the main loop, completing Steps and then deciding the next step and repeating. ## What else to know +An autopilot takes user input from the React app. You can see this happening in `server/notebook.py`. It basically queues user inputs, pops off the most recent, runs that as a "UserInputStep", uses its Policy to run other steps until the next step is None, and then pops off the next user input. When nothing left, just waits for more. + `Autopilot` contains the - History - LLM diff --git a/docs/docs/concepts/ide.md b/docs/docs/concepts/ide.md index b9bb8dbe..85e72dc9 100644 --- a/docs/docs/concepts/ide.md +++ b/docs/docs/concepts/ide.md @@ -16,6 +16,9 @@ The VS Code extension implementation can be found at `/continue/extension/src` ### GitHub Codespaces +- `ide_protocol.py` is just the abstract version of what is implemented in `ide.py`, and `main.py` runs both `notebook.py` and `ide.py` as a single FastAPI server. This is the entry point to the Continue server, and acts as a bridge between IDE and React app +- extension directory contains 1. The VS Code extension, whose code is in `extension/src`, with `extension.ts` being the entry point, and 2. the Continue React app, in the `extension/react-app` folder. This is displayed in the sidebar of VSCode, but is designed to work with any IDE that implements the protocol as is done in `extension/src/continueIdeClient.ts`. + ## IDE Protocol methods ### handle_json diff --git a/docs/docs/concepts/policy.md b/docs/docs/concepts/policy.md index 36d52616..4bd3ed5e 100644 --- a/docs/docs/concepts/policy.md +++ b/docs/docs/concepts/policy.md @@ -2,10 +2,12 @@ ## One sentence definition -A `policy` is +A `policy` is decides what step to run next and is associated with a [autopilot](./autopilot.md). ## What else to know +The Policy is where slash commands are defined. The Policy is a global thing, so probably something we'll want to make user-configurable if we don't significantly change it. + *TODO: Explain in detail what this is and what its purpose is* The policy determines what step to run next diff --git a/docs/docs/concepts/sdk.md b/docs/docs/concepts/sdk.md index 18c6ca79..33b0b74b 100644 --- a/docs/docs/concepts/sdk.md +++ b/docs/docs/concepts/sdk.md @@ -6,6 +6,8 @@ The `Continue SDK` gives you access to tools (e.g. open a directory, edit a file ## What else to know +The ContinueSDK has a `run_step` method, which allows Steps to be composable. The reason you want to run it with `run_step` instead of creating a Step and calling `step.run(...)` is so Continue can automatically keep track of the order of all steps run, and allow for reversibility, etc... The ContinueSDK also contains functions for very common steps, like `edit_file`, `add_file`, `run` (to run shell commands), and a few others. `sdk.history` lets you access the history of past steps. `sdk.llm` lets you use the Autopilot's language model like `sdk.llm.complete`. `sdk.ide` lets you take any action within the connected IDE (this is where the IDE protocol is called). + *TODO: Explain in detail what this is and what its purpose is* *TODO: Detail all the SDK methods and how to use them* diff --git a/docs/docs/concepts/step.md b/docs/docs/concepts/step.md index a32cdc1d..97973a06 100644 --- a/docs/docs/concepts/step.md +++ b/docs/docs/concepts/step.md @@ -8,6 +8,8 @@ A `step` is ## What else to know +A `Step` is a Pydantic class inheriting from `Step`. Steps implement the `run` method, which takes a ContinueSDK as its only parameter. The ContinueSDK gives all the utilities you need to easily write recipes (Steps). It also implements the `describe` method, which just computes a textual description of what happened when the `run` method was called. Can save attributes in `run` if you want, or just have a default `describe`, or not even implement it, in which case the name of the class is used. Any parameters to a Step are defined as attributes to the class without a double leading underscore (those with this are private). + Steps can be composed together ### Step methods diff --git a/docs/docs/how-continue-works.md b/docs/docs/how-continue-works.md index f09c8221..550f328b 100644 --- a/docs/docs/how-continue-works.md +++ b/docs/docs/how-continue-works.md @@ -2,6 +2,8 @@ *TODO: Describe in more detail how `Continue` works* +## Overview + The `Continue` library consists of a [SDK](./concepts/sdk.md), a [GUI](./concepts/gui.md), and a [Core](./concepts/core.md) that brings everything together. The [SDK](./concepts/sdk.md) gives you access to tools (e.g. open a directory, edit a file, call a model, etc), which you can use when defining how a step should work and composing them with other steps. @@ -10,38 +12,18 @@ The [GUI](./concepts/gui.md) enables you to guide steps and makes everything tra The [Core](./concepts/core.md) connects the SDK and GUI with the IDE (i.e. in VS Code, a web browser, etc), enabling the steps to make changes to your code and accelerate your software development workflows. -### continuedev - -`core` folder contains major concepts, including Agent, Observation (sunsetting this potentially), Policy, SDK (all so far in their own files), and in `main.py`, History, HistoryNode, Step, and others. `env.py` is a common place to load environment variables, which can then be imported from here. - -`libs` contains misc. stuff. `llm` for language model utilities. `steps` for builtin Continue steps. `util` for very misc. stuff. `chroma` for chroma code that deals with codebase embeddings. - -`models` contains all the Pydantic models and `generate_json_schema.py`, a script that converts them to JSONSchema .json files in `schema/json`. - -`plugins` not really used, was from when I was using pluggy. I'll delete. - -`server` runs the servers that communicate with a) the React app (`notebook.py`) and b) the IDE (`ide.py`). `ide_protocol.py` is just the abstract version of what is implemented in `ide.py`, and `main.py` runs both `notebook.py` and `ide.py` as a single FastAPI server. This is the entry point to the Continue server, and acts as a bridge between IDE and React app. - -### docs - -Self-explanatory, but Docusaurus - -### extension - -Contains 1. The VS Code extension, whose code is in `extension/src`, with `extension.ts` being the entry point, and 2. the Continue React app, in the `extension/react-app` folder. This is displayed in the sidebar of VSCode, but is designed to work with any IDE that implements the protocol as is done in `extension/src/continueIdeClient.ts`. - -### schema - -We use OpenAPI/JSONSchema to define types so that it's really easy to bring them across language barriers. Use Pydantic types, then run `poetry run typegen` from the root of continuedev folder to generate JSONSchema json files in the `schema/json` folder. Then `npm run typegen` from the extension folder generates the types that are used within the extension. - ---- - -### GENERAL INFORMATION - -The Continue `Agent` class is the main loop, completing Steps and then deciding the next step and repeating. An Agent has a `Policy`, which decides what step to take next. An Agent takes user input from the React app. You can see this happening in `server/notebook.py`. It basically queues user inputs, pops off the most recent, runs that as a "UserInputStep", uses its Policy to run other steps until the next step is None, and then pops off the next user input. When nothing left, just waits for more. - -The Policy is where slash commands are defined. The Policy is a global thing, so probably something we'll want to make user-configurable if we don't significantly change it. - -A `Step` is a Pydantic class inheriting from `Step`. Steps implement the `run` method, which takes a ContinueSDK as its only parameter. The ContinueSDK gives all the utilities you need to easily write recipes (Steps). It also implements the `describe` method, which just computes a textual description of what happened when the `run` method was called. Can save attributes in `run` if you want, or just have a default `describe`, or not even implement it, in which case the name of the class is used. Any parameters to a Step are defined as attributes to the class without a double leading underscore (those with this are private). - -The ContinueSDK has a `run_step` method, which allows Steps to be composable. The reason you want to run it with `run_step` instead of creating a Step and calling `step.run(...)` is so Continue can automatically keep track of the order of all steps run, and allow for reversibility, etc... The ContinueSDK also contains functions for very common steps, like `edit_file`, `add_file`, `run` (to run shell commands), and a few others. `sdk.history` lets you access the history of past steps. `sdk.llm` lets you use the Agent's language model like `sdk.llm.complete`. `sdk.ide` lets you take any action within the connected IDE (this is where the IDE protocol is called). \ No newline at end of file +## What to know about codebase + +- `core` directory contains major concepts + - This includes Autopilot, Policy, SDK (all in their own files so far) + - It also includes `main.py`, which contains History, HistoryNode, Step, and others + - You'll find `env.py` here too, which is a common place to load environment variables, which can then be imported from here +- `libs` contains misc. stuff +- `llm` for language model utilities +- `steps` for builtin Continue steps +- `util` for very misc. stuff +- `chroma` for chroma code that deals with codebase embeddings +- `models` contains all the Pydantic models and `generate_json_schema.py`, a script that converts them to JSONSchema .json files in `schema/json` +- `server` runs the servers that communicate with a) the React app (`notebook.py`) and b) the IDE (`ide.py`) +- `ide_protocol.py` is just the abstract version of what is implemented in `ide.py`, and `main.py` runs both `notebook.py` and `ide.py` as a single FastAPI server. This is the entry point to the Continue server, and acts as a bridge between IDE and React app +- We use OpenAPI/JSONSchema to define types so that it's really easy to bring them across language barriers. Use Pydantic types, then run `poetry run typegen` from the root of continuedev folder to generate JSONSchema json files in the `schema/json` folder. Then `npm run typegen` from the extension folder generates the types that are used within the extension. \ No newline at end of file -- cgit v1.2.3-70-g09d2 From cb953056cbe169768ef369f744ab123bfed6c493 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Tue, 30 May 2023 13:12:01 -0400 Subject: create-a-recipe.md --- docs/docs/walkthroughs/create-a-recipe.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/docs/walkthroughs/create-a-recipe.md b/docs/docs/walkthroughs/create-a-recipe.md index 74800531..a2805782 100644 --- a/docs/docs/walkthroughs/create-a-recipe.md +++ b/docs/docs/walkthroughs/create-a-recipe.md @@ -1,6 +1,14 @@ # Create a recipe -*TODO: Describe step-by-step how to create a recipe* +_TODO: Describe step-by-step how to create a recipe_ + +> Creating a recipe is the same as creating a step, except that you may choose to break it up into intermediate steps. Start by creating a subclass of Step. You should first consider what will be the parameters of your recipe. These are defined as attributes in the step, as with `input_file_path: str` below. Next, write the `run` method. This method takes the ContinueSDK as a parameter, giving you all the tools you need to write your recipe/steps (if it's missing something, let us know, we'll add it!). You can write any code inside the run method; this is what will happen when your recipe is run, line for line. As you're writing the run method, you want to consider how to break it up into sub-steps; each step will be displayed as a cell in the GUI, so this makes a difference to the end user. To break something off into a sub-step, simply make a new subclass of Step just like this one, with parameters and a run method, and call it inside of the parent step using `await sdk.run_step(MySubStep())`. To understand all of the other things you can do inside of a step with the `ContinueSDK`, see its documentation page. + +> Finally, every Step is displayed with a description of what it has done. If you'd like to override the default description of your steps, which is just the class name, then implement the `describe` method. You can: + +- Return a static string +- Store state in a class attribute (prepend with a double underscore, which signifies (through Pydantic) that this is not a parameter for the Step, just internal state) during the run method, and then grab this in the describe method. +- Use state in conjunction with the `models` parameter of the describe method to autogenerate a description with a language model. For example, if you'd used an attribute called `__code_written` to store a string representing some code that was written, you could implement describe as `return (await models.gpt35()).complete(f"{self.__code_written}\n\nSummarize the changes made in the above code.")`. ## 1. Create a step @@ -65,4 +73,4 @@ class CreatePipelineRecipe(Step): SetupPipelineStep() >> ValidatePipelineStep() ) -``` \ No newline at end of file +``` -- cgit v1.2.3-70-g09d2 From e9d0180b8071f362b8e3922019e8f6e08d6e0f4c Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Tue, 30 May 2023 13:32:28 -0400 Subject: SDK methods/properties --- docs/docs/concepts/sdk.md | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/docs/docs/concepts/sdk.md b/docs/docs/concepts/sdk.md index 33b0b74b..ed276dc0 100644 --- a/docs/docs/concepts/sdk.md +++ b/docs/docs/concepts/sdk.md @@ -8,9 +8,37 @@ The `Continue SDK` gives you access to tools (e.g. open a directory, edit a file The ContinueSDK has a `run_step` method, which allows Steps to be composable. The reason you want to run it with `run_step` instead of creating a Step and calling `step.run(...)` is so Continue can automatically keep track of the order of all steps run, and allow for reversibility, etc... The ContinueSDK also contains functions for very common steps, like `edit_file`, `add_file`, `run` (to run shell commands), and a few others. `sdk.history` lets you access the history of past steps. `sdk.llm` lets you use the Autopilot's language model like `sdk.llm.complete`. `sdk.ide` lets you take any action within the connected IDE (this is where the IDE protocol is called). -*TODO: Explain in detail what this is and what its purpose is* +_TODO: Explain in detail what this is and what its purpose is_ -*TODO: Detail all the SDK methods and how to use them* +> The `ContinueSDK`'s purpose is to give you all the tools you need to automate software development tasks in one convenient and standard location. + +_TODO: Detail all the SDK methods and how to use them_ + +_Properties:_ + +`sdk.ide` is an instance of the class `AbstractIdeProtocolServer`, which contains all the methods you might need to interact with the IDE. This includes things like reading, editing, saving, and opening files as well as getting the workspace directory, displaying suggestions, and more. The goal is to have an IDE agnostic way of interacting with IDEs, so that Steps are portable across VSCode, Sublime, Code, or any other editor you use. + +`sdk.models` is an instance of the `Models` class, containing many of the most commonly used LLMs or other foundation models. You can instantiate a model (starcoder for example) (this is too awkward rn, I know) by calling `starcoder = await sdk.models.starcoder()`. Right now, all of the models are `LLM`s, meaning that they offer the `complete` method, used like `bubble_sort_code = await starcoder.complete("# Write a bubble sort function below, in Python:\n")`. + +`sdk.history` is the `History` object that contains all information about previously run steps`. See the documentation page to learn more. + +_Methods:_ + +`run_step` is what allows Steps to be composable. While at the core, steps are run by calling `step.run(continue_sdk)`, using `sdk.run_step(step)` automatically fills in the `ContinueSDK` parameter, takes care of recording the step in history, and automatically updates the GUI. + +The below methods are all just shorthand for very common steps. + +`apply_filesystem_edit` takes a FileSystemEdit (subclasses include Add/DeleteFile/Directory and EditFile) and runs the `FileSystemEditStep`. + +`wait_for_user_input` and `wait_for_user_confirmation` both run steps that will open a cell prompting the user for some input, in the former case asking for a text input, and in the latter case just asking for confirmation through a button click. We are considering allowing for more complex forms in the future, potentially even dynamically generated by LLMs, so please reach out if this would be useful. + +`run` will run either a single command or a list of shell commands. + +`edit_file` takes a filename and prompt, then will use the EditCodeStep to apply the edits requested in natural language in the prompt to the file. The EditCodeStep uses StarCoder to do this; if you have reason to customize this functionality, you can define a custom step and call that. + +`add/delete_file/directory` do just that. + +`get_user_secret` will retrieve a secret from the local .env file or, if it doesn't exist, prompt the user to enter the secret, then store this in the .env file. ## SDK methods @@ -47,7 +75,7 @@ Gets the name of the files that are open in the IDE currently ### sdk.ide.readFile -Gets the contents of the file located at the `filepath` +Gets the contents of the file located at the `filepath` #### Paramaters @@ -55,4 +83,4 @@ Gets the contents of the file located at the `filepath` ### sdk.ide.get_recent_edits -**Q: what does this method do?** \ No newline at end of file +**Q: what does this method do?** -- cgit v1.2.3-70-g09d2 From 2b9fc4f2d9ab3b5dbc69fc2fb36ca7be29dcb031 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Tue, 30 May 2023 13:53:00 -0400 Subject: How continue works --- docs/docs/how-continue-works.md | 14 +++++++++----- docs/static/img/continue-architecture.png | Bin 0 -> 136666 bytes 2 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 docs/static/img/continue-architecture.png diff --git a/docs/docs/how-continue-works.md b/docs/docs/how-continue-works.md index 550f328b..7868c6be 100644 --- a/docs/docs/how-continue-works.md +++ b/docs/docs/how-continue-works.md @@ -1,6 +1,10 @@ # How `Continue` works -*TODO: Describe in more detail how `Continue` works* +_TODO: Describe in more detail how `Continue` works_ + +> (Nate) Continue connects any code editor (primarily VS Code right now) to a server (the Continue server) that can take actions in the editor in accordance with defined recipes at the request of a user through the GUI. What this looks like (maybe I'll draw a diagram): The Continue VS Code extension runs the ContinueIdeProtocol, launches the Continue Python server in the background, and opens the Continue GUI in a side-panel. The Continue server is the brain, communication center, and source of truth, interacting with VS Code through the ContinueIdeProtocol and with the GUI through the NotebookProtocol. Communication between the extension and GUI happens through the Continue server. When you type a natural language command in the GUI, this is sent to the Continue server, where the `Autopilot` class takes action, potentially using the ContinueIdeProtocol to request actions be taken in the IDE, and then updates the GUI to display the new history. + +![Continue Architecture Diagram](/img/continue-architecture.png) ## Overview @@ -15,9 +19,9 @@ The [Core](./concepts/core.md) connects the SDK and GUI with the IDE (i.e. in VS ## What to know about codebase - `core` directory contains major concepts - - This includes Autopilot, Policy, SDK (all in their own files so far) - - It also includes `main.py`, which contains History, HistoryNode, Step, and others - - You'll find `env.py` here too, which is a common place to load environment variables, which can then be imported from here + - This includes Autopilot, Policy, SDK (all in their own files so far) + - It also includes `main.py`, which contains History, HistoryNode, Step, and others + - You'll find `env.py` here too, which is a common place to load environment variables, which can then be imported from here - `libs` contains misc. stuff - `llm` for language model utilities - `steps` for builtin Continue steps @@ -26,4 +30,4 @@ The [Core](./concepts/core.md) connects the SDK and GUI with the IDE (i.e. in VS - `models` contains all the Pydantic models and `generate_json_schema.py`, a script that converts them to JSONSchema .json files in `schema/json` - `server` runs the servers that communicate with a) the React app (`notebook.py`) and b) the IDE (`ide.py`) - `ide_protocol.py` is just the abstract version of what is implemented in `ide.py`, and `main.py` runs both `notebook.py` and `ide.py` as a single FastAPI server. This is the entry point to the Continue server, and acts as a bridge between IDE and React app -- We use OpenAPI/JSONSchema to define types so that it's really easy to bring them across language barriers. Use Pydantic types, then run `poetry run typegen` from the root of continuedev folder to generate JSONSchema json files in the `schema/json` folder. Then `npm run typegen` from the extension folder generates the types that are used within the extension. \ No newline at end of file +- We use OpenAPI/JSONSchema to define types so that it's really easy to bring them across language barriers. Use Pydantic types, then run `poetry run typegen` from the root of continuedev folder to generate JSONSchema json files in the `schema/json` folder. Then `npm run typegen` from the extension folder generates the types that are used within the extension. diff --git a/docs/static/img/continue-architecture.png b/docs/static/img/continue-architecture.png new file mode 100644 index 00000000..7a38c904 Binary files /dev/null and b/docs/static/img/continue-architecture.png differ -- cgit v1.2.3-70-g09d2 From f17ef985e96423b32628fa8169535b824f5d1f9e Mon Sep 17 00:00:00 2001 From: Ty Dunn Date: Thu, 1 Jun 2023 23:00:45 +0200 Subject: single pages --- docs/docs/getting-started.md | 29 +++++++++++++++++++++++++++-- docs/docs/how-continue-works.md | 16 +++++++++++----- docs/docs/install.md | 14 ++++++++++++-- docs/docs/intro.md | 6 ++++-- docs/docs/telemetry.md | 4 ++-- 5 files changed, 56 insertions(+), 13 deletions(-) diff --git a/docs/docs/getting-started.md b/docs/docs/getting-started.md index 0324f89e..bd77fe6e 100644 --- a/docs/docs/getting-started.md +++ b/docs/docs/getting-started.md @@ -2,13 +2,38 @@ ## GitHub Codespaces Demo -*TODO: Describe step-by-step how to try the GitHub Codespaces Demo* +**TODO: Add `Open in GitHub Codespaces` badge here** + +1. Click the `Open in GitHub Codespaces` badge above + +:::info + We don't want to waste your time with install and env setup before you try Continue, so we set up a GitHub Codespaces dev container for you, which **won’t cost you anything**. If you are using GitHub Free for personal accounts, you can [use Codespaces for 120 hours per month for free](https://docs.github.com/en/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#monthly-included-storage-and-core-hours-for-personal-accounts) +::: + +2. Select the `Create new codespace` button and wait a couple minutes for it to launch and then install the Continue extension. It should look like this one it is complete: + +**TODO: Insert an image of Continue when it has opened** + +3. Try playing with Continue as you build a Python script to do Pandas stuff + +**TODO: Design and set up Pandas stuff scenario in codespaces** + +4. There are a few recipes you should also try +a. In the first directory, try out X recipe +b. In the second directory, try out Y recipe +c. In the third directory, try out Z recipe + +- database migrations +- something super simple (libaries) +- unit testing + +**TODO: Design and these recipes in codespaces** ## Next Steps If you would prefer to use Continue locally, we reccommend installing `Continue` packaged as a VS Code extension as described [here](./install.md). -Otherwise, if you would like to continue to use GitHub Codespaces, then you should now go through the walkthroughs: +Otherwise, if you would like to continue to use Continue on GitHub Codespaces, then you should now go through the walkthroughs: - How to [use the GUI](./walkthroughs/use-the-gui.md) - How to [use a recipe](./walkthroughs/use-a-recipe.md) - How to [create a recipe](./walkthroughs/create-a-recipe.md) diff --git a/docs/docs/how-continue-works.md b/docs/docs/how-continue-works.md index 7868c6be..751236fb 100644 --- a/docs/docs/how-continue-works.md +++ b/docs/docs/how-continue-works.md @@ -1,11 +1,9 @@ # How `Continue` works -_TODO: Describe in more detail how `Continue` works_ - -> (Nate) Continue connects any code editor (primarily VS Code right now) to a server (the Continue server) that can take actions in the editor in accordance with defined recipes at the request of a user through the GUI. What this looks like (maybe I'll draw a diagram): The Continue VS Code extension runs the ContinueIdeProtocol, launches the Continue Python server in the background, and opens the Continue GUI in a side-panel. The Continue server is the brain, communication center, and source of truth, interacting with VS Code through the ContinueIdeProtocol and with the GUI through the NotebookProtocol. Communication between the extension and GUI happens through the Continue server. When you type a natural language command in the GUI, this is sent to the Continue server, where the `Autopilot` class takes action, potentially using the ContinueIdeProtocol to request actions be taken in the IDE, and then updates the GUI to display the new history. - ![Continue Architecture Diagram](/img/continue-architecture.png) +**TODO: Rename notebook protocol in this diagram** + ## Overview The `Continue` library consists of a [SDK](./concepts/sdk.md), a [GUI](./concepts/gui.md), and a [Core](./concepts/core.md) that brings everything together. @@ -18,6 +16,14 @@ The [Core](./concepts/core.md) connects the SDK and GUI with the IDE (i.e. in VS ## What to know about codebase +**TODO: Refactor all of this and make it fit with language above** + +- Continue connects any code editor (primarily VS Code right now) to a server (the Continue server) that can take actions in the editor in accordance with defined recipes at the request of a user through the GUI +- What this looks like: + - The Continue VS Code extension runs the ContinueIdeProtocol, launches the Continue Python server in the background, and opens the Continue GUI in a side-panel. + - The Continue server is the brain, communication center, and source of truth, interacting with VS Code through the ContinueIdeProtocol and with the GUI through the NotebookProtocol. + - Communication between the extension and GUI happens through the Continue server. + - When you type a natural language command in the GUI, this is sent to the Continue server, where the `Autopilot` class takes action, potentially using the ContinueIdeProtocol to request actions be taken in the IDE, and then updates the GUI to display the new history. - `core` directory contains major concepts - This includes Autopilot, Policy, SDK (all in their own files so far) - It also includes `main.py`, which contains History, HistoryNode, Step, and others @@ -30,4 +36,4 @@ The [Core](./concepts/core.md) connects the SDK and GUI with the IDE (i.e. in VS - `models` contains all the Pydantic models and `generate_json_schema.py`, a script that converts them to JSONSchema .json files in `schema/json` - `server` runs the servers that communicate with a) the React app (`notebook.py`) and b) the IDE (`ide.py`) - `ide_protocol.py` is just the abstract version of what is implemented in `ide.py`, and `main.py` runs both `notebook.py` and `ide.py` as a single FastAPI server. This is the entry point to the Continue server, and acts as a bridge between IDE and React app -- We use OpenAPI/JSONSchema to define types so that it's really easy to bring them across language barriers. Use Pydantic types, then run `poetry run typegen` from the root of continuedev folder to generate JSONSchema json files in the `schema/json` folder. Then `npm run typegen` from the extension folder generates the types that are used within the extension. +- We use OpenAPI/JSONSchema to define types so that it's really easy to bring them across language barriers. Use Pydantic types, then run `poetry run typegen` from the root of continuedev folder to generate JSONSchema json files in the `schema/json` folder. Then `npm run typegen` from the extension folder generates the types that are used within the extension. \ No newline at end of file diff --git a/docs/docs/install.md b/docs/docs/install.md index fdce84b0..f44fb01e 100644 --- a/docs/docs/install.md +++ b/docs/docs/install.md @@ -1,12 +1,22 @@ # Installation +:::note If you want to try `Continue` before installing, check out the [GitHub Codespaces Demo](./getting-started.md) +::: ## Install `Continue` packaged as a VS Code extension -Steps for installing `Continue` packaged as a VS Code extension... +1. Click `Install` on the `Continue` extension in the Visual Studio Marketplace [here](https://marketplace.visualstudio.com/items?itemName=Continue.continue) -*TODO: Describe step-by-step how to install `Continue` packaged as a VS Code extension* +2. This will open the `Continue` extension page in VS Code, where you will need to click `Install` again + +3. Once you do this, you will see a message in the bottom right hand corner of VS Code that says `Setting up Continue extension...`. After a couple minutes, the `Continue` extension will then open up + +**TODO: Finish writing out this step-by-step** + +## How to install from source + +Please follow the [README instructions in the repo](https://github.com/continuedev/continue) to install `Continue` from source. ## Next steps diff --git a/docs/docs/intro.md b/docs/docs/intro.md index 2d92d777..e9f1dffe 100644 --- a/docs/docs/intro.md +++ b/docs/docs/intro.md @@ -2,15 +2,17 @@ ![continue-cover-logo](/img/continue-cover-logo.png) +**TODO: Nate's review of this page** + ## What is `Continue`? **`Continue` is the open-source library for accelerating your use of LLMs while coding.** -You define the scenarios where Large Language Models ([LLMs](./concepts/llm.md)) like GPT-4 and StarCoder should act as an autopilot that helps you complete software development tasks. You use [recipes](./concepts/recipe.md) created by others to automate more steps in your development workflows. If a [recipe](./concepts/recipe.md) does not exist or work exactly like you want, you can use the [Continue SDK](./concepts/sdk.md) to create custom [steps](./concepts/step.md) and compose them into personalized [recipes](./concepts/recipe.md). Whether you are using a [recipe](./concepts/recipe.md) created by yourself or someone else, you can also review, reverse, and rerun [steps](./concepts/step.md) with the [Continue GUI](./concepts/gui.md), which helps guide the work done by LLMs and learn when to use and trust them. +You define the scenarios where Large Language Models ([LLMs](./concepts/llm.md)) like GPT-4 and StarCoder should act as an autopilot that helps you complete software development tasks. You use [recipes](./concepts/recipe.md) created by others to automate more steps in your development workflows. If a [recipe](./concepts/recipe.md) does not exist or work exactly like you want, you can use the [Continue SDK](./concepts/sdk.md) to create custom [steps](./concepts/step.md) and compose them into personalized [recipes](./concepts/recipe.md). Whether you are using a [recipe](./concepts/recipe.md) created by yourself or someone else, you can also review, reverse, and rerun [steps](./concepts/step.md) with the [Continue GUI](./concepts/gui.md), which helps you guide the work done by LLMs and learn when to use and trust them. ## Why do developers use `Continue`? -Many developers have begun to use models like [GPT-4](https://openai.com/research/gpt-4) through [ChatGPT](https://openai.com/blog/chatgpt) while coding; however, this is quite a painful experience because of how much manual copy, paste, and editing is required to construct context for LLMs and then incorporate the generations from LLMs. Many other developers prefer to use open source models or work at organizations where they are unable to use ChatGPT, so they are using [StarCoder](https://huggingface.co/blog/starcoder) [Chat](https://huggingface.co/chat/) and running into the same issues. +Many developers have begun to use models like [GPT-4](https://openai.com/research/gpt-4) through [ChatGPT](https://openai.com/blog/chatgpt) while coding; however, this is quite a painful experience because of how much manual copy, paste, and editing is required to construct context for LLMs and then incorporate the generations from LLMs. Many other developers prefer to use open source models or work at organizations where they are unable to use ChatGPT, so they are using [StarCoder](https://huggingface.co/blog/starcoder) [Chat](https://huggingface.co/chat/) and are running into the same issues. `Continue` eliminates the manual copy, paste, and editing required when using LLMs while coding. This accelerates how developers build, ship, and maintain software, while giving them the control to define when LLMs should take actions and the confidence to trust LLMs. In short, it enables developers to do what they have always done: work together to create better and better abstractions that make it easier and easier to automate the repetitive work that people want computers to do. diff --git a/docs/docs/telemetry.md b/docs/docs/telemetry.md index be0c7666..d1399706 100644 --- a/docs/docs/telemetry.md +++ b/docs/docs/telemetry.md @@ -8,10 +8,10 @@ We track the following... -*TODO: Detail exactly what we track* +**TODO: Detail exactly what we track after we add initial telemetry** ## How to opt out Here are the instructions for turning off telemetry... -*TODO: Describe step-by-step how to opt out of telemetry* \ No newline at end of file +**TODO: Describe step-by-step how to opt out of telemetry** \ No newline at end of file -- cgit v1.2.3-70-g09d2 From 50345910d6a3035b98f5083262ee04a6885d16b2 Mon Sep 17 00:00:00 2001 From: Ty Dunn Date: Thu, 1 Jun 2023 23:04:33 +0200 Subject: pages within categoriees --- docs/docs/concepts/autopilot.md | 23 +++++---- docs/docs/concepts/core.md | 22 ++++---- docs/docs/concepts/gui.md | 23 +++++---- docs/docs/concepts/history.md | 10 ++-- docs/docs/concepts/ide.md | 46 +++++++++-------- docs/docs/concepts/llm.md | 17 +++--- docs/docs/concepts/policy.md | 17 +++--- docs/docs/concepts/recipe.md | 20 +++---- docs/docs/concepts/sdk.md | 86 ++++++++++++------------------- docs/docs/concepts/step.md | 20 ++++--- docs/docs/walkthroughs/create-a-recipe.md | 67 ++++++++++++++---------- docs/docs/walkthroughs/share-a-recipe.md | 8 ++- docs/docs/walkthroughs/use-a-recipe.md | 15 +++++- docs/docs/walkthroughs/use-the-gui.md | 11 +++- 14 files changed, 208 insertions(+), 177 deletions(-) diff --git a/docs/docs/concepts/autopilot.md b/docs/docs/concepts/autopilot.md index c49e221e..725e0d88 100644 --- a/docs/docs/concepts/autopilot.md +++ b/docs/docs/concepts/autopilot.md @@ -1,17 +1,20 @@ # Autopilot -*TODO: Explain in detail what this is and what its purpose is* +## Overview -## One sentence definition +**TODO: Better explain in one sentence what this is and what its purpose is** -The `autopilot` class is the main loop, completing Steps and then deciding the next step and repeating. +The `autopilot` class is the main loop, completing steps and then deciding the next step and repeating -## What else to know +## Details -An autopilot takes user input from the React app. You can see this happening in `server/notebook.py`. It basically queues user inputs, pops off the most recent, runs that as a "UserInputStep", uses its Policy to run other steps until the next step is None, and then pops off the next user input. When nothing left, just waits for more. +**TODO: Nate to brain dump anything important to know and Ty to shape into paragraphs** -`Autopilot` contains the -- History -- LLM -- Policy -- IDE \ No newline at end of file +- An autopilot takes user input from the React app +- You can see this happening in `server/notebook.py` +- It basically queues user inputs, pops off the most recent, runs that as a "UserInputStep", uses its Policy to run other steps until the next step is None, and then pops off the next user input. When nothing left, just waits for more +- `Autopilot` contains the + - History + - LLM + - Policy + - IDE \ No newline at end of file diff --git a/docs/docs/concepts/core.md b/docs/docs/concepts/core.md index eaadd5ff..b8cc1d50 100644 --- a/docs/docs/concepts/core.md +++ b/docs/docs/concepts/core.md @@ -1,20 +1,18 @@ # Core -*TODO: Explain in detail what this is and what its purpose is* +## Overview -## One sentence definition +**TODO: Better explain in one sentence what this is and what its purpose is** The `Continue Core` connects the [SDK](./sdk.md) and [GUI](./gui.md) with the [IDE](./ide.md) (i.e. in VS Code, GitHub Codespaces, a web browser text editor, etc), enabling the steps to make changes to your code and accelerate your software development workflows. -## What else to know +## Details -The `Core` includes +**TODO: Nate to brain dump anything important to know and Ty to shape into paragraphs** -- IDE protocol -- GUI protocol -- SDK -- Autopilot - -There is a two-way sync between an IDE and the GUI that happens through Core. - -**Q: does this make sense as a concept?** \ No newline at end of file +- The `Core` includes + - IDE protocol + - GUI protocol + - SDK + - Autopilot +- There is a two-way sync between an IDE and the GUI that happens through Core \ No newline at end of file diff --git a/docs/docs/concepts/gui.md b/docs/docs/concepts/gui.md index 81d6fbbf..4847572b 100644 --- a/docs/docs/concepts/gui.md +++ b/docs/docs/concepts/gui.md @@ -1,19 +1,20 @@ # GUI -*TODO: Explain in detail what this is and what its purpose is* +**TODO: Make sure codebase aligns with this terminology** -## One sentence definition +## Overview -The `Continue GUI` enables you to guide steps and makes everything transparent, so you can review all steps that were automated, giving you the opportunity to undo and rerun any that ran incorrectly. +**TODO: Explain in one sentence what this is and what its purpose is** -## What else to know +The `Continue GUI` enables you to guide steps and makes everything transparent, so you can review all steps that were automated, giving you the opportunity to undo and rerun any that ran incorrectly. -**From GUI to Core** -- Natural language instructions from the developer -- Hover / clicked on a step -- Other user input +## Details -**From Core to GUI** -- Updates to state (e.g. a new step) +**TODO: Nate to brain dump anything important to know and Ty to shape into paragraphs** -**Q: do we call this the Continue GUI or Notebook?** \ No newline at end of file +- **From GUI to Core** + - Natural language instructions from the developer + - Hover / clicked on a step + - Other user input +- **From Core to GUI** + - Updates to state (e.g. a new step) \ No newline at end of file diff --git a/docs/docs/concepts/history.md b/docs/docs/concepts/history.md index 518e847c..8b29b241 100644 --- a/docs/docs/concepts/history.md +++ b/docs/docs/concepts/history.md @@ -1,11 +1,13 @@ # History -*TODO: Explain in detail what this is and what its purpose is* +## Overview -## One sentence definition +**TODO: Better explain in one sentence what this is and what its purpose is** The `history` is the ordered record of all past steps. -## What else to know +## Details -**Q: What step data and metadata is stored in the history?** \ No newline at end of file +**TODO: Nate to brain dump anything important to know and Ty to shape into paragraphs** + +- What step data and metadata is stored in the history? \ No newline at end of file diff --git a/docs/docs/concepts/ide.md b/docs/docs/concepts/ide.md index 85e72dc9..56bece8e 100644 --- a/docs/docs/concepts/ide.md +++ b/docs/docs/concepts/ide.md @@ -1,63 +1,67 @@ # IDE -## One sentence definition +## Overview -The `IDE` is +**TODO: Better explain in one sentence what this is and what its purpose is** -## What else to know +The `IDE` is the text editor where you manually edit your code. -*TODO: Explain in detail what this is and what its purpose is* +## Details -## Supported IDEs +**TODO: Nate to brain dump anything important to know and Ty to shape into paragraphs** -### VS Code +- `ide_protocol.py` is just the abstract version of what is implemented in `ide.py`, and `main.py` runs both `notebook.py` and `ide.py` as a single FastAPI server. This is the entry point to the Continue server, and acts as a bridge between IDE and React app +- extension directory contains 1. The VS Code extension, whose code is in `extension/src`, with `extension.ts` being the entry point, and 2. the Continue React app, in the `extension/react-app` folder. This is displayed in the sidebar of VSCode, but is designed to work with any IDE that implements the protocol as is done in `extension/src/continueIdeClient.ts`. -The VS Code extension implementation can be found at `/continue/extension/src` +### Supported IDEs -### GitHub Codespaces +#### VS Code -- `ide_protocol.py` is just the abstract version of what is implemented in `ide.py`, and `main.py` runs both `notebook.py` and `ide.py` as a single FastAPI server. This is the entry point to the Continue server, and acts as a bridge between IDE and React app -- extension directory contains 1. The VS Code extension, whose code is in `extension/src`, with `extension.ts` being the entry point, and 2. the Continue React app, in the `extension/react-app` folder. This is displayed in the sidebar of VSCode, but is designed to work with any IDE that implements the protocol as is done in `extension/src/continueIdeClient.ts`. +You can install the VS Code extension [here](../install.md) + +#### GitHub Codespaces + +You can install the GitHub Codespaces extension [here](../getting-started.md) -## IDE Protocol methods +### IDE Protocol methods -### handle_json +#### handle_json Handle a json message -### showSuggestion +#### showSuggestion Show a suggestion to the user -### getWorkspaceDirectory +#### getWorkspaceDirectory Get the workspace directory -### setFileOpen +#### setFileOpen Set whether a file is open -### openNotebook +#### openNotebook Open a notebook -### showSuggestionsAndWait +#### showSuggestionsAndWait Show suggestions to the user and wait for a response -### onAcceptRejectSuggestion +#### onAcceptRejectSuggestion Called when the user accepts or rejects a suggestion -### onTraceback +#### onTraceback Called when a traceback is received -### onFileSystemUpdate +#### onFileSystemUpdate Called when a file system update is received -### onCloseNotebook +#### onCloseNotebook Called when a notebook is closed diff --git a/docs/docs/concepts/llm.md b/docs/docs/concepts/llm.md index b3a0fca2..d7d62b37 100644 --- a/docs/docs/concepts/llm.md +++ b/docs/docs/concepts/llm.md @@ -1,16 +1,21 @@ # LLM -## One sentence definition +## Overview + +**TODO: Better explain in one sentence what this is and what its purpose is** An `LLM` is short for Large Language Model, which includes models like GPT-4, StarCoder, and others. -## What else to know +## Details + +**TODO: Nate to brain dump anything important to know and Ty to shape into paragraphs** +- `LLM` is the large language model that can be used in steps to automate that require some judgement based on context (e.g. generating code based on docs, explaining an error given a stack trace, etc) -*TODO: Explain in detail what this is and what its purpose is* +### Supported Models -`LLM` is the large language model that can be used in steps to automate that require some judgement based on context (e.g. generating code based on docs, explaining an error given a stack trace, etc) +#### `gpt-4` -**Q: should we call this LLM? Perhaps just model?** +#### `gpt-turbo-3.5` -**Q: should this abstraction be connected to autopilot?** \ No newline at end of file +#### `StarCoder` \ No newline at end of file diff --git a/docs/docs/concepts/policy.md b/docs/docs/concepts/policy.md index 4bd3ed5e..9658f6b4 100644 --- a/docs/docs/concepts/policy.md +++ b/docs/docs/concepts/policy.md @@ -1,17 +1,14 @@ # Policy -## One sentence definition +## Overview -A `policy` is decides what step to run next and is associated with a [autopilot](./autopilot.md). - -## What else to know +**TODO: Better explain in one sentence what this is and what its purpose is** -The Policy is where slash commands are defined. The Policy is a global thing, so probably something we'll want to make user-configurable if we don't significantly change it. - -*TODO: Explain in detail what this is and what its purpose is* +A `policy` is decides what step to run next and is associated with a [autopilot](./autopilot.md). -The policy determines what step to run next +## Details -**Q: what else do folks need to understand about policies?** +**TODO: Nate to brain dump anything important to know and Ty to shape into paragraphs** -**Q: what is the future plan for policies?** \ No newline at end of file +- The Policy is where slash commands are defined +- The Policy is a global thing, so probably something we'll want to make user-configurable if we don't significantly change it \ No newline at end of file diff --git a/docs/docs/concepts/recipe.md b/docs/docs/concepts/recipe.md index aa48a2a5..3bc59b53 100644 --- a/docs/docs/concepts/recipe.md +++ b/docs/docs/concepts/recipe.md @@ -1,19 +1,15 @@ # Recipe -## One sentence definition +## Overview -A `recipe` is a sequence of [steps](./step.md) composed into a workflow that developers use and share with others. +**TODO: Better explain in one sentence what this is and what its purpose is** -## What else to know +A `recipe` is an ordered sequence of [steps](./step.md) that are intended to accomplish some complete task, comprising a workflow that developers use and share with others. -Although technically just a step itself, since they also subclass the Step class, recipes differentiate themselves from normal steps by ending their name with `Recipe` by +## Details -Technically, everything is a step since everything subclasses the step class. Steps can be composed together. Once steps are composed into a workflow that developers use and share with others, that step is called a recipe and, by convention, it ends with Recipe to signal this +**TODO: Nate to brain dump anything important to know and Ty to shape into paragraphs** -*TODO: Explain in detail what this is and what its purpose is* - -An ordered sequence of steps that are intended to accomplish some complete task - -Actually just a step that is composed of only other steps / recipes. - -Altnerative names: workflow, plugin \ No newline at end of file +- Although technically just a step itself, since they also subclass the Step class, recipes differentiate themselves from normal steps by ending their name with `Recipe` by +- Technically, everything is a step since everything subclasses the step class. Steps can be composed together. Once steps are composed into a workflow that developers use and share with others, that step is called a recipe and, by convention, it ends with Recipe to signal this +- Actually just a step that is composed of only other steps / recipes. \ No newline at end of file diff --git a/docs/docs/concepts/sdk.md b/docs/docs/concepts/sdk.md index ed276dc0..caf012ed 100644 --- a/docs/docs/concepts/sdk.md +++ b/docs/docs/concepts/sdk.md @@ -1,86 +1,64 @@ # SDK -## One sentence definition +## Overview -The `Continue SDK` gives you access to tools (e.g. open a directory, edit a file, call an LLM, etc), which you can use when defining how a step should work and composing them with other steps. +**TODO: Better explain in one sentence what this is and what its purpose is** -## What else to know +The `Continue SDK` give you all the tools you need to automate software development tasks in one convenient and standard location (e.g. open a directory, edit a file, call an LLM, etc), which you can use when defining how a step should work and composing them with other steps. -The ContinueSDK has a `run_step` method, which allows Steps to be composable. The reason you want to run it with `run_step` instead of creating a Step and calling `step.run(...)` is so Continue can automatically keep track of the order of all steps run, and allow for reversibility, etc... The ContinueSDK also contains functions for very common steps, like `edit_file`, `add_file`, `run` (to run shell commands), and a few others. `sdk.history` lets you access the history of past steps. `sdk.llm` lets you use the Autopilot's language model like `sdk.llm.complete`. `sdk.ide` lets you take any action within the connected IDE (this is where the IDE protocol is called). +## Details -_TODO: Explain in detail what this is and what its purpose is_ +**TODO: Nate to brain dump anything important to know and Ty to shape into paragraphs** -> The `ContinueSDK`'s purpose is to give you all the tools you need to automate software development tasks in one convenient and standard location. +- The ContinueSDK has a `run_step` method, which allows Steps to be composable +- The reason you want to run it with `run_step` instead of creating a Step and calling `step.run(...)` is so Continue can automatically keep track of the order of all steps run, and allow for reversibility, etc... +- The ContinueSDK also contains functions for very common steps, like `edit_file`, `add_file`, `run` (to run shell commands), and a few others +- `sdk.history` lets you access the history of past steps +- `sdk.llm` lets you use the Autopilot's language model like `sdk.llm.complete` +- `sdk.ide` lets you take any action within the connected IDE (this is where the IDE protocol is called) -_TODO: Detail all the SDK methods and how to use them_ +### Properties -_Properties:_ +#### `sdk.ide` `sdk.ide` is an instance of the class `AbstractIdeProtocolServer`, which contains all the methods you might need to interact with the IDE. This includes things like reading, editing, saving, and opening files as well as getting the workspace directory, displaying suggestions, and more. The goal is to have an IDE agnostic way of interacting with IDEs, so that Steps are portable across VSCode, Sublime, Code, or any other editor you use. +#### `sdk.models` + `sdk.models` is an instance of the `Models` class, containing many of the most commonly used LLMs or other foundation models. You can instantiate a model (starcoder for example) (this is too awkward rn, I know) by calling `starcoder = await sdk.models.starcoder()`. Right now, all of the models are `LLM`s, meaning that they offer the `complete` method, used like `bubble_sort_code = await starcoder.complete("# Write a bubble sort function below, in Python:\n")`. +#### `sdk.history` + `sdk.history` is the `History` object that contains all information about previously run steps`. See the documentation page to learn more. -_Methods:_ +### Methods + +#### `run_step` `run_step` is what allows Steps to be composable. While at the core, steps are run by calling `step.run(continue_sdk)`, using `sdk.run_step(step)` automatically fills in the `ContinueSDK` parameter, takes care of recording the step in history, and automatically updates the GUI. The below methods are all just shorthand for very common steps. -`apply_filesystem_edit` takes a FileSystemEdit (subclasses include Add/DeleteFile/Directory and EditFile) and runs the `FileSystemEditStep`. - -`wait_for_user_input` and `wait_for_user_confirmation` both run steps that will open a cell prompting the user for some input, in the former case asking for a text input, and in the latter case just asking for confirmation through a button click. We are considering allowing for more complex forms in the future, potentially even dynamically generated by LLMs, so please reach out if this would be useful. - -`run` will run either a single command or a list of shell commands. - -`edit_file` takes a filename and prompt, then will use the EditCodeStep to apply the edits requested in natural language in the prompt to the file. The EditCodeStep uses StarCoder to do this; if you have reason to customize this functionality, you can define a custom step and call that. - -`add/delete_file/directory` do just that. - -`get_user_secret` will retrieve a secret from the local .env file or, if it doesn't exist, prompt the user to enter the secret, then store this in the .env file. - -## SDK methods - -### run_step +#### `apply_filesystem_edit` -### edit_file - -Edits a file - -#### Parameters - -- `filepath` (required): the location of the file that should be edited -- `prompt` (required): instructions for how the LLM should edit the file - -### run - -Runs a command - -#### Parameters - -- `command` (required): the command that should be run - -### wait_for_user_confirmation - -Waits for the user to review the steps that ran before running the next steps +`apply_filesystem_edit` takes a FileSystemEdit (subclasses include Add/DeleteFile/Directory and EditFile) and runs the `FileSystemEditStep`. -#### Paramaters +#### `wait_for_user_input` and `wait_for_user_confirmation` -- `question` (required): asks the user to confirm something specific +`wait_for_user_input` and `wait_for_user_confirmation` both run steps that will open a cell prompting the user for some input, in the former case asking for a text input, and in the latter case just asking for confirmation through a button click. We are considering allowing for more complex forms in the future, potentially even dynamically generated by LLMs, so please reach out if this would be useful. -### ide.getOpenFiles +#### `run` -Gets the name of the files that are open in the IDE currently +`run` will run either a single command or a list of shell commands. -### sdk.ide.readFile +#### `edit_file` -Gets the contents of the file located at the `filepath` +`edit_file` takes a filename and prompt, then will use the EditCodeStep to apply the edits requested in natural language in the prompt to the file. The EditCodeStep uses StarCoder to do this; if you have reason to customize this functionality, you can define a custom step and call that. -#### Paramaters +#### `add/delete_file/directory` -- `filepath` (required): the location of the file that should be read +`add/delete_file/directory` do just that. -### sdk.ide.get_recent_edits +#### `get_user_secret` -**Q: what does this method do?** +`get_user_secret` will retrieve a secret from the local .env file or, if it doesn't exist, prompt the user to enter the secret, then store this in the .env file. diff --git a/docs/docs/concepts/step.md b/docs/docs/concepts/step.md index 97973a06..fe044556 100644 --- a/docs/docs/concepts/step.md +++ b/docs/docs/concepts/step.md @@ -1,16 +1,22 @@ # Step -*TODO: Explain in detail what this is and what its purpose is* +## Overview -## One sentence definition +**TODO: Better explain in one sentence what this is and what its purpose is** -A `step` is +A `step` is a simple action that the LLM should take as part of a sequence that collectively completes some task -## What else to know +## Details -A `Step` is a Pydantic class inheriting from `Step`. Steps implement the `run` method, which takes a ContinueSDK as its only parameter. The ContinueSDK gives all the utilities you need to easily write recipes (Steps). It also implements the `describe` method, which just computes a textual description of what happened when the `run` method was called. Can save attributes in `run` if you want, or just have a default `describe`, or not even implement it, in which case the name of the class is used. Any parameters to a Step are defined as attributes to the class without a double leading underscore (those with this are private). +**TODO: Nate to brain dump anything important to know and Ty to shape into paragraphs** -Steps can be composed together +- A `Step` is a Pydantic class inheriting from `Step` +- Steps implement the `run` method, which takes a ContinueSDK as its only parameter +- The ContinueSDK gives all the utilities you need to easily write recipes (Steps) +- It also implements the `describe` method, which just computes a textual description of what happened when the `run` method was called +- Can save attributes in `run` if you want, or just have a default `describe`, or not even implement it, in which case the name of the class is used +- Any parameters to a Step are defined as attributes to the class without a double leading underscore (those with this are private). +- Steps can be composed together ### Step methods @@ -30,7 +36,7 @@ the code that should run when the step is reversed the code that should run when the step is rerun with feedback -*TODO: Move list / description of all steps and recipes to the place where people will be able to use and update them* +**TODO: Move the below list / description of all steps and recipes to the place where people will be able to use, update, share them** ### Steps & recipes diff --git a/docs/docs/walkthroughs/create-a-recipe.md b/docs/docs/walkthroughs/create-a-recipe.md index a2805782..ac89ae4e 100644 --- a/docs/docs/walkthroughs/create-a-recipe.md +++ b/docs/docs/walkthroughs/create-a-recipe.md @@ -1,22 +1,52 @@ # Create a recipe -_TODO: Describe step-by-step how to create a recipe_ +**TODO: Describe step-by-step how to create a recipe** -> Creating a recipe is the same as creating a step, except that you may choose to break it up into intermediate steps. Start by creating a subclass of Step. You should first consider what will be the parameters of your recipe. These are defined as attributes in the step, as with `input_file_path: str` below. Next, write the `run` method. This method takes the ContinueSDK as a parameter, giving you all the tools you need to write your recipe/steps (if it's missing something, let us know, we'll add it!). You can write any code inside the run method; this is what will happen when your recipe is run, line for line. As you're writing the run method, you want to consider how to break it up into sub-steps; each step will be displayed as a cell in the GUI, so this makes a difference to the end user. To break something off into a sub-step, simply make a new subclass of Step just like this one, with parameters and a run method, and call it inside of the parent step using `await sdk.run_step(MySubStep())`. To understand all of the other things you can do inside of a step with the `ContinueSDK`, see its documentation page. +Points to include +- Where to create recipes +- How to create a step +- How to create recipe +- Using models -> Finally, every Step is displayed with a description of what it has done. If you'd like to override the default description of your steps, which is just the class name, then implement the `describe` method. You can: +## 1. Create a step -- Return a static string -- Store state in a class attribute (prepend with a double underscore, which signifies (through Pydantic) that this is not a parameter for the Step, just internal state) during the run method, and then grab this in the describe method. -- Use state in conjunction with the `models` parameter of the describe method to autogenerate a description with a language model. For example, if you'd used an attribute called `__code_written` to store a string representing some code that was written, you could implement describe as `return (await models.gpt35()).complete(f"{self.__code_written}\n\nSummarize the changes made in the above code.")`. +### a. Start by creating a subclass of Step -## 1. Create a step +You should first consider what will be the parameters of your recipe. These are defined as attributes in the step, as with `input_file_path: str` below -### Using the SDK +### b. Next, write the `run` method + +This method takes the ContinueSDK as a parameter, giving you all the tools you need to write your recipe/steps (if it's missing something, let us know, we'll add it!). You can write any code inside the run method; this is what will happen when your recipe is run, line for line. As you're writing the run method, you want to consider how to break it up into sub-steps; each step will be displayed as a cell in the GUI, so this makes a difference to the end user. To break something off into a sub-step, simply make a new subclass of Step just like this one, with parameters and a run method, and call it inside of the parent step using `await sdk.run_step(MySubStep())`. To understand all of the other things you can do inside of a step with the `ContinueSDK`, see its documentation page. + +### c. Finally, every Step is displayed with a description of what it has done + +If you'd like to override the default description of your steps, which is just the class name, then implement the `describe` method. You can: + - Return a static string + - Store state in a class attribute (prepend with a double underscore, which signifies (through Pydantic) that this is not a parameter for the Step, just internal state) during the run method, and then grab this in the describe method. + - Use state in conjunction with the `models` parameter of the describe method to autogenerate a description with a language model. For example, if you'd used an attribute called `__code_written` to store a string representing some code that was written, you could implement describe as `return (await models.gpt35()).complete(f"{self.__code_written}\n\nSummarize the changes made in the above code.")`. + +## 2. Compose steps together into a complete recipe + +Creating a recipe is the same as creating a step, except that you may choose to break it up into intermediate steps + +By convention, the name of every recipe ends with `Recipe`. + +```python +class CreatePipelineRecipe(Step): + + async def run(self, sdk: ContinueSDK): + await sdk.run_step( + WaitForUserInputStep(prompt="What API do you want to load data from?") >> + SetupPipelineStep() >> + ValidatePipelineStep() + ) +``` -You will want to use the SDK when you are opening directories, editing files, using models, etc. +## Additional considerations -This will ensure that these actions are recorded as steps, so they are reviewable, reversable, and rerunnable. +### Using the SDK + +You will want to use the SDK when you are opening directories, editing files, using models, etc. This will ensure that these actions are recorded as steps, so they are reviewable, reversable, and rerunnable. ### Allow for configurability @@ -57,20 +87,3 @@ class SetUpVenvStep(Step): else: await sdk.run("python3 -m venv env && source env/bin/activate") # MacOS and Linux ``` - -## 2. Compose steps together into a complete recipe - -R - -By convention, the name of every recipe ends with `Recipe`. - -```python -class CreatePipelineRecipe(Step): - - async def run(self, sdk: ContinueSDK): - await sdk.run_step( - WaitForUserInputStep(prompt="What API do you want to load data from?") >> - SetupPipelineStep() >> - ValidatePipelineStep() - ) -``` diff --git a/docs/docs/walkthroughs/share-a-recipe.md b/docs/docs/walkthroughs/share-a-recipe.md index 1d5e2f60..a5f7ef50 100644 --- a/docs/docs/walkthroughs/share-a-recipe.md +++ b/docs/docs/walkthroughs/share-a-recipe.md @@ -1,3 +1,9 @@ # Share a recipe -*TODO: Describe step-by-step how to share a recipe* \ No newline at end of file +**TODO: Describe step-by-step how to share a recipe** + +Points to include +- Where to create recipes +- What you need to contribute them (README, style, etc) +- How to push them +- How to get them reviewed \ No newline at end of file diff --git a/docs/docs/walkthroughs/use-a-recipe.md b/docs/docs/walkthroughs/use-a-recipe.md index fc653eea..e230030e 100644 --- a/docs/docs/walkthroughs/use-a-recipe.md +++ b/docs/docs/walkthroughs/use-a-recipe.md @@ -1,3 +1,16 @@ # Use a recipe -*TODO: Describe step-by-step how to use a recipe* \ No newline at end of file +**TODO: Describe how to use a recipe** + +Points to include +- How to get recipes +- Slash commands +- READMEs with instructions for each recipe? +- Using GUI +- Reviewing +- Reversing +- Rerunning +- Follow the instructions +- Customizing recipe +- Recipes on per model basis (make sure you have added API key) +- Creating a recipe from scratch (link) \ No newline at end of file diff --git a/docs/docs/walkthroughs/use-the-gui.md b/docs/docs/walkthroughs/use-the-gui.md index a7263159..770b19d3 100644 --- a/docs/docs/walkthroughs/use-the-gui.md +++ b/docs/docs/walkthroughs/use-the-gui.md @@ -1,3 +1,12 @@ # Use the GUI -*TODO: Describe step-by-step how to use the `Continue GUI`* \ No newline at end of file +**TODO: Describe how to use the `Continue GUI`** + +Points to include +- Recipes +- Steps +- Giving natural language instructions +- Single turn at the moment +- Opening the (set of) file(s) you want to edit +- Reversing +- Modifying with feedback \ No newline at end of file -- cgit v1.2.3-70-g09d2 From 2bc683a8205b60a19555cf09cd4a5d113d7ea476 Mon Sep 17 00:00:00 2001 From: Ty Dunn Date: Fri, 2 Jun 2023 00:05:58 +0200 Subject: last touches for today --- docs/docs/concepts/autopilot.md | 6 +++--- docs/docs/concepts/core.md | 6 +++--- docs/docs/concepts/gui.md | 7 ++++--- docs/docs/concepts/history.md | 6 +++--- docs/docs/concepts/ide.md | 34 +++++++++++++++---------------- docs/docs/concepts/llm.md | 16 ++++++++------- docs/docs/concepts/policy.md | 6 +++--- docs/docs/concepts/recipe.md | 6 +++--- docs/docs/concepts/sdk.md | 32 ++++++++++++++--------------- docs/docs/concepts/step.md | 38 +++++++++++++++++------------------ docs/docs/getting-started.md | 4 ++-- docs/docs/how-continue-works.md | 2 +- docs/docs/install.md | 2 +- docs/docs/walkthroughs/use-the-gui.md | 2 +- 14 files changed, 85 insertions(+), 82 deletions(-) diff --git a/docs/docs/concepts/autopilot.md b/docs/docs/concepts/autopilot.md index 725e0d88..5073f7cb 100644 --- a/docs/docs/concepts/autopilot.md +++ b/docs/docs/concepts/autopilot.md @@ -1,10 +1,10 @@ # Autopilot -## Overview - **TODO: Better explain in one sentence what this is and what its purpose is** -The `autopilot` class is the main loop, completing steps and then deciding the next step and repeating +:::info +The **autopilot** is the main loop, completing steps and then deciding the next step and repeating +::: ## Details diff --git a/docs/docs/concepts/core.md b/docs/docs/concepts/core.md index b8cc1d50..766dbca0 100644 --- a/docs/docs/concepts/core.md +++ b/docs/docs/concepts/core.md @@ -1,10 +1,10 @@ # Core -## Overview - **TODO: Better explain in one sentence what this is and what its purpose is** -The `Continue Core` connects the [SDK](./sdk.md) and [GUI](./gui.md) with the [IDE](./ide.md) (i.e. in VS Code, GitHub Codespaces, a web browser text editor, etc), enabling the steps to make changes to your code and accelerate your software development workflows. +:::info +The **Continue Core** connects the [SDK](./sdk.md) and [GUI](./gui.md) with the [IDE](./ide.md) (i.e. in VS Code, GitHub Codespaces, a web browser text editor, etc), enabling the steps to make changes to your code and accelerate your software development workflows +::: ## Details diff --git a/docs/docs/concepts/gui.md b/docs/docs/concepts/gui.md index 4847572b..7ba16a63 100644 --- a/docs/docs/concepts/gui.md +++ b/docs/docs/concepts/gui.md @@ -2,11 +2,12 @@ **TODO: Make sure codebase aligns with this terminology** -## Overview - **TODO: Explain in one sentence what this is and what its purpose is** -The `Continue GUI` enables you to guide steps and makes everything transparent, so you can review all steps that were automated, giving you the opportunity to undo and rerun any that ran incorrectly. +:::info +The **Continue GUI** enables you to guide steps and makes everything transparent, so you can review all steps that were automated, giving you the opportunity to undo and rerun any that ran incorrectly +::: + ## Details diff --git a/docs/docs/concepts/history.md b/docs/docs/concepts/history.md index 8b29b241..bf72d2b4 100644 --- a/docs/docs/concepts/history.md +++ b/docs/docs/concepts/history.md @@ -1,10 +1,10 @@ # History -## Overview - **TODO: Better explain in one sentence what this is and what its purpose is** -The `history` is the ordered record of all past steps. +:::info +The **history** is the ordered record of all past steps +::: ## Details diff --git a/docs/docs/concepts/ide.md b/docs/docs/concepts/ide.md index 56bece8e..f7ff2429 100644 --- a/docs/docs/concepts/ide.md +++ b/docs/docs/concepts/ide.md @@ -1,10 +1,10 @@ # IDE -## Overview - **TODO: Better explain in one sentence what this is and what its purpose is** -The `IDE` is the text editor where you manually edit your code. +:::info +The **IDE** is the text editor where you manually edit your code. +::: ## Details @@ -13,55 +13,55 @@ The `IDE` is the text editor where you manually edit your code. - `ide_protocol.py` is just the abstract version of what is implemented in `ide.py`, and `main.py` runs both `notebook.py` and `ide.py` as a single FastAPI server. This is the entry point to the Continue server, and acts as a bridge between IDE and React app - extension directory contains 1. The VS Code extension, whose code is in `extension/src`, with `extension.ts` being the entry point, and 2. the Continue React app, in the `extension/react-app` folder. This is displayed in the sidebar of VSCode, but is designed to work with any IDE that implements the protocol as is done in `extension/src/continueIdeClient.ts`. -### Supported IDEs +## Supported IDEs -#### VS Code +### VS Code You can install the VS Code extension [here](../install.md) -#### GitHub Codespaces +### GitHub Codespaces You can install the GitHub Codespaces extension [here](../getting-started.md) -### IDE Protocol methods +## IDE Protocol methods -#### handle_json +### handle_json Handle a json message -#### showSuggestion +### showSuggestion Show a suggestion to the user -#### getWorkspaceDirectory +### getWorkspaceDirectory Get the workspace directory -#### setFileOpen +### setFileOpen Set whether a file is open -#### openNotebook +### openNotebook Open a notebook -#### showSuggestionsAndWait +### showSuggestionsAndWait Show suggestions to the user and wait for a response -#### onAcceptRejectSuggestion +### onAcceptRejectSuggestion Called when the user accepts or rejects a suggestion -#### onTraceback +### onTraceback Called when a traceback is received -#### onFileSystemUpdate +### onFileSystemUpdate Called when a file system update is received -#### onCloseNotebook +### onCloseNotebook Called when a notebook is closed diff --git a/docs/docs/concepts/llm.md b/docs/docs/concepts/llm.md index d7d62b37..fb3b2a33 100644 --- a/docs/docs/concepts/llm.md +++ b/docs/docs/concepts/llm.md @@ -1,21 +1,23 @@ # LLM -## Overview - **TODO: Better explain in one sentence what this is and what its purpose is** -An `LLM` is short for Large Language Model, which includes models like GPT-4, StarCoder, and others. +:::info +An **LLM** is short for Large Language Model, which includes models like GPT-4, StarCoder, and others +::: ## Details **TODO: Nate to brain dump anything important to know and Ty to shape into paragraphs** - `LLM` is the large language model that can be used in steps to automate that require some judgement based on context (e.g. generating code based on docs, explaining an error given a stack trace, etc) +- Steps and recipes are implemented with specific models +- Need to credentials for OpenAI models -### Supported Models +## Supported Models -#### `gpt-4` +### `gpt-4` -#### `gpt-turbo-3.5` +### `gpt-turbo-3.5` -#### `StarCoder` \ No newline at end of file +### `StarCoder` \ No newline at end of file diff --git a/docs/docs/concepts/policy.md b/docs/docs/concepts/policy.md index 9658f6b4..79dbca56 100644 --- a/docs/docs/concepts/policy.md +++ b/docs/docs/concepts/policy.md @@ -1,10 +1,10 @@ # Policy -## Overview - **TODO: Better explain in one sentence what this is and what its purpose is** -A `policy` is decides what step to run next and is associated with a [autopilot](./autopilot.md). +:::info +A **policy** is decides what step to run next and is associated with a [autopilot](./autopilot.md) +::: ## Details diff --git a/docs/docs/concepts/recipe.md b/docs/docs/concepts/recipe.md index 3bc59b53..05d5eb0b 100644 --- a/docs/docs/concepts/recipe.md +++ b/docs/docs/concepts/recipe.md @@ -1,10 +1,10 @@ # Recipe -## Overview - **TODO: Better explain in one sentence what this is and what its purpose is** -A `recipe` is an ordered sequence of [steps](./step.md) that are intended to accomplish some complete task, comprising a workflow that developers use and share with others. +:::info +A **recipe** is an ordered sequence of [steps](./step.md) that are intended to accomplish some complete task, comprising a workflow that developers use and share with others. +::: ## Details diff --git a/docs/docs/concepts/sdk.md b/docs/docs/concepts/sdk.md index caf012ed..aab97f5f 100644 --- a/docs/docs/concepts/sdk.md +++ b/docs/docs/concepts/sdk.md @@ -1,10 +1,10 @@ # SDK -## Overview - **TODO: Better explain in one sentence what this is and what its purpose is** -The `Continue SDK` give you all the tools you need to automate software development tasks in one convenient and standard location (e.g. open a directory, edit a file, call an LLM, etc), which you can use when defining how a step should work and composing them with other steps. +:::info +The **Continue SDK** gives you all the tools you need to automate software development tasks in one convenient and standard location (e.g. open a directory, edit a file, call an LLM, etc), which you can use when defining how a step should work and composing them with other steps. +::: ## Details @@ -17,48 +17,48 @@ The `Continue SDK` give you all the tools you need to automate software developm - `sdk.llm` lets you use the Autopilot's language model like `sdk.llm.complete` - `sdk.ide` lets you take any action within the connected IDE (this is where the IDE protocol is called) -### Properties +## Properties -#### `sdk.ide` +### `sdk.ide` `sdk.ide` is an instance of the class `AbstractIdeProtocolServer`, which contains all the methods you might need to interact with the IDE. This includes things like reading, editing, saving, and opening files as well as getting the workspace directory, displaying suggestions, and more. The goal is to have an IDE agnostic way of interacting with IDEs, so that Steps are portable across VSCode, Sublime, Code, or any other editor you use. -#### `sdk.models` +### `sdk.models` `sdk.models` is an instance of the `Models` class, containing many of the most commonly used LLMs or other foundation models. You can instantiate a model (starcoder for example) (this is too awkward rn, I know) by calling `starcoder = await sdk.models.starcoder()`. Right now, all of the models are `LLM`s, meaning that they offer the `complete` method, used like `bubble_sort_code = await starcoder.complete("# Write a bubble sort function below, in Python:\n")`. -#### `sdk.history` +### `sdk.history` `sdk.history` is the `History` object that contains all information about previously run steps`. See the documentation page to learn more. -### Methods +## Methods -#### `run_step` +### `run_step` `run_step` is what allows Steps to be composable. While at the core, steps are run by calling `step.run(continue_sdk)`, using `sdk.run_step(step)` automatically fills in the `ContinueSDK` parameter, takes care of recording the step in history, and automatically updates the GUI. The below methods are all just shorthand for very common steps. -#### `apply_filesystem_edit` +### `apply_filesystem_edit` `apply_filesystem_edit` takes a FileSystemEdit (subclasses include Add/DeleteFile/Directory and EditFile) and runs the `FileSystemEditStep`. -#### `wait_for_user_input` and `wait_for_user_confirmation` +### `wait_for_user_input` and `wait_for_user_confirmation` `wait_for_user_input` and `wait_for_user_confirmation` both run steps that will open a cell prompting the user for some input, in the former case asking for a text input, and in the latter case just asking for confirmation through a button click. We are considering allowing for more complex forms in the future, potentially even dynamically generated by LLMs, so please reach out if this would be useful. -#### `run` +### `run` `run` will run either a single command or a list of shell commands. -#### `edit_file` +### `edit_file` `edit_file` takes a filename and prompt, then will use the EditCodeStep to apply the edits requested in natural language in the prompt to the file. The EditCodeStep uses StarCoder to do this; if you have reason to customize this functionality, you can define a custom step and call that. -#### `add/delete_file/directory` +### `add/delete_file/directory` `add/delete_file/directory` do just that. -#### `get_user_secret` +### `get_user_secret` -`get_user_secret` will retrieve a secret from the local .env file or, if it doesn't exist, prompt the user to enter the secret, then store this in the .env file. +`get_user_secret` will retrieve a secret from the local .env file or, if it doesn't exist, prompt the user to enter the secret, then store this in the .env file. \ No newline at end of file diff --git a/docs/docs/concepts/step.md b/docs/docs/concepts/step.md index fe044556..61761344 100644 --- a/docs/docs/concepts/step.md +++ b/docs/docs/concepts/step.md @@ -1,10 +1,10 @@ # Step -## Overview - **TODO: Better explain in one sentence what this is and what its purpose is** -A `step` is a simple action that the LLM should take as part of a sequence that collectively completes some task +:::info +A **step** is a simple action that the LLM should take as part of a sequence that collectively completes some task +::: ## Details @@ -18,54 +18,54 @@ A `step` is a simple action that the LLM should take as part of a sequence that - Any parameters to a Step are defined as attributes to the class without a double leading underscore (those with this are private). - Steps can be composed together -### Step methods +## Step methods -#### `run` (required) +### `run` (required) the code that should run when executed by the policy -#### `description` (optional) +### `description` (optional) the definition of what the step does in natural language -#### `reverse` (optional) +### `reverse` (optional) the code that should run when the step is reversed -#### `modify` (optional) +### `modify` (optional) the code that should run when the step is rerun with feedback **TODO: Move the below list / description of all steps and recipes to the place where people will be able to use, update, share them** -### Steps & recipes +## Steps & recipes -#### Core +### Core -##### RunCommandStep +#### RunCommandStep -##### EditCodeStep +#### EditCodeStep -#### ManualEditStep +### ManualEditStep -### Community +## Community -#### CreateTableStep +### CreateTableStep Create a table in TypeORM -#### MigrationStep +### MigrationStep Create and run an alembic migration -##### Parameters +#### Parameters - `edited_file`: -#### WritePytestsStep +### WritePytestsStep Write unit tests for this file. -##### Parameters +#### Parameters - for_filepath (required): the path of the file that unit tests should be created for \ No newline at end of file diff --git a/docs/docs/getting-started.md b/docs/docs/getting-started.md index bd77fe6e..bec9961c 100644 --- a/docs/docs/getting-started.md +++ b/docs/docs/getting-started.md @@ -6,7 +6,7 @@ 1. Click the `Open in GitHub Codespaces` badge above -:::info +:::tip We don't want to waste your time with install and env setup before you try Continue, so we set up a GitHub Codespaces dev container for you, which **won’t cost you anything**. If you are using GitHub Free for personal accounts, you can [use Codespaces for 120 hours per month for free](https://docs.github.com/en/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#monthly-included-storage-and-core-hours-for-personal-accounts) ::: @@ -27,7 +27,7 @@ c. In the third directory, try out Z recipe - something super simple (libaries) - unit testing -**TODO: Design and these recipes in codespaces** +**TODO: Design and add these recipes in codespaces** ## Next Steps diff --git a/docs/docs/how-continue-works.md b/docs/docs/how-continue-works.md index 751236fb..e032c7a4 100644 --- a/docs/docs/how-continue-works.md +++ b/docs/docs/how-continue-works.md @@ -14,7 +14,7 @@ The [GUI](./concepts/gui.md) enables you to guide steps and makes everything tra The [Core](./concepts/core.md) connects the SDK and GUI with the IDE (i.e. in VS Code, a web browser, etc), enabling the steps to make changes to your code and accelerate your software development workflows. -## What to know about codebase +## Details **TODO: Refactor all of this and make it fit with language above** diff --git a/docs/docs/install.md b/docs/docs/install.md index f44fb01e..b9916b73 100644 --- a/docs/docs/install.md +++ b/docs/docs/install.md @@ -16,7 +16,7 @@ If you want to try `Continue` before installing, check out the [GitHub Codespace ## How to install from source -Please follow the [README instructions in the repo](https://github.com/continuedev/continue) to install `Continue` from source. +Please follow the [README instructions in the repo](https://github.com/continuedev/continue/blob/main/README.md) to install `Continue` from source. ## Next steps diff --git a/docs/docs/walkthroughs/use-the-gui.md b/docs/docs/walkthroughs/use-the-gui.md index 770b19d3..c244b461 100644 --- a/docs/docs/walkthroughs/use-the-gui.md +++ b/docs/docs/walkthroughs/use-the-gui.md @@ -5,8 +5,8 @@ Points to include - Recipes - Steps -- Giving natural language instructions - Single turn at the moment - Opening the (set of) file(s) you want to edit +- Then giving natural language instructions - Reversing - Modifying with feedback \ No newline at end of file -- cgit v1.2.3-70-g09d2 From fd446b55cb32d35ab9d0a0b535af26c366154388 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Thu, 1 Jun 2023 23:47:38 -0400 Subject: Edits and braindumps in docs --- docs/docs/concepts/autopilot.md | 20 ++++-- docs/docs/concepts/core.md | 14 ++-- docs/docs/concepts/gui.md | 15 ++-- docs/docs/concepts/history.md | 4 +- docs/docs/concepts/ide.md | 6 +- docs/docs/concepts/llm.md | 4 +- docs/docs/concepts/policy.md | 4 +- docs/docs/concepts/recipe.md | 4 +- docs/docs/concepts/sdk.md | 6 +- docs/docs/concepts/step.md | 6 +- docs/docs/getting-started.md | 27 +++---- docs/docs/how-continue-works.md | 18 +++-- docs/docs/install.md | 13 ++-- docs/docs/intro.md | 18 +++-- docs/docusaurus.config.js | 80 ++++++++++----------- docs/src/components/HomepageFeatures/index.js | 35 ++++----- docs/static/img/continue-architecture.png | Bin 136666 -> 1023648 bytes extension/README.md | 2 +- .../react-app/src/components/CodeMultiselect.tsx | 2 +- .../react-app/src/components/VSCodeFileLink.tsx | 4 +- extension/react-app/src/tabs/chat/MessageDiv.tsx | 2 +- extension/scripts/README.md | 2 +- extension/src/README.md | 14 ++-- 23 files changed, 153 insertions(+), 147 deletions(-) diff --git a/docs/docs/concepts/autopilot.md b/docs/docs/concepts/autopilot.md index 5073f7cb..f3ed6fc9 100644 --- a/docs/docs/concepts/autopilot.md +++ b/docs/docs/concepts/autopilot.md @@ -8,13 +8,23 @@ The **autopilot** is the main loop, completing steps and then deciding the next ## Details -**TODO: Nate to brain dump anything important to know and Ty to shape into paragraphs** +The Autopilot class is the center of Continue. Every step is initiated from the Autopilot, which provides it with a ContinueSDK. + +- Records history +- Allows reversal +- Injects SDK +- Has policy to decide what step to take next +- Accepts user input and acts on it +- Main event loop +- Contains main classes that are provided through the SDK, including LLM, History, IDE + +--- - An autopilot takes user input from the React app - You can see this happening in `server/notebook.py` - It basically queues user inputs, pops off the most recent, runs that as a "UserInputStep", uses its Policy to run other steps until the next step is None, and then pops off the next user input. When nothing left, just waits for more - `Autopilot` contains the - - History - - LLM - - Policy - - IDE \ No newline at end of file + - History + - LLM + - Policy + - IDE diff --git a/docs/docs/concepts/core.md b/docs/docs/concepts/core.md index 766dbca0..e9757b36 100644 --- a/docs/docs/concepts/core.md +++ b/docs/docs/concepts/core.md @@ -3,16 +3,16 @@ **TODO: Better explain in one sentence what this is and what its purpose is** :::info -The **Continue Core** connects the [SDK](./sdk.md) and [GUI](./gui.md) with the [IDE](./ide.md) (i.e. in VS Code, GitHub Codespaces, a web browser text editor, etc), enabling the steps to make changes to your code and accelerate your software development workflows +The **Continue Core** holds the main event loop, responsible for connecting [IDE](./ide.md) (i.e. in VS Code, GitHub Codespaces, a web browser text editor, etc), [SDK](./sdk.md), and [GUI](./gui.md), and deciding which steps to take next. ::: ## Details -**TODO: Nate to brain dump anything important to know and Ty to shape into paragraphs** +I tried a rewrite of the info box above. The core doesn't really mean that much except for maybe the Autopilot class and the small set of classes in core.py, including History, Step, Policy mostly. Maybe best referred to as a set of abstractions. Autopilot runs the main event loop, basically queueing user input and asking the policy what to do next, and injecting the SDK, and recording history. I suppose you could also say it includes the protocols, in which case you might say "connects IDE and GUI through the SDK", though lots of 3-letter acronyms going on here. Notes below are correct. - The `Core` includes - - IDE protocol - - GUI protocol - - SDK - - Autopilot -- There is a two-way sync between an IDE and the GUI that happens through Core \ No newline at end of file + - IDE protocol + - GUI protocol + - SDK + - Autopilot +- There is a two-way sync between an IDE and the GUI that happens through Core diff --git a/docs/docs/concepts/gui.md b/docs/docs/concepts/gui.md index 7ba16a63..ff99839f 100644 --- a/docs/docs/concepts/gui.md +++ b/docs/docs/concepts/gui.md @@ -2,20 +2,17 @@ **TODO: Make sure codebase aligns with this terminology** -**TODO: Explain in one sentence what this is and what its purpose is** - :::info -The **Continue GUI** enables you to guide steps and makes everything transparent, so you can review all steps that were automated, giving you the opportunity to undo and rerun any that ran incorrectly +The **Continue GUI** lets you transparently review every automated step, providing the opportunity to undo and rerun any that ran incorrectly. ::: - ## Details -**TODO: Nate to brain dump anything important to know and Ty to shape into paragraphs** +GUI displays every step taken by Continue in a way that lets you easily review, reverse, refine, re-run. Provides a natural language prompt where you can request edits in natural language or initiate recipes with slash commands. Communicates with the Continue server via GUI Protocol. Is a React app, which will eventually be published as a standalone npm package, importable as a simple React component. - **From GUI to Core** - - Natural language instructions from the developer - - Hover / clicked on a step - - Other user input + - Natural language instructions from the developer + - Hover / clicked on a step + - Other user input - **From Core to GUI** - - Updates to state (e.g. a new step) \ No newline at end of file + - Updates to state (e.g. a new step) diff --git a/docs/docs/concepts/history.md b/docs/docs/concepts/history.md index bf72d2b4..7f028e14 100644 --- a/docs/docs/concepts/history.md +++ b/docs/docs/concepts/history.md @@ -8,6 +8,6 @@ The **history** is the ordered record of all past steps ## Details -**TODO: Nate to brain dump anything important to know and Ty to shape into paragraphs** +History stores a list ("timeline") of HistoryNodes. Each HistoryNode contains the Step with parameters, the Observation returned by the step, and the depth of the step (just so we can understand the tree structure, and what called what, and display as a tree if we wanted). History has a current_index, which can be smaller than the length of the timeline if some steps have been reversed (in which case GUI displays them with lower opacity). History class mostly responsible for maintaining order of history during reversals, grabbing most recent steps, or other things that should be bottlenecked through reliable access methods. -- What step data and metadata is stored in the history? \ No newline at end of file +- What step data and metadata is stored in the history? diff --git a/docs/docs/concepts/ide.md b/docs/docs/concepts/ide.md index f7ff2429..dc20518e 100644 --- a/docs/docs/concepts/ide.md +++ b/docs/docs/concepts/ide.md @@ -8,10 +8,10 @@ The **IDE** is the text editor where you manually edit your code. ## Details -**TODO: Nate to brain dump anything important to know and Ty to shape into paragraphs** +SDK provides "IDEProtocol" class so that steps can interact with VS Code, etc... in an IDE-agnostic way. Communicates with editor through websockets protocol. All that's needed to make continue work with a new IDE/editor is to implement the protocol on the side of the editor. - `ide_protocol.py` is just the abstract version of what is implemented in `ide.py`, and `main.py` runs both `notebook.py` and `ide.py` as a single FastAPI server. This is the entry point to the Continue server, and acts as a bridge between IDE and React app -- extension directory contains 1. The VS Code extension, whose code is in `extension/src`, with `extension.ts` being the entry point, and 2. the Continue React app, in the `extension/react-app` folder. This is displayed in the sidebar of VSCode, but is designed to work with any IDE that implements the protocol as is done in `extension/src/continueIdeClient.ts`. +- extension directory contains 1. The VS Code extension, whose code is in `extension/src`, with `extension.ts` being the entry point, and 2. the Continue React app, in the `extension/react-app` folder. This is displayed in the sidebar of VS Code, but is designed to work with any IDE that implements the protocol as is done in `extension/src/continueIdeClient.ts`. ## Supported IDEs @@ -95,4 +95,4 @@ Apply a file edit ### saveFile -Save a file \ No newline at end of file +Save a file diff --git a/docs/docs/concepts/llm.md b/docs/docs/concepts/llm.md index fb3b2a33..6e5fccc1 100644 --- a/docs/docs/concepts/llm.md +++ b/docs/docs/concepts/llm.md @@ -8,7 +8,7 @@ An **LLM** is short for Large Language Model, which includes models like GPT-4, ## Details -**TODO: Nate to brain dump anything important to know and Ty to shape into paragraphs** +Just a class with a "complete" method. Right now have HuggingFaceInferenceAPI and OpenAI subclasses. Need credentials as of now. Different models useful in different places, so we provide easy access to multiple of them, right now just gpt3.5 and starcoder, but can add others super easily. - `LLM` is the large language model that can be used in steps to automate that require some judgement based on context (e.g. generating code based on docs, explaining an error given a stack trace, etc) - Steps and recipes are implemented with specific models @@ -20,4 +20,4 @@ An **LLM** is short for Large Language Model, which includes models like GPT-4, ### `gpt-turbo-3.5` -### `StarCoder` \ No newline at end of file +### `StarCoder` diff --git a/docs/docs/concepts/policy.md b/docs/docs/concepts/policy.md index 79dbca56..ea515673 100644 --- a/docs/docs/concepts/policy.md +++ b/docs/docs/concepts/policy.md @@ -8,7 +8,7 @@ A **policy** is decides what step to run next and is associated with a [autopilo ## Details -**TODO: Nate to brain dump anything important to know and Ty to shape into paragraphs** +A relic of my original plan that ended up being the place to define slash commands, the command run on startup, and other weird stuff that you might want to inject after certain other steps. This may be the place where "hooks" turn out to be implemented. Much of this may be configurable through `continue.json/yaml` config file (this is where steps that run on GUI opening are currently configured.). Simply takes the history and returns a single step to run next. Can return None if no step to take next. Then user input will kick it off again eventually. Autopilot has a single policy that it follows, so definitely a global/user-configurable type of thing. - The Policy is where slash commands are defined -- The Policy is a global thing, so probably something we'll want to make user-configurable if we don't significantly change it \ No newline at end of file +- The Policy is a global thing, so probably something we'll want to make user-configurable if we don't significantly change it diff --git a/docs/docs/concepts/recipe.md b/docs/docs/concepts/recipe.md index 05d5eb0b..da2b6264 100644 --- a/docs/docs/concepts/recipe.md +++ b/docs/docs/concepts/recipe.md @@ -8,8 +8,8 @@ A **recipe** is an ordered sequence of [steps](./step.md) that are intended to a ## Details -**TODO: Nate to brain dump anything important to know and Ty to shape into paragraphs** +When enough steps are strung together they become a recipe. Can kick off with slash command, can share/download somehow. - Although technically just a step itself, since they also subclass the Step class, recipes differentiate themselves from normal steps by ending their name with `Recipe` by - Technically, everything is a step since everything subclasses the step class. Steps can be composed together. Once steps are composed into a workflow that developers use and share with others, that step is called a recipe and, by convention, it ends with Recipe to signal this -- Actually just a step that is composed of only other steps / recipes. \ No newline at end of file +- Actually just a step that is composed of only other steps / recipes. diff --git a/docs/docs/concepts/sdk.md b/docs/docs/concepts/sdk.md index aab97f5f..30da2e79 100644 --- a/docs/docs/concepts/sdk.md +++ b/docs/docs/concepts/sdk.md @@ -8,8 +8,6 @@ The **Continue SDK** gives you all the tools you need to automate software devel ## Details -**TODO: Nate to brain dump anything important to know and Ty to shape into paragraphs** - - The ContinueSDK has a `run_step` method, which allows Steps to be composable - The reason you want to run it with `run_step` instead of creating a Step and calling `step.run(...)` is so Continue can automatically keep track of the order of all steps run, and allow for reversibility, etc... - The ContinueSDK also contains functions for very common steps, like `edit_file`, `add_file`, `run` (to run shell commands), and a few others @@ -21,7 +19,7 @@ The **Continue SDK** gives you all the tools you need to automate software devel ### `sdk.ide` -`sdk.ide` is an instance of the class `AbstractIdeProtocolServer`, which contains all the methods you might need to interact with the IDE. This includes things like reading, editing, saving, and opening files as well as getting the workspace directory, displaying suggestions, and more. The goal is to have an IDE agnostic way of interacting with IDEs, so that Steps are portable across VSCode, Sublime, Code, or any other editor you use. +`sdk.ide` is an instance of the class `AbstractIdeProtocolServer`, which contains all the methods you might need to interact with the IDE. This includes things like reading, editing, saving, and opening files as well as getting the workspace directory, displaying suggestions, and more. The goal is to have an IDE agnostic way of interacting with IDEs, so that Steps are portable across VS Code, Sublime, Code, or any other editor you use. ### `sdk.models` @@ -61,4 +59,4 @@ The below methods are all just shorthand for very common steps. ### `get_user_secret` -`get_user_secret` will retrieve a secret from the local .env file or, if it doesn't exist, prompt the user to enter the secret, then store this in the .env file. \ No newline at end of file +`get_user_secret` will retrieve a secret from the local .env file or, if it doesn't exist, prompt the user to enter the secret before moving on. diff --git a/docs/docs/concepts/step.md b/docs/docs/concepts/step.md index 61761344..b92e6faf 100644 --- a/docs/docs/concepts/step.md +++ b/docs/docs/concepts/step.md @@ -8,8 +8,6 @@ A **step** is a simple action that the LLM should take as part of a sequence tha ## Details -**TODO: Nate to brain dump anything important to know and Ty to shape into paragraphs** - - A `Step` is a Pydantic class inheriting from `Step` - Steps implement the `run` method, which takes a ContinueSDK as its only parameter - The ContinueSDK gives all the utilities you need to easily write recipes (Steps) @@ -60,7 +58,7 @@ Create and run an alembic migration #### Parameters -- `edited_file`: +- `edited_file`: ### WritePytestsStep @@ -68,4 +66,4 @@ Write unit tests for this file. #### Parameters -- for_filepath (required): the path of the file that unit tests should be created for \ No newline at end of file +- for_filepath (required): the path of the file that unit tests should be created for diff --git a/docs/docs/getting-started.md b/docs/docs/getting-started.md index bec9961c..39becd1a 100644 --- a/docs/docs/getting-started.md +++ b/docs/docs/getting-started.md @@ -2,15 +2,15 @@ ## GitHub Codespaces Demo -**TODO: Add `Open in GitHub Codespaces` badge here** +[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/continuedev/continue-codespaces-demo?quickstart=1) 1. Click the `Open in GitHub Codespaces` badge above :::tip - We don't want to waste your time with install and env setup before you try Continue, so we set up a GitHub Codespaces dev container for you, which **won’t cost you anything**. If you are using GitHub Free for personal accounts, you can [use Codespaces for 120 hours per month for free](https://docs.github.com/en/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#monthly-included-storage-and-core-hours-for-personal-accounts) +We don't want to waste your time with install and env setup before you try Continue, so we set up a GitHub Codespace for you, which **won’t cost you anything**. If you are using GitHub Free for personal accounts, you can [use Codespaces for 120 hours per month for free](https://docs.github.com/en/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#monthly-included-storage-and-core-hours-for-personal-accounts) ::: -2. Select the `Create new codespace` button and wait a couple minutes for it to launch and then install the Continue extension. It should look like this one it is complete: +2. Select the `Create new codespace` button and wait a couple minutes while it launches and installs the Continue extension. Once complete, it should look like this: **TODO: Insert an image of Continue when it has opened** @@ -19,9 +19,9 @@ **TODO: Design and set up Pandas stuff scenario in codespaces** 4. There are a few recipes you should also try -a. In the first directory, try out X recipe -b. In the second directory, try out Y recipe -c. In the third directory, try out Z recipe + a. In the first directory, try out X recipe + b. In the second directory, try out Y recipe + c. In the third directory, try out Z recipe - database migrations - something super simple (libaries) @@ -31,10 +31,13 @@ c. In the third directory, try out Z recipe ## Next Steps -If you would prefer to use Continue locally, we reccommend installing `Continue` packaged as a VS Code extension as described [here](./install.md). +If you're ready to use Continue locally, install `Continue` packaged as a VS Code extension, as described [here](./install.md). -Otherwise, if you would like to continue to use Continue on GitHub Codespaces, then you should now go through the walkthroughs: -- How to [use the GUI](./walkthroughs/use-the-gui.md) -- How to [use a recipe](./walkthroughs/use-a-recipe.md) -- How to [create a recipe](./walkthroughs/create-a-recipe.md) -- How to [share a recipe](./walkthroughs/share-a-recipe.md) \ No newline at end of file +If you'd like to continue exploring in GitHub Codespaces, you can learn more with our walkthroughs: + +How to... + +- [Use the GUI](./walkthroughs/use-the-gui.md) +- [Invoke a recipe](./walkthroughs/use-a-recipe.md) +- [Create a recipe](./walkthroughs/create-a-recipe.md) +- [Share a recipe](./walkthroughs/share-a-recipe.md) diff --git a/docs/docs/how-continue-works.md b/docs/docs/how-continue-works.md index e032c7a4..32bf6347 100644 --- a/docs/docs/how-continue-works.md +++ b/docs/docs/how-continue-works.md @@ -2,17 +2,15 @@ ![Continue Architecture Diagram](/img/continue-architecture.png) -**TODO: Rename notebook protocol in this diagram** - ## Overview -The `Continue` library consists of a [SDK](./concepts/sdk.md), a [GUI](./concepts/gui.md), and a [Core](./concepts/core.md) that brings everything together. +The `Continue` library consists of an [SDK](./concepts/sdk.md), a [GUI](./concepts/gui.md), and a [Core](./concepts/core.md) that brings everything together. -The [SDK](./concepts/sdk.md) gives you access to tools (e.g. open a directory, edit a file, call a model, etc), which you can use when defining how a step should work and composing them with other steps. +The [SDK](./concepts/sdk.md) gives you access to the tools (e.g. open a directory, edit a file, call a model, etc.) needed to define steps that integrate LLMs into your IDE. -The [GUI](./concepts/gui.md) enables you to guide steps and makes everything transparent, so you can review all steps that were automated, giving you the opportunity to undo and rerun any that ran incorrectly. +The [GUI](./concepts/gui.md) lets you transparently review every automated step, providing the opportunity to undo and rerun any that ran incorrectly. -The [Core](./concepts/core.md) connects the SDK and GUI with the IDE (i.e. in VS Code, a web browser, etc), enabling the steps to make changes to your code and accelerate your software development workflows. +The [Core](./concepts/core.md) holds the main event loop, responsible for connecting IDE, SDK, and GUI and deciding which steps to take next. ## Details @@ -20,9 +18,9 @@ The [Core](./concepts/core.md) connects the SDK and GUI with the IDE (i.e. in VS - Continue connects any code editor (primarily VS Code right now) to a server (the Continue server) that can take actions in the editor in accordance with defined recipes at the request of a user through the GUI - What this looks like: - - The Continue VS Code extension runs the ContinueIdeProtocol, launches the Continue Python server in the background, and opens the Continue GUI in a side-panel. - - The Continue server is the brain, communication center, and source of truth, interacting with VS Code through the ContinueIdeProtocol and with the GUI through the NotebookProtocol. - - Communication between the extension and GUI happens through the Continue server. + - The Continue VS Code extension runs the ContinueIdeProtocol, launches the Continue Python server in the background, and opens the Continue GUI in a side-panel. + - The Continue server is the brain, communication center, and source of truth, interacting with VS Code through the ContinueIdeProtocol and with the GUI through the NotebookProtocol. + - Communication between the extension and GUI happens through the Continue server. - When you type a natural language command in the GUI, this is sent to the Continue server, where the `Autopilot` class takes action, potentially using the ContinueIdeProtocol to request actions be taken in the IDE, and then updates the GUI to display the new history. - `core` directory contains major concepts - This includes Autopilot, Policy, SDK (all in their own files so far) @@ -36,4 +34,4 @@ The [Core](./concepts/core.md) connects the SDK and GUI with the IDE (i.e. in VS - `models` contains all the Pydantic models and `generate_json_schema.py`, a script that converts them to JSONSchema .json files in `schema/json` - `server` runs the servers that communicate with a) the React app (`notebook.py`) and b) the IDE (`ide.py`) - `ide_protocol.py` is just the abstract version of what is implemented in `ide.py`, and `main.py` runs both `notebook.py` and `ide.py` as a single FastAPI server. This is the entry point to the Continue server, and acts as a bridge between IDE and React app -- We use OpenAPI/JSONSchema to define types so that it's really easy to bring them across language barriers. Use Pydantic types, then run `poetry run typegen` from the root of continuedev folder to generate JSONSchema json files in the `schema/json` folder. Then `npm run typegen` from the extension folder generates the types that are used within the extension. \ No newline at end of file +- We use OpenAPI/JSONSchema to define types so that it's really easy to bring them across language barriers. Use Pydantic types, then run `poetry run typegen` from the root of continuedev folder to generate JSONSchema json files in the `schema/json` folder. Then `npm run typegen` from the extension folder generates the types that are used within the extension. diff --git a/docs/docs/install.md b/docs/docs/install.md index b9916b73..6dce5da4 100644 --- a/docs/docs/install.md +++ b/docs/docs/install.md @@ -20,8 +20,11 @@ Please follow the [README instructions in the repo](https://github.com/continued ## Next steps -Now that you have installed the VS Code extension, you should go through the walkthroughs: -- How to [use the GUI](./walkthroughs/use-the-gui.md) -- How to [use a recipe](./walkthroughs/use-a-recipe.md) -- How to [create a recipe](./walkthroughs/create-a-recipe.md) -- How to [share a recipe](./walkthroughs/share-a-recipe.md) \ No newline at end of file +Now that you have installed the VS Code extension, you can learn more with our walkthroughs: + +How to... + +- [Use the GUI](./walkthroughs/use-the-gui.md) +- [Invoke a recipe](./walkthroughs/use-a-recipe.md) +- [Create a recipe](./walkthroughs/create-a-recipe.md) +- [Share a recipe](./walkthroughs/share-a-recipe.md) diff --git a/docs/docs/intro.md b/docs/docs/intro.md index e9f1dffe..5d73a256 100644 --- a/docs/docs/intro.md +++ b/docs/docs/intro.md @@ -2,21 +2,19 @@ ![continue-cover-logo](/img/continue-cover-logo.png) -**TODO: Nate's review of this page** +## Quickstart + +1. Try out `Continue` in the [GitHub Codespaces Demo](./getting-started.md) +2. Install `Continue` packaged as a [VS Code extension](./install.md) ## What is `Continue`? -**`Continue` is the open-source library for accelerating your use of LLMs while coding.** +**`Continue` is the open-source library for accelerating software development with language models** -You define the scenarios where Large Language Models ([LLMs](./concepts/llm.md)) like GPT-4 and StarCoder should act as an autopilot that helps you complete software development tasks. You use [recipes](./concepts/recipe.md) created by others to automate more steps in your development workflows. If a [recipe](./concepts/recipe.md) does not exist or work exactly like you want, you can use the [Continue SDK](./concepts/sdk.md) to create custom [steps](./concepts/step.md) and compose them into personalized [recipes](./concepts/recipe.md). Whether you are using a [recipe](./concepts/recipe.md) created by yourself or someone else, you can also review, reverse, and rerun [steps](./concepts/step.md) with the [Continue GUI](./concepts/gui.md), which helps you guide the work done by LLMs and learn when to use and trust them. +You define the scenarios where Large Language Models ([LLMs](./concepts/llm.md)) like GPT-4 and StarCoder should act as an autopilot, helping you complete software development tasks. You use [recipes](./concepts/recipe.md) created by others to automate more steps in your workflows. If a [recipe](./concepts/recipe.md) does not exist or work exactly like you want, you can use the [Continue SDK](./concepts/sdk.md) to create custom [steps](./concepts/step.md) and compose them into personalized [recipes](./concepts/recipe.md). Whether you are using a [recipe](./concepts/recipe.md) created by yourself or someone else, you can review, reverse, and rerun [steps](./concepts/step.md) with the [Continue GUI](./concepts/gui.md), which helps you guide the work done by LLMs and learn when to use and trust them. ## Why do developers use `Continue`? -Many developers have begun to use models like [GPT-4](https://openai.com/research/gpt-4) through [ChatGPT](https://openai.com/blog/chatgpt) while coding; however, this is quite a painful experience because of how much manual copy, paste, and editing is required to construct context for LLMs and then incorporate the generations from LLMs. Many other developers prefer to use open source models or work at organizations where they are unable to use ChatGPT, so they are using [StarCoder](https://huggingface.co/blog/starcoder) [Chat](https://huggingface.co/chat/) and are running into the same issues. - -`Continue` eliminates the manual copy, paste, and editing required when using LLMs while coding. This accelerates how developers build, ship, and maintain software, while giving them the control to define when LLMs should take actions and the confidence to trust LLMs. In short, it enables developers to do what they have always done: work together to create better and better abstractions that make it easier and easier to automate the repetitive work that people want computers to do. +Many developers have begun to use models like [GPT-4](https://openai.com/research/gpt-4) through [ChatGPT](https://openai.com/blog/chatgpt) while coding; however, the experience is painful because of how much manual copying, pasting, and editing is required to supply them with context and transfer the generated solutions to your codebase. `Continue` eliminates this pain by deeply integrating LLMs into your IDE. -## Getting started - -1. Try out `Continue` in the [GitHub Codespaces Demo](./getting-started.md) -2. Install `Continue` packaged as a [VS Code extension](./install.md) \ No newline at end of file +`Continue` accelerates how developers build, ship, and maintain software, while giving them the control to define when LLMs should take actions and the confidence to trust LLMs. In short, it enables developers to do what they have always done: work together to create better and better abstractions that make it easier and easier to automate the repetitive work that people want computers to do. diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index 7ca00f8d..c2991841 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -1,49 +1,49 @@ // @ts-check // Note: type annotations allow type checking and IDEs autocompletion -const lightCodeTheme = require('prism-react-renderer/themes/github'); -const darkCodeTheme = require('prism-react-renderer/themes/dracula'); +const lightCodeTheme = require("prism-react-renderer/themes/github"); +const darkCodeTheme = require("prism-react-renderer/themes/dracula"); /** @type {import('@docusaurus/types').Config} */ const config = { - title: 'Continue', - tagline: 'the open-source library for accelerating your use of LLMs while coding', - favicon: 'img/favicon.ico', + title: "Continue", + tagline: + "the open-source library for accelerating software development with language models", + favicon: "img/favicon.ico", // Set the production url of your site here - url: 'https://continue.dev', + url: "https://continue.dev", // Set the // pathname under which your site is served // For GitHub pages deployment, it is often '//' - baseUrl: '/', + baseUrl: "/", // GitHub pages deployment config. // If you aren't using GitHub pages, you don't need these. - organizationName: 'continuedev', // Usually your GitHub org/user name. - projectName: 'continue', // Usually your repo name. + organizationName: "continuedev", // Usually your GitHub org/user name. + projectName: "continue", // Usually your repo name. - onBrokenLinks: 'throw', - onBrokenMarkdownLinks: 'warn', + onBrokenLinks: "throw", + onBrokenMarkdownLinks: "warn", // Even if you don't use internalization, you can use this field to set useful // metadata like html lang. For example, if your site is Chinese, you may want // to replace "en" with "zh-Hans". i18n: { - defaultLocale: 'en', - locales: ['en'], + defaultLocale: "en", + locales: ["en"], }, presets: [ [ - 'classic', + "classic", /** @type {import('@docusaurus/preset-classic').Options} */ ({ docs: { - sidebarPath: require.resolve('./sidebars.js'), - editUrl: - 'https://github.com/continuedev/continue/', + sidebarPath: require.resolve("./sidebars.js"), + editUrl: "https://github.com/continuedev/continue/", }, theme: { - customCss: require.resolve('./src/css/custom.css'), + customCss: require.resolve("./src/css/custom.css"), }, }), ], @@ -53,54 +53,54 @@ const config = { /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ ({ // Replace with your project's social card - image: 'img/docusaurus-social-card.jpg', + image: "img/docusaurus-social-card.jpg", navbar: { - title: 'Continue', + title: "Continue", logo: { - alt: 'My Site Logo', - src: 'img/logo.svg', + alt: "My Site Logo", + src: "img/logo.svg", }, items: [ { - type: 'docSidebar', - sidebarId: 'docsSidebar', - position: 'left', - label: 'Docs', + type: "docSidebar", + sidebarId: "docsSidebar", + position: "left", + label: "Docs", }, { - href: 'https://github.com/continuedev/continue', - label: 'GitHub', - position: 'right', + href: "https://github.com/continuedev/continue", + label: "GitHub", + position: "right", }, ], }, footer: { - style: 'dark', + style: "dark", links: [ { - title: 'Docs', + title: "Docs", items: [ { - label: 'Introduction', - to: '/docs/intro', + label: "Introduction", + to: "/docs/intro", }, ], }, { - title: 'Community', + title: "Community", items: [ { - label: 'Twitter', - href: 'https://twitter.com/continuedev', + label: "Twitter", + href: "https://twitter.com/continuedev", }, ], }, { - title: 'More', + title: "More", items: [ { - label: 'GitHub', - href: 'https://github.com/continuedev/continue', + label: "GitHub", + href: "https://github.com/continuedev/continue", }, ], }, @@ -114,4 +114,4 @@ const config = { }), }; -module.exports = config; \ No newline at end of file +module.exports = config; diff --git a/docs/src/components/HomepageFeatures/index.js b/docs/src/components/HomepageFeatures/index.js index 764ca891..0c5d8272 100644 --- a/docs/src/components/HomepageFeatures/index.js +++ b/docs/src/components/HomepageFeatures/index.js @@ -1,43 +1,44 @@ -import React from 'react'; -import clsx from 'clsx'; -import styles from './styles.module.css'; +import React from "react"; +import clsx from "clsx"; +import styles from "./styles.module.css"; const FeatureList = [ { - title: 'Define the scenarios where LLMs should step into accelerate you', - Svg: require('@site/static/img/undraw_docusaurus_mountain.svg').default, + title: "Tell LLMs when to step in", + Svg: require("@site/static/img/undraw_docusaurus_mountain.svg").default, description: ( <> - Enable LLMs to be an autopilot for parts of your software development tasks - by leveraging recipes created by others in the workflows you use when coding + Seamlessly put your repetitive software development tasks on autopilot + by leveraging recipes created by others ), }, { - title: 'Create your own workflows to show LLMs exactly what to do', - Svg: require('@site/static/img/undraw_docusaurus_tree.svg').default, + title: "Write your own recipes", + Svg: require("@site/static/img/undraw_docusaurus_tree.svg").default, description: ( <> - Use the Continue SDK to create your own custom steps and compose them into - personalized recipes, so that using LLMs seamlessly fits into your workflows + Use the Continue SDK to create your own custom steps and compose them + into personalized recipes, guiding LLMs through common sequences of + tasks ), }, { - title: 'Guide the steps taken by LLMs to learn when to use and trust them', - Svg: require('@site/static/img/undraw_docusaurus_react.svg').default, + title: "Wield LLMs with confidence", + Svg: require("@site/static/img/undraw_docusaurus_react.svg").default, description: ( <> - Use the Continue GUI to review, reverse, and rerun steps or even entire recipes, - incorporating LLMs with confidence into your software development workflows + Use the Continue GUI to review, reverse, and rerun steps or even entire + recipes, allowing you to build trust in LLMs ), }, ]; -function Feature({Svg, title, description}) { +function Feature({ Svg, title, description }) { return ( -
+
diff --git a/docs/static/img/continue-architecture.png b/docs/static/img/continue-architecture.png index 7a38c904..58366d8f 100644 Binary files a/docs/static/img/continue-architecture.png and b/docs/static/img/continue-architecture.png differ diff --git a/extension/README.md b/extension/README.md index 0a003145..df158440 100644 --- a/extension/README.md +++ b/extension/README.md @@ -29,7 +29,7 @@ Once Continue has code snippets to work with, it can generate a fix. Just click ### Stacktrace Parsing -Any stacktrace that appears in your VSCode terminal will be caught by us so we can immediately begin the debugging process. For small bugs that you might have quickly solved, we'll just speed up the process to be nearly instantaneous. +Any stacktrace that appears in your VS Code terminal will be caught by us so we can immediately begin the debugging process. For small bugs that you might have quickly solved, we'll just speed up the process to be nearly instantaneous. ### Generate Unit Tests and Docstrings diff --git a/extension/react-app/src/components/CodeMultiselect.tsx b/extension/react-app/src/components/CodeMultiselect.tsx index 626ae42f..c0ab9400 100644 --- a/extension/react-app/src/components/CodeMultiselect.tsx +++ b/extension/react-app/src/components/CodeMultiselect.tsx @@ -135,7 +135,7 @@ function formatFileRange( )} (lines ${rangeInFile.range.start.line + 1}-${ rangeInFile.range.end.line + 1 })`; - // +1 because VSCode Ranges are 0-indexed + // +1 because VS Code Ranges are 0-indexed } //#endregion diff --git a/extension/react-app/src/components/VSCodeFileLink.tsx b/extension/react-app/src/components/VSCodeFileLink.tsx index 6219654d..12ce5af8 100644 --- a/extension/react-app/src/components/VSCodeFileLink.tsx +++ b/extension/react-app/src/components/VSCodeFileLink.tsx @@ -1,7 +1,7 @@ import React from "react"; import { postVscMessage } from "../vscode"; -function VSCodeFileLink(props: { path: string; text?: string }) { +function VS CodeFileLink(props: { path: string; text?: string }) { return ( requirements.txt` whenever you add a new requirement. diff --git a/extension/src/README.md b/extension/src/README.md index bb10f5c8..76b96ea0 100644 --- a/extension/src/README.md +++ b/extension/src/README.md @@ -22,23 +22,23 @@ 10. Then run `npm run compile` -7. Open `src/activate.ts` file (or any TypeScript file) +11. Open `src/activate.ts` file (or any TypeScript file) -7. Press `F5` on your keyboard to start `Run and Debug` mode +12. Press `F5` on your keyboard to start `Run and Debug` mode -8. `cmd+shift+p` to look at developer console and select Continue commands +13. `cmd+shift+p` to look at developer console and select Continue commands -9. Every time you make changes to the code, you need to run `npm run compile` +14. Every time you make changes to the code, you need to run `npm run compile` -10. If you run into a "command not found" error, try running `npm run rebuild` and then `npm run compile` +15. If you run into a "command not found" error, try running `npm run rebuild` and then `npm run compile` ## Alternative: Install a packaged version -You should always have a packaged version installed in VSCode, because when Continue is broken you'll want a stable version to help you debug. There are four key commands in the `package.json`: +You should always have a packaged version installed in VS Code, because when Continue is broken you'll want a stable version to help you debug. There are four key commands in the `package.json`: 1. `npm run package` will create a .vsix file in the `build/` folder that can then be installed. It is this same file that you can share with others who want to try the extension. -2. `npm run install-extension` will install the extension to VSCode. You should then see it in your installed extensions in the VSCode sidebar. +2. `npm run install-extension` will install the extension to VS Code. You should then see it in your installed extensions in the VS Code sidebar. 3. `npm run uninstall` will uninstall the extension. You don't always have to do this thanks to the reinstall command, but can be useful when you want to do so manually. -- cgit v1.2.3-70-g09d2 From 22c420cbf26293e145def3e90e7132b4a337a5a5 Mon Sep 17 00:00:00 2001 From: Ty Dunn Date: Fri, 2 Jun 2023 17:58:53 +0200 Subject: changing core to server & other stuff --- docs/docs/concepts/core.md | 18 ------------------ docs/docs/concepts/server.md | 18 ++++++++++++++++++ docs/docs/concepts/step.md | 2 +- docs/docs/getting-started.md | 12 ++++-------- docs/docs/how-continue-works.md | 4 ++-- docs/docs/install.md | 9 +++------ docs/docs/intro.md | 2 +- docs/sidebars.js | 2 +- 8 files changed, 30 insertions(+), 37 deletions(-) delete mode 100644 docs/docs/concepts/core.md create mode 100644 docs/docs/concepts/server.md diff --git a/docs/docs/concepts/core.md b/docs/docs/concepts/core.md deleted file mode 100644 index e9757b36..00000000 --- a/docs/docs/concepts/core.md +++ /dev/null @@ -1,18 +0,0 @@ -# Core - -**TODO: Better explain in one sentence what this is and what its purpose is** - -:::info -The **Continue Core** holds the main event loop, responsible for connecting [IDE](./ide.md) (i.e. in VS Code, GitHub Codespaces, a web browser text editor, etc), [SDK](./sdk.md), and [GUI](./gui.md), and deciding which steps to take next. -::: - -## Details - -I tried a rewrite of the info box above. The core doesn't really mean that much except for maybe the Autopilot class and the small set of classes in core.py, including History, Step, Policy mostly. Maybe best referred to as a set of abstractions. Autopilot runs the main event loop, basically queueing user input and asking the policy what to do next, and injecting the SDK, and recording history. I suppose you could also say it includes the protocols, in which case you might say "connects IDE and GUI through the SDK", though lots of 3-letter acronyms going on here. Notes below are correct. - -- The `Core` includes - - IDE protocol - - GUI protocol - - SDK - - Autopilot -- There is a two-way sync between an IDE and the GUI that happens through Core diff --git a/docs/docs/concepts/server.md b/docs/docs/concepts/server.md new file mode 100644 index 00000000..3eebdb5f --- /dev/null +++ b/docs/docs/concepts/server.md @@ -0,0 +1,18 @@ +# Server + +**TODO: Better explain in one sentence what this is and what its purpose is** + +:::info +The **Continue Server** holds the main event loop, responsible for connecting [IDE](./ide.md) (i.e. in VS Code, GitHub Codespaces, a web browser text editor, etc), [SDK](./sdk.md), and [GUI](./gui.md), and deciding which steps to take next. +::: + +## Details + +I tried a rewrite of the info box above. The core doesn't really mean that much except for maybe the Autopilot class and the small set of classes in core.py, including History, Step, Policy mostly. Maybe best referred to as a set of abstractions. Autopilot runs the main event loop, basically queueing user input and asking the policy what to do next, and injecting the SDK, and recording history. I suppose you could also say it includes the protocols, in which case you might say "connects IDE and GUI through the SDK", though lots of 3-letter acronyms going on here. Notes below are correct. + +- The `server` includes + - IDE protocol + - GUI protocol + - SDK + - Autopilot +- There is a two-way sync between an IDE and the GUI that happens through the server diff --git a/docs/docs/concepts/step.md b/docs/docs/concepts/step.md index b92e6faf..1758fdd8 100644 --- a/docs/docs/concepts/step.md +++ b/docs/docs/concepts/step.md @@ -66,4 +66,4 @@ Write unit tests for this file. #### Parameters -- for_filepath (required): the path of the file that unit tests should be created for +- for_filepath (required): the path of the file that unit tests should be created for \ No newline at end of file diff --git a/docs/docs/getting-started.md b/docs/docs/getting-started.md index 39becd1a..90d6f8dc 100644 --- a/docs/docs/getting-started.md +++ b/docs/docs/getting-started.md @@ -14,18 +14,14 @@ We don't want to waste your time with install and env setup before you try Conti **TODO: Insert an image of Continue when it has opened** -3. Try playing with Continue as you build a Python script to do Pandas stuff +3. Try playing with Continue as you write some Python code to understand a dataset with Pandas **TODO: Design and set up Pandas stuff scenario in codespaces** 4. There are a few recipes you should also try - a. In the first directory, try out X recipe - b. In the second directory, try out Y recipe - c. In the third directory, try out Z recipe - -- database migrations -- something super simple (libaries) -- unit testing + a. In the first directory, try out Pytest recipe + b. In the second directory, try out Write comments for the highlighted code recipe + c. In the third directory, try out dlt CreatePipeline recipe **TODO: Design and add these recipes in codespaces** diff --git a/docs/docs/how-continue-works.md b/docs/docs/how-continue-works.md index 32bf6347..2d5f09a8 100644 --- a/docs/docs/how-continue-works.md +++ b/docs/docs/how-continue-works.md @@ -4,13 +4,13 @@ ## Overview -The `Continue` library consists of an [SDK](./concepts/sdk.md), a [GUI](./concepts/gui.md), and a [Core](./concepts/core.md) that brings everything together. +The `Continue` library consists of an [SDK](./concepts/sdk.md), a [GUI](./concepts/gui.md), and a [Server](./concepts/server.md) that brings everything together. The [SDK](./concepts/sdk.md) gives you access to the tools (e.g. open a directory, edit a file, call a model, etc.) needed to define steps that integrate LLMs into your IDE. The [GUI](./concepts/gui.md) lets you transparently review every automated step, providing the opportunity to undo and rerun any that ran incorrectly. -The [Core](./concepts/core.md) holds the main event loop, responsible for connecting IDE, SDK, and GUI and deciding which steps to take next. +The [Server](./concepts/server.md) holds the main event loop, responsible for connecting IDE, SDK, and GUI and deciding which steps to take next. ## Details diff --git a/docs/docs/install.md b/docs/docs/install.md index 6dce5da4..7e36ffd5 100644 --- a/docs/docs/install.md +++ b/docs/docs/install.md @@ -4,7 +4,7 @@ If you want to try `Continue` before installing, check out the [GitHub Codespaces Demo](./getting-started.md) ::: -## Install `Continue` packaged as a VS Code extension +## Install `Continue` locally in VS Code 1. Click `Install` on the `Continue` extension in the Visual Studio Marketplace [here](https://marketplace.visualstudio.com/items?itemName=Continue.continue) @@ -20,11 +20,8 @@ Please follow the [README instructions in the repo](https://github.com/continued ## Next steps -Now that you have installed the VS Code extension, you can learn more with our walkthroughs: - -How to... - +Now that you have installed locally in VS Code, you can learn more with our walkthroughs: - [Use the GUI](./walkthroughs/use-the-gui.md) -- [Invoke a recipe](./walkthroughs/use-a-recipe.md) +- [Use a recipe](./walkthroughs/use-a-recipe.md) - [Create a recipe](./walkthroughs/create-a-recipe.md) - [Share a recipe](./walkthroughs/share-a-recipe.md) diff --git a/docs/docs/intro.md b/docs/docs/intro.md index 5d73a256..b1ce4c72 100644 --- a/docs/docs/intro.md +++ b/docs/docs/intro.md @@ -15,6 +15,6 @@ You define the scenarios where Large Language Models ([LLMs](./concepts/llm.md)) ## Why do developers use `Continue`? -Many developers have begun to use models like [GPT-4](https://openai.com/research/gpt-4) through [ChatGPT](https://openai.com/blog/chatgpt) while coding; however, the experience is painful because of how much manual copying, pasting, and editing is required to supply them with context and transfer the generated solutions to your codebase. `Continue` eliminates this pain by deeply integrating LLMs into your IDE. +Many developers have begun to use models like [GPT-4](https://openai.com/research/gpt-4) through [ChatGPT](https://openai.com/blog/chatgpt) while coding; however, the experience is painful because of how much manual copying, pasting, and editing is required to supply them with context and transfer the generated solutions to your codebase. `Continue` eliminates this pain by deeply integrating LLMs into your IDE amd workflows. `Continue` accelerates how developers build, ship, and maintain software, while giving them the control to define when LLMs should take actions and the confidence to trust LLMs. In short, it enables developers to do what they have always done: work together to create better and better abstractions that make it easier and easier to automate the repetitive work that people want computers to do. diff --git a/docs/sidebars.js b/docs/sidebars.js index e232ceeb..b3ebec57 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -33,7 +33,7 @@ const sidebars = { label: "Concepts", items: [ "concepts/autopilot", - "concepts/core", + "concepts/server", "concepts/gui", "concepts/history", "concepts/ide", -- cgit v1.2.3-70-g09d2 From 07b0c7f5a3cfc30ab711179c4e437bac87768b81 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Fri, 2 Jun 2023 15:46:40 -0400 Subject: edits --- docs/docs/concepts/server.md | 9 +-------- docs/docs/walkthroughs/create-a-recipe.md | 12 +++++++----- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/docs/docs/concepts/server.md b/docs/docs/concepts/server.md index 3eebdb5f..e609fc6d 100644 --- a/docs/docs/concepts/server.md +++ b/docs/docs/concepts/server.md @@ -8,11 +8,4 @@ The **Continue Server** holds the main event loop, responsible for connecting [I ## Details -I tried a rewrite of the info box above. The core doesn't really mean that much except for maybe the Autopilot class and the small set of classes in core.py, including History, Step, Policy mostly. Maybe best referred to as a set of abstractions. Autopilot runs the main event loop, basically queueing user input and asking the policy what to do next, and injecting the SDK, and recording history. I suppose you could also say it includes the protocols, in which case you might say "connects IDE and GUI through the SDK", though lots of 3-letter acronyms going on here. Notes below are correct. - -- The `server` includes - - IDE protocol - - GUI protocol - - SDK - - Autopilot -- There is a two-way sync between an IDE and the GUI that happens through the server +The Continue server communicates with the IDE and GUI through websockets, acting as the communication bridge and main event loop. The `Autopilot` class is where most of this happens, accepting user input, calling on a policy to decide the next step, and injecting the `ContinueSDK` to run steps. diff --git a/docs/docs/walkthroughs/create-a-recipe.md b/docs/docs/walkthroughs/create-a-recipe.md index ac89ae4e..0cf1892e 100644 --- a/docs/docs/walkthroughs/create-a-recipe.md +++ b/docs/docs/walkthroughs/create-a-recipe.md @@ -3,6 +3,7 @@ **TODO: Describe step-by-step how to create a recipe** Points to include + - Where to create recipes - How to create a step - How to create recipe @@ -21,9 +22,10 @@ This method takes the ContinueSDK as a parameter, giving you all the tools you n ### c. Finally, every Step is displayed with a description of what it has done If you'd like to override the default description of your steps, which is just the class name, then implement the `describe` method. You can: - - Return a static string - - Store state in a class attribute (prepend with a double underscore, which signifies (through Pydantic) that this is not a parameter for the Step, just internal state) during the run method, and then grab this in the describe method. - - Use state in conjunction with the `models` parameter of the describe method to autogenerate a description with a language model. For example, if you'd used an attribute called `__code_written` to store a string representing some code that was written, you could implement describe as `return (await models.gpt35()).complete(f"{self.__code_written}\n\nSummarize the changes made in the above code.")`. + +- Return a static string +- Store state in a class attribute (prepend with a double underscore, which signifies (through Pydantic) that this is not a parameter for the Step, just internal state) during the run method, and then grab this in the describe method. +- Use state in conjunction with the `models` parameter of the describe method to autogenerate a description with a language model. For example, if you'd used an attribute called `__code_written` to store a string representing some code that was written, you could implement describe as `return (await models.gpt35()).complete(f"{self.\_\_code_written}\n\nSummarize the changes made in the above code.")`. ## 2. Compose steps together into a complete recipe @@ -53,7 +55,7 @@ You will want to use the SDK when you are opening directories, editing files, us Steps can include optional parameters that allow users to configure them ```python -from continueos import ContinueSDK +from continuedev import ContinueSDK class CreatePytestsStep(Step): @@ -73,7 +75,7 @@ class CreatePytestsStep(Step): You might want to implement your steps, so that they can run on Linux, MacOS, and Windows. ```python -from continueos import ContinueSDK +from continuedev import ContinueSDK import platform class SetUpVenvStep(Step): -- cgit v1.2.3-70-g09d2 From 85b19295941c272f3a6250ecab6126d45d357d6a Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Fri, 2 Jun 2023 19:42:24 -0400 Subject: telemetry --- docs/docs/telemetry.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/docs/telemetry.md b/docs/docs/telemetry.md index d1399706..c5e938dd 100644 --- a/docs/docs/telemetry.md +++ b/docs/docs/telemetry.md @@ -8,10 +8,14 @@ We track the following... -**TODO: Detail exactly what we track after we add initial telemetry** +- Steps that are run and their parameters ## How to opt out -Here are the instructions for turning off telemetry... +Create a `continue.json` file in the root of your workspace and add the following: -**TODO: Describe step-by-step how to opt out of telemetry** \ No newline at end of file +```json +{ + "allow_anonymous_telemetry": false +} +``` -- cgit v1.2.3-70-g09d2