diff options
author | Nate Sesti <sestinj@gmail.com> | 2023-06-28 14:08:16 -0700 |
---|---|---|
committer | Nate Sesti <sestinj@gmail.com> | 2023-06-28 14:08:16 -0700 |
commit | d4dd9a73d48c2e97ce08a1eacaecad799620098f (patch) | |
tree | 283e3c2ab67b810357c9f59beef4123013954fb8 | |
parent | 8159e6371efb3501d23f6103da4b7489a6c86d93 (diff) | |
download | sncontinue-d4dd9a73d48c2e97ce08a1eacaecad799620098f.tar.gz sncontinue-d4dd9a73d48c2e97ce08a1eacaecad799620098f.tar.bz2 sncontinue-d4dd9a73d48c2e97ce08a1eacaecad799620098f.zip |
patch, details
-rw-r--r-- | continuedev/src/continuedev/libs/llm/proxy_server.py | 2 | ||||
-rw-r--r-- | continuedev/src/continuedev/steps/chat.py | 26 | ||||
-rw-r--r-- | continuedev/src/continuedev/steps/core/core.py | 4 | ||||
-rw-r--r-- | extension/package-lock.json | 4 | ||||
-rw-r--r-- | extension/package.json | 2 |
5 files changed, 22 insertions, 16 deletions
diff --git a/continuedev/src/continuedev/libs/llm/proxy_server.py b/continuedev/src/continuedev/libs/llm/proxy_server.py index ccdb2002..bd831ad9 100644 --- a/continuedev/src/continuedev/libs/llm/proxy_server.py +++ b/continuedev/src/continuedev/libs/llm/proxy_server.py @@ -38,7 +38,7 @@ class ProxyServer(LLM): **args }) as resp: try: - return json.loads(await resp.text()) + return await resp.text() except: raise Exception(await resp.text()) diff --git a/continuedev/src/continuedev/steps/chat.py b/continuedev/src/continuedev/steps/chat.py index 50e0f905..ccb7f62a 100644 --- a/continuedev/src/continuedev/steps/chat.py +++ b/continuedev/src/continuedev/steps/chat.py @@ -25,6 +25,9 @@ class SimpleChatStep(Step): await sdk.update_ui() async for chunk in sdk.models.default.stream_complete(self.user_input, with_history=await sdk.get_chat_context()): + if sdk.current_step_was_deleted(): + return + self.description += chunk await sdk.update_ui() @@ -125,11 +128,11 @@ class ChatWithFunctions(Step): EditHighlightedCodeStep(user_input=""), ViewDirectoryTreeStep(), AddDirectoryStep(directory_name=""), DeleteFileStep(filename=""), RunTerminalCommandStep(command="")] - name: str = "Chat" + name: str = "Input" manage_own_chat_context: bool = True async def run(self, sdk: ContinueSDK): - self.description = f"```{self.user_input}```\n\nDeciding next steps...\n\n" + self.description = f"```{self.user_input}```" await sdk.update_ui() step_name_step_class_map = { @@ -153,6 +156,9 @@ class ChatWithFunctions(Step): msg_step = None async for msg_chunk in sdk.models.gpt350613.stream_chat(await sdk.get_chat_context(), functions=functions): + if sdk.current_step_was_deleted(): + return + if "content" in msg_chunk and msg_chunk["content"] is not None: msg_content += msg_chunk["content"] # if last_function_called_index_in_history is not None: @@ -220,13 +226,13 @@ class ChatWithFunctions(Step): step_to_run = step_name_step_class_map[func_name]( **fn_call_params) - if func_name == "AddFileStep": - step_to_run.hide = True - self.description += f"\nAdded file `{func_args['filename']}`" - elif func_name == "AddDirectoryStep": - step_to_run.hide = True - self.description += f"\nAdded directory `{func_args['directory_name']}`" - else: - self.description += f"\n`Running function {func_name}`\n\n" + # if func_name == "AddFileStep": + # step_to_run.hide = True + # self.description += f"\nAdded file `{func_args['filename']}`" + # elif func_name == "AddDirectoryStep": + # step_to_run.hide = True + # self.description += f"\nAdded directory `{func_args['directory_name']}`" + # else: + # self.description += f"\n`Running function {func_name}`\n\n" await sdk.run_step(step_to_run) await sdk.update_ui() diff --git a/continuedev/src/continuedev/steps/core/core.py b/continuedev/src/continuedev/steps/core/core.py index 8a28490e..d047e419 100644 --- a/continuedev/src/continuedev/steps/core/core.py +++ b/continuedev/src/continuedev/steps/core/core.py @@ -183,7 +183,7 @@ class DefaultModelEditCodeStep(Step): full_file_contents_lst[cur_end_line]) cur_end_line -= 1 if total_tokens < MAX_TOKENS_FOR_MODEL[model_to_use.name]: - return cur_start_line, cur_end_line + break if total_tokens > MAX_TOKENS_FOR_MODEL[model_to_use.name]: while cur_start_line < max_start_line: @@ -191,7 +191,7 @@ class DefaultModelEditCodeStep(Step): total_tokens -= model_to_use.count_tokens( full_file_contents_lst[cur_end_line]) if total_tokens < MAX_TOKENS_FOR_MODEL[model_to_use.name]: - return cur_start_line, cur_end_line + break # Now use the found start/end lines to get the prefix and suffix strings file_prefix = "\n".join( diff --git a/extension/package-lock.json b/extension/package-lock.json index 0b86a8a1..f80125f5 100644 --- a/extension/package-lock.json +++ b/extension/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "0.0.74", + "version": "0.0.75", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "continue", - "version": "0.0.74", + "version": "0.0.75", "license": "Apache-2.0", "dependencies": { "@electron/rebuild": "^3.2.10", diff --git a/extension/package.json b/extension/package.json index 54a6e1f5..540011f9 100644 --- a/extension/package.json +++ b/extension/package.json @@ -14,7 +14,7 @@ "displayName": "Continue", "pricing": "Free", "description": "Accelerating software development with language models", - "version": "0.0.74", + "version": "0.0.75", "publisher": "Continue", "engines": { "vscode": "^1.74.0" |