mycode-sdk 0.13.2__tar.gz → 0.14.0__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.
- {mycode_sdk-0.13.2 → mycode_sdk-0.14.0}/PKG-INFO +2 -2
- {mycode_sdk-0.13.2 → mycode_sdk-0.14.0}/pyproject.toml +2 -2
- {mycode_sdk-0.13.2 → mycode_sdk-0.14.0}/src/mycode/agent.py +1 -0
- {mycode_sdk-0.13.2 → mycode_sdk-0.14.0}/src/mycode/models.py +3 -1
- {mycode_sdk-0.13.2 → mycode_sdk-0.14.0}/src/mycode/models_catalog.json +183 -139
- {mycode_sdk-0.13.2 → mycode_sdk-0.14.0}/src/mycode/providers/__init__.py +9 -1
- {mycode_sdk-0.13.2 → mycode_sdk-0.14.0}/src/mycode/providers/base.py +6 -0
- {mycode_sdk-0.13.2 → mycode_sdk-0.14.0}/src/mycode/providers/gemini.py +47 -2
- {mycode_sdk-0.13.2 → mycode_sdk-0.14.0}/src/mycode/providers/openai_chat.py +1 -1
- {mycode_sdk-0.13.2 → mycode_sdk-0.14.0}/src/mycode/providers/openai_responses.py +4 -2
- {mycode_sdk-0.13.2 → mycode_sdk-0.14.0}/.gitignore +0 -0
- {mycode_sdk-0.13.2 → mycode_sdk-0.14.0}/LICENSE +0 -0
- {mycode_sdk-0.13.2 → mycode_sdk-0.14.0}/README.md +0 -0
- {mycode_sdk-0.13.2 → mycode_sdk-0.14.0}/src/mycode/__init__.py +0 -0
- {mycode_sdk-0.13.2 → mycode_sdk-0.14.0}/src/mycode/attachments.py +0 -0
- {mycode_sdk-0.13.2 → mycode_sdk-0.14.0}/src/mycode/compact.py +0 -0
- {mycode_sdk-0.13.2 → mycode_sdk-0.14.0}/src/mycode/hooks.py +0 -0
- {mycode_sdk-0.13.2 → mycode_sdk-0.14.0}/src/mycode/messages.py +0 -0
- {mycode_sdk-0.13.2 → mycode_sdk-0.14.0}/src/mycode/providers/anthropic_like.py +0 -0
- {mycode_sdk-0.13.2 → mycode_sdk-0.14.0}/src/mycode/py.typed +0 -0
- {mycode_sdk-0.13.2 → mycode_sdk-0.14.0}/src/mycode/session.py +0 -0
- {mycode_sdk-0.13.2 → mycode_sdk-0.14.0}/src/mycode/tools.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: mycode-sdk
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.14.0
|
|
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
|
|
@@ -19,7 +19,7 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
19
19
|
Classifier: Topic :: Software Development
|
|
20
20
|
Requires-Python: >=3.12
|
|
21
21
|
Requires-Dist: anthropic>=0.116.0
|
|
22
|
-
Requires-Dist: google-genai>=2.
|
|
22
|
+
Requires-Dist: google-genai>=2.15.0
|
|
23
23
|
Requires-Dist: griffelib>=2.1.0
|
|
24
24
|
Requires-Dist: httpx>=0.28.0
|
|
25
25
|
Requires-Dist: openai>=2.45.0
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "mycode-sdk"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.14.0"
|
|
8
8
|
description = "Lightweight Python SDK for building AI agents."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.12"
|
|
@@ -24,7 +24,7 @@ classifiers = [
|
|
|
24
24
|
keywords = ["agent", "llm", "anthropic", "openai", "gemini", "sdk"]
|
|
25
25
|
dependencies = [
|
|
26
26
|
"anthropic>=0.116.0",
|
|
27
|
-
"google-genai>=2.
|
|
27
|
+
"google-genai>=2.15.0",
|
|
28
28
|
"griffelib>=2.1.0",
|
|
29
29
|
"httpx>=0.28.0",
|
|
30
30
|
"openai>=2.45.0",
|
|
@@ -708,6 +708,7 @@ class Agent:
|
|
|
708
708
|
api_key=self.api_key,
|
|
709
709
|
api_base=self.api_base,
|
|
710
710
|
reasoning_effort=reasoning_effort,
|
|
711
|
+
supports_reasoning=self.supports_reasoning,
|
|
711
712
|
supports_image_input=self.supports_image_input,
|
|
712
713
|
supports_pdf_input=self.supports_pdf_input,
|
|
713
714
|
transcript_path=self.transcript_path,
|
|
@@ -176,7 +176,9 @@ def lookup_model_metadata(
|
|
|
176
176
|
return None
|
|
177
177
|
|
|
178
178
|
model_name = requested_model.split("/", 1)[1].strip() if "/" in requested_model else requested_model
|
|
179
|
-
|
|
179
|
+
# Agent Platform serves the same Gemini models; share the google catalog.
|
|
180
|
+
catalog_provider = "google" if provider_type == "google_vertex" else provider_type
|
|
181
|
+
catalog_entry = catalog.providers.get(catalog_provider, {}).get(requested_model)
|
|
180
182
|
if catalog_entry is None:
|
|
181
183
|
catalog_entry = catalog.fallback.get(model_name)
|
|
182
184
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"fallback": {
|
|
3
3
|
"MiniMax-M2": {
|
|
4
|
-
"context_window":
|
|
4
|
+
"context_window": 204800,
|
|
5
5
|
"cost": {
|
|
6
6
|
"input": 0.3,
|
|
7
7
|
"output": 1.2
|
|
8
8
|
},
|
|
9
|
-
"max_output_tokens":
|
|
9
|
+
"max_output_tokens": 131072,
|
|
10
10
|
"reasoning_efforts": [],
|
|
11
11
|
"supports_image_input": false,
|
|
12
12
|
"supports_pdf_input": false,
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"supports_reasoning": true
|
|
84
84
|
},
|
|
85
85
|
"MiniMax-M3": {
|
|
86
|
-
"context_window":
|
|
86
|
+
"context_window": 1048576,
|
|
87
87
|
"cost": {
|
|
88
88
|
"cache_read": 0.06,
|
|
89
89
|
"input": 0.3,
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
}
|
|
98
98
|
]
|
|
99
99
|
},
|
|
100
|
-
"max_output_tokens":
|
|
100
|
+
"max_output_tokens": 512000,
|
|
101
101
|
"reasoning_efforts": [],
|
|
102
102
|
"supports_image_input": true,
|
|
103
103
|
"supports_pdf_input": false,
|
|
@@ -1293,6 +1293,24 @@
|
|
|
1293
1293
|
"supports_pdf_input": false,
|
|
1294
1294
|
"supports_reasoning": true
|
|
1295
1295
|
},
|
|
1296
|
+
"glm-5.3-flash": {
|
|
1297
|
+
"context_window": 1000000,
|
|
1298
|
+
"cost": {
|
|
1299
|
+
"cache_read": 0.015,
|
|
1300
|
+
"cache_write": 0,
|
|
1301
|
+
"input": 0.075,
|
|
1302
|
+
"output": 0.25
|
|
1303
|
+
},
|
|
1304
|
+
"max_output_tokens": 131072,
|
|
1305
|
+
"reasoning_efforts": [
|
|
1306
|
+
"low",
|
|
1307
|
+
"high",
|
|
1308
|
+
"max"
|
|
1309
|
+
],
|
|
1310
|
+
"supports_image_input": true,
|
|
1311
|
+
"supports_pdf_input": true,
|
|
1312
|
+
"supports_reasoning": true
|
|
1313
|
+
},
|
|
1296
1314
|
"glm-5v-turbo": {
|
|
1297
1315
|
"context_window": 200000,
|
|
1298
1316
|
"cost": {
|
|
@@ -2076,8 +2094,7 @@
|
|
|
2076
2094
|
},
|
|
2077
2095
|
"max_output_tokens": 64000,
|
|
2078
2096
|
"reasoning_efforts": [
|
|
2079
|
-
"
|
|
2080
|
-
"medium",
|
|
2097
|
+
"none",
|
|
2081
2098
|
"high"
|
|
2082
2099
|
],
|
|
2083
2100
|
"supports_image_input": false,
|
|
@@ -2748,7 +2765,19 @@
|
|
|
2748
2765
|
"context_window": 262144,
|
|
2749
2766
|
"cost": {
|
|
2750
2767
|
"input": 0.45,
|
|
2751
|
-
"output": 2.25
|
|
2768
|
+
"output": 2.25,
|
|
2769
|
+
"tiers": [
|
|
2770
|
+
{
|
|
2771
|
+
"input": 0.75,
|
|
2772
|
+
"output": 3.75,
|
|
2773
|
+
"size": 32000
|
|
2774
|
+
},
|
|
2775
|
+
{
|
|
2776
|
+
"input": 1.2,
|
|
2777
|
+
"output": 6,
|
|
2778
|
+
"size": 128000
|
|
2779
|
+
}
|
|
2780
|
+
]
|
|
2752
2781
|
},
|
|
2753
2782
|
"max_output_tokens": 65536,
|
|
2754
2783
|
"reasoning_efforts": null,
|
|
@@ -2760,7 +2789,19 @@
|
|
|
2760
2789
|
"context_window": 262144,
|
|
2761
2790
|
"cost": {
|
|
2762
2791
|
"input": 1.5,
|
|
2763
|
-
"output": 7.5
|
|
2792
|
+
"output": 7.5,
|
|
2793
|
+
"tiers": [
|
|
2794
|
+
{
|
|
2795
|
+
"input": 2.7,
|
|
2796
|
+
"output": 13.5,
|
|
2797
|
+
"size": 32000
|
|
2798
|
+
},
|
|
2799
|
+
{
|
|
2800
|
+
"input": 4.5,
|
|
2801
|
+
"output": 22.5,
|
|
2802
|
+
"size": 128000
|
|
2803
|
+
}
|
|
2804
|
+
]
|
|
2764
2805
|
},
|
|
2765
2806
|
"max_output_tokens": 65536,
|
|
2766
2807
|
"reasoning_efforts": null,
|
|
@@ -3479,7 +3520,19 @@
|
|
|
3479
3520
|
"context_window": 262144,
|
|
3480
3521
|
"cost": {
|
|
3481
3522
|
"input": 0.45,
|
|
3482
|
-
"output": 2.25
|
|
3523
|
+
"output": 2.25,
|
|
3524
|
+
"tiers": [
|
|
3525
|
+
{
|
|
3526
|
+
"input": 0.75,
|
|
3527
|
+
"output": 3.75,
|
|
3528
|
+
"size": 32000
|
|
3529
|
+
},
|
|
3530
|
+
{
|
|
3531
|
+
"input": 1.2,
|
|
3532
|
+
"output": 6,
|
|
3533
|
+
"size": 128000
|
|
3534
|
+
}
|
|
3535
|
+
]
|
|
3483
3536
|
},
|
|
3484
3537
|
"max_output_tokens": 65536,
|
|
3485
3538
|
"reasoning_efforts": null,
|
|
@@ -3491,7 +3544,19 @@
|
|
|
3491
3544
|
"context_window": 262144,
|
|
3492
3545
|
"cost": {
|
|
3493
3546
|
"input": 1.5,
|
|
3494
|
-
"output": 7.5
|
|
3547
|
+
"output": 7.5,
|
|
3548
|
+
"tiers": [
|
|
3549
|
+
{
|
|
3550
|
+
"input": 2.7,
|
|
3551
|
+
"output": 13.5,
|
|
3552
|
+
"size": 32000
|
|
3553
|
+
},
|
|
3554
|
+
{
|
|
3555
|
+
"input": 4.5,
|
|
3556
|
+
"output": 22.5,
|
|
3557
|
+
"size": 128000
|
|
3558
|
+
}
|
|
3559
|
+
]
|
|
3495
3560
|
},
|
|
3496
3561
|
"max_output_tokens": 65536,
|
|
3497
3562
|
"reasoning_efforts": null,
|
|
@@ -4708,12 +4773,12 @@
|
|
|
4708
4773
|
},
|
|
4709
4774
|
"minimax": {
|
|
4710
4775
|
"MiniMax-M2": {
|
|
4711
|
-
"context_window":
|
|
4776
|
+
"context_window": 204800,
|
|
4712
4777
|
"cost": {
|
|
4713
4778
|
"input": 0.3,
|
|
4714
4779
|
"output": 1.2
|
|
4715
4780
|
},
|
|
4716
|
-
"max_output_tokens":
|
|
4781
|
+
"max_output_tokens": 131072,
|
|
4717
4782
|
"reasoning_efforts": [],
|
|
4718
4783
|
"supports_image_input": false,
|
|
4719
4784
|
"supports_pdf_input": false,
|
|
@@ -4790,7 +4855,7 @@
|
|
|
4790
4855
|
"supports_reasoning": true
|
|
4791
4856
|
},
|
|
4792
4857
|
"MiniMax-M3": {
|
|
4793
|
-
"context_window":
|
|
4858
|
+
"context_window": 1048576,
|
|
4794
4859
|
"cost": {
|
|
4795
4860
|
"cache_read": 0.06,
|
|
4796
4861
|
"input": 0.3,
|
|
@@ -4804,7 +4869,7 @@
|
|
|
4804
4869
|
}
|
|
4805
4870
|
]
|
|
4806
4871
|
},
|
|
4807
|
-
"max_output_tokens":
|
|
4872
|
+
"max_output_tokens": 512000,
|
|
4808
4873
|
"reasoning_efforts": [],
|
|
4809
4874
|
"supports_image_input": true,
|
|
4810
4875
|
"supports_pdf_input": false,
|
|
@@ -5956,11 +6021,7 @@
|
|
|
5956
6021
|
"output": 25
|
|
5957
6022
|
},
|
|
5958
6023
|
"max_output_tokens": 64000,
|
|
5959
|
-
"reasoning_efforts": [
|
|
5960
|
-
"low",
|
|
5961
|
-
"medium",
|
|
5962
|
-
"high"
|
|
5963
|
-
],
|
|
6024
|
+
"reasoning_efforts": [],
|
|
5964
6025
|
"supports_image_input": true,
|
|
5965
6026
|
"supports_pdf_input": true,
|
|
5966
6027
|
"supports_reasoning": true
|
|
@@ -6574,9 +6635,9 @@
|
|
|
6574
6635
|
"deepseek/deepseek-v4-flash": {
|
|
6575
6636
|
"context_window": 1048576,
|
|
6576
6637
|
"cost": {
|
|
6577
|
-
"cache_read": 0.
|
|
6578
|
-
"input": 0.
|
|
6579
|
-
"output": 0.
|
|
6638
|
+
"cache_read": 0.015904,
|
|
6639
|
+
"input": 0.07952,
|
|
6640
|
+
"output": 0.15904
|
|
6580
6641
|
},
|
|
6581
6642
|
"max_output_tokens": 384000,
|
|
6582
6643
|
"reasoning_efforts": [
|
|
@@ -6590,11 +6651,11 @@
|
|
|
6590
6651
|
"deepseek/deepseek-v4-flash-0731": {
|
|
6591
6652
|
"context_window": 1310720,
|
|
6592
6653
|
"cost": {
|
|
6593
|
-
"cache_read": 0.
|
|
6594
|
-
"input": 0.
|
|
6595
|
-
"output": 0.
|
|
6654
|
+
"cache_read": 0.012,
|
|
6655
|
+
"input": 0.06,
|
|
6656
|
+
"output": 0.12
|
|
6596
6657
|
},
|
|
6597
|
-
"max_output_tokens":
|
|
6658
|
+
"max_output_tokens": 943718,
|
|
6598
6659
|
"reasoning_efforts": [
|
|
6599
6660
|
"low",
|
|
6600
6661
|
"high",
|
|
@@ -6624,9 +6685,9 @@
|
|
|
6624
6685
|
"deepseek/deepseek-v4-pro": {
|
|
6625
6686
|
"context_window": 1048576,
|
|
6626
6687
|
"cost": {
|
|
6627
|
-
"cache_read": 0.
|
|
6628
|
-
"input": 0.
|
|
6629
|
-
"output": 1.
|
|
6688
|
+
"cache_read": 0.0725,
|
|
6689
|
+
"input": 0.87,
|
|
6690
|
+
"output": 1.74
|
|
6630
6691
|
},
|
|
6631
6692
|
"max_output_tokens": 384000,
|
|
6632
6693
|
"reasoning_efforts": [
|
|
@@ -7096,18 +7157,6 @@
|
|
|
7096
7157
|
"supports_pdf_input": false,
|
|
7097
7158
|
"supports_reasoning": false
|
|
7098
7159
|
},
|
|
7099
|
-
"google/gemma-3n-e4b-it": {
|
|
7100
|
-
"context_window": 32768,
|
|
7101
|
-
"cost": {
|
|
7102
|
-
"input": 0.06,
|
|
7103
|
-
"output": 0.12
|
|
7104
|
-
},
|
|
7105
|
-
"max_output_tokens": 29491,
|
|
7106
|
-
"reasoning_efforts": null,
|
|
7107
|
-
"supports_image_input": false,
|
|
7108
|
-
"supports_pdf_input": false,
|
|
7109
|
-
"supports_reasoning": false
|
|
7110
|
-
},
|
|
7111
7160
|
"google/gemma-4-26b-a4b-it": {
|
|
7112
7161
|
"context_window": 262144,
|
|
7113
7162
|
"cost": {
|
|
@@ -7135,11 +7184,11 @@
|
|
|
7135
7184
|
"google/gemma-4-31b-it": {
|
|
7136
7185
|
"context_window": 262144,
|
|
7137
7186
|
"cost": {
|
|
7138
|
-
"cache_read": 0.
|
|
7139
|
-
"input": 0.
|
|
7187
|
+
"cache_read": 0.05,
|
|
7188
|
+
"input": 0.09,
|
|
7140
7189
|
"output": 0.34
|
|
7141
7190
|
},
|
|
7142
|
-
"max_output_tokens":
|
|
7191
|
+
"max_output_tokens": 16384,
|
|
7143
7192
|
"reasoning_efforts": [],
|
|
7144
7193
|
"supports_image_input": true,
|
|
7145
7194
|
"supports_pdf_input": false,
|
|
@@ -7377,10 +7426,11 @@
|
|
|
7377
7426
|
"meta-llama/llama-3.3-70b-instruct": {
|
|
7378
7427
|
"context_window": 131072,
|
|
7379
7428
|
"cost": {
|
|
7380
|
-
"
|
|
7381
|
-
"
|
|
7429
|
+
"cache_read": 0.71,
|
|
7430
|
+
"input": 0.71,
|
|
7431
|
+
"output": 0.71
|
|
7382
7432
|
},
|
|
7383
|
-
"max_output_tokens":
|
|
7433
|
+
"max_output_tokens": 115200,
|
|
7384
7434
|
"reasoning_efforts": null,
|
|
7385
7435
|
"supports_image_input": false,
|
|
7386
7436
|
"supports_pdf_input": false,
|
|
@@ -7401,17 +7451,18 @@
|
|
|
7401
7451
|
"meta-llama/llama-4-scout": {
|
|
7402
7452
|
"context_window": 1310720,
|
|
7403
7453
|
"cost": {
|
|
7404
|
-
"
|
|
7405
|
-
"
|
|
7454
|
+
"cache_read": 0.055,
|
|
7455
|
+
"input": 0.11,
|
|
7456
|
+
"output": 0.34
|
|
7406
7457
|
},
|
|
7407
|
-
"max_output_tokens":
|
|
7458
|
+
"max_output_tokens": 8192,
|
|
7408
7459
|
"reasoning_efforts": null,
|
|
7409
7460
|
"supports_image_input": true,
|
|
7410
7461
|
"supports_pdf_input": false,
|
|
7411
7462
|
"supports_reasoning": false
|
|
7412
7463
|
},
|
|
7413
7464
|
"meta-llama/llama-guard-4-12b": {
|
|
7414
|
-
"context_window":
|
|
7465
|
+
"context_window": 163840,
|
|
7415
7466
|
"cost": {
|
|
7416
7467
|
"input": 0.18,
|
|
7417
7468
|
"output": 0.18
|
|
@@ -7603,7 +7654,7 @@
|
|
|
7603
7654
|
"input": 0.3,
|
|
7604
7655
|
"output": 1.2
|
|
7605
7656
|
},
|
|
7606
|
-
"max_output_tokens":
|
|
7657
|
+
"max_output_tokens": 131072,
|
|
7607
7658
|
"reasoning_efforts": [],
|
|
7608
7659
|
"supports_image_input": false,
|
|
7609
7660
|
"supports_pdf_input": false,
|
|
@@ -7972,8 +8023,8 @@
|
|
|
7972
8023
|
"moonshotai/kimi-k2.7-code": {
|
|
7973
8024
|
"context_window": 262144,
|
|
7974
8025
|
"cost": {
|
|
7975
|
-
"cache_read": 0.
|
|
7976
|
-
"input": 0.
|
|
8026
|
+
"cache_read": 0.18,
|
|
8027
|
+
"input": 0.66,
|
|
7977
8028
|
"output": 3.4
|
|
7978
8029
|
},
|
|
7979
8030
|
"max_output_tokens": 235929,
|
|
@@ -8100,11 +8151,11 @@
|
|
|
8100
8151
|
"nvidia/nemotron-3-nano-30b-a3b": {
|
|
8101
8152
|
"context_window": 262144,
|
|
8102
8153
|
"cost": {
|
|
8103
|
-
"cache_read": 0.
|
|
8154
|
+
"cache_read": 0.025,
|
|
8104
8155
|
"input": 0.05,
|
|
8105
8156
|
"output": 0.2
|
|
8106
8157
|
},
|
|
8107
|
-
"max_output_tokens":
|
|
8158
|
+
"max_output_tokens": 228000,
|
|
8108
8159
|
"reasoning_efforts": [],
|
|
8109
8160
|
"supports_image_input": false,
|
|
8110
8161
|
"supports_pdf_input": false,
|
|
@@ -9101,11 +9152,7 @@
|
|
|
9101
9152
|
"output": 60
|
|
9102
9153
|
},
|
|
9103
9154
|
"max_output_tokens": 100000,
|
|
9104
|
-
"reasoning_efforts": [
|
|
9105
|
-
"low",
|
|
9106
|
-
"medium",
|
|
9107
|
-
"high"
|
|
9108
|
-
],
|
|
9155
|
+
"reasoning_efforts": [],
|
|
9109
9156
|
"supports_image_input": true,
|
|
9110
9157
|
"supports_pdf_input": true,
|
|
9111
9158
|
"supports_reasoning": true
|
|
@@ -9130,11 +9177,7 @@
|
|
|
9130
9177
|
"output": 8
|
|
9131
9178
|
},
|
|
9132
9179
|
"max_output_tokens": 100000,
|
|
9133
|
-
"reasoning_efforts": [
|
|
9134
|
-
"low",
|
|
9135
|
-
"medium",
|
|
9136
|
-
"high"
|
|
9137
|
-
],
|
|
9180
|
+
"reasoning_efforts": [],
|
|
9138
9181
|
"supports_image_input": true,
|
|
9139
9182
|
"supports_pdf_input": true,
|
|
9140
9183
|
"supports_reasoning": true
|
|
@@ -9147,11 +9190,7 @@
|
|
|
9147
9190
|
"output": 4.4
|
|
9148
9191
|
},
|
|
9149
9192
|
"max_output_tokens": 100000,
|
|
9150
|
-
"reasoning_efforts": [
|
|
9151
|
-
"low",
|
|
9152
|
-
"medium",
|
|
9153
|
-
"high"
|
|
9154
|
-
],
|
|
9193
|
+
"reasoning_efforts": [],
|
|
9155
9194
|
"supports_image_input": false,
|
|
9156
9195
|
"supports_pdf_input": true,
|
|
9157
9196
|
"supports_reasoning": true
|
|
@@ -9178,11 +9217,7 @@
|
|
|
9178
9217
|
"output": 80
|
|
9179
9218
|
},
|
|
9180
9219
|
"max_output_tokens": 100000,
|
|
9181
|
-
"reasoning_efforts": [
|
|
9182
|
-
"low",
|
|
9183
|
-
"medium",
|
|
9184
|
-
"high"
|
|
9185
|
-
],
|
|
9220
|
+
"reasoning_efforts": [],
|
|
9186
9221
|
"supports_image_input": true,
|
|
9187
9222
|
"supports_pdf_input": true,
|
|
9188
9223
|
"supports_reasoning": true
|
|
@@ -9195,11 +9230,7 @@
|
|
|
9195
9230
|
"output": 4.4
|
|
9196
9231
|
},
|
|
9197
9232
|
"max_output_tokens": 100000,
|
|
9198
|
-
"reasoning_efforts": [
|
|
9199
|
-
"low",
|
|
9200
|
-
"medium",
|
|
9201
|
-
"high"
|
|
9202
|
-
],
|
|
9233
|
+
"reasoning_efforts": [],
|
|
9203
9234
|
"supports_image_input": true,
|
|
9204
9235
|
"supports_pdf_input": true,
|
|
9205
9236
|
"supports_reasoning": true
|
|
@@ -9464,33 +9495,13 @@
|
|
|
9464
9495
|
"supports_pdf_input": false,
|
|
9465
9496
|
"supports_reasoning": false
|
|
9466
9497
|
},
|
|
9467
|
-
"qwen/qwen-plus-2025-07-28:thinking": {
|
|
9468
|
-
"context_window": 1000000,
|
|
9469
|
-
"cost": {
|
|
9470
|
-
"input": 0.26,
|
|
9471
|
-
"output": 0.78,
|
|
9472
|
-
"tiers": [
|
|
9473
|
-
{
|
|
9474
|
-
"input": 0.78,
|
|
9475
|
-
"output": 2.34,
|
|
9476
|
-
"size": 256000
|
|
9477
|
-
}
|
|
9478
|
-
]
|
|
9479
|
-
},
|
|
9480
|
-
"max_output_tokens": 32768,
|
|
9481
|
-
"reasoning_efforts": [],
|
|
9482
|
-
"supports_image_input": false,
|
|
9483
|
-
"supports_pdf_input": false,
|
|
9484
|
-
"supports_reasoning": true
|
|
9485
|
-
},
|
|
9486
9498
|
"qwen/qwen2.5-vl-72b-instruct": {
|
|
9487
9499
|
"context_window": 128000,
|
|
9488
9500
|
"cost": {
|
|
9489
|
-
"
|
|
9490
|
-
"
|
|
9491
|
-
"output": 1
|
|
9501
|
+
"input": 0.25,
|
|
9502
|
+
"output": 0.75
|
|
9492
9503
|
},
|
|
9493
|
-
"max_output_tokens":
|
|
9504
|
+
"max_output_tokens": 28800,
|
|
9494
9505
|
"reasoning_efforts": null,
|
|
9495
9506
|
"supports_image_input": true,
|
|
9496
9507
|
"supports_pdf_input": false,
|
|
@@ -9523,10 +9534,11 @@
|
|
|
9523
9534
|
"qwen/qwen3-235b-a22b-2507": {
|
|
9524
9535
|
"context_window": 262144,
|
|
9525
9536
|
"cost": {
|
|
9526
|
-
"
|
|
9527
|
-
"
|
|
9537
|
+
"cache_read": 0.0175,
|
|
9538
|
+
"input": 0.0875,
|
|
9539
|
+
"output": 0.35
|
|
9528
9540
|
},
|
|
9529
|
-
"max_output_tokens":
|
|
9541
|
+
"max_output_tokens": 235929,
|
|
9530
9542
|
"reasoning_efforts": null,
|
|
9531
9543
|
"supports_image_input": false,
|
|
9532
9544
|
"supports_pdf_input": false,
|
|
@@ -9906,11 +9918,10 @@
|
|
|
9906
9918
|
"qwen/qwen3.5-397b-a17b": {
|
|
9907
9919
|
"context_window": 262144,
|
|
9908
9920
|
"cost": {
|
|
9909
|
-
"
|
|
9910
|
-
"
|
|
9911
|
-
"output": 3.6
|
|
9921
|
+
"input": 0.39,
|
|
9922
|
+
"output": 2.34
|
|
9912
9923
|
},
|
|
9913
|
-
"max_output_tokens":
|
|
9924
|
+
"max_output_tokens": 65536,
|
|
9914
9925
|
"reasoning_efforts": [],
|
|
9915
9926
|
"supports_image_input": true,
|
|
9916
9927
|
"supports_pdf_input": false,
|
|
@@ -9996,8 +10007,8 @@
|
|
|
9996
10007
|
"context_window": 262144,
|
|
9997
10008
|
"cost": {
|
|
9998
10009
|
"cache_read": 0.05,
|
|
9999
|
-
"input": 0.
|
|
10000
|
-
"output":
|
|
10010
|
+
"input": 0.1,
|
|
10011
|
+
"output": 0.9
|
|
10001
10012
|
},
|
|
10002
10013
|
"max_output_tokens": 235929,
|
|
10003
10014
|
"reasoning_efforts": [],
|
|
@@ -10170,6 +10181,20 @@
|
|
|
10170
10181
|
"supports_pdf_input": false,
|
|
10171
10182
|
"supports_reasoning": true
|
|
10172
10183
|
},
|
|
10184
|
+
"qwen/qwen3.8-flash": {
|
|
10185
|
+
"context_window": 1000000,
|
|
10186
|
+
"cost": {
|
|
10187
|
+
"cache_read": 0.016,
|
|
10188
|
+
"cache_write": 0.2,
|
|
10189
|
+
"input": 0.15,
|
|
10190
|
+
"output": 0.47
|
|
10191
|
+
},
|
|
10192
|
+
"max_output_tokens": 131072,
|
|
10193
|
+
"reasoning_efforts": [],
|
|
10194
|
+
"supports_image_input": true,
|
|
10195
|
+
"supports_pdf_input": false,
|
|
10196
|
+
"supports_reasoning": true
|
|
10197
|
+
},
|
|
10173
10198
|
"qwen/qwen3.8-max": {
|
|
10174
10199
|
"context_window": 1000000,
|
|
10175
10200
|
"cost": {
|
|
@@ -10315,22 +10340,6 @@
|
|
|
10315
10340
|
"supports_pdf_input": false,
|
|
10316
10341
|
"supports_reasoning": false
|
|
10317
10342
|
},
|
|
10318
|
-
"stealth/ox-alpha": {
|
|
10319
|
-
"context_window": 1048576,
|
|
10320
|
-
"cost": {
|
|
10321
|
-
"input": 0,
|
|
10322
|
-
"output": 0
|
|
10323
|
-
},
|
|
10324
|
-
"max_output_tokens": 131072,
|
|
10325
|
-
"reasoning_efforts": [
|
|
10326
|
-
"low",
|
|
10327
|
-
"high",
|
|
10328
|
-
"max"
|
|
10329
|
-
],
|
|
10330
|
-
"supports_image_input": true,
|
|
10331
|
-
"supports_pdf_input": false,
|
|
10332
|
-
"supports_reasoning": true
|
|
10333
|
-
},
|
|
10334
10343
|
"stepfun/step-3.5-flash": {
|
|
10335
10344
|
"context_window": 262144,
|
|
10336
10345
|
"cost": {
|
|
@@ -10833,11 +10842,11 @@
|
|
|
10833
10842
|
"z-ai/glm-4.6": {
|
|
10834
10843
|
"context_window": 204800,
|
|
10835
10844
|
"cost": {
|
|
10836
|
-
"cache_read": 0.
|
|
10837
|
-
"input": 0.
|
|
10838
|
-
"output":
|
|
10845
|
+
"cache_read": 0.08,
|
|
10846
|
+
"input": 0.43,
|
|
10847
|
+
"output": 1.75
|
|
10839
10848
|
},
|
|
10840
|
-
"max_output_tokens":
|
|
10849
|
+
"max_output_tokens": 16384,
|
|
10841
10850
|
"reasoning_efforts": [],
|
|
10842
10851
|
"supports_image_input": false,
|
|
10843
10852
|
"supports_pdf_input": false,
|
|
@@ -10969,6 +10978,23 @@
|
|
|
10969
10978
|
"supports_pdf_input": false,
|
|
10970
10979
|
"supports_reasoning": true
|
|
10971
10980
|
},
|
|
10981
|
+
"z-ai/glm-5.3-flash": {
|
|
10982
|
+
"context_window": 1310720,
|
|
10983
|
+
"cost": {
|
|
10984
|
+
"cache_read": 0.015,
|
|
10985
|
+
"input": 0.075,
|
|
10986
|
+
"output": 0.25
|
|
10987
|
+
},
|
|
10988
|
+
"max_output_tokens": 131072,
|
|
10989
|
+
"reasoning_efforts": [
|
|
10990
|
+
"low",
|
|
10991
|
+
"high",
|
|
10992
|
+
"max"
|
|
10993
|
+
],
|
|
10994
|
+
"supports_image_input": true,
|
|
10995
|
+
"supports_pdf_input": false,
|
|
10996
|
+
"supports_reasoning": true
|
|
10997
|
+
},
|
|
10972
10998
|
"z-ai/glm-5v-turbo": {
|
|
10973
10999
|
"context_window": 202752,
|
|
10974
11000
|
"cost": {
|
|
@@ -11059,11 +11085,11 @@
|
|
|
11059
11085
|
"~deepseek/deepseek-v4-flash-latest": {
|
|
11060
11086
|
"context_window": 1310720,
|
|
11061
11087
|
"cost": {
|
|
11062
|
-
"cache_read": 0.
|
|
11063
|
-
"input": 0.
|
|
11088
|
+
"cache_read": 0.007,
|
|
11089
|
+
"input": 0.03,
|
|
11064
11090
|
"output": 0.1
|
|
11065
11091
|
},
|
|
11066
|
-
"max_output_tokens":
|
|
11092
|
+
"max_output_tokens": 131072,
|
|
11067
11093
|
"reasoning_efforts": [
|
|
11068
11094
|
"low",
|
|
11069
11095
|
"high",
|
|
@@ -11122,9 +11148,9 @@
|
|
|
11122
11148
|
"~moonshotai/kimi-latest": {
|
|
11123
11149
|
"context_window": 1048576,
|
|
11124
11150
|
"cost": {
|
|
11125
|
-
"cache_read": 0.
|
|
11126
|
-
"input": 2.
|
|
11127
|
-
"output":
|
|
11151
|
+
"cache_read": 0.256,
|
|
11152
|
+
"input": 2.55,
|
|
11153
|
+
"output": 12.75
|
|
11128
11154
|
},
|
|
11129
11155
|
"max_output_tokens": 943718,
|
|
11130
11156
|
"reasoning_efforts": [
|
|
@@ -11637,6 +11663,24 @@
|
|
|
11637
11663
|
"supports_pdf_input": false,
|
|
11638
11664
|
"supports_reasoning": true
|
|
11639
11665
|
},
|
|
11666
|
+
"glm-5.3-flash": {
|
|
11667
|
+
"context_window": 1000000,
|
|
11668
|
+
"cost": {
|
|
11669
|
+
"cache_read": 0.015,
|
|
11670
|
+
"cache_write": 0,
|
|
11671
|
+
"input": 0.075,
|
|
11672
|
+
"output": 0.25
|
|
11673
|
+
},
|
|
11674
|
+
"max_output_tokens": 131072,
|
|
11675
|
+
"reasoning_efforts": [
|
|
11676
|
+
"low",
|
|
11677
|
+
"high",
|
|
11678
|
+
"max"
|
|
11679
|
+
],
|
|
11680
|
+
"supports_image_input": true,
|
|
11681
|
+
"supports_pdf_input": true,
|
|
11682
|
+
"supports_reasoning": true
|
|
11683
|
+
},
|
|
11640
11684
|
"glm-5v-turbo": {
|
|
11641
11685
|
"context_window": 200000,
|
|
11642
11686
|
"cost": {
|
|
@@ -4,7 +4,7 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
from mycode.providers.anthropic_like import AnthropicAdapter, MiniMaxAdapter, MoonshotAIAdapter
|
|
6
6
|
from mycode.providers.base import ProviderAdapter
|
|
7
|
-
from mycode.providers.gemini import GoogleGeminiAdapter
|
|
7
|
+
from mycode.providers.gemini import GoogleGeminiAdapter, GoogleVertexAdapter
|
|
8
8
|
from mycode.providers.openai_chat import (
|
|
9
9
|
AlibabaAdapter,
|
|
10
10
|
DeepSeekAdapter,
|
|
@@ -21,6 +21,7 @@ _PROVIDERS: dict[str, ProviderAdapter] = {
|
|
|
21
21
|
AnthropicAdapter(),
|
|
22
22
|
OpenAIResponsesAdapter(),
|
|
23
23
|
GoogleGeminiAdapter(),
|
|
24
|
+
GoogleVertexAdapter(),
|
|
24
25
|
DeepSeekAdapter(),
|
|
25
26
|
ZAIAdapter(),
|
|
26
27
|
MoonshotAIAdapter(),
|
|
@@ -69,6 +70,11 @@ def provider_api_key_from_env(provider_name: str | None) -> str | None:
|
|
|
69
70
|
return adapter.api_key_from_env() if adapter else None
|
|
70
71
|
|
|
71
72
|
|
|
73
|
+
def provider_can_authenticate_from_env(provider_name: str | None) -> bool:
|
|
74
|
+
adapter = _PROVIDERS.get(provider_name) if provider_name else None
|
|
75
|
+
return adapter.can_authenticate_from_env() if adapter else False
|
|
76
|
+
|
|
77
|
+
|
|
72
78
|
def provider_default_models(provider_name: str | None) -> tuple[str, ...]:
|
|
73
79
|
adapter = _PROVIDERS.get(provider_name) if provider_name else None
|
|
74
80
|
return adapter.default_models if adapter else ()
|
|
@@ -79,6 +85,7 @@ __all__ = [
|
|
|
79
85
|
"AnthropicAdapter",
|
|
80
86
|
"ProviderAdapter",
|
|
81
87
|
"GoogleGeminiAdapter",
|
|
88
|
+
"GoogleVertexAdapter",
|
|
82
89
|
"MiniMaxAdapter",
|
|
83
90
|
"MoonshotAIAdapter",
|
|
84
91
|
"DeepSeekAdapter",
|
|
@@ -92,6 +99,7 @@ __all__ = [
|
|
|
92
99
|
"is_supported_provider",
|
|
93
100
|
"list_supported_providers",
|
|
94
101
|
"provider_api_key_from_env",
|
|
102
|
+
"provider_can_authenticate_from_env",
|
|
95
103
|
"provider_default_models",
|
|
96
104
|
"provider_env_api_key_names",
|
|
97
105
|
]
|
|
@@ -120,6 +120,7 @@ class ProviderRequest:
|
|
|
120
120
|
api_key: str | None
|
|
121
121
|
api_base: str | None
|
|
122
122
|
reasoning_effort: str | None = None
|
|
123
|
+
supports_reasoning: bool | None = None
|
|
123
124
|
supports_image_input: bool = True
|
|
124
125
|
supports_pdf_input: bool = True
|
|
125
126
|
transcript_path: str | None = None
|
|
@@ -318,6 +319,11 @@ class ProviderAdapter(ABC):
|
|
|
318
319
|
return value
|
|
319
320
|
return None
|
|
320
321
|
|
|
322
|
+
def can_authenticate_from_env(self) -> bool:
|
|
323
|
+
"""Return whether ambient environment state can authenticate this adapter."""
|
|
324
|
+
|
|
325
|
+
return self.api_key_from_env() is not None
|
|
326
|
+
|
|
321
327
|
def require_api_key(self, api_key: str | None) -> str:
|
|
322
328
|
resolved = (api_key or "").strip() or self.api_key_from_env() or ""
|
|
323
329
|
if resolved:
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
+
import os
|
|
5
6
|
from collections.abc import AsyncIterator
|
|
6
7
|
from contextlib import suppress
|
|
7
8
|
from typing import Any, override
|
|
@@ -81,8 +82,7 @@ class GoogleGeminiAdapter(ProviderAdapter):
|
|
|
81
82
|
|
|
82
83
|
@override
|
|
83
84
|
async def stream_turn(self, request: ProviderRequest) -> AsyncIterator[ProviderStreamEvent]:
|
|
84
|
-
|
|
85
|
-
client = genai.Client(api_key=api_key, http_options=self._http_options(request))
|
|
85
|
+
client = self._build_client(request)
|
|
86
86
|
|
|
87
87
|
blocks: list[dict[str, Any]] = []
|
|
88
88
|
response_id: str | None = None
|
|
@@ -154,6 +154,10 @@ class GoogleGeminiAdapter(ProviderAdapter):
|
|
|
154
154
|
},
|
|
155
155
|
)
|
|
156
156
|
|
|
157
|
+
def _build_client(self, request: ProviderRequest) -> genai.Client:
|
|
158
|
+
api_key = self.require_api_key(request.api_key)
|
|
159
|
+
return genai.Client(api_key=api_key, http_options=self._http_options(request))
|
|
160
|
+
|
|
157
161
|
def _http_options(self, request: ProviderRequest) -> types.HttpOptions:
|
|
158
162
|
base_url = self.resolve_base_url(request.api_base)
|
|
159
163
|
api_version = "v1beta"
|
|
@@ -359,3 +363,44 @@ class GoogleGeminiAdapter(ProviderAdapter):
|
|
|
359
363
|
thinking_block(str(text), meta=part_meta) if is_thought else text_block(str(text), meta=part_meta)
|
|
360
364
|
)
|
|
361
365
|
return event
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
class GoogleVertexAdapter(GoogleGeminiAdapter):
|
|
369
|
+
"""Adapter for Google Agent Platform on Vertex AI."""
|
|
370
|
+
|
|
371
|
+
provider_id = "google_vertex"
|
|
372
|
+
label = "Google Agent Platform"
|
|
373
|
+
default_base_url = None
|
|
374
|
+
env_api_key_names = ("GOOGLE_CLOUD_API_KEY",)
|
|
375
|
+
|
|
376
|
+
@override
|
|
377
|
+
def can_authenticate_from_env(self) -> bool:
|
|
378
|
+
return bool(self.api_key_from_env() or (os.environ.get("GOOGLE_CLOUD_PROJECT") or "").strip())
|
|
379
|
+
|
|
380
|
+
@override
|
|
381
|
+
def _build_client(self, request: ProviderRequest) -> genai.Client:
|
|
382
|
+
api_key = (request.api_key or "").strip() or self.api_key_from_env()
|
|
383
|
+
project = (os.environ.get("GOOGLE_CLOUD_PROJECT") or "").strip() or None
|
|
384
|
+
location = (os.environ.get("GOOGLE_CLOUD_LOCATION") or "").strip() or None
|
|
385
|
+
if not api_key and not project:
|
|
386
|
+
checked = "GOOGLE_CLOUD_API_KEY, GOOGLE_CLOUD_PROJECT, GOOGLE_CLOUD_LOCATION"
|
|
387
|
+
raise ValueError(f"missing authentication for provider google_vertex; checked: {checked}")
|
|
388
|
+
# Every auth value is passed explicitly: the SDK's implicit discovery would
|
|
389
|
+
# pick up GOOGLE_API_KEY/GEMINI_API_KEY, which belong to the google provider.
|
|
390
|
+
return genai.Client(
|
|
391
|
+
enterprise=True,
|
|
392
|
+
api_key=api_key,
|
|
393
|
+
project=project,
|
|
394
|
+
location=location,
|
|
395
|
+
http_options=self._http_options(request),
|
|
396
|
+
)
|
|
397
|
+
|
|
398
|
+
@override
|
|
399
|
+
def _http_options(self, request: ProviderRequest) -> types.HttpOptions:
|
|
400
|
+
# The SDK builds Agent Platform URLs from the auth mode and location; only
|
|
401
|
+
# an explicit api_base override is passed through, with no forced api_version.
|
|
402
|
+
return types.HttpOptions(
|
|
403
|
+
base_url=self.resolve_base_url(request.api_base),
|
|
404
|
+
timeout=int(request.request_timeout * 1000),
|
|
405
|
+
retry_options=types.HttpRetryOptions(attempts=1),
|
|
406
|
+
)
|
|
@@ -419,7 +419,7 @@ class ZAIAdapter(OpenAIChatAdapter):
|
|
|
419
419
|
label = "Z.AI"
|
|
420
420
|
default_base_url = "https://api.z.ai/api/paas/v4/"
|
|
421
421
|
env_api_key_names = ("ZAI_API_KEY",)
|
|
422
|
-
default_models = ("glm-5.3",)
|
|
422
|
+
default_models = ("glm-5.3", "glm-5.3-flash")
|
|
423
423
|
auto_discoverable = True
|
|
424
424
|
supports_reasoning_effort = True
|
|
425
425
|
|
|
@@ -170,8 +170,10 @@ class OpenAIResponsesAdapter(ProviderAdapter):
|
|
|
170
170
|
"tools": [self._serialize_tool(tool) for tool in request.tools] or None,
|
|
171
171
|
"tool_choice": "auto" if request.tools else None,
|
|
172
172
|
}
|
|
173
|
-
if request.reasoning_effort:
|
|
174
|
-
reasoning: dict[str, str] = {
|
|
173
|
+
if request.reasoning_effort or request.supports_reasoning is True:
|
|
174
|
+
reasoning: dict[str, str] = {}
|
|
175
|
+
if request.reasoning_effort:
|
|
176
|
+
reasoning["effort"] = request.reasoning_effort
|
|
175
177
|
if request.reasoning_effort != "none":
|
|
176
178
|
reasoning["summary"] = "auto"
|
|
177
179
|
payload["reasoning"] = reasoning
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|