From 99cd41b8901a09c4f5e5a1e0fc78a93ee2306f2e Mon Sep 17 00:00:00 2001 From: Ty Dunn Date: Mon, 3 Jul 2023 19:42:28 -0700 Subject: mentioning openai api key --- README.md | 11 +++++++++++ extension/README.md | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/README.md b/README.md index f917e505..7f950362 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,17 @@ Let Continue build the scaffolding of Python scripts, React components, and more ### [Download for VS Code](https://marketplace.visualstudio.com/items?itemName=Continue.continue) +## OpenAI API Key + +New users can try out Continue with GPT-4 using a proxy server that securely makes calls to OpenAI using our API key. Continue should just work the first time you install the extension in VS Code. + +Once you are using Continue regularly though, you will need to add an OpenAI API key that has access to GPT-4 by following these steps: +1. Copy your API key from https://platform.openai.com/account/api-keys +2. Use the `cmd`+`,` (Mac) / `ctrl`+`,` (Windows) to open your VS Code settings +3. Type "Continue" in the search bar +4. Click `Edit in settings.json` under **Continue: OpenAI_API_KEY" section** +5. Paste your API key as the value for "continue.OPENAI_API_KEY" in `settings.json` + ## License [Apache 2.0 © 2023 Continue Dev, Inc.](./LICENSE) diff --git a/extension/README.md b/extension/README.md index 1766cef1..4786c99b 100644 --- a/extension/README.md +++ b/extension/README.md @@ -25,6 +25,17 @@ Let Continue build the scaffolding of Python scripts, React components, and more - `Write Python in a new file to get Posthog events` - `Add a React component for syntax highlighted code` +## OpenAI API Key + +New users can try out Continue with GPT-4 using a proxy server that securely makes calls to OpenAI using our API key. Continue should just work the first time you install the extension in VS Code. + +Once you are using Continue regularly though, you will need to add an OpenAI API key that has access to GPT-4 by following these steps: +1. Copy your API key from https://platform.openai.com/account/api-keys +2. Use the `cmd`+`,` (Mac) / `ctrl`+`,` (Windows) to open your VS Code settings +3. Type "Continue" in the search bar +4. Click `Edit in settings.json` under **Continue: OpenAI_API_KEY" section** +5. Paste your API key as the value for "continue.OPENAI_API_KEY" in `settings.json` + ## License [Apache 2.0 © 2023 Continue Dev, Inc.](./LICENSE) \ No newline at end of file -- cgit v1.2.3-70-g09d2 From fac295e722f158f13502b45b749aee30b900c7a7 Mon Sep 17 00:00:00 2001 From: Ty Dunn Date: Mon, 3 Jul 2023 21:45:17 -0700 Subject: adding config slash command --- continuedev/src/continuedev/core/config.py | 5 +++++ continuedev/src/continuedev/libs/util/step_name_to_steps.py | 2 ++ continuedev/src/continuedev/server/gui.py | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/continuedev/src/continuedev/core/config.py b/continuedev/src/continuedev/core/config.py index ed5d785a..2972e4d1 100644 --- a/continuedev/src/continuedev/core/config.py +++ b/continuedev/src/continuedev/core/config.py @@ -43,6 +43,11 @@ class ContinueConfig(BaseModel): description="Reply to instructions or a question with previous steps and the highlighted code or current file as context", step_name="SimpleChatStep", ), + SlashCommand( + name="config", + description="Open the config file to create new and edit existing slash commands", + step_name="OpenConfigStep", + ), SlashCommand( name="comment", description="Write comments for the current file or highlighted code", diff --git a/continuedev/src/continuedev/libs/util/step_name_to_steps.py b/continuedev/src/continuedev/libs/util/step_name_to_steps.py index f431f317..d329e110 100644 --- a/continuedev/src/continuedev/libs/util/step_name_to_steps.py +++ b/continuedev/src/continuedev/libs/util/step_name_to_steps.py @@ -12,6 +12,7 @@ from ...recipes.DDtoBQRecipe.main import DDtoBQRecipe from ...recipes.DeployPipelineAirflowRecipe.main import DeployPipelineAirflowRecipe from ...steps.on_traceback import DefaultOnTracebackStep from ...steps.clear_history import ClearHistoryStep +from ...steps.open_config import OpenConfigStep # This mapping is used to convert from string in ContinueConfig json to corresponding Step class. # Used for example in slash_commands and steps_on_startup @@ -27,6 +28,7 @@ step_name_to_step_class = { "DeployPipelineAirflowRecipe": DeployPipelineAirflowRecipe, "DefaultOnTracebackStep": DefaultOnTracebackStep, "ClearHistoryStep": ClearHistoryStep, + "OpenConfigStep": OpenConfigStep } diff --git a/continuedev/src/continuedev/server/gui.py b/continuedev/src/continuedev/server/gui.py index 9a33fb6c..85458c09 100644 --- a/continuedev/src/continuedev/server/gui.py +++ b/continuedev/src/continuedev/server/gui.py @@ -148,7 +148,7 @@ async def websocket_endpoint(websocket: WebSocket, session: Session = Depends(we # Update any history that may have happened before connection await protocol.send_available_slash_commands() - # await protocol.send_state_update() THIS WAS CAUSING A LOT OF ISSUES. Don't uncomment. + await protocol.send_state_update() while AppStatus.should_exit is False: message = await websocket.receive_text() -- cgit v1.2.3-70-g09d2 From bbeea6ab78b14fa735962dbf4970be1230877097 Mon Sep 17 00:00:00 2001 From: Ty Dunn Date: Mon, 3 Jul 2023 21:46:01 -0700 Subject: config too --- continuedev/src/continuedev/steps/open_config.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 continuedev/src/continuedev/steps/open_config.py diff --git a/continuedev/src/continuedev/steps/open_config.py b/continuedev/src/continuedev/steps/open_config.py new file mode 100644 index 00000000..43c1b7ce --- /dev/null +++ b/continuedev/src/continuedev/steps/open_config.py @@ -0,0 +1,13 @@ +from ..core.main import Step +from ..core.sdk import ContinueSDK +import os + + +class OpenConfigStep(Step): + name: str = "Open config" + + async def run(self, sdk: ContinueSDK): + global_dir = os.path.expanduser('~/.continue') + config_path = os.path.join(global_dir, 'config.json') + print(config_path) + await sdk.ide.setFileOpen(config_path) \ No newline at end of file -- cgit v1.2.3-70-g09d2