ui details
This commit is contained in:
parent
fce7833491
commit
5ae9fdcf9a
8 changed files with 48 additions and 14 deletions
|
|
@ -23,12 +23,14 @@ SERVER_URL = "https://proxy-server-l6vsfbzhba-uw.a.run.app"
|
|||
|
||||
class ProxyServer(LLM):
|
||||
unique_id: str
|
||||
name: str
|
||||
default_model: Literal["gpt-3.5-turbo", "gpt-4"]
|
||||
|
||||
def __init__(self, unique_id: str, default_model: Literal["gpt-3.5-turbo", "gpt-4"], system_message: str = None):
|
||||
self.unique_id = unique_id
|
||||
self.default_model = default_model
|
||||
self.system_message = system_message
|
||||
self.name = default_model
|
||||
|
||||
@cached_property
|
||||
def __encoding_for_model(self):
|
||||
|
|
|
|||
4
extension/package-lock.json
generated
4
extension/package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "continue",
|
||||
"version": "0.0.50",
|
||||
"version": "0.0.52",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "continue",
|
||||
"version": "0.0.50",
|
||||
"version": "0.0.52",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@electron/rebuild": "^3.2.10",
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
"displayName": "Continue",
|
||||
"pricing": "Free",
|
||||
"description": "Refine code 10x faster",
|
||||
"version": "0.0.50",
|
||||
"version": "0.0.52",
|
||||
"publisher": "Continue",
|
||||
"engines": {
|
||||
"vscode": "^1.74.0"
|
||||
|
|
|
|||
|
|
@ -124,11 +124,11 @@ const ComboBox = React.forwardRef((props: ComboBoxProps, ref) => {
|
|||
} else if (event.key === "Tab" && items.length > 0) {
|
||||
setInputValue(items[0].name);
|
||||
event.preventDefault();
|
||||
} else if (event.key === "ArrowUp" && !isOpen) {
|
||||
} else if (event.key === "ArrowUp") {
|
||||
if (positionInHistory == 0) return;
|
||||
setInputValue(history[positionInHistory - 1]);
|
||||
setPositionInHistory((prev) => prev - 1);
|
||||
} else if (event.key === "ArrowDown" && !isOpen) {
|
||||
} else if (event.key === "ArrowDown") {
|
||||
if (positionInHistory >= history.length - 1) {
|
||||
setInputValue("");
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -31,7 +31,9 @@ interface StepContainerProps {
|
|||
onUserInput: (input: string) => void;
|
||||
onRetry: () => void;
|
||||
onDelete: () => void;
|
||||
open?: boolean;
|
||||
open: boolean;
|
||||
onToggleAll: () => void;
|
||||
onToggle: () => void;
|
||||
}
|
||||
|
||||
const MainDiv = styled.div<{ stepDepth: number; inFuture: boolean }>`
|
||||
|
|
@ -81,9 +83,6 @@ const MarkdownPre = styled.pre`
|
|||
const MarkdownCode = styled.code``;
|
||||
|
||||
function StepContainer(props: StepContainerProps) {
|
||||
const [open, setOpen] = useState(
|
||||
typeof props.open === "undefined" ? true : props.open
|
||||
);
|
||||
const [isHovered, setIsHovered] = useState(false);
|
||||
const naturalLanguageInputRef = useRef<HTMLTextAreaElement>(null);
|
||||
const userInputRef = useRef<HTMLInputElement>(null);
|
||||
|
|
@ -119,19 +118,25 @@ function StepContainer(props: StepContainerProps) {
|
|||
}}
|
||||
hidden={props.historyNode.step.hide as any}
|
||||
>
|
||||
<StepContainerDiv open={open}>
|
||||
<StepContainerDiv open={props.open}>
|
||||
<GradientBorder
|
||||
borderColor={
|
||||
props.historyNode.observation?.error ? "#f00" : undefined
|
||||
}
|
||||
className="overflow-hidden cursor-pointer"
|
||||
onClick={() => setOpen((prev) => !prev)}
|
||||
onClick={(e) => {
|
||||
if (props.open && e.metaKey) {
|
||||
props.onToggleAll();
|
||||
} else {
|
||||
props.onToggle();
|
||||
}
|
||||
}}
|
||||
>
|
||||
<HeaderDiv
|
||||
error={props.historyNode.observation?.error ? true : false}
|
||||
>
|
||||
<h4 className="m-2">
|
||||
{open ? (
|
||||
{props.open ? (
|
||||
<ChevronDown size="1.4em" />
|
||||
) : (
|
||||
<ChevronRight size="1.4em" />
|
||||
|
|
@ -174,8 +179,8 @@ function StepContainer(props: StepContainerProps) {
|
|||
</>
|
||||
</HeaderDiv>
|
||||
</GradientBorder>
|
||||
<ContentDiv hidden={!open}>
|
||||
{open && false && (
|
||||
<ContentDiv hidden={!props.open}>
|
||||
{props.open && false && (
|
||||
<>
|
||||
<pre className="overflow-x-scroll">
|
||||
Step Details:
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ function GUI(props: GUIProps) {
|
|||
const [availableSlashCommands, setAvailableSlashCommands] = useState<
|
||||
{ name: string; description: string }[]
|
||||
>([]);
|
||||
const [stepsOpen, setStepsOpen] = useState<boolean[]>([]);
|
||||
const [history, setHistory] = useState<History | undefined>();
|
||||
// {
|
||||
// timeline: [
|
||||
|
|
@ -212,6 +213,15 @@ function GUI(props: GUIProps) {
|
|||
setWaitingForSteps(state.active);
|
||||
setHistory(state.history);
|
||||
setUserInputQueue(state.user_input_queue);
|
||||
const nextStepsOpen = [...stepsOpen];
|
||||
for (
|
||||
let i = nextStepsOpen.length;
|
||||
i < state.history.timeline.length;
|
||||
i++
|
||||
) {
|
||||
nextStepsOpen.push(true);
|
||||
}
|
||||
setStepsOpen(nextStepsOpen);
|
||||
|
||||
if (shouldScrollToBottom) {
|
||||
scrollToBottom();
|
||||
|
|
@ -321,6 +331,15 @@ function GUI(props: GUIProps) {
|
|||
{history?.timeline.map((node: HistoryNode, index: number) => {
|
||||
return (
|
||||
<StepContainer
|
||||
open={stepsOpen[index]}
|
||||
onToggle={() => {
|
||||
const nextStepsOpen = [...stepsOpen];
|
||||
nextStepsOpen[index] = !nextStepsOpen[index];
|
||||
setStepsOpen(nextStepsOpen);
|
||||
}}
|
||||
onToggleAll={() => {
|
||||
setStepsOpen((prev) => prev.map(() => !prev[index]));
|
||||
}}
|
||||
key={index}
|
||||
onUserInput={(input: string) => {
|
||||
onStepUserInput(input, index);
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -10,6 +10,7 @@ import {
|
|||
} from "./client";
|
||||
import { convertSingleToDoubleQuoteJSON } from "./util/util";
|
||||
import { getExtensionUri } from "./util/vscode";
|
||||
import { extensionContext } from "./activation/activate";
|
||||
const axios = require("axios").default;
|
||||
const util = require("util");
|
||||
const exec = util.promisify(require("child_process").exec);
|
||||
|
|
@ -52,6 +53,13 @@ export function get_api_url() {
|
|||
const API_URL = get_api_url();
|
||||
|
||||
export function getContinueServerUrl() {
|
||||
// If in debug mode, always use 8001
|
||||
if (
|
||||
extensionContext &&
|
||||
extensionContext.extensionMode === vscode.ExtensionMode.Development
|
||||
) {
|
||||
return "http://localhost:8001";
|
||||
}
|
||||
return (
|
||||
vscode.workspace.getConfiguration("continue").get<string>("serverUrl") ||
|
||||
"http://localhost:8000"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue