Skip to content

Commit da7639c

Browse files
authored
πŸ› When creating a sub-agent, the prompt content needs to be cleared. #641
2 parents d4765f5 + 47f787f commit da7639c

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

β€Žfrontend/app/[locale]/setup/agentSetup/AgentManagementConfig.tsxβ€Ž

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@ export default function BusinessLogicConfig({
774774
try {
775775
const result = await getCreatingSubAgentId(mainAgentId);
776776
if (result.success && result.data) {
777-
const { agentId, enabledToolIds, modelName, maxSteps, businessDescription, prompt } = result.data;
777+
const { agentId, enabledToolIds, modelName, maxSteps, businessDescription, dutyPrompt, constraintPrompt, fewShotsPrompt } = result.data;
778778

779779
// Update the main agent ID
780780
setMainAgentId(agentId);
@@ -792,9 +792,17 @@ export default function BusinessLogicConfig({
792792
if (businessDescription) {
793793
setBusinessLogic(businessDescription);
794794
}
795-
// Update the system prompt
796-
if (prompt) {
797-
setSystemPrompt(prompt);
795+
// Update the duty prompt
796+
if (setDutyContent) {
797+
setDutyContent(dutyPrompt || '');
798+
}
799+
// Update the constraint prompt
800+
if (setConstraintContent) {
801+
setConstraintContent(constraintPrompt || '');
802+
}
803+
// Update the few shots prompt
804+
if (setFewShotsContent) {
805+
setFewShotsContent(fewShotsPrompt || '');
798806
}
799807
} else {
800808
message.error(result.message || t('businessLogic.config.error.agentIdFailed'));

β€Žfrontend/services/agentConfigService.tsβ€Ž

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ export const getCreatingSubAgentId = async (mainAgentId: string | null) => {
163163
modelName: data.model_name,
164164
maxSteps: data.max_steps,
165165
businessDescription: data.business_description,
166-
prompt: data.prompt
166+
dutyPrompt: data.duty_prompt,
167+
constraintPrompt: data.constraint_prompt,
168+
fewShotsPrompt: data.few_shots_prompt
167169
},
168170
message: ''
169171
};

0 commit comments

Comments
Β (0)