Skip to content

Commit bea6acf

Browse files
committed
fix; ci
1 parent 9b697c8 commit bea6acf

File tree

4 files changed

+22
-0
lines changed

4 files changed

+22
-0
lines changed

tests/models/test_cohere.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,20 @@ def test_init():
6262
assert m.base_url == 'https://api.cohere.com'
6363

6464

65+
@dataclass
66+
class MockClientWrapper:
67+
def get_base_url(self) -> str:
68+
return 'https://api.cohere.com'
69+
70+
6571
@dataclass
6672
class MockAsyncClientV2:
6773
completions: MockChatResponse | Sequence[MockChatResponse] | None = None
6874
index = 0
75+
_client_wrapper: MockClientWrapper = None # type: ignore
76+
77+
def __post_init__(self):
78+
self._client_wrapper = MockClientWrapper()
6979

7080
@classmethod
7181
def create_mock(cls, completions: MockChatResponse | Sequence[MockChatResponse]) -> AsyncClientV2:

tests/models/test_groq.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ class MockGroq:
9797
completions: MockChatCompletion | Sequence[MockChatCompletion] | None = None
9898
stream: Sequence[MockChatCompletionChunk] | Sequence[Sequence[MockChatCompletionChunk]] | None = None
9999
index: int = 0
100+
base_url: str = 'https://api.groq.com/openai/v1'
100101

101102
@cached_property
102103
def chat(self) -> Any:

tests/models/test_huggingface.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ class MockHuggingFace:
8080
stream: Sequence[MockStreamEvent] | Sequence[Sequence[MockStreamEvent]] | None = None
8181
index: int = 0
8282
chat_completion_kwargs: list[dict[str, Any]] = field(default_factory=list)
83+
model: str = 'hf-model'
8384

8485
@cached_property
8586
def chat(self) -> Any:

tests/models/test_mistral.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,22 @@
6969
]
7070

7171

72+
@dataclass
73+
class MockSdkConfiguration:
74+
def get_server_details(self) -> tuple[str, ...]:
75+
return ('https://api.mistral.ai/v1',)
76+
77+
7278
@dataclass
7379
class MockMistralAI:
7480
completions: MockChatCompletion | Sequence[MockChatCompletion] | None = None
7581
stream: Sequence[MockCompletionEvent] | Sequence[Sequence[MockCompletionEvent]] | None = None
7682
index: int = 0
7783

84+
@cached_property
85+
def sdk_configuration(self) -> MockSdkConfiguration:
86+
return MockSdkConfiguration()
87+
7888
@cached_property
7989
def chat(self) -> Any:
8090
if self.stream:

0 commit comments

Comments
 (0)