♻️ refactor extension folders and react-app

This commit is contained in:
Nate Sesti 2023-10-20 23:39:13 -07:00
parent 15f28e4e55
commit 5f690518c6
316 changed files with 3143 additions and 741 deletions

View file

@ -77,43 +77,43 @@ jobs:
- name: Build and publish the package
run: cd server && poetry publish --build
# 1.5 Place the binary in extension/exe directory
- name: Make sure extension/exe directory exists
# 1.5 Place the binary in extensions/vscode/exe directory
- name: Make sure extensions/vscode/exe directory exists
run: |
mkdir -p extension/exe
mkdir -p extensions/vscode/exe
- name: Copy binary to extension (non-Windows)
run: |
cp dist/run extension/exe/run
cp dist/run extensions/vscode/exe/run
if: matrix.os != 'windows-latest'
- name: Copy binary to extension (Windows)
run: |
cp dist/run.exe extension/exe/run.exe
cp dist/run.exe extensions/vscode/exe/run.exe
if: matrix.os == 'windows-latest'
# 1.8 Set permissions and upload binary
- name: Set permissions
run: |
chmod 777 extension/exe/run
chmod 777 extensions/vscode/exe/run
- uses: actions/upload-artifact@v2
if: matrix.os == 'macos-latest' && matrix.arch == 'x64'
with:
name: macOSBinary
path: extension/exe/run
path: extensions/vscode/exe/run
- uses: actions/upload-artifact@v2
if: matrix.os == 'ubuntu-20.04' && matrix.arch == 'x64' && matrix.platform == 'linux'
with:
name: LinuxBinary
path: extension/exe/run
path: extensions/vscode/exe/run
- uses: actions/upload-artifact@v2
if: matrix.os == 'windows-latest' && matrix.arch == 'x64'
with:
name: WindowsBinary
path: extension/exe/run.exe
path: extensions/vscode/exe/run.exe
# 2. Install npm dependencies
- name: Use Node.js 19.0.0
@ -124,34 +124,34 @@ jobs:
- name: Cache extension node_modules
uses: actions/cache@v2
with:
path: extension/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('extension/package-lock.json') }}
path: extensions/vscode/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('extensions/vscode/package-lock.json') }}
- name: Cache react-app node_modules
- name: Cache gui node_modules
uses: actions/cache@v2
with:
path: extension/react-app/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('extension/react-app/package-lock.json') }}
path: gui/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('gui/package-lock.json') }}
- name: Install extension Dependencies
run: |
cd extension
cd extensions/vscode
npm ci
- name: Add a copy of continuedev to the extension
run: |
cd extension
cd extensions/vscode
cp -r ../server/continuedev continuedev
- name: Install react-app Dependencies
- name: Install gui Dependencies
run: |
cd extension/react-app
cd gui
npm ci --legacy-peer-deps
# 3. Run tests for the extension
- name: Prepare the extension
run: |
cd extension
cd extensions/vscode
npm run prepackage
- name: Install Xvfb for Linux and run tests
@ -159,39 +159,39 @@ jobs:
sudo apt-get install -y xvfb # Install Xvfb
Xvfb :99 & # Start Xvfb
export DISPLAY=:99 # Export the display number to the environment
cd extension
cd extensions/vscode
npm run test
if: matrix.os == 'ubuntu-20.04'
- name: Run extension tests
run: |
cd extension
cd extensions/vscode
npm run test
if: matrix.os != 'ubuntu-20.04'
# 3.5 If on Apple Silicon, download the binary from S3 bucket
- name: Remove existing binary
if: matrix.os == 'macos-latest' && matrix.arch == 'arm64'
run: rm extension/exe/run
run: rm extensions/vscode/exe/run
- name: Download Apple Silicon Binary
if: matrix.os == 'macos-latest' && matrix.arch == 'arm64'
run: curl -o extension/exe/run https://continue-server-binaries.s3.us-west-1.amazonaws.com/apple-silicon/run
run: curl -o extensions/vscode/exe/run https://continue-server-binaries.s3.us-west-1.amazonaws.com/apple-silicon/run
- name: Set permissions
run: |
chmod -R 777 extension/exe/run
chmod -R 777 extensions/vscode/exe/run
# 4. Package the extension
- shell: pwsh
run: echo "target=${{ matrix.platform }}-${{ matrix.arch }}" >> $env:GITHUB_ENV
- run: cd extension && npx vsce package --target ${{ env.target }}
- run: cd extensions/vscode && npx vsce package --target ${{ env.target }}
# 5. Upload the .vsix as an artifact
- uses: actions/upload-artifact@v2
with:
name: ${{ env.target }}
path: "extension/*.vsix"
path: "extensions/vscode/*.vsix"
# 6. Upload continue.log as an artifact for debugging of the workflow
- name: Upload continue.log
@ -224,7 +224,7 @@ jobs:
# 2. Publish the extension to VS Code Marketplace
- run: |
cd extension
cd extensions/vscode
npx vsce publish --packagePath ../alpine-x64/*.vsix ../darwin-arm64/*.vsix ../darwin-x64/*.vsix ../linux-arm64/*.vsix ../linux-armhf/*.vsix ../linux-x64/*.vsix ../win32-ia32/*.vsix ../win32-x64/*.vsix ../win32-arm64/*.vsix
env:
VSCE_PAT: ${{ secrets.VSCE_TOKEN }}
@ -232,13 +232,13 @@ jobs:
# 3. Publish the extension to Open VSX Registry
- name: Publish (Open VSX Registry)
run: |
cd extension
cd extensions/vscode
npx ovsx publish -p ${{ secrets.VSX_REGISTRY_TOKEN }} --packagePath ../alpine-x64/*.vsix ../darwin-arm64/*.vsix ../darwin-x64/*.vsix ../linux-arm64/*.vsix ../linux-armhf/*.vsix ../linux-x64/*.vsix ../win32-ia32/*.vsix ../win32-x64/*.vsix ../win32-arm64/*.vsix
# 4. Update the package.json version and push changes
- name: Update version in package.json
run: |
cd extension
cd extensions/vscode
npm version patch
- name: Commit changes

View file

@ -115,43 +115,43 @@ jobs:
- name: Build PyInstaller Executable
run: pyinstaller continue_server.spec
# 1.5 Place the binary in extension/exe directory
- name: Make sure extension/exe directory exists
# 1.5 Place the binary in extensions/vscode/exe directory
- name: Make sure extensions/vscode/exe directory exists
run: |
mkdir -p extension/exe
mkdir -p extensions/vscode/exe
- name: Copy binary to extension (non-Windows)
run: |
cp dist/continue_server extension/exe/continue_server
cp dist/continue_server extensions/vscode/exe/continue_server
if: matrix.os != 'windows-latest'
- name: Copy binary to extension (Windows)
run: |
cp dist/continue_server.exe extension/exe/continue_server.exe
cp dist/continue_server.exe extensions/vscode/exe/continue_server.exe
if: matrix.os == 'windows-latest'
# 1.8 Set permissions and upload binary
- name: Set permissions
run: |
chmod 777 extension/exe/continue_server
chmod 777 extensions/vscode/exe/continue_server
- uses: actions/upload-artifact@v2
if: matrix.os == 'macos-latest' && matrix.arch == 'x64'
with:
name: macOSBinary
path: extension/exe/continue_server
path: extensions/vscode/exe/continue_server
- uses: actions/upload-artifact@v2
if: matrix.os == 'ubuntu-20.04' && matrix.arch == 'x64' && matrix.platform == 'linux'
with:
name: LinuxBinary
path: extension/exe/continue_server
path: extensions/vscode/exe/continue_server
- uses: actions/upload-artifact@v2
if: matrix.os == 'windows-latest' && matrix.arch == 'x64'
with:
name: WindowsBinary
path: extension/exe/continue_server.exe
path: extensions/vscode/exe/continue_server.exe
# 2. Install npm dependencies
- name: Use Node.js 19.0.0
@ -162,34 +162,34 @@ jobs:
- name: Cache extension node_modules
uses: actions/cache@v2
with:
path: extension/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('extension/package-lock.json') }}
path: extensions/vscode/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('extensions/vscode/package-lock.json') }}
- name: Cache react-app node_modules
- name: Cache gui node_modules
uses: actions/cache@v2
with:
path: extension/react-app/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('extension/react-app/package-lock.json') }}
path: gui/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('gui/package-lock.json') }}
- name: Install extension Dependencies
run: |
cd extension
cd extensions/vscode
npm ci
- name: Add a copy of continuedev to the extension
run: |
cd extension
cd extensions/vscode
cp -r ../server/continuedev continuedev
- name: Install react-app Dependencies
- name: Install gui Dependencies
run: |
cd extension/react-app
cd gui
npm ci --legacy-peer-deps
# 3. Run tests for the extension
- name: Prepare the extension
run: |
cd extension
cd extensions/vscode
npm run prepackage
- name: Install Xvfb for Linux and run tests
@ -197,39 +197,39 @@ jobs:
sudo apt-get install -y xvfb # Install Xvfb
Xvfb :99 & # Start Xvfb
export DISPLAY=:99 # Export the display number to the environment
cd extension
cd extensions/vscode
npm run test
if: matrix.os == 'ubuntu-20.04'
- name: Run extension tests
run: |
cd extension
cd extensions/vscode
npm run test
if: matrix.os != 'ubuntu-20.04'
# 3.5 If on Apple Silicon, download the binary from S3 bucket
- name: Remove existing binary
if: matrix.os == 'macos-latest' && matrix.arch == 'arm64'
run: rm extension/exe/continue_server
run: rm extensions/vscode/exe/continue_server
- name: Download Apple Silicon Binary
if: matrix.os == 'macos-latest' && matrix.arch == 'arm64'
run: curl -o extension/exe/continue_server https://continue-server-binaries.s3.us-west-1.amazonaws.com/apple-silicon/continue_server
run: curl -o extensions/vscode/exe/continue_server https://continue-server-binaries.s3.us-west-1.amazonaws.com/apple-silicon/continue_server
- name: Set permissions
run: |
chmod -R 777 extension/exe/continue_server
chmod -R 777 extensions/vscode/exe/continue_server
# 4. Package the extension
- shell: pwsh
run: echo "target=${{ matrix.platform }}-${{ matrix.arch }}" >> $env:GITHUB_ENV
- run: cd extension && npx vsce package --pre-release --target ${{ env.target }}
- run: cd extensions/vscode && npx vsce package --pre-release --target ${{ env.target }}
# 5. Upload the .vsix as an artifact
- uses: actions/upload-artifact@v2
with:
name: ${{ env.target }}
path: "extension/*.vsix"
path: "extensions/vscode/*.vsix"
# 6. Upload continue.log as an artifact for debugging of the workflow
- name: Upload continue.log
@ -262,7 +262,7 @@ jobs:
# 2. Publish the extension to VS Code Marketplace
- run: |
cd extension
cd extensions/vscode
npx vsce publish --pre-release --packagePath ../alpine-x64/*.vsix ../darwin-arm64/*.vsix ../darwin-x64/*.vsix ../linux-arm64/*.vsix ../linux-armhf/*.vsix ../linux-x64/*.vsix ../win32-ia32/*.vsix ../win32-x64/*.vsix ../win32-arm64/*.vsix
env:
VSCE_PAT: ${{ secrets.VSCE_TOKEN }}
@ -270,13 +270,13 @@ jobs:
# 3. Publish the extension to Open VSX Registry
- name: Publish (Open VSX Registry)
run: |
cd extension
cd extensions/vscode
npx ovsx publish --pre-release -p ${{ secrets.VSX_REGISTRY_TOKEN }} --packagePath ../alpine-x64/*.vsix ../darwin-arm64/*.vsix ../darwin-x64/*.vsix ../linux-arm64/*.vsix ../linux-armhf/*.vsix ../linux-x64/*.vsix ../win32-ia32/*.vsix ../win32-x64/*.vsix ../win32-arm64/*.vsix
# 4. Update the package.json version and push changes
- name: Update version in package.json
run: |
cd extension
cd extensions/vscode
npm version patch
- name: Commit changes

26
.vscode/launch.json vendored
View file

@ -26,14 +26,14 @@
"request": "attach",
"name": "Vite",
"url": "http://localhost:5173",
"webRoot": "${workspaceFolder}/extension/react-app/src",
"webRoot": "${workspaceFolder}/gui/src",
"sourceMapPathOverrides": {
"webpack:///./src/*": "${webRoot}/*"
},
"port": 9222,
// "runtimeArgs": ["--remote-debugging-port=9222"],
"sourceMaps": true,
"preLaunchTask": "react-app:dev",
"preLaunchTask": "gui:dev"
},
{
"name": "Pytest",
@ -80,14 +80,14 @@
"name": "Extension (VSCode)",
"type": "extensionHost",
"request": "launch",
"cwd": "${workspaceFolder}/extension",
"cwd": "${workspaceFolder}/extensions/vscode",
"args": [
// Pass a directory to manually test in
"${workspaceFolder}/extension/manual-testing-sandbox",
"${workspaceFolder}/extension/manual-testing-sandbox/example.ts",
"--extensionDevelopmentPath=${workspaceFolder}/extension"
"${workspaceFolder}/extensions/vscode/manual-testing-sandbox",
"${workspaceFolder}/extensions/vscode/manual-testing-sandbox/example.ts",
"--extensionDevelopmentPath=${workspaceFolder}/extensions/vscode"
],
"outFiles": ["${workspaceFolder}/extension/out/**/*.js"],
"outFiles": ["${workspaceFolder}/extensions/vscode/out/**/*.js"],
"preLaunchTask": "vscode-extension:build",
"env": {
"CONTINUE_SERVER_URL": "http://localhost:8001"
@ -98,19 +98,19 @@
"name": "Tests (VSCode)",
"type": "extensionHost",
"request": "launch",
"cwd": "${workspaceFolder}/extension",
"cwd": "${workspaceFolder}/extensions/vscode",
"runtimeExecutable": "${execPath}",
"args": [
// Pass a directory to run tests in
"${workspaceFolder}/extension/manual-testing-sandbox",
"--extensionDevelopmentPath=${workspaceFolder}/extension",
"--extensionTestsPath=${workspaceFolder}/extension/out/test-runner/mochaRunner"
"${workspaceFolder}/extensions/vscode/manual-testing-sandbox",
"--extensionDevelopmentPath=${workspaceFolder}/extensions/vscode",
"--extensionTestsPath=${workspaceFolder}/extensions/vscode/out/test-runner/mochaRunner"
],
"outFiles": [
// Allows setting breakpoints in test suites across the /src folder
"${workspaceFolder}/extension/out/test-suites/**/*.js",
"${workspaceFolder}/extensions/vscode/out/test-suites/**/*.js",
// Allows setting breakpoints in mocha test runner file
"${workspaceFolder}/extension/out/test-runner/**/*.js"
"${workspaceFolder}/extensions/vscode/out/test-runner/**/*.js"
],
"internalConsoleOptions": "openOnSessionStart",
"preLaunchTask": "vscode-extension:tests:build",

235
.vscode/tasks.json vendored
View file

@ -1,125 +1,118 @@
{
"version": "2.0.0",
"tasks": [
// Compile and bundle the extension
"version": "2.0.0",
"tasks": [
// Compile and bundle the extension
{
"label": "vscode-extension:build",
"dependsOn": [
// To detect compile errors
"vscode-extension:tsc",
// To build the React app that is used in the extension
"vscode-extension:continue-ui:build",
// To bundle the code the same way we do for publishing
"vscode-extension:esbuild"
],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "vscode-extension:esbuild",
"type": "npm",
"script": "esbuild",
"path": "extensions/vscode",
"problemMatcher": [
{
"label": "vscode-extension:build",
"dependsOn": [
// To detect compile errors
"vscode-extension:tsc",
// To build the react-app that is used in the extension
"vscode-extension:continue-ui:build",
// To bundle the code the same way we do for publishing
"vscode-extension:esbuild"
],
"group": {
"kind": "build",
"isDefault": true
"pattern": [
{
"regexp": "> (.*?):([0-9]+):([0-9]+): (warning|error): (.+)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
},
{
"label": "vscode-extension:esbuild",
"type": "npm",
"script": "esbuild",
"path": "extension",
"problemMatcher": [
{
"pattern": [
{
"regexp": "> (.*?):([0-9]+):([0-9]+): (warning|error): (.+)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
],
}
],
},
// Tsc currently errors out due to testing setup issues, will be resolved in a different PR
// This will be useful for preventing debugging if there are compile errors
{
"label": "vscode-extension:tsc",
"type": "npm",
"script": "tsc",
"path": "extension",
"problemMatcher": [
"$tsc"
],
"presentation": {
"revealProblems": "onProblem",
"clear": true,
},
},
// Build the react-app. It gets bundled into the extension as a file resource and has a seprate build step
{
"label": "vscode-extension:continue-ui:build",
"type": "npm",
"script": "build",
"path": "extension/react-app",
"problemMatcher": [
"$tsc"
],
"presentation": {
"revealProblems": "onProblem",
"clear": true,
},
},
//
// Compile and bundle tests
{
"label": "vscode-extension:tests:build",
"dependsOn": [
// Build the extension
"vscode-extension:build",
// To detect compile errors - this type checks both the extension and the tests
"vscode-extension:tsc",
"vscode-extension:tests:esbuild"
],
},
{
"label": "vscode-extension:tests:esbuild",
"type": "npm",
"script": "build-test",
"path": "extension",
"problemMatcher": [
{
"pattern": [
{
"regexp": "> (.*?):([0-9]+):([0-9]+): (warning|error): (.+)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
]
}
]
},
//
// Install or update all dependencies for all projects in the monrepo
{
"label": "install-all-dependencies",
"type": "shell",
"command": "./install-dependencies.sh",
"problemMatcher": [], // Empty so users are not promted to select progress reporting
},
//
// Start the React App for debugging with Vite
{
"label": "react-app:dev",
"type": "shell",
"command": "npm",
"options": {
"cwd": "extension/react-app",
},
"args": [
"run",
"dev"
],
"isBackground": true,
]
}
]
}
]
},
// Tsc currently errors out due to testing setup issues, will be resolved in a different PR
// This will be useful for preventing debugging if there are compile errors
{
"label": "vscode-extension:tsc",
"type": "npm",
"script": "tsc",
"path": "extensions/vscode",
"problemMatcher": ["$tsc"],
"presentation": {
"revealProblems": "onProblem",
"clear": true
}
},
// Build the React app. It gets bundled into the extension as a file resource and has a seprate build step
{
"label": "vscode-extension:continue-ui:build",
"type": "shell",
"command": "node",
"args": ["${workspaceFolder}/extensions/vscode/scripts/prepackage.js"],
"problemMatcher": ["$tsc"],
"presentation": {
"revealProblems": "onProblem",
"clear": true
}
},
//
// Compile and bundle tests
{
"label": "vscode-extension:tests:build",
"dependsOn": [
// Build the extension
"vscode-extension:build",
// To detect compile errors - this type checks both the extension and the tests
"vscode-extension:tsc",
"vscode-extension:tests:esbuild"
]
},
{
"label": "vscode-extension:tests:esbuild",
"type": "npm",
"script": "build-test",
"path": "extensions/vscode",
"problemMatcher": [
{
"pattern": [
{
"regexp": "> (.*?):([0-9]+):([0-9]+): (warning|error): (.+)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
]
}
]
},
//
// Install or update all dependencies for all projects in the monrepo
{
"label": "install-all-dependencies",
"type": "shell",
"command": "./install-dependencies.sh",
"problemMatcher": [] // Empty so users are not promted to select progress reporting
},
//
// Start the React App for debugging with Vite
{
"label": "gui:dev",
"type": "shell",
"command": "npm",
"options": {
"cwd": "gui"
},
"args": ["run", "dev"],
"isBackground": true
}
]
}

View file

@ -95,7 +95,7 @@ Continue consists of 3 components, designed so that Continue can easily be exten
1. **Continue Server** - The Continue Server is responsible for keeping state, running the autopilot loop which takes actions, and communicating between the IDE and GUI.
2. **Continue IDE Client** - The Continue IDE Client is a plugin for the IDE which implements the Continue IDE Protocol. This allows the server to request actions to be taken within the IDE, for example if `sdk.ide.setFileOpen("main.py")` is called on the server, it will communicate over websocketes with the IDE, which will open the file `main.py`. The first IDE Client we have built is for VS Code, but we plan to build clients for other IDEs in the future. The IDE Client must 1. implement the websockets protocol, as is done [here](./extension/src/continueIdeClient.ts) for VS Code and 2. launch the Continue Server, like [here](./extension/src/activation/environmentSetup.ts), and 3. display the Continue GUI in a sidebar, like [here](./extension/src/debugPanel.ts).
2. **Continue IDE Client** - The Continue IDE Client is a plugin for the IDE which implements the Continue IDE Protocol. This allows the server to request actions to be taken within the IDE, for example if `sdk.ide.setFileOpen("main.py")` is called on the server, it will communicate over websocketes with the IDE, which will open the file `main.py`. The first IDE Client we have built is for VS Code, but we plan to build clients for other IDEs in the future. The IDE Client must 1. implement the websockets protocol, as is done [here](./extensions/vscode/src/continueIdeClient.ts) for VS Code and 2. launch the Continue Server, like [here](./extensions/vscode/src/activation/environmentSetup.ts), and 3. display the Continue GUI in a sidebar, like [here](./extensions/vscode/src/debugPanel.ts).
3. **Continue GUI** - The Continue GUI is a React application that gives the user control over Continue. It displays the history of Steps, shows what context is included in the current Step, and lets the users enter natural language or slash commands to initiate new Steps. The GUI communicates with the Continue Server over its own websocket connection
@ -105,7 +105,7 @@ It is important that the IDE Client and GUI never communicate except when the ID
### Continue VS Code Client
The starting point for the VS Code extension is [activate.ts](./extension/src/activation/activate.ts). The `activateExtension` function here will:
The starting point for the VS Code extension is [activate.ts](./extensions/vscode/src/activation/activate.ts). The `activateExtension` function here will:
1. Check whether the current version of the extension is up-to-date and, if not, display a notification
@ -119,11 +119,11 @@ The JetBrains extension is currently in alpha testing. Please reach out on [Disc
### Continue IDE Websockets Protocol
On the IDE side, this is implemented in [continueIdeClient.ts](./extension/src/continueIdeClient.ts). On the server side, this is implemented in [ide.py](./continuedev/src/continuedev/server/ide.py). You can see [ide_protocol.py](./continuedev/src/continuedev/server/ide_protocol.py) for the protocol definition.
On the IDE side, this is implemented in [continueIdeClient.ts](./extensions/vscode/src/continueIdeClient.ts). On the server side, this is implemented in [ide.py](./continuedev/src/continuedev/server/ide.py). You can see [ide_protocol.py](./continuedev/src/continuedev/server/ide_protocol.py) for the protocol definition.
### Continue GUI Websockets Protocol
On the GUI side, this is implemented in [ContinueGUIClientProtocol.ts](./extension/react-app/src/hooks/ContinueGUIClientProtocol.ts). On the server side, this is implemented in [gui.py](./continuedev/src/continuedev/server/gui.py). You can see [gui_protocol.py](./continuedev/src/continuedev/server/gui_protocol.py) or [AbstractContinueGUIClientProtocol.ts](./extension/react-app/src/hooks/AbstractContinueGUIClientProtocol.ts) for the protocol definition.
On the GUI side, this is implemented in [ContinueGUIClientProtocol.ts](./gui/src/hooks/ContinueGUIClientProtocol.ts). On the server side, this is implemented in [gui.py](./continuedev/src/continuedev/server/gui.py). You can see [gui_protocol.py](./continuedev/src/continuedev/server/gui_protocol.py) or [AbstractContinueGUIClientProtocol.ts](./gui/src/hooks/AbstractContinueGUIClientProtocol.ts) for the protocol definition.
When state is updated on the server, we currently send the entirety of the object over websockets to the GUI. This will of course have to be improved soon. The state object, `FullState`, is defined in [core/main.py](./continuedev/src/continuedev/core/main.py) and includes:

View file

@ -1,6 +1,6 @@
> 🎁 **New! [Try out the new JetBrains extension (Alpha)](https://plugins.jetbrains.com/plugin/22707-continue-extension)**
![Continue logo](c_d.png)
![Continue logo](media/c_d.png)
<h1 align="center">Continue</h1>
@ -24,7 +24,7 @@
<p></p>
![Editing With Continue](readme.gif)
![Editing With Continue](media/readme.gif)
</div>
@ -78,4 +78,4 @@ Check out the [contribution ideas board](https://github.com/orgs/continuedev/pro
## License
[Apache 2.0 © 2023 Continue Dev, Inc.](./LICENSE)
[Apache 2.0 © 2023 Continue Dev, Inc.](./LICENSE)

View file

@ -1,27 +0,0 @@
from collections import defaultdict
# Initialize a dictionary to store the sizes of the folders
folder_sizes = defaultdict(int)
# Parse the file
with open(
"archive_contents.txt", "r"
) as f: # replace 'file.txt' with your file name
for line in f:
parts = line.split(",")
if len(parts) < 2:
continue
size = int(parts[1].strip()) # get the size
path = parts[-1].strip() # get the path
# Split the path into its components and accumulate the sizes for each folder
path_parts = path.split("/")
top_level = path_parts[0]
folder_sizes[top_level] += size
# Sort the folders by size in descending order
sorted_folders = sorted(folder_sizes.items(), key=lambda x: x[1], reverse=True)
# Print the sorted folders and their sizes
for folder, size in sorted_folders:
print(f"{folder}: {size}")

View file

@ -11,7 +11,7 @@ The **IDE** is the text editor where you manually edit your code.
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 VS Code, 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 `extensions/vscode/src`, with `extension.ts` being the entry point, and 2. the Continue React app, in the `gui` 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 `extensions/vscode/src/continueIdeClient.ts`.
## Supported IDEs

View file

@ -30,9 +30,9 @@ You can install it from the JetBrains Marketplace [here](https://plugins.jetbrai
Here is how you can get started with adding Continue to a new IDE:
1. Let us know that you would like to add Continue to a new IDE by opening an issue [here](https://github.com/continuedev/continue/issues/new/choose)
2. Implement a class that maps each of the actions like "read file" to the API provided by that IDE like [here](https://github.com/continuedev/continue/blob/main/extension/src/continueIdeClient.ts)
2. Implement a class that maps each of the actions like "read file" to the API provided by that IDE like [here](https://github.com/continuedev/continue/blob/main/extensions/vscode/src/continueIdeClient.ts)
3. Learn more about what you might also do by looking at this pull request that added initial support for JetBrains [here](https://github.com/continuedev/continue/pull/457)
## Running the server manually
If you would like to run the Continue server manually, rather than allowing the IDE to automatically set it up, you can follow the short tutorial for [Manually Running Continue](./walkthroughs/manually-run-continue.md).
If you would like to run the Continue server manually, rather than allowing the IDE to automatically set it up, you can follow the short tutorial for [Manually Running Continue](./walkthroughs/manually-run-continue.md).

View file

@ -4,7 +4,7 @@ import ClassPropertyRef from '@site/src/components/ClassPropertyRef.tsx';
Type '@diff' to reference all of the changes you've made to your current branch. This is useful if you want to summarize what you've done or ask for a general review of your work before committing.
[View the source](https://github.com/continuedev/continue/tree/main/continuedev/src/continuedev/plugins/context_providers/diff.py)
[View the source](https://github.com/continuedev/continue/blob/main/server/continuedev/libs/llm/plugins/context_providers/diff.py)
## Properties

View file

@ -4,7 +4,7 @@ import ClassPropertyRef from '@site/src/components/ClassPropertyRef.tsx';
The FileContextProvider is a ContextProvider that allows you to search files in the open workspace.
[View the source](https://github.com/continuedev/continue/tree/main/continuedev/src/continuedev/plugins/context_providers/file.py)
[View the source](https://github.com/continuedev/continue/blob/main/server/continuedev/libs/llm/plugins/context_providers/file.py)
## Properties

View file

@ -4,7 +4,7 @@ import ClassPropertyRef from '@site/src/components/ClassPropertyRef.tsx';
Type '@tree' to reference the contents of your current workspace. The LLM will be able to see the nested directory structure of your project.
[View the source](https://github.com/continuedev/continue/tree/main/continuedev/src/continuedev/plugins/context_providers/filetree.py)
[View the source](https://github.com/continuedev/continue/blob/main/server/continuedev/libs/llm/plugins/context_providers/filetree.py)
## Properties

View file

@ -4,7 +4,7 @@ import ClassPropertyRef from '@site/src/components/ClassPropertyRef.tsx';
The GitHubIssuesContextProvider is a ContextProvider that allows you to search GitHub issues in a repo. Type '@issue' to reference the title and contents of an issue.
[View the source](https://github.com/continuedev/continue/tree/main/continuedev/src/continuedev/plugins/context_providers/github.py)
[View the source](https://github.com/continuedev/continue/blob/main/server/continuedev/libs/llm/plugins/context_providers/github.py)
## Properties

View file

@ -4,7 +4,7 @@ import ClassPropertyRef from '@site/src/components/ClassPropertyRef.tsx';
Type '@google' to reference the results of a Google search. For example, type "@google python tutorial" if you want to search and discuss ways of learning Python.
[View the source](https://github.com/continuedev/continue/tree/main/continuedev/src/continuedev/plugins/context_providers/google.py)
[View the source](https://github.com/continuedev/continue/blob/main/server/continuedev/libs/llm/plugins/context_providers/google.py)
## Properties

View file

@ -4,7 +4,7 @@ import ClassPropertyRef from '@site/src/components/ClassPropertyRef.tsx';
Type '@search' to reference the results of codebase search, just like the results you would get from VS Code search.
[View the source](https://github.com/continuedev/continue/tree/main/continuedev/src/continuedev/plugins/context_providers/search.py)
[View the source](https://github.com/continuedev/continue/blob/main/server/continuedev/libs/llm/plugins/context_providers/search.py)
## Properties

View file

@ -4,7 +4,7 @@ import ClassPropertyRef from '@site/src/components/ClassPropertyRef.tsx';
Type '@terminal' to reference the contents of your IDE's terminal.
[View the source](https://github.com/continuedev/continue/tree/main/continuedev/src/continuedev/plugins/context_providers/terminal.py)
[View the source](https://github.com/continuedev/continue/blob/main/server/continuedev/libs/llm/plugins/context_providers/terminal.py)
## Properties

View file

@ -4,7 +4,7 @@ import ClassPropertyRef from '@site/src/components/ClassPropertyRef.tsx';
Type '@url' to reference the contents of a URL. You can either reference preset URLs, or reference one dynamically by typing '@url https://example.com'. The text contents of the page will be fetched and used as context.
[View the source](https://github.com/continuedev/continue/tree/main/continuedev/src/continuedev/plugins/context_providers/url.py)
[View the source](https://github.com/continuedev/continue/blob/main/server/continuedev/libs/llm/plugins/context_providers/url.py)
## Properties

View file

@ -17,7 +17,7 @@ config = ContinueConfig(
Claude 2 is not yet publicly released. You can request early access [here](https://www.anthropic.com/earlyaccess).
[View the source](https://github.com/continuedev/continue/tree/main/continuedev/src/continuedev/libs/llm/anthropic.py)
[View the source](https://github.com/continuedev/continue/blob/main/server/continuedev/libs/llm/libs/llm/anthropic.py)
## Properties

View file

@ -19,7 +19,7 @@ config = ContinueConfig(
)
```
[View the source](https://github.com/continuedev/continue/tree/main/continuedev/src/continuedev/libs/llm/ggml.py)
[View the source](https://github.com/continuedev/continue/blob/main/server/continuedev/libs/llm/libs/llm/ggml.py)
## Properties
@ -29,6 +29,7 @@ config = ContinueConfig(
<ClassPropertyRef name='api_version' details='{&quot;title&quot;: &quot;Api Version&quot;, &quot;description&quot;: &quot;OpenAI API version. For use with Azure OpenAI Service.&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='engine' details='{&quot;title&quot;: &quot;Engine&quot;, &quot;description&quot;: &quot;OpenAI engine. For use with Azure OpenAI Service.&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
### Inherited Properties
<ClassPropertyRef name='title' details='{&quot;title&quot;: &quot;Title&quot;, &quot;description&quot;: &quot;A title that will identify this model in the model selection dropdown&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
@ -47,5 +48,5 @@ config = ContinueConfig(
<ClassPropertyRef name='ca_bundle_path' details='{&quot;title&quot;: &quot;Ca Bundle Path&quot;, &quot;description&quot;: &quot;Path to a custom CA bundle to use when making the HTTP request&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='proxy' details='{&quot;title&quot;: &quot;Proxy&quot;, &quot;description&quot;: &quot;Proxy URL to use when making the HTTP request&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='headers' details='{&quot;title&quot;: &quot;Headers&quot;, &quot;description&quot;: &quot;Headers to use when making the HTTP request&quot;, &quot;type&quot;: &quot;object&quot;, &quot;additionalProperties&quot;: {&quot;type&quot;: &quot;string&quot;}}' required={false} default=""/>
<ClassPropertyRef name='prompt_templates' details='{&quot;title&quot;: &quot;Prompt Templates&quot;, &quot;description&quot;: &quot;A dictionary of prompt templates that can be used to customize the behavior of the LLM in certain situations. For example, set the \&quot;edit\&quot; key in order to change the prompt that is used for the /edit slash command. Each value in the dictionary is a string templated in mustache syntax, and filled in at runtime with the variables specific to the situation. See the documentation for more information.&quot;, &quot;default&quot;: {&quot;edit&quot;: &quot;Consider the following code:\n```\n{{{code_to_edit}}}\n```\nEdit the code to perfectly satisfy the following user request:\n{{{user_input}}}\nOutput nothing except for the code. No code block, no English explanation, no start/end tags.&quot;}, &quot;type&quot;: &quot;object&quot;}' required={false} default="{&#x27;edit&#x27;: &#x27;Consider the following code:\n```\n{{{code_to_edit}}}\n```\nEdit the code to perfectly satisfy the following user request:\n{{{user_input}}}\nOutput nothing except for the code. No code block, no English explanation, no start/end tags.&#x27;}"/>
<ClassPropertyRef name='prompt_templates' details='{&quot;title&quot;: &quot;Prompt Templates&quot;, &quot;description&quot;: &quot;A dictionary of prompt templates that can be used to customize the behavior of the LLM in certain situations. For example, set the \&quot;edit\&quot; key in order to change the prompt that is used for the /edit slash command. Each value in the dictionary is a string templated in mustache syntax, and filled in at runtime with the variables specific to the situation OR an instance of the PromptTemplate class if you want to control other parameters. See the documentation for more information.&quot;, &quot;default&quot;: {&quot;edit&quot;: {&quot;model&quot;: null, &quot;temperature&quot;: null, &quot;top_p&quot;: null, &quot;top_k&quot;: null, &quot;presence_penalty&quot;: null, &quot;frequency_penalty&quot;: null, &quot;stop&quot;: [&quot;[/CODE]&quot;], &quot;max_tokens&quot;: 600, &quot;functions&quot;: null, &quot;prompt&quot;: &quot;[CODE]\n{{{code_to_edit}}}\n[/CODE]\n[INST]\nYou are an expert programmer and personal assistant, here is your task: \&quot;Rewrite the above code in order to {{{user_input}}}\&quot;\n\nYour answer should start with a [CODE] tag and end with a [/CODE] tag.\n[/INST]\n[CODE]&quot;, &quot;raw&quot;: true}}, &quot;type&quot;: &quot;object&quot;}' required={false} default="{&#x27;edit&#x27;: {&#x27;model&#x27;: None, &#x27;temperature&#x27;: None, &#x27;top_p&#x27;: None, &#x27;top_k&#x27;: None, &#x27;presence_penalty&#x27;: None, &#x27;frequency_penalty&#x27;: None, &#x27;stop&#x27;: [&#x27;[/CODE]&#x27;], &#x27;max_tokens&#x27;: 600, &#x27;functions&#x27;: None, &#x27;prompt&#x27;: &#x27;[CODE]\n{{{code_to_edit}}}\n[/CODE]\n[INST]\nYou are an expert programmer and personal assistant, here is your task: &quot;Rewrite the above code in order to {{{user_input}}}&quot;\n\nYour answer should start with a [CODE] tag and end with a [/CODE] tag.\n[/INST]\n[CODE]&#x27;, &#x27;raw&#x27;: True}}"/>
<ClassPropertyRef name='api_key' details='{&quot;title&quot;: &quot;Api Key&quot;, &quot;description&quot;: &quot;The API key for the LLM provider.&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>

View file

@ -18,7 +18,7 @@ config = ContinueConfig(
)
```
[View the source](https://github.com/continuedev/continue/tree/main/continuedev/src/continuedev/libs/llm/google_palm_api.py)
[View the source](https://github.com/continuedev/continue/blob/main/server/continuedev/libs/llm/libs/llm/google_palm_api.py)
## Properties

View file

@ -12,13 +12,13 @@ config = ContinueConfig(
...
models=Models(
default=HuggingFaceInferenceAPI(
endpoint_url: "<INFERENCE_API_ENDPOINT_URL>",
hf_token: "<HUGGING_FACE_TOKEN>",
endpoint_url="<INFERENCE_API_ENDPOINT_URL>",
hf_token="<HUGGING_FACE_TOKEN>",
)
)
```
[View the source](https://github.com/continuedev/continue/tree/main/continuedev/src/continuedev/libs/llm/hf_inference_api.py)
[View the source](https://github.com/continuedev/continue/blob/main/server/continuedev/libs/llm/libs/llm/hf_inference_api.py)
## Properties
@ -44,5 +44,5 @@ config = ContinueConfig(
<ClassPropertyRef name='ca_bundle_path' details='{&quot;title&quot;: &quot;Ca Bundle Path&quot;, &quot;description&quot;: &quot;Path to a custom CA bundle to use when making the HTTP request&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='proxy' details='{&quot;title&quot;: &quot;Proxy&quot;, &quot;description&quot;: &quot;Proxy URL to use when making the HTTP request&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='headers' details='{&quot;title&quot;: &quot;Headers&quot;, &quot;description&quot;: &quot;Headers to use when making the HTTP request&quot;, &quot;type&quot;: &quot;object&quot;, &quot;additionalProperties&quot;: {&quot;type&quot;: &quot;string&quot;}}' required={false} default=""/>
<ClassPropertyRef name='prompt_templates' details='{&quot;title&quot;: &quot;Prompt Templates&quot;, &quot;description&quot;: &quot;A dictionary of prompt templates that can be used to customize the behavior of the LLM in certain situations. For example, set the \&quot;edit\&quot; key in order to change the prompt that is used for the /edit slash command. Each value in the dictionary is a string templated in mustache syntax, and filled in at runtime with the variables specific to the situation. See the documentation for more information.&quot;, &quot;default&quot;: {&quot;edit&quot;: &quot;Consider the following code:\n```\n{{{code_to_edit}}}\n```\nEdit the code to perfectly satisfy the following user request:\n{{{user_input}}}\nOutput nothing except for the code. No code block, no English explanation, no start/end tags.&quot;}, &quot;type&quot;: &quot;object&quot;}' required={false} default="{&#x27;edit&#x27;: &#x27;Consider the following code:\n```\n{{{code_to_edit}}}\n```\nEdit the code to perfectly satisfy the following user request:\n{{{user_input}}}\nOutput nothing except for the code. No code block, no English explanation, no start/end tags.&#x27;}"/>
<ClassPropertyRef name='prompt_templates' details='{&quot;title&quot;: &quot;Prompt Templates&quot;, &quot;description&quot;: &quot;A dictionary of prompt templates that can be used to customize the behavior of the LLM in certain situations. For example, set the \&quot;edit\&quot; key in order to change the prompt that is used for the /edit slash command. Each value in the dictionary is a string templated in mustache syntax, and filled in at runtime with the variables specific to the situation OR an instance of the PromptTemplate class if you want to control other parameters. See the documentation for more information.&quot;, &quot;default&quot;: {&quot;edit&quot;: {&quot;model&quot;: null, &quot;temperature&quot;: null, &quot;top_p&quot;: null, &quot;top_k&quot;: null, &quot;presence_penalty&quot;: null, &quot;frequency_penalty&quot;: null, &quot;stop&quot;: [&quot;[/CODE]&quot;], &quot;max_tokens&quot;: 600, &quot;functions&quot;: null, &quot;prompt&quot;: &quot;[CODE]\n{{{code_to_edit}}}\n[/CODE]\n[INST]\nYou are an expert programmer and personal assistant, here is your task: \&quot;Rewrite the above code in order to {{{user_input}}}\&quot;\n\nYour answer should start with a [CODE] tag and end with a [/CODE] tag.\n[/INST]\n[CODE]&quot;, &quot;raw&quot;: true}}, &quot;type&quot;: &quot;object&quot;}' required={false} default="{&#x27;edit&#x27;: {&#x27;model&#x27;: None, &#x27;temperature&#x27;: None, &#x27;top_p&#x27;: None, &#x27;top_k&#x27;: None, &#x27;presence_penalty&#x27;: None, &#x27;frequency_penalty&#x27;: None, &#x27;stop&#x27;: [&#x27;[/CODE]&#x27;], &#x27;max_tokens&#x27;: 600, &#x27;functions&#x27;: None, &#x27;prompt&#x27;: &#x27;[CODE]\n{{{code_to_edit}}}\n[/CODE]\n[INST]\nYou are an expert programmer and personal assistant, here is your task: &quot;Rewrite the above code in order to {{{user_input}}}&quot;\n\nYour answer should start with a [CODE] tag and end with a [/CODE] tag.\n[/INST]\n[CODE]&#x27;, &#x27;raw&#x27;: True}}"/>
<ClassPropertyRef name='api_key' details='{&quot;title&quot;: &quot;Api Key&quot;, &quot;description&quot;: &quot;The API key for the LLM provider.&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>

View file

@ -4,7 +4,7 @@ import ClassPropertyRef from '@site/src/components/ClassPropertyRef.tsx';
[View the source](https://github.com/continuedev/continue/tree/main/continuedev/src/continuedev/libs/llm/hf_tgi.py)
[View the source](https://github.com/continuedev/continue/blob/main/server/continuedev/libs/llm/libs/llm/hf_tgi.py)
## Properties
@ -29,5 +29,5 @@ import ClassPropertyRef from '@site/src/components/ClassPropertyRef.tsx';
<ClassPropertyRef name='ca_bundle_path' details='{&quot;title&quot;: &quot;Ca Bundle Path&quot;, &quot;description&quot;: &quot;Path to a custom CA bundle to use when making the HTTP request&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='proxy' details='{&quot;title&quot;: &quot;Proxy&quot;, &quot;description&quot;: &quot;Proxy URL to use when making the HTTP request&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='headers' details='{&quot;title&quot;: &quot;Headers&quot;, &quot;description&quot;: &quot;Headers to use when making the HTTP request&quot;, &quot;type&quot;: &quot;object&quot;, &quot;additionalProperties&quot;: {&quot;type&quot;: &quot;string&quot;}}' required={false} default=""/>
<ClassPropertyRef name='prompt_templates' details='{&quot;title&quot;: &quot;Prompt Templates&quot;, &quot;description&quot;: &quot;A dictionary of prompt templates that can be used to customize the behavior of the LLM in certain situations. For example, set the \&quot;edit\&quot; key in order to change the prompt that is used for the /edit slash command. Each value in the dictionary is a string templated in mustache syntax, and filled in at runtime with the variables specific to the situation. See the documentation for more information.&quot;, &quot;default&quot;: {&quot;edit&quot;: &quot;Consider the following code:\n```\n{{{code_to_edit}}}\n```\nEdit the code to perfectly satisfy the following user request:\n{{{user_input}}}\nOutput nothing except for the code. No code block, no English explanation, no start/end tags.&quot;}, &quot;type&quot;: &quot;object&quot;}' required={false} default="{&#x27;edit&#x27;: &#x27;Consider the following code:\n```\n{{{code_to_edit}}}\n```\nEdit the code to perfectly satisfy the following user request:\n{{{user_input}}}\nOutput nothing except for the code. No code block, no English explanation, no start/end tags.&#x27;}"/>
<ClassPropertyRef name='prompt_templates' details='{&quot;title&quot;: &quot;Prompt Templates&quot;, &quot;description&quot;: &quot;A dictionary of prompt templates that can be used to customize the behavior of the LLM in certain situations. For example, set the \&quot;edit\&quot; key in order to change the prompt that is used for the /edit slash command. Each value in the dictionary is a string templated in mustache syntax, and filled in at runtime with the variables specific to the situation OR an instance of the PromptTemplate class if you want to control other parameters. See the documentation for more information.&quot;, &quot;default&quot;: {&quot;edit&quot;: {&quot;model&quot;: null, &quot;temperature&quot;: null, &quot;top_p&quot;: null, &quot;top_k&quot;: null, &quot;presence_penalty&quot;: null, &quot;frequency_penalty&quot;: null, &quot;stop&quot;: [&quot;[/CODE]&quot;], &quot;max_tokens&quot;: 600, &quot;functions&quot;: null, &quot;prompt&quot;: &quot;[CODE]\n{{{code_to_edit}}}\n[/CODE]\n[INST]\nYou are an expert programmer and personal assistant, here is your task: \&quot;Rewrite the above code in order to {{{user_input}}}\&quot;\n\nYour answer should start with a [CODE] tag and end with a [/CODE] tag.\n[/INST]\n[CODE]&quot;, &quot;raw&quot;: true}}, &quot;type&quot;: &quot;object&quot;}' required={false} default="{&#x27;edit&#x27;: {&#x27;model&#x27;: None, &#x27;temperature&#x27;: None, &#x27;top_p&#x27;: None, &#x27;top_k&#x27;: None, &#x27;presence_penalty&#x27;: None, &#x27;frequency_penalty&#x27;: None, &#x27;stop&#x27;: [&#x27;[/CODE]&#x27;], &#x27;max_tokens&#x27;: 600, &#x27;functions&#x27;: None, &#x27;prompt&#x27;: &#x27;[CODE]\n{{{code_to_edit}}}\n[/CODE]\n[INST]\nYou are an expert programmer and personal assistant, here is your task: &quot;Rewrite the above code in order to {{{user_input}}}&quot;\n\nYour answer should start with a [CODE] tag and end with a [/CODE] tag.\n[/INST]\n[CODE]&#x27;, &#x27;raw&#x27;: True}}"/>
<ClassPropertyRef name='api_key' details='{&quot;title&quot;: &quot;Api Key&quot;, &quot;description&quot;: &quot;The API key for the LLM provider.&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>

View file

@ -23,13 +23,14 @@ config = ContinueConfig(
)
```
[View the source](https://github.com/continuedev/continue/tree/main/continuedev/src/continuedev/libs/llm/llamacpp.py)
[View the source](https://github.com/continuedev/continue/blob/main/server/continuedev/libs/llm/libs/llm/llamacpp.py)
## Properties
<ClassPropertyRef name='server_url' details='{&quot;title&quot;: &quot;Server Url&quot;, &quot;description&quot;: &quot;URL of the server&quot;, &quot;default&quot;: &quot;http://localhost:8080&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default="http://localhost:8080"/>
<ClassPropertyRef name='llama_cpp_args' details='{&quot;title&quot;: &quot;Llama Cpp Args&quot;, &quot;description&quot;: &quot;A list of additional arguments to pass to llama.cpp. See [here](https://github.com/ggerganov/llama.cpp/tree/master/examples/server#api-endpoints) for the complete catalog of options.&quot;, &quot;default&quot;: {&quot;stop&quot;: [&quot;[INST]&quot;]}, &quot;type&quot;: &quot;object&quot;}' required={false} default="{&#x27;stop&#x27;: [&#x27;[INST]&#x27;]}"/>
### Inherited Properties
<ClassPropertyRef name='title' details='{&quot;title&quot;: &quot;Title&quot;, &quot;description&quot;: &quot;A title that will identify this model in the model selection dropdown&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
@ -48,5 +49,5 @@ config = ContinueConfig(
<ClassPropertyRef name='ca_bundle_path' details='{&quot;title&quot;: &quot;Ca Bundle Path&quot;, &quot;description&quot;: &quot;Path to a custom CA bundle to use when making the HTTP request&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='proxy' details='{&quot;title&quot;: &quot;Proxy&quot;, &quot;description&quot;: &quot;Proxy URL to use when making the HTTP request&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='headers' details='{&quot;title&quot;: &quot;Headers&quot;, &quot;description&quot;: &quot;Headers to use when making the HTTP request&quot;, &quot;type&quot;: &quot;object&quot;, &quot;additionalProperties&quot;: {&quot;type&quot;: &quot;string&quot;}}' required={false} default=""/>
<ClassPropertyRef name='prompt_templates' details='{&quot;title&quot;: &quot;Prompt Templates&quot;, &quot;description&quot;: &quot;A dictionary of prompt templates that can be used to customize the behavior of the LLM in certain situations. For example, set the \&quot;edit\&quot; key in order to change the prompt that is used for the /edit slash command. Each value in the dictionary is a string templated in mustache syntax, and filled in at runtime with the variables specific to the situation. See the documentation for more information.&quot;, &quot;default&quot;: {&quot;edit&quot;: &quot;Consider the following code:\n```\n{{{code_to_edit}}}\n```\nEdit the code to perfectly satisfy the following user request:\n{{{user_input}}}\nOutput nothing except for the code. No code block, no English explanation, no start/end tags.&quot;}, &quot;type&quot;: &quot;object&quot;}' required={false} default="{&#x27;edit&#x27;: &#x27;Consider the following code:\n```\n{{{code_to_edit}}}\n```\nEdit the code to perfectly satisfy the following user request:\n{{{user_input}}}\nOutput nothing except for the code. No code block, no English explanation, no start/end tags.&#x27;}"/>
<ClassPropertyRef name='prompt_templates' details='{&quot;title&quot;: &quot;Prompt Templates&quot;, &quot;description&quot;: &quot;A dictionary of prompt templates that can be used to customize the behavior of the LLM in certain situations. For example, set the \&quot;edit\&quot; key in order to change the prompt that is used for the /edit slash command. Each value in the dictionary is a string templated in mustache syntax, and filled in at runtime with the variables specific to the situation OR an instance of the PromptTemplate class if you want to control other parameters. See the documentation for more information.&quot;, &quot;default&quot;: {&quot;edit&quot;: {&quot;model&quot;: null, &quot;temperature&quot;: null, &quot;top_p&quot;: null, &quot;top_k&quot;: null, &quot;presence_penalty&quot;: null, &quot;frequency_penalty&quot;: null, &quot;stop&quot;: [&quot;[/CODE]&quot;], &quot;max_tokens&quot;: 600, &quot;functions&quot;: null, &quot;prompt&quot;: &quot;[CODE]\n{{{code_to_edit}}}\n[/CODE]\n[INST]\nYou are an expert programmer and personal assistant, here is your task: \&quot;Rewrite the above code in order to {{{user_input}}}\&quot;\n\nYour answer should start with a [CODE] tag and end with a [/CODE] tag.\n[/INST]\n[CODE]&quot;, &quot;raw&quot;: true}}, &quot;type&quot;: &quot;object&quot;}' required={false} default="{&#x27;edit&#x27;: {&#x27;model&#x27;: None, &#x27;temperature&#x27;: None, &#x27;top_p&#x27;: None, &#x27;top_k&#x27;: None, &#x27;presence_penalty&#x27;: None, &#x27;frequency_penalty&#x27;: None, &#x27;stop&#x27;: [&#x27;[/CODE]&#x27;], &#x27;max_tokens&#x27;: 600, &#x27;functions&#x27;: None, &#x27;prompt&#x27;: &#x27;[CODE]\n{{{code_to_edit}}}\n[/CODE]\n[INST]\nYou are an expert programmer and personal assistant, here is your task: &quot;Rewrite the above code in order to {{{user_input}}}&quot;\n\nYour answer should start with a [CODE] tag and end with a [/CODE] tag.\n[/INST]\n[CODE]&#x27;, &#x27;raw&#x27;: True}}"/>
<ClassPropertyRef name='api_key' details='{&quot;title&quot;: &quot;Api Key&quot;, &quot;description&quot;: &quot;The API key for the LLM provider.&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>

View file

@ -15,7 +15,7 @@ config = ContinueConfig(
)
```
[View the source](https://github.com/continuedev/continue/tree/main/continuedev/src/continuedev/libs/llm/ollama.py)
[View the source](https://github.com/continuedev/continue/blob/main/server/continuedev/libs/llm/libs/llm/ollama.py)
## Properties
@ -40,5 +40,5 @@ config = ContinueConfig(
<ClassPropertyRef name='ca_bundle_path' details='{&quot;title&quot;: &quot;Ca Bundle Path&quot;, &quot;description&quot;: &quot;Path to a custom CA bundle to use when making the HTTP request&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='proxy' details='{&quot;title&quot;: &quot;Proxy&quot;, &quot;description&quot;: &quot;Proxy URL to use when making the HTTP request&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='headers' details='{&quot;title&quot;: &quot;Headers&quot;, &quot;description&quot;: &quot;Headers to use when making the HTTP request&quot;, &quot;type&quot;: &quot;object&quot;, &quot;additionalProperties&quot;: {&quot;type&quot;: &quot;string&quot;}}' required={false} default=""/>
<ClassPropertyRef name='prompt_templates' details='{&quot;title&quot;: &quot;Prompt Templates&quot;, &quot;description&quot;: &quot;A dictionary of prompt templates that can be used to customize the behavior of the LLM in certain situations. For example, set the \&quot;edit\&quot; key in order to change the prompt that is used for the /edit slash command. Each value in the dictionary is a string templated in mustache syntax, and filled in at runtime with the variables specific to the situation. See the documentation for more information.&quot;, &quot;default&quot;: {&quot;edit&quot;: &quot;Consider the following code:\n```\n{{{code_to_edit}}}\n```\nEdit the code to perfectly satisfy the following user request:\n{{{user_input}}}\nOutput nothing except for the code. No code block, no English explanation, no start/end tags.&quot;}, &quot;type&quot;: &quot;object&quot;}' required={false} default="{&#x27;edit&#x27;: &#x27;Consider the following code:\n```\n{{{code_to_edit}}}\n```\nEdit the code to perfectly satisfy the following user request:\n{{{user_input}}}\nOutput nothing except for the code. No code block, no English explanation, no start/end tags.&#x27;}"/>
<ClassPropertyRef name='prompt_templates' details='{&quot;title&quot;: &quot;Prompt Templates&quot;, &quot;description&quot;: &quot;A dictionary of prompt templates that can be used to customize the behavior of the LLM in certain situations. For example, set the \&quot;edit\&quot; key in order to change the prompt that is used for the /edit slash command. Each value in the dictionary is a string templated in mustache syntax, and filled in at runtime with the variables specific to the situation OR an instance of the PromptTemplate class if you want to control other parameters. See the documentation for more information.&quot;, &quot;default&quot;: {&quot;edit&quot;: {&quot;model&quot;: null, &quot;temperature&quot;: null, &quot;top_p&quot;: null, &quot;top_k&quot;: null, &quot;presence_penalty&quot;: null, &quot;frequency_penalty&quot;: null, &quot;stop&quot;: [&quot;[/CODE]&quot;], &quot;max_tokens&quot;: 600, &quot;functions&quot;: null, &quot;prompt&quot;: &quot;[CODE]\n{{{code_to_edit}}}\n[/CODE]\n[INST]\nYou are an expert programmer and personal assistant, here is your task: \&quot;Rewrite the above code in order to {{{user_input}}}\&quot;\n\nYour answer should start with a [CODE] tag and end with a [/CODE] tag.\n[/INST]\n[CODE]&quot;, &quot;raw&quot;: true}}, &quot;type&quot;: &quot;object&quot;}' required={false} default="{&#x27;edit&#x27;: {&#x27;model&#x27;: None, &#x27;temperature&#x27;: None, &#x27;top_p&#x27;: None, &#x27;top_k&#x27;: None, &#x27;presence_penalty&#x27;: None, &#x27;frequency_penalty&#x27;: None, &#x27;stop&#x27;: [&#x27;[/CODE]&#x27;], &#x27;max_tokens&#x27;: 600, &#x27;functions&#x27;: None, &#x27;prompt&#x27;: &#x27;[CODE]\n{{{code_to_edit}}}\n[/CODE]\n[INST]\nYou are an expert programmer and personal assistant, here is your task: &quot;Rewrite the above code in order to {{{user_input}}}&quot;\n\nYour answer should start with a [CODE] tag and end with a [/CODE] tag.\n[/INST]\n[CODE]&#x27;, &#x27;raw&#x27;: True}}"/>
<ClassPropertyRef name='api_key' details='{&quot;title&quot;: &quot;Api Key&quot;, &quot;description&quot;: &quot;The API key for the LLM provider.&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>

View file

@ -28,15 +28,17 @@ Options for serving models locally with an OpenAI-compatible server include:
- [LocalAI](https://localai.io/basics/getting_started/)
- [llama-cpp-python](https://github.com/abetlen/llama-cpp-python#web-server)
[View the source](https://github.com/continuedev/continue/tree/main/continuedev/src/continuedev/libs/llm/openai.py)
[View the source](https://github.com/continuedev/continue/blob/main/server/continuedev/libs/llm/libs/llm/openai.py)
## Properties
<ClassPropertyRef name='api_base' details='{&quot;title&quot;: &quot;Api Base&quot;, &quot;description&quot;: &quot;OpenAI API base URL.&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='api_type' details='{&quot;title&quot;: &quot;Api Type&quot;, &quot;description&quot;: &quot;OpenAI API type.&quot;, &quot;enum&quot;: [&quot;azure&quot;, &quot;openai&quot;], &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='api_version' details='{&quot;title&quot;: &quot;Api Version&quot;, &quot;description&quot;: &quot;OpenAI API version. For use with Azure OpenAI Service.&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='use_legacy_completions_endpoint' details='{&quot;title&quot;: &quot;Use Legacy Completions Endpoint&quot;, &quot;description&quot;: &quot;Manually specify to use the legacy completions endpoint instead of chat completions.&quot;, &quot;default&quot;: false, &quot;type&quot;: &quot;boolean&quot;}' required={false} default="False"/>
<ClassPropertyRef name='engine' details='{&quot;title&quot;: &quot;Engine&quot;, &quot;description&quot;: &quot;OpenAI engine. For use with Azure OpenAI Service.&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
### Inherited Properties
<ClassPropertyRef name='model' details='{&quot;title&quot;: &quot;Model&quot;, &quot;description&quot;: &quot;The name of the model to be used (e.g. gpt-4, codellama)&quot;, &quot;type&quot;: &quot;string&quot;}' required={true} default=""/>

View file

@ -25,7 +25,7 @@ The `OpenAIFreeTrial` class will automatically switch to using your API key inst
These classes support any models available through the OpenAI API, assuming your API key has access, including "gpt-4", "gpt-3.5-turbo", "gpt-3.5-turbo-16k", and "gpt-4-32k".
[View the source](https://github.com/continuedev/continue/tree/main/continuedev/src/continuedev/libs/llm/openai_free_trial.py)
[View the source](https://github.com/continuedev/continue/blob/main/server/continuedev/libs/llm/libs/llm/openai_free_trial.py)
## Properties

View file

@ -17,7 +17,7 @@ config = ContinueConfig(
)
```
[View the source](https://github.com/continuedev/continue/tree/main/continuedev/src/continuedev/libs/llm/queued.py)
[View the source](https://github.com/continuedev/continue/blob/main/server/continuedev/libs/llm/libs/llm/queued.py)
## Properties

View file

@ -20,7 +20,7 @@ config = ContinueConfig(
If you don't specify the `model` parameter, it will default to `replicate/llama-2-70b-chat:58d078176e02c219e11eb4da5a02a7830a283b14cf8f94537af893ccff5ee781`.
[View the source](https://github.com/continuedev/continue/tree/main/continuedev/src/continuedev/libs/llm/replicate.py)
[View the source](https://github.com/continuedev/continue/blob/main/server/continuedev/libs/llm/libs/llm/replicate.py)
## Properties
@ -45,4 +45,4 @@ If you don't specify the `model` parameter, it will default to `replicate/llama-
<ClassPropertyRef name='ca_bundle_path' details='{&quot;title&quot;: &quot;Ca Bundle Path&quot;, &quot;description&quot;: &quot;Path to a custom CA bundle to use when making the HTTP request&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='proxy' details='{&quot;title&quot;: &quot;Proxy&quot;, &quot;description&quot;: &quot;Proxy URL to use when making the HTTP request&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='headers' details='{&quot;title&quot;: &quot;Headers&quot;, &quot;description&quot;: &quot;Headers to use when making the HTTP request&quot;, &quot;type&quot;: &quot;object&quot;, &quot;additionalProperties&quot;: {&quot;type&quot;: &quot;string&quot;}}' required={false} default=""/>
<ClassPropertyRef name='prompt_templates' details='{&quot;title&quot;: &quot;Prompt Templates&quot;, &quot;description&quot;: &quot;A dictionary of prompt templates that can be used to customize the behavior of the LLM in certain situations. For example, set the \&quot;edit\&quot; key in order to change the prompt that is used for the /edit slash command. Each value in the dictionary is a string templated in mustache syntax, and filled in at runtime with the variables specific to the situation. See the documentation for more information.&quot;, &quot;default&quot;: {&quot;edit&quot;: &quot;Consider the following code:\n```\n{{{code_to_edit}}}\n```\nEdit the code to perfectly satisfy the following user request:\n{{{user_input}}}\nOutput nothing except for the code. No code block, no English explanation, no start/end tags.&quot;}, &quot;type&quot;: &quot;object&quot;}' required={false} default="{&#x27;edit&#x27;: &#x27;Consider the following code:\n```\n{{{code_to_edit}}}\n```\nEdit the code to perfectly satisfy the following user request:\n{{{user_input}}}\nOutput nothing except for the code. No code block, no English explanation, no start/end tags.&#x27;}"/>
<ClassPropertyRef name='prompt_templates' details='{&quot;title&quot;: &quot;Prompt Templates&quot;, &quot;description&quot;: &quot;A dictionary of prompt templates that can be used to customize the behavior of the LLM in certain situations. For example, set the \&quot;edit\&quot; key in order to change the prompt that is used for the /edit slash command. Each value in the dictionary is a string templated in mustache syntax, and filled in at runtime with the variables specific to the situation OR an instance of the PromptTemplate class if you want to control other parameters. See the documentation for more information.&quot;, &quot;default&quot;: {&quot;edit&quot;: {&quot;model&quot;: null, &quot;temperature&quot;: null, &quot;top_p&quot;: null, &quot;top_k&quot;: null, &quot;presence_penalty&quot;: null, &quot;frequency_penalty&quot;: null, &quot;stop&quot;: [&quot;[/CODE]&quot;], &quot;max_tokens&quot;: 600, &quot;functions&quot;: null, &quot;prompt&quot;: &quot;[CODE]\n{{{code_to_edit}}}\n[/CODE]\n[INST]\nYou are an expert programmer and personal assistant, here is your task: \&quot;Rewrite the above code in order to {{{user_input}}}\&quot;\n\nYour answer should start with a [CODE] tag and end with a [/CODE] tag.\n[/INST]\n[CODE]&quot;, &quot;raw&quot;: true}}, &quot;type&quot;: &quot;object&quot;}' required={false} default="{&#x27;edit&#x27;: {&#x27;model&#x27;: None, &#x27;temperature&#x27;: None, &#x27;top_p&#x27;: None, &#x27;top_k&#x27;: None, &#x27;presence_penalty&#x27;: None, &#x27;frequency_penalty&#x27;: None, &#x27;stop&#x27;: [&#x27;[/CODE]&#x27;], &#x27;max_tokens&#x27;: 600, &#x27;functions&#x27;: None, &#x27;prompt&#x27;: &#x27;[CODE]\n{{{code_to_edit}}}\n[/CODE]\n[INST]\nYou are an expert programmer and personal assistant, here is your task: &quot;Rewrite the above code in order to {{{user_input}}}&quot;\n\nYour answer should start with a [CODE] tag and end with a [/CODE] tag.\n[/INST]\n[CODE]&#x27;, &#x27;raw&#x27;: True}}"/>

View file

@ -0,0 +1,52 @@
import ClassPropertyRef from '@site/src/components/ClassPropertyRef.tsx';
# TextGenWebUI
TextGenWebUI is a comprehensive, open-source language model UI and local server. You can set it up with an OpenAI-compatible server plugin, but if for some reason that doesn't work, you can use this class like so:
```python title="~/.continue/config.py"
<<<<<<<< HEAD:server/continuedev/libs/llm/text_gen_interface.py
from continuedev.libs.llm.text_gen_interface import TextGenUI
========
from continuedev.libs.llm.text_gen_webui import TextGenWebUI
>>>>>>>> 16b0a48035350d350e05ae5fe17478ae78042904:server/continuedev/libs/llm/text_gen_webui.py
config = ContinueConfig(
...
models=Models(
default=TextGenWebUI(
model="<MODEL_NAME>",
)
)
)
```
[View the source](https://github.com/continuedev/continue/blob/main/server/continuedev/libs/llm/libs/llm/text_gen_webui.py)
## Properties
<ClassPropertyRef name='server_url' details='{&quot;title&quot;: &quot;Server Url&quot;, &quot;description&quot;: &quot;URL of your TextGenWebUI server&quot;, &quot;default&quot;: &quot;http://localhost:5000&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default="http://localhost:5000"/>
<ClassPropertyRef name='streaming_url' details='{&quot;title&quot;: &quot;Streaming Url&quot;, &quot;description&quot;: &quot;URL of your TextGenWebUI streaming server (separate from main server URL)&quot;, &quot;default&quot;: &quot;http://localhost:5005&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default="http://localhost:5005"/>
### Inherited Properties
<ClassPropertyRef name='title' details='{&quot;title&quot;: &quot;Title&quot;, &quot;description&quot;: &quot;A title that will identify this model in the model selection dropdown&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='unique_id' details='{&quot;title&quot;: &quot;Unique Id&quot;, &quot;description&quot;: &quot;The unique ID of the user.&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='model' details='{&quot;title&quot;: &quot;Model&quot;, &quot;description&quot;: &quot;The name of the model to be used (e.g. gpt-4, codellama)&quot;, &quot;default&quot;: &quot;text-gen-webui&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default="text-gen-webui"/>
<ClassPropertyRef name='system_message' details='{&quot;title&quot;: &quot;System Message&quot;, &quot;description&quot;: &quot;A system message that will always be followed by the LLM&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='context_length' details='{&quot;title&quot;: &quot;Context Length&quot;, &quot;description&quot;: &quot;The maximum context length of the LLM in tokens, as counted by count_tokens.&quot;, &quot;default&quot;: 2048, &quot;type&quot;: &quot;integer&quot;}' required={false} default="2048"/>
<ClassPropertyRef name='stop_tokens' details='{&quot;title&quot;: &quot;Stop Tokens&quot;, &quot;description&quot;: &quot;Tokens that will stop the completion.&quot;, &quot;type&quot;: &quot;array&quot;, &quot;items&quot;: {&quot;type&quot;: &quot;string&quot;}}' required={false} default=""/>
<ClassPropertyRef name='temperature' details='{&quot;title&quot;: &quot;Temperature&quot;, &quot;description&quot;: &quot;The temperature of the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='top_p' details='{&quot;title&quot;: &quot;Top P&quot;, &quot;description&quot;: &quot;The top_p of the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='top_k' details='{&quot;title&quot;: &quot;Top K&quot;, &quot;description&quot;: &quot;The top_k of the completion.&quot;, &quot;type&quot;: &quot;integer&quot;}' required={false} default=""/>
<ClassPropertyRef name='presence_penalty' details='{&quot;title&quot;: &quot;Presence Penalty&quot;, &quot;description&quot;: &quot;The presence penalty Aof the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='frequency_penalty' details='{&quot;title&quot;: &quot;Frequency Penalty&quot;, &quot;description&quot;: &quot;The frequency penalty of the completion.&quot;, &quot;type&quot;: &quot;number&quot;}' required={false} default=""/>
<ClassPropertyRef name='timeout' details='{&quot;title&quot;: &quot;Timeout&quot;, &quot;description&quot;: &quot;Set the timeout for each request to the LLM. If you are running a local LLM that takes a while to respond, you might want to set this to avoid timeouts.&quot;, &quot;default&quot;: 300, &quot;type&quot;: &quot;integer&quot;}' required={false} default="300"/>
<ClassPropertyRef name='verify_ssl' details='{&quot;title&quot;: &quot;Verify Ssl&quot;, &quot;description&quot;: &quot;Whether to verify SSL certificates for requests.&quot;, &quot;type&quot;: &quot;boolean&quot;}' required={false} default=""/>
<ClassPropertyRef name='ca_bundle_path' details='{&quot;title&quot;: &quot;Ca Bundle Path&quot;, &quot;description&quot;: &quot;Path to a custom CA bundle to use when making the HTTP request&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='proxy' details='{&quot;title&quot;: &quot;Proxy&quot;, &quot;description&quot;: &quot;Proxy URL to use when making the HTTP request&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='headers' details='{&quot;title&quot;: &quot;Headers&quot;, &quot;description&quot;: &quot;Headers to use when making the HTTP request&quot;, &quot;type&quot;: &quot;object&quot;, &quot;additionalProperties&quot;: {&quot;type&quot;: &quot;string&quot;}}' required={false} default=""/>
<ClassPropertyRef name='prompt_templates' details='{&quot;title&quot;: &quot;Prompt Templates&quot;, &quot;description&quot;: &quot;A dictionary of prompt templates that can be used to customize the behavior of the LLM in certain situations. For example, set the \&quot;edit\&quot; key in order to change the prompt that is used for the /edit slash command. Each value in the dictionary is a string templated in mustache syntax, and filled in at runtime with the variables specific to the situation OR an instance of the PromptTemplate class if you want to control other parameters. See the documentation for more information.&quot;, &quot;default&quot;: {&quot;edit&quot;: &quot;Here is the code before editing:\n```\n{{{code_to_edit}}}\n```\n\nHere is the edit requested:\n\&quot;{{{user_input}}}\&quot;\n\nHere is the code after editing:&quot;}, &quot;type&quot;: &quot;object&quot;}' required={false} default="{&#x27;edit&#x27;: &#x27;Here is the code before editing:\n```\n{{{code_to_edit}}}\n```\n\nHere is the edit requested:\n&quot;{{{user_input}}}&quot;\n\nHere is the code after editing:&#x27;}"/>
<ClassPropertyRef name='api_key' details='{&quot;title&quot;: &quot;Api Key&quot;, &quot;description&quot;: &quot;The API key for the LLM provider.&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>

View file

@ -19,7 +19,7 @@ config = ContinueConfig(
)
```
[View the source](https://github.com/continuedev/continue/tree/main/continuedev/src/continuedev/libs/llm/together.py)
[View the source](https://github.com/continuedev/continue/blob/main/server/continuedev/libs/llm/libs/llm/together.py)
## Properties
@ -45,4 +45,4 @@ config = ContinueConfig(
<ClassPropertyRef name='ca_bundle_path' details='{&quot;title&quot;: &quot;Ca Bundle Path&quot;, &quot;description&quot;: &quot;Path to a custom CA bundle to use when making the HTTP request&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='proxy' details='{&quot;title&quot;: &quot;Proxy&quot;, &quot;description&quot;: &quot;Proxy URL to use when making the HTTP request&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default=""/>
<ClassPropertyRef name='headers' details='{&quot;title&quot;: &quot;Headers&quot;, &quot;description&quot;: &quot;Headers to use when making the HTTP request&quot;, &quot;type&quot;: &quot;object&quot;, &quot;additionalProperties&quot;: {&quot;type&quot;: &quot;string&quot;}}' required={false} default=""/>
<ClassPropertyRef name='prompt_templates' details='{&quot;title&quot;: &quot;Prompt Templates&quot;, &quot;description&quot;: &quot;A dictionary of prompt templates that can be used to customize the behavior of the LLM in certain situations. For example, set the \&quot;edit\&quot; key in order to change the prompt that is used for the /edit slash command. Each value in the dictionary is a string templated in mustache syntax, and filled in at runtime with the variables specific to the situation. See the documentation for more information.&quot;, &quot;default&quot;: {&quot;edit&quot;: &quot;Consider the following code:\n```\n{{{code_to_edit}}}\n```\nEdit the code to perfectly satisfy the following user request:\n{{{user_input}}}\nOutput nothing except for the code. No code block, no English explanation, no start/end tags.&quot;}, &quot;type&quot;: &quot;object&quot;}' required={false} default="{&#x27;edit&#x27;: &#x27;Consider the following code:\n```\n{{{code_to_edit}}}\n```\nEdit the code to perfectly satisfy the following user request:\n{{{user_input}}}\nOutput nothing except for the code. No code block, no English explanation, no start/end tags.&#x27;}"/>
<ClassPropertyRef name='prompt_templates' details='{&quot;title&quot;: &quot;Prompt Templates&quot;, &quot;description&quot;: &quot;A dictionary of prompt templates that can be used to customize the behavior of the LLM in certain situations. For example, set the \&quot;edit\&quot; key in order to change the prompt that is used for the /edit slash command. Each value in the dictionary is a string templated in mustache syntax, and filled in at runtime with the variables specific to the situation OR an instance of the PromptTemplate class if you want to control other parameters. See the documentation for more information.&quot;, &quot;default&quot;: {&quot;edit&quot;: {&quot;model&quot;: null, &quot;temperature&quot;: null, &quot;top_p&quot;: null, &quot;top_k&quot;: null, &quot;presence_penalty&quot;: null, &quot;frequency_penalty&quot;: null, &quot;stop&quot;: [&quot;[/CODE]&quot;], &quot;max_tokens&quot;: 600, &quot;functions&quot;: null, &quot;prompt&quot;: &quot;[CODE]\n{{{code_to_edit}}}\n[/CODE]\n[INST]\nYou are an expert programmer and personal assistant, here is your task: \&quot;Rewrite the above code in order to {{{user_input}}}\&quot;\n\nYour answer should start with a [CODE] tag and end with a [/CODE] tag.\n[/INST]\n[CODE]&quot;, &quot;raw&quot;: true}}, &quot;type&quot;: &quot;object&quot;}' required={false} default="{&#x27;edit&#x27;: {&#x27;model&#x27;: None, &#x27;temperature&#x27;: None, &#x27;top_p&#x27;: None, &#x27;top_k&#x27;: None, &#x27;presence_penalty&#x27;: None, &#x27;frequency_penalty&#x27;: None, &#x27;stop&#x27;: [&#x27;[/CODE]&#x27;], &#x27;max_tokens&#x27;: 600, &#x27;functions&#x27;: None, &#x27;prompt&#x27;: &#x27;[CODE]\n{{{code_to_edit}}}\n[/CODE]\n[INST]\nYou are an expert programmer and personal assistant, here is your task: &quot;Rewrite the above code in order to {{{user_input}}}&quot;\n\nYour answer should start with a [CODE] tag and end with a [/CODE] tag.\n[/INST]\n[CODE]&#x27;, &#x27;raw&#x27;: True}}"/>

View file

@ -4,7 +4,7 @@ import ClassPropertyRef from '@site/src/components/ClassPropertyRef.tsx';
Continue can be deeply customized by editing the `ContinueConfig` object in `~/.continue/config.py` (`%userprofile%\.continue\config.py` for Windows) on your machine. This class is instantiated from the config file for every new session.
[View the source](https://github.com/continuedev/continue/tree/main/continuedev/src/continuedev/core/config.py)
[View the source](https://github.com/continuedev/continue/blob/main/server/continuedev/libs/llm/core/config.py)
## Properties
@ -23,4 +23,6 @@ Continue can be deeply customized by editing the `ContinueConfig` object in `~/.
<ClassPropertyRef name='data_server_url' details='{&quot;title&quot;: &quot;Data Server Url&quot;, &quot;description&quot;: &quot;The URL of the server where development data is sent. No data is sent unless a valid user token is provided.&quot;, &quot;default&quot;: &quot;https://us-west1-autodebug.cloudfunctions.net&quot;, &quot;type&quot;: &quot;string&quot;}' required={false} default="https://us-west1-autodebug.cloudfunctions.net"/>
<ClassPropertyRef name='disable_summaries' details='{&quot;title&quot;: &quot;Disable Summaries&quot;, &quot;description&quot;: &quot;If set to `True`, Continue will not generate summaries for each Step. This can be useful if you want to save on compute.&quot;, &quot;default&quot;: false, &quot;type&quot;: &quot;boolean&quot;}' required={false} default="False"/>
### Inherited Properties

View file

@ -2,7 +2,7 @@
Continue can be run even on an air-gapped computer if you use a local model. You'll have to make a few adjustments for this to work.
1. Download the latest .vsix file from the [Open VSX Registry](https://open-vsx.org/extension/Continue/continue) and [install it to VS Code](https://code.visualstudio.com/docs/editor/extension-marketplace#_install-from-a-vsix).
1. Download the latest .vsix file from the [Open VSX Registry](https://open-vsx.org/extensions/vscode/Continue/continue) and [install it to VS Code](https://code.visualstudio.com/docs/editor/extension-marketplace#_install-from-a-vsix).
2. In VS Code settings, search "continue" and check the box that says "Manually Running Server". This will stop Continue from trying to kill and redownload the server binary.
3. Follow instructions to [run Continue manually](./manually-run-continue.md).
4. Open `~/.continue/config.py` and set `allow_anonymous_telemetry=False`. This will stop Continue from attempting requests to PostHog.

View file

@ -1,125 +0,0 @@
const { exec } = require("child_process");
const fs = require("fs");
const ncp = require("ncp").ncp;
const path = require("path");
exec("npm install", (error) => {
if (error) throw error;
console.log("npm install completed");
exec("npm run typegen", (error) => {
if (error) throw error;
console.log("npm run typegen completed");
process.chdir("react-app");
exec("npm install", (error) => {
if (error) throw error;
console.log("npm install in react-app completed");
exec("npm run build", (error) => {
// Then copy over the dist folder to the Intellij extension
// cp ../../intellij-extension/src/main/resources/webview/index.html tmp_index.html && rm -rf ../../intellij-extension/src/main/resources/webview && mkdir ../../intellij-extension/src/main/resources/webview && cp -R dist/* ../../intellij-extension/src/main/resources/webview && cp tmp_index.html ../../intellij-extension/src/main/resources/webview/index.html && rm tmp_index.html
fs.copyFileSync(
path.join(
"..",
"..",
"intellij-extension",
"src",
"main",
"resources",
"webview",
"index.html"
),
path.join("tmp_index.html")
);
fs.rmSync(
path.join(
"..",
"..",
"intellij-extension",
"src",
"main",
"resources",
"webview"
),
{ recursive: true }
);
fs.mkdirSync(
path.join(
"..",
"..",
"intellij-extension",
"src",
"main",
"resources",
"webview"
),
{ recursive: true }
);
ncp(
"dist",
path.join(
"..",
"..",
"intellij-extension",
"src",
"main",
"resources",
"webview"
),
(error) => {
if (error) {
console.log(
"Error copying react-app build to intellij-extension: ",
error
);
throw error;
}
const indexHtmlPath = path.join(
"..",
"..",
"intellij-extension",
"src",
"main",
"resources",
"webview",
"index.html"
);
if (fs.existsSync(indexHtmlPath)) {
fs.rmSync(indexHtmlPath, {});
}
fs.copyFileSync(
"tmp_index.html",
path.join(
"..",
"..",
"intellij-extension",
"src",
"main",
"resources",
"webview",
"index.html"
)
);
fs.unlinkSync("tmp_index.html");
console.log("Copied react-app build to intellij-extension");
}
);
if (error) {
console.log("Error running npm run build in react-app: ", error);
throw error;
}
if (!fs.existsSync(path.join("dist", "assets", "index.js"))) {
throw new Error("react-app build did not produce index.js");
}
if (!fs.existsSync(path.join("dist", "assets", "index.css"))) {
throw new Error("react-app build did not produce index.css");
}
console.log("npm run build in react-app completed");
});
});
});
});

View file

@ -1,9 +1,9 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run Plugin" type="GradleRunConfiguration" factoryName="Gradle">
<log_file alias="idea.log" path="$PROJECT_DIR$/intellij-extension/build/idea-sandbox/system/log/idea.log" />
<log_file alias="idea.log" path="$PROJECT_DIR$/extensions/intellij/build/idea-sandbox/system/log/idea.log" />
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$/intellij-extension" />
<option name="externalProjectPath" value="$PROJECT_DIR$/extensions/intellij" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">

View file

@ -1,9 +1,9 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run Tests" type="GradleRunConfiguration" factoryName="Gradle">
<log_file alias="idea.log" path="$PROJECT_DIR$/intellij-extension/build/idea-sandbox/system/log/idea.log" />
<log_file alias="idea.log" path="$PROJECT_DIR$/extensions/intellij/build/idea-sandbox/system/log/idea.log" />
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$/intellij-extension" />
<option name="externalProjectPath" value="$PROJECT_DIR$/extensions/intellij" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">

View file

Before

Width:  |  Height:  |  Size: 801 B

After

Width:  |  Height:  |  Size: 801 B

View file

Before

Width:  |  Height:  |  Size: 801 B

After

Width:  |  Height:  |  Size: 801 B

View file

Before

Width:  |  Height:  |  Size: 168 B

After

Width:  |  Height:  |  Size: 168 B

View file

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

View file

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

View file

@ -0,0 +1,29 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/play_button.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Continue</title>
<script type="module" crossorigin src="/assets/index.js"></script>
<link rel="stylesheet" href="/assets/index.css" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Lexend:wght@300&display=swap"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap"
rel="stylesheet"
/>
</head>
<body>
<div id="root"></div>
<script>
localStorage.setItem("ide", "jetbrains");
</script>
</body>
</html>

View file

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View file

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View file

Before

Width:  |  Height:  |  Size: 181 KiB

After

Width:  |  Height:  |  Size: 181 KiB

View file

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View file

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 106 KiB

View file

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 57 KiB

View file

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

View file

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View file

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

View file

Before

Width:  |  Height:  |  Size: 6 KiB

After

Width:  |  Height:  |  Size: 6 KiB

View file

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

View file

Before

Width:  |  Height:  |  Size: 483 KiB

After

Width:  |  Height:  |  Size: 483 KiB

View file

Before

Width:  |  Height:  |  Size: 1,017 B

After

Width:  |  Height:  |  Size: 1,017 B

View file

@ -15,10 +15,6 @@ scripts/.env
**/env
**/node_modules
react-app/node_modules
react-app/public
react-app/src
**/.pytest_cache
**/__pycache__

Some files were not shown because too many files have changed in this diff Show more