chore: update toolCall typos

This commit is contained in:
Test 2024-12-02 13:23:07 -06:00
parent 1e334008c0
commit ca06d66915
3 changed files with 6 additions and 48 deletions

View file

@ -157,21 +157,21 @@ const Layout = () => {
useWebviewListener(
"focusEdit",
async () => {
await saveSession(true);
await saveSession();
dispatch(focusEdit());
dispatch(setMode("edit"));
},
[navigate],
[],
);
useWebviewListener(
"focusEditWithoutClear",
async () => {
await saveSession(true);
await saveSession();
dispatch(focusEdit());
dispatch(setMode("edit"));
},
[navigate],
[],
);
useWebviewListener(

View file

@ -6,8 +6,6 @@ import { renderChatMessage } from "core/util/messageContent";
import { CopyIconButton } from "../gui/CopyIconButton";
import { useAppDispatch, useAppSelector } from "../../redux/hooks";
import useHistory from "../../hooks/useHistory";
import { useContext } from "react";
import { IdeMessengerContext } from "../../context/IdeMessenger";
import { completeEdit } from "../../redux/thunks/completeEdit";
export interface EditActionsProps {

View file

@ -1,15 +1,11 @@
import { createAsyncThunk } from "@reduxjs/toolkit";
import { selectCurrentToolCall } from "../selectors/selectCurrentToolCall";
import {
cancelToolCall,
setCalling,
setToolCallOutput,
} from "../slices/sessionSlice";
import { cancelToolCall } from "../slices/sessionSlice";
import { ThunkApiType } from "../store";
import { streamResponseAfterToolCall } from "./streamResponseAfterToolCall";
export const cancelTool = createAsyncThunk<void, undefined, ThunkApiType>(
"chat/callTool",
"chat/cancelTool",
async (_, { dispatch, extra, getState }) => {
const state = getState();
const toolCallState = selectCurrentToolCall(state);
@ -40,39 +36,3 @@ export const cancelTool = createAsyncThunk<void, undefined, ThunkApiType>(
);
},
);
export const callTool = createAsyncThunk<void, undefined, ThunkApiType>(
"chat/callTool",
async (_, { dispatch, extra, getState }) => {
const state = getState();
const toolCallState = selectCurrentToolCall(state);
console.log("calling tool", toolCallState.toolCall);
if (!toolCallState) {
return;
}
if (toolCallState.status !== "generated") {
return;
}
dispatch(setCalling());
const result = await extra.ideMessenger.request("tools/call", {
toolCall: toolCallState.toolCall,
});
if (result.status === "success") {
const contextItems = result.content.contextItems;
dispatch(setToolCallOutput(contextItems));
// Send to the LLM to continue the conversation
dispatch(
streamResponseAfterToolCall({
toolCallId: toolCallState.toolCall.id,
toolOutput: contextItems,
}),
);
}
},
);