-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaudio_model.py
More file actions
64 lines (49 loc) · 1.94 KB
/
Copy pathaudio_model.py
File metadata and controls
64 lines (49 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
from graxon.audio_models.types import AudioModelCreateParams, AudioModelProvider
from graxon.client import GraxonAsyncClient
import asyncio
async def main():
base_url = "http://localhost:8888"
api_key = "graxon_api_key"
timeout = 60
client = GraxonAsyncClient(api_key=api_key, base_url=base_url, timeout=timeout)
org_id = "test"
# create audio model
create_response = await client.audio_models.create(org_id, request=AudioModelCreateParams(
org_id=org_id,
name="Deepgram Test Model",
model_name="en-US_BroadbandModel Test Model",
model_id="en-US_BroadbandModel",
provider=AudioModelProvider.DEEPGRAM,
description="Deepgram Test Model"
))
print(create_response)
# create multiple audio models
multiple_create_response = await client.audio_models.create_multiple(org_id, [
AudioModelCreateParams(
org_id=org_id,
name="ELEVENLABS Test Model",
model_name="en-ELEVENLABS Test Model",
model_id="en-ELEVENLABS",
provider=AudioModelProvider.ELEVENLABS,
description="ELEVENLABS Test Model"
),
AudioModelCreateParams(
org_id=org_id,
name="ASSEMBLYAI Test Model",
model_name="en-ASSEMBLYAI Test Model",
model_id="en-ASSEMBLYAI",
provider=AudioModelProvider.ASSEMBLYAI,
description="ASSEMBLYAI Test Model"
)
])
print(multiple_create_response)
# get audio model
get_response = await client.audio_models.get(org_id, audio_model_id=create_response.id)
print(get_response)
# list by provider
list_response = await client.audio_models.list_by_provider(org_id, provider=AudioModelProvider.DEEPGRAM)
print(list_response)
# delete audio model
delete_response = await client.audio_models.delete(org_id, audio_model_id=create_response.id)
print(delete_response)
asyncio.run(main())