summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--continuedev/pyproject.toml2
-rw-r--r--continuedev/src/continuedev/libs/llm/proxy_server.py11
-rw-r--r--extension/package-lock.json4
-rw-r--r--extension/package.json2
-rw-r--r--extension/server_version.txt1
-rw-r--r--extension/src/activation/environmentSetup.ts32
6 files changed, 31 insertions, 21 deletions
diff --git a/continuedev/pyproject.toml b/continuedev/pyproject.toml
index e33627e7..6727e29a 100644
--- a/continuedev/pyproject.toml
+++ b/continuedev/pyproject.toml
@@ -6,7 +6,7 @@ authors = ["Nate Sesti <sestinj@gmail.com>"]
readme = "README.md"
[tool.poetry.dependencies]
-python = "^3.9"
+python = "^3.8"
diff-match-patch = "^20230430"
fastapi = "^0.95.1"
typer = "^0.7.0"
diff --git a/continuedev/src/continuedev/libs/llm/proxy_server.py b/continuedev/src/continuedev/libs/llm/proxy_server.py
index bd831ad9..69c96ee8 100644
--- a/continuedev/src/continuedev/libs/llm/proxy_server.py
+++ b/continuedev/src/continuedev/libs/llm/proxy_server.py
@@ -5,6 +5,11 @@ import aiohttp
from ...core.main import ChatMessage
from ..llm import LLM
from ..util.count_tokens import DEFAULT_ARGS, DEFAULT_MAX_TOKENS, compile_chat_messages, CHAT_MODELS, count_tokens
+import certifi
+import ssl
+
+ca_bundle_path = certifi.where()
+ssl_context = ssl.create_default_context(cafile=ca_bundle_path)
# SERVER_URL = "http://127.0.0.1:8080"
SERVER_URL = "https://proxy-server-l6vsfbzhba-uw.a.run.app"
@@ -31,7 +36,7 @@ class ProxyServer(LLM):
async def complete(self, prompt: str, with_history: List[ChatMessage] = [], **kwargs) -> Coroutine[Any, Any, str]:
args = self.default_args | kwargs
- async with aiohttp.ClientSession() as session:
+ async with aiohttp.ClientSession(connector=aiohttp.TCPConnector(ssl_context=ssl_context)) as session:
async with session.post(f"{SERVER_URL}/complete", json={
"messages": compile_chat_messages(args["model"], with_history, prompt, functions=None),
"unique_id": self.unique_id,
@@ -47,7 +52,7 @@ class ProxyServer(LLM):
messages = compile_chat_messages(
self.default_model, messages, None, functions=args.get("functions", None))
- async with aiohttp.ClientSession() as session:
+ async with aiohttp.ClientSession(connector=aiohttp.TCPConnector(ssl_context=ssl_context)) as session:
async with session.post(f"{SERVER_URL}/stream_chat", json={
"messages": messages,
"unique_id": self.unique_id,
@@ -71,7 +76,7 @@ class ProxyServer(LLM):
messages = compile_chat_messages(
self.default_model, with_history, prompt, functions=args.get("functions", None))
- async with aiohttp.ClientSession() as session:
+ async with aiohttp.ClientSession(connector=aiohttp.TCPConnector(ssl_context=ssl_context)) as session:
async with session.post(f"{SERVER_URL}/stream_complete", json={
"messages": messages,
"unique_id": self.unique_id,
diff --git a/extension/package-lock.json b/extension/package-lock.json
index d988c6a9..7e0c9cde 100644
--- a/extension/package-lock.json
+++ b/extension/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "continue",
- "version": "0.0.99",
+ "version": "0.0.102",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "continue",
- "version": "0.0.99",
+ "version": "0.0.102",
"license": "Apache-2.0",
"dependencies": {
"@electron/rebuild": "^3.2.10",
diff --git a/extension/package.json b/extension/package.json
index 5406bb71..9d369724 100644
--- a/extension/package.json
+++ b/extension/package.json
@@ -14,7 +14,7 @@
"displayName": "Continue",
"pricing": "Free",
"description": "The open-source coding autopilot",
- "version": "0.0.99",
+ "version": "0.0.102",
"publisher": "Continue",
"engines": {
"vscode": "^1.60.0"
diff --git a/extension/server_version.txt b/extension/server_version.txt
new file mode 100644
index 00000000..da5ce208
--- /dev/null
+++ b/extension/server_version.txt
@@ -0,0 +1 @@
+0.0.101 \ No newline at end of file
diff --git a/extension/src/activation/environmentSetup.ts b/extension/src/activation/environmentSetup.ts
index d4c81d2e..7e550ea8 100644
--- a/extension/src/activation/environmentSetup.ts
+++ b/extension/src/activation/environmentSetup.ts
@@ -71,9 +71,11 @@ async function getPythonPipCommands() {
}
}
+ let pipCmd = pythonCmd.endsWith("3") ? "pip3" : "pip";
+
const version = stdout.split(" ")[1];
const [major, minor] = version.split(".");
- if (parseInt(major) !== 3 || parseInt(minor) < 7) {
+ if (parseInt(major) !== 3 || parseInt(minor) < 8) {
// Need to check specific versions
const checkPython3VersionExists = async (minorVersion: number) => {
const [stdout, stderr] = await runCommand(
@@ -82,24 +84,27 @@ async function getPythonPipCommands() {
return typeof stderr === "undefined" || stderr === "";
};
- const validVersions = [7, 8, 9, 10, 11, 12];
+ const VALID_VERSIONS = [8, 9, 10, 11, 12];
let versionExists = false;
- for (const minorVersion of validVersions) {
+ for (const minorVersion of VALID_VERSIONS) {
if (await checkPython3VersionExists(minorVersion)) {
versionExists = true;
- break;
+ pythonCmd = `python3.${minorVersion}`;
+ pipCmd = `pip3.${minorVersion}`;
}
}
if (!versionExists) {
vscode.window.showErrorMessage(
- "Continue requires Python3 version 3.7 or greater. Please update your Python3 installation, reload VS Code, and try again."
+ "Continue requires Python3 version 3.8 or greater. Please update your Python3 installation, reload VS Code, and try again."
);
- throw new Error("Python3 is not installed.");
+ throw new Error("Python3.8 or greater is not installed.");
}
+ } else {
+ pythonCmd = `python${major}.${minor}`;
+ pipCmd = `pip${major}.${minor}`;
}
- const pipCmd = pythonCmd.endsWith("3") ? "pip3" : "pip";
return [pythonCmd, pipCmd];
}
@@ -298,14 +303,13 @@ export async function startContinuePythonServer() {
// Do this after above check so we don't have to waste time setting up the env
await setupPythonEnv();
- let activateCmd = ". env/bin/activate";
- let pythonCmd = "python3";
- if (process.platform == "win32") {
- activateCmd = ".\\env\\Scripts\\activate";
- pythonCmd = "python";
- }
+ const [pythonCmd] = await getPythonPipCommands();
+ const activateCmd =
+ process.platform == "win32"
+ ? ".\\env\\Scripts\\activate"
+ : ". env/bin/activate";
- let command = `cd "${path.join(
+ const command = `cd "${path.join(
getExtensionUri().fsPath,
"scripts"
)}" && ${activateCmd} && cd .. && ${pythonCmd} -m scripts.run_continue_server`;