@@ -35,7 +35,7 @@ func NewImageService(opts ...option.RequestOption) (r ImageService) {
3535}
3636
3737// Use an image model to generate an image for a given prompt.
38- func (r * ImageService ) New (ctx context.Context , body ImageNewParams , opts ... option.RequestOption ) (res * ImageFile , err error ) {
38+ func (r * ImageService ) Generate (ctx context.Context , body ImageGenerateParams , opts ... option.RequestOption ) (res * ImageFile , err error ) {
3939 opts = slices .Concat (r .Options , opts )
4040 path := "images/generations"
4141 err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , body , & res , opts ... )
@@ -192,11 +192,11 @@ const (
192192 ImageFileObjectList ImageFileObject = "list"
193193)
194194
195- type ImageNewParams struct {
195+ type ImageGenerateParams struct {
196196 // The model to use for image generation.
197197 //
198198 // [See all of Together AI's image models](https://docs.together.ai/docs/serverless-models#image-models)
199- Model ImageNewParamsModel `json:"model,omitzero,required"`
199+ Model ImageGenerateParamsModel `json:"model,omitzero,required"`
200200 // A description of the desired images. Maximum length varies by model.
201201 Prompt string `json:"prompt,required"`
202202 // If true, disables the safety checker for image generation.
@@ -221,40 +221,40 @@ type ImageNewParams struct {
221221 Width param.Opt [int64 ] `json:"width,omitzero"`
222222 // An array of objects that define LoRAs (Low-Rank Adaptations) to influence the
223223 // generated image.
224- ImageLoras []ImageNewParamsImageLora `json:"image_loras,omitzero"`
224+ ImageLoras []ImageGenerateParamsImageLora `json:"image_loras,omitzero"`
225225 // The format of the image response. Can be either be `jpeg` or `png`. Defaults to
226226 // `jpeg`.
227227 //
228228 // Any of "jpeg", "png".
229- OutputFormat ImageNewParamsOutputFormat `json:"output_format,omitzero"`
229+ OutputFormat ImageGenerateParamsOutputFormat `json:"output_format,omitzero"`
230230 // Format of the image response. Can be either a base64 string or a URL.
231231 //
232232 // Any of "base64", "url".
233- ResponseFormat ImageNewParamsResponseFormat `json:"response_format,omitzero"`
233+ ResponseFormat ImageGenerateParamsResponseFormat `json:"response_format,omitzero"`
234234 paramObj
235235}
236236
237- func (r ImageNewParams ) MarshalJSON () (data []byte , err error ) {
238- type shadow ImageNewParams
237+ func (r ImageGenerateParams ) MarshalJSON () (data []byte , err error ) {
238+ type shadow ImageGenerateParams
239239 return param .MarshalObject (r , (* shadow )(& r ))
240240}
241- func (r * ImageNewParams ) UnmarshalJSON (data []byte ) error {
241+ func (r * ImageGenerateParams ) UnmarshalJSON (data []byte ) error {
242242 return apijson .UnmarshalRoot (data , r )
243243}
244244
245245// The model to use for image generation.
246246//
247247// [See all of Together AI's image models](https://docs.together.ai/docs/serverless-models#image-models)
248- type ImageNewParamsModel string
248+ type ImageGenerateParamsModel string
249249
250250const (
251- ImageNewParamsModelBlackForestLabsFlux1SchnellFree ImageNewParamsModel = "black-forest-labs/FLUX.1-schnell-Free"
252- ImageNewParamsModelBlackForestLabsFlux1Schnell ImageNewParamsModel = "black-forest-labs/FLUX.1-schnell"
253- ImageNewParamsModelBlackForestLabsFlux1_1Pro ImageNewParamsModel = "black-forest-labs/FLUX.1.1-pro"
251+ ImageGenerateParamsModelBlackForestLabsFlux1SchnellFree ImageGenerateParamsModel = "black-forest-labs/FLUX.1-schnell-Free"
252+ ImageGenerateParamsModelBlackForestLabsFlux1Schnell ImageGenerateParamsModel = "black-forest-labs/FLUX.1-schnell"
253+ ImageGenerateParamsModelBlackForestLabsFlux1_1Pro ImageGenerateParamsModel = "black-forest-labs/FLUX.1.1-pro"
254254)
255255
256256// The properties Path, Scale are required.
257- type ImageNewParamsImageLora struct {
257+ type ImageGenerateParamsImageLora struct {
258258 // The URL of the LoRA to apply (e.g.
259259 // https://huggingface.co/strangerzonehf/Flux-Midjourney-Mix2-LoRA).
260260 Path string `json:"path,required"`
@@ -263,27 +263,27 @@ type ImageNewParamsImageLora struct {
263263 paramObj
264264}
265265
266- func (r ImageNewParamsImageLora ) MarshalJSON () (data []byte , err error ) {
267- type shadow ImageNewParamsImageLora
266+ func (r ImageGenerateParamsImageLora ) MarshalJSON () (data []byte , err error ) {
267+ type shadow ImageGenerateParamsImageLora
268268 return param .MarshalObject (r , (* shadow )(& r ))
269269}
270- func (r * ImageNewParamsImageLora ) UnmarshalJSON (data []byte ) error {
270+ func (r * ImageGenerateParamsImageLora ) UnmarshalJSON (data []byte ) error {
271271 return apijson .UnmarshalRoot (data , r )
272272}
273273
274274// The format of the image response. Can be either be `jpeg` or `png`. Defaults to
275275// `jpeg`.
276- type ImageNewParamsOutputFormat string
276+ type ImageGenerateParamsOutputFormat string
277277
278278const (
279- ImageNewParamsOutputFormatJpeg ImageNewParamsOutputFormat = "jpeg"
280- ImageNewParamsOutputFormatPng ImageNewParamsOutputFormat = "png"
279+ ImageGenerateParamsOutputFormatJpeg ImageGenerateParamsOutputFormat = "jpeg"
280+ ImageGenerateParamsOutputFormatPng ImageGenerateParamsOutputFormat = "png"
281281)
282282
283283// Format of the image response. Can be either a base64 string or a URL.
284- type ImageNewParamsResponseFormat string
284+ type ImageGenerateParamsResponseFormat string
285285
286286const (
287- ImageNewParamsResponseFormatBase64 ImageNewParamsResponseFormat = "base64"
288- ImageNewParamsResponseFormatURL ImageNewParamsResponseFormat = "url"
287+ ImageGenerateParamsResponseFormatBase64 ImageGenerateParamsResponseFormat = "base64"
288+ ImageGenerateParamsResponseFormatURL ImageGenerateParamsResponseFormat = "url"
289289)
0 commit comments