more progress

This commit is contained in:
Ty Dunn 2023-06-21 21:33:24 -07:00
parent 6cedd587c6
commit 8c8e65f552
4 changed files with 10 additions and 2 deletions

View file

@ -46,8 +46,11 @@ class Autopilot(ContinueBaseModel):
return list(map(lambda x: {"name": x.name, "description": x.description}, self.continue_sdk.config.slash_commands)) or []
async def change_default_model(self):
# TODO: Implement this
temp = self.continue_sdk.config.slash_commands
print("Changing default model")
if self.continue_sdk.config.default_model == "gpt-4":
self.continue_sdk.config.default_model == "gpt-3.5-turbo" # not quite correct
else:
self.continue_sdk.config.default_model == "gpt-4" # not quite correct
async def clear_history(self):
self.history = History.from_empty()

View file

@ -77,6 +77,8 @@ class GUIProtocolServer(AbstractGUIProtocolServer):
self.on_reverse_to_index(data["index"])
elif message_type == "retry_at_index":
self.on_retry_at_index(data["index"])
elif message_type == "change_default_model":
self.on_change_default_model()
elif message_type == "clear_history":
self.on_clear_history()
elif message_type == "delete_at_index":

View file

@ -13,6 +13,8 @@ abstract class AbstractContinueGUIClientProtocol {
callback: (commands: { name: string; description: string }[]) => void
): void;
abstract changeDefaultModel(): void;
abstract sendClear(): void;
abstract retryAtIndex(index: number): void;

View file

@ -473,6 +473,7 @@ function GUI(props: GUIProps) {
<HeaderButtonWithText
onClick={() => {
setUsingFastModel((prev) => !prev);
client?.changeDefaultModel();
}}
text={usingFastModel ? "gpt-3.5-turbo" : "gpt-4"}
>