Initial commit
Co-Authored-By: Quentin Torroba <quentin.torroba@mistral.ai> Co-Authored-By: Laure Hugo <laure.hugo@mistral.ai> Co-Authored-By: Benjamin Trom <benjamin.trom@mistral.ai> Co-Authored-By: Mathias Gesbert <mathias.gesbert@ext.mistral.ai> Co-Authored-By: Michel Thomazo <michel.thomazo@mistral.ai> Co-Authored-By: Clément Drouin <clement.drouin@mistral.ai> Co-Authored-By: Vincent Guilloux <vincent.guilloux@mistral.ai> Co-Authored-By: Valentin Berard <val@mistral.ai> Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
commit
fa15fc977b
200 changed files with 30484 additions and 0 deletions
16
tests/mock/mock_backend_factory.py
Normal file
16
tests/mock/mock_backend_factory.py
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from contextlib import contextmanager
|
||||
|
||||
from vibe.core.config import Backend
|
||||
from vibe.core.llm.backend.factory import BACKEND_FACTORY
|
||||
|
||||
|
||||
@contextmanager
|
||||
def mock_backend_factory(backend_type: Backend, factory_func):
|
||||
original = BACKEND_FACTORY[backend_type]
|
||||
try:
|
||||
BACKEND_FACTORY[backend_type] = factory_func
|
||||
yield
|
||||
finally:
|
||||
BACKEND_FACTORY[backend_type] = original
|
||||
Loading…
Add table
Add a link
Reference in a new issue