mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-07-17 09:56:06 +00:00
fix: lint code to build success
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { IDynamicFormItemSchema } from '@/app/infra/entities/form/dynamic';
|
||||
import { I18nLabel } from '@/app/infra/entities/common';
|
||||
import { PipelineConfigTab } from '@/app/infra/entities/pipeline';
|
||||
|
||||
export interface ApiResponse<T> {
|
||||
@@ -32,7 +31,7 @@ export interface Requester {
|
||||
icon?: string;
|
||||
spec: {
|
||||
config: IDynamicFormItemSchema[];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export interface ApiRespProviderLLMModels {
|
||||
@@ -307,4 +306,4 @@ export interface GetPipelineResponseData {
|
||||
|
||||
export interface GetPipelineMetadataResponseData {
|
||||
configs: PipelineConfigTab[];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
import { I18nLabel } from '@/app/infra/entities/common';
|
||||
|
||||
export interface IDynamicFormItemSchema {
|
||||
id: string;
|
||||
default: string | number | boolean | Array<unknown>;
|
||||
label: I18nLabel;
|
||||
name: string;
|
||||
required: boolean;
|
||||
type: DynamicFormItemType;
|
||||
description?: I18nLabel;
|
||||
options?: IDynamicFormItemOption[];
|
||||
}
|
||||
id: string;
|
||||
default: string | number | boolean | Array<unknown>;
|
||||
label: I18nLabel;
|
||||
name: string;
|
||||
required: boolean;
|
||||
type: DynamicFormItemType;
|
||||
description?: I18nLabel;
|
||||
options?: IDynamicFormItemOption[];
|
||||
}
|
||||
|
||||
export enum DynamicFormItemType {
|
||||
INT = 'integer',
|
||||
FLOAT = 'float',
|
||||
BOOLEAN = 'boolean',
|
||||
STRING = 'string',
|
||||
STRING_ARRAY = 'array[string]',
|
||||
SELECT = 'select',
|
||||
LLM_MODEL_SELECTOR = 'llm-model-selector',
|
||||
PROMPT_EDITOR = 'prompt-editor',
|
||||
UNKNOWN = 'unknown',
|
||||
}
|
||||
INT = 'integer',
|
||||
FLOAT = 'float',
|
||||
BOOLEAN = 'boolean',
|
||||
STRING = 'string',
|
||||
STRING_ARRAY = 'array[string]',
|
||||
SELECT = 'select',
|
||||
LLM_MODEL_SELECTOR = 'llm-model-selector',
|
||||
PROMPT_EDITOR = 'prompt-editor',
|
||||
UNKNOWN = 'unknown',
|
||||
}
|
||||
|
||||
export interface IDynamicFormItemOption {
|
||||
name: string;
|
||||
label: I18nLabel;
|
||||
}
|
||||
name: string;
|
||||
label: I18nLabel;
|
||||
}
|
||||
|
||||
@@ -20,4 +20,4 @@ export interface PipelineConfigStage {
|
||||
label: I18nLabel;
|
||||
description?: I18nLabel;
|
||||
config: IDynamicFormItemSchema[];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,10 +28,8 @@ import {
|
||||
MarketPluginResponse,
|
||||
GetPipelineResponseData,
|
||||
GetPipelineMetadataResponseData,
|
||||
AsyncTask
|
||||
AsyncTask,
|
||||
} from '@/app/infra/entities/api';
|
||||
import { toast } from "sonner"
|
||||
|
||||
|
||||
type JSONValue = string | number | boolean | JSONObject | JSONArray | null;
|
||||
interface JSONObject {
|
||||
@@ -130,9 +128,8 @@ class HttpClient {
|
||||
|
||||
switch (status) {
|
||||
case 401:
|
||||
|
||||
console.log('401 error: ', errMessage, error.request);
|
||||
console.log('responseURL', error.request.responseURL)
|
||||
console.log('responseURL', error.request.responseURL);
|
||||
localStorage.removeItem('token');
|
||||
if (!error.request.responseURL.includes('/check-token')) {
|
||||
window.location.href = '/login';
|
||||
@@ -231,7 +228,10 @@ class HttpClient {
|
||||
}
|
||||
|
||||
public getProviderRequesterIconURL(name: string): string {
|
||||
return this.instance.defaults.baseURL + `/api/v1/provider/requesters/${name}/icon`;
|
||||
return (
|
||||
this.instance.defaults.baseURL +
|
||||
`/api/v1/provider/requesters/${name}/icon`
|
||||
);
|
||||
}
|
||||
|
||||
// ============ Provider Model LLM ============
|
||||
@@ -289,7 +289,9 @@ class HttpClient {
|
||||
}
|
||||
|
||||
public getAdapterIconURL(name: string): string {
|
||||
return this.instance.defaults.baseURL + `/api/v1/platform/adapters/${name}/icon`;
|
||||
return (
|
||||
this.instance.defaults.baseURL + `/api/v1/platform/adapters/${name}/icon`
|
||||
);
|
||||
}
|
||||
|
||||
// ============ Platform Bots ============
|
||||
@@ -418,7 +420,7 @@ class HttpClient {
|
||||
}
|
||||
|
||||
// export const httpClient = new HttpClient("https://version-4.langbot.dev");
|
||||
export const httpClient = new HttpClient("http://localhost:5300");
|
||||
export const httpClient = new HttpClient('http://localhost:5300');
|
||||
|
||||
// 临时写法,未来两种Client都继承自HttpClient父类,不允许共享方法
|
||||
export const spaceClient = new HttpClient('https://space.langbot.app');
|
||||
|
||||
Reference in New Issue
Block a user