mirror of
https://github.com/stackblitz/bolt.new
synced 2025-02-11 07:03:15 +00:00
Merge pull request #414 from SujalXplores/fix/eslint-issues
fix: silent eslint issues
This commit is contained in:
commit
574f0a05b3
@ -22,9 +22,6 @@ import { ExportChatButton } from '~/components/chat/chatExportAndImport/ExportCh
|
|||||||
import { ImportButton } from '~/components/chat/chatExportAndImport/ImportButton';
|
import { ImportButton } from '~/components/chat/chatExportAndImport/ImportButton';
|
||||||
import { ExamplePrompts } from '~/components/chat/ExamplePrompts';
|
import { ExamplePrompts } from '~/components/chat/ExamplePrompts';
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
||||||
const providerList = PROVIDER_LIST;
|
|
||||||
|
|
||||||
// @ts-ignore TODO: Introduce proper types
|
// @ts-ignore TODO: Introduce proper types
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
const ModelSelector = ({ model, setModel, provider, setProvider, modelList, providerList, apiKeys }) => {
|
const ModelSelector = ({ model, setModel, provider, setProvider, modelList, providerList, apiKeys }) => {
|
||||||
|
@ -93,14 +93,13 @@ export class ActionRunner {
|
|||||||
|
|
||||||
this.#updateAction(actionId, { ...action, ...data.action, executed: !isStreaming });
|
this.#updateAction(actionId, { ...action, ...data.action, executed: !isStreaming });
|
||||||
|
|
||||||
// eslint-disable-next-line consistent-return
|
this.#currentExecutionPromise = this.#currentExecutionPromise
|
||||||
return (this.#currentExecutionPromise = this.#currentExecutionPromise
|
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.#executeAction(actionId, isStreaming);
|
this.#executeAction(actionId, isStreaming);
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.error('Action failed:', error);
|
console.error('Action failed:', error);
|
||||||
}));
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async #executeAction(actionId: string, isStreaming: boolean = false) {
|
async #executeAction(actionId: string, isStreaming: boolean = false) {
|
||||||
|
@ -283,6 +283,10 @@ const getOllamaBaseUrl = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
async function getOllamaModels(): Promise<ModelInfo[]> {
|
async function getOllamaModels(): Promise<ModelInfo[]> {
|
||||||
|
if (typeof window === 'undefined') {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const baseUrl = getOllamaBaseUrl();
|
const baseUrl = getOllamaBaseUrl();
|
||||||
const response = await fetch(`${baseUrl}/api/tags`);
|
const response = await fetch(`${baseUrl}/api/tags`);
|
||||||
@ -294,8 +298,8 @@ async function getOllamaModels(): Promise<ModelInfo[]> {
|
|||||||
provider: 'Ollama',
|
provider: 'Ollama',
|
||||||
maxTokenAllowed: 8000,
|
maxTokenAllowed: 8000,
|
||||||
}));
|
}));
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
console.error('Error getting Ollama models:', e);
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -321,8 +325,8 @@ async function getOpenAILikeModels(): Promise<ModelInfo[]> {
|
|||||||
label: model.id,
|
label: model.id,
|
||||||
provider: 'OpenAILike',
|
provider: 'OpenAILike',
|
||||||
}));
|
}));
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
console.error('Error getting OpenAILike models:', e);
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -361,6 +365,10 @@ async function getOpenRouterModels(): Promise<ModelInfo[]> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function getLMStudioModels(): Promise<ModelInfo[]> {
|
async function getLMStudioModels(): Promise<ModelInfo[]> {
|
||||||
|
if (typeof window === 'undefined') {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const baseUrl = import.meta.env.LMSTUDIO_API_BASE_URL || 'http://localhost:1234';
|
const baseUrl = import.meta.env.LMSTUDIO_API_BASE_URL || 'http://localhost:1234';
|
||||||
const response = await fetch(`${baseUrl}/v1/models`);
|
const response = await fetch(`${baseUrl}/v1/models`);
|
||||||
@ -371,8 +379,8 @@ async function getLMStudioModels(): Promise<ModelInfo[]> {
|
|||||||
label: model.id,
|
label: model.id,
|
||||||
provider: 'LMStudio',
|
provider: 'LMStudio',
|
||||||
}));
|
}));
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
console.error('Error getting LMStudio models:', e);
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user