@ax-llm/ax 10.0.31 → 10.0.34

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 CHANGED
@@ -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["Llama3_70B"] = "llama3-70b-8192";
2524
+ AxAIGroqModel2["Llama33_70B"] = "llama-3.3-70b-versatile";
2525
2525
  AxAIGroqModel2["Mixtral_8x7B"] = "mixtral-8x7b-32768";
2526
- AxAIGroqModel2["Gemma_7B"] = "gemma-7b-it";
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: "gemma-7b-it" /* Gemma_7B */,
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: "llama3-70b-8192" /* Llama3_70B */,
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: "llama3-70b-8192" /* Llama3_70B */,
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: "instructions",
3320
- title: "Instructions",
3319
+ name: "error",
3320
+ title: "Error",
3321
3321
  description: this.message
3322
3322
  });
3323
3323
  return extraFields;
@@ -3369,7 +3369,9 @@ var assertStreamingAssertions = (asserts, values, xstate, content, final) => {
3369
3369
  };
3370
3370
  var assertRequiredFields = (sig, values) => {
3371
3371
  const fields = sig.getOutputFields();
3372
- const missingFields = fields.filter((f) => !(f.name in values));
3372
+ const missingFields = fields.filter(
3373
+ (f) => !f.isOptional && !(f.name in values)
3374
+ );
3373
3375
  if (missingFields.length > 0) {
3374
3376
  throw new AxAssertionError({
3375
3377
  message: `Output must include: ${missingFields.map((f) => `\`${f.title}:\``).join(", ")}`,
@@ -4102,15 +4104,17 @@ var AxProgram = class {
4102
4104
  };
4103
4105
 
4104
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.`;
4105
4112
  var formattingRules = `
4106
- When providing responses:
4107
- 1. Only output the exact requested content - no additional text, commentary, explanations, or clarifications
4108
- 2. Each key's value must strictly adhere to the formatting rules specified in the reference documentation
4109
- 3. Follow all formatting conventions precisely as defined
4110
- 4. Do not add any extra content beyond what is explicitly requested
4111
- 5. Match the exact structure and format specifications for each field
4112
- 6. No preamble, postscript, or supplementary information
4113
- 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.`;
4114
4118
  var AxPromptTemplate = class {
4115
4119
  sig;
4116
4120
  fieldTemplates;
@@ -4127,14 +4131,11 @@ var AxPromptTemplate = class {
4127
4131
  (f) => "toFunction" in f ? f.toFunction() : f
4128
4132
  );
4129
4133
  const funcList = funcs?.map(
4130
- (fn) => `- \`${fn.name}\`: ${capitalizeFirstLetter(fn.description)}`
4134
+ (fn) => `- \`${fn.name}\`: ${capitalizeFirstLetter(fn.description)}.`
4131
4135
  ).join("\n");
4132
4136
  if (funcList && funcList.length > 0) {
4133
4137
  task.push(`## Available Functions
4134
4138
  ${funcList}`);
4135
- task.push(
4136
- `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.`
4137
- );
4138
4139
  }
4139
4140
  const inputFields = this.renderFields(this.sig.getInputFields());
4140
4141
  task.push(`## Input Fields
@@ -4142,10 +4143,10 @@ ${inputFields}`);
4142
4143
  const outputFields = this.renderFields(this.sig.getOutputFields());
4143
4144
  task.push(`## Output Fields
4144
4145
  ${outputFields}`);
4145
- task.push(
4146
- "Output must be in plain text, with each `key: value` pair on a new line. The format of each `value` should strictly adhere to the formatting instructions for its corresponding `key`, as defined earlier in this prompt."
4147
- );
4148
- task.push(formattingRules);
4146
+ if (funcList && funcList.length > 0) {
4147
+ task.push(functionCallInstructions.trim());
4148
+ }
4149
+ task.push(formattingRules.trim());
4149
4150
  const desc = this.sig.getDescription();
4150
4151
  if (desc) {
4151
4152
  task.push(
@@ -4371,7 +4372,7 @@ ${capitalizeFirstLetter(desc.endsWith(".") ? desc : desc + ".")}`
4371
4372
  const type = field.type?.name ? toFieldType(field.type) : "string";
4372
4373
  const required = field.isOptional ? "optional" : "required";
4373
4374
  const description = field.description ? `: ${capitalizeFirstLetter(field.description)}` : "";
4374
- return `- \`${name}\` (${type}, ${required})${description}`.trim();
4375
+ return `- \`${name}\` (${type}, ${required})${description}.`.trim();
4375
4376
  });
4376
4377
  return rows.join("\n");
4377
4378
  };