@ax-llm/ax 10.0.32 → 10.0.35
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 +24 -25
- package/index.cjs.map +1 -1
- package/index.d.cts +2 -2
- package/index.d.ts +2 -2
- package/index.js +24 -25
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.cjs
CHANGED
|
@@ -2204,7 +2204,7 @@ var AxAIGoogleGeminiImpl = class {
|
|
|
2204
2204
|
throw new Error("Chat prompt is empty");
|
|
2205
2205
|
}
|
|
2206
2206
|
const apiConfig = {
|
|
2207
|
-
name: stream ? `/models/${model}:streamGenerateContent?alt=sse` : `/models/${model}:
|
|
2207
|
+
name: stream ? `/models/${model}:streamGenerateContent?alt=sse` : `/models/${model}:generateContent`
|
|
2208
2208
|
};
|
|
2209
2209
|
if (this.isVertex === false) {
|
|
2210
2210
|
const pf = stream ? "&" : "?";
|
|
@@ -2521,23 +2521,23 @@ var AxRateLimiterTokenUsage = class {
|
|
|
2521
2521
|
// ai/groq/types.ts
|
|
2522
2522
|
var AxAIGroqModel = /* @__PURE__ */ ((AxAIGroqModel2) => {
|
|
2523
2523
|
AxAIGroqModel2["Llama3_8B"] = "llama3-8b-8192";
|
|
2524
|
-
AxAIGroqModel2["
|
|
2524
|
+
AxAIGroqModel2["Llama33_70B"] = "llama-3.3-70b-versatile";
|
|
2525
2525
|
AxAIGroqModel2["Mixtral_8x7B"] = "mixtral-8x7b-32768";
|
|
2526
|
-
AxAIGroqModel2["
|
|
2526
|
+
AxAIGroqModel2["Gemma2_9B"] = "gemma2-9b-it";
|
|
2527
2527
|
return AxAIGroqModel2;
|
|
2528
2528
|
})(AxAIGroqModel || {});
|
|
2529
2529
|
|
|
2530
2530
|
// ai/groq/info.ts
|
|
2531
2531
|
var axModelInfoGroq = [
|
|
2532
2532
|
{
|
|
2533
|
-
name: "
|
|
2533
|
+
name: "gemma2-9b-it" /* Gemma2_9B */,
|
|
2534
2534
|
currency: "usd",
|
|
2535
2535
|
characterIsToken: true,
|
|
2536
2536
|
promptTokenCostPer1M: 0.2,
|
|
2537
2537
|
completionTokenCostPer1M: 0.2
|
|
2538
2538
|
},
|
|
2539
2539
|
{
|
|
2540
|
-
name: "
|
|
2540
|
+
name: "llama-3.3-70b-versatile" /* Llama33_70B */,
|
|
2541
2541
|
currency: "usd",
|
|
2542
2542
|
characterIsToken: true,
|
|
2543
2543
|
promptTokenCostPer1M: 0.59,
|
|
@@ -2561,7 +2561,7 @@ var axModelInfoGroq = [
|
|
|
2561
2561
|
|
|
2562
2562
|
// ai/groq/api.ts
|
|
2563
2563
|
var axAIGroqDefaultConfig = () => structuredClone({
|
|
2564
|
-
model: "
|
|
2564
|
+
model: "llama-3.3-70b-versatile" /* Llama33_70B */,
|
|
2565
2565
|
...axBaseAIDefaultConfig()
|
|
2566
2566
|
});
|
|
2567
2567
|
var AxAIGroq = class extends AxAIOpenAI {
|
|
@@ -3316,8 +3316,8 @@ var AxAssertionError = class extends Error {
|
|
|
3316
3316
|
getFixingInstructions = (_sig) => {
|
|
3317
3317
|
const extraFields = [];
|
|
3318
3318
|
extraFields.push({
|
|
3319
|
-
name: "
|
|
3320
|
-
title: "
|
|
3319
|
+
name: "error",
|
|
3320
|
+
title: "Error",
|
|
3321
3321
|
description: this.message
|
|
3322
3322
|
});
|
|
3323
3323
|
return extraFields;
|
|
@@ -4104,15 +4104,17 @@ var AxProgram = class {
|
|
|
4104
4104
|
};
|
|
4105
4105
|
|
|
4106
4106
|
// dsp/prompt.ts
|
|
4107
|
+
var functionCallInstructions = `
|
|
4108
|
+
## Function Call Instructions
|
|
4109
|
+
- Complete the task, using the functions defined earlier in this prompt.
|
|
4110
|
+
- Call functions step-by-step, using the output of one function as input to the next.
|
|
4111
|
+
- Use the function results to generate the output fields.`;
|
|
4107
4112
|
var formattingRules = `
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
5. Match the exact structure and format specifications for each field
|
|
4114
|
-
6. No preamble, postscript, or supplementary information
|
|
4115
|
-
7. Pure output only - conforming exactly to the documented requirements`;
|
|
4113
|
+
## Output Formatting Rules
|
|
4114
|
+
- Each output key, value must strictly adhere to the specified output field formatting rules.
|
|
4115
|
+
- No preamble, postscript, or supplementary information.
|
|
4116
|
+
- Output must be in plain text, with each \`key: value\` pair on a new line.
|
|
4117
|
+
- Do not repeat output fields.`;
|
|
4116
4118
|
var AxPromptTemplate = class {
|
|
4117
4119
|
sig;
|
|
4118
4120
|
fieldTemplates;
|
|
@@ -4129,14 +4131,11 @@ var AxPromptTemplate = class {
|
|
|
4129
4131
|
(f) => "toFunction" in f ? f.toFunction() : f
|
|
4130
4132
|
);
|
|
4131
4133
|
const funcList = funcs?.map(
|
|
4132
|
-
(fn) => `- \`${fn.name}\`: ${capitalizeFirstLetter(fn.description)}
|
|
4134
|
+
(fn) => `- \`${fn.name}\`: ${capitalizeFirstLetter(fn.description)}.`
|
|
4133
4135
|
).join("\n");
|
|
4134
4136
|
if (funcList && funcList.length > 0) {
|
|
4135
4137
|
task.push(`## Available Functions
|
|
4136
4138
|
${funcList}`);
|
|
4137
|
-
task.push(
|
|
4138
|
-
`Complete the task, using the functions defined earlier in this prompt, as needed. The output field values may be generated by applying these functions if appropriate for the task.`
|
|
4139
|
-
);
|
|
4140
4139
|
}
|
|
4141
4140
|
const inputFields = this.renderFields(this.sig.getInputFields());
|
|
4142
4141
|
task.push(`## Input Fields
|
|
@@ -4144,10 +4143,10 @@ ${inputFields}`);
|
|
|
4144
4143
|
const outputFields = this.renderFields(this.sig.getOutputFields());
|
|
4145
4144
|
task.push(`## Output Fields
|
|
4146
4145
|
${outputFields}`);
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
task.push(formattingRules);
|
|
4146
|
+
if (funcList && funcList.length > 0) {
|
|
4147
|
+
task.push(functionCallInstructions.trim());
|
|
4148
|
+
}
|
|
4149
|
+
task.push(formattingRules.trim());
|
|
4151
4150
|
const desc = this.sig.getDescription();
|
|
4152
4151
|
if (desc) {
|
|
4153
4152
|
task.push(
|
|
@@ -4373,7 +4372,7 @@ ${capitalizeFirstLetter(desc.endsWith(".") ? desc : desc + ".")}`
|
|
|
4373
4372
|
const type = field.type?.name ? toFieldType(field.type) : "string";
|
|
4374
4373
|
const required = field.isOptional ? "optional" : "required";
|
|
4375
4374
|
const description = field.description ? `: ${capitalizeFirstLetter(field.description)}` : "";
|
|
4376
|
-
return `- \`${name}\` (${type}, ${required})${description}
|
|
4375
|
+
return `- \`${name}\` (${type}, ${required})${description}.`.trim();
|
|
4377
4376
|
});
|
|
4378
4377
|
return rows.join("\n");
|
|
4379
4378
|
};
|