fix type errs
This commit is contained in:
parent
cf25bb210f
commit
5a07fed30c
8 changed files with 25 additions and 31 deletions
|
|
@ -4,7 +4,7 @@ import {
|
|||
LLMOptions,
|
||||
ModelProvider,
|
||||
} from "../../index.js";
|
||||
import { renderChatMessage } from "../../util/messageContent.js";
|
||||
import { renderChatMessage, stripImages } from "../../util/messageContent.js";
|
||||
import { BaseLLM } from "../index.js";
|
||||
import { streamSse } from "../stream.js";
|
||||
|
||||
|
|
@ -146,8 +146,9 @@ class Anthropic extends BaseLLM {
|
|||
): AsyncGenerator<ChatMessage> {
|
||||
const shouldCacheSystemMessage =
|
||||
!!this.systemMessage && this.cacheBehavior?.cacheSystemMessage;
|
||||
const systemMessage: string =
|
||||
messages.filter((m) => m.role === "system")[0]?.content ?? "";
|
||||
const systemMessage: string = stripImages(
|
||||
messages.filter((m) => m.role === "system")[0]?.content ?? "",
|
||||
);
|
||||
|
||||
const msgs = this.convertMessages(messages);
|
||||
const response = await this.fetch(new URL("messages", this.apiBase), {
|
||||
|
|
|
|||
6
extensions/vscode/package-lock.json
generated
6
extensions/vscode/package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "continue",
|
||||
"version": "0.9.232",
|
||||
"version": "0.9.233",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "continue",
|
||||
"version": "0.9.232",
|
||||
"version": "0.9.233",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@electron/rebuild": "^3.2.10",
|
||||
|
|
@ -109,7 +109,7 @@
|
|||
"cheerio": "^1.0.0-rc.12",
|
||||
"commander": "^12.0.0",
|
||||
"comment-json": "^4.2.3",
|
||||
"dbinfoz": "^0.11.0",
|
||||
"dbinfoz": "^0.14.0",
|
||||
"diff": "^7.0.0",
|
||||
"dotenv": "^16.4.5",
|
||||
"fastest-levenshtein": "^1.0.16",
|
||||
|
|
|
|||
8
gui/package-lock.json
generated
8
gui/package-lock.json
generated
|
|
@ -56,7 +56,6 @@
|
|||
"socket.io-client": "^4.7.2",
|
||||
"styled-components": "^5.3.6",
|
||||
"table": "^6.8.1",
|
||||
"tailwind-scrollbar-hide": "^1.1.7",
|
||||
"tippy.js": "^6.3.7",
|
||||
"unist-util-visit": "^5.0.0",
|
||||
"uuid": "^9.0.1",
|
||||
|
|
@ -112,7 +111,7 @@
|
|||
"cheerio": "^1.0.0-rc.12",
|
||||
"commander": "^12.0.0",
|
||||
"comment-json": "^4.2.3",
|
||||
"dbinfoz": "^0.11.0",
|
||||
"dbinfoz": "^0.14.0",
|
||||
"diff": "^7.0.0",
|
||||
"dotenv": "^16.4.5",
|
||||
"fastest-levenshtein": "^1.0.16",
|
||||
|
|
@ -8985,11 +8984,6 @@
|
|||
"node": ">=10.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/tailwind-scrollbar-hide": {
|
||||
"version": "1.1.7",
|
||||
"resolved": "https://registry.npmjs.org/tailwind-scrollbar-hide/-/tailwind-scrollbar-hide-1.1.7.tgz",
|
||||
"integrity": "sha512-X324n9OtpTmOMqEgDUEA/RgLrNfBF/jwJdctaPZDzB3mppxJk7TLIDmOreEDm1Bq4R9LSPu4Epf8VSdovNU+iA=="
|
||||
},
|
||||
"node_modules/tailwindcss": {
|
||||
"version": "3.4.12",
|
||||
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.12.tgz",
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ import useSubmenuContextProviders from "./hooks/useSubmenuContextProviders";
|
|||
import { useVscTheme } from "./hooks/useVscTheme";
|
||||
import { AddNewModel, ConfigureProvider } from "./pages/AddNewModel";
|
||||
import ConfigErrorPage from "./pages/config-error";
|
||||
import Edit from "./pages/Edit";
|
||||
import ErrorPage from "./pages/error";
|
||||
import Chat from "./pages/gui";
|
||||
import History from "./pages/history";
|
||||
|
|
@ -33,10 +32,6 @@ const router = createMemoryRouter([
|
|||
path: "/",
|
||||
element: <Chat />,
|
||||
},
|
||||
{
|
||||
path: "/edit",
|
||||
element: <Edit />,
|
||||
},
|
||||
{
|
||||
path: "/history",
|
||||
element: <History />,
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ import {
|
|||
abortStream,
|
||||
acceptToolCall,
|
||||
addPromptCompletionPair,
|
||||
clearLastResponse,
|
||||
clearLastEmptyResponse,
|
||||
initNewActiveMessage,
|
||||
resetNextCodeBlockToApplyIndex,
|
||||
resubmitAtIndex,
|
||||
|
|
@ -38,13 +38,12 @@ import {
|
|||
setCurCheckpointIndex,
|
||||
setInactive,
|
||||
setIsGatheringContext,
|
||||
setIsInMultifileEdit,
|
||||
setMessageAtIndex,
|
||||
streamUpdate,
|
||||
} from "../redux/slices/stateSlice";
|
||||
import { RootState } from "../redux/store";
|
||||
import useHistory from "./useHistory";
|
||||
import { updateFileSymbolsFromContextItems } from "../util/symbols";
|
||||
import useHistory from "./useHistory";
|
||||
|
||||
function useChatHandler(dispatch: Dispatch, ideMessenger: IIdeMessenger) {
|
||||
const posthog = usePostHog();
|
||||
|
|
@ -103,7 +102,7 @@ function useChatHandler(dispatch: Dispatch, ideMessenger: IIdeMessenger) {
|
|||
}
|
||||
} catch (e) {
|
||||
// If there's an error, we should clear the response so there aren't two input boxes
|
||||
dispatch(clearLastResponse());
|
||||
dispatch(clearLastEmptyResponse());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -352,9 +351,9 @@ function useChatHandler(dispatch: Dispatch, ideMessenger: IIdeMessenger) {
|
|||
params: {},
|
||||
});
|
||||
|
||||
if (slashCommand.name === "multifile-edit") {
|
||||
dispatch(setIsInMultifileEdit(true));
|
||||
}
|
||||
// if (slashCommand.name === "multifile-edit") {
|
||||
// dispatch(setIsInMultifileEdit(true));
|
||||
// }
|
||||
|
||||
await _streamSlashCommand(
|
||||
messages,
|
||||
|
|
|
|||
|
|
@ -1,14 +1,18 @@
|
|||
import { ArrowLeftIcon } from "@heroicons/react/24/outline";
|
||||
import { Editor, JSONContent } from "@tiptap/core";
|
||||
import { InputModifiers, RangeInFileWithContents } from "core";
|
||||
import { stripImages } from "core/llm/images";
|
||||
import { stripImages } from "core/util/messageContent";
|
||||
import { useCallback, useContext, useEffect } from "react";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import ContinueInputBox from "../../components/mainInput/ContinueInputBox";
|
||||
import { NewSessionButton } from "../../components/mainInput/NewSessionButton";
|
||||
import resolveEditorContent from "../../components/mainInput/resolveInput";
|
||||
import TipTapEditor from "../../components/mainInput/TipTapEditor";
|
||||
import StepContainer from "../../components/StepContainer";
|
||||
import AcceptRejectAllButtons from "../../components/StepContainer/AcceptRejectAllButtons";
|
||||
import { IdeMessengerContext } from "../../context/IdeMessenger";
|
||||
import useChatHandler from "../../hooks/useChatHandler";
|
||||
import {
|
||||
clearCodeToEdit,
|
||||
setEditDone,
|
||||
|
|
@ -16,10 +20,6 @@ import {
|
|||
} from "../../redux/slices/editModeState";
|
||||
import { RootState } from "../../redux/store";
|
||||
import CodeToEdit from "./CodeToEdit";
|
||||
import useChatHandler from "../../hooks/useChatHandler";
|
||||
import AcceptRejectAllButtons from "../../components/StepContainer/AcceptRejectAllButtons";
|
||||
import ContinueInputBox from "../../components/mainInput/ContinueInputBox";
|
||||
import StepContainer from "../../components/StepContainer";
|
||||
import getMultifileEditPrompt from "./getMultifileEditPrompt";
|
||||
|
||||
const EDIT_DISALLOWED_CONTEXT_PROVIDERS = [
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ function ToolOutput(props: ToolOutputProps) {
|
|||
return (
|
||||
<div>
|
||||
<ContextItemsPeek
|
||||
isGatheringContext={false}
|
||||
isCurrentContextPeek={false}
|
||||
contextItems={[
|
||||
{
|
||||
content: props.output,
|
||||
|
|
|
|||
|
|
@ -549,6 +549,11 @@ export const {
|
|||
abortStream,
|
||||
updateIndexingStatus,
|
||||
setIndexingChatPeekHidden,
|
||||
setCalling,
|
||||
cancelToolCall,
|
||||
registerCurrentToolCall,
|
||||
setGeneratedOutput,
|
||||
acceptToolCall,
|
||||
} = stateSlice.actions;
|
||||
|
||||
export default stateSlice.reducer;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue