Merge branch 'main' into preview
This commit is contained in:
commit
9bc04e2e4f
24 changed files with 171 additions and 160 deletions
2
.github/workflows/main.yaml
vendored
2
.github/workflows/main.yaml
vendored
|
|
@ -286,7 +286,7 @@ jobs:
|
|||
run: |
|
||||
git config --local user.email "action@github.com"
|
||||
git config --local user.name "GitHub Action"
|
||||
git commit -am "ci: 🏷 Update PyPI version [skip ci]"
|
||||
git commit -am "💚 Update package.json version [skip ci]"
|
||||
|
||||
- name: Push changes
|
||||
uses: ad-m/github-push-action@master
|
||||
|
|
|
|||
44
.github/workflows/preview.yaml
vendored
44
.github/workflows/preview.yaml
vendored
|
|
@ -6,48 +6,6 @@ on:
|
|||
- preview
|
||||
|
||||
jobs:
|
||||
# pypi-deployment:
|
||||
# runs-on: ubuntu-latest
|
||||
# permissions:
|
||||
# contents: write
|
||||
# steps:
|
||||
# - name: Check out code
|
||||
# uses: actions/checkout@v2
|
||||
|
||||
# - name: Set up Python
|
||||
# uses: actions/setup-python@v4
|
||||
# with:
|
||||
# python-version: "3.10.8"
|
||||
|
||||
# - name: Install dependencies
|
||||
# run: |
|
||||
# python -m pip install --upgrade pip
|
||||
# pip install poetry
|
||||
|
||||
# - name: Install project dependencies
|
||||
# run: cd server && poetry install
|
||||
|
||||
# - name: Configure Poetry Token
|
||||
# run: cd server && poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }}
|
||||
|
||||
# - name: Bump the version
|
||||
# run: cd server && poetry version patch
|
||||
|
||||
# - name: Build and publish the package
|
||||
# run: cd server && poetry publish --build
|
||||
|
||||
# - name: Commit changes
|
||||
# run: |
|
||||
# git config --local user.email "action@github.com"
|
||||
# git config --local user.name "GitHub Action"
|
||||
# git commit -am "ci: 🏷 Update PyPI version [skip ci]"
|
||||
|
||||
# - name: Push changes
|
||||
# uses: ad-m/github-push-action@master
|
||||
# with:
|
||||
# github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
# branch: ${{ github.ref }}
|
||||
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
|
|
@ -315,7 +273,7 @@ jobs:
|
|||
run: |
|
||||
git config --local user.email "action@github.com"
|
||||
git config --local user.name "GitHub Action"
|
||||
git commit -am "ci: 💚 Update package.json version [skip ci]"
|
||||
git commit -am "💚 Update package.json version [skip ci]"
|
||||
|
||||
- name: Push changes
|
||||
uses: ad-m/github-push-action@master
|
||||
|
|
|
|||
3
.vscode/tasks.json
vendored
3
.vscode/tasks.json
vendored
|
|
@ -60,6 +60,9 @@
|
|||
"presentation": {
|
||||
"revealProblems": "onProblem",
|
||||
"clear": true
|
||||
},
|
||||
"options": {
|
||||
"cwd": "${workspaceFolder}/extensions/vscode"
|
||||
}
|
||||
},
|
||||
//
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
> 🎁 **New! [Try out the new JetBrains extension (Alpha)](https://plugins.jetbrains.com/plugin/22707-continue-extension)**
|
||||
|
||||
> Interested in a 1-on-1, 15 minute introduction to Continue? Fill out [this form](https://forms.gle/H6U6rGDX55oWSWjC8) and we'll get in touch!
|
||||
|
||||

|
||||
|
||||
<h1 align="center">Continue</h1>
|
||||
|
|
@ -62,7 +64,7 @@ Press `cmd+shift+r` (MacOS) / `ctrl+shift+r` (Windows) when you come across an e
|
|||
|
||||
### Download for [VS Code](https://marketplace.visualstudio.com/items?itemName=Continue.continue) and [JetBrains](https://plugins.jetbrains.com/plugin/22707-continue-extension)
|
||||
|
||||
By default, Continue uses `GPT-4` and `GPT-3.5-turbo` via the OpenAI API. You can adjust the config to use different Large Language Models (LLMs), including local, private models. Read more [here](https://continue.dev/docs/customization/models).
|
||||
By default, Continue uses `GPT-4` and `GPT-3.5-turbo` via the OpenAI API. You can adjust the config to use different Large Language Models (LLMs) like [Code Llama, Claude 2, WizardCoder, PaLM 2, and more](https://github.com/continuedev/what-llm-to-use). Read more [here](https://continue.dev/docs/customization/models).
|
||||
|
||||
### [Run the server manually](https://continue.dev/docs/walkthroughs/manually-run-continue)
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ Local Models
|
|||
|
||||
Open-Source Models (not local)
|
||||
|
||||
- [TogetherLLM](../reference/Models/togetherllm.md) - Use any model from the [Together Models list](https://docs.together.ai/docs/models-inference) with your Together API key.
|
||||
- [TogetherLLM](../reference/Models/togetherllm.md) - Use any model from the [Together Models list](https://docs.together.ai/docs/inference-models) with your Together API key.
|
||||
- [ReplicateLLM](../reference/Models/replicatellm.md) - Use any open-source model from the [Replicate Streaming List](https://replicate.com/collections/streaming-language-models) with your Replicate API key.
|
||||
- [HuggingFaceInferenceAPI](../reference/Models/huggingfaceinferenceapi.md) - Use any open-source model from the [Hugging Face Inference API](https://huggingface.co/inference-api) with your Hugging Face token.
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ keywords: [no internet, air-gapped, local model]
|
|||
|
||||
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/extensions/vscode/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/extension/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.
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
4
extensions/vscode/package-lock.json
generated
4
extensions/vscode/package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "continue",
|
||||
"version": "0.1.40",
|
||||
"version": "0.1.42",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "continue",
|
||||
"version": "0.1.40",
|
||||
"version": "0.1.42",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@electron/rebuild": "^3.2.10",
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "continue",
|
||||
"icon": "media/icon.png",
|
||||
"version": "0.1.40",
|
||||
"version": "0.1.42",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/continuedev/continue"
|
||||
|
|
|
|||
|
|
@ -719,7 +719,7 @@ class IdeProtocolClient {
|
|||
}
|
||||
|
||||
async debugTerminal() {
|
||||
const contents = await this.getTerminalContents();
|
||||
const contents = (await this.getTerminalContents()).trim();
|
||||
this.send("debugTerminal", v4(), { contents });
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1107,6 +1107,11 @@ const ComboBox = React.forwardRef((props: ComboBoxProps, ref) => {
|
|||
setInputFocused(false);
|
||||
},
|
||||
onKeyDown: (event) => {
|
||||
// Prevent duplicate calls to keyDown events due to IME.
|
||||
if (isComposing) {
|
||||
return;
|
||||
}
|
||||
|
||||
dispatch(setBottomMessage(undefined));
|
||||
if (event.key === "Enter" && event.shiftKey) {
|
||||
// Prevent Downshift's default 'Enter' behavior.
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// Write a component that displays a dialog box with a text field and a button.
|
||||
import React, { useEffect, useState } from "react";
|
||||
import React, { isValidElement, useEffect, useState } from "react";
|
||||
import styled from "styled-components";
|
||||
import { Button, secondaryDark, vscBackground, vscForeground } from ".";
|
||||
import { isMetaEquivalentKeyPressed } from "../util";
|
||||
|
|
@ -71,6 +71,10 @@ const TextDialog = (props: {
|
|||
};
|
||||
}, [props]);
|
||||
|
||||
if (!isValidElement(props.message) && typeof props.message !== "string") {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<ScreenCover
|
||||
onClick={() => {
|
||||
|
|
@ -86,7 +90,7 @@ const TextDialog = (props: {
|
|||
<Dialog>
|
||||
{typeof props.message === "string" ? (
|
||||
<ReactMarkdown>{props.message || ""}</ReactMarkdown>
|
||||
) : (
|
||||
) : !React.isValidElement(props.message) ? null : (
|
||||
props.message
|
||||
)}
|
||||
</Dialog>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { useDispatch } from "react-redux";
|
||||
import { useRouteError } from "react-router-dom";
|
||||
import { useNavigate, useRouteError } from "react-router-dom";
|
||||
import { newSession } from "../redux/slices/sessionStateReducer";
|
||||
import useContinueGUIProtocol from "../hooks/useContinueClient";
|
||||
import ContinueButton from "../components/ContinueButton";
|
||||
|
|
@ -10,6 +10,7 @@ export default function ErrorPage() {
|
|||
console.error(error);
|
||||
const dispatch = useDispatch();
|
||||
const client = useContinueGUIProtocol(false);
|
||||
const navigate = useNavigate();
|
||||
|
||||
return (
|
||||
<div
|
||||
|
|
@ -30,6 +31,8 @@ export default function ErrorPage() {
|
|||
onClick={() => {
|
||||
client?.stopSession();
|
||||
dispatch(newSession());
|
||||
localStorage.removeItem("persist:root");
|
||||
navigate("/");
|
||||
}}
|
||||
></ContinueButton>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -398,7 +398,7 @@ function GUI(props: GUIProps) {
|
|||
localStorage.setItem("mainTextEntryCounter", "1");
|
||||
}
|
||||
},
|
||||
[client, sessionState.history, sessionState.context_items]
|
||||
[client, sessionState.history, sessionState.context_items, defaultModel]
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
from typing import Callable, List, Literal, Optional
|
||||
import asyncio
|
||||
from typing import List, Literal, Optional
|
||||
|
||||
import certifi
|
||||
from ..util.count_tokens import MAX_TOKENS_FOR_MODEL
|
||||
|
|
@ -160,6 +161,11 @@ class OpenAI(LLM):
|
|||
):
|
||||
if not hasattr(chunk, "choices") or len(chunk.choices) == 0:
|
||||
continue
|
||||
|
||||
if self.api_type == "azure":
|
||||
# To smooth out the response streaming, which typically comes in bursts
|
||||
await asyncio.sleep(0.01)
|
||||
|
||||
yield chunk.choices[0].delta
|
||||
else:
|
||||
async for chunk in await openai.Completion.acreate(
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import asyncio
|
||||
import json
|
||||
import traceback
|
||||
from typing import List
|
||||
|
|
@ -70,6 +71,7 @@ class ProxyServer(LLM):
|
|||
if chunk.strip() != "":
|
||||
loaded_chunk = json.loads(chunk)
|
||||
yield loaded_chunk
|
||||
await asyncio.sleep(0.01)
|
||||
|
||||
except Exception as e:
|
||||
posthog_logger.capture_event(
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ from typing import List
|
|||
from ...core.context import ContextProvider
|
||||
from ...core.main import ContextItem, ContextItemDescription, ContextItemId
|
||||
from ...libs.util.create_async_task import create_async_task
|
||||
from .util import remove_meilisearch_disallowed_chars
|
||||
from .util import remove_meilisearch_disallowed_chars, remove_prefix
|
||||
|
||||
|
||||
class DynamicProvider(ContextProvider, ABC):
|
||||
|
|
@ -40,7 +40,7 @@ class DynamicProvider(ContextProvider, ABC):
|
|||
if not id.provider_title == self.title:
|
||||
raise Exception("Invalid provider title for item")
|
||||
|
||||
query = query.lstrip(self.title + " ")
|
||||
query = remove_prefix(text=query, prefix=self.title).strip()
|
||||
results = await self.get_content(query)
|
||||
|
||||
ctx_item = self.BASE_CONTEXT_ITEM.copy()
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ from ...core.context import ContextProvider
|
|||
from ...core.main import ContextItem, ContextItemDescription, ContextItemId
|
||||
from ...libs.util.logging import logger
|
||||
from ...libs.util.ripgrep import get_rg_path
|
||||
from .util import remove_meilisearch_disallowed_chars
|
||||
from .util import remove_meilisearch_disallowed_chars, remove_prefix
|
||||
|
||||
|
||||
class SearchContextProvider(ContextProvider):
|
||||
|
|
@ -80,7 +80,7 @@ class SearchContextProvider(ContextProvider):
|
|||
if not id.provider_title == self.title:
|
||||
raise Exception("Invalid provider title for item")
|
||||
|
||||
query = query.lstrip("search ")
|
||||
query = remove_prefix(text=query, prefix="search").strip()
|
||||
results = await self._search(query)
|
||||
|
||||
ctx_item = self.BASE_CONTEXT_ITEM.copy()
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ from pydantic import Field
|
|||
|
||||
from ...core.context import ContextProvider
|
||||
from ...core.main import ContextItem, ContextItemDescription, ContextItemId
|
||||
from .util import remove_meilisearch_disallowed_chars
|
||||
from .util import remove_meilisearch_disallowed_chars, remove_prefix
|
||||
|
||||
|
||||
class URLContextProvider(ContextProvider):
|
||||
|
|
@ -92,7 +92,7 @@ class URLContextProvider(ContextProvider):
|
|||
raise Exception("Invalid provider title for item")
|
||||
|
||||
# Generate the dynamic item
|
||||
url = query.lstrip("url ").strip()
|
||||
url = remove_prefix(text=query, prefix="url").strip()
|
||||
if url is None or url == "":
|
||||
return None
|
||||
content, title = self._get_url_text_contents_and_title(url)
|
||||
|
|
|
|||
|
|
@ -3,3 +3,15 @@ import re
|
|||
|
||||
def remove_meilisearch_disallowed_chars(id: str) -> str:
|
||||
return re.sub(r"[^0-9a-zA-Z_-]", "", id)
|
||||
|
||||
|
||||
def remove_prefix(text: str, prefix: str) -> str:
|
||||
if text.startswith(prefix):
|
||||
return text[len(prefix):]
|
||||
return text
|
||||
|
||||
|
||||
def remove_suffix(text: str, suffix: str) -> str:
|
||||
if text.endswith(suffix):
|
||||
return text[:-len(suffix)]
|
||||
return text
|
||||
|
|
|
|||
|
|
@ -282,6 +282,21 @@ class GUIProtocolServer:
|
|||
_running_autopilots: Dict[str, Autopilot] = {}
|
||||
|
||||
async def run_from_state(self, state: SessionState, step: Optional[Step] = None):
|
||||
if step is not None or len(state.history) > 0:
|
||||
step_to_log = step or state.history[-1]
|
||||
posthog_logger.capture_event(
|
||||
"step run",
|
||||
{
|
||||
"step_name": step_to_log.name,
|
||||
"params": step_to_log.params if step is None else step.dict(),
|
||||
"context": list(
|
||||
map(
|
||||
lambda item: item.dict(),
|
||||
state.context_items,
|
||||
)
|
||||
),
|
||||
},
|
||||
)
|
||||
autopilot = self.get_autopilot(state)
|
||||
cancel_token = str(uuid.uuid4())
|
||||
self._running_autopilots[cancel_token] = autopilot
|
||||
|
|
|
|||
|
|
@ -65,11 +65,12 @@ class Window:
|
|||
|
||||
async def reload_config(self):
|
||||
self.config = self.load_config()
|
||||
await self.config.models.start(
|
||||
self.ide.window_info.unique_id,
|
||||
self.config.system_message,
|
||||
self.config.temperature,
|
||||
)
|
||||
if self.ide is not None:
|
||||
await self.config.models.start(
|
||||
self.ide.window_info.unique_id,
|
||||
self.config.system_message,
|
||||
self.config.temperature,
|
||||
)
|
||||
|
||||
async def load(
|
||||
self, config: Optional[ContinueConfig] = None, only_reloading: bool = False
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
[tool.poetry]
|
||||
name = "continuedev"
|
||||
version = "0.1.72"
|
||||
version = "0.1.76"
|
||||
description = ""
|
||||
authors = ["Nate Sesti <sestinj@gmail.com>"]
|
||||
readme = "README.md"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue