@voltagent/core 1.2.9 → 1.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -5142,6 +5142,10 @@ declare class Agent {
5142
5142
  * Add toolkit instructions
5143
5143
  */
5144
5144
  private addToolkitInstructions;
5145
+ /**
5146
+ * Enrich instructions with additional context and modifiers
5147
+ */
5148
+ private enrichInstructions;
5145
5149
  /**
5146
5150
  * Prepare agents memory for supervisor
5147
5151
  */
package/dist/index.d.ts CHANGED
@@ -5142,6 +5142,10 @@ declare class Agent {
5142
5142
  * Add toolkit instructions
5143
5143
  */
5144
5144
  private addToolkitInstructions;
5145
+ /**
5146
+ * Enrich instructions with additional context and modifiers
5147
+ */
5148
+ private enrichInstructions;
5145
5149
  /**
5146
5150
  * Prepare agents memory for supervisor
5147
5151
  */
package/dist/index.js CHANGED
@@ -18086,37 +18086,51 @@ ${additionalContext}`
18086
18086
  return messages;
18087
18087
  }
18088
18088
  if (promptContent.type === "text") {
18089
- let content2 = promptContent.text || "";
18090
- content2 = this.addToolkitInstructions(content2);
18091
- if (this.markdown) {
18092
- content2 = `${content2}
18093
-
18094
- Use markdown to format your answers.`;
18095
- }
18096
- if (retrieverContext) {
18097
- content2 = `${content2}
18098
-
18099
- Relevant Context:
18100
- ${retrieverContext}`;
18101
- }
18102
- if (workingMemoryContext) {
18103
- content2 = `${content2}${workingMemoryContext}`;
18104
- }
18105
- if (this.subAgentManager.hasSubAgents()) {
18106
- const agentsMemory = await this.prepareAgentsMemory(oc);
18107
- content2 = this.subAgentManager.generateSupervisorSystemMessage(
18108
- content2,
18109
- agentsMemory,
18110
- this.supervisorConfig
18111
- );
18112
- }
18089
+ const baseContent2 = promptContent.text || "";
18090
+ const content2 = await this.enrichInstructions(
18091
+ baseContent2,
18092
+ retrieverContext,
18093
+ workingMemoryContext,
18094
+ oc
18095
+ );
18113
18096
  return {
18114
18097
  role: "system",
18115
18098
  content: `You are ${this.name}. ${content2}`
18116
18099
  };
18117
18100
  }
18118
18101
  }
18119
- let content = typeof resolvedInstructions === "string" ? resolvedInstructions : "";
18102
+ const baseContent = typeof resolvedInstructions === "string" ? resolvedInstructions : "";
18103
+ const content = await this.enrichInstructions(
18104
+ baseContent,
18105
+ retrieverContext,
18106
+ workingMemoryContext,
18107
+ oc
18108
+ );
18109
+ return {
18110
+ role: "system",
18111
+ content: `You are ${this.name}. ${content}`
18112
+ };
18113
+ }
18114
+ /**
18115
+ * Add toolkit instructions
18116
+ */
18117
+ addToolkitInstructions(baseInstructions) {
18118
+ const toolkits = this.toolManager.getToolkits();
18119
+ let toolInstructions = "";
18120
+ for (const toolkit of toolkits) {
18121
+ if (toolkit.addInstructions && toolkit.instructions) {
18122
+ toolInstructions += `
18123
+
18124
+ ${toolkit.instructions}`;
18125
+ }
18126
+ }
18127
+ return baseInstructions + toolInstructions;
18128
+ }
18129
+ /**
18130
+ * Enrich instructions with additional context and modifiers
18131
+ */
18132
+ async enrichInstructions(baseContent, retrieverContext, workingMemoryContext, oc) {
18133
+ let content = baseContent;
18120
18134
  content = this.addToolkitInstructions(content);
18121
18135
  if (this.markdown) {
18122
18136
  content = `${content}
@@ -18140,25 +18154,7 @@ ${retrieverContext}`;
18140
18154
  this.supervisorConfig
18141
18155
  );
18142
18156
  }
18143
- return {
18144
- role: "system",
18145
- content: `You are ${this.name}. ${content}`
18146
- };
18147
- }
18148
- /**
18149
- * Add toolkit instructions
18150
- */
18151
- addToolkitInstructions(baseInstructions) {
18152
- const toolkits = this.toolManager.getToolkits();
18153
- let toolInstructions = "";
18154
- for (const toolkit of toolkits) {
18155
- if (toolkit.addInstructions && toolkit.instructions) {
18156
- toolInstructions += `
18157
-
18158
- ${toolkit.instructions}`;
18159
- }
18160
- }
18161
- return baseInstructions + toolInstructions;
18157
+ return content;
18162
18158
  }
18163
18159
  /**
18164
18160
  * Prepare agents memory for supervisor