patch, details
This commit is contained in:
parent
8159e6371e
commit
d4dd9a73d4
5 changed files with 22 additions and 16 deletions
|
|
@ -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())
|
||||
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
4
extension/package-lock.json
generated
4
extension/package-lock.json
generated
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue