Skip to content

Commit 54c8d57

Browse files
author
Jicheng Lu
committed
add constants
1 parent 10219a3 commit 54c8d57

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/lib/helpers/constants.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ export const FILE_EDITORS = [
3939

4040
export const LEARNER_AGENT_ID = "01acc3e5-0af7-49e6-ad7a-a760bd12dc40";
4141
export const EVALUATOR_AGENT_ID = "2cd4b805-7078-4405-87e9-2ec9aadf8a11";
42+
export const AI_PROGRAMMER_AGENT_ID = "c2a2faf6-b8b5-47fe-807b-f4714cf25dd4";
43+
export const RULE_TRIGGER_CODE_GENERATE_TEMPLATE = "rule-trigger-code-generate_instruction";
4244

4345
export const TRAINING_MODE = "training";
4446
export const DEFAULT_KNOWLEDGE_COLLECTION = "BotSharp";

src/routes/page/agent/[agentId]/agent-components/agent-rule.svelte

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import Markdown from '$lib/common/markdown/Markdown.svelte';
77
import BotsharpTooltip from '$lib/common/tooltip/BotsharpTooltip.svelte';
88
import LoadingToComplete from '$lib/common/LoadingToComplete.svelte';
9-
import { ADMIN_ROLES } from '$lib/helpers/constants';
9+
import { ADMIN_ROLES, AI_PROGRAMMER_AGENT_ID, RULE_TRIGGER_CODE_GENERATE_TEMPLATE } from '$lib/helpers/constants';
1010
import { AgentCodeScriptType } from '$lib/helpers/enums';
1111
1212
const limit = 100;
@@ -191,17 +191,17 @@
191191
return new Promise((resolve, reject) => {
192192
isLoading = true;
193193
generateAgentCodeScript(agent.id, {
194-
text: rule.criteria,
194+
text: '',
195195
options: {
196+
agent_id: AI_PROGRAMMER_AGENT_ID,
197+
template_name: RULE_TRIGGER_CODE_GENERATE_TEMPLATE,
196198
save_to_db: true,
197199
script_name: `${rule.trigger_name}_rule.py`,
198200
script_type: AgentCodeScriptType.Src,
199201
data: {
200-
'rule_args': { ...rule.output_args }
202+
'args_example': { ...rule.output_args },
203+
'user_request': rule.criteria
201204
}
202-
// to do:
203-
// agent_id: agent.id,
204-
// template_name: "rule"
205205
}
206206
}).then(res => {
207207
if (res?.success) {

0 commit comments

Comments
 (0)