v2.6.0 (#524)
Co-authored-by: Clément Drouin <clement.drouin@mistral.ai> Co-authored-by: Clément Sirieix <clement.sirieix@mistral.ai> Co-authored-by: Gauthier Guinet <43207538+Gguinet@users.noreply.github.com> Co-authored-by: Kim-Adeline Miguel <kimadeline.miguel@mistral.ai> Co-authored-by: Michel Thomazo <51709227+michelTho@users.noreply.github.com> Co-authored-by: Quentin <torroba.q@gmail.com> Co-authored-by: Simon <80467011+sorgfresser@users.noreply.github.com> Co-authored-by: Simon Van de Kerckhove <simon.vandekerckhove@mistral.ai> Co-authored-by: Vincent G <10739306+VinceOPS@users.noreply.github.com> Co-authored-by: angelapopopo <angele.lenglemetz@mistral.ai> Co-authored-by: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
parent
5103019b01
commit
eb580209d4
180 changed files with 11136 additions and 1030 deletions
36
tests/stubs/fake_audio_player.py
Normal file
36
tests/stubs/fake_audio_player.py
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Callable
|
||||
|
||||
from vibe.core.audio_player import AlreadyPlayingError
|
||||
from vibe.core.audio_player.audio_player_port import AudioFormat
|
||||
|
||||
|
||||
class FakeAudioPlayer:
|
||||
def __init__(self) -> None:
|
||||
self._playing = False
|
||||
self._on_finished: Callable[[], object] | None = None
|
||||
|
||||
@property
|
||||
def is_playing(self) -> bool:
|
||||
return self._playing
|
||||
|
||||
def play(
|
||||
self,
|
||||
audio_data: bytes,
|
||||
audio_format: AudioFormat,
|
||||
*,
|
||||
on_finished: Callable[[], object] | None = None,
|
||||
) -> None:
|
||||
if self._playing:
|
||||
raise AlreadyPlayingError("Already playing")
|
||||
self._playing = True
|
||||
self._on_finished = on_finished
|
||||
|
||||
def stop(self) -> None:
|
||||
self._playing = False
|
||||
|
||||
def simulate_finished(self) -> None:
|
||||
self._playing = False
|
||||
if self._on_finished is not None:
|
||||
self._on_finished()
|
||||
|
|
@ -6,7 +6,7 @@ from acp import (
|
|||
Agent as AcpAgent,
|
||||
Client,
|
||||
CreateTerminalResponse,
|
||||
KillTerminalCommandResponse,
|
||||
KillTerminalResponse,
|
||||
ReadTextFileResponse,
|
||||
ReleaseTerminalResponse,
|
||||
RequestPermissionResponse,
|
||||
|
|
@ -112,7 +112,7 @@ class FakeClient(Client):
|
|||
|
||||
async def kill_terminal(
|
||||
self, session_id: str, terminal_id: str, **kwargs: Any
|
||||
) -> KillTerminalCommandResponse | None:
|
||||
) -> KillTerminalResponse | None:
|
||||
raise NotImplementedError()
|
||||
|
||||
async def ext_method(self, method: str, params: dict[str, Any]) -> dict[str, Any]:
|
||||
|
|
|
|||
21
tests/stubs/fake_tts_client.py
Normal file
21
tests/stubs/fake_tts_client.py
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
from vibe.core.tts.tts_client_port import TTSResult
|
||||
|
||||
|
||||
class FakeTTSClient:
|
||||
def __init__(
|
||||
self, *_args: Any, result: TTSResult | None = None, **_kwargs: Any
|
||||
) -> None:
|
||||
self._result: TTSResult = result or TTSResult(audio_data=b"fake-audio")
|
||||
|
||||
def set_result(self, result: TTSResult) -> None:
|
||||
self._result = result
|
||||
|
||||
async def speak(self, text: str) -> TTSResult:
|
||||
return self._result
|
||||
|
||||
async def close(self) -> None:
|
||||
pass
|
||||
Loading…
Add table
Add a link
Reference in a new issue