diff options
| author | Ty Dunn <ty@tydunn.com> | 2023-07-07 17:57:45 -0700 |
|---|---|---|
| committer | Ty Dunn <ty@tydunn.com> | 2023-07-07 17:57:45 -0700 |
| commit | 59dc2a776268da2567aad17421053011c1263cf1 (patch) | |
| tree | de906c1202c72a8008cdee405a489c08bb4e3b85 /continuedev/src/continuedev/core | |
| parent | 128e5b5cf46dee72f6f72b3f36adb83b13dcc0d8 (diff) | |
| parent | 4d3a10c0324e451b6481104fcaff47e80ce5db70 (diff) | |
| download | sncontinue-59dc2a776268da2567aad17421053011c1263cf1.tar.gz sncontinue-59dc2a776268da2567aad17421053011c1263cf1.tar.bz2 sncontinue-59dc2a776268da2567aad17421053011c1263cf1.zip | |
Merge branch 'main' of github.com:continuedev/continue
Diffstat (limited to 'continuedev/src/continuedev/core')
| -rw-r--r-- | continuedev/src/continuedev/core/main.py | 3 | ||||
| -rw-r--r-- | continuedev/src/continuedev/core/policy.py | 4 | ||||
| -rw-r--r-- | continuedev/src/continuedev/core/sdk.py | 3 |
3 files changed, 6 insertions, 4 deletions
diff --git a/continuedev/src/continuedev/core/main.py b/continuedev/src/continuedev/core/main.py index 403e5417..4ea17f20 100644 --- a/continuedev/src/continuedev/core/main.py +++ b/continuedev/src/continuedev/core/main.py @@ -38,7 +38,8 @@ class ChatMessage(ContinueBaseModel): del d[key] if not with_functions: - d["role"] = "assistant" + if d["role"] == "function": + d["role"] = "assistant" if "name" in d: del d["name"] if "function_call" in d: diff --git a/continuedev/src/continuedev/core/policy.py b/continuedev/src/continuedev/core/policy.py index 6ee2d03f..b8363df2 100644 --- a/continuedev/src/continuedev/core/policy.py +++ b/continuedev/src/continuedev/core/policy.py @@ -46,7 +46,7 @@ def parse_custom_command(inp: str, config: ContinueConfig) -> Union[None, Step]: slash_command = parse_slash_command(custom_cmd.prompt, config) if slash_command is not None: return slash_command - return CustomCommandStep(name=custom_cmd.name, description=custom_cmd.description, prompt=custom_cmd.prompt, user_input=after_command) + return CustomCommandStep(name=custom_cmd.name, description=custom_cmd.description, prompt=custom_cmd.prompt, user_input=after_command, slash_command=command_name) return None @@ -82,6 +82,6 @@ class DemoPolicy(Policy): if custom_command is not None: return custom_command - return SimpleChatStep(user_input=user_input) + return SimpleChatStep() return None diff --git a/continuedev/src/continuedev/core/sdk.py b/continuedev/src/continuedev/core/sdk.py index 49513013..ed670799 100644 --- a/continuedev/src/continuedev/core/sdk.py +++ b/continuedev/src/continuedev/core/sdk.py @@ -192,7 +192,8 @@ class ContinueSDK(AbstractContinueSDK): async def get_chat_context(self) -> List[ChatMessage]: history_context = self.history.to_chat_history() - highlighted_code = self.__autopilot._highlighted_ranges + highlighted_code = [ + hr.range for hr in self.__autopilot._highlighted_ranges] preface = "The following code is highlighted" |
