mycode-sdk 0.13.3__tar.gz → 0.14.1__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.3 → mycode_sdk-0.14.1}/PKG-INFO +5 -5
- {mycode_sdk-0.13.3 → mycode_sdk-0.14.1}/pyproject.toml +5 -5
- {mycode_sdk-0.13.3 → mycode_sdk-0.14.1}/src/mycode/models_catalog.json +179 -186
- {mycode_sdk-0.13.3 → mycode_sdk-0.14.1}/src/mycode/providers/anthropic_like.py +3 -3
- {mycode_sdk-0.13.3 → mycode_sdk-0.14.1}/src/mycode/providers/base.py +5 -5
- {mycode_sdk-0.13.3 → mycode_sdk-0.14.1}/src/mycode/providers/gemini.py +48 -39
- {mycode_sdk-0.13.3 → mycode_sdk-0.14.1}/src/mycode/providers/openai_chat.py +4 -4
- {mycode_sdk-0.13.3 → mycode_sdk-0.14.1}/src/mycode/providers/openai_responses.py +3 -3
- {mycode_sdk-0.13.3 → mycode_sdk-0.14.1}/.gitignore +0 -0
- {mycode_sdk-0.13.3 → mycode_sdk-0.14.1}/LICENSE +0 -0
- {mycode_sdk-0.13.3 → mycode_sdk-0.14.1}/README.md +0 -0
- {mycode_sdk-0.13.3 → mycode_sdk-0.14.1}/src/mycode/__init__.py +0 -0
- {mycode_sdk-0.13.3 → mycode_sdk-0.14.1}/src/mycode/agent.py +0 -0
- {mycode_sdk-0.13.3 → mycode_sdk-0.14.1}/src/mycode/attachments.py +0 -0
- {mycode_sdk-0.13.3 → mycode_sdk-0.14.1}/src/mycode/compact.py +0 -0
- {mycode_sdk-0.13.3 → mycode_sdk-0.14.1}/src/mycode/hooks.py +0 -0
- {mycode_sdk-0.13.3 → mycode_sdk-0.14.1}/src/mycode/messages.py +0 -0
- {mycode_sdk-0.13.3 → mycode_sdk-0.14.1}/src/mycode/models.py +0 -0
- {mycode_sdk-0.13.3 → mycode_sdk-0.14.1}/src/mycode/providers/__init__.py +0 -0
- {mycode_sdk-0.13.3 → mycode_sdk-0.14.1}/src/mycode/py.typed +0 -0
- {mycode_sdk-0.13.3 → mycode_sdk-0.14.1}/src/mycode/session.py +0 -0
- {mycode_sdk-0.13.3 → mycode_sdk-0.14.1}/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.1
|
|
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
|
|
@@ -18,11 +18,11 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
18
18
|
Classifier: Programming Language :: Python :: 3.13
|
|
19
19
|
Classifier: Topic :: Software Development
|
|
20
20
|
Requires-Python: >=3.12
|
|
21
|
-
Requires-Dist: anthropic>=
|
|
22
|
-
Requires-Dist: google-genai>=2.
|
|
21
|
+
Requires-Dist: anthropic>=1.2.0
|
|
22
|
+
Requires-Dist: google-genai>=2.20.0
|
|
23
23
|
Requires-Dist: griffelib>=2.1.0
|
|
24
|
-
Requires-Dist:
|
|
25
|
-
Requires-Dist: openai>=
|
|
24
|
+
Requires-Dist: httpx2>=2.10.0
|
|
25
|
+
Requires-Dist: openai>=3.6.0
|
|
26
26
|
Requires-Dist: pydantic>=2.13.4
|
|
27
27
|
Description-Content-Type: text/markdown
|
|
28
28
|
|
|
@@ -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.1"
|
|
8
8
|
description = "Lightweight Python SDK for building AI agents."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.12"
|
|
@@ -23,11 +23,11 @@ classifiers = [
|
|
|
23
23
|
]
|
|
24
24
|
keywords = ["agent", "llm", "anthropic", "openai", "gemini", "sdk"]
|
|
25
25
|
dependencies = [
|
|
26
|
-
"anthropic>=
|
|
27
|
-
"google-genai>=2.
|
|
26
|
+
"anthropic>=1.2.0",
|
|
27
|
+
"google-genai>=2.20.0",
|
|
28
28
|
"griffelib>=2.1.0",
|
|
29
|
-
"
|
|
30
|
-
"openai>=
|
|
29
|
+
"httpx2>=2.10.0",
|
|
30
|
+
"openai>=3.6.0",
|
|
31
31
|
"pydantic>=2.13.4",
|
|
32
32
|
]
|
|
33
33
|
|
|
@@ -1066,18 +1066,6 @@
|
|
|
1066
1066
|
"supports_pdf_input": false,
|
|
1067
1067
|
"supports_reasoning": true
|
|
1068
1068
|
},
|
|
1069
|
-
"gemini-robotics-er-1.6-preview": {
|
|
1070
|
-
"context_window": 131072,
|
|
1071
|
-
"cost": {
|
|
1072
|
-
"input": 1,
|
|
1073
|
-
"output": 5
|
|
1074
|
-
},
|
|
1075
|
-
"max_output_tokens": 65536,
|
|
1076
|
-
"reasoning_efforts": [],
|
|
1077
|
-
"supports_image_input": true,
|
|
1078
|
-
"supports_pdf_input": false,
|
|
1079
|
-
"supports_reasoning": true
|
|
1080
|
-
},
|
|
1081
1069
|
"gemma-4-26b-a4b-it": {
|
|
1082
1070
|
"context_window": 262144,
|
|
1083
1071
|
"max_output_tokens": 32768,
|
|
@@ -2119,6 +2107,22 @@
|
|
|
2119
2107
|
"supports_pdf_input": false,
|
|
2120
2108
|
"supports_reasoning": true
|
|
2121
2109
|
},
|
|
2110
|
+
"hy4-preview": {
|
|
2111
|
+
"context_window": 1024000,
|
|
2112
|
+
"cost": {
|
|
2113
|
+
"cache_read": 0.042,
|
|
2114
|
+
"input": 0.834,
|
|
2115
|
+
"output": 2.501
|
|
2116
|
+
},
|
|
2117
|
+
"max_output_tokens": 64000,
|
|
2118
|
+
"reasoning_efforts": [
|
|
2119
|
+
"none",
|
|
2120
|
+
"high"
|
|
2121
|
+
],
|
|
2122
|
+
"supports_image_input": false,
|
|
2123
|
+
"supports_pdf_input": false,
|
|
2124
|
+
"supports_reasoning": true
|
|
2125
|
+
},
|
|
2122
2126
|
"kimi-k2-thinking": {
|
|
2123
2127
|
"context_window": 262144,
|
|
2124
2128
|
"cost": {
|
|
@@ -3054,6 +3058,24 @@
|
|
|
3054
3058
|
"supports_pdf_input": false,
|
|
3055
3059
|
"supports_reasoning": true
|
|
3056
3060
|
},
|
|
3061
|
+
"qwen3.8-flash": {
|
|
3062
|
+
"context_window": 1000000,
|
|
3063
|
+
"cost": {
|
|
3064
|
+
"cache_read": 0.016,
|
|
3065
|
+
"cache_write": 0.2,
|
|
3066
|
+
"input": 0.15,
|
|
3067
|
+
"output": 0.47
|
|
3068
|
+
},
|
|
3069
|
+
"max_output_tokens": 131072,
|
|
3070
|
+
"reasoning_efforts": [
|
|
3071
|
+
"low",
|
|
3072
|
+
"medium",
|
|
3073
|
+
"xhigh"
|
|
3074
|
+
],
|
|
3075
|
+
"supports_image_input": true,
|
|
3076
|
+
"supports_pdf_input": false,
|
|
3077
|
+
"supports_reasoning": true
|
|
3078
|
+
},
|
|
3057
3079
|
"qwen3.8-max": {
|
|
3058
3080
|
"context_window": 1000000,
|
|
3059
3081
|
"cost": {
|
|
@@ -3871,6 +3893,24 @@
|
|
|
3871
3893
|
"supports_pdf_input": false,
|
|
3872
3894
|
"supports_reasoning": true
|
|
3873
3895
|
},
|
|
3896
|
+
"qwen3.8-flash": {
|
|
3897
|
+
"context_window": 1000000,
|
|
3898
|
+
"cost": {
|
|
3899
|
+
"cache_read": 0.016,
|
|
3900
|
+
"cache_write": 0.2,
|
|
3901
|
+
"input": 0.15,
|
|
3902
|
+
"output": 0.47
|
|
3903
|
+
},
|
|
3904
|
+
"max_output_tokens": 131072,
|
|
3905
|
+
"reasoning_efforts": [
|
|
3906
|
+
"low",
|
|
3907
|
+
"medium",
|
|
3908
|
+
"xhigh"
|
|
3909
|
+
],
|
|
3910
|
+
"supports_image_input": true,
|
|
3911
|
+
"supports_pdf_input": false,
|
|
3912
|
+
"supports_reasoning": true
|
|
3913
|
+
},
|
|
3874
3914
|
"qwen3.8-max": {
|
|
3875
3915
|
"context_window": 1000000,
|
|
3876
3916
|
"cost": {
|
|
@@ -4694,18 +4734,6 @@
|
|
|
4694
4734
|
"supports_pdf_input": false,
|
|
4695
4735
|
"supports_reasoning": true
|
|
4696
4736
|
},
|
|
4697
|
-
"gemini-robotics-er-1.6-preview": {
|
|
4698
|
-
"context_window": 131072,
|
|
4699
|
-
"cost": {
|
|
4700
|
-
"input": 1,
|
|
4701
|
-
"output": 5
|
|
4702
|
-
},
|
|
4703
|
-
"max_output_tokens": 65536,
|
|
4704
|
-
"reasoning_efforts": [],
|
|
4705
|
-
"supports_image_input": true,
|
|
4706
|
-
"supports_pdf_input": false,
|
|
4707
|
-
"supports_reasoning": true
|
|
4708
|
-
},
|
|
4709
4737
|
"gemma-4-26b-a4b-it": {
|
|
4710
4738
|
"context_window": 262144,
|
|
4711
4739
|
"max_output_tokens": 32768,
|
|
@@ -5851,18 +5879,6 @@
|
|
|
5851
5879
|
"supports_pdf_input": false,
|
|
5852
5880
|
"supports_reasoning": false
|
|
5853
5881
|
},
|
|
5854
|
-
"allenai/olmo-3-32b-think": {
|
|
5855
|
-
"context_window": 65536,
|
|
5856
|
-
"cost": {
|
|
5857
|
-
"input": 0.15,
|
|
5858
|
-
"output": 0.5
|
|
5859
|
-
},
|
|
5860
|
-
"max_output_tokens": 58982,
|
|
5861
|
-
"reasoning_efforts": [],
|
|
5862
|
-
"supports_image_input": false,
|
|
5863
|
-
"supports_pdf_input": false,
|
|
5864
|
-
"supports_reasoning": true
|
|
5865
|
-
},
|
|
5866
5882
|
"amazon/nova-2-lite-v1": {
|
|
5867
5883
|
"context_window": 1000000,
|
|
5868
5884
|
"cost": {
|
|
@@ -5927,7 +5943,7 @@
|
|
|
5927
5943
|
"anthracite-org/magnum-v4-72b": {
|
|
5928
5944
|
"context_window": 32768,
|
|
5929
5945
|
"cost": {
|
|
5930
|
-
"input":
|
|
5946
|
+
"input": 2.5,
|
|
5931
5947
|
"output": 5
|
|
5932
5948
|
},
|
|
5933
5949
|
"max_output_tokens": 4096,
|
|
@@ -6083,26 +6099,6 @@
|
|
|
6083
6099
|
"supports_pdf_input": true,
|
|
6084
6100
|
"supports_reasoning": true
|
|
6085
6101
|
},
|
|
6086
|
-
"anthropic/claude-opus-4.7-fast": {
|
|
6087
|
-
"context_window": 1000000,
|
|
6088
|
-
"cost": {
|
|
6089
|
-
"cache_read": 3,
|
|
6090
|
-
"cache_write": 37.5,
|
|
6091
|
-
"input": 30,
|
|
6092
|
-
"output": 150
|
|
6093
|
-
},
|
|
6094
|
-
"max_output_tokens": 128000,
|
|
6095
|
-
"reasoning_efforts": [
|
|
6096
|
-
"low",
|
|
6097
|
-
"medium",
|
|
6098
|
-
"high",
|
|
6099
|
-
"xhigh",
|
|
6100
|
-
"max"
|
|
6101
|
-
],
|
|
6102
|
-
"supports_image_input": true,
|
|
6103
|
-
"supports_pdf_input": true,
|
|
6104
|
-
"supports_reasoning": true
|
|
6105
|
-
},
|
|
6106
6102
|
"anthropic/claude-opus-4.8": {
|
|
6107
6103
|
"context_window": 1000000,
|
|
6108
6104
|
"cost": {
|
|
@@ -6281,27 +6277,15 @@
|
|
|
6281
6277
|
"context_window": 262144,
|
|
6282
6278
|
"cost": {
|
|
6283
6279
|
"cache_read": 0.06,
|
|
6284
|
-
"input": 0.
|
|
6285
|
-
"output": 0.
|
|
6280
|
+
"input": 0.25,
|
|
6281
|
+
"output": 0.8
|
|
6286
6282
|
},
|
|
6287
|
-
"max_output_tokens":
|
|
6283
|
+
"max_output_tokens": 80000,
|
|
6288
6284
|
"reasoning_efforts": [],
|
|
6289
6285
|
"supports_image_input": false,
|
|
6290
6286
|
"supports_pdf_input": false,
|
|
6291
6287
|
"supports_reasoning": true
|
|
6292
6288
|
},
|
|
6293
|
-
"arcee-ai/virtuoso-large": {
|
|
6294
|
-
"context_window": 131072,
|
|
6295
|
-
"cost": {
|
|
6296
|
-
"input": 0.75,
|
|
6297
|
-
"output": 1.2
|
|
6298
|
-
},
|
|
6299
|
-
"max_output_tokens": 64000,
|
|
6300
|
-
"reasoning_efforts": null,
|
|
6301
|
-
"supports_image_input": false,
|
|
6302
|
-
"supports_pdf_input": false,
|
|
6303
|
-
"supports_reasoning": false
|
|
6304
|
-
},
|
|
6305
6289
|
"baidu/ernie-4.5-vl-424b-a47b": {
|
|
6306
6290
|
"context_window": 123000,
|
|
6307
6291
|
"cost": {
|
|
@@ -6610,11 +6594,11 @@
|
|
|
6610
6594
|
"deepseek/deepseek-v3.2": {
|
|
6611
6595
|
"context_window": 163840,
|
|
6612
6596
|
"cost": {
|
|
6613
|
-
"cache_read": 0.
|
|
6614
|
-
"input": 0.
|
|
6615
|
-
"output": 0.
|
|
6597
|
+
"cache_read": 0.1345,
|
|
6598
|
+
"input": 0.269,
|
|
6599
|
+
"output": 0.4
|
|
6616
6600
|
},
|
|
6617
|
-
"max_output_tokens":
|
|
6601
|
+
"max_output_tokens": 65536,
|
|
6618
6602
|
"reasoning_efforts": [],
|
|
6619
6603
|
"supports_image_input": false,
|
|
6620
6604
|
"supports_pdf_input": false,
|
|
@@ -6635,9 +6619,9 @@
|
|
|
6635
6619
|
"deepseek/deepseek-v4-flash": {
|
|
6636
6620
|
"context_window": 1048576,
|
|
6637
6621
|
"cost": {
|
|
6638
|
-
"cache_read": 0.
|
|
6639
|
-
"input": 0.
|
|
6640
|
-
"output": 0.
|
|
6622
|
+
"cache_read": 0.016184,
|
|
6623
|
+
"input": 0.08092,
|
|
6624
|
+
"output": 0.16184
|
|
6641
6625
|
},
|
|
6642
6626
|
"max_output_tokens": 384000,
|
|
6643
6627
|
"reasoning_efforts": [
|
|
@@ -6651,9 +6635,9 @@
|
|
|
6651
6635
|
"deepseek/deepseek-v4-flash-0731": {
|
|
6652
6636
|
"context_window": 1310720,
|
|
6653
6637
|
"cost": {
|
|
6654
|
-
"cache_read": 0.
|
|
6655
|
-
"input": 0.
|
|
6656
|
-
"output": 0.
|
|
6638
|
+
"cache_read": 0.016,
|
|
6639
|
+
"input": 0.065,
|
|
6640
|
+
"output": 0.18
|
|
6657
6641
|
},
|
|
6658
6642
|
"max_output_tokens": 943718,
|
|
6659
6643
|
"reasoning_efforts": [
|
|
@@ -6685,11 +6669,11 @@
|
|
|
6685
6669
|
"deepseek/deepseek-v4-pro": {
|
|
6686
6670
|
"context_window": 1048576,
|
|
6687
6671
|
"cost": {
|
|
6688
|
-
"cache_read": 0.
|
|
6689
|
-
"input":
|
|
6690
|
-
"output":
|
|
6672
|
+
"cache_read": 0.135,
|
|
6673
|
+
"input": 1.6,
|
|
6674
|
+
"output": 3.2
|
|
6691
6675
|
},
|
|
6692
|
-
"max_output_tokens":
|
|
6676
|
+
"max_output_tokens": 393216,
|
|
6693
6677
|
"reasoning_efforts": [
|
|
6694
6678
|
"high",
|
|
6695
6679
|
"xhigh"
|
|
@@ -6701,11 +6685,11 @@
|
|
|
6701
6685
|
"deepseek/deepseek-v4-pro-0813": {
|
|
6702
6686
|
"context_window": 1048576,
|
|
6703
6687
|
"cost": {
|
|
6704
|
-
"cache_read": 0.
|
|
6705
|
-
"input":
|
|
6706
|
-
"output":
|
|
6688
|
+
"cache_read": 0.022,
|
|
6689
|
+
"input": 0.66,
|
|
6690
|
+
"output": 1.98
|
|
6707
6691
|
},
|
|
6708
|
-
"max_output_tokens":
|
|
6692
|
+
"max_output_tokens": 384000,
|
|
6709
6693
|
"reasoning_efforts": [
|
|
6710
6694
|
"low",
|
|
6711
6695
|
"high",
|
|
@@ -7092,11 +7076,11 @@
|
|
|
7092
7076
|
"google/gemini-3.7-flash": {
|
|
7093
7077
|
"context_window": 1048576,
|
|
7094
7078
|
"cost": {
|
|
7095
|
-
"cache_read": 0.
|
|
7096
|
-
"cache_write": 0.
|
|
7097
|
-
"input": 0.
|
|
7098
|
-
"output":
|
|
7099
|
-
"reasoning":
|
|
7079
|
+
"cache_read": 0.075,
|
|
7080
|
+
"cache_write": 0.041667,
|
|
7081
|
+
"input": 0.75,
|
|
7082
|
+
"output": 3.75,
|
|
7083
|
+
"reasoning": 3.75
|
|
7100
7084
|
},
|
|
7101
7085
|
"max_output_tokens": 65536,
|
|
7102
7086
|
"reasoning_efforts": [
|
|
@@ -7133,7 +7117,7 @@
|
|
|
7133
7117
|
"supports_reasoning": false
|
|
7134
7118
|
},
|
|
7135
7119
|
"google/gemma-3-27b-it": {
|
|
7136
|
-
"context_window":
|
|
7120
|
+
"context_window": 131072,
|
|
7137
7121
|
"cost": {
|
|
7138
7122
|
"cache_read": 0.04,
|
|
7139
7123
|
"input": 0.08,
|
|
@@ -7267,6 +7251,23 @@
|
|
|
7267
7251
|
"supports_pdf_input": false,
|
|
7268
7252
|
"supports_reasoning": false
|
|
7269
7253
|
},
|
|
7254
|
+
"ibm-granite/granite-4.2-8b": {
|
|
7255
|
+
"context_window": 131072,
|
|
7256
|
+
"cost": {
|
|
7257
|
+
"cache_read": 0.05,
|
|
7258
|
+
"input": 0.1,
|
|
7259
|
+
"output": 0.15
|
|
7260
|
+
},
|
|
7261
|
+
"max_output_tokens": 117964,
|
|
7262
|
+
"reasoning_efforts": [
|
|
7263
|
+
"none",
|
|
7264
|
+
"low",
|
|
7265
|
+
"high"
|
|
7266
|
+
],
|
|
7267
|
+
"supports_image_input": false,
|
|
7268
|
+
"supports_pdf_input": false,
|
|
7269
|
+
"supports_reasoning": true
|
|
7270
|
+
},
|
|
7270
7271
|
"inception/mercury-2": {
|
|
7271
7272
|
"context_window": 128000,
|
|
7272
7273
|
"cost": {
|
|
@@ -7298,18 +7299,17 @@
|
|
|
7298
7299
|
"supports_pdf_input": false,
|
|
7299
7300
|
"supports_reasoning": true
|
|
7300
7301
|
},
|
|
7301
|
-
"
|
|
7302
|
-
"context_window":
|
|
7302
|
+
"inclusionai/ling-3.0-flash-fin:free": {
|
|
7303
|
+
"context_window": 262144,
|
|
7303
7304
|
"cost": {
|
|
7304
|
-
"
|
|
7305
|
-
"
|
|
7306
|
-
"output": 0.6
|
|
7305
|
+
"input": 0,
|
|
7306
|
+
"output": 0
|
|
7307
7307
|
},
|
|
7308
|
-
"max_output_tokens":
|
|
7309
|
-
"reasoning_efforts":
|
|
7308
|
+
"max_output_tokens": 32768,
|
|
7309
|
+
"reasoning_efforts": [],
|
|
7310
7310
|
"supports_image_input": false,
|
|
7311
7311
|
"supports_pdf_input": false,
|
|
7312
|
-
"supports_reasoning":
|
|
7312
|
+
"supports_reasoning": true
|
|
7313
7313
|
},
|
|
7314
7314
|
"kwaipilot/kat-coder-pro-v2": {
|
|
7315
7315
|
"context_window": 262144,
|
|
@@ -7318,20 +7318,20 @@
|
|
|
7318
7318
|
"input": 0.3,
|
|
7319
7319
|
"output": 1.2
|
|
7320
7320
|
},
|
|
7321
|
-
"max_output_tokens":
|
|
7321
|
+
"max_output_tokens": 144000,
|
|
7322
7322
|
"reasoning_efforts": null,
|
|
7323
7323
|
"supports_image_input": false,
|
|
7324
7324
|
"supports_pdf_input": false,
|
|
7325
7325
|
"supports_reasoning": false
|
|
7326
7326
|
},
|
|
7327
7327
|
"kwaipilot/kat-coder-pro-v2.5": {
|
|
7328
|
-
"context_window":
|
|
7328
|
+
"context_window": 262144,
|
|
7329
7329
|
"cost": {
|
|
7330
7330
|
"cache_read": 0.15,
|
|
7331
7331
|
"input": 0.74,
|
|
7332
7332
|
"output": 2.96
|
|
7333
7333
|
},
|
|
7334
|
-
"max_output_tokens":
|
|
7334
|
+
"max_output_tokens": 235929,
|
|
7335
7335
|
"reasoning_efforts": null,
|
|
7336
7336
|
"supports_image_input": false,
|
|
7337
7337
|
"supports_pdf_input": false,
|
|
@@ -7352,7 +7352,7 @@
|
|
|
7352
7352
|
"mancer/weaver": {
|
|
7353
7353
|
"context_window": 8000,
|
|
7354
7354
|
"cost": {
|
|
7355
|
-
"input": 0.
|
|
7355
|
+
"input": 0.4,
|
|
7356
7356
|
"output": 0.75
|
|
7357
7357
|
},
|
|
7358
7358
|
"max_output_tokens": 6000,
|
|
@@ -7440,9 +7440,9 @@
|
|
|
7440
7440
|
"context_window": 1048576,
|
|
7441
7441
|
"cost": {
|
|
7442
7442
|
"input": 0.2,
|
|
7443
|
-
"output": 0.
|
|
7443
|
+
"output": 0.696
|
|
7444
7444
|
},
|
|
7445
|
-
"max_output_tokens":
|
|
7445
|
+
"max_output_tokens": 115200,
|
|
7446
7446
|
"reasoning_efforts": null,
|
|
7447
7447
|
"supports_image_input": true,
|
|
7448
7448
|
"supports_pdf_input": false,
|
|
@@ -7451,11 +7451,10 @@
|
|
|
7451
7451
|
"meta-llama/llama-4-scout": {
|
|
7452
7452
|
"context_window": 1310720,
|
|
7453
7453
|
"cost": {
|
|
7454
|
-
"
|
|
7455
|
-
"
|
|
7456
|
-
"output": 0.34
|
|
7454
|
+
"input": 0.1,
|
|
7455
|
+
"output": 0.3
|
|
7457
7456
|
},
|
|
7458
|
-
"max_output_tokens":
|
|
7457
|
+
"max_output_tokens": 16384,
|
|
7459
7458
|
"reasoning_efforts": null,
|
|
7460
7459
|
"supports_image_input": true,
|
|
7461
7460
|
"supports_pdf_input": false,
|
|
@@ -7477,10 +7476,10 @@
|
|
|
7477
7476
|
"context_window": 131072,
|
|
7478
7477
|
"cost": {
|
|
7479
7478
|
"cache_read": 0.04,
|
|
7480
|
-
"input": 0.
|
|
7481
|
-
"output": 1.
|
|
7479
|
+
"input": 0.3,
|
|
7480
|
+
"output": 1.2
|
|
7482
7481
|
},
|
|
7483
|
-
"max_output_tokens":
|
|
7482
|
+
"max_output_tokens": 16384,
|
|
7484
7483
|
"reasoning_efforts": [
|
|
7485
7484
|
"low",
|
|
7486
7485
|
"medium",
|
|
@@ -7713,9 +7712,9 @@
|
|
|
7713
7712
|
"mistralai/devstral-2512": {
|
|
7714
7713
|
"context_window": 262144,
|
|
7715
7714
|
"cost": {
|
|
7716
|
-
"cache_read": 0.
|
|
7717
|
-
"input": 0.
|
|
7718
|
-
"output": 2
|
|
7715
|
+
"cache_read": 0.04,
|
|
7716
|
+
"input": 0.4,
|
|
7717
|
+
"output": 2
|
|
7719
7718
|
},
|
|
7720
7719
|
"max_output_tokens": 209715,
|
|
7721
7720
|
"reasoning_efforts": null,
|
|
@@ -7749,18 +7748,6 @@
|
|
|
7749
7748
|
"supports_pdf_input": false,
|
|
7750
7749
|
"supports_reasoning": false
|
|
7751
7750
|
},
|
|
7752
|
-
"mistralai/ministral-8b": {
|
|
7753
|
-
"context_window": 128000,
|
|
7754
|
-
"cost": {
|
|
7755
|
-
"input": 0.11,
|
|
7756
|
-
"output": 0.11
|
|
7757
|
-
},
|
|
7758
|
-
"max_output_tokens": 102400,
|
|
7759
|
-
"reasoning_efforts": null,
|
|
7760
|
-
"supports_image_input": false,
|
|
7761
|
-
"supports_pdf_input": false,
|
|
7762
|
-
"supports_reasoning": false
|
|
7763
|
-
},
|
|
7764
7751
|
"mistralai/ministral-8b-2512": {
|
|
7765
7752
|
"context_window": 262144,
|
|
7766
7753
|
"cost": {
|
|
@@ -7945,13 +7932,13 @@
|
|
|
7945
7932
|
"supports_reasoning": false
|
|
7946
7933
|
},
|
|
7947
7934
|
"mistralai/voxtral-small-24b-2507": {
|
|
7948
|
-
"context_window":
|
|
7935
|
+
"context_window": 32768,
|
|
7949
7936
|
"cost": {
|
|
7950
7937
|
"cache_read": 0.01,
|
|
7951
7938
|
"input": 0.1,
|
|
7952
7939
|
"output": 0.3
|
|
7953
7940
|
},
|
|
7954
|
-
"max_output_tokens":
|
|
7941
|
+
"max_output_tokens": 26214,
|
|
7955
7942
|
"reasoning_efforts": null,
|
|
7956
7943
|
"supports_image_input": false,
|
|
7957
7944
|
"supports_pdf_input": true,
|
|
@@ -7997,9 +7984,9 @@
|
|
|
7997
7984
|
"moonshotai/kimi-k2.5": {
|
|
7998
7985
|
"context_window": 262144,
|
|
7999
7986
|
"cost": {
|
|
8000
|
-
"cache_read": 0.
|
|
8001
|
-
"input": 0.
|
|
8002
|
-
"output":
|
|
7987
|
+
"cache_read": 0.07,
|
|
7988
|
+
"input": 0.45,
|
|
7989
|
+
"output": 2.25
|
|
8003
7990
|
},
|
|
8004
7991
|
"max_output_tokens": 235929,
|
|
8005
7992
|
"reasoning_efforts": [],
|
|
@@ -8204,13 +8191,13 @@
|
|
|
8204
8191
|
"supports_reasoning": true
|
|
8205
8192
|
},
|
|
8206
8193
|
"nvidia/nemotron-3-ultra-550b-a55b": {
|
|
8207
|
-
"context_window":
|
|
8194
|
+
"context_window": 262144,
|
|
8208
8195
|
"cost": {
|
|
8209
|
-
"cache_read": 0.
|
|
8210
|
-
"input": 0.
|
|
8211
|
-
"output":
|
|
8196
|
+
"cache_read": 0.1,
|
|
8197
|
+
"input": 0.5,
|
|
8198
|
+
"output": 2.2
|
|
8212
8199
|
},
|
|
8213
|
-
"max_output_tokens":
|
|
8200
|
+
"max_output_tokens": 16384,
|
|
8214
8201
|
"reasoning_efforts": [
|
|
8215
8202
|
"medium",
|
|
8216
8203
|
"high"
|
|
@@ -9821,10 +9808,10 @@
|
|
|
9821
9808
|
"qwen/qwen3-vl-30b-a3b-instruct": {
|
|
9822
9809
|
"context_window": 262144,
|
|
9823
9810
|
"cost": {
|
|
9824
|
-
"input": 0.
|
|
9825
|
-
"output": 0.
|
|
9811
|
+
"input": 0.15,
|
|
9812
|
+
"output": 0.6
|
|
9826
9813
|
},
|
|
9827
|
-
"max_output_tokens":
|
|
9814
|
+
"max_output_tokens": 16384,
|
|
9828
9815
|
"reasoning_efforts": null,
|
|
9829
9816
|
"supports_image_input": true,
|
|
9830
9817
|
"supports_pdf_input": false,
|
|
@@ -9881,10 +9868,10 @@
|
|
|
9881
9868
|
"qwen/qwen3.5-122b-a10b": {
|
|
9882
9869
|
"context_window": 262144,
|
|
9883
9870
|
"cost": {
|
|
9884
|
-
"input": 0.
|
|
9885
|
-
"output": 2.
|
|
9871
|
+
"input": 0.29,
|
|
9872
|
+
"output": 2.4
|
|
9886
9873
|
},
|
|
9887
|
-
"max_output_tokens":
|
|
9874
|
+
"max_output_tokens": 81920,
|
|
9888
9875
|
"reasoning_efforts": [],
|
|
9889
9876
|
"supports_image_input": true,
|
|
9890
9877
|
"supports_pdf_input": false,
|
|
@@ -9994,10 +9981,11 @@
|
|
|
9994
9981
|
"qwen/qwen3.6-27b": {
|
|
9995
9982
|
"context_window": 262144,
|
|
9996
9983
|
"cost": {
|
|
9997
|
-
"
|
|
9998
|
-
"
|
|
9984
|
+
"cache_read": 0.12,
|
|
9985
|
+
"input": 0.6,
|
|
9986
|
+
"output": 3.6
|
|
9999
9987
|
},
|
|
10000
|
-
"max_output_tokens":
|
|
9988
|
+
"max_output_tokens": 235929,
|
|
10001
9989
|
"reasoning_efforts": [],
|
|
10002
9990
|
"supports_image_input": true,
|
|
10003
9991
|
"supports_pdf_input": false,
|
|
@@ -10153,7 +10141,7 @@
|
|
|
10153
10141
|
"input": 2,
|
|
10154
10142
|
"output": 6
|
|
10155
10143
|
},
|
|
10156
|
-
"max_output_tokens":
|
|
10144
|
+
"max_output_tokens": 262144,
|
|
10157
10145
|
"reasoning_efforts": [
|
|
10158
10146
|
"low",
|
|
10159
10147
|
"medium",
|
|
@@ -10451,26 +10439,31 @@
|
|
|
10451
10439
|
"supports_pdf_input": false,
|
|
10452
10440
|
"supports_reasoning": true
|
|
10453
10441
|
},
|
|
10454
|
-
"
|
|
10455
|
-
"context_window":
|
|
10442
|
+
"tencent/hy4-preview": {
|
|
10443
|
+
"context_window": 1048576,
|
|
10456
10444
|
"cost": {
|
|
10457
|
-
"cache_read": 0.
|
|
10458
|
-
"input": 0.
|
|
10459
|
-
"output":
|
|
10445
|
+
"cache_read": 0.042,
|
|
10446
|
+
"input": 0.834,
|
|
10447
|
+
"output": 2.501
|
|
10460
10448
|
},
|
|
10461
|
-
"max_output_tokens":
|
|
10462
|
-
"reasoning_efforts":
|
|
10449
|
+
"max_output_tokens": 64000,
|
|
10450
|
+
"reasoning_efforts": [
|
|
10451
|
+
"none",
|
|
10452
|
+
"low",
|
|
10453
|
+
"high"
|
|
10454
|
+
],
|
|
10463
10455
|
"supports_image_input": false,
|
|
10464
10456
|
"supports_pdf_input": false,
|
|
10465
|
-
"supports_reasoning":
|
|
10457
|
+
"supports_reasoning": true
|
|
10466
10458
|
},
|
|
10467
|
-
"thedrummer/
|
|
10468
|
-
"context_window":
|
|
10459
|
+
"thedrummer/cydonia-24b-v4.1": {
|
|
10460
|
+
"context_window": 131072,
|
|
10469
10461
|
"cost": {
|
|
10470
|
-
"
|
|
10462
|
+
"cache_read": 0.15,
|
|
10463
|
+
"input": 0.3,
|
|
10471
10464
|
"output": 0.5
|
|
10472
10465
|
},
|
|
10473
|
-
"max_output_tokens":
|
|
10466
|
+
"max_output_tokens": 117964,
|
|
10474
10467
|
"reasoning_efforts": null,
|
|
10475
10468
|
"supports_image_input": false,
|
|
10476
10469
|
"supports_pdf_input": false,
|
|
@@ -10504,11 +10497,11 @@
|
|
|
10504
10497
|
"thinkingmachines/inkling": {
|
|
10505
10498
|
"context_window": 1048576,
|
|
10506
10499
|
"cost": {
|
|
10507
|
-
"cache_read": 0.
|
|
10508
|
-
"input":
|
|
10500
|
+
"cache_read": 0.17,
|
|
10501
|
+
"input": 1,
|
|
10509
10502
|
"output": 4.05
|
|
10510
10503
|
},
|
|
10511
|
-
"max_output_tokens":
|
|
10504
|
+
"max_output_tokens": 471859,
|
|
10512
10505
|
"reasoning_efforts": [
|
|
10513
10506
|
"none",
|
|
10514
10507
|
"minimal",
|
|
@@ -10920,11 +10913,11 @@
|
|
|
10920
10913
|
"z-ai/glm-5.1": {
|
|
10921
10914
|
"context_window": 204800,
|
|
10922
10915
|
"cost": {
|
|
10923
|
-
"cache_read": 0.
|
|
10924
|
-
"input":
|
|
10925
|
-
"output": 3.
|
|
10916
|
+
"cache_read": 0.1794,
|
|
10917
|
+
"input": 0.966,
|
|
10918
|
+
"output": 3.036
|
|
10926
10919
|
},
|
|
10927
|
-
"max_output_tokens":
|
|
10920
|
+
"max_output_tokens": 128000,
|
|
10928
10921
|
"reasoning_efforts": [],
|
|
10929
10922
|
"supports_image_input": false,
|
|
10930
10923
|
"supports_pdf_input": false,
|
|
@@ -10962,7 +10955,7 @@
|
|
|
10962
10955
|
"supports_reasoning": true
|
|
10963
10956
|
},
|
|
10964
10957
|
"z-ai/glm-5.3": {
|
|
10965
|
-
"context_window":
|
|
10958
|
+
"context_window": 1310720,
|
|
10966
10959
|
"cost": {
|
|
10967
10960
|
"cache_read": 0.26,
|
|
10968
10961
|
"input": 1.4,
|
|
@@ -11085,11 +11078,11 @@
|
|
|
11085
11078
|
"~deepseek/deepseek-v4-flash-latest": {
|
|
11086
11079
|
"context_window": 1310720,
|
|
11087
11080
|
"cost": {
|
|
11088
|
-
"cache_read": 0.
|
|
11089
|
-
"input": 0.
|
|
11090
|
-
"output": 0.
|
|
11081
|
+
"cache_read": 0.013,
|
|
11082
|
+
"input": 0.05,
|
|
11083
|
+
"output": 0.16
|
|
11091
11084
|
},
|
|
11092
|
-
"max_output_tokens":
|
|
11085
|
+
"max_output_tokens": 393216,
|
|
11093
11086
|
"reasoning_efforts": [
|
|
11094
11087
|
"low",
|
|
11095
11088
|
"high",
|
|
@@ -11102,11 +11095,11 @@
|
|
|
11102
11095
|
"~google/gemini-flash-latest": {
|
|
11103
11096
|
"context_window": 1048576,
|
|
11104
11097
|
"cost": {
|
|
11105
|
-
"cache_read": 0.
|
|
11106
|
-
"cache_write": 0.
|
|
11107
|
-
"input": 0.
|
|
11108
|
-
"output":
|
|
11109
|
-
"reasoning":
|
|
11098
|
+
"cache_read": 0.075,
|
|
11099
|
+
"cache_write": 0.041667,
|
|
11100
|
+
"input": 0.75,
|
|
11101
|
+
"output": 3.75,
|
|
11102
|
+
"reasoning": 3.75
|
|
11110
11103
|
},
|
|
11111
11104
|
"max_output_tokens": 65536,
|
|
11112
11105
|
"reasoning_efforts": [
|
|
@@ -11238,13 +11231,13 @@
|
|
|
11238
11231
|
"supports_reasoning": true
|
|
11239
11232
|
},
|
|
11240
11233
|
"~z-ai/glm-latest": {
|
|
11241
|
-
"context_window":
|
|
11234
|
+
"context_window": 1310720,
|
|
11242
11235
|
"cost": {
|
|
11243
|
-
"cache_read": 0.
|
|
11244
|
-
"input": 1.
|
|
11245
|
-
"output":
|
|
11236
|
+
"cache_read": 0.234,
|
|
11237
|
+
"input": 1.17,
|
|
11238
|
+
"output": 3.96
|
|
11246
11239
|
},
|
|
11247
|
-
"max_output_tokens":
|
|
11240
|
+
"max_output_tokens": 943718,
|
|
11248
11241
|
"reasoning_efforts": [
|
|
11249
11242
|
"low",
|
|
11250
11243
|
"high",
|
|
@@ -6,7 +6,7 @@ import hashlib
|
|
|
6
6
|
from collections.abc import AsyncIterator
|
|
7
7
|
from typing import Any, cast, override
|
|
8
8
|
|
|
9
|
-
import
|
|
9
|
+
import httpx2
|
|
10
10
|
from anthropic import APIError, AsyncAnthropic
|
|
11
11
|
|
|
12
12
|
from mycode.messages import (
|
|
@@ -150,7 +150,7 @@ class AnthropicLikeAdapter(ProviderAdapter):
|
|
|
150
150
|
base_url=self.resolve_base_url(request.api_base),
|
|
151
151
|
# connect stays at the SDK's 5s default; retries are owned
|
|
152
152
|
# by the Agent runtime.
|
|
153
|
-
timeout=
|
|
153
|
+
timeout=httpx2.Timeout(request.request_timeout, connect=5.0),
|
|
154
154
|
max_retries=0,
|
|
155
155
|
) as client,
|
|
156
156
|
client.messages.stream(**self._build_request_payload(request)) as stream,
|
|
@@ -172,7 +172,7 @@ class AnthropicLikeAdapter(ProviderAdapter):
|
|
|
172
172
|
yield ProviderStreamEvent("text_delta", {"text": text})
|
|
173
173
|
|
|
174
174
|
final_message = await stream.get_final_message()
|
|
175
|
-
except (APIError,
|
|
175
|
+
except (APIError, httpx2.HTTPError) as exc:
|
|
176
176
|
error = normalize_provider_error(exc, self.provider_id)
|
|
177
177
|
if self.provider_id == "anthropic" and getattr(exc, "type", None) in _RETRYABLE_ANTHROPIC_ERROR_TYPES:
|
|
178
178
|
error.retryable = True
|
|
@@ -14,7 +14,7 @@ from collections.abc import AsyncIterator
|
|
|
14
14
|
from dataclasses import dataclass, field
|
|
15
15
|
from typing import Any, Literal
|
|
16
16
|
|
|
17
|
-
import
|
|
17
|
+
import httpx2
|
|
18
18
|
|
|
19
19
|
from mycode.attachments import unsupported_attachment_block
|
|
20
20
|
from mycode.compact import apply_compact_replay
|
|
@@ -61,7 +61,7 @@ def normalize_provider_error(exc: Exception, provider_id: str) -> ProviderError:
|
|
|
61
61
|
"""Project one SDK exception onto the shared :class:`ProviderError` shape.
|
|
62
62
|
|
|
63
63
|
Works on duck-typed attributes shared by the openai/anthropic SDKs
|
|
64
|
-
(``status_code``, ``response``) and google-genai (``code``), plus the
|
|
64
|
+
(``status_code``, ``response``) and google-genai (``code``), plus the HTTPX2
|
|
65
65
|
transport exceptions all three surface directly or as ``__cause__``.
|
|
66
66
|
"""
|
|
67
67
|
|
|
@@ -71,8 +71,8 @@ def normalize_provider_error(exc: Exception, provider_id: str) -> ProviderError:
|
|
|
71
71
|
status_code = raw_status if isinstance(raw_status, int) and 400 <= raw_status <= 599 else None
|
|
72
72
|
|
|
73
73
|
# TimeoutException is a TransportError subclass — check it first.
|
|
74
|
-
timed_out = isinstance(exc,
|
|
75
|
-
connection_failed = isinstance(exc,
|
|
74
|
+
timed_out = isinstance(exc, httpx2.TimeoutException) or isinstance(exc.__cause__, httpx2.TimeoutException)
|
|
75
|
+
connection_failed = isinstance(exc, httpx2.TransportError) or isinstance(exc.__cause__, httpx2.TransportError)
|
|
76
76
|
|
|
77
77
|
if status_code is not None:
|
|
78
78
|
reason = "http_status"
|
|
@@ -87,7 +87,7 @@ def normalize_provider_error(exc: Exception, provider_id: str) -> ProviderError:
|
|
|
87
87
|
reason = "provider_error"
|
|
88
88
|
retryable = False
|
|
89
89
|
|
|
90
|
-
# str(
|
|
90
|
+
# str(httpx2.ReadTimeout()) is empty — fall back to type and phase.
|
|
91
91
|
message = str(exc).strip() or f"{type(exc).__name__} while streaming from {provider_id}"
|
|
92
92
|
|
|
93
93
|
headers = getattr(getattr(exc, "response", None), "headers", None)
|
|
@@ -4,11 +4,10 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
import os
|
|
6
6
|
from collections.abc import AsyncIterator
|
|
7
|
-
from contextlib import suppress
|
|
8
7
|
from typing import Any, override
|
|
9
8
|
from urllib.parse import urlparse
|
|
10
9
|
|
|
11
|
-
import
|
|
10
|
+
import httpx2
|
|
12
11
|
from google import genai
|
|
13
12
|
from google.genai import types
|
|
14
13
|
from google.genai.errors import APIError
|
|
@@ -82,44 +81,46 @@ class GoogleGeminiAdapter(ProviderAdapter):
|
|
|
82
81
|
|
|
83
82
|
@override
|
|
84
83
|
async def stream_turn(self, request: ProviderRequest) -> AsyncIterator[ProviderStreamEvent]:
|
|
85
|
-
client = self._build_client(request)
|
|
86
|
-
|
|
87
84
|
blocks: list[dict[str, Any]] = []
|
|
88
85
|
response_id: str | None = None
|
|
89
86
|
finish_reason: str | None = None
|
|
90
87
|
finish_message: str | None = None
|
|
91
88
|
usage: dict[str, Any] | None = None
|
|
92
89
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
90
|
+
with httpx2.Client(follow_redirects=True) as http_client:
|
|
91
|
+
async with httpx2.AsyncClient(follow_redirects=True) as http_async_client:
|
|
92
|
+
http_options = self._http_options(request)
|
|
93
|
+
http_options.httpx_client = http_client
|
|
94
|
+
http_options.httpx_async_client = http_async_client
|
|
95
|
+
client = self._build_client(request, http_options)
|
|
96
|
+
|
|
97
|
+
try:
|
|
98
|
+
stream = await client.aio.models.generate_content_stream(
|
|
99
|
+
model=request.model,
|
|
100
|
+
contents=self._build_contents(request),
|
|
101
|
+
config=self._build_config(request),
|
|
102
|
+
)
|
|
103
|
+
started = False
|
|
104
|
+
async for chunk in stream:
|
|
105
|
+
if not started:
|
|
106
|
+
started = True
|
|
107
|
+
yield ProviderStreamEvent("stream_started")
|
|
108
|
+
response_id = response_id or getattr(chunk, "response_id", None)
|
|
109
|
+
usage = _to_json(getattr(chunk, "usage_metadata", None)) or usage
|
|
110
|
+
|
|
111
|
+
candidates = getattr(chunk, "candidates", None) or []
|
|
112
|
+
if not candidates:
|
|
113
|
+
continue
|
|
114
|
+
candidate = candidates[0]
|
|
115
|
+
|
|
116
|
+
finish_reason = _to_json(getattr(candidate, "finish_reason", None)) or finish_reason
|
|
117
|
+
finish_message = getattr(candidate, "finish_message", None) or finish_message
|
|
118
|
+
|
|
119
|
+
for part in getattr(getattr(candidate, "content", None), "parts", None) or []:
|
|
120
|
+
if event := self._consume_part(blocks, part):
|
|
121
|
+
yield event
|
|
122
|
+
except (APIError, httpx2.HTTPError) as exc:
|
|
123
|
+
raise normalize_provider_error(exc, self.provider_id) from exc
|
|
123
124
|
|
|
124
125
|
raw_usage = usage or {}
|
|
125
126
|
# Gemini omits zero-valued counts (proto3), so once a usage payload
|
|
@@ -154,9 +155,13 @@ class GoogleGeminiAdapter(ProviderAdapter):
|
|
|
154
155
|
},
|
|
155
156
|
)
|
|
156
157
|
|
|
157
|
-
def _build_client(
|
|
158
|
+
def _build_client(
|
|
159
|
+
self,
|
|
160
|
+
request: ProviderRequest,
|
|
161
|
+
http_options: types.HttpOptions,
|
|
162
|
+
) -> genai.Client:
|
|
158
163
|
api_key = self.require_api_key(request.api_key)
|
|
159
|
-
return genai.Client(api_key=api_key, http_options=
|
|
164
|
+
return genai.Client(api_key=api_key, http_options=http_options)
|
|
160
165
|
|
|
161
166
|
def _http_options(self, request: ProviderRequest) -> types.HttpOptions:
|
|
162
167
|
base_url = self.resolve_base_url(request.api_base)
|
|
@@ -167,7 +172,7 @@ class GoogleGeminiAdapter(ProviderAdapter):
|
|
|
167
172
|
base_url=base_url,
|
|
168
173
|
api_version=api_version,
|
|
169
174
|
# google-genai only takes a scalar per-request timeout (in ms) that
|
|
170
|
-
# overrides any client-level
|
|
175
|
+
# overrides any client-level httpx2.Timeout, so connect cannot be
|
|
171
176
|
# pinned separately; the Agent's stream_start_timeout bounds it.
|
|
172
177
|
timeout=int(request.request_timeout * 1000),
|
|
173
178
|
# attempts=1 means no retries; retries are owned by the Agent
|
|
@@ -378,7 +383,11 @@ class GoogleVertexAdapter(GoogleGeminiAdapter):
|
|
|
378
383
|
return bool(self.api_key_from_env() or (os.environ.get("GOOGLE_CLOUD_PROJECT") or "").strip())
|
|
379
384
|
|
|
380
385
|
@override
|
|
381
|
-
def _build_client(
|
|
386
|
+
def _build_client(
|
|
387
|
+
self,
|
|
388
|
+
request: ProviderRequest,
|
|
389
|
+
http_options: types.HttpOptions,
|
|
390
|
+
) -> genai.Client:
|
|
382
391
|
api_key = (request.api_key or "").strip() or self.api_key_from_env()
|
|
383
392
|
project = (os.environ.get("GOOGLE_CLOUD_PROJECT") or "").strip() or None
|
|
384
393
|
location = (os.environ.get("GOOGLE_CLOUD_LOCATION") or "").strip() or None
|
|
@@ -392,7 +401,7 @@ class GoogleVertexAdapter(GoogleGeminiAdapter):
|
|
|
392
401
|
api_key=api_key,
|
|
393
402
|
project=project,
|
|
394
403
|
location=location,
|
|
395
|
-
http_options=
|
|
404
|
+
http_options=http_options,
|
|
396
405
|
)
|
|
397
406
|
|
|
398
407
|
@override
|
|
@@ -7,7 +7,7 @@ from collections.abc import AsyncIterator
|
|
|
7
7
|
from dataclasses import dataclass
|
|
8
8
|
from typing import Any, override
|
|
9
9
|
|
|
10
|
-
import
|
|
10
|
+
import httpx2
|
|
11
11
|
from openai import APIError, AsyncOpenAI
|
|
12
12
|
|
|
13
13
|
from mycode.messages import (
|
|
@@ -81,7 +81,7 @@ class OpenAIChatAdapter(ProviderAdapter):
|
|
|
81
81
|
base_url=self.resolve_base_url(request.api_base),
|
|
82
82
|
# connect stays at the SDK's 5s default; retries are owned by
|
|
83
83
|
# the Agent runtime.
|
|
84
|
-
timeout=
|
|
84
|
+
timeout=httpx2.Timeout(request.request_timeout, connect=5.0),
|
|
85
85
|
max_retries=0,
|
|
86
86
|
) as client:
|
|
87
87
|
stream = await client.chat.completions.create(**self._build_request_payload(request), stream=True)
|
|
@@ -128,7 +128,7 @@ class OpenAIChatAdapter(ProviderAdapter):
|
|
|
128
128
|
state.name = function.name
|
|
129
129
|
if function.arguments:
|
|
130
130
|
state.arguments_text += function.arguments
|
|
131
|
-
except (APIError,
|
|
131
|
+
except (APIError, httpx2.HTTPError) as exc:
|
|
132
132
|
raise normalize_provider_error(exc, self.provider_id) from exc
|
|
133
133
|
|
|
134
134
|
blocks = []
|
|
@@ -438,7 +438,7 @@ class AlibabaAdapter(OpenAIChatAdapter):
|
|
|
438
438
|
label = "Alibaba Cloud"
|
|
439
439
|
default_base_url = "https://dashscope.aliyuncs.com/compatible-mode/v1"
|
|
440
440
|
env_api_key_names = ("DASHSCOPE_API_KEY",)
|
|
441
|
-
default_models = ("qwen3.8-max",)
|
|
441
|
+
default_models = ("qwen3.8-max", "qwen3.8-flash")
|
|
442
442
|
auto_discoverable = True
|
|
443
443
|
supports_reasoning_effort = True
|
|
444
444
|
|
|
@@ -7,7 +7,7 @@ from collections.abc import AsyncIterator
|
|
|
7
7
|
from copy import deepcopy
|
|
8
8
|
from typing import Any, cast, override
|
|
9
9
|
|
|
10
|
-
import
|
|
10
|
+
import httpx2
|
|
11
11
|
from openai import APIError, AsyncOpenAI
|
|
12
12
|
|
|
13
13
|
from mycode.messages import (
|
|
@@ -72,7 +72,7 @@ class OpenAIResponsesAdapter(ProviderAdapter):
|
|
|
72
72
|
base_url=self.resolve_base_url(request.api_base),
|
|
73
73
|
# connect stays at the SDK's 5s default; retries are owned by
|
|
74
74
|
# the Agent runtime.
|
|
75
|
-
timeout=
|
|
75
|
+
timeout=httpx2.Timeout(request.request_timeout, connect=5.0),
|
|
76
76
|
max_retries=0,
|
|
77
77
|
) as client:
|
|
78
78
|
stream = await client.responses.create(**payload, stream=True)
|
|
@@ -137,7 +137,7 @@ class OpenAIResponsesAdapter(ProviderAdapter):
|
|
|
137
137
|
)
|
|
138
138
|
},
|
|
139
139
|
)
|
|
140
|
-
except (APIError,
|
|
140
|
+
except (APIError, httpx2.HTTPError) as exc:
|
|
141
141
|
raise normalize_provider_error(exc, self.provider_id) from exc
|
|
142
142
|
|
|
143
143
|
def _build_request_payload(self, request: ProviderRequest) -> dict[str, Any]:
|
|
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
|
|
File without changes
|
|
File without changes
|