File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed
src/codeweaver/providers/config/categories Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -223,7 +223,7 @@ def client(self) -> LiteralSDKClient:
223223 with contextlib .suppress (AttributeError , KeyError , ValueError ):
224224 is_sdkclient_member = SDKClient .from_string (self .provider .variable ) is not None
225225 if self .provider .only_uses_own_client and is_sdkclient_member :
226- return cast (" LiteralSDKClient" , SDKClient .from_string (self .provider .variable ))
226+ return cast (LiteralSDKClient , SDKClient .from_string (self .provider .variable ))
227227 if self .provider not in (Provider .AZURE , Provider .HEROKU ):
228228 raise ValueError (
229229 f"Cannot resolve embedding client for provider { self .provider .variable } ." ,
@@ -834,7 +834,7 @@ def validate_model_compatibility(self) -> AsymmetricEmbeddingProviderSettings:
834834 @property
835835 def dimension (self ) -> NonNegativeInt :
836836 """Get the embedding dimension for both models (they must match)."""
837- return cast (" NonNegativeInt" , self .dimension_tuple [0 ] or 0 )
837+ return cast (NonNegativeInt , self .dimension_tuple [0 ] or 0 )
838838
839839 @property
840840 def datatype (self ) -> str :
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ class BaseRerankingProviderSettings(BaseProviderCategorySettings):
9898 @property
9999 def client (self ) -> LiteralSDKClient :
100100 """Return the reranking SDKClient enum member."""
101- return cast (" LiteralSDKClient" , SDKClient .from_string (self .provider .variable ))
101+ return cast (LiteralSDKClient , SDKClient .from_string (self .provider .variable ))
102102
103103 def is_cloud (self ) -> bool :
104104 """Return True if the provider is a cloud provider, False otherwise."""
Original file line number Diff line number Diff line change 1616
1717from datetime import timedelta
1818from pathlib import Path
19- from unittest .mock import AsyncMock , Mock , NonCallableMock
19+ from unittest .mock import AsyncMock , Mock
2020
2121import pytest
2222
@@ -115,8 +115,10 @@ def mock_checkpoint_manager(test_checkpoint_data: dict) -> Mock:
115115 manager .delete = AsyncMock ()
116116 # Some tests may call `load_checkpoint()` instead of `load()`;
117117 # make it an alias so both return the same checkpoint object.
118- manager .load_checkpoint = manager .load
119- manager .validate_checkpoint_compatibility = AsyncMock (return_value = (True , "NONE" ))
118+ if hasattr (manager , "load_checkpoint" ):
119+ manager .load_checkpoint = manager .load
120+ if hasattr (manager , "validate_checkpoint_compatibility" ):
121+ manager .validate_checkpoint_compatibility = AsyncMock (return_value = (True , "NONE" ))
120122
121123 # Configure synchronous fingerprint helpers with real CheckpointSettingsFingerprint
122124 # instances so ConfigChangeAnalyzer's ``is_compatible_with`` comparison works correctly.
You can’t perform that action at this time.
0 commit comments