@ax-llm/ax 11.0.12 → 11.0.13
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/index.cjs +9 -8
- package/index.cjs.map +1 -1
- package/index.js +9 -8
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -4743,16 +4743,10 @@ var AxPromptTemplate = class {
|
|
|
4743
4743
|
this.sig = sig;
|
|
4744
4744
|
this.fieldTemplates = fieldTemplates;
|
|
4745
4745
|
const task = [];
|
|
4746
|
-
const desc = this.sig.getDescription();
|
|
4747
|
-
if (desc) {
|
|
4748
|
-
const capitalized = capitalizeFirstLetter(desc.trim());
|
|
4749
|
-
task.push(capitalized.endsWith(".") ? capitalized : capitalized + ".");
|
|
4750
|
-
}
|
|
4751
4746
|
const inArgs = this.renderDescFields(this.sig.getInputFields());
|
|
4752
4747
|
const outArgs = this.renderDescFields(this.sig.getOutputFields());
|
|
4753
4748
|
task.push(
|
|
4754
|
-
|
|
4755
|
-
You will be provided with the following fields: ${inArgs}. Your task is to generate new fields: ${outArgs}.`
|
|
4749
|
+
`You will be provided with the following fields: ${inArgs}. Your task is to generate new fields: ${outArgs}.`
|
|
4756
4750
|
);
|
|
4757
4751
|
const funcs = functions?.map(
|
|
4758
4752
|
(f) => "toFunction" in f ? f.toFunction() : f
|
|
@@ -4774,6 +4768,13 @@ ${outputFields}`);
|
|
|
4774
4768
|
task.push(functionCallInstructions.trim());
|
|
4775
4769
|
}
|
|
4776
4770
|
task.push(formattingRules.trim());
|
|
4771
|
+
const desc = this.sig.getDescription();
|
|
4772
|
+
if (desc) {
|
|
4773
|
+
const capitalized = capitalizeFirstLetter(desc.trim());
|
|
4774
|
+
const text = capitalized.endsWith(".") ? capitalized : capitalized + ".";
|
|
4775
|
+
task.push(`---
|
|
4776
|
+
${text}`);
|
|
4777
|
+
}
|
|
4777
4778
|
this.task = {
|
|
4778
4779
|
type: "text",
|
|
4779
4780
|
text: task.join("\n\n")
|
|
@@ -5018,7 +5019,7 @@ ${outputFields}`);
|
|
|
5018
5019
|
const type = field.type?.name ? toFieldType(field.type) : "string";
|
|
5019
5020
|
const required = field.isOptional ? "optional" : "required";
|
|
5020
5021
|
const description = field.description ? `: ${capitalizeFirstLetter(field.description)}` : "";
|
|
5021
|
-
return `- \`${name}
|
|
5022
|
+
return `- \`${name}:\` (${type}, ${required}) ${description}.`.trim();
|
|
5022
5023
|
});
|
|
5023
5024
|
return rows.join("\n");
|
|
5024
5025
|
};
|