minimax-model-behaviors.test.ts 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /**
  2. * Tests for MiniMax model behavior configuration
  3. *
  4. * Validates that MiniMax models are properly registered in the
  5. * model behavior registry and return correct configuration values.
  6. */
  7. import { describe, it, expect } from 'vitest';
  8. import { MODEL_BEHAVIORS, getModelBehavior, calculateModelTimeout } from '../model-behaviors.js';
  9. describe('MiniMax Model Behaviors', () => {
  10. describe('MODEL_BEHAVIORS registry', () => {
  11. it('should include MiniMax-M2.7 entry', () => {
  12. expect(MODEL_BEHAVIORS['MiniMax-M2.7']).toBeDefined();
  13. });
  14. it('should include MiniMax-M2.7-highspeed entry', () => {
  15. expect(MODEL_BEHAVIORS['MiniMax-M2.7-highspeed']).toBeDefined();
  16. });
  17. it('should have correct properties for MiniMax-M2.7', () => {
  18. const behavior = MODEL_BEHAVIORS['MiniMax-M2.7'];
  19. expect(behavior.sendsCompletionText).toBe(true);
  20. expect(behavior.mayEndWithToolCalls).toBe(false);
  21. expect(behavior.typicalResponseTime).toBe(8000);
  22. expect(behavior.toolCompletionGrace).toBe(4000);
  23. });
  24. it('should have correct properties for MiniMax-M2.7-highspeed', () => {
  25. const behavior = MODEL_BEHAVIORS['MiniMax-M2.7-highspeed'];
  26. expect(behavior.sendsCompletionText).toBe(true);
  27. expect(behavior.mayEndWithToolCalls).toBe(false);
  28. expect(behavior.typicalResponseTime).toBe(5000);
  29. expect(behavior.toolCompletionGrace).toBe(3000);
  30. });
  31. it('should have faster response time for highspeed variant', () => {
  32. const standard = MODEL_BEHAVIORS['MiniMax-M2.7'];
  33. const highspeed = MODEL_BEHAVIORS['MiniMax-M2.7-highspeed'];
  34. expect(highspeed.typicalResponseTime).toBeLessThan(standard.typicalResponseTime);
  35. });
  36. });
  37. describe('getModelBehavior()', () => {
  38. it('should return exact match for MiniMax-M2.7', () => {
  39. const behavior = getModelBehavior('MiniMax-M2.7');
  40. expect(behavior).toBe(MODEL_BEHAVIORS['MiniMax-M2.7']);
  41. });
  42. it('should return exact match for MiniMax-M2.7-highspeed', () => {
  43. const behavior = getModelBehavior('MiniMax-M2.7-highspeed');
  44. expect(behavior).toBe(MODEL_BEHAVIORS['MiniMax-M2.7-highspeed']);
  45. });
  46. it('should return partial match for minimax/MiniMax-M2.7', () => {
  47. const behavior = getModelBehavior('minimax/MiniMax-M2.7');
  48. expect(behavior.typicalResponseTime).toBe(8000);
  49. });
  50. it('should return partial match for minimax/MiniMax-M2.7-highspeed', () => {
  51. const behavior = getModelBehavior('minimax/MiniMax-M2.7-highspeed');
  52. expect(behavior.typicalResponseTime).toBe(5000);
  53. });
  54. });
  55. describe('calculateModelTimeout()', () => {
  56. it('should calculate timeout for MiniMax-M2.7', () => {
  57. const timeout = calculateModelTimeout(30000, 'MiniMax-M2.7');
  58. expect(timeout).toBeGreaterThanOrEqual(24000); // At least 3x typicalResponseTime
  59. });
  60. it('should calculate shorter timeout for MiniMax-M2.7-highspeed', () => {
  61. const timeoutStandard = calculateModelTimeout(30000, 'MiniMax-M2.7');
  62. const timeoutHighspeed = calculateModelTimeout(30000, 'MiniMax-M2.7-highspeed');
  63. expect(timeoutHighspeed).toBeLessThanOrEqual(timeoutStandard);
  64. });
  65. it('should respect minimum base timeout', () => {
  66. const timeout = calculateModelTimeout(60000, 'MiniMax-M2.7');
  67. expect(timeout).toBeGreaterThanOrEqual(60000);
  68. });
  69. });
  70. });