) => {
case 'csv':
return readCsvRawText(params);
default:
- return Promise.reject('Only support .txt, .md, .html, .pdf, .docx, pptx, .csv, .xlsx');
+ return Promise.reject(
+ `Only support .txt, .md, .html, .pdf, .docx, pptx, .csv, .xlsx. "${params.extension}" is not supported.`
+ );
}
};
diff --git a/projects/app/src/pageComponents/account/model/Channel/index.tsx b/projects/app/src/pageComponents/account/model/Channel/index.tsx
index 0f6ed2142..795cfd521 100644
--- a/projects/app/src/pageComponents/account/model/Channel/index.tsx
+++ b/projects/app/src/pageComponents/account/model/Channel/index.tsx
@@ -139,14 +139,14 @@ const ChannelTable = ({ Tab }: { Tab: React.ReactNode }) => {
{
const val = (() => {
- if (!e) return 0;
+ if (!e) return 1;
return e;
})();
updateChannel({
diff --git a/projects/app/src/web/core/ai/channel.ts b/projects/app/src/web/core/ai/channel.ts
index b7a10061b..fd4534a3f 100644
--- a/projects/app/src/web/core/ai/channel.ts
+++ b/projects/app/src/web/core/ai/channel.ts
@@ -130,7 +130,8 @@ export const postCreateChannel = (data: CreateChannelProps) =>
base_url: data.base_url,
models: data.models,
model_mapping: data.model_mapping,
- key: data.key
+ key: data.key,
+ priority: 1
});
export const putChannelStatus = (id: number, status: ChannelStatusEnum) =>
@@ -146,7 +147,7 @@ export const putChannel = (data: ChannelInfoType) =>
model_mapping: data.model_mapping,
key: data.key,
status: data.status,
- priority: data.priority
+ priority: data.priority ? Math.max(data.priority, 1) : undefined
});
export const deleteChannel = (id: number) => DELETE(`/channel/${id}`);
|