@code-yeongyu/senpi 2026.7.25-2 → 2026.7.25

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.
Files changed (158) hide show
  1. package/CHANGELOG.md +0 -29
  2. package/dist/core/agent-session.d.ts +0 -13
  3. package/dist/core/agent-session.d.ts.map +1 -1
  4. package/dist/core/agent-session.js +1 -23
  5. package/dist/core/agent-session.js.map +1 -1
  6. package/dist/core/extensions/builtin/config-reload/index.d.ts.map +1 -1
  7. package/dist/core/extensions/builtin/config-reload/index.js +17 -20
  8. package/dist/core/extensions/builtin/config-reload/index.js.map +1 -1
  9. package/dist/core/extensions/builtin/config-reload/log.d.ts +1 -4
  10. package/dist/core/extensions/builtin/config-reload/log.d.ts.map +1 -1
  11. package/dist/core/extensions/builtin/config-reload/log.js +0 -3
  12. package/dist/core/extensions/builtin/config-reload/log.js.map +1 -1
  13. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.d.ts +0 -48
  14. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.d.ts.map +1 -1
  15. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js +64 -88
  16. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js.map +1 -1
  17. package/dist/core/extensions/builtin/websearch/index.d.ts.map +1 -1
  18. package/dist/core/extensions/builtin/websearch/index.js +4 -2
  19. package/dist/core/extensions/builtin/websearch/index.js.map +1 -1
  20. package/dist/core/extensions/builtin/websearch/websearch/config.d.ts.map +1 -1
  21. package/dist/core/extensions/builtin/websearch/websearch/config.js +1 -4
  22. package/dist/core/extensions/builtin/websearch/websearch/config.js.map +1 -1
  23. package/dist/core/extensions/builtin/websearch/websearch/native.d.ts.map +1 -1
  24. package/dist/core/extensions/builtin/websearch/websearch/native.js +4 -2
  25. package/dist/core/extensions/builtin/websearch/websearch/native.js.map +1 -1
  26. package/dist/core/extensions/builtin/websearch/websearch/renderers.d.ts.map +1 -1
  27. package/dist/core/extensions/builtin/websearch/websearch/renderers.js +8 -20
  28. package/dist/core/extensions/builtin/websearch/websearch/renderers.js.map +1 -1
  29. package/dist/core/extensions/builtin/websearch/websearch/search.d.ts +1 -6
  30. package/dist/core/extensions/builtin/websearch/websearch/search.d.ts.map +1 -1
  31. package/dist/core/extensions/builtin/websearch/websearch/search.js +11 -15
  32. package/dist/core/extensions/builtin/websearch/websearch/search.js.map +1 -1
  33. package/dist/core/extensions/builtin/websearch/websearch/tool.d.ts.map +1 -1
  34. package/dist/core/extensions/builtin/websearch/websearch/tool.js +10 -5
  35. package/dist/core/extensions/builtin/websearch/websearch/tool.js.map +1 -1
  36. package/dist/core/extensions/builtin/websearch/websearch/types.d.ts +0 -1
  37. package/dist/core/extensions/builtin/websearch/websearch/types.d.ts.map +1 -1
  38. package/dist/core/extensions/builtin/websearch/websearch/types.js.map +1 -1
  39. package/dist/core/extensions/types.d.ts +0 -2
  40. package/dist/core/extensions/types.d.ts.map +1 -1
  41. package/dist/core/extensions/types.js.map +1 -1
  42. package/dist/core/model-resolver.d.ts +0 -1
  43. package/dist/core/model-resolver.d.ts.map +1 -1
  44. package/dist/core/model-resolver.js +3 -13
  45. package/dist/core/model-resolver.js.map +1 -1
  46. package/dist/core/remote-catalog-provider.d.ts.map +1 -1
  47. package/dist/core/remote-catalog-provider.js +1 -19
  48. package/dist/core/remote-catalog-provider.js.map +1 -1
  49. package/dist/core/resource-loader.d.ts.map +1 -1
  50. package/dist/core/resource-loader.js +0 -3
  51. package/dist/core/resource-loader.js.map +1 -1
  52. package/dist/core/retry-fallback/controller.d.ts +0 -7
  53. package/dist/core/retry-fallback/controller.d.ts.map +1 -1
  54. package/dist/core/retry-fallback/controller.js +0 -13
  55. package/dist/core/retry-fallback/controller.js.map +1 -1
  56. package/dist/core/settings-manager.d.ts +0 -7
  57. package/dist/core/settings-manager.d.ts.map +1 -1
  58. package/dist/core/settings-manager.js +0 -10
  59. package/dist/core/settings-manager.js.map +1 -1
  60. package/dist/core/thinking-levels.d.ts.map +1 -1
  61. package/dist/core/thinking-levels.js +2 -9
  62. package/dist/core/thinking-levels.js.map +1 -1
  63. package/dist/extensions/llama/provider.d.ts.map +1 -1
  64. package/dist/extensions/llama/provider.js +0 -6
  65. package/dist/extensions/llama/provider.js.map +1 -1
  66. package/dist/modes/interactive/components/custom-message.d.ts +1 -3
  67. package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
  68. package/dist/modes/interactive/components/custom-message.js +2 -9
  69. package/dist/modes/interactive/components/custom-message.js.map +1 -1
  70. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  71. package/dist/modes/interactive/interactive-mode.js +2 -9
  72. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  73. package/dist/package-manager-cli.d.ts.map +1 -1
  74. package/dist/package-manager-cli.js +0 -11
  75. package/dist/package-manager-cli.js.map +1 -1
  76. package/docs/extensions.md +2 -2
  77. package/docs/settings.md +0 -11
  78. package/examples/extensions/message-renderer.ts +2 -2
  79. package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +0 -12
  80. package/node_modules/@code-yeongyu/senpi-codemode/package.json +3 -3
  81. package/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts +0 -3
  82. package/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts.map +1 -1
  83. package/node_modules/@earendil-works/pi-agent-core/dist/agent.js +0 -2
  84. package/node_modules/@earendil-works/pi-agent-core/dist/agent.js.map +1 -1
  85. package/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
  86. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts.map +1 -1
  87. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +22 -87
  88. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -1
  89. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.d.ts.map +1 -1
  90. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js +7 -15
  91. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js.map +1 -1
  92. package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js +16 -38
  93. package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js.map +1 -1
  94. package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.d.ts.map +1 -1
  95. package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js +2 -9
  96. package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js.map +1 -1
  97. package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.d.ts.map +1 -1
  98. package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js +2 -12
  99. package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js.map +1 -1
  100. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.d.ts.map +1 -1
  101. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +11 -19
  102. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js.map +1 -1
  103. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.d.ts.map +1 -1
  104. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +23 -121
  105. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js.map +1 -1
  106. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.d.ts.map +1 -1
  107. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +7 -12
  108. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js.map +1 -1
  109. package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.d.ts.map +1 -1
  110. package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.js +0 -1
  111. package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.js.map +1 -1
  112. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/radius.d.ts +2 -3
  113. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/radius.d.ts.map +1 -1
  114. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/radius.js +35 -37
  115. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/radius.js.map +1 -1
  116. package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.d.ts.map +1 -1
  117. package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js +1 -11
  118. package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js.map +1 -1
  119. package/node_modules/@earendil-works/pi-ai/dist/index.d.ts +0 -1
  120. package/node_modules/@earendil-works/pi-ai/dist/index.d.ts.map +1 -1
  121. package/node_modules/@earendil-works/pi-ai/dist/index.js +0 -1
  122. package/node_modules/@earendil-works/pi-ai/dist/index.js.map +1 -1
  123. package/node_modules/@earendil-works/pi-ai/dist/models-store.d.ts +0 -5
  124. package/node_modules/@earendil-works/pi-ai/dist/models-store.d.ts.map +1 -1
  125. package/node_modules/@earendil-works/pi-ai/dist/models-store.js.map +1 -1
  126. package/node_modules/@earendil-works/pi-ai/dist/models.d.ts.map +1 -1
  127. package/node_modules/@earendil-works/pi-ai/dist/models.js +1 -5
  128. package/node_modules/@earendil-works/pi-ai/dist/models.js.map +1 -1
  129. package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
  130. package/node_modules/@earendil-works/pi-ai/dist/providers/data/amazon-bedrock.json +1 -1
  131. package/node_modules/@earendil-works/pi-ai/dist/providers/data/anthropic.json +1 -1
  132. package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-ai-gateway.json +1 -1
  133. package/node_modules/@earendil-works/pi-ai/dist/providers/data/github-copilot.json +1 -1
  134. package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode.json +1 -1
  135. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
  136. package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
  137. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +0 -9
  138. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
  139. package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
  140. package/node_modules/@earendil-works/pi-ai/dist/utils/error-body.d.ts.map +1 -1
  141. package/node_modules/@earendil-works/pi-ai/dist/utils/error-body.js +3 -8
  142. package/node_modules/@earendil-works/pi-ai/dist/utils/error-body.js.map +1 -1
  143. package/node_modules/@earendil-works/pi-ai/package.json +1 -1
  144. package/node_modules/@earendil-works/pi-pty/package.json +1 -1
  145. package/node_modules/@earendil-works/pi-tui/package.json +1 -1
  146. package/package.json +6 -6
  147. package/dist/beta/omo-local-update.d.ts +0 -207
  148. package/dist/beta/omo-local-update.d.ts.map +0 -1
  149. package/dist/beta/omo-local-update.js +0 -708
  150. package/dist/beta/omo-local-update.js.map +0 -1
  151. package/dist/core/extensions/builtin/config-reload/routine-settings.d.ts +0 -15
  152. package/dist/core/extensions/builtin/config-reload/routine-settings.d.ts.map +0 -1
  153. package/dist/core/extensions/builtin/config-reload/routine-settings.js +0 -102
  154. package/dist/core/extensions/builtin/config-reload/routine-settings.js.map +0 -1
  155. package/node_modules/@earendil-works/pi-ai/dist/utils/server-fallback-receipt.d.ts +0 -30
  156. package/node_modules/@earendil-works/pi-ai/dist/utils/server-fallback-receipt.d.ts.map +0 -1
  157. package/node_modules/@earendil-works/pi-ai/dist/utils/server-fallback-receipt.js +0 -70
  158. package/node_modules/@earendil-works/pi-ai/dist/utils/server-fallback-receipt.js.map +0 -1
@@ -15,87 +15,6 @@ import { buildCopilotDynamicHeaders, hasCopilotVisionInput } from "./github-copi
15
15
  import { clampOpenAIPromptCacheKey } from "./openai-prompt-cache.js";
16
16
  import { applyExtraBody, buildBaseOptions, clampMaxForOpenAI, OPENAI_COMPLETIONS_RESERVED_BODY_KEYS, } from "./simple-options.js";
17
17
  import { transformMessages } from "./transform-messages.js";
18
- const KIMI_K3_THINKING_LEVEL_MAP = {
19
- off: null,
20
- minimal: null,
21
- low: "low",
22
- medium: null,
23
- high: "high",
24
- xhigh: null,
25
- max: "max",
26
- };
27
- const DEEPSEEK_THINKING_LEVEL_MAP = {
28
- minimal: "high",
29
- low: "high",
30
- medium: "high",
31
- high: "high",
32
- xhigh: "max",
33
- max: "max",
34
- };
35
- const OPENROUTER_DEEPSEEK_THINKING_LEVEL_MAP = {
36
- minimal: "high",
37
- low: "high",
38
- medium: "high",
39
- high: "high",
40
- xhigh: "high",
41
- max: "high",
42
- };
43
- const MIMO_THINKING_LEVEL_MAP = {
44
- minimal: "low",
45
- low: "low",
46
- medium: "medium",
47
- high: "high",
48
- xhigh: "high",
49
- max: null,
50
- };
51
- const OLLAMA_THINKING_LEVEL_MAP = {
52
- off: "none",
53
- minimal: null,
54
- low: "low",
55
- medium: "medium",
56
- high: "high",
57
- xhigh: null,
58
- max: "max",
59
- };
60
- function getThinkingLevelMap(model, compat) {
61
- if (model.thinkingLevelMap !== undefined) {
62
- return model.thinkingLevelMap;
63
- }
64
- const id = model.id.toLowerCase();
65
- const isKimiK3 = id === "k3" || id.startsWith("k3-") || /(?:^|[/:-])kimi-k3(?:$|[/.:_-])/.test(id);
66
- const isDeepSeek = id.includes("deepseek");
67
- const isMiMo = /\bmimo\b/.test(id);
68
- const isGlm52 = /(?:^|[/:-])glm-5\.2(?:$|[/.:_-])/.test(id);
69
- if (model.provider === "ollama") {
70
- return OLLAMA_THINKING_LEVEL_MAP;
71
- }
72
- if (isKimiK3) {
73
- return KIMI_K3_THINKING_LEVEL_MAP;
74
- }
75
- if (compat.thinkingFormat === "openrouter" && isDeepSeek) {
76
- return OPENROUTER_DEEPSEEK_THINKING_LEVEL_MAP;
77
- }
78
- if ((compat.thinkingFormat === "openai" || compat.thinkingFormat === "openrouter") && isMiMo) {
79
- return MIMO_THINKING_LEVEL_MAP;
80
- }
81
- if (isDeepSeek) {
82
- return DEEPSEEK_THINKING_LEVEL_MAP;
83
- }
84
- if (isGlm52) {
85
- if (compat.thinkingFormat === "zai") {
86
- return DEEPSEEK_THINKING_LEVEL_MAP;
87
- }
88
- if (compat.thinkingFormat === "openrouter") {
89
- return { xhigh: "xhigh" };
90
- }
91
- return { max: "max" };
92
- }
93
- return undefined;
94
- }
95
- function resolveReasoningEffort(thinkingLevelMap, effort) {
96
- const mapped = thinkingLevelMap?.[effort];
97
- return mapped === undefined ? effort : typeof mapped === "string" ? mapped : undefined;
98
- }
99
18
  /**
100
19
  * Check if conversation messages contain tool calls or tool results.
101
20
  * This is needed because Anthropic (via proxy) requires the tools param
@@ -578,15 +497,12 @@ export const stream = (model, context, options) => {
578
497
  export const streamSimple = (model, context, options) => {
579
498
  getClientApiKey(model.provider, options?.apiKey, options?.headers);
580
499
  const base = buildBaseOptions(model, context, options, options?.apiKey);
581
- const compat = getCompat(model);
582
- const thinkingLevelMap = getThinkingLevelMap(model, compat);
583
- const thinkingModel = thinkingLevelMap === model.thinkingLevelMap ? model : { ...model, thinkingLevelMap };
584
- const clampedReasoning = options?.reasoning ? clampThinkingLevel(thinkingModel, options.reasoning) : undefined;
500
+ const clampedReasoning = options?.reasoning ? clampThinkingLevel(model, options.reasoning) : undefined;
585
501
  const reasoningEffort = clampedReasoning === "off"
586
502
  ? undefined
587
- : clampedReasoning === "max" && thinkingLevelMap?.max !== undefined
503
+ : clampedReasoning === "max" && model.thinkingLevelMap?.max !== undefined
588
504
  ? "max"
589
- : clampMaxForOpenAI(clampedReasoning, supportsXhigh(thinkingModel));
505
+ : clampMaxForOpenAI(clampedReasoning, supportsXhigh(model));
590
506
  const toolChoice = options?.toolChoice;
591
507
  return stream(model, context, {
592
508
  ...base,
@@ -633,7 +549,6 @@ function buildParams(model, context, options, compat = getCompat(model), cacheRe
633
549
  grammarToolInputProperties,
634
550
  });
635
551
  const cacheControl = getCompatCacheControl(compat, cacheRetention);
636
- const thinkingLevelMap = getThinkingLevelMap(model, compat);
637
552
  const params = {
638
553
  model: model.id,
639
554
  messages,
@@ -683,8 +598,9 @@ function buildParams(model, context, options, compat = getCompat(model), cacheRe
683
598
  const zaiParams = params;
684
599
  zaiParams.thinking = options?.reasoningEffort ? { type: "enabled", clear_thinking: false } : { type: "disabled" };
685
600
  if (options?.reasoningEffort && compat.supportsReasoningEffort) {
686
- const effort = resolveReasoningEffort(thinkingLevelMap, options.reasoningEffort);
687
- if (effort !== undefined) {
601
+ const mappedEffort = model.thinkingLevelMap?.[options.reasoningEffort];
602
+ const effort = mappedEffort === undefined ? options.reasoningEffort : mappedEffort;
603
+ if (typeof effort === "string") {
688
604
  zaiParams.reasoning_effort = effort;
689
605
  }
690
606
  }
@@ -708,13 +624,10 @@ function buildParams(model, context, options, compat = getCompat(model), cacheRe
708
624
  if (options?.reasoningEffort) {
709
625
  params.thinking = { type: "enabled" };
710
626
  if (compat.supportsReasoningEffort) {
711
- const effort = resolveReasoningEffort(thinkingLevelMap, options.reasoningEffort);
712
- if (effort !== undefined) {
713
- params.reasoning_effort = effort;
714
- }
627
+ params.reasoning_effort = model.thinkingLevelMap?.[options.reasoningEffort] ?? options.reasoningEffort;
715
628
  }
716
629
  }
717
- else if (compat.supportsDisabledThinking !== false && thinkingLevelMap?.off !== null) {
630
+ else if (compat.supportsDisabledThinking !== false && model.thinkingLevelMap?.off !== null) {
718
631
  params.thinking = { type: "disabled" };
719
632
  }
720
633
  }
@@ -722,17 +635,16 @@ function buildParams(model, context, options, compat = getCompat(model), cacheRe
722
635
  // OpenRouter normalizes reasoning across providers via a nested reasoning object.
723
636
  const openRouterParams = params;
724
637
  if (options?.reasoningEffort) {
725
- const effort = resolveReasoningEffort(thinkingLevelMap, options.reasoningEffort);
726
- if (effort !== undefined) {
727
- openRouterParams.reasoning = { effort };
728
- }
638
+ openRouterParams.reasoning = {
639
+ effort: model.thinkingLevelMap?.[options.reasoningEffort] ?? options.reasoningEffort,
640
+ };
729
641
  }
730
- else if (thinkingLevelMap?.off !== null) {
731
- openRouterParams.reasoning = { effort: thinkingLevelMap?.off ?? "none" };
642
+ else if (model.thinkingLevelMap?.off !== null) {
643
+ openRouterParams.reasoning = { effort: model.thinkingLevelMap?.off ?? "none" };
732
644
  }
733
645
  }
734
646
  else if (compat.thinkingFormat === "ant-ling" && model.reasoning && options?.reasoningEffort) {
735
- const effort = thinkingLevelMap?.[options.reasoningEffort];
647
+ const effort = model.thinkingLevelMap?.[options.reasoningEffort];
736
648
  if (typeof effort === "string") {
737
649
  params.reasoning = { effort };
738
650
  }
@@ -741,32 +653,23 @@ function buildParams(model, context, options, compat = getCompat(model), cacheRe
741
653
  const togetherParams = params;
742
654
  togetherParams.reasoning = { enabled: !!options?.reasoningEffort };
743
655
  if (options?.reasoningEffort && compat.supportsReasoningEffort) {
744
- const effort = resolveReasoningEffort(thinkingLevelMap, options.reasoningEffort);
745
- if (effort !== undefined) {
746
- togetherParams.reasoning_effort = effort;
747
- }
656
+ togetherParams.reasoning_effort = model.thinkingLevelMap?.[options.reasoningEffort] ?? options.reasoningEffort;
748
657
  }
749
658
  }
750
659
  else if (compat.thinkingFormat === "string-thinking" && model.reasoning) {
751
660
  if (options?.reasoningEffort) {
752
- const effort = resolveReasoningEffort(thinkingLevelMap, options.reasoningEffort);
753
- if (effort !== undefined) {
754
- params.thinking = effort;
755
- }
661
+ params.thinking = model.thinkingLevelMap?.[options.reasoningEffort] ?? options.reasoningEffort;
756
662
  }
757
- else if (thinkingLevelMap?.off !== null) {
758
- params.thinking = thinkingLevelMap?.off ?? "none";
663
+ else if (model.thinkingLevelMap?.off !== null) {
664
+ params.thinking = model.thinkingLevelMap?.off ?? "none";
759
665
  }
760
666
  }
761
667
  else if (options?.reasoningEffort && model.reasoning && compat.supportsReasoningEffort) {
762
668
  // OpenAI-style reasoning_effort
763
- const effort = resolveReasoningEffort(thinkingLevelMap, options.reasoningEffort);
764
- if (effort !== undefined) {
765
- params.reasoning_effort = effort;
766
- }
669
+ params.reasoning_effort = model.thinkingLevelMap?.[options.reasoningEffort] ?? options.reasoningEffort;
767
670
  }
768
671
  else if (!options?.reasoningEffort && model.reasoning && compat.supportsReasoningEffort) {
769
- const offValue = thinkingLevelMap?.off;
672
+ const offValue = model.thinkingLevelMap?.off;
770
673
  if (typeof offValue === "string") {
771
674
  params.reasoning_effort = offValue;
772
675
  }
@@ -793,14 +696,14 @@ function buildParams(model, context, options, compat = getCompat(model), cacheRe
793
696
  function buildChatTemplateKwargs(model, options, compat) {
794
697
  const kwargs = {};
795
698
  for (const [key, value] of Object.entries(compat.chatTemplateKwargs)) {
796
- const resolved = resolveChatTemplateKwargValue(model, options, compat, value);
699
+ const resolved = resolveChatTemplateKwargValue(model, options, value);
797
700
  if (resolved !== undefined) {
798
701
  kwargs[key] = resolved;
799
702
  }
800
703
  }
801
704
  return Object.keys(kwargs).length > 0 ? kwargs : undefined;
802
705
  }
803
- function resolveChatTemplateKwargValue(model, options, compat, value) {
706
+ function resolveChatTemplateKwargValue(model, options, value) {
804
707
  if (typeof value !== "object" || value === null) {
805
708
  return value;
806
709
  }
@@ -811,8 +714,7 @@ function resolveChatTemplateKwargValue(model, options, compat, value) {
811
714
  if (value.$var === "thinking.enabled") {
812
715
  return !!reasoningEffort;
813
716
  }
814
- const thinkingLevelMap = getThinkingLevelMap(model, compat);
815
- const mappedValue = reasoningEffort ? thinkingLevelMap?.[reasoningEffort] : thinkingLevelMap?.off;
717
+ const mappedValue = reasoningEffort ? model.thinkingLevelMap?.[reasoningEffort] : model.thinkingLevelMap?.off;
816
718
  return mappedValue === undefined ? reasoningEffort : typeof mappedValue === "string" ? mappedValue : undefined;
817
719
  }
818
720
  function getCompatCacheControl(compat, cacheRetention) {