mycode-sdk 0.9.1__tar.gz → 0.9.2__tar.gz

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 (23) hide show
  1. {mycode_sdk-0.9.1 → mycode_sdk-0.9.2}/PKG-INFO +1 -1
  2. {mycode_sdk-0.9.1 → mycode_sdk-0.9.2}/pyproject.toml +1 -1
  3. {mycode_sdk-0.9.1 → mycode_sdk-0.9.2}/src/mycode/models_catalog.json +56 -112
  4. {mycode_sdk-0.9.1 → mycode_sdk-0.9.2}/src/mycode/providers/anthropic_like.py +22 -25
  5. {mycode_sdk-0.9.1 → mycode_sdk-0.9.2}/src/mycode/providers/openai_chat.py +9 -2
  6. {mycode_sdk-0.9.1 → mycode_sdk-0.9.2}/.gitignore +0 -0
  7. {mycode_sdk-0.9.1 → mycode_sdk-0.9.2}/LICENSE +0 -0
  8. {mycode_sdk-0.9.1 → mycode_sdk-0.9.2}/README.md +0 -0
  9. {mycode_sdk-0.9.1 → mycode_sdk-0.9.2}/src/mycode/__init__.py +0 -0
  10. {mycode_sdk-0.9.1 → mycode_sdk-0.9.2}/src/mycode/agent.py +0 -0
  11. {mycode_sdk-0.9.1 → mycode_sdk-0.9.2}/src/mycode/attachments.py +0 -0
  12. {mycode_sdk-0.9.1 → mycode_sdk-0.9.2}/src/mycode/compact.py +0 -0
  13. {mycode_sdk-0.9.1 → mycode_sdk-0.9.2}/src/mycode/hooks.py +0 -0
  14. {mycode_sdk-0.9.1 → mycode_sdk-0.9.2}/src/mycode/messages.py +0 -0
  15. {mycode_sdk-0.9.1 → mycode_sdk-0.9.2}/src/mycode/models.py +0 -0
  16. {mycode_sdk-0.9.1 → mycode_sdk-0.9.2}/src/mycode/providers/__init__.py +0 -0
  17. {mycode_sdk-0.9.1 → mycode_sdk-0.9.2}/src/mycode/providers/base.py +0 -0
  18. {mycode_sdk-0.9.1 → mycode_sdk-0.9.2}/src/mycode/providers/gemini.py +0 -0
  19. {mycode_sdk-0.9.1 → mycode_sdk-0.9.2}/src/mycode/providers/openai_responses.py +0 -0
  20. {mycode_sdk-0.9.1 → mycode_sdk-0.9.2}/src/mycode/py.typed +0 -0
  21. {mycode_sdk-0.9.1 → mycode_sdk-0.9.2}/src/mycode/session.py +0 -0
  22. {mycode_sdk-0.9.1 → mycode_sdk-0.9.2}/src/mycode/tools.py +0 -0
  23. {mycode_sdk-0.9.1 → mycode_sdk-0.9.2}/src/mycode/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mycode-sdk
3
- Version: 0.9.1
3
+ Version: 0.9.2
4
4
  Summary: Lightweight Python SDK for building AI agents.
5
5
  Project-URL: Homepage, https://github.com/legibet/mycode
6
6
  Project-URL: Repository, https://github.com/legibet/mycode
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "mycode-sdk"
7
- version = "0.9.1"
7
+ version = "0.9.2"
8
8
  description = "Lightweight Python SDK for building AI agents."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.12"
@@ -56,6 +56,13 @@
56
56
  "supports_pdf_input": true,
57
57
  "supports_reasoning": false
58
58
  },
59
+ "claude-fable-5": {
60
+ "context_window": 1000000,
61
+ "max_output_tokens": 128000,
62
+ "supports_image_input": true,
63
+ "supports_pdf_input": true,
64
+ "supports_reasoning": true
65
+ },
59
66
  "claude-haiku-4-5": {
60
67
  "context_window": 200000,
61
68
  "max_output_tokens": 64000,
@@ -263,6 +270,13 @@
263
270
  "supports_pdf_input": true,
264
271
  "supports_reasoning": true
265
272
  },
273
+ "gemini-3-pro-image-preview": {
274
+ "context_window": 131072,
275
+ "max_output_tokens": 32768,
276
+ "supports_image_input": true,
277
+ "supports_pdf_input": false,
278
+ "supports_reasoning": true
279
+ },
266
280
  "gemini-3-pro-preview": {
267
281
  "context_window": 1048576,
268
282
  "max_output_tokens": 65536,
@@ -448,6 +462,13 @@
448
462
  "supports_image_input": true,
449
463
  "supports_pdf_input": false,
450
464
  "supports_reasoning": true
465
+ },
466
+ "kimi-k2.7-code": {
467
+ "context_window": 262144,
468
+ "max_output_tokens": 262144,
469
+ "supports_image_input": true,
470
+ "supports_pdf_input": false,
471
+ "supports_reasoning": true
451
472
  }
452
473
  },
453
474
  "openai": {
@@ -731,20 +752,6 @@
731
752
  "supports_pdf_input": true,
732
753
  "supports_reasoning": true
733
754
  },
734
- "o1-mini": {
735
- "context_window": 128000,
736
- "max_output_tokens": 65536,
737
- "supports_image_input": false,
738
- "supports_pdf_input": false,
739
- "supports_reasoning": true
740
- },
741
- "o1-preview": {
742
- "context_window": 128000,
743
- "max_output_tokens": 32768,
744
- "supports_image_input": false,
745
- "supports_pdf_input": false,
746
- "supports_reasoning": true
747
- },
748
755
  "o1-pro": {
749
756
  "context_window": 200000,
750
757
  "max_output_tokens": 100000,
@@ -915,6 +922,13 @@
915
922
  "supports_pdf_input": false,
916
923
  "supports_reasoning": false
917
924
  },
925
+ "anthropic/claude-fable-5": {
926
+ "context_window": 1000000,
927
+ "max_output_tokens": 128000,
928
+ "supports_image_input": true,
929
+ "supports_pdf_input": true,
930
+ "supports_reasoning": true
931
+ },
918
932
  "anthropic/claude-haiku-4.5": {
919
933
  "context_window": 200000,
920
934
  "max_output_tokens": 64000,
@@ -1013,20 +1027,6 @@
1013
1027
  "supports_pdf_input": false,
1014
1028
  "supports_reasoning": false
1015
1029
  },
1016
- "arcee-ai/maestro-reasoning": {
1017
- "context_window": 131072,
1018
- "max_output_tokens": 32000,
1019
- "supports_image_input": false,
1020
- "supports_pdf_input": false,
1021
- "supports_reasoning": false
1022
- },
1023
- "arcee-ai/spotlight": {
1024
- "context_window": 131072,
1025
- "max_output_tokens": 65537,
1026
- "supports_image_input": true,
1027
- "supports_pdf_input": false,
1028
- "supports_reasoning": false
1029
- },
1030
1030
  "arcee-ai/trinity-large-thinking": {
1031
1031
  "context_window": 262144,
1032
1032
  "max_output_tokens": 262144,
@@ -1048,13 +1048,6 @@
1048
1048
  "supports_pdf_input": false,
1049
1049
  "supports_reasoning": false
1050
1050
  },
1051
- "baidu/ernie-4.5-vl-28b-a3b": {
1052
- "context_window": 30000,
1053
- "max_output_tokens": 8000,
1054
- "supports_image_input": true,
1055
- "supports_pdf_input": false,
1056
- "supports_reasoning": true
1057
- },
1058
1051
  "baidu/ernie-4.5-vl-424b-a47b": {
1059
1052
  "context_window": 123000,
1060
1053
  "max_output_tokens": 16000,
@@ -1175,8 +1168,8 @@
1175
1168
  "supports_reasoning": true
1176
1169
  },
1177
1170
  "deepseek/deepseek-r1-distill-llama-70b": {
1178
- "context_window": 131072,
1179
- "max_output_tokens": 16384,
1171
+ "context_window": 8192,
1172
+ "max_output_tokens": 8192,
1180
1173
  "supports_image_input": false,
1181
1174
  "supports_pdf_input": false,
1182
1175
  "supports_reasoning": true
@@ -1210,7 +1203,7 @@
1210
1203
  "supports_reasoning": true
1211
1204
  },
1212
1205
  "deepseek/deepseek-v4-flash": {
1213
- "context_window": 1048576,
1206
+ "context_window": 1048575,
1214
1207
  "max_output_tokens": 131072,
1215
1208
  "supports_image_input": false,
1216
1209
  "supports_pdf_input": false,
@@ -1386,7 +1379,7 @@
1386
1379
  },
1387
1380
  "google/gemma-4-31b-it": {
1388
1381
  "context_window": 262144,
1389
- "max_output_tokens": 16384,
1382
+ "max_output_tokens": 262144,
1390
1383
  "supports_image_input": true,
1391
1384
  "supports_pdf_input": false,
1392
1385
  "supports_reasoning": true
@@ -1532,7 +1525,7 @@
1532
1525
  "supports_reasoning": false
1533
1526
  },
1534
1527
  "meta-llama/llama-3.1-8b-instruct": {
1535
- "context_window": 16384,
1528
+ "context_window": 131072,
1536
1529
  "max_output_tokens": 16384,
1537
1530
  "supports_image_input": false,
1538
1531
  "supports_pdf_input": false,
@@ -1594,13 +1587,6 @@
1594
1587
  "supports_pdf_input": false,
1595
1588
  "supports_reasoning": false
1596
1589
  },
1597
- "meta-llama/llama-guard-3-8b": {
1598
- "context_window": 131072,
1599
- "max_output_tokens": 131072,
1600
- "supports_image_input": false,
1601
- "supports_pdf_input": false,
1602
- "supports_reasoning": false
1603
- },
1604
1590
  "meta-llama/llama-guard-4-12b": {
1605
1591
  "context_window": 163840,
1606
1592
  "max_output_tokens": 16384,
@@ -1840,20 +1826,20 @@
1840
1826
  "supports_reasoning": true
1841
1827
  },
1842
1828
  "moonshotai/kimi-k2.5": {
1843
- "context_window": 262144,
1829
+ "context_window": 256000,
1844
1830
  "max_output_tokens": 262144,
1845
1831
  "supports_image_input": true,
1846
1832
  "supports_pdf_input": false,
1847
1833
  "supports_reasoning": true
1848
1834
  },
1849
1835
  "moonshotai/kimi-k2.6": {
1850
- "context_window": 262144,
1851
- "max_output_tokens": 262144,
1836
+ "context_window": 262142,
1837
+ "max_output_tokens": 262142,
1852
1838
  "supports_image_input": true,
1853
1839
  "supports_pdf_input": false,
1854
1840
  "supports_reasoning": true
1855
1841
  },
1856
- "moonshotai/kimi-k2.6:free": {
1842
+ "moonshotai/kimi-k2.7-code": {
1857
1843
  "context_window": 262144,
1858
1844
  "max_output_tokens": 262144,
1859
1845
  "supports_image_input": true,
@@ -1874,19 +1860,12 @@
1874
1860
  "supports_pdf_input": false,
1875
1861
  "supports_reasoning": false
1876
1862
  },
1877
- "nex-agi/deepseek-v3.1-nex-n1": {
1878
- "context_window": 131072,
1879
- "max_output_tokens": 163840,
1880
- "supports_image_input": false,
1881
- "supports_pdf_input": false,
1882
- "supports_reasoning": false
1883
- },
1884
- "nousresearch/hermes-2-pro-llama-3-8b": {
1885
- "context_window": 8192,
1886
- "max_output_tokens": 8192,
1887
- "supports_image_input": false,
1863
+ "nex-agi/nex-n2-pro:free": {
1864
+ "context_window": 262144,
1865
+ "max_output_tokens": 262144,
1866
+ "supports_image_input": true,
1888
1867
  "supports_pdf_input": false,
1889
- "supports_reasoning": false
1868
+ "supports_reasoning": true
1890
1869
  },
1891
1870
  "nousresearch/hermes-3-llama-3.1-405b": {
1892
1871
  "context_window": 131072,
@@ -1993,13 +1972,6 @@
1993
1972
  "supports_pdf_input": false,
1994
1973
  "supports_reasoning": true
1995
1974
  },
1996
- "nvidia/nemotron-nano-9b-v2": {
1997
- "context_window": 131072,
1998
- "max_output_tokens": 16384,
1999
- "supports_image_input": false,
2000
- "supports_pdf_input": false,
2001
- "supports_reasoning": true
2002
- },
2003
1975
  "nvidia/nemotron-nano-9b-v2:free": {
2004
1976
  "context_window": 128000,
2005
1977
  "max_output_tokens": 128000,
@@ -2042,13 +2014,6 @@
2042
2014
  "supports_pdf_input": false,
2043
2015
  "supports_reasoning": false
2044
2016
  },
2045
- "openai/gpt-4-1106-preview": {
2046
- "context_window": 128000,
2047
- "max_output_tokens": 4096,
2048
- "supports_image_input": false,
2049
- "supports_pdf_input": false,
2050
- "supports_reasoning": false
2051
- },
2052
2017
  "openai/gpt-4-turbo": {
2053
2018
  "context_window": 128000,
2054
2019
  "max_output_tokens": 4096,
@@ -2596,8 +2561,8 @@
2596
2561
  "supports_reasoning": true
2597
2562
  },
2598
2563
  "qwen/qwen2.5-vl-72b-instruct": {
2599
- "context_window": 32000,
2600
- "max_output_tokens": 8192,
2564
+ "context_window": 128000,
2565
+ "max_output_tokens": 128000,
2601
2566
  "supports_image_input": true,
2602
2567
  "supports_pdf_input": false,
2603
2568
  "supports_reasoning": false
@@ -2632,7 +2597,7 @@
2632
2597
  },
2633
2598
  "qwen/qwen3-30b-a3b": {
2634
2599
  "context_window": 40960,
2635
- "max_output_tokens": 20000,
2600
+ "max_output_tokens": 16384,
2636
2601
  "supports_image_input": false,
2637
2602
  "supports_pdf_input": false,
2638
2603
  "supports_reasoning": true
@@ -2821,7 +2786,7 @@
2821
2786
  },
2822
2787
  "qwen/qwen3.5-9b": {
2823
2788
  "context_window": 262144,
2824
- "max_output_tokens": 81920,
2789
+ "max_output_tokens": 262144,
2825
2790
  "supports_image_input": true,
2826
2791
  "supports_pdf_input": false,
2827
2792
  "supports_reasoning": true
@@ -2855,8 +2820,8 @@
2855
2820
  "supports_reasoning": true
2856
2821
  },
2857
2822
  "qwen/qwen3.6-35b-a3b": {
2858
- "context_window": 262140,
2859
- "max_output_tokens": 262140,
2823
+ "context_window": 262144,
2824
+ "max_output_tokens": 262144,
2860
2825
  "supports_image_input": true,
2861
2826
  "supports_pdf_input": false,
2862
2827
  "supports_reasoning": true
@@ -2924,13 +2889,6 @@
2924
2889
  "supports_pdf_input": false,
2925
2890
  "supports_reasoning": false
2926
2891
  },
2927
- "sao10k/l3-euryale-70b": {
2928
- "context_window": 8192,
2929
- "max_output_tokens": 8192,
2930
- "supports_image_input": false,
2931
- "supports_pdf_input": false,
2932
- "supports_reasoning": false
2933
- },
2934
2892
  "sao10k/l3-lunaris-8b": {
2935
2893
  "context_window": 8192,
2936
2894
  "max_output_tokens": 16384,
@@ -3092,13 +3050,6 @@
3092
3050
  "supports_pdf_input": false,
3093
3051
  "supports_reasoning": true
3094
3052
  },
3095
- "z-ai/glm-4-32b": {
3096
- "context_window": 128000,
3097
- "max_output_tokens": 128000,
3098
- "supports_image_input": false,
3099
- "supports_pdf_input": false,
3100
- "supports_reasoning": false
3101
- },
3102
3053
  "z-ai/glm-4.5": {
3103
3054
  "context_window": 131072,
3104
3055
  "max_output_tokens": 98304,
@@ -3113,13 +3064,6 @@
3113
3064
  "supports_pdf_input": false,
3114
3065
  "supports_reasoning": true
3115
3066
  },
3116
- "z-ai/glm-4.5-air:free": {
3117
- "context_window": 131072,
3118
- "max_output_tokens": 96000,
3119
- "supports_image_input": false,
3120
- "supports_pdf_input": false,
3121
- "supports_reasoning": true
3122
- },
3123
3067
  "z-ai/glm-4.5v": {
3124
3068
  "context_window": 65536,
3125
3069
  "max_output_tokens": 16384,
@@ -3136,7 +3080,7 @@
3136
3080
  },
3137
3081
  "z-ai/glm-4.6v": {
3138
3082
  "context_window": 131072,
3139
- "max_output_tokens": 24000,
3083
+ "max_output_tokens": 32768,
3140
3084
  "supports_image_input": true,
3141
3085
  "supports_pdf_input": false,
3142
3086
  "supports_reasoning": true
@@ -3163,7 +3107,7 @@
3163
3107
  "supports_reasoning": true
3164
3108
  },
3165
3109
  "z-ai/glm-5-turbo": {
3166
- "context_window": 202752,
3110
+ "context_window": 262144,
3167
3111
  "max_output_tokens": 131072,
3168
3112
  "supports_image_input": false,
3169
3113
  "supports_pdf_input": false,
@@ -3176,11 +3120,11 @@
3176
3120
  "supports_pdf_input": false,
3177
3121
  "supports_reasoning": true
3178
3122
  },
3179
- "z-ai/glm-5v-turbo": {
3180
- "context_window": 202752,
3181
- "max_output_tokens": 131072,
3123
+ "~anthropic/claude-fable-latest": {
3124
+ "context_window": 1000000,
3125
+ "max_output_tokens": 128000,
3182
3126
  "supports_image_input": true,
3183
- "supports_pdf_input": false,
3127
+ "supports_pdf_input": true,
3184
3128
  "supports_reasoning": true
3185
3129
  },
3186
3130
  "~anthropic/claude-haiku-latest": {
@@ -3219,8 +3163,8 @@
3219
3163
  "supports_reasoning": true
3220
3164
  },
3221
3165
  "~moonshotai/kimi-latest": {
3222
- "context_window": 262144,
3223
- "max_output_tokens": 262144,
3166
+ "context_window": 262142,
3167
+ "max_output_tokens": 262142,
3224
3168
  "supports_image_input": true,
3225
3169
  "supports_pdf_input": false,
3226
3170
  "supports_reasoning": true
@@ -28,9 +28,6 @@ from mycode.providers.base import (
28
28
  tool_result_content_blocks,
29
29
  )
30
30
 
31
- # Maps reasoning_effort values to extended thinking budget_tokens.
32
- _THINKING_BUDGETS: dict[str, int] = {"low": 2048, "medium": 8192, "high": 24576, "xhigh": 32768}
33
-
34
31
 
35
32
  class AnthropicLikeAdapter(ProviderAdapter):
36
33
  """Shared Messages adapter for Anthropic-compatible providers."""
@@ -43,14 +40,6 @@ class AnthropicLikeAdapter(ProviderAdapter):
43
40
  del request
44
41
  return None
45
42
 
46
- def manual_thinking_config(self, effort: str | None) -> dict[str, Any] | None:
47
- if not effort:
48
- return None
49
- if effort == "none":
50
- return {"type": "disabled"}
51
- budget = _THINKING_BUDGETS.get(effort)
52
- return {"type": "enabled", "budget_tokens": budget} if budget else None
53
-
54
43
  def _build_request_payload(self, request: ProviderRequest) -> dict[str, Any]:
55
44
  messages = [self._serialize_message(message) for message in self.prepare_messages(request)]
56
45
  self._apply_cache_control(messages)
@@ -59,9 +48,9 @@ class AnthropicLikeAdapter(ProviderAdapter):
59
48
  payload: dict[str, Any] = {
60
49
  "model": request.model,
61
50
  "max_tokens": request.max_tokens,
62
- "temperature": request.temperature,
63
51
  "messages": messages,
64
52
  }
53
+ # Anthropic-compatible providers use provider-default sampling; temperature is intentionally omitted.
65
54
  if request.system:
66
55
  payload["system"] = [
67
56
  {
@@ -315,7 +304,7 @@ class AnthropicAdapter(AnthropicLikeAdapter):
315
304
  label = "Anthropic"
316
305
  default_base_url = "https://api.anthropic.com"
317
306
  env_api_key_names = ("ANTHROPIC_API_KEY",)
318
- default_models = ("claude-sonnet-4-6", "claude-opus-4-7")
307
+ default_models = ("claude-sonnet-4-6", "claude-opus-4-8")
319
308
  supports_reasoning_effort = True
320
309
 
321
310
  @override
@@ -326,12 +315,10 @@ class AnthropicAdapter(AnthropicLikeAdapter):
326
315
  if effort == "none":
327
316
  return {"type": "disabled"}
328
317
  normalized = request.model.lower()
329
- if normalized.startswith(("claude-opus-4-7", "claude-opus-4-6", "claude-sonnet-4-6")):
330
- thinking: dict[str, Any] = {"type": "adaptive"}
331
- if normalized.startswith("claude-opus-4-7"):
332
- thinking["display"] = "summarized"
333
- return thinking
334
- return self.manual_thinking_config(effort)
318
+ thinking: dict[str, Any] = {"type": "adaptive"}
319
+ if normalized.startswith(("claude-opus-4-7", "claude-opus-4-8")):
320
+ thinking["display"] = "summarized"
321
+ return thinking
335
322
 
336
323
  @override
337
324
  def output_config(self, request: ProviderRequest) -> dict[str, Any] | None:
@@ -340,7 +327,7 @@ class AnthropicAdapter(AnthropicLikeAdapter):
340
327
  return None
341
328
 
342
329
  normalized = request.model.lower()
343
- if normalized.startswith("claude-opus-4-7"):
330
+ if normalized.startswith(("claude-opus-4-7", "claude-opus-4-8")):
344
331
  return {"effort": effort}
345
332
 
346
333
  if normalized.startswith("claude-sonnet-4-6"):
@@ -365,12 +352,22 @@ class MoonshotAIAdapter(AnthropicLikeAdapter):
365
352
  label = "Moonshot"
366
353
  default_base_url = "https://api.moonshot.ai/anthropic"
367
354
  env_api_key_names = ("MOONSHOT_API_KEY",)
368
- default_models = ("kimi-k2.6",)
355
+ default_models = ("kimi-k2.7-code", "kimi-k2.6")
369
356
  supports_reasoning_effort = True
370
357
 
371
358
  @override
372
359
  def thinking_config(self, request: ProviderRequest) -> dict[str, Any] | None:
373
- return self.manual_thinking_config(request.reasoning_effort)
360
+ if not request.reasoning_effort:
361
+ return None
362
+ if request.reasoning_effort == "none" and request.model.lower() != "kimi-k2.7-code":
363
+ return {"type": "disabled"}
364
+ return {"type": "adaptive"}
365
+
366
+ @override
367
+ def output_config(self, request: ProviderRequest) -> dict[str, Any] | None:
368
+ if not request.reasoning_effort or request.reasoning_effort == "none":
369
+ return None
370
+ return {"effort": request.reasoning_effort}
374
371
 
375
372
 
376
373
  class MiniMaxAdapter(AnthropicLikeAdapter):
@@ -385,9 +382,9 @@ class MiniMaxAdapter(AnthropicLikeAdapter):
385
382
  label = "MiniMax"
386
383
  default_base_url = "https://api.minimax.io/anthropic"
387
384
  env_api_key_names = ("MINIMAX_API_KEY",)
388
- default_models = ("MiniMax-M2.7", "MiniMax-M2.7-highspeed")
389
- supports_reasoning_effort = True
385
+ default_models = ("MiniMax-M3",)
386
+ supports_reasoning_effort = False
390
387
 
391
388
  @override
392
389
  def thinking_config(self, request: ProviderRequest) -> dict[str, Any] | None:
393
- return self.manual_thinking_config(request.reasoning_effort)
390
+ return {"type": "adaptive"}
@@ -366,12 +366,19 @@ class ZAIAdapter(OpenAIChatAdapter):
366
366
  label = "Z.AI"
367
367
  default_base_url = "https://api.z.ai/api/paas/v4/"
368
368
  env_api_key_names = ("ZAI_API_KEY",)
369
- default_models = ("glm-5.1", "glm-5-turbo")
369
+ default_models = ("glm-5.2",)
370
370
  auto_discoverable = True
371
+ supports_reasoning_effort = True
371
372
 
372
373
  @override
373
374
  def _build_provider_payload_overrides(self, request: ProviderRequest) -> dict[str, Any]:
374
- return {"extra_body": {"thinking": {"type": "enabled", "clear_thinking": False}}}
375
+ payload: dict[str, Any] = {"extra_body": {"thinking": {"type": "enabled", "clear_thinking": False}}}
376
+ if request.model.lower().startswith("glm-5.2"):
377
+ if request.reasoning_effort in {"low", "medium", "high"}:
378
+ payload["reasoning_effort"] = "high"
379
+ elif request.reasoning_effort == "xhigh":
380
+ payload["reasoning_effort"] = "max"
381
+ return payload
375
382
 
376
383
 
377
384
  class OpenRouterAdapter(OpenAIChatAdapter):
File without changes
File without changes
File without changes