Skip to content

Commit 265e216

Browse files
feat(api): add file_url, fix event ID
1 parent 1eee5ca commit 265e216

12 files changed

+81
-16
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 111
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-a473967d1766dc155994d932fbc4a5bcbd1c140a37c20d0a4065e1bf0640536d.yml
3-
openapi_spec_hash: 67cdc62b0d6c8b1de29b7dc54b265749
4-
config_hash: 7b53f96f897ca1b3407a5341a6f820db
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-2d116cda53321baa3479e628512def723207a81eb1cdaebb542bd0555e563bda.yml
3+
openapi_spec_hash: 809d958fec261a32004a4b026b718793
4+
config_hash: e74d6791681e3af1b548748ff47a22c2

src/openai/types/audio/transcription.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class UsageTokens(BaseModel):
4646

4747

4848
class UsageDuration(BaseModel):
49-
duration: float
49+
seconds: float
5050
"""Duration of the input audio in seconds."""
5151

5252
type: Literal["duration"]

src/openai/types/audio/transcription_verbose.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212

1313
class Usage(BaseModel):
14-
duration: float
14+
seconds: float
1515
"""Duration of the input audio in seconds."""
1616

1717
type: Literal["duration"]

src/openai/types/beta/realtime/conversation_item_input_audio_transcription_completed_event.py

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,54 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import List, Optional
4-
from typing_extensions import Literal
3+
from typing import List, Union, Optional
4+
from typing_extensions import Literal, TypeAlias
55

66
from ...._models import BaseModel
77

8-
__all__ = ["ConversationItemInputAudioTranscriptionCompletedEvent", "Logprob"]
8+
__all__ = [
9+
"ConversationItemInputAudioTranscriptionCompletedEvent",
10+
"Usage",
11+
"UsageTranscriptTextUsageTokens",
12+
"UsageTranscriptTextUsageTokensInputTokenDetails",
13+
"UsageTranscriptTextUsageDuration",
14+
"Logprob",
15+
]
16+
17+
18+
class UsageTranscriptTextUsageTokensInputTokenDetails(BaseModel):
19+
audio_tokens: Optional[int] = None
20+
"""Number of audio tokens billed for this request."""
21+
22+
text_tokens: Optional[int] = None
23+
"""Number of text tokens billed for this request."""
24+
25+
26+
class UsageTranscriptTextUsageTokens(BaseModel):
27+
input_tokens: int
28+
"""Number of input tokens billed for this request."""
29+
30+
output_tokens: int
31+
"""Number of output tokens generated."""
32+
33+
total_tokens: int
34+
"""Total number of tokens used (input + output)."""
35+
36+
type: Literal["tokens"]
37+
"""The type of the usage object. Always `tokens` for this variant."""
38+
39+
input_token_details: Optional[UsageTranscriptTextUsageTokensInputTokenDetails] = None
40+
"""Details about the input tokens billed for this request."""
41+
42+
43+
class UsageTranscriptTextUsageDuration(BaseModel):
44+
seconds: float
45+
"""Duration of the input audio in seconds."""
46+
47+
type: Literal["duration"]
48+
"""The type of the usage object. Always `duration` for this variant."""
49+
50+
51+
Usage: TypeAlias = Union[UsageTranscriptTextUsageTokens, UsageTranscriptTextUsageDuration]
952

1053

1154
class Logprob(BaseModel):
@@ -37,5 +80,8 @@ class ConversationItemInputAudioTranscriptionCompletedEvent(BaseModel):
3780
The event type, must be `conversation.item.input_audio_transcription.completed`.
3881
"""
3982

83+
usage: Usage
84+
"""Usage statistics for the transcription."""
85+
4086
logprobs: Optional[List[Logprob]] = None
4187
"""The log probabilities of the transcription."""

src/openai/types/file_object.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,19 @@ class FileObject(BaseModel):
2525
"""The object type, which is always `file`."""
2626

2727
purpose: Literal[
28-
"assistants", "assistants_output", "batch", "batch_output", "fine-tune", "fine-tune-results", "vision"
28+
"assistants",
29+
"assistants_output",
30+
"batch",
31+
"batch_output",
32+
"fine-tune",
33+
"fine-tune-results",
34+
"vision",
35+
"user_data",
2936
]
3037
"""The intended purpose of the file.
3138
3239
Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`,
33-
`fine-tune`, `fine-tune-results` and `vision`.
40+
`fine-tune`, `fine-tune-results`, `vision`, and `user_data`.
3441
"""
3542

3643
status: Literal["uploaded", "processed", "error"]

src/openai/types/responses/response_input_file.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,8 @@ class ResponseInputFile(BaseModel):
1818
file_id: Optional[str] = None
1919
"""The ID of the file to be sent to the model."""
2020

21+
file_url: Optional[str] = None
22+
"""The URL of the file to be sent to the model."""
23+
2124
filename: Optional[str] = None
2225
"""The name of the file to be sent to the model."""

src/openai/types/responses/response_input_file_param.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,8 @@ class ResponseInputFileParam(TypedDict, total=False):
1818
file_id: Optional[str]
1919
"""The ID of the file to be sent to the model."""
2020

21+
file_url: str
22+
"""The URL of the file to be sent to the model."""
23+
2124
filename: str
2225
"""The name of the file to be sent to the model."""

src/openai/types/responses/response_mcp_call_arguments_delta_event.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ class ResponseMcpCallArgumentsDeltaEvent(BaseModel):
2020
sequence_number: int
2121
"""The sequence number of this event."""
2222

23-
type: Literal["response.mcp_call.arguments_delta"]
24-
"""The type of the event. Always 'response.mcp_call.arguments_delta'."""
23+
type: Literal["response.mcp_call_arguments.delta"]
24+
"""The type of the event. Always 'response.mcp_call_arguments.delta'."""

src/openai/types/responses/response_mcp_call_arguments_done_event.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ class ResponseMcpCallArgumentsDoneEvent(BaseModel):
2020
sequence_number: int
2121
"""The sequence number of this event."""
2222

23-
type: Literal["response.mcp_call.arguments_done"]
24-
"""The type of the event. Always 'response.mcp_call.arguments_done'."""
23+
type: Literal["response.mcp_call_arguments.done"]
24+
"""The type of the event. Always 'response.mcp_call_arguments.done'."""

src/openai/types/responses/response_output_text_annotation_added_event.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ class ResponseOutputTextAnnotationAddedEvent(BaseModel):
2626
sequence_number: int
2727
"""The sequence number of this event."""
2828

29-
type: Literal["response.output_text_annotation.added"]
30-
"""The type of the event. Always 'response.output_text_annotation.added'."""
29+
type: Literal["response.output_text.annotation.added"]
30+
"""The type of the event. Always 'response.output_text.annotation.added'."""

0 commit comments

Comments
 (0)