vibe/tests/stubs/fake_transcribe_client.py
Mathias Gesbert 626f905186
v2.9.6 (#682)
Co-authored-by: Clément Drouin <clement.drouin@mistral.ai>
Co-authored-by: Michel Thomazo <51709227+michelTho@users.noreply.github.com>
Co-authored-by: Pierre Rossinès <pierre.rossines@mistral.ai>
Co-authored-by: Mistral Vibe <vibe@mistral.ai>
2026-05-11 11:44:53 +02:00

25 lines
704 B
Python

from __future__ import annotations
from collections.abc import AsyncIterator
from typing import Any
from vibe.core.transcribe.transcribe_client_port import TranscribeEvent
class FakeTranscribeClient:
def __init__(
self, *_args: Any, events: list[TranscribeEvent] | None = None, **_kwargs: Any
) -> None:
self._events: list[TranscribeEvent] = events or []
def set_events(self, events: list[TranscribeEvent]) -> None:
self._events = events
async def transcribe(
self, audio_stream: AsyncIterator[bytes]
) -> AsyncIterator[TranscribeEvent]:
for event in self._events:
yield event
async def close(self) -> None:
pass