4.7 doc update (#1068)
* fix: plugin update * feat: get current time plugin * fix: ts * perf: select app ux * fix: ts * perf: max w * move code * perf: inform tip * fix: inform * doc * fix: tool handle * perf: tmp file store * doc * fix: message file selector * feat: doc * perf: switch trigger * doc * fix: openapi import * rount the number * parse openapi schema * fix empty line after variables (#64) * doc image * image size * doc * doc * catch error --------- Co-authored-by: heheer <71265218+newfish-cmyk@users.noreply.github.com>
This commit is contained in:
@@ -23,6 +23,8 @@ type StreamResponseType = {
|
||||
responseText: string;
|
||||
[DispatchNodeResponseKeyEnum.nodeResponse]: ChatHistoryItemResType[];
|
||||
};
|
||||
class FatalError extends Error {}
|
||||
|
||||
export const streamFetch = ({
|
||||
url = '/api/v1/chat/completions',
|
||||
data,
|
||||
@@ -206,9 +208,12 @@ export const streamFetch = ({
|
||||
onclose() {
|
||||
finished = true;
|
||||
},
|
||||
onerror(e) {
|
||||
onerror(err) {
|
||||
if (err instanceof FatalError) {
|
||||
throw err;
|
||||
}
|
||||
clearTimeout(timeoutId);
|
||||
failedFinish(getErrText(e));
|
||||
failedFinish(getErrText(err));
|
||||
},
|
||||
openWhenHidden: true
|
||||
});
|
||||
|
||||
@@ -15,7 +15,10 @@ export function checkChatSupportSelectFileByChatModels(models: string[] = []) {
|
||||
}
|
||||
|
||||
export function checkChatSupportSelectFileByModules(modules: ModuleItemType[] = []) {
|
||||
const chatModules = modules.filter((item) => item.flowType === FlowNodeTypeEnum.chatNode);
|
||||
const chatModules = modules.filter(
|
||||
(item) =>
|
||||
item.flowType === FlowNodeTypeEnum.chatNode || item.flowType === FlowNodeTypeEnum.tools
|
||||
);
|
||||
const models: string[] = chatModules.map(
|
||||
(item) => item.inputs.find((item) => item.key === 'model')?.value || ''
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user