26 lines
654 B
Python
26 lines
654 B
Python
import asyncio
|
|
import httpx
|
|
import os
|
|
import base64
|
|
from dotenv import load_dotenv
|
|
|
|
load_dotenv()
|
|
SARVAM_API_KEY = os.getenv("SARVAM_API_KEY", "")
|
|
|
|
async def test_batch():
|
|
async with httpx.AsyncClient() as client:
|
|
# Step 1: create job
|
|
create_resp = await client.post(
|
|
"https://api.sarvam.ai/v1/speech-to-text",
|
|
headers={"api-subscription-key": SARVAM_API_KEY},
|
|
json={
|
|
"model": "saaras:v4",
|
|
"with_diarization": True
|
|
}
|
|
)
|
|
print("Create Job:")
|
|
print(create_resp.status_code)
|
|
print(create_resp.text)
|
|
|
|
asyncio.run(test_batch())
|