mirror of
https://github.com/labring/FastGPT.git
synced 2026-05-07 01:02:55 +08:00
V4.14.9 features (#6599)
* fix: image read and json error (Agent) (#6502) * fix: 1.image read 2.JSON parsing error * dataset cite and pause * perf: plancall second parse * add test --------- Co-authored-by: archer <545436317@qq.com> * master message * remove invalid code * feat(sre): integrate traces, logs, metrics into one sdk (#6580) * fix: image read and json error (Agent) (#6502) * fix: 1.image read 2.JSON parsing error * dataset cite and pause * perf: plancall second parse * add test --------- Co-authored-by: archer <545436317@qq.com> * master message * wip: otel sdk * feat(sre): integrate traces, logs, metrics into one sdk * fix(sre): use SpanStatusCode constants * fix(sre): clarify step memory measurement * update package * fix: ts --------- Co-authored-by: YeYuheng <57035043+YYH211@users.noreply.github.com> Co-authored-by: archer <545436317@qq.com> * doc * sandbox in agent (#6579) * doc * update template * fix: pr * fix: sdk package * update lock * update next * update dockerfile * dockerfile * dockerfile * update sdk version * update dockerefile * version --------- Co-authored-by: YeYuheng <57035043+YYH211@users.noreply.github.com> Co-authored-by: Ryo <whoeverimf5@gmail.com>
This commit is contained in:
@@ -80,7 +80,12 @@ const HumanContentCard = React.memo(
|
||||
<Flex flexDirection={'column'} gap={4}>
|
||||
{files.length > 0 && <FilesBlock files={files} />}
|
||||
{text && (
|
||||
<Box fontSize={'inherit'} color={'inherit'} whiteSpace={'pre-wrap'} wordBreak={'break-word'}>
|
||||
<Box
|
||||
fontSize={'inherit'}
|
||||
color={'inherit'}
|
||||
whiteSpace={'pre-wrap'}
|
||||
wordBreak={'break-word'}
|
||||
>
|
||||
{text}
|
||||
</Box>
|
||||
)}
|
||||
|
||||
@@ -46,7 +46,11 @@ const HumanItem = ({ chat }: { chat: UserChatItemType }) => {
|
||||
>
|
||||
<Flex flexDirection={'column'} gap={4}>
|
||||
{files.length > 0 && <FileBlock files={files} />}
|
||||
{text && <Box whiteSpace={'pre-wrap'} wordBreak={'break-word'}>{text}</Box>}
|
||||
{text && (
|
||||
<Box whiteSpace={'pre-wrap'} wordBreak={'break-word'}>
|
||||
{text}
|
||||
</Box>
|
||||
)}
|
||||
</Flex>
|
||||
</Box>
|
||||
<ChatAvatar type={ChatRoleEnum.Human} src={humanAvatar} />
|
||||
|
||||
@@ -28,7 +28,8 @@ export const HelperBotContext = createContext<HelperBotContextType>({
|
||||
taskObject: '',
|
||||
selectedTools: [],
|
||||
selectedDatasets: [],
|
||||
fileUpload: false
|
||||
fileUpload: false,
|
||||
enableSandbox: false
|
||||
},
|
||||
onApply: function (e): void {
|
||||
throw new Error('Function not implemented.');
|
||||
|
||||
@@ -28,6 +28,8 @@ export async function register() {
|
||||
{ initGeo },
|
||||
{ instrumentationCheck },
|
||||
{ getErrText },
|
||||
{ configureMetrics },
|
||||
{ configureTracing },
|
||||
{ configureLogger, getLogger, LogCategories },
|
||||
{ InitialErrorEnum }
|
||||
] = await Promise.all([
|
||||
@@ -49,10 +51,14 @@ export async function register() {
|
||||
import('@fastgpt/service/common/geo'),
|
||||
import('@/service/common/system/health'),
|
||||
import('@fastgpt/global/common/error/utils'),
|
||||
import('@fastgpt/service/common/metrics'),
|
||||
import('@fastgpt/service/common/tracing'),
|
||||
import('@fastgpt/service/common/logger'),
|
||||
import('@fastgpt/service/common/system/constants')
|
||||
]);
|
||||
|
||||
await configureMetrics();
|
||||
await configureTracing();
|
||||
await configureLogger();
|
||||
const logger = getLogger(LogCategories.SYSTEM);
|
||||
logger.info('Starting system initialization...');
|
||||
|
||||
@@ -78,6 +78,7 @@ const ChatTest = ({ appForm, setAppForm, setRenderEdit, form2WorkflowFn }: Props
|
||||
selectedTools: appForm.selectedTools.map((tool) => tool.id),
|
||||
selectedDatasets: appForm.dataset.datasets.map((dataset) => dataset.datasetId),
|
||||
fileUpload: appForm.chatConfig.fileSelectConfig?.canSelectFile || false,
|
||||
enableSandbox: appForm.aiSettings.useAgentSandbox || false,
|
||||
modelConfig: {
|
||||
model: appForm.aiSettings.model,
|
||||
temperature: appForm.aiSettings.temperature,
|
||||
@@ -153,6 +154,7 @@ const ChatTest = ({ appForm, setAppForm, setRenderEdit, form2WorkflowFn }: Props
|
||||
metadata={topAgentMetadata}
|
||||
onApply={async (formData) => {
|
||||
const fileUploadEnabled = !!formData.fileUploadEnabled;
|
||||
const enableSandboxEnabled = !!formData.enableSandboxEnabled;
|
||||
|
||||
// Filter internal tools
|
||||
const filteredToolIds = (formData.tools || []).filter(
|
||||
@@ -178,7 +180,8 @@ const ChatTest = ({ appForm, setAppForm, setRenderEdit, form2WorkflowFn }: Props
|
||||
: prev.dataset,
|
||||
aiSettings: {
|
||||
...prev.aiSettings,
|
||||
systemPrompt: formData.systemPrompt || prev.aiSettings.systemPrompt
|
||||
systemPrompt: formData.systemPrompt || prev.aiSettings.systemPrompt,
|
||||
useAgentSandbox: enableSandboxEnabled
|
||||
},
|
||||
chatConfig: {
|
||||
...prev.chatConfig,
|
||||
|
||||
@@ -99,7 +99,8 @@ const EditForm = ({
|
||||
appForm.chatConfig.fileSelectConfig?.canSelectAudio ||
|
||||
appForm.chatConfig.fileSelectConfig?.canSelectCustomFileExtension
|
||||
),
|
||||
hasSelectedDataset: (appForm.dataset.datasets?.length || 0) > 0
|
||||
hasSelectedDataset: (appForm.dataset.datasets?.length || 0) > 0,
|
||||
useAgentSandbox: !!appForm.aiSettings.useAgentSandbox
|
||||
});
|
||||
|
||||
const {
|
||||
|
||||
+32
-2
@@ -49,13 +49,15 @@ export const useSkillManager = ({
|
||||
onUpdateOrAddTool,
|
||||
onDeleteTool,
|
||||
canUploadFile,
|
||||
hasSelectedDataset
|
||||
hasSelectedDataset,
|
||||
useAgentSandbox
|
||||
}: {
|
||||
selectedTools: SelectedToolItemType[];
|
||||
onDeleteTool: (id: string) => void;
|
||||
onUpdateOrAddTool: (tool: SelectedToolItemType) => void;
|
||||
canUploadFile: boolean;
|
||||
hasSelectedDataset: boolean;
|
||||
useAgentSandbox: boolean;
|
||||
}) => {
|
||||
const { t, i18n } = useTranslation();
|
||||
const { toast } = useToast();
|
||||
@@ -109,6 +111,17 @@ export const useSkillManager = ({
|
||||
});
|
||||
}
|
||||
|
||||
const sandboxToolInfo = systemSubInfo[SubAppIds.sandboxTool];
|
||||
if (sandboxToolInfo) {
|
||||
apiTools.unshift({
|
||||
id: SubAppIds.sandboxTool,
|
||||
label: parseI18nString(sandboxToolInfo.name, i18n.language),
|
||||
icon: sandboxToolInfo.avatar,
|
||||
description: sandboxToolInfo.toolDescription,
|
||||
canClick: true
|
||||
});
|
||||
}
|
||||
|
||||
return apiTools;
|
||||
},
|
||||
{
|
||||
@@ -324,8 +337,25 @@ export const useSkillManager = ({
|
||||
});
|
||||
}
|
||||
|
||||
// Merge sandbox tool
|
||||
const sandboxToolInfo = systemSubInfo[SubAppIds.sandboxTool];
|
||||
if (sandboxToolInfo) {
|
||||
tools.push({
|
||||
id: SubAppIds.sandboxTool,
|
||||
pluginId: SubAppIds.sandboxTool,
|
||||
name: parseI18nString(sandboxToolInfo.name, i18n.language),
|
||||
avatar: sandboxToolInfo.avatar,
|
||||
intro: sandboxToolInfo.toolDescription,
|
||||
flowNodeType: FlowNodeTypeEnum.tool,
|
||||
templateType: FlowNodeTemplateTypeEnum.tools,
|
||||
inputs: [],
|
||||
outputs: [],
|
||||
configStatus: useAgentSandbox ? 'noConfig' : 'invalid'
|
||||
});
|
||||
}
|
||||
|
||||
return tools;
|
||||
}, [selectedTools, canUploadFile, hasSelectedDataset, i18n.language]);
|
||||
}, [selectedTools, canUploadFile, hasSelectedDataset, useAgentSandbox, i18n.language]);
|
||||
|
||||
const [configTool, setConfigTool] = useState<SelectedToolItemType>();
|
||||
const onClickSkill = useCallback(
|
||||
|
||||
+2
-4
@@ -223,12 +223,10 @@ const NodeCard = (props: Props) => {
|
||||
// 1. MCP tool, HTTP tool set and system tool set do not have version
|
||||
if (
|
||||
isAppNode &&
|
||||
(
|
||||
node.toolConfig?.mcpToolSet ||
|
||||
(node.toolConfig?.mcpToolSet ||
|
||||
node.toolConfig?.mcpTool ||
|
||||
node?.toolConfig?.httpToolSet ||
|
||||
node?.toolConfig?.systemToolSet
|
||||
)
|
||||
node?.toolConfig?.systemToolSet)
|
||||
)
|
||||
return false;
|
||||
// 2. Team app/System commercial plugin
|
||||
|
||||
Reference in New Issue
Block a user