Skip to content

Commit 06e0748

Browse files
release: 2.7.0 (#320)
* codegen metadata * feat(api): add generate_audio, image_reference, media params to videos.create * release: 2.7.0 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent 9f8a8e4 commit 06e0748

8 files changed

Lines changed: 182 additions & 16 deletions

File tree

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "2.6.0"
2+
".": "2.7.0"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 74
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/togetherai%2Ftogetherai-d91fd4a37aa010c545f29c4413b9aef8f556d0a63d3c0e5a7ee36abf1671142d.yml
3-
openapi_spec_hash: d3365b580d695d006648441db545aff8
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/togetherai%2Ftogetherai-76f8801298719cc87e9dc4c64b321bcfd432416d76488499d340b4bb6bf81b9b.yml
3+
openapi_spec_hash: ce0b83ef0a5f174461bd7d13a379b636
44
config_hash: 52d213100a0ca1a4b2cdcd2718936b51

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 2.7.0 (2026-04-03)
4+
5+
Full Changelog: [v2.6.0...v2.7.0](https://github.com/togethercomputer/together-py/compare/v2.6.0...v2.7.0)
6+
7+
### Features
8+
9+
* **api:** add generate_audio, image_reference, media params to videos.create ([b2c5ca7](https://github.com/togethercomputer/together-py/commit/b2c5ca776fa2520e99b4e7c6de8bd1421b4de33f))
10+
311
## 2.6.0 (2026-03-31)
412

513
Full Changelog: [v2.5.0...v2.6.0](https://github.com/togethercomputer/together-py/compare/v2.5.0...v2.6.0)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "together"
3-
version = "2.6.0"
3+
version = "2.7.0"
44
description = "The official Python library for the together API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"

src/together/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
__title__ = "together"
4-
__version__ = "2.6.0" # x-release-please-version
4+
__version__ = "2.7.0" # x-release-please-version

src/together/resources/videos.py

Lines changed: 44 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,17 @@ def create(
5050
model: str,
5151
fps: int | Omit = omit,
5252
frame_images: Iterable[video_create_params.FrameImage] | Omit = omit,
53+
generate_audio: bool | Omit = omit,
5354
guidance_scale: int | Omit = omit,
5455
height: int | Omit = omit,
56+
media: video_create_params.Media | Omit = omit,
5557
negative_prompt: str | Omit = omit,
5658
output_format: Literal["MP4", "WEBM"] | Omit = omit,
5759
output_quality: int | Omit = omit,
5860
prompt: str | Omit = omit,
61+
ratio: str | Omit = omit,
5962
reference_images: SequenceNotStr[str] | Omit = omit,
63+
resolution: str | Omit = omit,
6064
seconds: str | Omit = omit,
6165
seed: int | Omit = omit,
6266
steps: int | Omit = omit,
@@ -76,14 +80,20 @@ def create(
7680
7781
fps: Frames per second. Defaults to 24.
7882
79-
frame_images: Array of images to guide video generation, similar to keyframes.
83+
frame_images: Deprecated: use media.frame_images instead. Array of images to guide video
84+
generation, similar to keyframes.
85+
86+
generate_audio: Whether to generate audio for the video.
8087
8188
guidance_scale: Controls how closely the video generation follows your prompt. Higher values
8289
make the model adhere more strictly to your text description, while lower values
8390
allow more creative freedom. guidence_scale affects both visual content and
8491
temporal consistency.Recommended range is 6.0-10.0 for most video models. Values
8592
above 12 may cause over-guidance artifacts or unnatural motion patterns.
8693
94+
media: Media inputs for video generation. The accepted fields depend on the model type
95+
(e.g. i2v, r2v, t2v, videoedit).
96+
8797
negative_prompt: Similar to prompt, but specifies what to avoid instead of what to include
8898
8999
output_format: Specifies the format of the output video. Defaults to MP4.
@@ -92,9 +102,13 @@ def create(
92102
93103
prompt: Text prompt that describes the video to generate.
94104
95-
reference_images: Unlike frame_images which constrain specific timeline positions, reference
96-
images guide the general appearance that should appear consistently across the
97-
video.
105+
ratio: Aspect ratio of the video.
106+
107+
reference_images: Deprecated: use media.reference_images instead. Unlike frame_images which
108+
constrain specific timeline positions, reference images guide the general
109+
appearance that should appear consistently across the video.
110+
111+
resolution: Video resolution.
98112
99113
seconds: Clip duration in seconds.
100114
@@ -121,13 +135,17 @@ def create(
121135
"model": model,
122136
"fps": fps,
123137
"frame_images": frame_images,
138+
"generate_audio": generate_audio,
124139
"guidance_scale": guidance_scale,
125140
"height": height,
141+
"media": media,
126142
"negative_prompt": negative_prompt,
127143
"output_format": output_format,
128144
"output_quality": output_quality,
129145
"prompt": prompt,
146+
"ratio": ratio,
130147
"reference_images": reference_images,
148+
"resolution": resolution,
131149
"seconds": seconds,
132150
"seed": seed,
133151
"steps": steps,
@@ -204,13 +222,17 @@ async def create(
204222
model: str,
205223
fps: int | Omit = omit,
206224
frame_images: Iterable[video_create_params.FrameImage] | Omit = omit,
225+
generate_audio: bool | Omit = omit,
207226
guidance_scale: int | Omit = omit,
208227
height: int | Omit = omit,
228+
media: video_create_params.Media | Omit = omit,
209229
negative_prompt: str | Omit = omit,
210230
output_format: Literal["MP4", "WEBM"] | Omit = omit,
211231
output_quality: int | Omit = omit,
212232
prompt: str | Omit = omit,
233+
ratio: str | Omit = omit,
213234
reference_images: SequenceNotStr[str] | Omit = omit,
235+
resolution: str | Omit = omit,
214236
seconds: str | Omit = omit,
215237
seed: int | Omit = omit,
216238
steps: int | Omit = omit,
@@ -230,14 +252,20 @@ async def create(
230252
231253
fps: Frames per second. Defaults to 24.
232254
233-
frame_images: Array of images to guide video generation, similar to keyframes.
255+
frame_images: Deprecated: use media.frame_images instead. Array of images to guide video
256+
generation, similar to keyframes.
257+
258+
generate_audio: Whether to generate audio for the video.
234259
235260
guidance_scale: Controls how closely the video generation follows your prompt. Higher values
236261
make the model adhere more strictly to your text description, while lower values
237262
allow more creative freedom. guidence_scale affects both visual content and
238263
temporal consistency.Recommended range is 6.0-10.0 for most video models. Values
239264
above 12 may cause over-guidance artifacts or unnatural motion patterns.
240265
266+
media: Media inputs for video generation. The accepted fields depend on the model type
267+
(e.g. i2v, r2v, t2v, videoedit).
268+
241269
negative_prompt: Similar to prompt, but specifies what to avoid instead of what to include
242270
243271
output_format: Specifies the format of the output video. Defaults to MP4.
@@ -246,9 +274,13 @@ async def create(
246274
247275
prompt: Text prompt that describes the video to generate.
248276
249-
reference_images: Unlike frame_images which constrain specific timeline positions, reference
250-
images guide the general appearance that should appear consistently across the
251-
video.
277+
ratio: Aspect ratio of the video.
278+
279+
reference_images: Deprecated: use media.reference_images instead. Unlike frame_images which
280+
constrain specific timeline positions, reference images guide the general
281+
appearance that should appear consistently across the video.
282+
283+
resolution: Video resolution.
252284
253285
seconds: Clip duration in seconds.
254286
@@ -275,13 +307,17 @@ async def create(
275307
"model": model,
276308
"fps": fps,
277309
"frame_images": frame_images,
310+
"generate_audio": generate_audio,
278311
"guidance_scale": guidance_scale,
279312
"height": height,
313+
"media": media,
280314
"negative_prompt": negative_prompt,
281315
"output_format": output_format,
282316
"output_quality": output_quality,
283317
"prompt": prompt,
318+
"ratio": ratio,
284319
"reference_images": reference_images,
320+
"resolution": resolution,
285321
"seconds": seconds,
286322
"seed": seed,
287323
"steps": steps,

src/together/types/video_create_params.py

Lines changed: 93 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,16 @@
77

88
from .._types import SequenceNotStr
99

10-
__all__ = ["VideoCreateParams", "FrameImage"]
10+
__all__ = [
11+
"VideoCreateParams",
12+
"FrameImage",
13+
"Media",
14+
"MediaAudioInput",
15+
"MediaFrameImage",
16+
"MediaFrameVideo",
17+
"MediaReferenceVideo",
18+
"MediaSourceVideo",
19+
]
1120

1221

1322
class VideoCreateParams(TypedDict, total=False):
@@ -18,7 +27,13 @@ class VideoCreateParams(TypedDict, total=False):
1827
"""Frames per second. Defaults to 24."""
1928

2029
frame_images: Iterable[FrameImage]
21-
"""Array of images to guide video generation, similar to keyframes."""
30+
"""Deprecated: use media.frame_images instead.
31+
32+
Array of images to guide video generation, similar to keyframes.
33+
"""
34+
35+
generate_audio: bool
36+
"""Whether to generate audio for the video."""
2237

2338
guidance_scale: int
2439
"""Controls how closely the video generation follows your prompt.
@@ -32,6 +47,12 @@ class VideoCreateParams(TypedDict, total=False):
3247

3348
height: int
3449

50+
media: Media
51+
"""Media inputs for video generation.
52+
53+
The accepted fields depend on the model type (e.g. i2v, r2v, t2v, videoedit).
54+
"""
55+
3556
negative_prompt: str
3657
"""Similar to prompt, but specifies what to avoid instead of what to include"""
3758

@@ -44,13 +65,20 @@ class VideoCreateParams(TypedDict, total=False):
4465
prompt: str
4566
"""Text prompt that describes the video to generate."""
4667

68+
ratio: str
69+
"""Aspect ratio of the video."""
70+
4771
reference_images: SequenceNotStr[str]
48-
"""
72+
"""Deprecated: use media.reference_images instead.
73+
4974
Unlike frame_images which constrain specific timeline positions, reference
5075
images guide the general appearance that should appear consistently across the
5176
video.
5277
"""
5378

79+
resolution: str
80+
"""Video resolution."""
81+
5482
seconds: str
5583
"""Clip duration in seconds."""
5684

@@ -84,3 +112,65 @@ class FrameImage(TypedDict, total=False):
84112
- If size is two, frames are first and last.
85113
- If size is larger, frames are first, last and evenly spaced between.
86114
"""
115+
116+
117+
class MediaAudioInput(TypedDict, total=False):
118+
audio: Required[str]
119+
"""URL of the audio."""
120+
121+
122+
class MediaFrameImage(TypedDict, total=False):
123+
input_image: Required[str]
124+
"""URL path to hosted image that is used for a frame"""
125+
126+
frame: Union[float, Literal["first", "last"]]
127+
"""Optional param to specify where to insert the frame.
128+
129+
If this is omitted, the following heuristics are applied:
130+
131+
- frame_images size is one, frame is first.
132+
- If size is two, frames are first and last.
133+
- If size is larger, frames are first, last and evenly spaced between.
134+
"""
135+
136+
137+
class MediaFrameVideo(TypedDict, total=False):
138+
video: Required[str]
139+
"""URL of the video."""
140+
141+
142+
class MediaReferenceVideo(TypedDict, total=False):
143+
video: Required[str]
144+
"""URL of the video."""
145+
146+
147+
class MediaSourceVideo(TypedDict, total=False):
148+
"""Source video to edit."""
149+
150+
video: Required[str]
151+
"""URL of the video."""
152+
153+
154+
class Media(TypedDict, total=False):
155+
"""Media inputs for video generation.
156+
157+
The accepted fields depend on the model type (e.g. i2v, r2v, t2v, videoedit).
158+
"""
159+
160+
audio_inputs: Iterable[MediaAudioInput]
161+
"""Array of audio inputs."""
162+
163+
frame_images: Iterable[MediaFrameImage]
164+
"""Array of images to guide video generation at specific timeline positions."""
165+
166+
frame_videos: Iterable[MediaFrameVideo]
167+
"""Array of video clips to use as starting clips."""
168+
169+
reference_images: SequenceNotStr[str]
170+
"""Array of image URLs that guide the general appearance across the video."""
171+
172+
reference_videos: Iterable[MediaReferenceVideo]
173+
"""Array of reference videos."""
174+
175+
source_video: MediaSourceVideo
176+
"""Source video to edit."""

tests/api_resources/test_videos.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,29 @@ def test_method_create_with_all_params(self, client: Together) -> None:
3535
"frame": 0,
3636
}
3737
],
38+
generate_audio=True,
3839
guidance_scale=0,
3940
height=0,
41+
media={
42+
"audio_inputs": [{"audio": "audio"}],
43+
"frame_images": [
44+
{
45+
"input_image": "input_image",
46+
"frame": 0,
47+
}
48+
],
49+
"frame_videos": [{"video": "video"}],
50+
"reference_images": ["string"],
51+
"reference_videos": [{"video": "video"}],
52+
"source_video": {"video": "video"},
53+
},
4054
negative_prompt="negative_prompt",
4155
output_format="MP4",
4256
output_quality=0,
4357
prompt="x",
58+
ratio="ratio",
4459
reference_images=["string"],
60+
resolution="resolution",
4561
seconds="seconds",
4662
seed=0,
4763
steps=10,
@@ -135,13 +151,29 @@ async def test_method_create_with_all_params(self, async_client: AsyncTogether)
135151
"frame": 0,
136152
}
137153
],
154+
generate_audio=True,
138155
guidance_scale=0,
139156
height=0,
157+
media={
158+
"audio_inputs": [{"audio": "audio"}],
159+
"frame_images": [
160+
{
161+
"input_image": "input_image",
162+
"frame": 0,
163+
}
164+
],
165+
"frame_videos": [{"video": "video"}],
166+
"reference_images": ["string"],
167+
"reference_videos": [{"video": "video"}],
168+
"source_video": {"video": "video"},
169+
},
140170
negative_prompt="negative_prompt",
141171
output_format="MP4",
142172
output_quality=0,
143173
prompt="x",
174+
ratio="ratio",
144175
reference_images=["string"],
176+
resolution="resolution",
145177
seconds="seconds",
146178
seed=0,
147179
steps=10,

0 commit comments

Comments
 (0)