modelmix 5.1.12 → 5.1.16

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.
@@ -517,26 +517,29 @@ describe('Token Usage Tracking', () => {
517
517
 
518
518
  it('should register Gemini Flash shortcuts with Google provider', function () {
519
519
  const model = ModelMix.new()
520
+ .gemini38flash()
520
521
  .gemini37flash()
521
522
  .gemini36flash()
522
523
  .gemini35flash()
523
524
  .gemini35flashLite();
524
525
 
525
526
  expect(model.models.map(({ key }) => key)).to.deep.equal([
527
+ 'gemini-3.8-flash',
526
528
  'gemini-3.7-flash',
527
529
  'gemini-3.6-flash',
528
530
  'gemini-3.5-flash',
529
531
  'gemini-3.5-flash-lite'
530
532
  ]);
531
533
  expect(model.models.every(({ provider }) => provider instanceof MixGoogle)).to.equal(true);
534
+ expect(ModelMix.calculateCost('gemini-3.8-flash', { input: 1_000_000, output: 1_000_000 })).to.equal(4.5);
532
535
  expect(ModelMix.calculateCost('gemini-3.7-flash', { input: 1_000_000, output: 1_000_000 })).to.equal(4.5);
533
536
  expect(ModelMix.calculateCost('gemini-3.6-flash', { input: 1_000_000, output: 1_000_000 })).to.equal(4.5);
534
537
  expect(ModelMix.calculateCost('gemini-3.5-flash', { input: 1_000_000, output: 1_000_000 })).to.equal(5.25);
535
538
  expect(ModelMix.calculateCost('gemini-3.5-flash-lite', { input: 1_000_000, output: 1_000_000 })).to.equal(2.8);
536
539
  });
537
540
 
538
- it('should calculate Gemini 3.7 Flash cache reads at the introductory rate', function () {
539
- expect(ModelMix.calculateCostBreakdown('gemini-3.7-flash', {
541
+ it('should calculate Gemini 3.8 Flash cache reads and thinking at the introductory rate', function () {
542
+ expect(ModelMix.calculateCostBreakdown('gemini-3.8-flash', {
540
543
  input: 1_000_000,
541
544
  output: 1_000_000,
542
545
  thinking: 500_000,
@@ -552,10 +555,10 @@ describe('Token Usage Tracking', () => {
552
555
  });
553
556
  });
554
557
 
555
- it('should forward options and config through gemini37flash()', function () {
558
+ it('should forward options and config through gemini38flash()', function () {
556
559
  const options = { thinkingLevel: 'high' };
557
560
  const config = { max_history: 3 };
558
- const model = ModelMix.new().gemini37flash({ options, config });
561
+ const model = ModelMix.new().gemini38flash({ options, config });
559
562
 
560
563
  expect(model.models[0].provider).to.be.instanceOf(MixGoogle);
561
564
  expect(model.models[0].provider.options).to.deep.equal(options);
@@ -687,7 +690,7 @@ describe('Token Usage Tracking', () => {
687
690
  this.timeout(30000);
688
691
 
689
692
  const model = ModelMix.new()
690
- .gemini37flash()
693
+ .gemini38flash()
691
694
  .addText('Say hi');
692
695
 
693
696
  const result = await model.raw();
@@ -750,7 +753,7 @@ describe('Token Usage Tracking', () => {
750
753
  const providers = [
751
754
  { name: 'OpenAI', create: (m) => m.gpt56luna() },
752
755
  { name: 'Anthropic', create: (m) => m.haiku45() },
753
- { name: 'Google', create: (m) => m.gemini37flash() }
756
+ { name: 'Google', create: (m) => m.gemini38flash() }
754
757
  ];
755
758
 
756
759
  for (const provider of providers) {