fix linting errors
This commit is contained in:
parent
ae72f3a293
commit
fe97190e40
7 changed files with 14 additions and 16 deletions
|
|
@ -82,10 +82,10 @@ export default function StepContainerPreToolbar(
|
|||
const isNextCodeBlock = nextCodeBlockIndex === props.codeBlockIndex;
|
||||
const hasFileExtension = /\.[0-9a-z]+$/i.test(props.relativeFilepath);
|
||||
|
||||
const defaultModel = useAppSelector(selectSelectedChatModel);
|
||||
const selectedChatModel = useAppSelector(selectSelectedChatModel);
|
||||
|
||||
async function onClickApply() {
|
||||
if (!defaultModel) {
|
||||
if (!selectedChatModel) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ export function Chat() {
|
|||
const showSessionTabs = useAppSelector(
|
||||
(store) => store.config.config.ui?.showSessionTabs,
|
||||
);
|
||||
const defaultModel = useAppSelector(selectSelectedChatModel);
|
||||
const selectedChatModel = useAppSelector(selectSelectedChatModel);
|
||||
const isStreaming = useAppSelector((state) => state.session.isStreaming);
|
||||
const [stepsOpen, setStepsOpen] = useState<(boolean | undefined)[]>([]);
|
||||
const mainTextInputRef = useRef<HTMLInputElement>(null);
|
||||
|
|
@ -165,7 +165,7 @@ export function Chat() {
|
|||
"Cannot submit message while awaiting tool confirmation",
|
||||
);
|
||||
}
|
||||
if (defaultModel?.provider === "free-trial") {
|
||||
if (selectedChatModel?.provider === "free-trial") {
|
||||
const newCount = incrementFreeTrialCount();
|
||||
|
||||
if (newCount === FREE_TRIAL_LIMIT_REQUESTS) {
|
||||
|
|
@ -224,7 +224,7 @@ export function Chat() {
|
|||
},
|
||||
[
|
||||
history,
|
||||
defaultModel,
|
||||
selectedChatModel,
|
||||
streamResponse,
|
||||
isSingleRangeEditOrInsertion,
|
||||
codeToEdit,
|
||||
|
|
@ -233,7 +233,7 @@ export function Chat() {
|
|||
);
|
||||
|
||||
async function handleSingleRangeEditOrInsertion(editorState: JSONContent) {
|
||||
if (!defaultModel) {
|
||||
if (!selectedChatModel) {
|
||||
console.error("No selected chat model");
|
||||
return;
|
||||
}
|
||||
|
|
@ -248,7 +248,7 @@ export function Chat() {
|
|||
defaultContextProviders: [],
|
||||
availableSlashCommands: [],
|
||||
dispatch,
|
||||
selectedModelTitle: defaultModel.title,
|
||||
selectedModelTitle: selectedChatModel.title,
|
||||
});
|
||||
|
||||
const prompt = [
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ export const callTool = createAsyncThunk<void, undefined, ThunkApiType>(
|
|||
|
||||
const selectedChatModel = selectSelectedChatModel(state);
|
||||
|
||||
if (!defaultModel) {
|
||||
if (!selectedChatModel) {
|
||||
throw new Error("No model selected");
|
||||
}
|
||||
|
||||
|
|
@ -77,7 +77,7 @@ export const callTool = createAsyncThunk<void, undefined, ThunkApiType>(
|
|||
} else {
|
||||
const result = await extra.ideMessenger.request("tools/call", {
|
||||
toolCall: toolCallState.toolCall,
|
||||
selectedModelTitle: defaultModel.title,
|
||||
selectedModelTitle: selectedChatModel.title,
|
||||
});
|
||||
if (result.status === "error") {
|
||||
errorMessage = result.error;
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ export const gatherContext = createAsyncThunk<
|
|||
const defaultContextProviders =
|
||||
state.config.config.experimental?.defaultContext ?? [];
|
||||
|
||||
if (!defaultModel) {
|
||||
if (!selectedChatModel) {
|
||||
console.error(
|
||||
"gatherContext thunk: Cannot gather context, no model selected",
|
||||
);
|
||||
|
|
|
|||
|
|
@ -35,10 +35,10 @@ export const streamNormalInput = createAsyncThunk<
|
|||
const toolGroupSettings = state.ui.toolGroupSettings;
|
||||
const streamAborter = state.session.streamAborter;
|
||||
const useTools = selectUseTools(state);
|
||||
if (!defaultModel) {
|
||||
if (!selectedChatModel) {
|
||||
throw new Error("Default model not defined");
|
||||
}
|
||||
const includeTools = useTools && modelSupportsTools(defaultModel);
|
||||
const includeTools = useTools && modelSupportsTools(selectedChatModel);
|
||||
|
||||
// Send request
|
||||
const gen = extra.ideMessenger.llmStreamChat(
|
||||
|
|
|
|||
|
|
@ -35,11 +35,9 @@ export const streamResponseThunk = createAsyncThunk<
|
|||
streamThunkWrapper(async () => {
|
||||
const state = getState();
|
||||
const selectedChatModel = selectSelectedChatModel(state);
|
||||
|
||||
const slashCommands = state.config.config.slashCommands || [];
|
||||
const inputIndex = index ?? state.session.history.length; // Either given index or concat to end
|
||||
|
||||
if (!defaultModel) {
|
||||
if (!selectedChatModel) {
|
||||
throw new Error("No chat model selected");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ export const streamResponseAfterToolCall = createAsyncThunk<
|
|||
const initialHistory = state.session.history;
|
||||
const selectedChatModel = selectSelectedChatModel(state);
|
||||
|
||||
if (!defaultModel) {
|
||||
if (!selectedChatModel) {
|
||||
throw new Error("No model selected");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue