malek-messaoudii
add gemini api
73d4f3c
raw
history blame
406 Bytes
from services.gemini_client import get_gemini_client
async def speech_to_text(audio_bytes: bytes) -> str:
client = get_gemini_client()
response = client.models.generate_content(
model="gemini-2.5-flash",
contents=[
{
"mime_type": "audio/wav",
"data": audio_bytes
}
]
)
text = response.text
return text