tamar-model-client 0.1.23__py3-none-any.whl → 0.1.24__py3-none-any.whl
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.
- tamar_model_client/exceptions.py +2 -2
- {tamar_model_client-0.1.23.dist-info → tamar_model_client-0.1.24.dist-info}/METADATA +1 -1
- {tamar_model_client-0.1.23.dist-info → tamar_model_client-0.1.24.dist-info}/RECORD +6 -6
- tests/test_google_azure_final.py +4 -4
- {tamar_model_client-0.1.23.dist-info → tamar_model_client-0.1.24.dist-info}/WHEEL +0 -0
- {tamar_model_client-0.1.23.dist-info → tamar_model_client-0.1.24.dist-info}/top_level.txt +0 -0
tamar_model_client/exceptions.py
CHANGED
@@ -65,9 +65,9 @@ RETRY_POLICY = {
|
|
65
65
|
'max_attempts': 3
|
66
66
|
},
|
67
67
|
grpc.StatusCode.INTERNAL: {
|
68
|
-
'retryable':
|
68
|
+
'retryable': False, # 内部错误通常不应重试
|
69
69
|
'check_details': True,
|
70
|
-
'max_attempts':
|
70
|
+
'max_attempts': 0
|
71
71
|
},
|
72
72
|
grpc.StatusCode.UNAUTHENTICATED: {
|
73
73
|
'retryable': True,
|
@@ -3,7 +3,7 @@ tamar_model_client/async_client.py,sha256=H6IhGI415DGXoeNAd4A0anw1oL4Ss3LYdcEVeG
|
|
3
3
|
tamar_model_client/auth.py,sha256=gbwW5Aakeb49PMbmYvrYlVx1mfyn1LEDJ4qQVs-9DA4,438
|
4
4
|
tamar_model_client/circuit_breaker.py,sha256=0XHJXBYA4O8vwsDGwqNrae9zxNJphY5Rfucc9ytVFGA,5419
|
5
5
|
tamar_model_client/error_handler.py,sha256=oI_jUTjnq4OXu8fwJoGXNmQpddEgOFF9ZUhbytq7H6c,12384
|
6
|
-
tamar_model_client/exceptions.py,sha256=
|
6
|
+
tamar_model_client/exceptions.py,sha256=o1SxCiHVPsJwqP3bWIVPPDFcJOKFRg7zdp8oy9eaV3A,13073
|
7
7
|
tamar_model_client/json_formatter.py,sha256=IyBv_pEEzjF-KaMF-7rxRpNc_fxRYK2A-pu_2n4Liow,1990
|
8
8
|
tamar_model_client/logging_icons.py,sha256=MRTZ1Xvkep9ce_jdltj54_XZUXvIpQ95soRNmLdJ4qw,1837
|
9
9
|
tamar_model_client/sync_client.py,sha256=RDM-ptIL0cNIie-2qpkTEFh60XTks8p2Wdz0Q5YHA1Q,36241
|
@@ -27,10 +27,10 @@ tamar_model_client/schemas/inputs.py,sha256=dz1m8NbUIxA99JXZc8WlyzbKpDuz1lEzx3Vg
|
|
27
27
|
tamar_model_client/schemas/outputs.py,sha256=M_fcqUtXPJnfiLabHlyA8BorlC5pYkf5KLjXO1ysKIQ,1031
|
28
28
|
tests/__init__.py,sha256=kbmImddLDwdqlkkmkyKtl4bQy_ipe-R8eskpaBylU9w,38
|
29
29
|
tests/stream_hanging_analysis.py,sha256=W3W48IhQbNAR6-xvMpoWZvnWOnr56CTaH4-aORNBuD4,14807
|
30
|
-
tests/test_google_azure_final.py,sha256=
|
30
|
+
tests/test_google_azure_final.py,sha256=7SaVv8l0n5OXLdzzVOLgK8wC_kFFVx0tULZ8Y9_QAAw,26380
|
31
31
|
tests/test_logging_issue.py,sha256=JTMbotfHpAEPMBj73pOwxPn-Zn4QVQJX6scMz48FRDQ,2427
|
32
32
|
tests/test_simple.py,sha256=Xf0U-J9_xn_LzUsmYu06suK0_7DrPeko8OHoHldsNxE,7169
|
33
|
-
tamar_model_client-0.1.
|
34
|
-
tamar_model_client-0.1.
|
35
|
-
tamar_model_client-0.1.
|
36
|
-
tamar_model_client-0.1.
|
33
|
+
tamar_model_client-0.1.24.dist-info/METADATA,sha256=ilgWWWLCU-vEJe1BmIBXrwGUvG3cnaVh-z49nbIIXcg,23453
|
34
|
+
tamar_model_client-0.1.24.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
35
|
+
tamar_model_client-0.1.24.dist-info/top_level.txt,sha256=f1I-S8iWN-cgv4gB8gxRg9jJOTJMumvm4oGKVPfGg6A,25
|
36
|
+
tamar_model_client-0.1.24.dist-info/RECORD,,
|
tests/test_google_azure_final.py
CHANGED
@@ -27,7 +27,7 @@ test_logger.addHandler(test_handler)
|
|
27
27
|
logger = test_logger
|
28
28
|
|
29
29
|
os.environ['MODEL_MANAGER_SERVER_GRPC_USE_TLS'] = "true"
|
30
|
-
os.environ['MODEL_MANAGER_SERVER_ADDRESS'] = "
|
30
|
+
os.environ['MODEL_MANAGER_SERVER_ADDRESS'] = "localhost:50051"
|
31
31
|
os.environ['MODEL_MANAGER_SERVER_JWT_SECRET_KEY'] = "model-manager-server-jwt-key"
|
32
32
|
|
33
33
|
# 导入客户端模块
|
@@ -414,7 +414,7 @@ def test_concurrent_requests(num_requests: int = 150):
|
|
414
414
|
model="tamar-google-gemini-flash-lite",
|
415
415
|
contents="1+1等于几?",
|
416
416
|
user_context=UserContext(
|
417
|
-
user_id=f"
|
417
|
+
user_id=f"{os.environ.get('INSTANCE_ID', '0')}_{request_id:03d}",
|
418
418
|
org_id="test_org",
|
419
419
|
client_type="concurrent_test"
|
420
420
|
),
|
@@ -533,7 +533,7 @@ async def test_async_concurrent_requests(num_requests: int = 150):
|
|
533
533
|
model="tamar-google-gemini-flash-lite",
|
534
534
|
contents="1+1等于几?",
|
535
535
|
user_context=UserContext(
|
536
|
-
user_id=f"
|
536
|
+
user_id=f"{os.environ.get('INSTANCE_ID', '0')}_{request_id:03d}",
|
537
537
|
org_id="test_org",
|
538
538
|
client_type="async_concurrent_test"
|
539
539
|
),
|
@@ -648,7 +648,7 @@ async def main():
|
|
648
648
|
#test_concurrent_requests(150) # 测试150个并发请求
|
649
649
|
|
650
650
|
# 异步并发测试
|
651
|
-
await test_async_concurrent_requests(
|
651
|
+
await test_async_concurrent_requests(50) # 测试150个异步并发请求
|
652
652
|
|
653
653
|
print("\n✅ 测试完成")
|
654
654
|
|
File without changes
|
File without changes
|