summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorNate Sesti <sestinj@gmail.com>2023-05-30 13:32:28 -0400
committerNate Sesti <sestinj@gmail.com>2023-05-30 13:32:28 -0400
commite9d0180b8071f362b8e3922019e8f6e08d6e0f4c (patch)
tree3bb7096a207390a09673cf8c00715ccfecbee41b /docs
parentcb953056cbe169768ef369f744ab123bfed6c493 (diff)
downloadsncontinue-e9d0180b8071f362b8e3922019e8f6e08d6e0f4c.tar.gz
sncontinue-e9d0180b8071f362b8e3922019e8f6e08d6e0f4c.tar.bz2
sncontinue-e9d0180b8071f362b8e3922019e8f6e08d6e0f4c.zip
SDK methods/properties
Diffstat (limited to 'docs')
-rw-r--r--docs/docs/concepts/sdk.md36
1 files 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?**