@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.d.cts CHANGED
@@ -983,9 +983,9 @@ declare class AxAIGoogleGemini extends AxBaseAI<AxAIGoogleGeminiChatRequest, AxA
983
983
 
984
984
  declare enum AxAIGroqModel {
985
985
  Llama3_8B = "llama3-8b-8192",
986
- Llama3_70B = "llama3-70b-8192",
986
+ Llama33_70B = "llama-3.3-70b-versatile",
987
987
  Mixtral_8x7B = "mixtral-8x7b-32768",
988
- Gemma_7B = "gemma-7b-it"
988
+ Gemma2_9B = "gemma2-9b-it"
989
989
  }
990
990
 
991
991
  type AxAIGroqAIConfig = AxAIOpenAIConfig;
package/index.d.ts CHANGED
@@ -983,9 +983,9 @@ declare class AxAIGoogleGemini extends AxBaseAI<AxAIGoogleGeminiChatRequest, AxA
983
983
 
984
984
  declare enum AxAIGroqModel {
985
985
  Llama3_8B = "llama3-8b-8192",
986
- Llama3_70B = "llama3-70b-8192",
986
+ Llama33_70B = "llama-3.3-70b-versatile",
987
987
  Mixtral_8x7B = "mixtral-8x7b-32768",
988
- Gemma_7B = "gemma-7b-it"
988
+ Gemma2_9B = "gemma2-9b-it"
989
989
  }
990
990
 
991
991
  type AxAIGroqAIConfig = AxAIOpenAIConfig;
package/index.js CHANGED
@@ -2427,23 +2427,23 @@ var AxRateLimiterTokenUsage = class {
2427
2427
  // ai/groq/types.ts
2428
2428
  var AxAIGroqModel = /* @__PURE__ */ ((AxAIGroqModel2) => {
2429
2429
  AxAIGroqModel2["Llama3_8B"] = "llama3-8b-8192";
2430
- AxAIGroqModel2["Llama3_70B"] = "llama3-70b-8192";
2430
+ AxAIGroqModel2["Llama33_70B"] = "llama-3.3-70b-versatile";
2431
2431
  AxAIGroqModel2["Mixtral_8x7B"] = "mixtral-8x7b-32768";
2432
- AxAIGroqModel2["Gemma_7B"] = "gemma-7b-it";
2432
+ AxAIGroqModel2["Gemma2_9B"] = "gemma2-9b-it";
2433
2433
  return AxAIGroqModel2;
2434
2434
  })(AxAIGroqModel || {});
2435
2435
 
2436
2436
  // ai/groq/info.ts
2437
2437
  var axModelInfoGroq = [
2438
2438
  {
2439
- name: "gemma-7b-it" /* Gemma_7B */,
2439
+ name: "gemma2-9b-it" /* Gemma2_9B */,
2440
2440
  currency: "usd",
2441
2441
  characterIsToken: true,
2442
2442
  promptTokenCostPer1M: 0.2,
2443
2443
  completionTokenCostPer1M: 0.2
2444
2444
  },
2445
2445
  {
2446
- name: "llama3-70b-8192" /* Llama3_70B */,
2446
+ name: "llama-3.3-70b-versatile" /* Llama33_70B */,
2447
2447
  currency: "usd",
2448
2448
  characterIsToken: true,
2449
2449
  promptTokenCostPer1M: 0.59,
@@ -2467,7 +2467,7 @@ var axModelInfoGroq = [
2467
2467
 
2468
2468
  // ai/groq/api.ts
2469
2469
  var axAIGroqDefaultConfig = () => structuredClone({
2470
- model: "llama3-70b-8192" /* Llama3_70B */,
2470
+ model: "llama-3.3-70b-versatile" /* Llama33_70B */,
2471
2471
  ...axBaseAIDefaultConfig()
2472
2472
  });
2473
2473
  var AxAIGroq = class extends AxAIOpenAI {
@@ -3222,8 +3222,8 @@ var AxAssertionError = class extends Error {
3222
3222
  getFixingInstructions = (_sig) => {
3223
3223
  const extraFields = [];
3224
3224
  extraFields.push({
3225
- name: "instructions",
3226
- title: "Instructions",
3225
+ name: "error",
3226
+ title: "Error",
3227
3227
  description: this.message
3228
3228
  });
3229
3229
  return extraFields;
@@ -3275,7 +3275,9 @@ var assertStreamingAssertions = (asserts, values, xstate, content, final) => {
3275
3275
  };
3276
3276
  var assertRequiredFields = (sig, values) => {
3277
3277
  const fields = sig.getOutputFields();
3278
- const missingFields = fields.filter((f) => !(f.name in values));
3278
+ const missingFields = fields.filter(
3279
+ (f) => !f.isOptional && !(f.name in values)
3280
+ );
3279
3281
  if (missingFields.length > 0) {
3280
3282
  throw new AxAssertionError({
3281
3283
  message: `Output must include: ${missingFields.map((f) => `\`${f.title}:\``).join(", ")}`,
@@ -4008,15 +4010,17 @@ var AxProgram = class {
4008
4010
  };
4009
4011
 
4010
4012
  // dsp/prompt.ts
4013
+ var functionCallInstructions = `
4014
+ ## Function Call Instructions
4015
+ - Complete the task, using the functions defined earlier in this prompt.
4016
+ - Call functions step-by-step, using the output of one function as input to the next.
4017
+ - Use the function results to generate the output fields.`;
4011
4018
  var formattingRules = `
4012
- When providing responses:
4013
- 1. Only output the exact requested content - no additional text, commentary, explanations, or clarifications
4014
- 2. Each key's value must strictly adhere to the formatting rules specified in the reference documentation
4015
- 3. Follow all formatting conventions precisely as defined
4016
- 4. Do not add any extra content beyond what is explicitly requested
4017
- 5. Match the exact structure and format specifications for each field
4018
- 6. No preamble, postscript, or supplementary information
4019
- 7. Pure output only - conforming exactly to the documented requirements`;
4019
+ ## Output Formatting Rules
4020
+ - Each output key, value must strictly adhere to the specified output field formatting rules.
4021
+ - No preamble, postscript, or supplementary information.
4022
+ - Output must be in plain text, with each \`key: value\` pair on a new line.
4023
+ - Do not repeat output fields.`;
4020
4024
  var AxPromptTemplate = class {
4021
4025
  sig;
4022
4026
  fieldTemplates;
@@ -4033,14 +4037,11 @@ var AxPromptTemplate = class {
4033
4037
  (f) => "toFunction" in f ? f.toFunction() : f
4034
4038
  );
4035
4039
  const funcList = funcs?.map(
4036
- (fn) => `- \`${fn.name}\`: ${capitalizeFirstLetter(fn.description)}`
4040
+ (fn) => `- \`${fn.name}\`: ${capitalizeFirstLetter(fn.description)}.`
4037
4041
  ).join("\n");
4038
4042
  if (funcList && funcList.length > 0) {
4039
4043
  task.push(`## Available Functions
4040
4044
  ${funcList}`);
4041
- task.push(
4042
- `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.`
4043
- );
4044
4045
  }
4045
4046
  const inputFields = this.renderFields(this.sig.getInputFields());
4046
4047
  task.push(`## Input Fields
@@ -4048,10 +4049,10 @@ ${inputFields}`);
4048
4049
  const outputFields = this.renderFields(this.sig.getOutputFields());
4049
4050
  task.push(`## Output Fields
4050
4051
  ${outputFields}`);
4051
- task.push(
4052
- "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."
4053
- );
4054
- task.push(formattingRules);
4052
+ if (funcList && funcList.length > 0) {
4053
+ task.push(functionCallInstructions.trim());
4054
+ }
4055
+ task.push(formattingRules.trim());
4055
4056
  const desc = this.sig.getDescription();
4056
4057
  if (desc) {
4057
4058
  task.push(
@@ -4277,7 +4278,7 @@ ${capitalizeFirstLetter(desc.endsWith(".") ? desc : desc + ".")}`
4277
4278
  const type = field.type?.name ? toFieldType(field.type) : "string";
4278
4279
  const required = field.isOptional ? "optional" : "required";
4279
4280
  const description = field.description ? `: ${capitalizeFirstLetter(field.description)}` : "";
4280
- return `- \`${name}\` (${type}, ${required})${description}`.trim();
4281
+ return `- \`${name}\` (${type}, ${required})${description}.`.trim();
4281
4282
  });
4282
4283
  return rows.join("\n");
4283
4284
  };