mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-22 20:37:48 +00:00
Perf ui detail (#2775)
* perf: tool response tip * perf: image extract * perf: user question tool desc * fix: simple mode load app module * perf: simple mode plugin version * perf: share page reload * refresh simple mode data
This commit is contained in:
@@ -178,6 +178,11 @@ export const loadRequestMessages = async ({
|
||||
});
|
||||
});
|
||||
|
||||
// Too many images or too long text, return text
|
||||
if (httpsImages.length > 4 || input.length > 1000) {
|
||||
return [{ type: 'text', text: input || '' }];
|
||||
}
|
||||
|
||||
// 添加原始input作为文本
|
||||
result.push({ type: 'text', text: input });
|
||||
return result;
|
||||
|
@@ -255,17 +255,6 @@ export const runToolWithFunctionCall = async (
|
||||
];
|
||||
// console.log(tokens, 'tool');
|
||||
|
||||
// Run tool status
|
||||
if (node.showStatus) {
|
||||
workflowStreamResponse?.({
|
||||
event: SseResponseEventEnum.flowNodeStatus,
|
||||
data: {
|
||||
status: 'running',
|
||||
name: node.name
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// tool assistant
|
||||
const toolAssistants = toolsRunResponse
|
||||
.map((item) => {
|
||||
|
@@ -275,17 +275,6 @@ export const runToolWithPromptCall = async (
|
||||
};
|
||||
})();
|
||||
|
||||
// Run tool status
|
||||
if (node.showStatus) {
|
||||
workflowStreamResponse?.({
|
||||
event: SseResponseEventEnum.flowNodeStatus,
|
||||
data: {
|
||||
status: 'running',
|
||||
name: node.name
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 合并工具调用的结果,使用 functionCall 格式存储。
|
||||
const assistantToolMsgParams: ChatCompletionAssistantMessageParam = {
|
||||
role: ChatCompletionRequestMessageRoleEnum.Assistant,
|
||||
|
@@ -311,17 +311,6 @@ export const runToolWithToolChoice = async (
|
||||
|
||||
// console.log(tokens, 'tool');
|
||||
|
||||
// Run tool status
|
||||
if (node.showStatus) {
|
||||
workflowStreamResponse?.({
|
||||
event: SseResponseEventEnum.flowNodeStatus,
|
||||
data: {
|
||||
status: 'running',
|
||||
name: node.name
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// tool assistant
|
||||
const toolAssistants = toolsRunResponse
|
||||
.map((item) => {
|
||||
|
@@ -497,7 +497,7 @@ export async function dispatchWorkFlow(data: Props): Promise<DispatchFlowRespons
|
||||
result: Record<string, any>;
|
||||
}> {
|
||||
// push run status messages
|
||||
if (node.showStatus) {
|
||||
if (node.showStatus && !props.isToolCall) {
|
||||
props.workflowStreamResponse?.({
|
||||
event: SseResponseEventEnum.flowNodeStatus,
|
||||
data: {
|
||||
|
Reference in New Issue
Block a user