All files / src/models/adapters minimax.ts

100% Statements 12/12
100% Branches 6/6
100% Functions 1/1
100% Lines 12/12

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2110x   10x 10x 10x   10x 10x     11x 11x 7x 4x 2x   2x        
import { BaseModelAdapter } from "./base";
 
export class MinimaxAdapter extends BaseModelAdapter {
  readonly idPattern = /(^|[\/_-])minimax([\/_-]|$)/i;
  readonly defaultTemperature = 0.7;
 
  readonly supportedReasoningModes = ["none", "on", "adaptive"];
  readonly reasoningParameterFormat = "chat_template_kwargs" as const;
 
  applyReasoningMode(request: import("../../types").NimChatRequest, mode: string): void {
    request.chat_template_kwargs = request.chat_template_kwargs || {};
    if (mode === "none") {
      request.chat_template_kwargs.thinking_mode = "disabled";
    } else if (mode === "adaptive") {
      request.chat_template_kwargs.thinking_mode = "adaptive";
    } else {
      request.chat_template_kwargs.thinking_mode = "enabled";
    }
  }
}