Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions src/openai/_client.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,80 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import Any, Dict
from ..._types import NOT_GIVEN, NotGiven
from ..._client import SyncAPIClient, AsyncAPIClient

class Transcriptions:
def __init__(self, client: SyncAPIClient, async_client: AsyncAPIClient):
self._client = client
self._async_client = async_client

def create(
self,
*,
model: str,
file: Any,
**params: Any,
) -> Dict:
# Always enforce transcribe task
params["task"] = "transcribe"
return self._client.post(
f"/audio/transcriptions",
files={"file": file},
data={"model": model, **params},
)

async def create_async(
self,
*,
model: str,
file: Any,
**params: Any,
) -> Dict:
# Always enforce transcribe task
params["task"] = "transcribe"
return await self._async_client.post(
f"/audio/transcriptions",
files={"file": file},
data={"model": model, **params},
)
from typing import Any, Dict
from ..._types import NOT_GIVEN, NotGiven
from ..._client import SyncAPIClient, AsyncAPIClient

class Translations:
def __init__(self, client: SyncAPIClient, async_client: AsyncAPIClient):
self._client = client
self._async_client = async_client

def create(
self,
*,
model: str,
file: Any,
**params: Any,
) -> Dict:
# Always enforce translate task
params["task"] = "translate"
return self._client.post(
f"/audio/translations",
files={"file": file},
data={"model": model, **params},
)

async def create_async(
self,
*,
model: str,
file: Any,
**params: Any,
) -> Dict:
# Always enforce translate task
params["task"] = "translate"
return await self._async_client.post(
f"/audio/translations",
files={"file": file},
data={"model": model, **params},
)

from __future__ import annotations

Expand Down