Thanks to visit codestin.com
Credit goes to pkg.go.dev

together

package module
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2026 License: Apache-2.0 Imports: 25 Imported by: 2

README

Together Go API Library

Go Reference

The Together Go library provides convenient access to the Together REST API from applications written in Go.

It is generated with Stainless.

Installation

import (
	"github.com/togethercomputer/together-go" // imported as together
)

Or to pin the version:

go get -u 'github.com/togethercomputer/[email protected]'

Requirements

This library requires Go 1.22+.

Usage

The full API of this library can be found in api.md.

package main

import (
	"context"
	"fmt"

	"github.com/togethercomputer/together-go"
	"github.com/togethercomputer/together-go/option"
)

func main() {
	client := together.NewClient(
		option.WithAPIKey("My API Key"), // defaults to os.LookupEnv("TOGETHER_API_KEY")
	)
	chatCompletion, err := client.Chat.Completions.New(context.TODO(), together.ChatCompletionNewParams{
		Messages: []together.ChatCompletionNewParamsMessageUnion{{
			OfChatCompletionNewsMessageChatCompletionUserMessageParam: &together.ChatCompletionNewParamsMessageChatCompletionUserMessageParam{
				Role: "user",
				Content: together.ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentUnion{
					OfString: together.String("Say this is a test!"),
				},
			},
		}},
		Model: "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", chatCompletion.Choices)
}

Request fields

The together library uses the omitzero semantics from the Go 1.24+ encoding/json release for request fields.

Required primitive fields (int64, string, etc.) feature the tag `api:"required"`. These fields are always serialized, even their zero values.

Optional primitive types are wrapped in a param.Opt[T]. These fields can be set with the provided constructors, together.String(string), together.Int(int64), etc.

Any param.Opt[T], map, slice, struct or string enum uses the tag `json:"...,omitzero"`. Its zero value is considered omitted.

The param.IsOmitted(any) function can confirm the presence of any omitzero field.

p := together.ExampleParams{
	ID:   "id_xxx",               // required property
	Name: together.String("..."), // optional property

	Point: together.Point{
		X: 0,               // required field will serialize as 0
		Y: together.Int(1), // optional field will serialize as 1
		// ... omitted non-required fields will not be serialized
	},

	Origin: together.Origin{}, // the zero value of [Origin] is considered omitted
}

To send null instead of a param.Opt[T], use param.Null[T](). To send null instead of a struct T, use param.NullStruct[T]().

p.Name = param.Null[string]()       // 'null' instead of string
p.Point = param.NullStruct[Point]() // 'null' instead of struct

param.IsNull(p.Name)  // true
param.IsNull(p.Point) // true

Request structs contain a .SetExtraFields(map[string]any) method which can send non-conforming fields in the request body. Extra fields overwrite any struct fields with a matching key. For security reasons, only use SetExtraFields with trusted data.

To send a custom value instead of a struct, use param.Override[T](value).

// In cases where the API specifies a given type,
// but you want to send something else, use [SetExtraFields]:
p.SetExtraFields(map[string]any{
	"x": 0.01, // send "x" as a float instead of int
})

// Send a number instead of an object
custom := param.Override[together.FooParams](12)
Request unions

Unions are represented as a struct with fields prefixed by "Of" for each of its variants, only one field can be non-zero. The non-zero field will be serialized.

Sub-properties of the union can be accessed via methods on the union struct. These methods return a mutable pointer to the underlying data, if present.

// Only one field can be non-zero, use param.IsOmitted() to check if a field is set
type AnimalUnionParam struct {
	OfCat *Cat `json:",omitzero,inline`
	OfDog *Dog `json:",omitzero,inline`
}

animal := AnimalUnionParam{
	OfCat: &Cat{
		Name: "Whiskers",
		Owner: PersonParam{
			Address: AddressParam{Street: "3333 Coyote Hill Rd", Zip: 0},
		},
	},
}

// Mutating a field
if address := animal.GetOwner().GetAddress(); address != nil {
	address.ZipCode = 94304
}
Response objects

All fields in response structs are ordinary value types (not pointers or wrappers). Response structs also include a special JSON field containing metadata about each property.

type Animal struct {
	Name   string `json:"name,nullable"`
	Owners int    `json:"owners"`
	Age    int    `json:"age"`
	JSON   struct {
		Name        respjson.Field
		Owner       respjson.Field
		Age         respjson.Field
		ExtraFields map[string]respjson.Field
	} `json:"-"`
}

To handle optional data, use the .Valid() method on the JSON field. .Valid() returns true if a field is not null, not present, or couldn't be marshaled.

If .Valid() is false, the corresponding field will simply be its zero value.

raw := `{"owners": 1, "name": null}`

var res Animal
json.Unmarshal([]byte(raw), &res)

// Accessing regular fields

res.Owners // 1
res.Name   // ""
res.Age    // 0

// Optional field checks

res.JSON.Owners.Valid() // true
res.JSON.Name.Valid()   // false
res.JSON.Age.Valid()    // false

// Raw JSON values

res.JSON.Owners.Raw()                  // "1"
res.JSON.Name.Raw() == "null"          // true
res.JSON.Name.Raw() == respjson.Null   // true
res.JSON.Age.Raw() == ""               // true
res.JSON.Age.Raw() == respjson.Omitted // true

These .JSON structs also include an ExtraFields map containing any properties in the json response that were not specified in the struct. This can be useful for API features not yet present in the SDK.

body := res.JSON.ExtraFields["my_unexpected_field"].Raw()
Response Unions

In responses, unions are represented by a flattened struct containing all possible fields from each of the object variants. To convert it to a variant use the .AsFooVariant() method or the .AsAny() method if present.

If a response value union contains primitive values, primitive fields will be alongside the properties but prefixed with Of and feature the tag json:"...,inline".

type AnimalUnion struct {
	// From variants [Dog], [Cat]
	Owner Person `json:"owner"`
	// From variant [Dog]
	DogBreed string `json:"dog_breed"`
	// From variant [Cat]
	CatBreed string `json:"cat_breed"`
	// ...

	JSON struct {
		Owner respjson.Field
		// ...
	} `json:"-"`
}

// If animal variant
if animal.Owner.Address.ZipCode == "" {
	panic("missing zip code")
}

// Switch on the variant
switch variant := animal.AsAny().(type) {
case Dog:
case Cat:
default:
	panic("unexpected type")
}
RequestOptions

This library uses the functional options pattern. Functions defined in the option package return a RequestOption, which is a closure that mutates a RequestConfig. These options can be supplied to the client or at individual requests. For example:

client := together.NewClient(
	// Adds a header to every request made by the client
	option.WithHeader("X-Some-Header", "custom_header_info"),
)

client.Chat.Completions.New(context.TODO(), ...,
	// Override the header
	option.WithHeader("X-Some-Header", "some_other_custom_header_info"),
	// Add an undocumented field to the request body, using sjson syntax
	option.WithJSONSet("some.json.path", map[string]string{"my": "object"}),
)

The request option option.WithDebugLog(nil) may be helpful while debugging.

See the full list of request options.

Pagination

This library provides some conveniences for working with paginated list endpoints.

You can use .ListAutoPaging() methods to iterate through items across all pages:

Or you can use simple .List() methods to fetch a single page and receive a standard response object with additional helper methods like .GetNextPage(), e.g.:

Errors

When the API returns a non-success status code, we return an error with type *together.Error. This contains the StatusCode, *http.Request, and *http.Response values of the request, as well as the JSON of the error body (much like other response objects in the SDK).

To handle errors, we recommend that you use the errors.As pattern:

_, err := client.Chat.Completions.New(context.TODO(), together.ChatCompletionNewParams{
	Messages: []together.ChatCompletionNewParamsMessageUnion{{
		OfChatCompletionNewsMessageChatCompletionUserMessageParam: &together.ChatCompletionNewParamsMessageChatCompletionUserMessageParam{
			Role: "user",
			Content: together.ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentUnion{
				OfString: together.String("Say this is a test"),
			},
		},
	}},
	Model: "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",
})
if err != nil {
	var apierr *together.Error
	if errors.As(err, &apierr) {
		println(string(apierr.DumpRequest(true)))  // Prints the serialized HTTP request
		println(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response
	}
	panic(err.Error()) // GET "/chat/completions": 400 Bad Request { ... }
}

When other errors occur, they are returned unwrapped; for example, if HTTP transport fails, you might receive *url.Error wrapping *net.OpError.

Timeouts

Requests do not time out by default; use context to configure a timeout for a request lifecycle.

Note that if a request is retried, the context timeout does not start over. To set a per-retry timeout, use option.WithRequestTimeout().

// This sets the timeout for the request, including all the retries.
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
defer cancel()
client.Chat.Completions.New(
	ctx,
	together.ChatCompletionNewParams{
		Messages: []together.ChatCompletionNewParamsMessageUnion{{
			OfChatCompletionNewsMessageChatCompletionUserMessageParam: &together.ChatCompletionNewParamsMessageChatCompletionUserMessageParam{
				Role: "user",
				Content: together.ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentUnion{
					OfString: together.String("Say this is a test"),
				},
			},
		}},
		Model: "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",
	},
	// This sets the per-retry timeout
	option.WithRequestTimeout(20*time.Second),
)
File uploads

Request parameters that correspond to file uploads in multipart requests are typed as io.Reader. The contents of the io.Reader will by default be sent as a multipart form part with the file name of "anonymous_file" and content-type of "application/octet-stream".

The file name and content-type can be customized by implementing Name() string or ContentType() string on the run-time type of io.Reader. Note that os.File implements Name() string, so a file returned by os.Open will be sent with the file name on disk.

We also provide a helper together.File(reader io.Reader, filename string, contentType string) which can be used to wrap any io.Reader with the appropriate file name and content type.

// A file from the file system
file, err := os.Open("/path/to/file")
together.FileUploadParams{
	File:     file,
	FileName: "dataset.csv",
	Purpose:  together.FilePurposeFineTune,
}

// A file from a string
together.FileUploadParams{
	File:     strings.NewReader("my file contents"),
	FileName: "dataset.csv",
	Purpose:  together.FilePurposeFineTune,
}

// With a custom filename and contentType
together.FileUploadParams{
	File:     together.File(strings.NewReader(`{"hello": "foo"}`), "file.go", "application/json"),
	FileName: "dataset.csv",
	Purpose:  together.FilePurposeFineTune,
}
Retries

Certain errors will be automatically retried 2 times by default, with a short exponential backoff. We retry by default all connection errors, 408 Request Timeout, 409 Conflict, 429 Rate Limit, and >=500 Internal errors.

You can use the WithMaxRetries option to configure or disable this:

// Configure the default for all requests:
client := together.NewClient(
	option.WithMaxRetries(0), // default is 2
)

// Override per-request:
client.Chat.Completions.New(
	context.TODO(),
	together.ChatCompletionNewParams{
		Messages: []together.ChatCompletionNewParamsMessageUnion{{
			OfChatCompletionNewsMessageChatCompletionUserMessageParam: &together.ChatCompletionNewParamsMessageChatCompletionUserMessageParam{
				Role: "user",
				Content: together.ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentUnion{
					OfString: together.String("Say this is a test"),
				},
			},
		}},
		Model: "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",
	},
	option.WithMaxRetries(5),
)
Accessing raw response data (e.g. response headers)

You can access the raw HTTP response data by using the option.WithResponseInto() request option. This is useful when you need to examine response headers, status codes, or other details.

// Create a variable to store the HTTP response
var response *http.Response
chatCompletion, err := client.Chat.Completions.New(
	context.TODO(),
	together.ChatCompletionNewParams{
		Messages: []together.ChatCompletionNewParamsMessageUnion{{
			OfChatCompletionNewsMessageChatCompletionUserMessageParam: &together.ChatCompletionNewParamsMessageChatCompletionUserMessageParam{
				Role: "user",
				Content: together.ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentUnion{
					OfString: together.String("Say this is a test"),
				},
			},
		}},
		Model: "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",
	},
	option.WithResponseInto(&response),
)
if err != nil {
	// handle error
}
fmt.Printf("%+v\n", chatCompletion)

fmt.Printf("Status Code: %d\n", response.StatusCode)
fmt.Printf("Headers: %+#v\n", response.Header)
Making custom/undocumented requests

This library is typed for convenient access to the documented API. If you need to access undocumented endpoints, params, or response properties, the library can still be used.

Undocumented endpoints

To make requests to undocumented endpoints, you can use client.Get, client.Post, and other HTTP verbs. RequestOptions on the client, such as retries, will be respected when making these requests.

var (
    // params can be an io.Reader, a []byte, an encoding/json serializable object,
    // or a "…Params" struct defined in this library.
    params map[string]any

    // result can be an []byte, *http.Response, a encoding/json deserializable object,
    // or a model defined in this library.
    result *http.Response
)
err := client.Post(context.Background(), "/unspecified", params, &result)
if err != nil {
    …
}
Undocumented request params

To make requests using undocumented parameters, you may use either the option.WithQuerySet() or the option.WithJSONSet() methods.

params := FooNewParams{
    ID:   "id_xxxx",
    Data: FooNewParamsData{
        FirstName: together.String("John"),
    },
}
client.Foo.New(context.Background(), params, option.WithJSONSet("data.last_name", "Doe"))
Undocumented response properties

To access undocumented response properties, you may either access the raw JSON of the response as a string with result.JSON.RawJSON(), or get the raw JSON of a particular field on the result with result.JSON.Foo.Raw().

Any fields that are not present on the response struct will be saved and can be accessed by result.JSON.ExtraFields() which returns the extra fields as a map[string]Field.

Middleware

We provide option.WithMiddleware which applies the given middleware to requests.

func Logger(req *http.Request, next option.MiddlewareNext) (res *http.Response, err error) {
	// Before the request
	start := time.Now()
	LogReq(req)

	// Forward the request to the next handler
	res, err = next(req)

	// Handle stuff after the request
	end := time.Now()
	LogRes(res, err, start - end)

    return res, err
}

client := together.NewClient(
	option.WithMiddleware(Logger),
)

When multiple middlewares are provided as variadic arguments, the middlewares are applied left to right. If option.WithMiddleware is given multiple times, for example first in the client then the method, the middleware in the client will run first and the middleware given in the method will run next.

You may also replace the default http.Client with option.WithHTTPClient(client). Only one http client is accepted (this overwrites any previous client) and receives requests after any middleware has been applied.

Semantic versioning

This package generally follows SemVer conventions, though certain backwards-incompatible changes may be released as minor versions:

  1. Changes to library internals which are technically public but not intended or documented for external use. (Please open a GitHub issue to let us know if you are relying on such internals.)
  2. Changes that we do not expect to impact the vast majority of users in practice.

We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

We are keen for your feedback; please open an issue with questions, bugs, or suggestions.

Contributing

See the contributing documentation.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(b bool) param.Opt[bool]

func BoolPtr

func BoolPtr(v bool) *bool

func DefaultClientOptions

func DefaultClientOptions() []option.RequestOption

DefaultClientOptions read from the environment (TOGETHER_API_KEY, TOGETHER_BASE_URL). This should be used to initialize new clients.

func File

func File(rdr io.Reader, filename string, contentType string) file

func Float

func Float(f float64) param.Opt[float64]

func FloatPtr

func FloatPtr(v float64) *float64

func Int

func Int(i int64) param.Opt[int64]

func IntPtr

func IntPtr(v int64) *int64

func Opt

func Opt[T comparable](v T) param.Opt[T]

func Ptr

func Ptr[T any](v T) *T

func String

func String(s string) param.Opt[string]

func StringPtr

func StringPtr(v string) *string

func Time

func Time(t time.Time) param.Opt[time.Time]

func TimePtr

func TimePtr(v time.Time) *time.Time

Types

type AudioService

type AudioService struct {
	Options        []option.RequestOption
	Speech         AudioSpeechService
	Voices         AudioVoiceService
	Transcriptions AudioTranscriptionService
	Translations   AudioTranslationService
}

AudioService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAudioService method instead.

func NewAudioService

func NewAudioService(opts ...option.RequestOption) (r AudioService)

NewAudioService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

type AudioSpeechNewParams

type AudioSpeechNewParams struct {
	// Input text to generate the audio for
	Input string `json:"input" api:"required"`
	// The name of the model to query.
	//
	// [See all of Together AI's chat models](https://docs.together.ai/docs/serverless-models#audio-models)
	// The current supported tts models are: - cartesia/sonic - hexgrad/Kokoro-82M -
	// canopylabs/orpheus-3b-0.1-ft
	Model AudioSpeechNewParamsModel `json:"model,omitzero" api:"required"`
	// The voice to use for generating the audio. The voices supported are different
	// for each model. For eg - for canopylabs/orpheus-3b-0.1-ft, one of the voices
	// supported is tara, for hexgrad/Kokoro-82M, one of the voices supported is
	// af_alloy and for cartesia/sonic, one of the voices supported is "friendly
	// sidekick".
	//
	// You can view the voices supported for each model using the /v1/voices endpoint
	// sending the model name as the query parameter.
	// [View all supported voices here](https://docs.together.ai/docs/text-to-speech#supported-voices).
	//
	// `hexgrad/Kokoro-82M` additionally supports voice mixing, where two or more
	// voices are combined into a single blended voice by joining their names with `+`
	// (e.g. `af_bella+af_heart`). Optional per-voice weights can be provided in
	// parentheses (e.g. `af_bella(2)+af_heart(1)`). Other models require a single
	// voice name.
	Voice string `json:"voice" api:"required"`
	// Language or locale of input text. Accepts ISO 639-1 language codes (e.g., `en`,
	// `fr`, `es`, `zh`) as well as locale codes for region-specific variants. Locale
	// codes must be lowercase (e.g., `zh-hk` for Cantonese).
	Language param.Opt[string] `json:"language,omitzero"`
	// Sampling rate in Hz for the output audio. Cartesia and Minimax models respect
	// this parameter. Orpheus and Kokoro models always output at 24000 Hz regardless
	// of this setting.
	SampleRate param.Opt[int64] `json:"sample_rate,omitzero"`
	// Bitrate of the MP3 audio output in bits per second. Only applicable when
	// response_format is mp3. Higher values produce better audio quality at larger
	// file sizes. Default is 128000. Currently supported on Cartesia models.
	//
	// Any of 32000, 64000, 96000, 128000, 192000.
	BitRate int64 `json:"bit_rate,omitzero"`
	// Additional model-specific parameters that fine-tune speech generation behavior.
	ExtraParams AudioSpeechNewParamsExtraParams `json:"extra_params,omitzero"`
	// Audio encoding of response. Only applicable when response_format is raw or pcm.
	// Cartesia models respect this parameter and support all values. Orpheus, Kokoro,
	// and Minimax models always return pcm_s16le regardless of this setting.
	//
	// Any of "pcm_f32le", "pcm_s16le", "pcm_mulaw", "pcm_alaw".
	ResponseEncoding AudioSpeechNewParamsResponseEncoding `json:"response_encoding,omitzero"`
	// The format of audio output. Supported formats are mp3, wav, raw if streaming is
	// false. If streaming is true, the only supported format is raw.
	//
	// Any of "mp3", "wav", "raw".
	ResponseFormat AudioSpeechNewParamsResponseFormat `json:"response_format,omitzero"`
	// contains filtered or unexported fields
}

func (AudioSpeechNewParams) MarshalJSON

func (r AudioSpeechNewParams) MarshalJSON() (data []byte, err error)

func (*AudioSpeechNewParams) UnmarshalJSON

func (r *AudioSpeechNewParams) UnmarshalJSON(data []byte) error

type AudioSpeechNewParamsExtraParams added in v0.10.0

type AudioSpeechNewParamsExtraParams struct {
	// A list of pronunciation rules for specific characters or symbols. Each entry
	// uses the format `"<source>/<replacement>"` (e.g., `["omg/oh my god"]`) to
	// override how the model pronounces matching tokens.
	PronunciationDict []string `json:"pronunciation_dict,omitzero"`
	// contains filtered or unexported fields
}

Additional model-specific parameters that fine-tune speech generation behavior.

func (AudioSpeechNewParamsExtraParams) MarshalJSON added in v0.10.0

func (r AudioSpeechNewParamsExtraParams) MarshalJSON() (data []byte, err error)

func (*AudioSpeechNewParamsExtraParams) UnmarshalJSON added in v0.10.0

func (r *AudioSpeechNewParamsExtraParams) UnmarshalJSON(data []byte) error

type AudioSpeechNewParamsModel

type AudioSpeechNewParamsModel string

The name of the model to query.

[See all of Together AI's chat models](https://docs.together.ai/docs/serverless-models#audio-models) The current supported tts models are: - cartesia/sonic - hexgrad/Kokoro-82M - canopylabs/orpheus-3b-0.1-ft

const (
	AudioSpeechNewParamsModelCartesiaSonic            AudioSpeechNewParamsModel = "cartesia/sonic"
	AudioSpeechNewParamsModelHexgradKokoro82M         AudioSpeechNewParamsModel = "hexgrad/Kokoro-82M"
	AudioSpeechNewParamsModelCanopylabsOrpheus3b0_1Ft AudioSpeechNewParamsModel = "canopylabs/orpheus-3b-0.1-ft"
)

type AudioSpeechNewParamsResponseEncoding

type AudioSpeechNewParamsResponseEncoding string

Audio encoding of response. Only applicable when response_format is raw or pcm. Cartesia models respect this parameter and support all values. Orpheus, Kokoro, and Minimax models always return pcm_s16le regardless of this setting.

const (
	AudioSpeechNewParamsResponseEncodingPcmF32le AudioSpeechNewParamsResponseEncoding = "pcm_f32le"
	AudioSpeechNewParamsResponseEncodingPcmS16le AudioSpeechNewParamsResponseEncoding = "pcm_s16le"
	AudioSpeechNewParamsResponseEncodingPcmMulaw AudioSpeechNewParamsResponseEncoding = "pcm_mulaw"
	AudioSpeechNewParamsResponseEncodingPcmAlaw  AudioSpeechNewParamsResponseEncoding = "pcm_alaw"
)

type AudioSpeechNewParamsResponseFormat

type AudioSpeechNewParamsResponseFormat string

The format of audio output. Supported formats are mp3, wav, raw if streaming is false. If streaming is true, the only supported format is raw.

const (
	AudioSpeechNewParamsResponseFormatMP3 AudioSpeechNewParamsResponseFormat = "mp3"
	AudioSpeechNewParamsResponseFormatWav AudioSpeechNewParamsResponseFormat = "wav"
	AudioSpeechNewParamsResponseFormatRaw AudioSpeechNewParamsResponseFormat = "raw"
)

type AudioSpeechService

type AudioSpeechService struct {
	Options []option.RequestOption
}

AudioSpeechService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAudioSpeechService method instead.

func NewAudioSpeechService

func NewAudioSpeechService(opts ...option.RequestOption) (r AudioSpeechService)

NewAudioSpeechService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*AudioSpeechService) New

Generate audio from input text

func (*AudioSpeechService) NewStreaming

Generate audio from input text

type AudioSpeechStreamChunk

type AudioSpeechStreamChunk struct {
	// base64 encoded audio stream
	B64   string `json:"b64" api:"required"`
	Model string `json:"model" api:"required"`
	// The object type, which is always `audio.tts.chunk`.
	Object constant.AudioTtsChunk `json:"object" default:"audio.tts.chunk"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		B64         respjson.Field
		Model       respjson.Field
		Object      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AudioSpeechStreamChunk) RawJSON

func (r AudioSpeechStreamChunk) RawJSON() string

Returns the unmodified JSON received from the API

func (*AudioSpeechStreamChunk) UnmarshalJSON

func (r *AudioSpeechStreamChunk) UnmarshalJSON(data []byte) error

type AudioTranscriptionNewParams

type AudioTranscriptionNewParams struct {
	// Audio file upload or public HTTP/HTTPS URL. Supported formats .wav, .mp3, .m4a,
	// .webm, .flac, .ogg, .opus, .aac.
	File AudioTranscriptionNewParamsFileUnion `json:"file,omitzero" api:"required" format:"binary"`
	// Whether to enable speaker diarization. When enabled, you will get the speaker id
	// for each word in the transcription. In the response, in the words array, you
	// will get the speaker id for each word. In addition, we also return the
	// speaker_segments array which contains the speaker id for each speaker segment
	// along with the start and end time of the segment along with all the words in the
	// segment.
	//
	// For eg - ... "speaker_segments": [ "speaker_id": "SPEAKER_00", "start": 0,
	// "end": 30.02, "words": [ { "id": 0, "word": "Tijana", "start": 0, "end": 11.475,
	// "speaker_id": "SPEAKER_00" }, ...
	Diarize param.Opt[bool] `json:"diarize,omitzero"`
	// Optional ISO 639-1 language code. If `auto` is provided, language is
	// auto-detected.
	Language param.Opt[string] `json:"language,omitzero"`
	// Maximum number of speakers expected in the audio. Used to improve diarization
	// accuracy when the approximate number of speakers is known.
	MaxSpeakers param.Opt[int64] `json:"max_speakers,omitzero"`
	// Minimum number of speakers expected in the audio. Used to improve diarization
	// accuracy when the approximate number of speakers is known.
	MinSpeakers param.Opt[int64] `json:"min_speakers,omitzero"`
	// Optional text to bias decoding. Supported only on Whisper-family models (e.g.
	// `openai/whisper-large-v3`). Other STT models (e.g.
	// `nvidia/parakeet-tdt-0.6b-v3`) accept the field for API compatibility but ignore
	// it.
	Prompt param.Opt[string] `json:"prompt,omitzero"`
	// Sampling temperature between 0.0 and 1.0
	Temperature param.Opt[float64] `json:"temperature,omitzero"`
	// Model to use for transcription
	//
	// Any of "openai/whisper-large-v3".
	Model AudioTranscriptionNewParamsModel `json:"model,omitzero"`
	// The format of the response
	//
	// Any of "json", "verbose_json".
	ResponseFormat AudioTranscriptionNewParamsResponseFormat `json:"response_format,omitzero"`
	// Controls level of timestamp detail in verbose_json. Only used when
	// response_format is verbose_json. Can be a single granularity or an array to get
	// multiple levels.
	TimestampGranularities AudioTranscriptionNewParamsTimestampGranularitiesUnion `json:"timestamp_granularities,omitzero"`
	// contains filtered or unexported fields
}

func (AudioTranscriptionNewParams) MarshalMultipart

func (r AudioTranscriptionNewParams) MarshalMultipart() (data []byte, contentType string, err error)

type AudioTranscriptionNewParamsFileUnion added in v0.3.0

type AudioTranscriptionNewParamsFileUnion struct {
	OfFile   io.Reader         `json:",omitzero,inline"`
	OfString param.Opt[string] `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (AudioTranscriptionNewParamsFileUnion) MarshalJSON added in v0.3.0

func (u AudioTranscriptionNewParamsFileUnion) MarshalJSON() ([]byte, error)

func (*AudioTranscriptionNewParamsFileUnion) UnmarshalJSON added in v0.3.0

func (u *AudioTranscriptionNewParamsFileUnion) UnmarshalJSON(data []byte) error

type AudioTranscriptionNewParamsModel

type AudioTranscriptionNewParamsModel string

Model to use for transcription

const (
	AudioTranscriptionNewParamsModelOpenAIWhisperLargeV3 AudioTranscriptionNewParamsModel = "openai/whisper-large-v3"
)

type AudioTranscriptionNewParamsResponseFormat

type AudioTranscriptionNewParamsResponseFormat string

The format of the response

const (
	AudioTranscriptionNewParamsResponseFormatJson        AudioTranscriptionNewParamsResponseFormat = "json"
	AudioTranscriptionNewParamsResponseFormatVerboseJson AudioTranscriptionNewParamsResponseFormat = "verbose_json"
)

type AudioTranscriptionNewParamsTimestampGranularitiesString

type AudioTranscriptionNewParamsTimestampGranularitiesString string
const (
	AudioTranscriptionNewParamsTimestampGranularitiesStringSegment AudioTranscriptionNewParamsTimestampGranularitiesString = "segment"
	AudioTranscriptionNewParamsTimestampGranularitiesStringWord    AudioTranscriptionNewParamsTimestampGranularitiesString = "word"
)

type AudioTranscriptionNewParamsTimestampGranularitiesUnion

type AudioTranscriptionNewParamsTimestampGranularitiesUnion struct {
	// Check if union is this variant with
	// !param.IsOmitted(union.OfAudioTranscriptionNewsTimestampGranularitiesString)
	OfAudioTranscriptionNewsTimestampGranularitiesString         param.Opt[string] `json:",omitzero,inline"`
	OfAudioTranscriptionNewsTimestampGranularitiesArrayItemArray []string          `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (AudioTranscriptionNewParamsTimestampGranularitiesUnion) MarshalJSON

func (*AudioTranscriptionNewParamsTimestampGranularitiesUnion) UnmarshalJSON

type AudioTranscriptionNewResponseAudioTranscriptionJsonResponse

type AudioTranscriptionNewResponseAudioTranscriptionJsonResponse struct {
	// The transcribed text
	Text string `json:"text" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Text        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AudioTranscriptionNewResponseAudioTranscriptionJsonResponse) RawJSON

Returns the unmodified JSON received from the API

func (*AudioTranscriptionNewResponseAudioTranscriptionJsonResponse) UnmarshalJSON

type AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponse

type AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponse struct {
	// The duration of the audio in seconds
	Duration float64 `json:"duration" api:"required"`
	// The language of the audio
	Language string `json:"language" api:"required"`
	// Array of transcription segments
	Segments []AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSegment `json:"segments" api:"required"`
	// The transcribed text
	Text string `json:"text" api:"required"`
	// Array of transcription speaker segments (only when diarize is enabled)
	SpeakerSegments []AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSpeakerSegment `json:"speaker_segments"`
	// Array of transcription words (only when timestamp_granularities includes 'word')
	Words []AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseWord `json:"words"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Duration        respjson.Field
		Language        respjson.Field
		Segments        respjson.Field
		Text            respjson.Field
		SpeakerSegments respjson.Field
		Words           respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponse) RawJSON

Returns the unmodified JSON received from the API

func (*AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponse) UnmarshalJSON

type AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSegment

type AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSegment struct {
	// Unique identifier for the segment
	ID int64 `json:"id" api:"required"`
	// End time of the segment in seconds
	End float64 `json:"end" api:"required"`
	// Start time of the segment in seconds
	Start float64 `json:"start" api:"required"`
	// The text content of the segment
	Text string `json:"text" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		End         respjson.Field
		Start       respjson.Field
		Text        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSegment) RawJSON

Returns the unmodified JSON received from the API

func (*AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSegment) UnmarshalJSON

type AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSpeakerSegment

type AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSpeakerSegment struct {
	// Unique identifier for the speaker segment
	ID int64 `json:"id" api:"required"`
	// End time of the speaker segment in seconds
	End float64 `json:"end" api:"required"`
	// The speaker identifier
	SpeakerID string `json:"speaker_id" api:"required"`
	// Start time of the speaker segment in seconds
	Start float64 `json:"start" api:"required"`
	// The full text spoken by this speaker in this segment
	Text string `json:"text" api:"required"`
	// Array of words spoken by this speaker in this segment
	Words []AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSpeakerSegmentWord `json:"words" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		End         respjson.Field
		SpeakerID   respjson.Field
		Start       respjson.Field
		Text        respjson.Field
		Words       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSpeakerSegment) RawJSON

Returns the unmodified JSON received from the API

func (*AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSpeakerSegment) UnmarshalJSON

type AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSpeakerSegmentWord

type AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSpeakerSegmentWord struct {
	// End time of the word in seconds
	End float64 `json:"end" api:"required"`
	// Start time of the word in seconds
	Start float64 `json:"start" api:"required"`
	// The word
	Word string `json:"word" api:"required"`
	// The speaker id for the word (only when diarize is enabled)
	SpeakerID string `json:"speaker_id"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		End         respjson.Field
		Start       respjson.Field
		Word        respjson.Field
		SpeakerID   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSpeakerSegmentWord) RawJSON

Returns the unmodified JSON received from the API

func (*AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSpeakerSegmentWord) UnmarshalJSON

type AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseWord

type AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseWord struct {
	// End time of the word in seconds
	End float64 `json:"end" api:"required"`
	// Start time of the word in seconds
	Start float64 `json:"start" api:"required"`
	// The word
	Word string `json:"word" api:"required"`
	// The speaker id for the word (only when diarize is enabled)
	SpeakerID string `json:"speaker_id"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		End         respjson.Field
		Start       respjson.Field
		Word        respjson.Field
		SpeakerID   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseWord) RawJSON

Returns the unmodified JSON received from the API

func (*AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseWord) UnmarshalJSON

type AudioTranscriptionNewResponseUnion

type AudioTranscriptionNewResponseUnion struct {
	Text string `json:"text"`
	// This field is from variant
	// [AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponse].
	Duration float64 `json:"duration"`
	// This field is from variant
	// [AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponse].
	Language string `json:"language"`
	// This field is from variant
	// [AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponse].
	Segments []AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSegment `json:"segments"`
	// This field is from variant
	// [AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponse].
	SpeakerSegments []AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSpeakerSegment `json:"speaker_segments"`
	// This field is from variant
	// [AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponse].
	Words []AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseWord `json:"words"`
	JSON  struct {
		Text            respjson.Field
		Duration        respjson.Field
		Language        respjson.Field
		Segments        respjson.Field
		SpeakerSegments respjson.Field
		Words           respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

AudioTranscriptionNewResponseUnion contains all possible properties and values from AudioTranscriptionNewResponseAudioTranscriptionJsonResponse, AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponse.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (AudioTranscriptionNewResponseUnion) AsAudioTranscriptionNewResponseAudioTranscriptionJsonResponse

func (u AudioTranscriptionNewResponseUnion) AsAudioTranscriptionNewResponseAudioTranscriptionJsonResponse() (v AudioTranscriptionNewResponseAudioTranscriptionJsonResponse)

func (AudioTranscriptionNewResponseUnion) AsAudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponse

func (u AudioTranscriptionNewResponseUnion) AsAudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponse() (v AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponse)

func (AudioTranscriptionNewResponseUnion) RawJSON

Returns the unmodified JSON received from the API

func (*AudioTranscriptionNewResponseUnion) UnmarshalJSON

func (r *AudioTranscriptionNewResponseUnion) UnmarshalJSON(data []byte) error

type AudioTranscriptionService

type AudioTranscriptionService struct {
	Options []option.RequestOption
}

AudioTranscriptionService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAudioTranscriptionService method instead.

func NewAudioTranscriptionService

func NewAudioTranscriptionService(opts ...option.RequestOption) (r AudioTranscriptionService)

NewAudioTranscriptionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*AudioTranscriptionService) New

Transcribes audio into text

type AudioTranslationNewParams

type AudioTranslationNewParams struct {
	// Audio file upload or public HTTP/HTTPS URL. Supported formats .wav, .mp3, .m4a,
	// .webm, .flac, .ogg, .opus, .aac.
	File AudioTranslationNewParamsFileUnion `json:"file,omitzero" api:"required" format:"binary"`
	// Target output language. Optional ISO 639-1 language code. If omitted, language
	// is set to English.
	Language param.Opt[string] `json:"language,omitzero"`
	// Optional text to bias decoding. Supported only on Whisper-family models (e.g.
	// `openai/whisper-large-v3`). Other STT models (e.g.
	// `nvidia/parakeet-tdt-0.6b-v3`) accept the field for API compatibility but ignore
	// it.
	Prompt param.Opt[string] `json:"prompt,omitzero"`
	// Sampling temperature between 0.0 and 1.0
	Temperature param.Opt[float64] `json:"temperature,omitzero"`
	// Model to use for translation
	//
	// Any of "openai/whisper-large-v3".
	Model AudioTranslationNewParamsModel `json:"model,omitzero"`
	// The format of the response
	//
	// Any of "json", "verbose_json".
	ResponseFormat AudioTranslationNewParamsResponseFormat `json:"response_format,omitzero"`
	// Controls level of timestamp detail in verbose_json. Only used when
	// response_format is verbose_json. Can be a single granularity or an array to get
	// multiple levels.
	TimestampGranularities AudioTranslationNewParamsTimestampGranularitiesUnion `json:"timestamp_granularities,omitzero"`
	// contains filtered or unexported fields
}

func (AudioTranslationNewParams) MarshalMultipart

func (r AudioTranslationNewParams) MarshalMultipart() (data []byte, contentType string, err error)

type AudioTranslationNewParamsFileUnion added in v0.3.0

type AudioTranslationNewParamsFileUnion struct {
	OfFile   io.Reader         `json:",omitzero,inline"`
	OfString param.Opt[string] `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (AudioTranslationNewParamsFileUnion) MarshalJSON added in v0.3.0

func (u AudioTranslationNewParamsFileUnion) MarshalJSON() ([]byte, error)

func (*AudioTranslationNewParamsFileUnion) UnmarshalJSON added in v0.3.0

func (u *AudioTranslationNewParamsFileUnion) UnmarshalJSON(data []byte) error

type AudioTranslationNewParamsModel

type AudioTranslationNewParamsModel string

Model to use for translation

const (
	AudioTranslationNewParamsModelOpenAIWhisperLargeV3 AudioTranslationNewParamsModel = "openai/whisper-large-v3"
)

type AudioTranslationNewParamsResponseFormat

type AudioTranslationNewParamsResponseFormat string

The format of the response

const (
	AudioTranslationNewParamsResponseFormatJson        AudioTranslationNewParamsResponseFormat = "json"
	AudioTranslationNewParamsResponseFormatVerboseJson AudioTranslationNewParamsResponseFormat = "verbose_json"
)

type AudioTranslationNewParamsTimestampGranularitiesString

type AudioTranslationNewParamsTimestampGranularitiesString string
const (
	AudioTranslationNewParamsTimestampGranularitiesStringSegment AudioTranslationNewParamsTimestampGranularitiesString = "segment"
	AudioTranslationNewParamsTimestampGranularitiesStringWord    AudioTranslationNewParamsTimestampGranularitiesString = "word"
)

type AudioTranslationNewParamsTimestampGranularitiesUnion

type AudioTranslationNewParamsTimestampGranularitiesUnion struct {
	// Check if union is this variant with
	// !param.IsOmitted(union.OfAudioTranslationNewsTimestampGranularitiesString)
	OfAudioTranslationNewsTimestampGranularitiesString         param.Opt[string] `json:",omitzero,inline"`
	OfAudioTranslationNewsTimestampGranularitiesArrayItemArray []string          `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (AudioTranslationNewParamsTimestampGranularitiesUnion) MarshalJSON

func (*AudioTranslationNewParamsTimestampGranularitiesUnion) UnmarshalJSON

type AudioTranslationNewResponseAudioTranslationJsonResponse

type AudioTranslationNewResponseAudioTranslationJsonResponse struct {
	// The translated text
	Text string `json:"text" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Text        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AudioTranslationNewResponseAudioTranslationJsonResponse) RawJSON

Returns the unmodified JSON received from the API

func (*AudioTranslationNewResponseAudioTranslationJsonResponse) UnmarshalJSON

type AudioTranslationNewResponseAudioTranslationVerboseJsonResponse

type AudioTranslationNewResponseAudioTranslationVerboseJsonResponse struct {
	// The duration of the audio in seconds
	Duration float64 `json:"duration" api:"required"`
	// The target language of the translation
	Language string `json:"language" api:"required"`
	// Array of translation segments
	Segments []AudioTranslationNewResponseAudioTranslationVerboseJsonResponseSegment `json:"segments" api:"required"`
	// The translated text
	Text string `json:"text" api:"required"`
	// Array of translation words (only when timestamp_granularities includes 'word')
	Words []AudioTranslationNewResponseAudioTranslationVerboseJsonResponseWord `json:"words"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Duration    respjson.Field
		Language    respjson.Field
		Segments    respjson.Field
		Text        respjson.Field
		Words       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AudioTranslationNewResponseAudioTranslationVerboseJsonResponse) RawJSON

Returns the unmodified JSON received from the API

func (*AudioTranslationNewResponseAudioTranslationVerboseJsonResponse) UnmarshalJSON

type AudioTranslationNewResponseAudioTranslationVerboseJsonResponseSegment

type AudioTranslationNewResponseAudioTranslationVerboseJsonResponseSegment struct {
	// Unique identifier for the segment
	ID int64 `json:"id" api:"required"`
	// End time of the segment in seconds
	End float64 `json:"end" api:"required"`
	// Start time of the segment in seconds
	Start float64 `json:"start" api:"required"`
	// The text content of the segment
	Text string `json:"text" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		End         respjson.Field
		Start       respjson.Field
		Text        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AudioTranslationNewResponseAudioTranslationVerboseJsonResponseSegment) RawJSON

Returns the unmodified JSON received from the API

func (*AudioTranslationNewResponseAudioTranslationVerboseJsonResponseSegment) UnmarshalJSON

type AudioTranslationNewResponseAudioTranslationVerboseJsonResponseWord

type AudioTranslationNewResponseAudioTranslationVerboseJsonResponseWord struct {
	// End time of the word in seconds
	End float64 `json:"end" api:"required"`
	// Start time of the word in seconds
	Start float64 `json:"start" api:"required"`
	// The word
	Word string `json:"word" api:"required"`
	// The speaker id for the word (only when diarize is enabled)
	SpeakerID string `json:"speaker_id"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		End         respjson.Field
		Start       respjson.Field
		Word        respjson.Field
		SpeakerID   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AudioTranslationNewResponseAudioTranslationVerboseJsonResponseWord) RawJSON

Returns the unmodified JSON received from the API

func (*AudioTranslationNewResponseAudioTranslationVerboseJsonResponseWord) UnmarshalJSON

type AudioTranslationNewResponseUnion

type AudioTranslationNewResponseUnion struct {
	Text string `json:"text"`
	// This field is from variant
	// [AudioTranslationNewResponseAudioTranslationVerboseJsonResponse].
	Duration float64 `json:"duration"`
	// This field is from variant
	// [AudioTranslationNewResponseAudioTranslationVerboseJsonResponse].
	Language string `json:"language"`
	// This field is from variant
	// [AudioTranslationNewResponseAudioTranslationVerboseJsonResponse].
	Segments []AudioTranslationNewResponseAudioTranslationVerboseJsonResponseSegment `json:"segments"`
	// This field is from variant
	// [AudioTranslationNewResponseAudioTranslationVerboseJsonResponse].
	Words []AudioTranslationNewResponseAudioTranslationVerboseJsonResponseWord `json:"words"`
	JSON  struct {
		Text     respjson.Field
		Duration respjson.Field
		Language respjson.Field
		Segments respjson.Field
		Words    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

AudioTranslationNewResponseUnion contains all possible properties and values from AudioTranslationNewResponseAudioTranslationJsonResponse, AudioTranslationNewResponseAudioTranslationVerboseJsonResponse.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (AudioTranslationNewResponseUnion) AsAudioTranslationNewResponseAudioTranslationJsonResponse

func (u AudioTranslationNewResponseUnion) AsAudioTranslationNewResponseAudioTranslationJsonResponse() (v AudioTranslationNewResponseAudioTranslationJsonResponse)

func (AudioTranslationNewResponseUnion) AsAudioTranslationNewResponseAudioTranslationVerboseJsonResponse

func (u AudioTranslationNewResponseUnion) AsAudioTranslationNewResponseAudioTranslationVerboseJsonResponse() (v AudioTranslationNewResponseAudioTranslationVerboseJsonResponse)

func (AudioTranslationNewResponseUnion) RawJSON

Returns the unmodified JSON received from the API

func (*AudioTranslationNewResponseUnion) UnmarshalJSON

func (r *AudioTranslationNewResponseUnion) UnmarshalJSON(data []byte) error

type AudioTranslationService

type AudioTranslationService struct {
	Options []option.RequestOption
}

AudioTranslationService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAudioTranslationService method instead.

func NewAudioTranslationService

func NewAudioTranslationService(opts ...option.RequestOption) (r AudioTranslationService)

NewAudioTranslationService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*AudioTranslationService) New

Translates audio into English

type AudioVoiceListResponse

type AudioVoiceListResponse struct {
	Data []AudioVoiceListResponseData `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Response containing a list of models and their available voices.

func (AudioVoiceListResponse) RawJSON

func (r AudioVoiceListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*AudioVoiceListResponse) UnmarshalJSON

func (r *AudioVoiceListResponse) UnmarshalJSON(data []byte) error

type AudioVoiceListResponseData

type AudioVoiceListResponseData struct {
	// Model name.
	Model string `json:"model" api:"required"`
	// List of available voices for the model.
	Voices []AudioVoiceListResponseDataVoice `json:"voices" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Model       respjson.Field
		Voices      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Represents a model with its available voices.

func (AudioVoiceListResponseData) RawJSON

func (r AudioVoiceListResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*AudioVoiceListResponseData) UnmarshalJSON

func (r *AudioVoiceListResponseData) UnmarshalJSON(data []byte) error

type AudioVoiceListResponseDataVoice

type AudioVoiceListResponseDataVoice struct {
	ID string `json:"id" api:"required"`
	// Voice name to be used for audio inference.
	Name string `json:"name" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Name        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AudioVoiceListResponseDataVoice) RawJSON

Returns the unmodified JSON received from the API

func (*AudioVoiceListResponseDataVoice) UnmarshalJSON

func (r *AudioVoiceListResponseDataVoice) UnmarshalJSON(data []byte) error

type AudioVoiceService

type AudioVoiceService struct {
	Options []option.RequestOption
}

AudioVoiceService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAudioVoiceService method instead.

func NewAudioVoiceService

func NewAudioVoiceService(opts ...option.RequestOption) (r AudioVoiceService)

NewAudioVoiceService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*AudioVoiceService) List

Fetch available voices for each model

type Autoscaling

type Autoscaling struct {
	// The maximum number of replicas to scale up to under load
	MaxReplicas int64 `json:"max_replicas" api:"required"`
	// The minimum number of replicas to maintain, even when there is no load
	MinReplicas int64 `json:"min_replicas" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MaxReplicas respjson.Field
		MinReplicas respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Configuration for automatic scaling of replicas based on demand.

func (Autoscaling) RawJSON

func (r Autoscaling) RawJSON() string

Returns the unmodified JSON received from the API

func (Autoscaling) ToParam

func (r Autoscaling) ToParam() AutoscalingParam

ToParam converts this Autoscaling to a AutoscalingParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with AutoscalingParam.Overrides()

func (*Autoscaling) UnmarshalJSON

func (r *Autoscaling) UnmarshalJSON(data []byte) error

type AutoscalingParam

type AutoscalingParam struct {
	// The maximum number of replicas to scale up to under load
	MaxReplicas int64 `json:"max_replicas" api:"required"`
	// The minimum number of replicas to maintain, even when there is no load
	MinReplicas int64 `json:"min_replicas" api:"required"`
	// contains filtered or unexported fields
}

Configuration for automatic scaling of replicas based on demand.

The properties MaxReplicas, MinReplicas are required.

func (AutoscalingParam) MarshalJSON

func (r AutoscalingParam) MarshalJSON() (data []byte, err error)

func (*AutoscalingParam) UnmarshalJSON

func (r *AutoscalingParam) UnmarshalJSON(data []byte) error

type BatchJob

type BatchJob struct {
	ID          string    `json:"id" format:"uuid"`
	CompletedAt time.Time `json:"completed_at" format:"date-time"`
	CreatedAt   time.Time `json:"created_at" format:"date-time"`
	Endpoint    string    `json:"endpoint"`
	Error       string    `json:"error"`
	ErrorFileID string    `json:"error_file_id"`
	// Size of input file in bytes
	FileSizeBytes int64     `json:"file_size_bytes"`
	InputFileID   string    `json:"input_file_id"`
	JobDeadline   time.Time `json:"job_deadline" format:"date-time"`
	// Model used for processing requests
	ModelID      string `json:"model_id"`
	OutputFileID string `json:"output_file_id"`
	// Completion progress (0.0 to 100)
	Progress float64 `json:"progress"`
	// Current status of the batch job
	//
	// Any of "VALIDATING", "IN_PROGRESS", "COMPLETED", "FAILED", "EXPIRED",
	// "CANCELLED".
	Status BatchJobStatus `json:"status"`
	UserID string         `json:"user_id"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		CompletedAt   respjson.Field
		CreatedAt     respjson.Field
		Endpoint      respjson.Field
		Error         respjson.Field
		ErrorFileID   respjson.Field
		FileSizeBytes respjson.Field
		InputFileID   respjson.Field
		JobDeadline   respjson.Field
		ModelID       respjson.Field
		OutputFileID  respjson.Field
		Progress      respjson.Field
		Status        respjson.Field
		UserID        respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BatchJob) RawJSON

func (r BatchJob) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchJob) UnmarshalJSON

func (r *BatchJob) UnmarshalJSON(data []byte) error

type BatchJobStatus

type BatchJobStatus string

Current status of the batch job

const (
	BatchJobStatusValidating BatchJobStatus = "VALIDATING"
	BatchJobStatusInProgress BatchJobStatus = "IN_PROGRESS"
	BatchJobStatusCompleted  BatchJobStatus = "COMPLETED"
	BatchJobStatusFailed     BatchJobStatus = "FAILED"
	BatchJobStatusExpired    BatchJobStatus = "EXPIRED"
	BatchJobStatusCancelled  BatchJobStatus = "CANCELLED"
)

type BatchNewParams

type BatchNewParams struct {
	// The endpoint to use for batch processing. Each line of the uploaded input file
	// is dispatched against this endpoint.
	//
	//   - `/v1/chat/completions` — chat completion batches
	//   - `/v1/audio/transcriptions` — audio transcription batches (e.g.
	//     `openai/whisper-large-v3`)
	//   - `/v1/audio/translations` — audio translation batches
	//
	// Any of "/v1/chat/completions", "/v1/audio/transcriptions",
	// "/v1/audio/translations".
	Endpoint BatchNewParamsEndpoint `json:"endpoint,omitzero" api:"required"`
	// ID of the uploaded input file containing batch requests
	InputFileID string `json:"input_file_id" api:"required"`
	// Time window for batch completion (optional)
	CompletionWindow param.Opt[string] `json:"completion_window,omitzero"`
	// Model to use for processing batch requests
	ModelID param.Opt[string] `json:"model_id,omitzero"`
	// Priority for batch processing (optional)
	Priority param.Opt[int64] `json:"priority,omitzero"`
	// contains filtered or unexported fields
}

func (BatchNewParams) MarshalJSON

func (r BatchNewParams) MarshalJSON() (data []byte, err error)

func (*BatchNewParams) UnmarshalJSON

func (r *BatchNewParams) UnmarshalJSON(data []byte) error

type BatchNewParamsEndpoint added in v0.10.0

type BatchNewParamsEndpoint string

The endpoint to use for batch processing. Each line of the uploaded input file is dispatched against this endpoint.

  • `/v1/chat/completions` — chat completion batches
  • `/v1/audio/transcriptions` — audio transcription batches (e.g. `openai/whisper-large-v3`)
  • `/v1/audio/translations` — audio translation batches
const (
	BatchNewParamsEndpointV1ChatCompletions     BatchNewParamsEndpoint = "/v1/chat/completions"
	BatchNewParamsEndpointV1AudioTranscriptions BatchNewParamsEndpoint = "/v1/audio/transcriptions"
	BatchNewParamsEndpointV1AudioTranslations   BatchNewParamsEndpoint = "/v1/audio/translations"
)

type BatchNewResponse

type BatchNewResponse struct {
	Job     BatchJob `json:"job"`
	Warning string   `json:"warning"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Job         respjson.Field
		Warning     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BatchNewResponse) RawJSON

func (r BatchNewResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchNewResponse) UnmarshalJSON

func (r *BatchNewResponse) UnmarshalJSON(data []byte) error

type BatchService

type BatchService struct {
	Options []option.RequestOption
}

BatchService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewBatchService method instead.

func NewBatchService

func NewBatchService(opts ...option.RequestOption) (r BatchService)

NewBatchService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*BatchService) Cancel

func (r *BatchService) Cancel(ctx context.Context, id string, opts ...option.RequestOption) (res *BatchJob, err error)

Cancel a batch job by ID

func (*BatchService) Get

func (r *BatchService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *BatchJob, err error)

Get details of a batch job by ID

func (*BatchService) List

func (r *BatchService) List(ctx context.Context, opts ...option.RequestOption) (res *[]BatchJob, err error)

List all batch jobs for the authenticated user

func (*BatchService) New

func (r *BatchService) New(ctx context.Context, body BatchNewParams, opts ...option.RequestOption) (res *BatchNewResponse, err error)

Create a new batch job with the given input file and endpoint

type BetaClusterDeleteResponse added in v0.4.0

type BetaClusterDeleteResponse struct {
	ClusterID string `json:"cluster_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ClusterID   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaClusterDeleteResponse) RawJSON added in v0.4.0

func (r BetaClusterDeleteResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaClusterDeleteResponse) UnmarshalJSON added in v0.4.0

func (r *BetaClusterDeleteResponse) UnmarshalJSON(data []byte) error

type BetaClusterListParams added in v0.10.0

type BetaClusterListParams struct {
	// Optional UMS project ID to filter clusters by. When set, only clusters belonging
	// to this project are returned. The caller must be a member of the project;
	// otherwise the result set will be empty.
	ProjectID param.Opt[string] `query:"project_id,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaClusterListParams) URLQuery added in v0.10.0

func (r BetaClusterListParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaClusterListParams's query parameters as `url.Values`.

type BetaClusterListRegionsResponse added in v0.4.0

type BetaClusterListRegionsResponse struct {
	Regions []BetaClusterListRegionsResponseRegion `json:"regions" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Regions     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaClusterListRegionsResponse) RawJSON added in v0.4.0

Returns the unmodified JSON received from the API

func (*BetaClusterListRegionsResponse) UnmarshalJSON added in v0.4.0

func (r *BetaClusterListRegionsResponse) UnmarshalJSON(data []byte) error

type BetaClusterListRegionsResponseRegion added in v0.4.0

type BetaClusterListRegionsResponseRegion struct {
	// List of supported identifiable cuda/nvidia driver versions pairs available in
	// the region.
	DriverVersions []BetaClusterListRegionsResponseRegionDriverVersion `json:"driver_versions" api:"required"`
	// Identifiable name of the region.
	Name string `json:"name" api:"required"`
	// List of supported identifiable gpus available in the region.
	SupportedInstanceTypes []string `json:"supported_instance_types" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		DriverVersions         respjson.Field
		Name                   respjson.Field
		SupportedInstanceTypes respjson.Field
		ExtraFields            map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaClusterListRegionsResponseRegion) RawJSON added in v0.4.0

Returns the unmodified JSON received from the API

func (*BetaClusterListRegionsResponseRegion) UnmarshalJSON added in v0.4.0

func (r *BetaClusterListRegionsResponseRegion) UnmarshalJSON(data []byte) error

type BetaClusterListRegionsResponseRegionDriverVersion added in v0.10.0

type BetaClusterListRegionsResponseRegionDriverVersion struct {
	// CUDA driver version.
	CudaVersion string `json:"cuda_version" api:"required"`
	// NVIDIA driver version.
	NvidiaDriverVersion string `json:"nvidia_driver_version" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CudaVersion         respjson.Field
		NvidiaDriverVersion respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

CUDA/NVIDIA driver versions pair available in the region to use in the create cluster request.

func (BetaClusterListRegionsResponseRegionDriverVersion) RawJSON added in v0.10.0

Returns the unmodified JSON received from the API

func (*BetaClusterListRegionsResponseRegionDriverVersion) UnmarshalJSON added in v0.10.0

type BetaClusterListResponse added in v0.4.0

type BetaClusterListResponse struct {
	Clusters []Cluster `json:"clusters" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Clusters    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaClusterListResponse) RawJSON added in v0.4.0

func (r BetaClusterListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaClusterListResponse) UnmarshalJSON added in v0.4.0

func (r *BetaClusterListResponse) UnmarshalJSON(data []byte) error

type BetaClusterNewParams added in v0.4.0

type BetaClusterNewParams struct {
	// RESERVED billing types allow you to specify the duration of the cluster
	// reservation via the duration_days field. ON_DEMAND billing types will give you
	// ownership of the cluster until you delete it. SCHEDULED_CAPACITY billing types
	// allow you to reserve capacity for a scheduled time window. You must specify the
	// reservation_start_time and reservation_end_time with this request.
	//
	// Any of "RESERVED", "ON_DEMAND", "SCHEDULED_CAPACITY".
	BillingType BetaClusterNewParamsBillingType `json:"billing_type,omitzero" api:"required"`
	// Name of the GPU cluster.
	ClusterName string `json:"cluster_name" api:"required"`
	// CUDA version for this cluster. For example, 12.5
	CudaVersion string `json:"cuda_version" api:"required"`
	// Type of GPU to use in the cluster
	//
	// Any of "H100_SXM", "H200_SXM", "RTX_6000_PCI", "L40_PCIE", "B200_SXM",
	// "H100_SXM_INF".
	GPUType BetaClusterNewParamsGPUType `json:"gpu_type,omitzero" api:"required"`
	// Number of GPUs to allocate in the cluster. This must be multiple of 8. For
	// example, 8, 16 or 24
	NumGPUs int64 `json:"num_gpus" api:"required"`
	// Nvidia driver version for this cluster. For example, 550. Only some combination
	// of cuda_version and nvidia_driver_version are supported.
	NvidiaDriverVersion string `json:"nvidia_driver_version" api:"required"`
	// Region to create the GPU cluster in. Usable regions can be found from
	// `client.clusters.list_regions()`
	Region string `json:"region" api:"required"`
	// Whether to enable auto-scaling for the cluster. If true, the cluster will
	// automatically scale the number of GPU worker nodes between num_gpus and
	// auto_scale_max_gpus based on the workload.
	AutoScale param.Opt[bool] `json:"auto_scale,omitzero"`
	// Maximum number of GPUs to which the cluster can be auto-scaled up. This field is
	// required if auto_scaled is true.
	AutoScaleMaxGPUs param.Opt[int64] `json:"auto_scale_max_gpus,omitzero"`
	// Whether GPU cluster should be auto-scaled based on the workload. By default, it
	// is not auto-scaled.
	AutoScaled param.Opt[bool] `json:"auto_scaled,omitzero"`
	// ID of the capacity pool to use for the cluster. This field is optional and only
	// applicable if the cluster is created from a capacity pool.
	CapacityPoolID param.Opt[string] `json:"capacity_pool_id,omitzero"`
	// Duration in days to keep the cluster running.
	DurationDays param.Opt[int64] `json:"duration_days,omitzero"`
	// Whether automated GPU node failover should be enabled for this cluster. By
	// default, it is disabled.
	GPUNodeFailoverEnabled param.Opt[bool] `json:"gpu_node_failover_enabled,omitzero"`
	// Whether to install Traefik ingress controller in the cluster. This field is only
	// applicable for Kubernetes clusters and is false by default.
	InstallTraefik param.Opt[bool] `json:"install_traefik,omitzero"`
	// Number of GPUs to allocate from the capacity pool. Must be a multiple of 8 and
	// not exceed num_gpus.
	NumCapacityPoolGPUs param.Opt[int64] `json:"num_capacity_pool_gpus,omitzero"`
	// Number of preemptible GPUs to request alongside on-demand capacity. Must be a
	// multiple of 8. Preemptible nodes are cheaper but may be reclaimed when on-demand
	// capacity is needed elsewhere; the system fulfills this asynchronously and
	// surfaces the actual count in allocated_preemptible_gpus.
	NumPreemptibleGPUs param.Opt[int64] `json:"num_preemptible_gpus,omitzero"`
	// Number of prepaid (PLG) reserved GPUs for this cluster. When omitted for
	// RESERVED billing on create, the server defaults this to num_gpus.
	NumReservedGPUs param.Opt[int64] `json:"num_reserved_gpus,omitzero"`
	// Project ID for the cluster. If not set, the project from the request context is
	// used.
	ProjectID param.Opt[string] `json:"project_id,omitzero"`
	// Reservation end time of the cluster. This field is required for SCHEDULED
	// billing to specify the reservation end time for the cluster.
	ReservationEndTime param.Opt[time.Time] `json:"reservation_end_time,omitzero" format:"date-time"`
	// Reservation start time of the cluster. This field is required for SCHEDULED
	// billing to specify the reservation start time for the cluster. If not provided,
	// the cluster provisions immediately.
	ReservationStartTime param.Opt[time.Time] `json:"reservation_start_time,omitzero" format:"date-time"`
	// Custom Slurm image for Slurm clusters.
	SlurmImage param.Opt[string] `json:"slurm_image,omitzero"`
	// Shared memory size in GiB for Slurm cluster. This field is required if
	// cluster_type is SLURM.
	SlurmShmSizeGib param.Opt[int64] `json:"slurm_shm_size_gib,omitzero"`
	// ID of an existing volume to use with the cluster creation.
	VolumeID param.Opt[string] `json:"volume_id,omitzero"`
	// AcceptanceTestsParams groups all GPU acceptance test options when enabled is
	// true.
	AcceptanceTestsParams BetaClusterNewParamsAcceptanceTestsParams `json:"acceptance_tests_params,omitzero"`
	// Add-ons to enable on the cluster at creation time.
	AddOns        []BetaClusterNewParamsAddOn       `json:"add_ons,omitzero"`
	ClusterConfig BetaClusterNewParamsClusterConfig `json:"cluster_config,omitzero"`
	// Type of cluster to create.
	//
	// Any of "KUBERNETES", "SLURM".
	ClusterType BetaClusterNewParamsClusterType `json:"cluster_type,omitzero"`
	OidcConfig  BetaClusterNewParamsOidcConfig  `json:"oidc_config,omitzero"`
	// Inline configuration to create a shared volume with the cluster creation.
	SharedVolume BetaClusterNewParamsSharedVolume `json:"shared_volume,omitzero"`
	// contains filtered or unexported fields
}

func (BetaClusterNewParams) MarshalJSON added in v0.4.0

func (r BetaClusterNewParams) MarshalJSON() (data []byte, err error)

func (*BetaClusterNewParams) UnmarshalJSON added in v0.4.0

func (r *BetaClusterNewParams) UnmarshalJSON(data []byte) error

type BetaClusterNewParamsAcceptanceTestsParams added in v0.10.0

type BetaClusterNewParamsAcceptanceTestsParams struct {
	// Skip DCGM diagnostics acceptance test.
	DcgmDiagSkipped param.Opt[bool] `json:"dcgm_diag_skipped,omitzero"`
	// Whether to run GPU acceptance tests during cluster bring-up.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// GPU burn duration in seconds; 0 means use the default when enabled.
	GPUBurnDuration param.Opt[int64] `json:"gpu_burn_duration,omitzero"`
	// Skip GPU burn acceptance test.
	GPUBurnSkipped param.Opt[bool] `json:"gpu_burn_skipped,omitzero"`
	// Skip NCCL multi-node acceptance test.
	NcclMultiNodeSkipped param.Opt[bool] `json:"nccl_multi_node_skipped,omitzero"`
	// Skip NCCL single-node acceptance test.
	NcclSingleNodeSkipped param.Opt[bool] `json:"nccl_single_node_skipped,omitzero"`
	// DCGM diagnostic depth. SHORT = readiness; MEDIUM = default; LONG = system
	// validation; EXTENDED = memtest. An omitted value selects MEDIUM when enabled.
	//
	// Any of "DCGM_DIAG_LEVEL_SHORT", "DCGM_DIAG_LEVEL_MEDIUM",
	// "DCGM_DIAG_LEVEL_LONG", "DCGM_DIAG_LEVEL_EXTENDED".
	DcgmDiagLevel string `json:"dcgm_diag_level,omitzero"`
	// contains filtered or unexported fields
}

AcceptanceTestsParams groups all GPU acceptance test options when enabled is true.

func (BetaClusterNewParamsAcceptanceTestsParams) MarshalJSON added in v0.10.0

func (r BetaClusterNewParamsAcceptanceTestsParams) MarshalJSON() (data []byte, err error)

func (*BetaClusterNewParamsAcceptanceTestsParams) UnmarshalJSON added in v0.10.0

func (r *BetaClusterNewParamsAcceptanceTestsParams) UnmarshalJSON(data []byte) error

type BetaClusterNewParamsAddOn added in v0.10.0

type BetaClusterNewParamsAddOn struct {
	// Type of add-on. Valid values: 'dashboard', 'ingress'.
	AddOnType string `json:"add_on_type" api:"required"`
	// Human-readable name for this add-on instance.
	Name   string                          `json:"name" api:"required"`
	Config BetaClusterNewParamsAddOnConfig `json:"config,omitzero"`
	// contains filtered or unexported fields
}

The properties AddOnType, Name are required.

func (BetaClusterNewParamsAddOn) MarshalJSON added in v0.10.0

func (r BetaClusterNewParamsAddOn) MarshalJSON() (data []byte, err error)

func (*BetaClusterNewParamsAddOn) UnmarshalJSON added in v0.10.0

func (r *BetaClusterNewParamsAddOn) UnmarshalJSON(data []byte) error

type BetaClusterNewParamsAddOnConfig added in v0.10.0

type BetaClusterNewParamsAddOnConfig struct {
	Dashboard BetaClusterNewParamsAddOnConfigDashboard `json:"dashboard,omitzero"`
	Ingress   BetaClusterNewParamsAddOnConfigIngress   `json:"ingress,omitzero"`
	// contains filtered or unexported fields
}

func (BetaClusterNewParamsAddOnConfig) MarshalJSON added in v0.10.0

func (r BetaClusterNewParamsAddOnConfig) MarshalJSON() (data []byte, err error)

func (*BetaClusterNewParamsAddOnConfig) UnmarshalJSON added in v0.10.0

func (r *BetaClusterNewParamsAddOnConfig) UnmarshalJSON(data []byte) error

type BetaClusterNewParamsAddOnConfigDashboard added in v0.10.0

type BetaClusterNewParamsAddOnConfigDashboard struct {
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

func (BetaClusterNewParamsAddOnConfigDashboard) MarshalJSON added in v0.10.0

func (r BetaClusterNewParamsAddOnConfigDashboard) MarshalJSON() (data []byte, err error)

func (*BetaClusterNewParamsAddOnConfigDashboard) UnmarshalJSON added in v0.10.0

func (r *BetaClusterNewParamsAddOnConfigDashboard) UnmarshalJSON(data []byte) error

type BetaClusterNewParamsAddOnConfigIngress added in v0.10.0

type BetaClusterNewParamsAddOnConfigIngress struct {
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

func (BetaClusterNewParamsAddOnConfigIngress) MarshalJSON added in v0.10.0

func (r BetaClusterNewParamsAddOnConfigIngress) MarshalJSON() (data []byte, err error)

func (*BetaClusterNewParamsAddOnConfigIngress) UnmarshalJSON added in v0.10.0

func (r *BetaClusterNewParamsAddOnConfigIngress) UnmarshalJSON(data []byte) error

type BetaClusterNewParamsBillingType added in v0.4.0

type BetaClusterNewParamsBillingType string

RESERVED billing types allow you to specify the duration of the cluster reservation via the duration_days field. ON_DEMAND billing types will give you ownership of the cluster until you delete it. SCHEDULED_CAPACITY billing types allow you to reserve capacity for a scheduled time window. You must specify the reservation_start_time and reservation_end_time with this request.

const (
	BetaClusterNewParamsBillingTypeReserved          BetaClusterNewParamsBillingType = "RESERVED"
	BetaClusterNewParamsBillingTypeOnDemand          BetaClusterNewParamsBillingType = "ON_DEMAND"
	BetaClusterNewParamsBillingTypeScheduledCapacity BetaClusterNewParamsBillingType = "SCHEDULED_CAPACITY"
)

type BetaClusterNewParamsClusterConfig added in v0.10.0

type BetaClusterNewParamsClusterConfig struct {
	// Any of "NONE", "TRAEFIK", "NGINX", "ISTIO".
	LoadBalancer string `json:"load_balancer,omitzero" api:"required"`
	// NVIDIA GPU Operator chart/version for the tenant cluster (e.g. v24.6.2). When
	// omitted, a service default is applied.
	GPUOperatorVersion         param.Opt[string]                              `json:"gpu_operator_version,omitzero"`
	JumphostEnabled            param.Opt[bool]                                `json:"jumphost_enabled,omitzero"`
	KubernetesDashboardEnabled param.Opt[bool]                                `json:"kubernetes_dashboard_enabled,omitzero"`
	Ingress                    BetaClusterNewParamsClusterConfigIngress       `json:"ingress,omitzero"`
	Observability              BetaClusterNewParamsClusterConfigObservability `json:"observability,omitzero"`
	// SlurmStartupScripts carries optional Slurm lifecycle scripts (prolog/epilog,
	// init, extra conf).
	SlurmStartupScripts BetaClusterNewParamsClusterConfigSlurmStartupScripts `json:"slurm_startup_scripts,omitzero"`
	// contains filtered or unexported fields
}

The property LoadBalancer is required.

func (BetaClusterNewParamsClusterConfig) MarshalJSON added in v0.10.0

func (r BetaClusterNewParamsClusterConfig) MarshalJSON() (data []byte, err error)

func (*BetaClusterNewParamsClusterConfig) UnmarshalJSON added in v0.10.0

func (r *BetaClusterNewParamsClusterConfig) UnmarshalJSON(data []byte) error

type BetaClusterNewParamsClusterConfigIngress added in v0.10.0

type BetaClusterNewParamsClusterConfigIngress struct {
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

func (BetaClusterNewParamsClusterConfigIngress) MarshalJSON added in v0.10.0

func (r BetaClusterNewParamsClusterConfigIngress) MarshalJSON() (data []byte, err error)

func (*BetaClusterNewParamsClusterConfigIngress) UnmarshalJSON added in v0.10.0

func (r *BetaClusterNewParamsClusterConfigIngress) UnmarshalJSON(data []byte) error

type BetaClusterNewParamsClusterConfigObservability added in v0.10.0

type BetaClusterNewParamsClusterConfigObservability struct {
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

func (BetaClusterNewParamsClusterConfigObservability) MarshalJSON added in v0.10.0

func (r BetaClusterNewParamsClusterConfigObservability) MarshalJSON() (data []byte, err error)

func (*BetaClusterNewParamsClusterConfigObservability) UnmarshalJSON added in v0.10.0

type BetaClusterNewParamsClusterConfigSlurmStartupScripts added in v0.10.0

type BetaClusterNewParamsClusterConfigSlurmStartupScripts struct {
	// Slurm controller epilog script.
	ControllerEpilog param.Opt[string] `json:"controller_epilog,omitzero"`
	// Slurm controller prolog script.
	ControllerProlog param.Opt[string] `json:"controller_prolog,omitzero"`
	// Additional slurm.conf fragments.
	ExtraSlurmConf param.Opt[string] `json:"extra_slurm_conf,omitzero"`
	// Script run on Slurm login node init.
	LoginInitScript param.Opt[string] `json:"login_init_script,omitzero"`
	// Script run on Slurm nodeset init.
	NodesetInitScript param.Opt[string] `json:"nodeset_init_script,omitzero"`
	// Slurm worker node epilog script.
	WorkerEpilog param.Opt[string] `json:"worker_epilog,omitzero"`
	// Slurm worker node prolog script.
	WorkerProlog param.Opt[string] `json:"worker_prolog,omitzero"`
	// contains filtered or unexported fields
}

SlurmStartupScripts carries optional Slurm lifecycle scripts (prolog/epilog, init, extra conf).

func (BetaClusterNewParamsClusterConfigSlurmStartupScripts) MarshalJSON added in v0.10.0

func (r BetaClusterNewParamsClusterConfigSlurmStartupScripts) MarshalJSON() (data []byte, err error)

func (*BetaClusterNewParamsClusterConfigSlurmStartupScripts) UnmarshalJSON added in v0.10.0

type BetaClusterNewParamsClusterType added in v0.4.0

type BetaClusterNewParamsClusterType string

Type of cluster to create.

const (
	BetaClusterNewParamsClusterTypeKubernetes BetaClusterNewParamsClusterType = "KUBERNETES"
	BetaClusterNewParamsClusterTypeSlurm      BetaClusterNewParamsClusterType = "SLURM"
)

type BetaClusterNewParamsGPUType added in v0.4.0

type BetaClusterNewParamsGPUType string

Type of GPU to use in the cluster

const (
	BetaClusterNewParamsGPUTypeH100Sxm    BetaClusterNewParamsGPUType = "H100_SXM"
	BetaClusterNewParamsGPUTypeH200Sxm    BetaClusterNewParamsGPUType = "H200_SXM"
	BetaClusterNewParamsGPUTypeRtx6000Pci BetaClusterNewParamsGPUType = "RTX_6000_PCI"
	BetaClusterNewParamsGPUTypeL40Pcie    BetaClusterNewParamsGPUType = "L40_PCIE"
	BetaClusterNewParamsGPUTypeB200Sxm    BetaClusterNewParamsGPUType = "B200_SXM"
	BetaClusterNewParamsGPUTypeH100SxmInf BetaClusterNewParamsGPUType = "H100_SXM_INF"
)

type BetaClusterNewParamsOidcConfig added in v0.10.0

type BetaClusterNewParamsOidcConfig struct {
	// OIDC client ID for authentication.
	ClientID string `json:"client_id" api:"required"`
	// JWT claim to use for user groups. For example, 'groups'
	GroupClaim string `json:"group_claim" api:"required"`
	// Prefix to add to the group claim to form the final group name. For example,
	// 'oidc:'
	GroupPrefix string `json:"group_prefix" api:"required"`
	// OIDC issuer URL for authentication. For example, https://accounts.google.com
	IssuerURL string `json:"issuer_url" api:"required"`
	// JWT claim to use as the username. For example, 'sub' or 'email'
	UsernameClaim string `json:"username_claim" api:"required"`
	// Prefix to add to the username claim to form the final username. For example,
	// 'oidc:'
	UsernamePrefix string `json:"username_prefix" api:"required"`
	// CA certificate in PEM format to validate the OIDC issuer's TLS certificate. This
	// field is optional but recommended if the issuer uses a private CA or self-signed
	// certificate.
	CaCert param.Opt[string] `json:"ca_cert,omitzero"`
	// contains filtered or unexported fields
}

The properties ClientID, GroupClaim, GroupPrefix, IssuerURL, UsernameClaim, UsernamePrefix are required.

func (BetaClusterNewParamsOidcConfig) MarshalJSON added in v0.10.0

func (r BetaClusterNewParamsOidcConfig) MarshalJSON() (data []byte, err error)

func (*BetaClusterNewParamsOidcConfig) UnmarshalJSON added in v0.10.0

func (r *BetaClusterNewParamsOidcConfig) UnmarshalJSON(data []byte) error

type BetaClusterNewParamsSharedVolume added in v0.4.0

type BetaClusterNewParamsSharedVolume struct {
	// Region name. Usable regions can be found from `clusters.list_regions()`
	Region string `json:"region" api:"required"`
	// Volume size in whole tebibytes (TiB).
	SizeTib int64 `json:"size_tib" api:"required"`
	// User provided name of the volume.
	VolumeName string `json:"volume_name" api:"required"`
	// When true, the shared volume is not deleted when the cluster is decommissioned.
	IsLifecycleIndependent param.Opt[bool] `json:"is_lifecycle_independent,omitzero"`
	// contains filtered or unexported fields
}

Inline configuration to create a shared volume with the cluster creation.

The properties Region, SizeTib, VolumeName are required.

func (BetaClusterNewParamsSharedVolume) MarshalJSON added in v0.4.0

func (r BetaClusterNewParamsSharedVolume) MarshalJSON() (data []byte, err error)

func (*BetaClusterNewParamsSharedVolume) UnmarshalJSON added in v0.4.0

func (r *BetaClusterNewParamsSharedVolume) UnmarshalJSON(data []byte) error

type BetaClusterRemediationApproveParams added in v0.10.0

type BetaClusterRemediationApproveParams struct {
	ClusterID  string `path:"cluster_id" api:"required" json:"-"`
	InstanceID string `path:"instance_id" api:"required" json:"-"`
	// Comment explaining the action.
	Comment param.Opt[string] `json:"comment,omitzero"`
	// contains filtered or unexported fields
}

func (BetaClusterRemediationApproveParams) MarshalJSON added in v0.10.0

func (r BetaClusterRemediationApproveParams) MarshalJSON() (data []byte, err error)

func (*BetaClusterRemediationApproveParams) UnmarshalJSON added in v0.10.0

func (r *BetaClusterRemediationApproveParams) UnmarshalJSON(data []byte) error

type BetaClusterRemediationCancelParams added in v0.10.0

type BetaClusterRemediationCancelParams struct {
	// The cluster ID.
	ClusterID string `path:"cluster_id" api:"required" json:"-"`
	// The instance ID.
	InstanceID string `path:"instance_id" api:"required" json:"-"`
	// contains filtered or unexported fields
}

type BetaClusterRemediationGetParams added in v0.10.0

type BetaClusterRemediationGetParams struct {
	ClusterID  string `path:"cluster_id" api:"required" json:"-"`
	InstanceID string `path:"instance_id" api:"required" json:"-"`
	// contains filtered or unexported fields
}

type BetaClusterRemediationListParams added in v0.10.0

type BetaClusterRemediationListParams struct {
	ClusterID string `path:"cluster_id" api:"required" json:"-"`
	// Order by expression.
	OrderBy param.Opt[string] `query:"order_by,omitzero" json:"-"`
	// Maximum results to return.
	PageSize param.Opt[int64] `query:"page_size,omitzero" json:"-"`
	// Pagination token from previous request.
	PageToken param.Opt[string] `query:"page_token,omitzero" json:"-"`
	// Filter by remediation mode(s). Returns remediations matching any of the
	// specified modes.
	//
	// Any of "REMEDIATION_MODE_VM_ONLY", "REMEDIATION_MODE_HOST_AWARE",
	// "REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT", "REMEDIATION_MODE_REBOOT_VM".
	Mode []string `query:"mode,omitzero" json:"-"`
	// Filter by state(s). Returns remediations matching any of the specified states.
	//
	//   - `PENDING_APPROVAL`: Awaiting approval before processing can begin.
	//   - `PENDING`: Approved and queued for processing.
	//   - `RUNNING`: Actively being processed.
	//   - `SUCCEEDED`: Successfully completed.
	//   - `FAILED`: Failed with an error.
	//   - `CANCELLED`: Cancelled by user or system.
	//   - `AUTO_RESOLVED`: The underlying issue was automatically resolved before
	//     processing.
	//
	// Any of "PENDING_APPROVAL", "PENDING", "RUNNING", "SUCCEEDED", "FAILED",
	// "CANCELLED", "AUTO_RESOLVED".
	State []string `query:"state,omitzero" json:"-"`
	// Filter by trigger type(s). Returns remediations matching any of the specified
	// triggers.
	//
	// Any of "REMEDIATION_TRIGGER_MANUAL", "REMEDIATION_TRIGGER_AUTOMATED".
	Trigger []string `query:"trigger,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaClusterRemediationListParams) URLQuery added in v0.10.0

func (r BetaClusterRemediationListParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaClusterRemediationListParams's query parameters as `url.Values`.

type BetaClusterRemediationListResponse added in v0.10.0

type BetaClusterRemediationListResponse struct {
	// Indicates if there are more results available.
	HasNext bool `json:"has_next" api:"required"`
	// Token for the next page.
	NextPageToken string `json:"next_page_token" api:"required"`
	// The list of remediations.
	Remediations []Remediation `json:"remediations" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		HasNext       respjson.Field
		NextPageToken respjson.Field
		Remediations  respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

ListRemediationsResponse is the response for ListRemediations.

func (BetaClusterRemediationListResponse) RawJSON added in v0.10.0

Returns the unmodified JSON received from the API

func (*BetaClusterRemediationListResponse) UnmarshalJSON added in v0.10.0

func (r *BetaClusterRemediationListResponse) UnmarshalJSON(data []byte) error

type BetaClusterRemediationNewParams added in v0.10.0

type BetaClusterRemediationNewParams struct {
	ClusterID string `path:"cluster_id" api:"required" json:"-"`
	// Remediation represents a node remediation request for an instance. An instance
	// can have multiple remediations over time (e.g., failed attempts followed by
	// retries).
	Remediation RemediationParam
	// Client-specified ID for idempotency.
	RemediationID param.Opt[string] `query:"remediation_id,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaClusterRemediationNewParams) MarshalJSON added in v0.10.0

func (r BetaClusterRemediationNewParams) MarshalJSON() (data []byte, err error)

func (BetaClusterRemediationNewParams) URLQuery added in v0.10.0

func (r BetaClusterRemediationNewParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaClusterRemediationNewParams's query parameters as `url.Values`.

func (*BetaClusterRemediationNewParams) UnmarshalJSON added in v0.10.0

func (r *BetaClusterRemediationNewParams) UnmarshalJSON(data []byte) error

type BetaClusterRemediationRejectParams added in v0.10.0

type BetaClusterRemediationRejectParams struct {
	ClusterID  string `path:"cluster_id" api:"required" json:"-"`
	InstanceID string `path:"instance_id" api:"required" json:"-"`
	// Comment explaining the action.
	Comment param.Opt[string] `json:"comment,omitzero"`
	// contains filtered or unexported fields
}

func (BetaClusterRemediationRejectParams) MarshalJSON added in v0.10.0

func (r BetaClusterRemediationRejectParams) MarshalJSON() (data []byte, err error)

func (*BetaClusterRemediationRejectParams) UnmarshalJSON added in v0.10.0

func (r *BetaClusterRemediationRejectParams) UnmarshalJSON(data []byte) error

type BetaClusterRemediationService added in v0.10.0

type BetaClusterRemediationService struct {
	Options []option.RequestOption
}

BetaClusterRemediationService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewBetaClusterRemediationService method instead.

func NewBetaClusterRemediationService added in v0.10.0

func NewBetaClusterRemediationService(opts ...option.RequestOption) (r BetaClusterRemediationService)

NewBetaClusterRemediationService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*BetaClusterRemediationService) Approve added in v0.10.0

Approves a pending remediation.

Only remediations with state PENDING_APPROVAL can be approved.

On APPROVE: state changes to PENDING and the remediation process begins. The reviewed_by, review_time, and review_comment fields are populated on the remediation after approval.

func (*BetaClusterRemediationService) Cancel added in v0.10.0

Cancels a pending remediation.

Only remediations in PENDING_APPROVAL or PENDING state can be cancelled.

func (*BetaClusterRemediationService) Get added in v0.10.0

Retrieve the status of a specific remdiation on a specific instance in a specific cluster.

func (*BetaClusterRemediationService) List added in v0.10.0

Lists remediations for an instance or cluster.

func (*BetaClusterRemediationService) New added in v0.10.0

Creates a new remediation for an instance.

Remediations created via the API goes directly to PENDING state.

Our system may trigger automated remediations that require approval. These remediations are created with PENDING_APPROVAL state. The user must call /approve to start the actual remediation process. These operations can also be rejected by calling /reject.

func (*BetaClusterRemediationService) Reject added in v0.10.0

Rejects a pending remediation.

Only remediations with state PENDING_APPROVAL can be rejected.

On REJECT: state changes to CANCELLED. The reviewed_by, review_time, and review_comment fields are populated on the remediation after rejection.

type BetaClusterService added in v0.4.0

type BetaClusterService struct {
	Options      []option.RequestOption
	Remediations BetaClusterRemediationService
	Storage      BetaClusterStorageService
}

BetaClusterService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewBetaClusterService method instead.

func NewBetaClusterService added in v0.4.0

func NewBetaClusterService(opts ...option.RequestOption) (r BetaClusterService)

NewBetaClusterService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*BetaClusterService) Delete added in v0.4.0

func (r *BetaClusterService) Delete(ctx context.Context, clusterID string, opts ...option.RequestOption) (res *BetaClusterDeleteResponse, err error)

Delete a GPU cluster by cluster ID.

func (*BetaClusterService) Get added in v0.4.0

func (r *BetaClusterService) Get(ctx context.Context, clusterID string, opts ...option.RequestOption) (res *Cluster, err error)

Retrieve information about a specific GPU cluster.

func (*BetaClusterService) List added in v0.4.0

List all GPU clusters.

func (*BetaClusterService) ListRegions added in v0.4.0

List regions and corresponding supported driver versions

func (*BetaClusterService) New added in v0.4.0

Create an Instant Cluster on Together's high-performance GPU clusters. With features like on-demand scaling, long-lived resizable high-bandwidth shared DC-local storage, Kubernetes and Slurm cluster flavors, a REST API, and Terraform support, you can run workloads flexibly without complex infrastructure management.

func (*BetaClusterService) Update added in v0.4.0

func (r *BetaClusterService) Update(ctx context.Context, clusterID string, body BetaClusterUpdateParams, opts ...option.RequestOption) (res *Cluster, err error)

Update the configuration of an existing GPU cluster.

type BetaClusterStorageDeleteResponse added in v0.4.0

type BetaClusterStorageDeleteResponse struct {
	Success bool `json:"success" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaClusterStorageDeleteResponse) RawJSON added in v0.4.0

Returns the unmodified JSON received from the API

func (*BetaClusterStorageDeleteResponse) UnmarshalJSON added in v0.4.0

func (r *BetaClusterStorageDeleteResponse) UnmarshalJSON(data []byte) error

type BetaClusterStorageListParams added in v0.10.0

type BetaClusterStorageListParams struct {
	// Optional UMS project ID to filter volumes by. When set, only volumes belonging
	// to this project are returned. The caller must be a member of the project;
	// otherwise the result set will be empty.
	ProjectID param.Opt[string] `query:"project_id,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaClusterStorageListParams) URLQuery added in v0.10.0

func (r BetaClusterStorageListParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaClusterStorageListParams's query parameters as `url.Values`.

type BetaClusterStorageListResponse added in v0.4.0

type BetaClusterStorageListResponse struct {
	Volumes []ClusterStorage `json:"volumes" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Volumes     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaClusterStorageListResponse) RawJSON added in v0.4.0

Returns the unmodified JSON received from the API

func (*BetaClusterStorageListResponse) UnmarshalJSON added in v0.4.0

func (r *BetaClusterStorageListResponse) UnmarshalJSON(data []byte) error

type BetaClusterStorageNewParams added in v0.4.0

type BetaClusterStorageNewParams struct {
	// Region name. Usable regions can be found from `clusters.list_regions()`
	Region string `json:"region" api:"required"`
	// Volume size in whole tebibytes (TiB).
	SizeTib int64 `json:"size_tib" api:"required"`
	// User provided name of the volume.
	VolumeName string `json:"volume_name" api:"required"`
	// When true, the shared volume is not deleted when the cluster is decommissioned.
	IsLifecycleIndependent param.Opt[bool] `json:"is_lifecycle_independent,omitzero"`
	// contains filtered or unexported fields
}

func (BetaClusterStorageNewParams) MarshalJSON added in v0.4.0

func (r BetaClusterStorageNewParams) MarshalJSON() (data []byte, err error)

func (*BetaClusterStorageNewParams) UnmarshalJSON added in v0.4.0

func (r *BetaClusterStorageNewParams) UnmarshalJSON(data []byte) error

type BetaClusterStorageService added in v0.4.0

type BetaClusterStorageService struct {
	Options []option.RequestOption
}

BetaClusterStorageService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewBetaClusterStorageService method instead.

func NewBetaClusterStorageService added in v0.4.0

func NewBetaClusterStorageService(opts ...option.RequestOption) (r BetaClusterStorageService)

NewBetaClusterStorageService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*BetaClusterStorageService) Delete added in v0.4.0

Delete a shared volume. Note that if this volume is attached to a cluster, deleting will fail.

func (*BetaClusterStorageService) Get added in v0.4.0

func (r *BetaClusterStorageService) Get(ctx context.Context, volumeID string, opts ...option.RequestOption) (res *ClusterStorage, err error)

Retrieve information about a specific shared volume.

func (*BetaClusterStorageService) List added in v0.4.0

List all shared volumes.

func (*BetaClusterStorageService) New added in v0.4.0

Instant Clusters supports long-lived, resizable in-DC shared storage with user data persistence. You can dynamically create and attach volumes to your cluster at cluster creation time, and resize as your data grows. All shared storage is backed by multi-NIC bare metal paths, ensuring high-throughput and low-latency performance for shared storage.

func (*BetaClusterStorageService) Update added in v0.4.0

Update the configuration of an existing shared volume.

type BetaClusterStorageUpdateParams added in v0.4.0

type BetaClusterStorageUpdateParams struct {
	// ID of the volume.
	VolumeID string `json:"volume_id" api:"required"`
	// Size of the volume in TiB.
	SizeTib param.Opt[int64] `json:"size_tib,omitzero"`
	// contains filtered or unexported fields
}

func (BetaClusterStorageUpdateParams) MarshalJSON added in v0.4.0

func (r BetaClusterStorageUpdateParams) MarshalJSON() (data []byte, err error)

func (*BetaClusterStorageUpdateParams) UnmarshalJSON added in v0.4.0

func (r *BetaClusterStorageUpdateParams) UnmarshalJSON(data []byte) error

type BetaClusterUpdateParams added in v0.4.0

type BetaClusterUpdateParams struct {
	// Target GPU count for the cluster. When omitted, the server keeps the current GPU
	// count from cluster metadata (use for config-only or decommission-time-only
	// updates).
	NumGPUs param.Opt[int64] `json:"num_gpus,omitzero"`
	// Updated desired number of preemptible GPUs for the cluster. When omitted, the
	// current value is preserved. Must be a multiple of 8.
	NumPreemptibleGPUs param.Opt[int64] `json:"num_preemptible_gpus,omitzero"`
	// Number of reserved GPUs to update to. This field is only applicable for clusters
	// with RESERVED billing type.
	NumReservedGPUs param.Opt[int64] `json:"num_reserved_gpus,omitzero"`
	// Timestamp at which the cluster should be decommissioned. Only accepted for
	// prepaid clusters.
	ReservationEndTime param.Opt[time.Time] `json:"reservation_end_time,omitzero" format:"date-time"`
	// Add-ons to update on the cluster. Each entry identifies an existing add-on by
	// name and provides the new external config to merge.
	AddOns        []BetaClusterUpdateParamsAddOn       `json:"add_ons,omitzero"`
	ClusterConfig BetaClusterUpdateParamsClusterConfig `json:"cluster_config,omitzero"`
	// Type of cluster to update.
	//
	// Any of "KUBERNETES", "SLURM".
	ClusterType BetaClusterUpdateParamsClusterType `json:"cluster_type,omitzero"`
	// contains filtered or unexported fields
}

func (BetaClusterUpdateParams) MarshalJSON added in v0.4.0

func (r BetaClusterUpdateParams) MarshalJSON() (data []byte, err error)

func (*BetaClusterUpdateParams) UnmarshalJSON added in v0.4.0

func (r *BetaClusterUpdateParams) UnmarshalJSON(data []byte) error

type BetaClusterUpdateParamsAddOn added in v0.10.0

type BetaClusterUpdateParamsAddOn struct {
	// Name of the add-on to update. Must match an existing add-on on the cluster.
	Name   string                             `json:"name" api:"required"`
	Config BetaClusterUpdateParamsAddOnConfig `json:"config,omitzero"`
	// contains filtered or unexported fields
}

The property Name is required.

func (BetaClusterUpdateParamsAddOn) MarshalJSON added in v0.10.0

func (r BetaClusterUpdateParamsAddOn) MarshalJSON() (data []byte, err error)

func (*BetaClusterUpdateParamsAddOn) UnmarshalJSON added in v0.10.0

func (r *BetaClusterUpdateParamsAddOn) UnmarshalJSON(data []byte) error

type BetaClusterUpdateParamsAddOnConfig added in v0.10.0

type BetaClusterUpdateParamsAddOnConfig struct {
	Dashboard BetaClusterUpdateParamsAddOnConfigDashboard `json:"dashboard,omitzero"`
	Ingress   BetaClusterUpdateParamsAddOnConfigIngress   `json:"ingress,omitzero"`
	// contains filtered or unexported fields
}

func (BetaClusterUpdateParamsAddOnConfig) MarshalJSON added in v0.10.0

func (r BetaClusterUpdateParamsAddOnConfig) MarshalJSON() (data []byte, err error)

func (*BetaClusterUpdateParamsAddOnConfig) UnmarshalJSON added in v0.10.0

func (r *BetaClusterUpdateParamsAddOnConfig) UnmarshalJSON(data []byte) error

type BetaClusterUpdateParamsAddOnConfigDashboard added in v0.10.0

type BetaClusterUpdateParamsAddOnConfigDashboard struct {
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

func (BetaClusterUpdateParamsAddOnConfigDashboard) MarshalJSON added in v0.10.0

func (r BetaClusterUpdateParamsAddOnConfigDashboard) MarshalJSON() (data []byte, err error)

func (*BetaClusterUpdateParamsAddOnConfigDashboard) UnmarshalJSON added in v0.10.0

func (r *BetaClusterUpdateParamsAddOnConfigDashboard) UnmarshalJSON(data []byte) error

type BetaClusterUpdateParamsAddOnConfigIngress added in v0.10.0

type BetaClusterUpdateParamsAddOnConfigIngress struct {
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

func (BetaClusterUpdateParamsAddOnConfigIngress) MarshalJSON added in v0.10.0

func (r BetaClusterUpdateParamsAddOnConfigIngress) MarshalJSON() (data []byte, err error)

func (*BetaClusterUpdateParamsAddOnConfigIngress) UnmarshalJSON added in v0.10.0

func (r *BetaClusterUpdateParamsAddOnConfigIngress) UnmarshalJSON(data []byte) error

type BetaClusterUpdateParamsClusterConfig added in v0.10.0

type BetaClusterUpdateParamsClusterConfig struct {
	// Any of "NONE", "TRAEFIK", "NGINX", "ISTIO".
	LoadBalancer string `json:"load_balancer,omitzero" api:"required"`
	// NVIDIA GPU Operator chart/version for the tenant cluster (e.g. v24.6.2). When
	// omitted, a service default is applied.
	GPUOperatorVersion         param.Opt[string]                                 `json:"gpu_operator_version,omitzero"`
	JumphostEnabled            param.Opt[bool]                                   `json:"jumphost_enabled,omitzero"`
	KubernetesDashboardEnabled param.Opt[bool]                                   `json:"kubernetes_dashboard_enabled,omitzero"`
	Ingress                    BetaClusterUpdateParamsClusterConfigIngress       `json:"ingress,omitzero"`
	Observability              BetaClusterUpdateParamsClusterConfigObservability `json:"observability,omitzero"`
	// SlurmStartupScripts carries optional Slurm lifecycle scripts (prolog/epilog,
	// init, extra conf).
	SlurmStartupScripts BetaClusterUpdateParamsClusterConfigSlurmStartupScripts `json:"slurm_startup_scripts,omitzero"`
	// contains filtered or unexported fields
}

The property LoadBalancer is required.

func (BetaClusterUpdateParamsClusterConfig) MarshalJSON added in v0.10.0

func (r BetaClusterUpdateParamsClusterConfig) MarshalJSON() (data []byte, err error)

func (*BetaClusterUpdateParamsClusterConfig) UnmarshalJSON added in v0.10.0

func (r *BetaClusterUpdateParamsClusterConfig) UnmarshalJSON(data []byte) error

type BetaClusterUpdateParamsClusterConfigIngress added in v0.10.0

type BetaClusterUpdateParamsClusterConfigIngress struct {
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

func (BetaClusterUpdateParamsClusterConfigIngress) MarshalJSON added in v0.10.0

func (r BetaClusterUpdateParamsClusterConfigIngress) MarshalJSON() (data []byte, err error)

func (*BetaClusterUpdateParamsClusterConfigIngress) UnmarshalJSON added in v0.10.0

func (r *BetaClusterUpdateParamsClusterConfigIngress) UnmarshalJSON(data []byte) error

type BetaClusterUpdateParamsClusterConfigObservability added in v0.10.0

type BetaClusterUpdateParamsClusterConfigObservability struct {
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

func (BetaClusterUpdateParamsClusterConfigObservability) MarshalJSON added in v0.10.0

func (r BetaClusterUpdateParamsClusterConfigObservability) MarshalJSON() (data []byte, err error)

func (*BetaClusterUpdateParamsClusterConfigObservability) UnmarshalJSON added in v0.10.0

type BetaClusterUpdateParamsClusterConfigSlurmStartupScripts added in v0.10.0

type BetaClusterUpdateParamsClusterConfigSlurmStartupScripts struct {
	// Slurm controller epilog script.
	ControllerEpilog param.Opt[string] `json:"controller_epilog,omitzero"`
	// Slurm controller prolog script.
	ControllerProlog param.Opt[string] `json:"controller_prolog,omitzero"`
	// Additional slurm.conf fragments.
	ExtraSlurmConf param.Opt[string] `json:"extra_slurm_conf,omitzero"`
	// Script run on Slurm login node init.
	LoginInitScript param.Opt[string] `json:"login_init_script,omitzero"`
	// Script run on Slurm nodeset init.
	NodesetInitScript param.Opt[string] `json:"nodeset_init_script,omitzero"`
	// Slurm worker node epilog script.
	WorkerEpilog param.Opt[string] `json:"worker_epilog,omitzero"`
	// Slurm worker node prolog script.
	WorkerProlog param.Opt[string] `json:"worker_prolog,omitzero"`
	// contains filtered or unexported fields
}

SlurmStartupScripts carries optional Slurm lifecycle scripts (prolog/epilog, init, extra conf).

func (BetaClusterUpdateParamsClusterConfigSlurmStartupScripts) MarshalJSON added in v0.10.0

func (*BetaClusterUpdateParamsClusterConfigSlurmStartupScripts) UnmarshalJSON added in v0.10.0

type BetaClusterUpdateParamsClusterType added in v0.4.0

type BetaClusterUpdateParamsClusterType string

Type of cluster to update.

const (
	BetaClusterUpdateParamsClusterTypeKubernetes BetaClusterUpdateParamsClusterType = "KUBERNETES"
	BetaClusterUpdateParamsClusterTypeSlurm      BetaClusterUpdateParamsClusterType = "SLURM"
)

type BetaJigDeployParams added in v0.6.0

type BetaJigDeployParams struct {
	// GPUType specifies the GPU hardware to use (e.g., "h100-80gb").
	//
	// Any of "h100-80gb", "h100-40gb-mig", "h200-140gb", "b200-192gb".
	GPUType BetaJigDeployParamsGPUType `json:"gpu_type,omitzero" api:"required"`
	// Image is the container image to deploy from registry.together.ai.
	Image string `json:"image" api:"required"`
	// Name is the unique identifier for your deployment. Must contain only
	// alphanumeric characters, underscores, or hyphens (1-100 characters)
	Name string `json:"name" api:"required"`
	// CPU is the number of CPU cores to allocate per container instance (e.g., 0.1 =
	// 100 milli cores)
	CPU param.Opt[float64] `json:"cpu,omitzero"`
	// Description is an optional human-readable description of your deployment
	Description param.Opt[string] `json:"description,omitzero"`
	// GPUCount is the number of GPUs to allocate per container instance. Defaults to 0
	// if not specified
	GPUCount param.Opt[int64] `json:"gpu_count,omitzero"`
	// HealthCheckPath is the HTTP path for health checks (e.g., "/health"). If set,
	// the platform checks this endpoint to determine container health.
	HealthCheckPath param.Opt[string] `json:"health_check_path,omitzero"`
	// MaxReplicas is the maximum number of container instances. Defaults to
	// MinReplicas if not set.
	MaxReplicas param.Opt[int64] `json:"max_replicas,omitzero"`
	// Memory is the amount of RAM to allocate per container instance in GiB (e.g., 0.5
	// = 512MiB)
	Memory param.Opt[float64] `json:"memory,omitzero"`
	// MinReplicas is the minimum number of container instances to run. Defaults to 1
	// if not specified
	MinReplicas param.Opt[int64] `json:"min_replicas,omitzero"`
	// Port is the container port your application listens on (e.g., 8080 for web
	// servers). Required if your application serves traffic
	Port param.Opt[int64] `json:"port,omitzero"`
	// Storage is the amount of ephemeral disk storage to allocate per container
	// instance (e.g., 10 = 10GiB)
	Storage param.Opt[int64] `json:"storage,omitzero"`
	// TerminationGracePeriodSeconds is the time in seconds to wait for graceful
	// shutdown before forcefully terminating the replica
	TerminationGracePeriodSeconds param.Opt[int64] `json:"termination_grace_period_seconds,omitzero"`
	// Args overrides the container's CMD. Provide as an array of arguments (e.g.,
	// ["python", "app.py"])
	Args []string `json:"args,omitzero"`
	// Autoscaling configuration. Example: {"metric": "QueueBacklogPerWorker",
	// "target": 1.01} to scale based on queue backlog. Omit or set to null to disable
	// autoscaling
	Autoscaling BetaJigDeployParamsAutoscalingUnion `json:"autoscaling,omitzero"`
	// Command overrides the container's ENTRYPOINT. Provide as an array (e.g.,
	// ["/bin/sh", "-c"])
	Command []string `json:"command,omitzero"`
	// EnvironmentVariables is a list of environment variables to set in the container.
	// Each must have a name and either a value or value_from_secret
	EnvironmentVariables []BetaJigDeployParamsEnvironmentVariable `json:"environment_variables,omitzero"`
	// Volumes is a list of volume mounts to attach to the container. Each mount must
	// reference an existing volume by name
	Volumes []BetaJigDeployParamsVolume `json:"volumes,omitzero"`
	// contains filtered or unexported fields
}

func (BetaJigDeployParams) MarshalJSON added in v0.6.0

func (r BetaJigDeployParams) MarshalJSON() (data []byte, err error)

func (*BetaJigDeployParams) UnmarshalJSON added in v0.6.0

func (r *BetaJigDeployParams) UnmarshalJSON(data []byte) error

type BetaJigDeployParamsAutoscalingCustomMetricAutoscalingConfig added in v0.7.0

type BetaJigDeployParamsAutoscalingCustomMetricAutoscalingConfig struct {
	// CustomMetricName is the Prometheus metric name. Required. Must match
	// [a-zA-Z\_:][a-zA-Z0-9_:]\*
	CustomMetricName param.Opt[string] `json:"custom_metric_name,omitzero"`
	// Target is the threshold value. Default: 500
	Target param.Opt[float64] `json:"target,omitzero"`
	// Metric must be CustomMetric
	//
	// Any of "CustomMetric".
	Metric string `json:"metric,omitzero"`
	// contains filtered or unexported fields
}

Autoscaling config for CustomMetric metric

func (BetaJigDeployParamsAutoscalingCustomMetricAutoscalingConfig) MarshalJSON added in v0.7.0

func (*BetaJigDeployParamsAutoscalingCustomMetricAutoscalingConfig) UnmarshalJSON added in v0.7.0

type BetaJigDeployParamsAutoscalingHTTPAutoscalingConfig added in v0.7.0

type BetaJigDeployParamsAutoscalingHTTPAutoscalingConfig struct {
	// Target is the threshold value. Default: 100 for HTTPTotalRequests, 500 (ms) for
	// HTTPAvgRequestDuration
	Target param.Opt[float64] `json:"target,omitzero"`
	// TimeIntervalMinutes is the rate window in minutes. Default: 10
	TimeIntervalMinutes param.Opt[int64] `json:"time_interval_minutes,omitzero"`
	// Metric must be HTTPTotalRequests or HTTPAvgRequestDuration
	//
	// Any of "HTTPTotalRequests", "HTTPAvgRequestDuration".
	Metric string `json:"metric,omitzero"`
	// contains filtered or unexported fields
}

Autoscaling config for HTTPTotalRequests and HTTPAvgRequestDuration metrics

func (BetaJigDeployParamsAutoscalingHTTPAutoscalingConfig) MarshalJSON added in v0.7.0

func (r BetaJigDeployParamsAutoscalingHTTPAutoscalingConfig) MarshalJSON() (data []byte, err error)

func (*BetaJigDeployParamsAutoscalingHTTPAutoscalingConfig) UnmarshalJSON added in v0.7.0

type BetaJigDeployParamsAutoscalingQueueAutoscalingConfig added in v0.7.0

type BetaJigDeployParamsAutoscalingQueueAutoscalingConfig struct {
	// Model overrides the model name for queue status lookup. Defaults to the
	// deployment app name
	Model param.Opt[string] `json:"model,omitzero"`
	// Target is the threshold value. Default: 1.01
	Target param.Opt[float64] `json:"target,omitzero"`
	// Metric must be QueueBacklogPerWorker
	//
	// Any of "QueueBacklogPerWorker".
	Metric string `json:"metric,omitzero"`
	// contains filtered or unexported fields
}

Autoscaling config for QueueBacklogPerWorker metric

func (BetaJigDeployParamsAutoscalingQueueAutoscalingConfig) MarshalJSON added in v0.7.0

func (r BetaJigDeployParamsAutoscalingQueueAutoscalingConfig) MarshalJSON() (data []byte, err error)

func (*BetaJigDeployParamsAutoscalingQueueAutoscalingConfig) UnmarshalJSON added in v0.7.0

type BetaJigDeployParamsAutoscalingUnion added in v0.7.0

type BetaJigDeployParamsAutoscalingUnion struct {
	OfBetaJigDeploysAutoscalingHTTPAutoscalingConfig         *BetaJigDeployParamsAutoscalingHTTPAutoscalingConfig         `json:",omitzero,inline"`
	OfBetaJigDeploysAutoscalingQueueAutoscalingConfig        *BetaJigDeployParamsAutoscalingQueueAutoscalingConfig        `json:",omitzero,inline"`
	OfBetaJigDeploysAutoscalingCustomMetricAutoscalingConfig *BetaJigDeployParamsAutoscalingCustomMetricAutoscalingConfig `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (BetaJigDeployParamsAutoscalingUnion) GetCustomMetricName added in v0.7.0

func (u BetaJigDeployParamsAutoscalingUnion) GetCustomMetricName() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaJigDeployParamsAutoscalingUnion) GetMetric added in v0.7.0

Returns a pointer to the underlying variant's property, if present.

func (BetaJigDeployParamsAutoscalingUnion) GetModel added in v0.7.0

Returns a pointer to the underlying variant's property, if present.

func (BetaJigDeployParamsAutoscalingUnion) GetTarget added in v0.7.0

Returns a pointer to the underlying variant's property, if present.

func (BetaJigDeployParamsAutoscalingUnion) GetTimeIntervalMinutes added in v0.7.0

func (u BetaJigDeployParamsAutoscalingUnion) GetTimeIntervalMinutes() *int64

Returns a pointer to the underlying variant's property, if present.

func (BetaJigDeployParamsAutoscalingUnion) MarshalJSON added in v0.7.0

func (u BetaJigDeployParamsAutoscalingUnion) MarshalJSON() ([]byte, error)

func (*BetaJigDeployParamsAutoscalingUnion) UnmarshalJSON added in v0.7.0

func (u *BetaJigDeployParamsAutoscalingUnion) UnmarshalJSON(data []byte) error

type BetaJigDeployParamsEnvironmentVariable added in v0.6.0

type BetaJigDeployParamsEnvironmentVariable struct {
	// Name is the environment variable name (e.g., "DATABASE_URL"). Must start with a
	// letter or underscore, followed by letters, numbers, or underscores
	Name string `json:"name" api:"required"`
	// Value is the plain text value for the environment variable. Use this for
	// non-sensitive values. Either Value or ValueFromSecret must be set, but not both
	Value param.Opt[string] `json:"value,omitzero"`
	// ValueFromSecret references a secret by name or ID to use as the value. Use this
	// for sensitive values like API keys or passwords. Either Value or ValueFromSecret
	// must be set, but not both
	ValueFromSecret param.Opt[string] `json:"value_from_secret,omitzero"`
	// contains filtered or unexported fields
}

The property Name is required.

func (BetaJigDeployParamsEnvironmentVariable) MarshalJSON added in v0.6.0

func (r BetaJigDeployParamsEnvironmentVariable) MarshalJSON() (data []byte, err error)

func (*BetaJigDeployParamsEnvironmentVariable) UnmarshalJSON added in v0.6.0

func (r *BetaJigDeployParamsEnvironmentVariable) UnmarshalJSON(data []byte) error

type BetaJigDeployParamsGPUType added in v0.6.0

type BetaJigDeployParamsGPUType string

GPUType specifies the GPU hardware to use (e.g., "h100-80gb").

const (
	BetaJigDeployParamsGPUTypeH100_80gb    BetaJigDeployParamsGPUType = "h100-80gb"
	BetaJigDeployParamsGPUTypeH100_40gbMig BetaJigDeployParamsGPUType = "h100-40gb-mig"
	BetaJigDeployParamsGPUTypeH200_140gb   BetaJigDeployParamsGPUType = "h200-140gb"
	BetaJigDeployParamsGPUTypeB200_192gb   BetaJigDeployParamsGPUType = "b200-192gb"
)

type BetaJigDeployParamsVolume added in v0.6.0

type BetaJigDeployParamsVolume struct {
	// MountPath is the path in the container where the volume mounts (e.g., "/data").
	MountPath string `json:"mount_path" api:"required"`
	// Name is the name of the volume to mount. Must reference an existing volume by
	// name or ID
	Name string `json:"name" api:"required"`
	// Version is the volume version to mount. On create, defaults to the latest
	// version. On update, defaults to the currently mounted version.
	Version param.Opt[int64] `json:"version,omitzero"`
	// contains filtered or unexported fields
}

The properties MountPath, Name are required.

func (BetaJigDeployParamsVolume) MarshalJSON added in v0.6.0

func (r BetaJigDeployParamsVolume) MarshalJSON() (data []byte, err error)

func (*BetaJigDeployParamsVolume) UnmarshalJSON added in v0.6.0

func (r *BetaJigDeployParamsVolume) UnmarshalJSON(data []byte) error

type BetaJigDestroyResponse added in v0.6.0

type BetaJigDestroyResponse = any

type BetaJigGetLogsParams added in v0.6.0

type BetaJigGetLogsParams struct {
	// Replica ID to filter logs
	ReplicaID param.Opt[string] `query:"replica_id,omitzero" json:"-"`
	// Deployment revision (UUID) to filter logs
	Revision param.Opt[string] `query:"revision,omitzero" json:"-"`
	// Deployment image version (tag or last 4 characters of image digest) to filter
	// logs
	Version param.Opt[string] `query:"version,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaJigGetLogsParams) URLQuery added in v0.6.0

func (r BetaJigGetLogsParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaJigGetLogsParams's query parameters as `url.Values`.

type BetaJigListResponse added in v0.6.0

type BetaJigListResponse struct {
	// Data is the array of deployment items
	Data []Deployment `json:"data"`
	// The object type, which is always `list`.
	//
	// Any of "list".
	Object BetaJigListResponseObject `json:"object"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Object      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaJigListResponse) RawJSON added in v0.6.0

func (r BetaJigListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaJigListResponse) UnmarshalJSON added in v0.6.0

func (r *BetaJigListResponse) UnmarshalJSON(data []byte) error

type BetaJigListResponseObject added in v0.7.0

type BetaJigListResponseObject string

The object type, which is always `list`.

const (
	BetaJigListResponseObjectList BetaJigListResponseObject = "list"
)

type BetaJigQueueCancelParams added in v0.6.0

type BetaJigQueueCancelParams struct {
	// Model identifier the job was submitted to
	Model string `json:"model" api:"required"`
	// The request ID returned from the submit endpoint
	RequestID string `json:"request_id" api:"required"`
	// contains filtered or unexported fields
}

func (BetaJigQueueCancelParams) MarshalJSON added in v0.6.0

func (r BetaJigQueueCancelParams) MarshalJSON() (data []byte, err error)

func (*BetaJigQueueCancelParams) UnmarshalJSON added in v0.6.0

func (r *BetaJigQueueCancelParams) UnmarshalJSON(data []byte) error

type BetaJigQueueCancelResponse added in v0.6.0

type BetaJigQueueCancelResponse struct {
	// Job status after the cancel attempt. Only pending jobs can be canceled. If the
	// job is already running, done, or failed, the status is returned unchanged.
	//
	// Any of "canceled", "running", "done", "failed".
	Status BetaJigQueueCancelResponseStatus `json:"status" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Status returned after a cancel attempt.

func (BetaJigQueueCancelResponse) RawJSON added in v0.6.0

func (r BetaJigQueueCancelResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaJigQueueCancelResponse) UnmarshalJSON added in v0.6.0

func (r *BetaJigQueueCancelResponse) UnmarshalJSON(data []byte) error

type BetaJigQueueCancelResponseStatus added in v0.7.0

type BetaJigQueueCancelResponseStatus string

Job status after the cancel attempt. Only pending jobs can be canceled. If the job is already running, done, or failed, the status is returned unchanged.

const (
	BetaJigQueueCancelResponseStatusCanceled BetaJigQueueCancelResponseStatus = "canceled"
	BetaJigQueueCancelResponseStatusRunning  BetaJigQueueCancelResponseStatus = "running"
	BetaJigQueueCancelResponseStatusDone     BetaJigQueueCancelResponseStatus = "done"
	BetaJigQueueCancelResponseStatusFailed   BetaJigQueueCancelResponseStatus = "failed"
)

type BetaJigQueueGetParams added in v0.6.0

type BetaJigQueueGetParams struct {
	// Model name the job was submitted to
	Model string `query:"model" api:"required" json:"-"`
	// Request ID returned from the submit endpoint
	RequestID string `query:"request_id" api:"required" json:"-"`
	// contains filtered or unexported fields
}

func (BetaJigQueueGetParams) URLQuery added in v0.6.0

func (r BetaJigQueueGetParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaJigQueueGetParams's query parameters as `url.Values`.

type BetaJigQueueGetResponse added in v0.6.0

type BetaJigQueueGetResponse struct {
	// Model identifier the job was submitted to
	Model string `json:"model" api:"required"`
	// The request ID that was returned from the submit endpoint
	RequestID string `json:"request_id" api:"required"`
	// Current job status. Transitions: pending → running → done/failed. A pending job
	// may also be canceled.
	//
	// Any of "pending", "running", "done", "failed", "canceled".
	Status BetaJigQueueGetResponseStatus `json:"status" api:"required"`
	// Timestamp when a worker claimed the job
	ClaimedAt time.Time `json:"claimed_at" format:"date-time"`
	// Timestamp when the job was created
	CreatedAt time.Time `json:"created_at" format:"date-time"`
	// Timestamp when the job completed (done or failed)
	DoneAt time.Time `json:"done_at" format:"date-time"`
	// Job metadata. Contains keys from the submit request, plus any modifications from
	// the model or system (e.g. progress, retry history).
	Info map[string]any `json:"info"`
	// Freeform model input, as submitted
	Inputs map[string]any `json:"inputs"`
	// Freeform model output, populated when the job reaches done status. Contents are
	// model-specific.
	Outputs map[string]any `json:"outputs"`
	// Job priority. Higher values are processed first.
	Priority int64 `json:"priority"`
	// Number of times this job has been retried. Workers set a claim timeout and must
	// send periodic status updates to keep the job alive. If no update is received
	// within the timeout, the job is returned to the queue and retried. After 3
	// retries the job is permanently failed. Jobs explicitly failed by the model are
	// not retried.
	Retries int64 `json:"retries"`
	// Non-fatal messages about the request (e.g. deprecation notices)
	Warnings []string `json:"warnings"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Model       respjson.Field
		RequestID   respjson.Field
		Status      respjson.Field
		ClaimedAt   respjson.Field
		CreatedAt   respjson.Field
		DoneAt      respjson.Field
		Info        respjson.Field
		Inputs      respjson.Field
		Outputs     respjson.Field
		Priority    respjson.Field
		Retries     respjson.Field
		Warnings    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Current status and metadata for a queued job.

func (BetaJigQueueGetResponse) RawJSON added in v0.6.0

func (r BetaJigQueueGetResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaJigQueueGetResponse) UnmarshalJSON added in v0.6.0

func (r *BetaJigQueueGetResponse) UnmarshalJSON(data []byte) error

type BetaJigQueueGetResponseStatus added in v0.7.0

type BetaJigQueueGetResponseStatus string

Current job status. Transitions: pending → running → done/failed. A pending job may also be canceled.

const (
	BetaJigQueueGetResponseStatusPending  BetaJigQueueGetResponseStatus = "pending"
	BetaJigQueueGetResponseStatusRunning  BetaJigQueueGetResponseStatus = "running"
	BetaJigQueueGetResponseStatusDone     BetaJigQueueGetResponseStatus = "done"
	BetaJigQueueGetResponseStatusFailed   BetaJigQueueGetResponseStatus = "failed"
	BetaJigQueueGetResponseStatusCanceled BetaJigQueueGetResponseStatus = "canceled"
)

type BetaJigQueueMetricsParams added in v0.6.0

type BetaJigQueueMetricsParams struct {
	// Model name to get metrics for
	Model string `query:"model" api:"required" json:"-"`
	// contains filtered or unexported fields
}

func (BetaJigQueueMetricsParams) URLQuery added in v0.6.0

func (r BetaJigQueueMetricsParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaJigQueueMetricsParams's query parameters as `url.Values`.

type BetaJigQueueMetricsResponse added in v0.6.0

type BetaJigQueueMetricsResponse struct {
	// Number of jobs currently being processed
	MessagesRunning int64 `json:"messages_running" api:"required"`
	// Number of jobs waiting to be claimed by a worker
	MessagesWaiting int64 `json:"messages_waiting" api:"required"`
	// Total number of active jobs (waiting + running)
	TotalJobs int64 `json:"total_jobs" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MessagesRunning respjson.Field
		MessagesWaiting respjson.Field
		TotalJobs       respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Queue job counts for a model.

func (BetaJigQueueMetricsResponse) RawJSON added in v0.7.0

func (r BetaJigQueueMetricsResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaJigQueueMetricsResponse) UnmarshalJSON added in v0.7.0

func (r *BetaJigQueueMetricsResponse) UnmarshalJSON(data []byte) error

type BetaJigQueueService added in v0.6.0

type BetaJigQueueService struct {
	Options []option.RequestOption
}

BetaJigQueueService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewBetaJigQueueService method instead.

func NewBetaJigQueueService added in v0.6.0

func NewBetaJigQueueService(opts ...option.RequestOption) (r BetaJigQueueService)

NewBetaJigQueueService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*BetaJigQueueService) Cancel added in v0.6.0

Cancel a pending job. Only jobs in pending status can be canceled. Running jobs cannot be stopped. Returns the job status after the attempt. If the job is not pending, returns 409 with the current status unchanged.

func (*BetaJigQueueService) Get added in v0.6.0

Poll the current status of a previously submitted job. Provide the request_id and model as query parameters.

func (*BetaJigQueueService) Metrics added in v0.6.0

Get the current queue statistics for a model, including pending and running job counts.

func (*BetaJigQueueService) Submit added in v0.6.0

Submit a new job to the queue for asynchronous processing. Jobs are processed in strict priority order (higher priority first, FIFO within the same priority). Returns a request ID that can be used to poll status or cancel the job.

type BetaJigQueueSubmitParams added in v0.6.0

type BetaJigQueueSubmitParams struct {
	// Required model identifier
	Model string `json:"model" api:"required"`
	// Freeform model input. Passed unchanged to the model. Contents are
	// model-specific.
	Payload map[string]any `json:"payload,omitzero" api:"required"`
	// Job priority. Higher values are processed first (strict priority ordering). Jobs
	// with equal priority are processed in submission order (FIFO).
	Priority param.Opt[int64] `json:"priority,omitzero"`
	// Arbitrary JSON metadata stored with the job. Returned in status responses, where
	// the model and system may have added or modified keys (e.g. progress).
	Info map[string]any `json:"info,omitzero"`
	// contains filtered or unexported fields
}

func (BetaJigQueueSubmitParams) MarshalJSON added in v0.6.0

func (r BetaJigQueueSubmitParams) MarshalJSON() (data []byte, err error)

func (*BetaJigQueueSubmitParams) UnmarshalJSON added in v0.6.0

func (r *BetaJigQueueSubmitParams) UnmarshalJSON(data []byte) error

type BetaJigQueueSubmitResponse added in v0.6.0

type BetaJigQueueSubmitResponse struct {
	// Unique identifier for the submitted job. Use this to poll status or cancel.
	RequestID string `json:"requestId" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Response returned after queueing a job.

func (BetaJigQueueSubmitResponse) RawJSON added in v0.6.0

func (r BetaJigQueueSubmitResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaJigQueueSubmitResponse) UnmarshalJSON added in v0.6.0

func (r *BetaJigQueueSubmitResponse) UnmarshalJSON(data []byte) error

type BetaJigSecretDeleteResponse added in v0.6.0

type BetaJigSecretDeleteResponse = any

type BetaJigSecretListResponse added in v0.6.0

type BetaJigSecretListResponse struct {
	// Data is the array of secret items
	Data []Secret `json:"data"`
	// The object type, which is always `list`.
	//
	// Any of "list".
	Object BetaJigSecretListResponseObject `json:"object"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Object      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaJigSecretListResponse) RawJSON added in v0.6.0

func (r BetaJigSecretListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaJigSecretListResponse) UnmarshalJSON added in v0.6.0

func (r *BetaJigSecretListResponse) UnmarshalJSON(data []byte) error

type BetaJigSecretListResponseObject added in v0.7.0

type BetaJigSecretListResponseObject string

The object type, which is always `list`.

const (
	BetaJigSecretListResponseObjectList BetaJigSecretListResponseObject = "list"
)

type BetaJigSecretNewParams added in v0.6.0

type BetaJigSecretNewParams struct {
	// Name is the unique identifier for the secret. Can contain alphanumeric
	// characters, underscores, hyphens, forward slashes, and periods (1-100
	// characters)
	Name string `json:"name" api:"required"`
	// Value is the sensitive data to store securely (e.g., API keys, passwords,
	// tokens). Encrypted at rest.
	Value string `json:"value" api:"required"`
	// Description is an optional human-readable description of the secret's purpose
	// (max 500 characters)
	Description param.Opt[string] `json:"description,omitzero"`
	// ProjectID is ignored - the project is automatically determined from your
	// authentication
	ProjectID param.Opt[string] `json:"project_id,omitzero"`
	// contains filtered or unexported fields
}

func (BetaJigSecretNewParams) MarshalJSON added in v0.6.0

func (r BetaJigSecretNewParams) MarshalJSON() (data []byte, err error)

func (*BetaJigSecretNewParams) UnmarshalJSON added in v0.6.0

func (r *BetaJigSecretNewParams) UnmarshalJSON(data []byte) error

type BetaJigSecretService added in v0.6.0

type BetaJigSecretService struct {
	Options []option.RequestOption
}

BetaJigSecretService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewBetaJigSecretService method instead.

func NewBetaJigSecretService added in v0.6.0

func NewBetaJigSecretService(opts ...option.RequestOption) (r BetaJigSecretService)

NewBetaJigSecretService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*BetaJigSecretService) Delete added in v0.6.0

Delete an existing secret

func (*BetaJigSecretService) Get added in v0.6.0

func (r *BetaJigSecretService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Secret, err error)

Retrieve details of a specific secret by its ID or name

func (*BetaJigSecretService) List added in v0.6.0

Retrieve all secrets in your project

func (*BetaJigSecretService) New added in v0.6.0

Create a new secret to store sensitive configuration values

func (*BetaJigSecretService) Update added in v0.6.0

Update an existing secret's value or metadata

type BetaJigSecretUpdateParams added in v0.6.0

type BetaJigSecretUpdateParams struct {
	// Description is an optional human-readable description of the secret's purpose
	// (max 500 characters)
	Description param.Opt[string] `json:"description,omitzero"`
	// Name is the new unique identifier for the secret. Can contain alphanumeric
	// characters, underscores, hyphens, forward slashes, and periods (1-100
	// characters)
	Name param.Opt[string] `json:"name,omitzero"`
	// ProjectID is ignored - the project is automatically determined from your
	// authentication
	ProjectID param.Opt[string] `json:"project_id,omitzero"`
	// Value is the new sensitive data to store securely. Updating this replaces the
	// existing secret value.
	Value param.Opt[string] `json:"value,omitzero"`
	// contains filtered or unexported fields
}

func (BetaJigSecretUpdateParams) MarshalJSON added in v0.6.0

func (r BetaJigSecretUpdateParams) MarshalJSON() (data []byte, err error)

func (*BetaJigSecretUpdateParams) UnmarshalJSON added in v0.6.0

func (r *BetaJigSecretUpdateParams) UnmarshalJSON(data []byte) error

type BetaJigService added in v0.6.0

type BetaJigService struct {
	Options []option.RequestOption
	Queue   BetaJigQueueService
	Volumes BetaJigVolumeService
	Secrets BetaJigSecretService
}

BetaJigService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewBetaJigService method instead.

func NewBetaJigService added in v0.6.0

func NewBetaJigService(opts ...option.RequestOption) (r BetaJigService)

NewBetaJigService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*BetaJigService) Deploy added in v0.6.0

func (r *BetaJigService) Deploy(ctx context.Context, body BetaJigDeployParams, opts ...option.RequestOption) (res *Deployment, err error)

Create a new deployment with specified configuration

func (*BetaJigService) Destroy added in v0.6.0

func (r *BetaJigService) Destroy(ctx context.Context, id string, opts ...option.RequestOption) (res *BetaJigDestroyResponse, err error)

Delete an existing deployment

func (*BetaJigService) Get added in v0.6.0

func (r *BetaJigService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Deployment, err error)

Retrieve details of a specific deployment by its ID or name

func (*BetaJigService) GetLogs added in v0.6.0

func (r *BetaJigService) GetLogs(ctx context.Context, id string, query BetaJigGetLogsParams, opts ...option.RequestOption) (res *DeploymentLogs, err error)

Retrieve logs from a deployment, optionally filtered by replica ID.

func (*BetaJigService) List added in v0.6.0

func (r *BetaJigService) List(ctx context.Context, opts ...option.RequestOption) (res *BetaJigListResponse, err error)

Get a list of all deployments in your project

func (*BetaJigService) Update added in v0.6.0

func (r *BetaJigService) Update(ctx context.Context, id string, body BetaJigUpdateParams, opts ...option.RequestOption) (res *Deployment, err error)

Update an existing deployment configuration

type BetaJigUpdateParams added in v0.6.0

type BetaJigUpdateParams struct {
	// CPU is the number of CPU cores to allocate per container instance (e.g., 0.1 =
	// 100 milli cores)
	CPU param.Opt[float64] `json:"cpu,omitzero"`
	// Description is an optional human-readable description of your deployment
	Description param.Opt[string] `json:"description,omitzero"`
	// GPUCount is the number of GPUs to allocate per container instance
	GPUCount param.Opt[int64] `json:"gpu_count,omitzero"`
	// HealthCheckPath is the HTTP path for health checks (e.g., "/health"). Set to
	// empty string to disable health checks
	HealthCheckPath param.Opt[string] `json:"health_check_path,omitzero"`
	// Image is the container image to deploy from registry.together.ai.
	Image param.Opt[string] `json:"image,omitzero"`
	// MaxReplicas is the maximum number of replicas that can be scaled up to.
	MaxReplicas param.Opt[int64] `json:"max_replicas,omitzero"`
	// Memory is the amount of RAM to allocate per container instance in GiB (e.g., 0.5
	// = 512MiB)
	Memory param.Opt[float64] `json:"memory,omitzero"`
	// MinReplicas is the minimum number of replicas to run
	MinReplicas param.Opt[int64] `json:"min_replicas,omitzero"`
	// Name is the new unique identifier for your deployment. Must contain only
	// alphanumeric characters, underscores, or hyphens (1-100 characters)
	Name param.Opt[string] `json:"name,omitzero"`
	// Port is the container port your application listens on (e.g., 8080 for web
	// servers)
	Port param.Opt[int64] `json:"port,omitzero"`
	// Storage is the amount of ephemeral disk storage to allocate per container
	// instance (e.g., 10 = 10GiB)
	Storage param.Opt[int64] `json:"storage,omitzero"`
	// TerminationGracePeriodSeconds is the time in seconds to wait for graceful
	// shutdown before forcefully terminating the replica
	TerminationGracePeriodSeconds param.Opt[int64] `json:"termination_grace_period_seconds,omitzero"`
	// Args overrides the container's CMD. Provide as an array of arguments (e.g.,
	// ["python", "app.py"])
	Args []string `json:"args,omitzero"`
	// Autoscaling configuration for the deployment. Set to {} to disable autoscaling
	Autoscaling BetaJigUpdateParamsAutoscalingUnion `json:"autoscaling,omitzero"`
	// Command overrides the container's ENTRYPOINT. Provide as an array (e.g.,
	// ["/bin/sh", "-c"])
	Command []string `json:"command,omitzero"`
	// EnvironmentVariables is a list of environment variables to set in the container.
	// Replaces all existing environment variables.
	EnvironmentVariables []BetaJigUpdateParamsEnvironmentVariable `json:"environment_variables,omitzero"`
	// GPUType specifies the GPU hardware to use (e.g., "h100-80gb")
	//
	// Any of "h100-80gb", "h100-40gb-mig", "h200-140gb", "b200-192gb".
	GPUType BetaJigUpdateParamsGPUType `json:"gpu_type,omitzero"`
	// Volumes is a list of volume mounts to attach to the container. Replaces all
	// existing volumes.
	Volumes []BetaJigUpdateParamsVolume `json:"volumes,omitzero"`
	// contains filtered or unexported fields
}

func (BetaJigUpdateParams) MarshalJSON added in v0.6.0

func (r BetaJigUpdateParams) MarshalJSON() (data []byte, err error)

func (*BetaJigUpdateParams) UnmarshalJSON added in v0.6.0

func (r *BetaJigUpdateParams) UnmarshalJSON(data []byte) error

type BetaJigUpdateParamsAutoscalingCustomMetricAutoscalingConfig added in v0.7.0

type BetaJigUpdateParamsAutoscalingCustomMetricAutoscalingConfig struct {
	// CustomMetricName is the Prometheus metric name. Required. Must match
	// [a-zA-Z\_:][a-zA-Z0-9_:]\*
	CustomMetricName param.Opt[string] `json:"custom_metric_name,omitzero"`
	// Target is the threshold value. Default: 500
	Target param.Opt[float64] `json:"target,omitzero"`
	// Metric must be CustomMetric
	//
	// Any of "CustomMetric".
	Metric string `json:"metric,omitzero"`
	// contains filtered or unexported fields
}

Autoscaling config for CustomMetric metric

func (BetaJigUpdateParamsAutoscalingCustomMetricAutoscalingConfig) MarshalJSON added in v0.7.0

func (*BetaJigUpdateParamsAutoscalingCustomMetricAutoscalingConfig) UnmarshalJSON added in v0.7.0

type BetaJigUpdateParamsAutoscalingHTTPAutoscalingConfig added in v0.7.0

type BetaJigUpdateParamsAutoscalingHTTPAutoscalingConfig struct {
	// Target is the threshold value. Default: 100 for HTTPTotalRequests, 500 (ms) for
	// HTTPAvgRequestDuration
	Target param.Opt[float64] `json:"target,omitzero"`
	// TimeIntervalMinutes is the rate window in minutes. Default: 10
	TimeIntervalMinutes param.Opt[int64] `json:"time_interval_minutes,omitzero"`
	// Metric must be HTTPTotalRequests or HTTPAvgRequestDuration
	//
	// Any of "HTTPTotalRequests", "HTTPAvgRequestDuration".
	Metric string `json:"metric,omitzero"`
	// contains filtered or unexported fields
}

Autoscaling config for HTTPTotalRequests and HTTPAvgRequestDuration metrics

func (BetaJigUpdateParamsAutoscalingHTTPAutoscalingConfig) MarshalJSON added in v0.7.0

func (r BetaJigUpdateParamsAutoscalingHTTPAutoscalingConfig) MarshalJSON() (data []byte, err error)

func (*BetaJigUpdateParamsAutoscalingHTTPAutoscalingConfig) UnmarshalJSON added in v0.7.0

type BetaJigUpdateParamsAutoscalingQueueAutoscalingConfig added in v0.7.0

type BetaJigUpdateParamsAutoscalingQueueAutoscalingConfig struct {
	// Model overrides the model name for queue status lookup. Defaults to the
	// deployment app name
	Model param.Opt[string] `json:"model,omitzero"`
	// Target is the threshold value. Default: 1.01
	Target param.Opt[float64] `json:"target,omitzero"`
	// Metric must be QueueBacklogPerWorker
	//
	// Any of "QueueBacklogPerWorker".
	Metric string `json:"metric,omitzero"`
	// contains filtered or unexported fields
}

Autoscaling config for QueueBacklogPerWorker metric

func (BetaJigUpdateParamsAutoscalingQueueAutoscalingConfig) MarshalJSON added in v0.7.0

func (r BetaJigUpdateParamsAutoscalingQueueAutoscalingConfig) MarshalJSON() (data []byte, err error)

func (*BetaJigUpdateParamsAutoscalingQueueAutoscalingConfig) UnmarshalJSON added in v0.7.0

type BetaJigUpdateParamsAutoscalingUnion added in v0.7.0

type BetaJigUpdateParamsAutoscalingUnion struct {
	OfBetaJigUpdatesAutoscalingHTTPAutoscalingConfig         *BetaJigUpdateParamsAutoscalingHTTPAutoscalingConfig         `json:",omitzero,inline"`
	OfBetaJigUpdatesAutoscalingQueueAutoscalingConfig        *BetaJigUpdateParamsAutoscalingQueueAutoscalingConfig        `json:",omitzero,inline"`
	OfBetaJigUpdatesAutoscalingCustomMetricAutoscalingConfig *BetaJigUpdateParamsAutoscalingCustomMetricAutoscalingConfig `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (BetaJigUpdateParamsAutoscalingUnion) GetCustomMetricName added in v0.7.0

func (u BetaJigUpdateParamsAutoscalingUnion) GetCustomMetricName() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaJigUpdateParamsAutoscalingUnion) GetMetric added in v0.7.0

Returns a pointer to the underlying variant's property, if present.

func (BetaJigUpdateParamsAutoscalingUnion) GetModel added in v0.7.0

Returns a pointer to the underlying variant's property, if present.

func (BetaJigUpdateParamsAutoscalingUnion) GetTarget added in v0.7.0

Returns a pointer to the underlying variant's property, if present.

func (BetaJigUpdateParamsAutoscalingUnion) GetTimeIntervalMinutes added in v0.7.0

func (u BetaJigUpdateParamsAutoscalingUnion) GetTimeIntervalMinutes() *int64

Returns a pointer to the underlying variant's property, if present.

func (BetaJigUpdateParamsAutoscalingUnion) MarshalJSON added in v0.7.0

func (u BetaJigUpdateParamsAutoscalingUnion) MarshalJSON() ([]byte, error)

func (*BetaJigUpdateParamsAutoscalingUnion) UnmarshalJSON added in v0.7.0

func (u *BetaJigUpdateParamsAutoscalingUnion) UnmarshalJSON(data []byte) error

type BetaJigUpdateParamsEnvironmentVariable added in v0.6.0

type BetaJigUpdateParamsEnvironmentVariable struct {
	// Name is the environment variable name (e.g., "DATABASE_URL"). Must start with a
	// letter or underscore, followed by letters, numbers, or underscores
	Name string `json:"name" api:"required"`
	// Value is the plain text value for the environment variable. Use this for
	// non-sensitive values. Either Value or ValueFromSecret must be set, but not both
	Value param.Opt[string] `json:"value,omitzero"`
	// ValueFromSecret references a secret by name or ID to use as the value. Use this
	// for sensitive values like API keys or passwords. Either Value or ValueFromSecret
	// must be set, but not both
	ValueFromSecret param.Opt[string] `json:"value_from_secret,omitzero"`
	// contains filtered or unexported fields
}

The property Name is required.

func (BetaJigUpdateParamsEnvironmentVariable) MarshalJSON added in v0.6.0

func (r BetaJigUpdateParamsEnvironmentVariable) MarshalJSON() (data []byte, err error)

func (*BetaJigUpdateParamsEnvironmentVariable) UnmarshalJSON added in v0.6.0

func (r *BetaJigUpdateParamsEnvironmentVariable) UnmarshalJSON(data []byte) error

type BetaJigUpdateParamsGPUType added in v0.6.0

type BetaJigUpdateParamsGPUType string

GPUType specifies the GPU hardware to use (e.g., "h100-80gb")

const (
	BetaJigUpdateParamsGPUTypeH100_80gb    BetaJigUpdateParamsGPUType = "h100-80gb"
	BetaJigUpdateParamsGPUTypeH100_40gbMig BetaJigUpdateParamsGPUType = "h100-40gb-mig"
	BetaJigUpdateParamsGPUTypeH200_140gb   BetaJigUpdateParamsGPUType = "h200-140gb"
	BetaJigUpdateParamsGPUTypeB200_192gb   BetaJigUpdateParamsGPUType = "b200-192gb"
)

type BetaJigUpdateParamsVolume added in v0.6.0

type BetaJigUpdateParamsVolume struct {
	// MountPath is the path in the container where the volume mounts (e.g., "/data").
	MountPath string `json:"mount_path" api:"required"`
	// Name is the name of the volume to mount. Must reference an existing volume by
	// name or ID
	Name string `json:"name" api:"required"`
	// Version is the volume version to mount. On create, defaults to the latest
	// version. On update, defaults to the currently mounted version.
	Version param.Opt[int64] `json:"version,omitzero"`
	// contains filtered or unexported fields
}

The properties MountPath, Name are required.

func (BetaJigUpdateParamsVolume) MarshalJSON added in v0.6.0

func (r BetaJigUpdateParamsVolume) MarshalJSON() (data []byte, err error)

func (*BetaJigUpdateParamsVolume) UnmarshalJSON added in v0.6.0

func (r *BetaJigUpdateParamsVolume) UnmarshalJSON(data []byte) error

type BetaJigVolumeDeleteResponse added in v0.6.0

type BetaJigVolumeDeleteResponse = any

type BetaJigVolumeGetParams added in v0.10.0

type BetaJigVolumeGetParams struct {
	// Volume version to describe (defaults to current version)
	Version param.Opt[int64] `query:"version,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaJigVolumeGetParams) URLQuery added in v0.10.0

func (r BetaJigVolumeGetParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaJigVolumeGetParams's query parameters as `url.Values`.

type BetaJigVolumeListResponse added in v0.6.0

type BetaJigVolumeListResponse struct {
	// Data is the array of volume items
	Data []Volume `json:"data"`
	// The object type, which is always `list`.
	//
	// Any of "list".
	Object BetaJigVolumeListResponseObject `json:"object"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Object      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaJigVolumeListResponse) RawJSON added in v0.6.0

func (r BetaJigVolumeListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaJigVolumeListResponse) UnmarshalJSON added in v0.6.0

func (r *BetaJigVolumeListResponse) UnmarshalJSON(data []byte) error

type BetaJigVolumeListResponseObject added in v0.7.0

type BetaJigVolumeListResponseObject string

The object type, which is always `list`.

const (
	BetaJigVolumeListResponseObjectList BetaJigVolumeListResponseObject = "list"
)

type BetaJigVolumeNewParams added in v0.6.0

type BetaJigVolumeNewParams struct {
	// Content specifies the new content to preload to this volume.
	Content BetaJigVolumeNewParamsContent `json:"content,omitzero" api:"required"`
	// Name is the unique identifier for the volume within the project
	Name string `json:"name" api:"required"`
	// Type is the volume type (currently only "readOnly" is supported)
	//
	// Any of "readOnly".
	Type BetaJigVolumeNewParamsType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

func (BetaJigVolumeNewParams) MarshalJSON added in v0.6.0

func (r BetaJigVolumeNewParams) MarshalJSON() (data []byte, err error)

func (*BetaJigVolumeNewParams) UnmarshalJSON added in v0.6.0

func (r *BetaJigVolumeNewParams) UnmarshalJSON(data []byte) error

type BetaJigVolumeNewParamsContent added in v0.6.0

type BetaJigVolumeNewParamsContent struct {
	// SourcePrefix is the file path prefix for the content to be preloaded into the
	// volume
	SourcePrefix param.Opt[string] `json:"source_prefix,omitzero"`
	// Type is the content type (currently only "files" is supported which allows
	// preloading files uploaded via Files API into the volume)
	//
	// Any of "files".
	Type string `json:"type,omitzero"`
	// contains filtered or unexported fields
}

Content specifies the new content to preload to this volume.

func (BetaJigVolumeNewParamsContent) MarshalJSON added in v0.6.0

func (r BetaJigVolumeNewParamsContent) MarshalJSON() (data []byte, err error)

func (*BetaJigVolumeNewParamsContent) UnmarshalJSON added in v0.6.0

func (r *BetaJigVolumeNewParamsContent) UnmarshalJSON(data []byte) error

type BetaJigVolumeNewParamsType added in v0.6.0

type BetaJigVolumeNewParamsType string

Type is the volume type (currently only "readOnly" is supported)

const (
	BetaJigVolumeNewParamsTypeReadOnly BetaJigVolumeNewParamsType = "readOnly"
)

type BetaJigVolumeService added in v0.6.0

type BetaJigVolumeService struct {
	Options []option.RequestOption
}

BetaJigVolumeService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewBetaJigVolumeService method instead.

func NewBetaJigVolumeService added in v0.6.0

func NewBetaJigVolumeService(opts ...option.RequestOption) (r BetaJigVolumeService)

NewBetaJigVolumeService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*BetaJigVolumeService) Delete added in v0.6.0

Delete an existing volume

func (*BetaJigVolumeService) Get added in v0.6.0

Retrieve details of a specific volume by its ID or name

func (*BetaJigVolumeService) List added in v0.6.0

Retrieve all volumes in your project

func (*BetaJigVolumeService) New added in v0.6.0

Create a new volume to preload files in deployments

func (*BetaJigVolumeService) Update added in v0.6.0

Update an existing volume's configuration or contents

type BetaJigVolumeUpdateParams added in v0.6.0

type BetaJigVolumeUpdateParams struct {
	// Name is the new unique identifier for the volume within the project
	Name param.Opt[string] `json:"name,omitzero"`
	// Content specifies the new content to preload to this volume.
	Content BetaJigVolumeUpdateParamsContent `json:"content,omitzero"`
	// Type is the new volume type (currently only "readOnly" is supported)
	//
	// Any of "readOnly".
	Type BetaJigVolumeUpdateParamsType `json:"type,omitzero"`
	// contains filtered or unexported fields
}

func (BetaJigVolumeUpdateParams) MarshalJSON added in v0.6.0

func (r BetaJigVolumeUpdateParams) MarshalJSON() (data []byte, err error)

func (*BetaJigVolumeUpdateParams) UnmarshalJSON added in v0.6.0

func (r *BetaJigVolumeUpdateParams) UnmarshalJSON(data []byte) error

type BetaJigVolumeUpdateParamsContent added in v0.6.0

type BetaJigVolumeUpdateParamsContent struct {
	// SourcePrefix is the file path prefix for the content to be preloaded into the
	// volume
	SourcePrefix param.Opt[string] `json:"source_prefix,omitzero"`
	// Type is the content type (currently only "files" is supported which allows
	// preloading files uploaded via Files API into the volume)
	//
	// Any of "files".
	Type string `json:"type,omitzero"`
	// contains filtered or unexported fields
}

Content specifies the new content to preload to this volume.

func (BetaJigVolumeUpdateParamsContent) MarshalJSON added in v0.6.0

func (r BetaJigVolumeUpdateParamsContent) MarshalJSON() (data []byte, err error)

func (*BetaJigVolumeUpdateParamsContent) UnmarshalJSON added in v0.6.0

func (r *BetaJigVolumeUpdateParamsContent) UnmarshalJSON(data []byte) error

type BetaJigVolumeUpdateParamsType added in v0.6.0

type BetaJigVolumeUpdateParamsType string

Type is the new volume type (currently only "readOnly" is supported)

const (
	BetaJigVolumeUpdateParamsTypeReadOnly BetaJigVolumeUpdateParamsType = "readOnly"
)

type BetaService added in v0.4.0

type BetaService struct {
	Options  []option.RequestOption
	Jig      BetaJigService
	Clusters BetaClusterService
}

BetaService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewBetaService method instead.

func NewBetaService added in v0.4.0

func NewBetaService(opts ...option.RequestOption) (r BetaService)

NewBetaService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

type ChatCompletion

type ChatCompletion struct {
	ID      string                 `json:"id" api:"required"`
	Choices []ChatCompletionChoice `json:"choices" api:"required"`
	Created int64                  `json:"created" api:"required"`
	Model   string                 `json:"model" api:"required"`
	// The object type, which is always `chat.completion`.
	Object constant.ChatCompletion `json:"object" default:"chat.completion"`
	// When `echo` is true, the prompt is included in the response. Additionally, when
	// `logprobs` is also provided, log probability information is provided on the
	// prompt.
	Prompt   ChatCompletionPrompt    `json:"prompt" api:"required"`
	Usage    ChatCompletionUsage     `json:"usage" api:"nullable"`
	Warnings []ChatCompletionWarning `json:"warnings"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Choices     respjson.Field
		Created     respjson.Field
		Model       respjson.Field
		Object      respjson.Field
		Prompt      respjson.Field
		Usage       respjson.Field
		Warnings    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ChatCompletion) RawJSON

func (r ChatCompletion) RawJSON() string

Returns the unmodified JSON received from the API

func (*ChatCompletion) UnmarshalJSON

func (r *ChatCompletion) UnmarshalJSON(data []byte) error

type ChatCompletionChoice

type ChatCompletionChoice struct {
	// Any of "stop", "eos", "length", "tool_calls", "function_call".
	FinishReason string                      `json:"finish_reason"`
	Index        int64                       `json:"index"`
	Logprobs     LogProbs                    `json:"logprobs" api:"nullable"`
	Message      ChatCompletionChoiceMessage `json:"message"`
	Seed         int64                       `json:"seed"`
	Text         string                      `json:"text"`
	// Top log probabilities for the tokens.
	TopLogprobs map[string]float64 `json:"top_logprobs"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		FinishReason respjson.Field
		Index        respjson.Field
		Logprobs     respjson.Field
		Message      respjson.Field
		Seed         respjson.Field
		Text         respjson.Field
		TopLogprobs  respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ChatCompletionChoice) RawJSON

func (r ChatCompletionChoice) RawJSON() string

Returns the unmodified JSON received from the API

func (*ChatCompletionChoice) UnmarshalJSON

func (r *ChatCompletionChoice) UnmarshalJSON(data []byte) error

type ChatCompletionChoiceMessage

type ChatCompletionChoiceMessage struct {
	Content string `json:"content" api:"required"`
	// Any of "assistant".
	Role string `json:"role" api:"required"`
	// Deprecated: deprecated
	FunctionCall ChatCompletionChoiceMessageFunctionCall `json:"function_call"`
	Reasoning    string                                  `json:"reasoning" api:"nullable"`
	ToolCalls    []ToolChoice                            `json:"tool_calls"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content      respjson.Field
		Role         respjson.Field
		FunctionCall respjson.Field
		Reasoning    respjson.Field
		ToolCalls    respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ChatCompletionChoiceMessage) RawJSON

func (r ChatCompletionChoiceMessage) RawJSON() string

Returns the unmodified JSON received from the API

func (*ChatCompletionChoiceMessage) UnmarshalJSON

func (r *ChatCompletionChoiceMessage) UnmarshalJSON(data []byte) error

type ChatCompletionChoiceMessageFunctionCall deprecated

type ChatCompletionChoiceMessageFunctionCall struct {
	Arguments string `json:"arguments" api:"required"`
	Name      string `json:"name" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Arguments   respjson.Field
		Name        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Deprecated: deprecated

func (ChatCompletionChoiceMessageFunctionCall) RawJSON

Returns the unmodified JSON received from the API

func (*ChatCompletionChoiceMessageFunctionCall) UnmarshalJSON

func (r *ChatCompletionChoiceMessageFunctionCall) UnmarshalJSON(data []byte) error

type ChatCompletionChunk

type ChatCompletionChunk struct {
	ID      string                      `json:"id" api:"required"`
	Choices []ChatCompletionChunkChoice `json:"choices" api:"required"`
	Created int64                       `json:"created" api:"required"`
	Model   string                      `json:"model" api:"required"`
	// The object type, which is always `chat.completion.chunk`.
	Object            constant.ChatCompletionChunk `json:"object" default:"chat.completion.chunk"`
	SystemFingerprint string                       `json:"system_fingerprint"`
	Usage             ChatCompletionUsage          `json:"usage" api:"nullable"`
	Warnings          []ChatCompletionWarning      `json:"warnings"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                respjson.Field
		Choices           respjson.Field
		Created           respjson.Field
		Model             respjson.Field
		Object            respjson.Field
		SystemFingerprint respjson.Field
		Usage             respjson.Field
		Warnings          respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ChatCompletionChunk) RawJSON

func (r ChatCompletionChunk) RawJSON() string

Returns the unmodified JSON received from the API

func (*ChatCompletionChunk) UnmarshalJSON

func (r *ChatCompletionChunk) UnmarshalJSON(data []byte) error

type ChatCompletionChunkChoice

type ChatCompletionChunkChoice struct {
	Delta ChatCompletionChunkChoiceDelta `json:"delta" api:"required"`
	// Any of "stop", "eos", "length", "tool_calls", "function_call".
	FinishReason string  `json:"finish_reason" api:"required"`
	Index        int64   `json:"index" api:"required"`
	Logprobs     float64 `json:"logprobs" api:"nullable"`
	Seed         int64   `json:"seed" api:"nullable"`
	// Top log probabilities for the tokens.
	TopLogprobs map[string]float64 `json:"top_logprobs"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Delta        respjson.Field
		FinishReason respjson.Field
		Index        respjson.Field
		Logprobs     respjson.Field
		Seed         respjson.Field
		TopLogprobs  respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ChatCompletionChunkChoice) RawJSON

func (r ChatCompletionChunkChoice) RawJSON() string

Returns the unmodified JSON received from the API

func (*ChatCompletionChunkChoice) UnmarshalJSON

func (r *ChatCompletionChunkChoice) UnmarshalJSON(data []byte) error

type ChatCompletionChunkChoiceDelta

type ChatCompletionChunkChoiceDelta struct {
	// Any of "system", "user", "assistant", "function", "tool".
	Role    string `json:"role" api:"required"`
	Content string `json:"content" api:"nullable"`
	// Deprecated: deprecated
	FunctionCall ChatCompletionChunkChoiceDeltaFunctionCall `json:"function_call" api:"nullable"`
	Reasoning    string                                     `json:"reasoning" api:"nullable"`
	TokenID      int64                                      `json:"token_id"`
	ToolCalls    []ToolChoice                               `json:"tool_calls"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Role         respjson.Field
		Content      respjson.Field
		FunctionCall respjson.Field
		Reasoning    respjson.Field
		TokenID      respjson.Field
		ToolCalls    respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ChatCompletionChunkChoiceDelta) RawJSON

Returns the unmodified JSON received from the API

func (*ChatCompletionChunkChoiceDelta) UnmarshalJSON

func (r *ChatCompletionChunkChoiceDelta) UnmarshalJSON(data []byte) error

type ChatCompletionChunkChoiceDeltaFunctionCall deprecated

type ChatCompletionChunkChoiceDeltaFunctionCall struct {
	Arguments string `json:"arguments" api:"required"`
	Name      string `json:"name" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Arguments   respjson.Field
		Name        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Deprecated: deprecated

func (ChatCompletionChunkChoiceDeltaFunctionCall) RawJSON

Returns the unmodified JSON received from the API

func (*ChatCompletionChunkChoiceDeltaFunctionCall) UnmarshalJSON

func (r *ChatCompletionChunkChoiceDeltaFunctionCall) UnmarshalJSON(data []byte) error

type ChatCompletionNewParams

type ChatCompletionNewParams struct {
	// A list of messages comprising the conversation so far.
	Messages []ChatCompletionNewParamsMessageUnion `json:"messages,omitzero" api:"required"`
	// The name of the model to query.
	//
	// [See all of Together AI's chat models](https://docs.together.ai/docs/serverless-models#chat-models)
	Model string `json:"model" api:"required"`
	// If true, the response contains the prompt. Can be used with `logprobs` to return
	// prompt logprobs.
	Echo param.Opt[bool] `json:"echo,omitzero"`
	// A number between -2.0 and 2.0 where a positive value decreases the likelihood of
	// repeating tokens that have already been mentioned.
	FrequencyPenalty param.Opt[float64] `json:"frequency_penalty,omitzero"`
	// An integer between 0 and 20 of the top k tokens to return log probabilities for
	// at each generation step, instead of only the sampled token. Log probabilities
	// help assess model confidence in token predictions.
	Logprobs param.Opt[int64] `json:"logprobs,omitzero"`
	// The maximum number of tokens to generate.
	MaxTokens param.Opt[int64] `json:"max_tokens,omitzero"`
	// A number between 0 and 1 that can be used as an alternative to top_p and top-k.
	MinP param.Opt[float64] `json:"min_p,omitzero"`
	// The number of completions to generate for each prompt.
	N param.Opt[int64] `json:"n,omitzero"`
	// A number between -2.0 and 2.0 where a positive value increases the likelihood of
	// a model talking about new topics.
	PresencePenalty param.Opt[float64] `json:"presence_penalty,omitzero"`
	// A number that controls the diversity of generated text by reducing the
	// likelihood of repeated sequences. Higher values decrease repetition.
	RepetitionPenalty param.Opt[float64] `json:"repetition_penalty,omitzero"`
	// The name of the moderation model used to validate tokens. Choose from the
	// available moderation models found
	// [here](https://docs.together.ai/docs/inference-models#moderation-models).
	SafetyModel param.Opt[string] `json:"safety_model,omitzero"`
	// Seed value for reproducibility.
	Seed param.Opt[int64] `json:"seed,omitzero"`
	// A decimal number from 0-1 that determines the degree of randomness in the
	// response. A temperature less than 1 favors more correctness and is appropriate
	// for question answering or summarization. A value closer to 1 introduces more
	// randomness in the output.
	Temperature param.Opt[float64] `json:"temperature,omitzero"`
	// An integer that's used to limit the number of choices for the next predicted
	// word or token. It specifies the maximum number of tokens to consider at each
	// step, based on their probability of occurrence. This technique helps to speed up
	// the generation process and can improve the quality of the generated text by
	// focusing on the most likely options.
	TopK param.Opt[int64] `json:"top_k,omitzero"`
	// A percentage (also called the nucleus parameter) that's used to dynamically
	// adjust the number of choices for each predicted token based on the cumulative
	// probabilities. It specifies a probability threshold below which all less likely
	// tokens are filtered out. This technique helps maintain diversity and generate
	// more fluent and natural-sounding text.
	TopP param.Opt[float64] `json:"top_p,omitzero"`
	// Additional configuration to pass to model engine.
	ChatTemplateKwargs any `json:"chat_template_kwargs,omitzero"`
	// Any of "hipaa".
	Compliance ChatCompletionNewParamsCompliance `json:"compliance,omitzero"`
	// Defines the behavior of the API when max_tokens exceed the maximum context
	// length of the model. When set to 'error', the API returns 400 with an
	// appropriate error message. When set to 'truncate', overrides max_tokens with the
	// maximum context length of the model.
	//
	// Any of "truncate", "error".
	ContextLengthExceededBehavior ChatCompletionNewParamsContextLengthExceededBehavior `json:"context_length_exceeded_behavior,omitzero"`
	FunctionCall                  ChatCompletionNewParamsFunctionCallUnion             `json:"function_call,omitzero"`
	// Adjusts the likelihood of specific tokens appearing in the generated output.
	LogitBias map[string]float64 `json:"logit_bias,omitzero"`
	// For models that support toggling reasoning functionality, this object can be
	// used to control that functionality.
	Reasoning ChatCompletionNewParamsReasoning `json:"reasoning,omitzero"`
	// Controls the level of reasoning effort the model should apply when generating
	// responses. Higher values may result in more thoughtful and detailed responses
	// but may take longer to generate.
	//
	// Any of "low", "medium", "high".
	ReasoningEffort ChatCompletionNewParamsReasoningEffort `json:"reasoning_effort,omitzero"`
	// An object specifying the format that the model must output.
	//
	// Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
	// Outputs which ensures the model will match your supplied JSON schema. Learn more
	// in the [Structured Outputs guide](https://docs.together.ai/docs/json-mode).
	//
	// Setting to `{ "type": "json_object" }` enables the older JSON mode, which
	// ensures the message the model generates is valid JSON. Using `json_schema` is
	// preferred for models that support it.
	ResponseFormat ChatCompletionNewParamsResponseFormatUnion `json:"response_format,omitzero"`
	// A list of string sequences that truncate (stop) inference text output. For
	// example, "</s>" stops generation as soon as the model generates the given token.
	Stop []string `json:"stop,omitzero"`
	// Controls which (if any) function is called by the model. By default uses `auto`,
	// which lets the model pick between generating a message or calling a function.
	ToolChoice ChatCompletionNewParamsToolChoiceUnion `json:"tool_choice,omitzero"`
	// A list of tools the model may call. Currently, only functions are supported as a
	// tool. Use this to provide a list of functions the model may generate JSON inputs
	// for.
	Tools []ToolsParam `json:"tools,omitzero"`
	// contains filtered or unexported fields
}

func (ChatCompletionNewParams) MarshalJSON

func (r ChatCompletionNewParams) MarshalJSON() (data []byte, err error)

func (*ChatCompletionNewParams) UnmarshalJSON

func (r *ChatCompletionNewParams) UnmarshalJSON(data []byte) error

type ChatCompletionNewParamsCompliance added in v0.4.0

type ChatCompletionNewParamsCompliance string
const (
	ChatCompletionNewParamsComplianceHipaa ChatCompletionNewParamsCompliance = "hipaa"
)

type ChatCompletionNewParamsContextLengthExceededBehavior

type ChatCompletionNewParamsContextLengthExceededBehavior string

Defines the behavior of the API when max_tokens exceed the maximum context length of the model. When set to 'error', the API returns 400 with an appropriate error message. When set to 'truncate', overrides max_tokens with the maximum context length of the model.

const (
	ChatCompletionNewParamsContextLengthExceededBehaviorTruncate ChatCompletionNewParamsContextLengthExceededBehavior = "truncate"
	ChatCompletionNewParamsContextLengthExceededBehaviorError    ChatCompletionNewParamsContextLengthExceededBehavior = "error"
)

type ChatCompletionNewParamsFunctionCallName

type ChatCompletionNewParamsFunctionCallName struct {
	Name string `json:"name" api:"required"`
	// contains filtered or unexported fields
}

The property Name is required.

func (ChatCompletionNewParamsFunctionCallName) MarshalJSON

func (r ChatCompletionNewParamsFunctionCallName) MarshalJSON() (data []byte, err error)

func (*ChatCompletionNewParamsFunctionCallName) UnmarshalJSON

func (r *ChatCompletionNewParamsFunctionCallName) UnmarshalJSON(data []byte) error

type ChatCompletionNewParamsFunctionCallString

type ChatCompletionNewParamsFunctionCallString string
const (
	ChatCompletionNewParamsFunctionCallStringNone ChatCompletionNewParamsFunctionCallString = "none"
	ChatCompletionNewParamsFunctionCallStringAuto ChatCompletionNewParamsFunctionCallString = "auto"
)

type ChatCompletionNewParamsFunctionCallUnion

type ChatCompletionNewParamsFunctionCallUnion struct {
	// Check if union is this variant with
	// !param.IsOmitted(union.OfChatCompletionNewsFunctionCallString)
	OfChatCompletionNewsFunctionCallString param.Opt[string]                        `json:",omitzero,inline"`
	OfChatCompletionNewsFunctionCallName   *ChatCompletionNewParamsFunctionCallName `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (ChatCompletionNewParamsFunctionCallUnion) MarshalJSON

func (*ChatCompletionNewParamsFunctionCallUnion) UnmarshalJSON

func (u *ChatCompletionNewParamsFunctionCallUnion) UnmarshalJSON(data []byte) error

type ChatCompletionNewParamsMessageChatCompletionAssistantMessageParam

type ChatCompletionNewParamsMessageChatCompletionAssistantMessageParam struct {
	// Any of "assistant".
	Role    string            `json:"role,omitzero" api:"required"`
	Content param.Opt[string] `json:"content,omitzero"`
	Name    param.Opt[string] `json:"name,omitzero"`
	// Deprecated: deprecated
	FunctionCall ChatCompletionNewParamsMessageChatCompletionAssistantMessageParamFunctionCall `json:"function_call,omitzero"`
	ToolCalls    []ToolChoiceParam                                                             `json:"tool_calls,omitzero"`
	// contains filtered or unexported fields
}

The property Role is required.

func (ChatCompletionNewParamsMessageChatCompletionAssistantMessageParam) MarshalJSON

func (*ChatCompletionNewParamsMessageChatCompletionAssistantMessageParam) UnmarshalJSON

type ChatCompletionNewParamsMessageChatCompletionAssistantMessageParamFunctionCall deprecated

type ChatCompletionNewParamsMessageChatCompletionAssistantMessageParamFunctionCall struct {
	Arguments string `json:"arguments" api:"required"`
	Name      string `json:"name" api:"required"`
	// contains filtered or unexported fields
}

Deprecated: deprecated

The properties Arguments, Name are required.

func (ChatCompletionNewParamsMessageChatCompletionAssistantMessageParamFunctionCall) MarshalJSON

func (*ChatCompletionNewParamsMessageChatCompletionAssistantMessageParamFunctionCall) UnmarshalJSON

type ChatCompletionNewParamsMessageChatCompletionFunctionMessageParam deprecated

type ChatCompletionNewParamsMessageChatCompletionFunctionMessageParam struct {
	Content string `json:"content" api:"required"`
	Name    string `json:"name" api:"required"`
	// Any of "function".
	Role string `json:"role,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Deprecated: deprecated

The properties Content, Name, Role are required.

func (ChatCompletionNewParamsMessageChatCompletionFunctionMessageParam) MarshalJSON

func (*ChatCompletionNewParamsMessageChatCompletionFunctionMessageParam) UnmarshalJSON

type ChatCompletionNewParamsMessageChatCompletionSystemMessageParam

type ChatCompletionNewParamsMessageChatCompletionSystemMessageParam struct {
	Content string `json:"content" api:"required"`
	// Any of "system".
	Role string            `json:"role,omitzero" api:"required"`
	Name param.Opt[string] `json:"name,omitzero"`
	// contains filtered or unexported fields
}

The properties Content, Role are required.

func (ChatCompletionNewParamsMessageChatCompletionSystemMessageParam) MarshalJSON

func (*ChatCompletionNewParamsMessageChatCompletionSystemMessageParam) UnmarshalJSON

type ChatCompletionNewParamsMessageChatCompletionToolMessageParam

type ChatCompletionNewParamsMessageChatCompletionToolMessageParam struct {
	Content string `json:"content" api:"required"`
	// Any of "tool".
	Role       string            `json:"role,omitzero" api:"required"`
	ToolCallID string            `json:"tool_call_id" api:"required"`
	Name       param.Opt[string] `json:"name,omitzero"`
	// contains filtered or unexported fields
}

The properties Content, Role, ToolCallID are required.

func (ChatCompletionNewParamsMessageChatCompletionToolMessageParam) MarshalJSON

func (*ChatCompletionNewParamsMessageChatCompletionToolMessageParam) UnmarshalJSON

type ChatCompletionNewParamsMessageChatCompletionUserMessageParam

type ChatCompletionNewParamsMessageChatCompletionUserMessageParam struct {
	// The content of the message, which can either be a simple string or a structured
	// format.
	Content ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentUnion `json:"content,omitzero" api:"required"`
	// Any of "user".
	Role string            `json:"role,omitzero" api:"required"`
	Name param.Opt[string] `json:"name,omitzero"`
	// contains filtered or unexported fields
}

The properties Content, Role are required.

func (ChatCompletionNewParamsMessageChatCompletionUserMessageParam) MarshalJSON

func (*ChatCompletionNewParamsMessageChatCompletionUserMessageParam) UnmarshalJSON

type ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemAudio

type ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemAudio struct {
	AudioURL ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemAudioAudioURL `json:"audio_url,omitzero" api:"required"`
	// Any of "audio_url".
	Type string `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The properties AudioURL, Type are required.

func (ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemAudio) MarshalJSON

func (*ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemAudio) UnmarshalJSON

type ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemAudioAudioURL

type ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemAudioAudioURL struct {
	// The URL of the audio
	URL string `json:"url" api:"required"`
	// contains filtered or unexported fields
}

The property URL is required.

func (ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemAudioAudioURL) MarshalJSON

func (*ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemAudioAudioURL) UnmarshalJSON

type ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemInputAudio

type ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemInputAudio struct {
	InputAudio ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemInputAudioInputAudio `json:"input_audio,omitzero" api:"required"`
	// Any of "input_audio".
	Type string `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The properties InputAudio, Type are required.

func (ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemInputAudio) MarshalJSON

func (*ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemInputAudio) UnmarshalJSON

type ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemInputAudioInputAudio

type ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemInputAudioInputAudio struct {
	// The base64 encoded audio data
	Data string `json:"data" api:"required"`
	// The format of the audio data
	//
	// Any of "wav".
	Format string `json:"format,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The properties Data, Format are required.

func (ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemInputAudioInputAudio) MarshalJSON

func (*ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemInputAudioInputAudio) UnmarshalJSON

type ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion

type ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion struct {
	OfChatCompletionStructuredMessageText     *ChatCompletionStructuredMessageTextParam                                                                                    `json:",omitzero,inline"`
	OfChatCompletionStructuredMessageImageURL *ChatCompletionStructuredMessageImageURLParam                                                                                `json:",omitzero,inline"`
	OfVideo                                   *ChatCompletionStructuredMessageVideoURLParam                                                                                `json:",omitzero,inline"`
	OfAudio                                   *ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemAudio      `json:",omitzero,inline"`
	OfInputAudio                              *ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemInputAudio `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion) GetAudioURL

Returns a pointer to the underlying variant's property, if present.

func (ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion) GetImageURL

Returns a pointer to the underlying variant's property, if present.

func (ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion) GetInputAudio

Returns a pointer to the underlying variant's property, if present.

func (ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion) GetText

Returns a pointer to the underlying variant's property, if present.

func (ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion) GetVideoURL

Returns a pointer to the underlying variant's property, if present.

func (ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion) MarshalJSON

func (*ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion) UnmarshalJSON

type ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentUnion

type ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentUnion struct {
	OfString                                                                                                        param.Opt[string]                                                                                                        `json:",omitzero,inline"`
	OfChatCompletionNewsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalArray []ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentUnion) MarshalJSON

func (*ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentUnion) UnmarshalJSON

type ChatCompletionNewParamsMessageUnion

type ChatCompletionNewParamsMessageUnion struct {
	OfChatCompletionNewsMessageChatCompletionSystemMessageParam    *ChatCompletionNewParamsMessageChatCompletionSystemMessageParam    `json:",omitzero,inline"`
	OfChatCompletionNewsMessageChatCompletionUserMessageParam      *ChatCompletionNewParamsMessageChatCompletionUserMessageParam      `json:",omitzero,inline"`
	OfChatCompletionNewsMessageChatCompletionAssistantMessageParam *ChatCompletionNewParamsMessageChatCompletionAssistantMessageParam `json:",omitzero,inline"`
	OfChatCompletionNewsMessageChatCompletionToolMessageParam      *ChatCompletionNewParamsMessageChatCompletionToolMessageParam      `json:",omitzero,inline"`
	OfChatCompletionNewsMessageChatCompletionFunctionMessageParam  *ChatCompletionNewParamsMessageChatCompletionFunctionMessageParam  `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (ChatCompletionNewParamsMessageUnion) GetContent

func (u ChatCompletionNewParamsMessageUnion) GetContent() (res chatCompletionNewParamsMessageUnionContent)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (ChatCompletionNewParamsMessageUnion) GetFunctionCall

Returns a pointer to the underlying variant's property, if present.

func (ChatCompletionNewParamsMessageUnion) GetName

Returns a pointer to the underlying variant's property, if present.

func (ChatCompletionNewParamsMessageUnion) GetRole

Returns a pointer to the underlying variant's property, if present.

func (ChatCompletionNewParamsMessageUnion) GetToolCallID

func (u ChatCompletionNewParamsMessageUnion) GetToolCallID() *string

Returns a pointer to the underlying variant's property, if present.

func (ChatCompletionNewParamsMessageUnion) GetToolCalls

Returns a pointer to the underlying variant's property, if present.

func (ChatCompletionNewParamsMessageUnion) MarshalJSON

func (u ChatCompletionNewParamsMessageUnion) MarshalJSON() ([]byte, error)

func (*ChatCompletionNewParamsMessageUnion) UnmarshalJSON

func (u *ChatCompletionNewParamsMessageUnion) UnmarshalJSON(data []byte) error

type ChatCompletionNewParamsReasoning added in v0.6.0

type ChatCompletionNewParamsReasoning struct {
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

For models that support toggling reasoning functionality, this object can be used to control that functionality.

func (ChatCompletionNewParamsReasoning) MarshalJSON added in v0.6.0

func (r ChatCompletionNewParamsReasoning) MarshalJSON() (data []byte, err error)

func (*ChatCompletionNewParamsReasoning) UnmarshalJSON added in v0.6.0

func (r *ChatCompletionNewParamsReasoning) UnmarshalJSON(data []byte) error

type ChatCompletionNewParamsReasoningEffort

type ChatCompletionNewParamsReasoningEffort string

Controls the level of reasoning effort the model should apply when generating responses. Higher values may result in more thoughtful and detailed responses but may take longer to generate.

const (
	ChatCompletionNewParamsReasoningEffortLow    ChatCompletionNewParamsReasoningEffort = "low"
	ChatCompletionNewParamsReasoningEffortMedium ChatCompletionNewParamsReasoningEffort = "medium"
	ChatCompletionNewParamsReasoningEffortHigh   ChatCompletionNewParamsReasoningEffort = "high"
)

type ChatCompletionNewParamsResponseFormatJsonObject

type ChatCompletionNewParamsResponseFormatJsonObject struct {
	// The type of response format being defined. Always `json_object`.
	Type constant.JsonObject `json:"type" default:"json_object"`
	// contains filtered or unexported fields
}

JSON object response format. An older method of generating JSON responses. Using `json_schema` is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so.

This struct has a constant value, construct it with NewChatCompletionNewParamsResponseFormatJsonObject.

func NewChatCompletionNewParamsResponseFormatJsonObject

func NewChatCompletionNewParamsResponseFormatJsonObject() ChatCompletionNewParamsResponseFormatJsonObject

func (ChatCompletionNewParamsResponseFormatJsonObject) MarshalJSON

func (r ChatCompletionNewParamsResponseFormatJsonObject) MarshalJSON() (data []byte, err error)

func (*ChatCompletionNewParamsResponseFormatJsonObject) UnmarshalJSON

type ChatCompletionNewParamsResponseFormatJsonSchema

type ChatCompletionNewParamsResponseFormatJsonSchema struct {
	// Structured Outputs configuration options, including a JSON Schema.
	JsonSchema ChatCompletionNewParamsResponseFormatJsonSchemaJsonSchema `json:"json_schema,omitzero" api:"required"`
	// The type of response format being defined. Always `json_schema`.
	//
	// This field can be elided, and will marshal its zero value as "json_schema".
	Type constant.JsonSchema `json:"type" default:"json_schema"`
	// contains filtered or unexported fields
}

JSON Schema response format. Used to generate structured JSON responses. Learn more about [Structured Outputs](https://docs.together.ai/docs/json-mode).

The properties JsonSchema, Type are required.

func (ChatCompletionNewParamsResponseFormatJsonSchema) MarshalJSON

func (r ChatCompletionNewParamsResponseFormatJsonSchema) MarshalJSON() (data []byte, err error)

func (*ChatCompletionNewParamsResponseFormatJsonSchema) UnmarshalJSON

type ChatCompletionNewParamsResponseFormatJsonSchemaJsonSchema

type ChatCompletionNewParamsResponseFormatJsonSchemaJsonSchema struct {
	// The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores
	// and dashes, with a maximum length of 64.
	Name string `json:"name" api:"required"`
	// Whether to enable strict schema adherence when generating the output. If set to
	// true, the model will always follow the exact schema defined in the `schema`
	// field. Only a subset of JSON Schema is supported when `strict` is `true`. To
	// learn more, read the
	// [Structured Outputs guide](https://docs.together.ai/docs/json-mode).
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// A description of what the response format is for, used by the model to determine
	// how to respond in the format.
	Description param.Opt[string] `json:"description,omitzero"`
	// The schema for the response format, described as a JSON Schema object. Learn how
	// to build JSON schemas [here](https://json-schema.org/).
	Schema map[string]any `json:"schema,omitzero"`
	// contains filtered or unexported fields
}

Structured Outputs configuration options, including a JSON Schema.

The property Name is required.

func (ChatCompletionNewParamsResponseFormatJsonSchemaJsonSchema) MarshalJSON

func (*ChatCompletionNewParamsResponseFormatJsonSchemaJsonSchema) UnmarshalJSON

type ChatCompletionNewParamsResponseFormatText

type ChatCompletionNewParamsResponseFormatText struct {
	// The type of response format being defined. Always `text`.
	Type constant.Text `json:"type" default:"text"`
	// contains filtered or unexported fields
}

Default response format. Used to generate text responses.

This struct has a constant value, construct it with NewChatCompletionNewParamsResponseFormatText.

func NewChatCompletionNewParamsResponseFormatText

func NewChatCompletionNewParamsResponseFormatText() ChatCompletionNewParamsResponseFormatText

func (ChatCompletionNewParamsResponseFormatText) MarshalJSON

func (r ChatCompletionNewParamsResponseFormatText) MarshalJSON() (data []byte, err error)

func (*ChatCompletionNewParamsResponseFormatText) UnmarshalJSON

func (r *ChatCompletionNewParamsResponseFormatText) UnmarshalJSON(data []byte) error

type ChatCompletionNewParamsResponseFormatUnion

type ChatCompletionNewParamsResponseFormatUnion struct {
	OfText       *ChatCompletionNewParamsResponseFormatText       `json:",omitzero,inline"`
	OfJsonSchema *ChatCompletionNewParamsResponseFormatJsonSchema `json:",omitzero,inline"`
	OfJsonObject *ChatCompletionNewParamsResponseFormatJsonObject `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (ChatCompletionNewParamsResponseFormatUnion) GetJsonSchema

Returns a pointer to the underlying variant's property, if present.

func (ChatCompletionNewParamsResponseFormatUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (ChatCompletionNewParamsResponseFormatUnion) MarshalJSON

func (*ChatCompletionNewParamsResponseFormatUnion) UnmarshalJSON

func (u *ChatCompletionNewParamsResponseFormatUnion) UnmarshalJSON(data []byte) error

type ChatCompletionNewParamsToolChoiceUnion

type ChatCompletionNewParamsToolChoiceUnion struct {
	OfString     param.Opt[string] `json:",omitzero,inline"`
	OfToolChoice *ToolChoiceParam  `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (ChatCompletionNewParamsToolChoiceUnion) MarshalJSON

func (u ChatCompletionNewParamsToolChoiceUnion) MarshalJSON() ([]byte, error)

func (*ChatCompletionNewParamsToolChoiceUnion) UnmarshalJSON

func (u *ChatCompletionNewParamsToolChoiceUnion) UnmarshalJSON(data []byte) error

type ChatCompletionPrompt added in v0.7.0

type ChatCompletionPrompt []ChatCompletionPromptItem

type ChatCompletionPromptItem added in v0.7.0

type ChatCompletionPromptItem struct {
	Logprobs LogProbs `json:"logprobs"`
	Text     string   `json:"text"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Logprobs    respjson.Field
		Text        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ChatCompletionPromptItem) RawJSON added in v0.7.0

func (r ChatCompletionPromptItem) RawJSON() string

Returns the unmodified JSON received from the API

func (*ChatCompletionPromptItem) UnmarshalJSON added in v0.7.0

func (r *ChatCompletionPromptItem) UnmarshalJSON(data []byte) error

type ChatCompletionService

type ChatCompletionService struct {
	Options []option.RequestOption
}

ChatCompletionService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewChatCompletionService method instead.

func NewChatCompletionService

func NewChatCompletionService(opts ...option.RequestOption) (r ChatCompletionService)

NewChatCompletionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ChatCompletionService) New

Generate a model response for a given chat conversation. Supports single queries and multi-turn conversations with system, user, and assistant messages.

func (*ChatCompletionService) NewStreaming

Generate a model response for a given chat conversation. Supports single queries and multi-turn conversations with system, user, and assistant messages.

type ChatCompletionStructuredMessageImageURLImageURLParam

type ChatCompletionStructuredMessageImageURLImageURLParam struct {
	// The URL of the image
	URL string `json:"url" api:"required"`
	// contains filtered or unexported fields
}

The property URL is required.

func (ChatCompletionStructuredMessageImageURLImageURLParam) MarshalJSON

func (r ChatCompletionStructuredMessageImageURLImageURLParam) MarshalJSON() (data []byte, err error)

func (*ChatCompletionStructuredMessageImageURLImageURLParam) UnmarshalJSON

type ChatCompletionStructuredMessageImageURLParam

type ChatCompletionStructuredMessageImageURLParam struct {
	ImageURL ChatCompletionStructuredMessageImageURLImageURLParam `json:"image_url,omitzero"`
	// Any of "image_url".
	Type ChatCompletionStructuredMessageImageURLType `json:"type,omitzero"`
	// contains filtered or unexported fields
}

func (ChatCompletionStructuredMessageImageURLParam) MarshalJSON

func (r ChatCompletionStructuredMessageImageURLParam) MarshalJSON() (data []byte, err error)

func (*ChatCompletionStructuredMessageImageURLParam) UnmarshalJSON

func (r *ChatCompletionStructuredMessageImageURLParam) UnmarshalJSON(data []byte) error

type ChatCompletionStructuredMessageImageURLType

type ChatCompletionStructuredMessageImageURLType string
const (
	ChatCompletionStructuredMessageImageURLTypeImageURL ChatCompletionStructuredMessageImageURLType = "image_url"
)

type ChatCompletionStructuredMessageTextParam

type ChatCompletionStructuredMessageTextParam struct {
	Text string `json:"text" api:"required"`
	// Any of "text".
	Type ChatCompletionStructuredMessageTextType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The properties Text, Type are required.

func (ChatCompletionStructuredMessageTextParam) MarshalJSON

func (r ChatCompletionStructuredMessageTextParam) MarshalJSON() (data []byte, err error)

func (*ChatCompletionStructuredMessageTextParam) UnmarshalJSON

func (r *ChatCompletionStructuredMessageTextParam) UnmarshalJSON(data []byte) error

type ChatCompletionStructuredMessageTextType

type ChatCompletionStructuredMessageTextType string
const (
	ChatCompletionStructuredMessageTextTypeText ChatCompletionStructuredMessageTextType = "text"
)

type ChatCompletionStructuredMessageVideoURLParam

type ChatCompletionStructuredMessageVideoURLParam struct {
	// Any of "video_url".
	Type     ChatCompletionStructuredMessageVideoURLType          `json:"type,omitzero" api:"required"`
	VideoURL ChatCompletionStructuredMessageVideoURLVideoURLParam `json:"video_url,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The properties Type, VideoURL are required.

func (ChatCompletionStructuredMessageVideoURLParam) MarshalJSON

func (r ChatCompletionStructuredMessageVideoURLParam) MarshalJSON() (data []byte, err error)

func (*ChatCompletionStructuredMessageVideoURLParam) UnmarshalJSON

func (r *ChatCompletionStructuredMessageVideoURLParam) UnmarshalJSON(data []byte) error

type ChatCompletionStructuredMessageVideoURLType

type ChatCompletionStructuredMessageVideoURLType string
const (
	ChatCompletionStructuredMessageVideoURLTypeVideoURL ChatCompletionStructuredMessageVideoURLType = "video_url"
)

type ChatCompletionStructuredMessageVideoURLVideoURLParam

type ChatCompletionStructuredMessageVideoURLVideoURLParam struct {
	// The URL of the video
	URL string `json:"url" api:"required"`
	// contains filtered or unexported fields
}

The property URL is required.

func (ChatCompletionStructuredMessageVideoURLVideoURLParam) MarshalJSON

func (r ChatCompletionStructuredMessageVideoURLVideoURLParam) MarshalJSON() (data []byte, err error)

func (*ChatCompletionStructuredMessageVideoURLVideoURLParam) UnmarshalJSON

type ChatCompletionUsage

type ChatCompletionUsage struct {
	CompletionTokens int64 `json:"completion_tokens" api:"required"`
	PromptTokens     int64 `json:"prompt_tokens" api:"required"`
	TotalTokens      int64 `json:"total_tokens" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CompletionTokens respjson.Field
		PromptTokens     respjson.Field
		TotalTokens      respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ChatCompletionUsage) RawJSON

func (r ChatCompletionUsage) RawJSON() string

Returns the unmodified JSON received from the API

func (*ChatCompletionUsage) UnmarshalJSON

func (r *ChatCompletionUsage) UnmarshalJSON(data []byte) error

type ChatCompletionWarning

type ChatCompletionWarning struct {
	Message string `json:"message" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ChatCompletionWarning) RawJSON

func (r ChatCompletionWarning) RawJSON() string

Returns the unmodified JSON received from the API

func (*ChatCompletionWarning) UnmarshalJSON

func (r *ChatCompletionWarning) UnmarshalJSON(data []byte) error

type ChatService

type ChatService struct {
	Options     []option.RequestOption
	Completions ChatCompletionService
}

ChatService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewChatService method instead.

func NewChatService

func NewChatService(opts ...option.RequestOption) (r ChatService)

NewChatService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

type Client

type Client struct {
	Options         []option.RequestOption
	Beta            BetaService
	Chat            ChatService
	Completions     CompletionService
	Embeddings      EmbeddingService
	Files           FileService
	FineTuning      FineTuningService
	CodeInterpreter CodeInterpreterService
	Images          ImageService
	Videos          VideoService
	Audio           AudioService
	Models          ModelService
	Endpoints       EndpointService
	Rerank          RerankService
	Batches         BatchService
	Evals           EvalService
}

Client creates a struct with services and top level methods that help with interacting with the together API. You should not instantiate this client directly, and instead use the NewClient method instead.

func NewClient

func NewClient(opts ...option.RequestOption) (r Client)

NewClient generates a new client with the default option read from the environment (TOGETHER_API_KEY, TOGETHER_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.

func (*Client) Delete

func (r *Client) Delete(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Execute

func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, opts ...option.RequestOption) error

Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.

If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.

The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.

If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.

Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.

The response body will be deserialized into the res variable, depending on its type:

  • A pointer to a *http.Response is populated by the raw response.
  • A pointer to a byte array will be populated with the contents of the request body.
  • A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
  • A nil value will not read the response body.

For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.

func (*Client) Get

func (r *Client) Get(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Patch

func (r *Client) Patch(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Post

func (r *Client) Post(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Post makes a POST request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Put

func (r *Client) Put(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Put makes a PUT request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

type Cluster added in v0.4.0

type Cluster struct {
	// Enabled add-ons on this cluster. Only add-ons with enabled=true in their config
	// are returned.
	AddOns []ClusterAddOn `json:"add_ons" api:"required"`
	// Actual number of preemptible GPUs currently allocated to the cluster. Updated
	// asynchronously by the fulfillment and reclamation workers; may be less than
	// desired_preemptible_gpus when capacity is constrained.
	AllocatedPreemptibleGPUs int64 `json:"allocated_preemptible_gpus" api:"required"`
	// Billing type for the cluster (RESERVED, ON_DEMAND, or SCHEDULED_CAPACITY).
	//
	// Any of "RESERVED", "ON_DEMAND", "SCHEDULED_CAPACITY".
	BillingType ClusterBillingType `json:"billing_type" api:"required"`
	ClusterID   string             `json:"cluster_id" api:"required"`
	ClusterName string             `json:"cluster_name" api:"required"`
	// Type of cluster.
	//
	// Any of "KUBERNETES", "SLURM".
	ClusterType       ClusterClusterType        `json:"cluster_type" api:"required"`
	ControlPlaneNodes []ClusterControlPlaneNode `json:"control_plane_nodes" api:"required"`
	CudaVersion       string                    `json:"cuda_version" api:"required"`
	// Customer's requested number of preemptible GPUs. Set on cluster create or
	// update; persists until changed.
	DesiredPreemptibleGPUs int64 `json:"desired_preemptible_gpus" api:"required"`
	// Any of "H100_SXM", "H200_SXM", "RTX_6000_PCI", "L40_PCIE", "B200_SXM",
	// "H100_SXM_INF".
	GPUType        ClusterGPUType         `json:"gpu_type" api:"required"`
	GPUWorkerNodes []ClusterGPUWorkerNode `json:"gpu_worker_nodes" api:"required"`
	KubeConfig     string                 `json:"kube_config" api:"required"`
	// Number of CPU-only worker nodes in the cluster.
	NumCPUWorkers       int64  `json:"num_cpu_workers" api:"required"`
	NumGPUs             int64  `json:"num_gpus" api:"required"`
	NvidiaDriverVersion string `json:"nvidia_driver_version" api:"required"`
	// Cluster-level phase transition history.
	PhaseTransitions []ClusterPhaseTransition `json:"phase_transitions" api:"required"`
	ProjectID        string                   `json:"project_id" api:"required"`
	Region           string                   `json:"region" api:"required"`
	// Current status of the GPU cluster.
	//
	// Any of "WaitingForControlPlaneNodes", "WaitingForDataPlaneNodes",
	// "WaitingForSubnet", "WaitingForSharedVolume", "InstallingDrivers",
	// "RunningAcceptanceTests", "Paused", "OnDemandComputePaused", "Ready",
	// "Degraded", "Deleting".
	Status               ClusterStatus        `json:"status" api:"required"`
	Volumes              []ClusterVolume      `json:"volumes" api:"required"`
	CapacityPoolID       string               `json:"capacity_pool_id"`
	ClusterConfig        ClusterClusterConfig `json:"cluster_config"`
	CreatedAt            time.Time            `json:"created_at" format:"date-time"`
	DurationHours        int64                `json:"duration_hours"`
	InstallTraefik       bool                 `json:"install_traefik"`
	OidcConfig           ClusterOidcConfig    `json:"oidc_config"`
	ReservationEndTime   time.Time            `json:"reservation_end_time" format:"date-time"`
	ReservationStartTime time.Time            `json:"reservation_start_time" format:"date-time"`
	SlurmShmSizeGib      int64                `json:"slurm_shm_size_gib"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AddOns                   respjson.Field
		AllocatedPreemptibleGPUs respjson.Field
		BillingType              respjson.Field
		ClusterID                respjson.Field
		ClusterName              respjson.Field
		ClusterType              respjson.Field
		ControlPlaneNodes        respjson.Field
		CudaVersion              respjson.Field
		DesiredPreemptibleGPUs   respjson.Field
		GPUType                  respjson.Field
		GPUWorkerNodes           respjson.Field
		KubeConfig               respjson.Field
		NumCPUWorkers            respjson.Field
		NumGPUs                  respjson.Field
		NvidiaDriverVersion      respjson.Field
		PhaseTransitions         respjson.Field
		ProjectID                respjson.Field
		Region                   respjson.Field
		Status                   respjson.Field
		Volumes                  respjson.Field
		CapacityPoolID           respjson.Field
		ClusterConfig            respjson.Field
		CreatedAt                respjson.Field
		DurationHours            respjson.Field
		InstallTraefik           respjson.Field
		OidcConfig               respjson.Field
		ReservationEndTime       respjson.Field
		ReservationStartTime     respjson.Field
		SlurmShmSizeGib          respjson.Field
		ExtraFields              map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (Cluster) RawJSON added in v0.4.0

func (r Cluster) RawJSON() string

Returns the unmodified JSON received from the API

func (*Cluster) UnmarshalJSON added in v0.4.0

func (r *Cluster) UnmarshalJSON(data []byte) error

type ClusterAddOn added in v0.10.0

type ClusterAddOn struct {
	AddOnType string             `json:"add_on_type" api:"required"`
	Config    ClusterAddOnConfig `json:"config" api:"required"`
	Name      string             `json:"name" api:"required"`
	State     ClusterAddOnState  `json:"state" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AddOnType   respjson.Field
		Config      respjson.Field
		Name        respjson.Field
		State       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

AddOnInfo is returned in cluster responses and add-on CRUD operations.

func (ClusterAddOn) RawJSON added in v0.10.0

func (r ClusterAddOn) RawJSON() string

Returns the unmodified JSON received from the API

func (*ClusterAddOn) UnmarshalJSON added in v0.10.0

func (r *ClusterAddOn) UnmarshalJSON(data []byte) error

type ClusterAddOnConfig added in v0.10.0

type ClusterAddOnConfig struct {
	Dashboard ClusterAddOnConfigDashboard `json:"dashboard"`
	Ingress   ClusterAddOnConfigIngress   `json:"ingress"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Dashboard   respjson.Field
		Ingress     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ClusterAddOnConfig) RawJSON added in v0.10.0

func (r ClusterAddOnConfig) RawJSON() string

Returns the unmodified JSON received from the API

func (*ClusterAddOnConfig) UnmarshalJSON added in v0.10.0

func (r *ClusterAddOnConfig) UnmarshalJSON(data []byte) error

type ClusterAddOnConfigDashboard added in v0.10.0

type ClusterAddOnConfigDashboard struct {
	Enabled bool `json:"enabled"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ClusterAddOnConfigDashboard) RawJSON added in v0.10.0

func (r ClusterAddOnConfigDashboard) RawJSON() string

Returns the unmodified JSON received from the API

func (*ClusterAddOnConfigDashboard) UnmarshalJSON added in v0.10.0

func (r *ClusterAddOnConfigDashboard) UnmarshalJSON(data []byte) error

type ClusterAddOnConfigIngress added in v0.10.0

type ClusterAddOnConfigIngress struct {
	Enabled bool `json:"enabled"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ClusterAddOnConfigIngress) RawJSON added in v0.10.0

func (r ClusterAddOnConfigIngress) RawJSON() string

Returns the unmodified JSON received from the API

func (*ClusterAddOnConfigIngress) UnmarshalJSON added in v0.10.0

func (r *ClusterAddOnConfigIngress) UnmarshalJSON(data []byte) error

type ClusterAddOnState added in v0.10.0

type ClusterAddOnState struct {
	Dashboard ClusterAddOnStateDashboard `json:"dashboard"`
	Ingress   ClusterAddOnStateIngress   `json:"ingress"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Dashboard   respjson.Field
		Ingress     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ClusterAddOnState) RawJSON added in v0.10.0

func (r ClusterAddOnState) RawJSON() string

Returns the unmodified JSON received from the API

func (*ClusterAddOnState) UnmarshalJSON added in v0.10.0

func (r *ClusterAddOnState) UnmarshalJSON(data []byte) error

type ClusterAddOnStateDashboard added in v0.10.0

type ClusterAddOnStateDashboard struct {
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ClusterAddOnStateDashboard) RawJSON added in v0.10.0

func (r ClusterAddOnStateDashboard) RawJSON() string

Returns the unmodified JSON received from the API

func (*ClusterAddOnStateDashboard) UnmarshalJSON added in v0.10.0

func (r *ClusterAddOnStateDashboard) UnmarshalJSON(data []byte) error

type ClusterAddOnStateIngress added in v0.10.0

type ClusterAddOnStateIngress struct {
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ClusterAddOnStateIngress) RawJSON added in v0.10.0

func (r ClusterAddOnStateIngress) RawJSON() string

Returns the unmodified JSON received from the API

func (*ClusterAddOnStateIngress) UnmarshalJSON added in v0.10.0

func (r *ClusterAddOnStateIngress) UnmarshalJSON(data []byte) error

type ClusterBillingType added in v0.10.0

type ClusterBillingType string

Billing type for the cluster (RESERVED, ON_DEMAND, or SCHEDULED_CAPACITY).

const (
	ClusterBillingTypeReserved          ClusterBillingType = "RESERVED"
	ClusterBillingTypeOnDemand          ClusterBillingType = "ON_DEMAND"
	ClusterBillingTypeScheduledCapacity ClusterBillingType = "SCHEDULED_CAPACITY"
)

type ClusterClusterConfig added in v0.10.0

type ClusterClusterConfig struct {
	// Any of "NONE", "TRAEFIK", "NGINX", "ISTIO".
	LoadBalancer string `json:"load_balancer" api:"required"`
	// NVIDIA GPU Operator chart/version for the tenant cluster (e.g. v24.6.2). When
	// omitted, a service default is applied.
	GPUOperatorVersion         string                            `json:"gpu_operator_version"`
	Ingress                    ClusterClusterConfigIngress       `json:"ingress"`
	JumphostEnabled            bool                              `json:"jumphost_enabled"`
	KubernetesDashboardEnabled bool                              `json:"kubernetes_dashboard_enabled"`
	Observability              ClusterClusterConfigObservability `json:"observability"`
	// SlurmStartupScripts carries optional Slurm lifecycle scripts (prolog/epilog,
	// init, extra conf).
	SlurmStartupScripts ClusterClusterConfigSlurmStartupScripts `json:"slurm_startup_scripts"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		LoadBalancer               respjson.Field
		GPUOperatorVersion         respjson.Field
		Ingress                    respjson.Field
		JumphostEnabled            respjson.Field
		KubernetesDashboardEnabled respjson.Field
		Observability              respjson.Field
		SlurmStartupScripts        respjson.Field
		ExtraFields                map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ClusterClusterConfig) RawJSON added in v0.10.0

func (r ClusterClusterConfig) RawJSON() string

Returns the unmodified JSON received from the API

func (*ClusterClusterConfig) UnmarshalJSON added in v0.10.0

func (r *ClusterClusterConfig) UnmarshalJSON(data []byte) error

type ClusterClusterConfigIngress added in v0.10.0

type ClusterClusterConfigIngress struct {
	Enabled bool `json:"enabled"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ClusterClusterConfigIngress) RawJSON added in v0.10.0

func (r ClusterClusterConfigIngress) RawJSON() string

Returns the unmodified JSON received from the API

func (*ClusterClusterConfigIngress) UnmarshalJSON added in v0.10.0

func (r *ClusterClusterConfigIngress) UnmarshalJSON(data []byte) error

type ClusterClusterConfigObservability added in v0.10.0

type ClusterClusterConfigObservability struct {
	Enabled bool `json:"enabled"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ClusterClusterConfigObservability) RawJSON added in v0.10.0

Returns the unmodified JSON received from the API

func (*ClusterClusterConfigObservability) UnmarshalJSON added in v0.10.0

func (r *ClusterClusterConfigObservability) UnmarshalJSON(data []byte) error

type ClusterClusterConfigSlurmStartupScripts added in v0.10.0

type ClusterClusterConfigSlurmStartupScripts struct {
	// Slurm controller epilog script.
	ControllerEpilog string `json:"controller_epilog"`
	// Slurm controller prolog script.
	ControllerProlog string `json:"controller_prolog"`
	// Additional slurm.conf fragments.
	ExtraSlurmConf string `json:"extra_slurm_conf"`
	// Script run on Slurm login node init.
	LoginInitScript string `json:"login_init_script"`
	// Script run on Slurm nodeset init.
	NodesetInitScript string `json:"nodeset_init_script"`
	// Slurm worker node epilog script.
	WorkerEpilog string `json:"worker_epilog"`
	// Slurm worker node prolog script.
	WorkerProlog string `json:"worker_prolog"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ControllerEpilog  respjson.Field
		ControllerProlog  respjson.Field
		ExtraSlurmConf    respjson.Field
		LoginInitScript   respjson.Field
		NodesetInitScript respjson.Field
		WorkerEpilog      respjson.Field
		WorkerProlog      respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

SlurmStartupScripts carries optional Slurm lifecycle scripts (prolog/epilog, init, extra conf).

func (ClusterClusterConfigSlurmStartupScripts) RawJSON added in v0.10.0

Returns the unmodified JSON received from the API

func (*ClusterClusterConfigSlurmStartupScripts) UnmarshalJSON added in v0.10.0

func (r *ClusterClusterConfigSlurmStartupScripts) UnmarshalJSON(data []byte) error

type ClusterClusterType added in v0.4.0

type ClusterClusterType string

Type of cluster.

const (
	ClusterClusterTypeKubernetes ClusterClusterType = "KUBERNETES"
	ClusterClusterTypeSlurm      ClusterClusterType = "SLURM"
)

type ClusterControlPlaneNode added in v0.4.0

type ClusterControlPlaneNode struct {
	HostName    string  `json:"host_name" api:"required"`
	MemoryGib   float64 `json:"memory_gib" api:"required"`
	Network     string  `json:"network" api:"required"`
	NodeID      string  `json:"node_id" api:"required"`
	NumCPUCores int64   `json:"num_cpu_cores" api:"required"`
	// Phase transition history for this control plane node.
	PhaseTransitions []ClusterControlPlaneNodePhaseTransition `json:"phase_transitions" api:"required"`
	Status           string                                   `json:"status" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		HostName         respjson.Field
		MemoryGib        respjson.Field
		Network          respjson.Field
		NodeID           respjson.Field
		NumCPUCores      respjson.Field
		PhaseTransitions respjson.Field
		Status           respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ClusterControlPlaneNode) RawJSON added in v0.4.0

func (r ClusterControlPlaneNode) RawJSON() string

Returns the unmodified JSON received from the API

func (*ClusterControlPlaneNode) UnmarshalJSON added in v0.4.0

func (r *ClusterControlPlaneNode) UnmarshalJSON(data []byte) error

type ClusterControlPlaneNodePhaseTransition added in v0.10.0

type ClusterControlPlaneNodePhaseTransition struct {
	// Node phase.
	//
	// Any of "NODE_PHASE_PENDING", "NODE_PHASE_SCHEDULING", "NODE_PHASE_BOOTING",
	// "NODE_PHASE_BOOTSTRAPPING", "NODE_PHASE_RUNNING", "NODE_PHASE_SUCCEEDED",
	// "NODE_PHASE_FAILED", "NODE_PHASE_PAUSED".
	Phase string `json:"phase" api:"required"`
	// Timestamp when the phase transition occurred.
	TransitionTime time.Time `json:"transition_time" api:"required" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Phase          respjson.Field
		TransitionTime respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ClusterControlPlaneNodePhaseTransition) RawJSON added in v0.10.0

Returns the unmodified JSON received from the API

func (*ClusterControlPlaneNodePhaseTransition) UnmarshalJSON added in v0.10.0

func (r *ClusterControlPlaneNodePhaseTransition) UnmarshalJSON(data []byte) error

type ClusterGPUType added in v0.4.0

type ClusterGPUType string
const (
	ClusterGPUTypeH100Sxm    ClusterGPUType = "H100_SXM"
	ClusterGPUTypeH200Sxm    ClusterGPUType = "H200_SXM"
	ClusterGPUTypeRtx6000Pci ClusterGPUType = "RTX_6000_PCI"
	ClusterGPUTypeL40Pcie    ClusterGPUType = "L40_PCIE"
	ClusterGPUTypeB200Sxm    ClusterGPUType = "B200_SXM"
	ClusterGPUTypeH100SxmInf ClusterGPUType = "H100_SXM_INF"
)

type ClusterGPUWorkerNode added in v0.4.0

type ClusterGPUWorkerNode struct {
	HostName    string   `json:"host_name" api:"required"`
	MemoryGib   float64  `json:"memory_gib" api:"required"`
	Networks    []string `json:"networks" api:"required"`
	NodeID      string   `json:"node_id" api:"required"`
	NumCPUCores int64    `json:"num_cpu_cores" api:"required"`
	NumGPUs     int64    `json:"num_gpus" api:"required"`
	// Phase transition history for this GPU worker node.
	PhaseTransitions []ClusterGPUWorkerNodePhaseTransition `json:"phase_transitions" api:"required"`
	Status           string                                `json:"status" api:"required"`
	InstanceID       string                                `json:"instance_id"`
	// Remediation represents a node remediation request for an instance. An instance
	// can have multiple remediations over time (e.g., failed attempts followed by
	// retries).
	LatestRemediation   Remediation `json:"latest_remediation"`
	SlurmWorkerHostname string      `json:"slurm_worker_hostname"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		HostName            respjson.Field
		MemoryGib           respjson.Field
		Networks            respjson.Field
		NodeID              respjson.Field
		NumCPUCores         respjson.Field
		NumGPUs             respjson.Field
		PhaseTransitions    respjson.Field
		Status              respjson.Field
		InstanceID          respjson.Field
		LatestRemediation   respjson.Field
		SlurmWorkerHostname respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ClusterGPUWorkerNode) RawJSON added in v0.4.0

func (r ClusterGPUWorkerNode) RawJSON() string

Returns the unmodified JSON received from the API

func (*ClusterGPUWorkerNode) UnmarshalJSON added in v0.4.0

func (r *ClusterGPUWorkerNode) UnmarshalJSON(data []byte) error

type ClusterGPUWorkerNodePhaseTransition added in v0.10.0

type ClusterGPUWorkerNodePhaseTransition struct {
	// Node phase.
	//
	// Any of "NODE_PHASE_PENDING", "NODE_PHASE_SCHEDULING", "NODE_PHASE_BOOTING",
	// "NODE_PHASE_BOOTSTRAPPING", "NODE_PHASE_RUNNING", "NODE_PHASE_SUCCEEDED",
	// "NODE_PHASE_FAILED", "NODE_PHASE_PAUSED".
	Phase string `json:"phase" api:"required"`
	// Timestamp when the phase transition occurred.
	TransitionTime time.Time `json:"transition_time" api:"required" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Phase          respjson.Field
		TransitionTime respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ClusterGPUWorkerNodePhaseTransition) RawJSON added in v0.10.0

Returns the unmodified JSON received from the API

func (*ClusterGPUWorkerNodePhaseTransition) UnmarshalJSON added in v0.10.0

func (r *ClusterGPUWorkerNodePhaseTransition) UnmarshalJSON(data []byte) error

type ClusterOidcConfig added in v0.10.0

type ClusterOidcConfig struct {
	// OIDC client ID for authentication.
	ClientID string `json:"client_id" api:"required"`
	// JWT claim to use for user groups. For example, 'groups'
	GroupClaim string `json:"group_claim" api:"required"`
	// Prefix to add to the group claim to form the final group name. For example,
	// 'oidc:'
	GroupPrefix string `json:"group_prefix" api:"required"`
	// OIDC issuer URL for authentication. For example, https://accounts.google.com
	IssuerURL string `json:"issuer_url" api:"required"`
	// JWT claim to use as the username. For example, 'sub' or 'email'
	UsernameClaim string `json:"username_claim" api:"required"`
	// Prefix to add to the username claim to form the final username. For example,
	// 'oidc:'
	UsernamePrefix string `json:"username_prefix" api:"required"`
	// CA certificate in PEM format to validate the OIDC issuer's TLS certificate. This
	// field is optional but recommended if the issuer uses a private CA or self-signed
	// certificate.
	CaCert string `json:"ca_cert"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ClientID       respjson.Field
		GroupClaim     respjson.Field
		GroupPrefix    respjson.Field
		IssuerURL      respjson.Field
		UsernameClaim  respjson.Field
		UsernamePrefix respjson.Field
		CaCert         respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ClusterOidcConfig) RawJSON added in v0.10.0

func (r ClusterOidcConfig) RawJSON() string

Returns the unmodified JSON received from the API

func (*ClusterOidcConfig) UnmarshalJSON added in v0.10.0

func (r *ClusterOidcConfig) UnmarshalJSON(data []byte) error

type ClusterPhaseTransition added in v0.10.0

type ClusterPhaseTransition struct {
	// Cluster phase.
	//
	// Any of "CLUSTER_PHASE_QUEUED", "CLUSTER_PHASE_SCHEDULED",
	// "CLUSTER_PHASE_WAITING_FOR_CONTROL_PLANE_NODES",
	// "CLUSTER_PHASE_WAITING_FOR_DATA_PLANE_NODES",
	// "CLUSTER_PHASE_WAITING_FOR_SUBNET", "CLUSTER_PHASE_WAITING_FOR_SHARED_VOLUME",
	// "CLUSTER_PHASE_WAITING_FOR_AUTO_SCALER", "CLUSTER_PHASE_INSTALLING_DRIVERS",
	// "CLUSTER_PHASE_RUNNING_ACCEPTANCE_TESTS",
	// "CLUSTER_PHASE_ACCEPTANCE_TESTS_FAILED", "CLUSTER_PHASE_RUNNING_NCCL_TESTS",
	// "CLUSTER_PHASE_NCCL_TESTS_FAILED", "CLUSTER_PHASE_READY",
	// "CLUSTER_PHASE_PAUSED", "CLUSTER_PHASE_ON_DEMAND_COMPUTE_PAUSED",
	// "CLUSTER_PHASE_DEGRADED", "CLUSTER_PHASE_DELETING".
	Phase string `json:"phase" api:"required"`
	// Timestamp when the phase transition occurred.
	TransitionTime time.Time `json:"transition_time" api:"required" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Phase          respjson.Field
		TransitionTime respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ClusterPhaseTransition) RawJSON added in v0.10.0

func (r ClusterPhaseTransition) RawJSON() string

Returns the unmodified JSON received from the API

func (*ClusterPhaseTransition) UnmarshalJSON added in v0.10.0

func (r *ClusterPhaseTransition) UnmarshalJSON(data []byte) error

type ClusterStatus added in v0.4.0

type ClusterStatus string

Current status of the GPU cluster.

const (
	ClusterStatusWaitingForControlPlaneNodes ClusterStatus = "WaitingForControlPlaneNodes"
	ClusterStatusWaitingForDataPlaneNodes    ClusterStatus = "WaitingForDataPlaneNodes"
	ClusterStatusWaitingForSubnet            ClusterStatus = "WaitingForSubnet"
	ClusterStatusWaitingForSharedVolume      ClusterStatus = "WaitingForSharedVolume"
	ClusterStatusInstallingDrivers           ClusterStatus = "InstallingDrivers"
	ClusterStatusRunningAcceptanceTests      ClusterStatus = "RunningAcceptanceTests"
	ClusterStatusPaused                      ClusterStatus = "Paused"
	ClusterStatusOnDemandComputePaused       ClusterStatus = "OnDemandComputePaused"
	ClusterStatusReady                       ClusterStatus = "Ready"
	ClusterStatusDegraded                    ClusterStatus = "Degraded"
	ClusterStatusDeleting                    ClusterStatus = "Deleting"
)

type ClusterStorage added in v0.4.0

type ClusterStorage struct {
	// Size of the volume in TiB.
	SizeTib int64 `json:"size_tib" api:"required"`
	// Current status of the shared volume.
	//
	// Any of "scheduled", "available", "bound", "provisioning", "deleting", "failed",
	// "access_revoked", "unknown".
	Status ClusterStorageStatus `json:"status" api:"required"`
	// ID of the volume.
	VolumeID string `json:"volume_id" api:"required"`
	// User provided name of the volume.
	VolumeName string `json:"volume_name" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		SizeTib     respjson.Field
		Status      respjson.Field
		VolumeID    respjson.Field
		VolumeName  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ClusterStorage) RawJSON added in v0.4.0

func (r ClusterStorage) RawJSON() string

Returns the unmodified JSON received from the API

func (*ClusterStorage) UnmarshalJSON added in v0.4.0

func (r *ClusterStorage) UnmarshalJSON(data []byte) error

type ClusterStorageStatus added in v0.5.0

type ClusterStorageStatus string

Current status of the shared volume.

const (
	ClusterStorageStatusScheduled     ClusterStorageStatus = "scheduled"
	ClusterStorageStatusAvailable     ClusterStorageStatus = "available"
	ClusterStorageStatusBound         ClusterStorageStatus = "bound"
	ClusterStorageStatusProvisioning  ClusterStorageStatus = "provisioning"
	ClusterStorageStatusDeleting      ClusterStorageStatus = "deleting"
	ClusterStorageStatusFailed        ClusterStorageStatus = "failed"
	ClusterStorageStatusAccessRevoked ClusterStorageStatus = "access_revoked"
	ClusterStorageStatusUnknown       ClusterStorageStatus = "unknown"
)

type ClusterVolume added in v0.4.0

type ClusterVolume struct {
	// Size of the volume in TiB.
	SizeTib int64 `json:"size_tib" api:"required"`
	// Current status of the volume.
	Status string `json:"status" api:"required"`
	// ID of the volume.
	VolumeID string `json:"volume_id" api:"required"`
	// User provided name of the volume.
	VolumeName string `json:"volume_name" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		SizeTib     respjson.Field
		Status      respjson.Field
		VolumeID    respjson.Field
		VolumeName  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ClusterVolume) RawJSON added in v0.4.0

func (r ClusterVolume) RawJSON() string

Returns the unmodified JSON received from the API

func (*ClusterVolume) UnmarshalJSON added in v0.4.0

func (r *ClusterVolume) UnmarshalJSON(data []byte) error

type CodeInterpreterExecuteParams

type CodeInterpreterExecuteParams struct {
	// Code snippet to execute.
	Code string `json:"code" api:"required"`
	// Programming language for the code to execute. Currently only supports Python.
	//
	// Any of "python".
	Language CodeInterpreterExecuteParamsLanguage `json:"language,omitzero" api:"required"`
	// Identifier of the current session. Used to make follow-up calls. Returns an
	// error if the session does not belong to the caller or has expired.
	SessionID param.Opt[string] `json:"session_id,omitzero"`
	// Files to upload to the session. If present, files are uploaded before executing
	// the given code.
	Files []CodeInterpreterExecuteParamsFile `json:"files,omitzero"`
	// contains filtered or unexported fields
}

func (CodeInterpreterExecuteParams) MarshalJSON

func (r CodeInterpreterExecuteParams) MarshalJSON() (data []byte, err error)

func (*CodeInterpreterExecuteParams) UnmarshalJSON

func (r *CodeInterpreterExecuteParams) UnmarshalJSON(data []byte) error

type CodeInterpreterExecuteParamsFile

type CodeInterpreterExecuteParamsFile struct {
	Content string `json:"content" api:"required"`
	// Encoding of the file content. Use `string` for text files such as code, and
	// `base64` for binary files, such as images.
	//
	// Any of "string", "base64".
	Encoding string `json:"encoding,omitzero" api:"required"`
	Name     string `json:"name" api:"required"`
	// contains filtered or unexported fields
}

The properties Content, Encoding, Name are required.

func (CodeInterpreterExecuteParamsFile) MarshalJSON

func (r CodeInterpreterExecuteParamsFile) MarshalJSON() (data []byte, err error)

func (*CodeInterpreterExecuteParamsFile) UnmarshalJSON

func (r *CodeInterpreterExecuteParamsFile) UnmarshalJSON(data []byte) error

type CodeInterpreterExecuteParamsLanguage

type CodeInterpreterExecuteParamsLanguage string

Programming language for the code to execute. Currently only supports Python.

const (
	CodeInterpreterExecuteParamsLanguagePython CodeInterpreterExecuteParamsLanguage = "python"
)

type CodeInterpreterService

type CodeInterpreterService struct {
	Options  []option.RequestOption
	Sessions CodeInterpreterSessionService
}

CodeInterpreterService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCodeInterpreterService method instead.

func NewCodeInterpreterService

func NewCodeInterpreterService(opts ...option.RequestOption) (r CodeInterpreterService)

NewCodeInterpreterService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*CodeInterpreterService) Execute

Executes the given code snippet and returns the output. Without a session_id, a new session is created to run the code. If you pass a valid session_id, the code runs in that session. This is useful for running multiple code snippets in the same environment, because dependencies and similar things are persisted between calls to the same session.

type CodeInterpreterSessionService

type CodeInterpreterSessionService struct {
	Options []option.RequestOption
}

CodeInterpreterSessionService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCodeInterpreterSessionService method instead.

func NewCodeInterpreterSessionService

func NewCodeInterpreterSessionService(opts ...option.RequestOption) (r CodeInterpreterSessionService)

NewCodeInterpreterSessionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*CodeInterpreterSessionService) List

Lists all your currently active sessions.

type Completion

type Completion struct {
	ID      string             `json:"id" api:"required"`
	Choices []CompletionChoice `json:"choices" api:"required"`
	Created int64              `json:"created" api:"required"`
	Model   string             `json:"model" api:"required"`
	// The object type, which is always `text.completion`.
	Object constant.TextCompletion `json:"object" default:"text.completion"`
	// When `echo` is true, the prompt is included in the response. Additionally, when
	// `logprobs` is also provided, log probability information is provided on the
	// prompt.
	Prompt ChatCompletionPrompt `json:"prompt" api:"required"`
	Usage  ChatCompletionUsage  `json:"usage" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Choices     respjson.Field
		Created     respjson.Field
		Model       respjson.Field
		Object      respjson.Field
		Prompt      respjson.Field
		Usage       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (Completion) RawJSON

func (r Completion) RawJSON() string

Returns the unmodified JSON received from the API

func (*Completion) UnmarshalJSON

func (r *Completion) UnmarshalJSON(data []byte) error

type CompletionChoice

type CompletionChoice struct {
	// Any of "stop", "eos", "length", "tool_calls", "function_call".
	FinishReason string   `json:"finish_reason"`
	Logprobs     LogProbs `json:"logprobs"`
	Seed         int64    `json:"seed"`
	Text         string   `json:"text"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		FinishReason respjson.Field
		Logprobs     respjson.Field
		Seed         respjson.Field
		Text         respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CompletionChoice) RawJSON

func (r CompletionChoice) RawJSON() string

Returns the unmodified JSON received from the API

func (*CompletionChoice) UnmarshalJSON

func (r *CompletionChoice) UnmarshalJSON(data []byte) error

type CompletionChunk

type CompletionChunk struct {
	ID      string                  `json:"id" api:"required"`
	Token   CompletionChunkToken    `json:"token" api:"required"`
	Choices []CompletionChunkChoice `json:"choices" api:"required"`
	// Any of "stop", "eos", "length", "tool_calls", "function_call".
	FinishReason CompletionChunkFinishReason `json:"finish_reason" api:"required"`
	Usage        ChatCompletionUsage         `json:"usage" api:"required"`
	Created      int64                       `json:"created"`
	// The object type, which is always `completion.chunk`.
	//
	// Any of "completion.chunk".
	Object CompletionChunkObject `json:"object"`
	Seed   int64                 `json:"seed"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID           respjson.Field
		Token        respjson.Field
		Choices      respjson.Field
		FinishReason respjson.Field
		Usage        respjson.Field
		Created      respjson.Field
		Object       respjson.Field
		Seed         respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CompletionChunk) RawJSON

func (r CompletionChunk) RawJSON() string

Returns the unmodified JSON received from the API

func (*CompletionChunk) UnmarshalJSON

func (r *CompletionChunk) UnmarshalJSON(data []byte) error

type CompletionChunkChoice

type CompletionChunkChoice struct {
	Index int64                      `json:"index" api:"required"`
	Delta CompletionChunkChoiceDelta `json:"delta"`
	Text  string                     `json:"text"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Index       respjson.Field
		Delta       respjson.Field
		Text        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CompletionChunkChoice) RawJSON

func (r CompletionChunkChoice) RawJSON() string

Returns the unmodified JSON received from the API

func (*CompletionChunkChoice) UnmarshalJSON

func (r *CompletionChunkChoice) UnmarshalJSON(data []byte) error

type CompletionChunkChoiceDelta

type CompletionChunkChoiceDelta struct {
	// Any of "system", "user", "assistant", "function", "tool".
	Role    string `json:"role" api:"required"`
	Content string `json:"content" api:"nullable"`
	// Deprecated: deprecated
	FunctionCall CompletionChunkChoiceDeltaFunctionCall `json:"function_call" api:"nullable"`
	Reasoning    string                                 `json:"reasoning" api:"nullable"`
	TokenID      int64                                  `json:"token_id"`
	ToolCalls    []ToolChoice                           `json:"tool_calls"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Role         respjson.Field
		Content      respjson.Field
		FunctionCall respjson.Field
		Reasoning    respjson.Field
		TokenID      respjson.Field
		ToolCalls    respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CompletionChunkChoiceDelta) RawJSON

func (r CompletionChunkChoiceDelta) RawJSON() string

Returns the unmodified JSON received from the API

func (*CompletionChunkChoiceDelta) UnmarshalJSON

func (r *CompletionChunkChoiceDelta) UnmarshalJSON(data []byte) error

type CompletionChunkChoiceDeltaFunctionCall deprecated

type CompletionChunkChoiceDeltaFunctionCall struct {
	Arguments string `json:"arguments" api:"required"`
	Name      string `json:"name" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Arguments   respjson.Field
		Name        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Deprecated: deprecated

func (CompletionChunkChoiceDeltaFunctionCall) RawJSON

Returns the unmodified JSON received from the API

func (*CompletionChunkChoiceDeltaFunctionCall) UnmarshalJSON

func (r *CompletionChunkChoiceDeltaFunctionCall) UnmarshalJSON(data []byte) error

type CompletionChunkFinishReason

type CompletionChunkFinishReason string
const (
	CompletionChunkFinishReasonStop         CompletionChunkFinishReason = "stop"
	CompletionChunkFinishReasonEos          CompletionChunkFinishReason = "eos"
	CompletionChunkFinishReasonLength       CompletionChunkFinishReason = "length"
	CompletionChunkFinishReasonToolCalls    CompletionChunkFinishReason = "tool_calls"
	CompletionChunkFinishReasonFunctionCall CompletionChunkFinishReason = "function_call"
)

type CompletionChunkObject

type CompletionChunkObject string

The object type, which is always `completion.chunk`.

const (
	CompletionChunkObjectCompletionChunk CompletionChunkObject = "completion.chunk"
)

type CompletionChunkToken

type CompletionChunkToken struct {
	ID      int64   `json:"id" api:"required"`
	Logprob float64 `json:"logprob" api:"required"`
	Special bool    `json:"special" api:"required"`
	Text    string  `json:"text" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Logprob     respjson.Field
		Special     respjson.Field
		Text        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CompletionChunkToken) RawJSON

func (r CompletionChunkToken) RawJSON() string

Returns the unmodified JSON received from the API

func (*CompletionChunkToken) UnmarshalJSON

func (r *CompletionChunkToken) UnmarshalJSON(data []byte) error

type CompletionNewParams

type CompletionNewParams struct {
	// The name of the model to query.
	//
	// [See all of Together AI's chat models](https://docs.together.ai/docs/serverless-models#chat-models)
	Model CompletionNewParamsModel `json:"model,omitzero" api:"required"`
	// A string providing context for the model to complete.
	Prompt string `json:"prompt" api:"required"`
	// If true, the response contains the prompt. Can be used with `logprobs` to return
	// prompt logprobs.
	Echo param.Opt[bool] `json:"echo,omitzero"`
	// A number between -2.0 and 2.0 where a positive value decreases the likelihood of
	// repeating tokens that have already been mentioned.
	FrequencyPenalty param.Opt[float64] `json:"frequency_penalty,omitzero"`
	// An integer between 0 and 20 of the top k tokens to return log probabilities for
	// at each generation step, instead of only the sampled token. Log probabilities
	// help assess model confidence in token predictions.
	Logprobs param.Opt[int64] `json:"logprobs,omitzero"`
	// The maximum number of tokens to generate.
	MaxTokens param.Opt[int64] `json:"max_tokens,omitzero"`
	// A number between 0 and 1 that can be used as an alternative to top-p and top-k.
	MinP param.Opt[float64] `json:"min_p,omitzero"`
	// The number of completions to generate for each prompt.
	N param.Opt[int64] `json:"n,omitzero"`
	// A number between -2.0 and 2.0 where a positive value increases the likelihood of
	// a model talking about new topics.
	PresencePenalty param.Opt[float64] `json:"presence_penalty,omitzero"`
	// A number that controls the diversity of generated text by reducing the
	// likelihood of repeated sequences. Higher values decrease repetition.
	RepetitionPenalty param.Opt[float64] `json:"repetition_penalty,omitzero"`
	// Seed value for reproducibility.
	Seed param.Opt[int64] `json:"seed,omitzero"`
	// A decimal number from 0-1 that determines the degree of randomness in the
	// response. A temperature less than 1 favors more correctness and is appropriate
	// for question answering or summarization. A value closer to 1 introduces more
	// randomness in the output.
	Temperature param.Opt[float64] `json:"temperature,omitzero"`
	// An integer that's used to limit the number of choices for the next predicted
	// word or token. It specifies the maximum number of tokens to consider at each
	// step, based on their probability of occurrence. This technique helps to speed up
	// the generation process and can improve the quality of the generated text by
	// focusing on the most likely options.
	TopK param.Opt[int64] `json:"top_k,omitzero"`
	// A percentage (also called the nucleus parameter) that's used to dynamically
	// adjust the number of choices for each predicted token based on the cumulative
	// probabilities. It specifies a probability threshold below which all less likely
	// tokens are filtered out. This technique helps maintain diversity and generate
	// more fluent and natural-sounding text.
	TopP param.Opt[float64] `json:"top_p,omitzero"`
	// Adjusts the likelihood of specific tokens appearing in the generated output.
	LogitBias map[string]float64 `json:"logit_bias,omitzero"`
	// The name of the moderation model used to validate tokens. Choose from the
	// available moderation models found
	// [here](https://docs.together.ai/docs/inference-models#moderation-models).
	SafetyModel CompletionNewParamsSafetyModel `json:"safety_model,omitzero"`
	// A list of string sequences that truncate (stop) inference text output. For
	// example, "</s>" stops generation as soon as the model generates the given token.
	Stop []string `json:"stop,omitzero"`
	// contains filtered or unexported fields
}

func (CompletionNewParams) MarshalJSON

func (r CompletionNewParams) MarshalJSON() (data []byte, err error)

func (*CompletionNewParams) UnmarshalJSON

func (r *CompletionNewParams) UnmarshalJSON(data []byte) error

type CompletionNewParamsModel

type CompletionNewParamsModel string

The name of the model to query.

[See all of Together AI's chat models](https://docs.together.ai/docs/serverless-models#chat-models)

const (
	CompletionNewParamsModelMetaLlamaLlama2_70bHf    CompletionNewParamsModel = "meta-llama/Llama-2-70b-hf"
	CompletionNewParamsModelMistralaiMistral7BV0_1   CompletionNewParamsModel = "mistralai/Mistral-7B-v0.1"
	CompletionNewParamsModelMistralaiMixtral8x7BV0_1 CompletionNewParamsModel = "mistralai/Mixtral-8x7B-v0.1"
	CompletionNewParamsModelMetaLlamaLlamaGuard7b    CompletionNewParamsModel = "Meta-Llama/Llama-Guard-7b"
)

type CompletionNewParamsSafetyModel

type CompletionNewParamsSafetyModel string

The name of the moderation model used to validate tokens. Choose from the available moderation models found [here](https://docs.together.ai/docs/inference-models#moderation-models).

const (
	CompletionNewParamsSafetyModelMetaLlamaLlamaGuard7b CompletionNewParamsSafetyModel = "Meta-Llama/Llama-Guard-7b"
)

type CompletionService

type CompletionService struct {
	Options []option.RequestOption
}

CompletionService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCompletionService method instead.

func NewCompletionService

func NewCompletionService(opts ...option.RequestOption) (r CompletionService)

NewCompletionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*CompletionService) New

Generate text completions for a given prompt using a language, code, or image model.

func (*CompletionService) NewStreaming

Generate text completions for a given prompt using a language, code, or image model.

type DedicatedEndpoint

type DedicatedEndpoint struct {
	// Unique identifier for the endpoint
	ID string `json:"id" api:"required"`
	// Configuration for automatic scaling of the endpoint
	Autoscaling Autoscaling `json:"autoscaling" api:"required"`
	// Timestamp when the endpoint was created
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Human-readable name for the endpoint
	DisplayName string `json:"display_name" api:"required"`
	// The hardware configuration used for this endpoint
	Hardware string `json:"hardware" api:"required"`
	// The model deployed on this endpoint
	Model string `json:"model" api:"required"`
	// System name for the endpoint
	Name string `json:"name" api:"required"`
	// The object type, which is always `endpoint`.
	Object constant.Endpoint `json:"object" default:"endpoint"`
	// The owner of this endpoint
	Owner string `json:"owner" api:"required"`
	// Current state of the endpoint
	//
	// Any of "PENDING", "STARTING", "STARTED", "STOPPING", "STOPPED", "ERROR".
	State DedicatedEndpointState `json:"state" api:"required"`
	// The type of endpoint
	//
	// Any of "dedicated".
	Type DedicatedEndpointType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Autoscaling respjson.Field
		CreatedAt   respjson.Field
		DisplayName respjson.Field
		Hardware    respjson.Field
		Model       respjson.Field
		Name        respjson.Field
		Object      respjson.Field
		Owner       respjson.Field
		State       respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Details about a dedicated endpoint deployment

func (DedicatedEndpoint) RawJSON

func (r DedicatedEndpoint) RawJSON() string

Returns the unmodified JSON received from the API

func (*DedicatedEndpoint) UnmarshalJSON

func (r *DedicatedEndpoint) UnmarshalJSON(data []byte) error

type DedicatedEndpointState

type DedicatedEndpointState string

Current state of the endpoint

const (
	DedicatedEndpointStatePending  DedicatedEndpointState = "PENDING"
	DedicatedEndpointStateStarting DedicatedEndpointState = "STARTING"
	DedicatedEndpointStateStarted  DedicatedEndpointState = "STARTED"
	DedicatedEndpointStateStopping DedicatedEndpointState = "STOPPING"
	DedicatedEndpointStateStopped  DedicatedEndpointState = "STOPPED"
	DedicatedEndpointStateError    DedicatedEndpointState = "ERROR"
)

type DedicatedEndpointType

type DedicatedEndpointType string

The type of endpoint

const (
	DedicatedEndpointTypeDedicated DedicatedEndpointType = "dedicated"
)

type Deployment added in v0.6.0

type Deployment struct {
	// ID is the unique identifier of the deployment
	ID string `json:"id"`
	// Args are the arguments passed to the container's command
	Args []string `json:"args"`
	// Autoscaling contains autoscaling configuration parameters for this deployment.
	// Omitted when autoscaling is disabled (nil)
	Autoscaling DeploymentAutoscalingUnion `json:"autoscaling"`
	// Command is the entrypoint command run in the container
	Command []string `json:"command"`
	// CPU is the amount of CPU resource allocated to each replica in cores (fractional
	// value is allowed)
	CPU float64 `json:"cpu"`
	// CreatedAt is the ISO8601 timestamp when this deployment was created
	CreatedAt time.Time `json:"created_at" format:"date-time"`
	// Description provides a human-readable explanation of the deployment's purpose or
	// content
	Description string `json:"description"`
	// DesiredReplicas is the number of replicas that the orchestrator is targeting
	DesiredReplicas int64 `json:"desired_replicas"`
	// EnvironmentVariables is a list of environment variables set in the container
	EnvironmentVariables []DeploymentEnvironmentVariable `json:"environment_variables"`
	// GPUCount is the number of GPUs allocated to each replica in this deployment
	GPUCount int64 `json:"gpu_count"`
	// GPUType specifies the type of GPU requested (if any) for this deployment
	//
	// Any of "h100-80gb", "h100-40gb-mig", "h200-140gb", "b200-192gb".
	GPUType DeploymentGPUType `json:"gpu_type"`
	// HealthCheckPath is the HTTP path used for health checks of the application
	HealthCheckPath string `json:"health_check_path"`
	// Image specifies the container image used for this deployment
	Image string `json:"image"`
	// MaxReplicas is the maximum number of replicas to run for this deployment
	MaxReplicas int64 `json:"max_replicas"`
	// Memory is the amount of memory allocated to each replica in GiB (fractional
	// value is allowed)
	Memory float64 `json:"memory"`
	// MinReplicas is the minimum number of replicas to run for this deployment
	MinReplicas int64 `json:"min_replicas"`
	// Name is the name of the deployment
	Name string `json:"name"`
	// The object type, which is always `deployment`.
	//
	// Any of "deployment".
	Object DeploymentObject `json:"object"`
	// Port is the container port that the deployment exposes
	Port int64 `json:"port"`
	// ReadyReplicas is the current number of replicas that are in the Ready state
	ReadyReplicas int64 `json:"ready_replicas"`
	// ReplicaEvents is a mapping of replica names or IDs to their status events
	ReplicaEvents map[string]DeploymentReplicaEvent `json:"replica_events"`
	// Status represents the overall status of the deployment (e.g., Updating, Scaling,
	// Ready, Failed)
	//
	// Any of "Updating", "Scaling", "Ready", "Failed", "ScaledToZero".
	Status DeploymentStatus `json:"status"`
	// Storage is the amount of storage (in MB or units as defined by the platform)
	// allocated to each replica
	Storage int64 `json:"storage"`
	// TerminationGracePeriodSeconds is the time in seconds to wait for graceful
	// shutdown before forcefully terminating the replica
	TerminationGracePeriodSeconds int64 `json:"termination_grace_period_seconds"`
	// UpdatedAt is the ISO8601 timestamp when this deployment was last updated
	UpdatedAt time.Time `json:"updated_at" format:"date-time"`
	// Volumes is a list of volume mounts for this deployment
	Volumes []DeploymentVolume `json:"volumes"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                            respjson.Field
		Args                          respjson.Field
		Autoscaling                   respjson.Field
		Command                       respjson.Field
		CPU                           respjson.Field
		CreatedAt                     respjson.Field
		Description                   respjson.Field
		DesiredReplicas               respjson.Field
		EnvironmentVariables          respjson.Field
		GPUCount                      respjson.Field
		GPUType                       respjson.Field
		HealthCheckPath               respjson.Field
		Image                         respjson.Field
		MaxReplicas                   respjson.Field
		Memory                        respjson.Field
		MinReplicas                   respjson.Field
		Name                          respjson.Field
		Object                        respjson.Field
		Port                          respjson.Field
		ReadyReplicas                 respjson.Field
		ReplicaEvents                 respjson.Field
		Status                        respjson.Field
		Storage                       respjson.Field
		TerminationGracePeriodSeconds respjson.Field
		UpdatedAt                     respjson.Field
		Volumes                       respjson.Field
		ExtraFields                   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (Deployment) RawJSON added in v0.6.0

func (r Deployment) RawJSON() string

Returns the unmodified JSON received from the API

func (*Deployment) UnmarshalJSON added in v0.6.0

func (r *Deployment) UnmarshalJSON(data []byte) error

type DeploymentAutoscalingCustomMetricAutoscalingConfig added in v0.7.0

type DeploymentAutoscalingCustomMetricAutoscalingConfig struct {
	// CustomMetricName is the Prometheus metric name. Required. Must match
	// [a-zA-Z\_:][a-zA-Z0-9_:]\*
	CustomMetricName string `json:"custom_metric_name"`
	// Metric must be CustomMetric
	//
	// Any of "CustomMetric".
	Metric string `json:"metric"`
	// Target is the threshold value. Default: 500
	Target float64 `json:"target"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CustomMetricName respjson.Field
		Metric           respjson.Field
		Target           respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Autoscaling config for CustomMetric metric

func (DeploymentAutoscalingCustomMetricAutoscalingConfig) RawJSON added in v0.7.0

Returns the unmodified JSON received from the API

func (*DeploymentAutoscalingCustomMetricAutoscalingConfig) UnmarshalJSON added in v0.7.0

type DeploymentAutoscalingHTTPAutoscalingConfig added in v0.7.0

type DeploymentAutoscalingHTTPAutoscalingConfig struct {
	// Metric must be HTTPTotalRequests or HTTPAvgRequestDuration
	//
	// Any of "HTTPTotalRequests", "HTTPAvgRequestDuration".
	Metric string `json:"metric"`
	// Target is the threshold value. Default: 100 for HTTPTotalRequests, 500 (ms) for
	// HTTPAvgRequestDuration
	Target float64 `json:"target"`
	// TimeIntervalMinutes is the rate window in minutes. Default: 10
	TimeIntervalMinutes int64 `json:"time_interval_minutes"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Metric              respjson.Field
		Target              respjson.Field
		TimeIntervalMinutes respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Autoscaling config for HTTPTotalRequests and HTTPAvgRequestDuration metrics

func (DeploymentAutoscalingHTTPAutoscalingConfig) RawJSON added in v0.7.0

Returns the unmodified JSON received from the API

func (*DeploymentAutoscalingHTTPAutoscalingConfig) UnmarshalJSON added in v0.7.0

func (r *DeploymentAutoscalingHTTPAutoscalingConfig) UnmarshalJSON(data []byte) error

type DeploymentAutoscalingQueueAutoscalingConfig added in v0.7.0

type DeploymentAutoscalingQueueAutoscalingConfig struct {
	// Metric must be QueueBacklogPerWorker
	//
	// Any of "QueueBacklogPerWorker".
	Metric string `json:"metric"`
	// Model overrides the model name for queue status lookup. Defaults to the
	// deployment app name
	Model string `json:"model"`
	// Target is the threshold value. Default: 1.01
	Target float64 `json:"target"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Metric      respjson.Field
		Model       respjson.Field
		Target      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Autoscaling config for QueueBacklogPerWorker metric

func (DeploymentAutoscalingQueueAutoscalingConfig) RawJSON added in v0.7.0

Returns the unmodified JSON received from the API

func (*DeploymentAutoscalingQueueAutoscalingConfig) UnmarshalJSON added in v0.7.0

func (r *DeploymentAutoscalingQueueAutoscalingConfig) UnmarshalJSON(data []byte) error

type DeploymentAutoscalingUnion added in v0.7.0

type DeploymentAutoscalingUnion struct {
	Metric string  `json:"metric"`
	Target float64 `json:"target"`
	// This field is from variant [DeploymentAutoscalingHTTPAutoscalingConfig].
	TimeIntervalMinutes int64 `json:"time_interval_minutes"`
	// This field is from variant [DeploymentAutoscalingQueueAutoscalingConfig].
	Model string `json:"model"`
	// This field is from variant [DeploymentAutoscalingCustomMetricAutoscalingConfig].
	CustomMetricName string `json:"custom_metric_name"`
	JSON             struct {
		Metric              respjson.Field
		Target              respjson.Field
		TimeIntervalMinutes respjson.Field
		Model               respjson.Field
		CustomMetricName    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

DeploymentAutoscalingUnion contains all possible properties and values from DeploymentAutoscalingHTTPAutoscalingConfig, DeploymentAutoscalingQueueAutoscalingConfig, DeploymentAutoscalingCustomMetricAutoscalingConfig.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (DeploymentAutoscalingUnion) AsDeploymentAutoscalingCustomMetricAutoscalingConfig added in v0.7.0

func (u DeploymentAutoscalingUnion) AsDeploymentAutoscalingCustomMetricAutoscalingConfig() (v DeploymentAutoscalingCustomMetricAutoscalingConfig)

func (DeploymentAutoscalingUnion) AsDeploymentAutoscalingHTTPAutoscalingConfig added in v0.7.0

func (u DeploymentAutoscalingUnion) AsDeploymentAutoscalingHTTPAutoscalingConfig() (v DeploymentAutoscalingHTTPAutoscalingConfig)

func (DeploymentAutoscalingUnion) AsDeploymentAutoscalingQueueAutoscalingConfig added in v0.7.0

func (u DeploymentAutoscalingUnion) AsDeploymentAutoscalingQueueAutoscalingConfig() (v DeploymentAutoscalingQueueAutoscalingConfig)

func (DeploymentAutoscalingUnion) RawJSON added in v0.7.0

func (u DeploymentAutoscalingUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*DeploymentAutoscalingUnion) UnmarshalJSON added in v0.7.0

func (r *DeploymentAutoscalingUnion) UnmarshalJSON(data []byte) error

type DeploymentEnvironmentVariable added in v0.6.0

type DeploymentEnvironmentVariable struct {
	// Name is the environment variable name (e.g., "DATABASE_URL"). Must start with a
	// letter or underscore, followed by letters, numbers, or underscores
	Name string `json:"name" api:"required"`
	// Value is the plain text value for the environment variable. Use this for
	// non-sensitive values. Either Value or ValueFromSecret must be set, but not both
	Value string `json:"value"`
	// ValueFromSecret references a secret by name or ID to use as the value. Use this
	// for sensitive values like API keys or passwords. Either Value or ValueFromSecret
	// must be set, but not both
	ValueFromSecret string `json:"value_from_secret"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Name            respjson.Field
		Value           respjson.Field
		ValueFromSecret respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (DeploymentEnvironmentVariable) RawJSON added in v0.6.0

Returns the unmodified JSON received from the API

func (*DeploymentEnvironmentVariable) UnmarshalJSON added in v0.6.0

func (r *DeploymentEnvironmentVariable) UnmarshalJSON(data []byte) error

type DeploymentGPUType added in v0.6.0

type DeploymentGPUType string

GPUType specifies the type of GPU requested (if any) for this deployment

const (
	DeploymentGPUTypeH100_80gb    DeploymentGPUType = "h100-80gb"
	DeploymentGPUTypeH100_40gbMig DeploymentGPUType = "h100-40gb-mig"
	DeploymentGPUTypeH200_140gb   DeploymentGPUType = "h200-140gb"
	DeploymentGPUTypeB200_192gb   DeploymentGPUType = "b200-192gb"
)

type DeploymentLogs added in v0.6.0

type DeploymentLogs struct {
	Lines []string `json:"lines"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Lines       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (DeploymentLogs) RawJSON added in v0.6.0

func (r DeploymentLogs) RawJSON() string

Returns the unmodified JSON received from the API

func (*DeploymentLogs) UnmarshalJSON added in v0.6.0

func (r *DeploymentLogs) UnmarshalJSON(data []byte) error

type DeploymentObject added in v0.7.0

type DeploymentObject string

The object type, which is always `deployment`.

const (
	DeploymentObjectDeployment DeploymentObject = "deployment"
)

type DeploymentReplicaEvent added in v0.6.0

type DeploymentReplicaEvent struct {
	// Image is the container image used for this replica
	Image string `json:"image"`
	// ReplicaReadySince is the timestamp when the replica became ready to serve
	// traffic
	ReplicaReadySince string `json:"replica_ready_since"`
	// ReplicaStatus is the current status of the replica (e.g., "Running", "Waiting",
	// "Terminated")
	ReplicaStatus string `json:"replica_status"`
	// ReplicaStatusMessage provides a human-readable message explaining the replica's
	// status
	ReplicaStatusMessage string `json:"replica_status_message"`
	// ReplicaStatusReason provides a brief machine-readable reason for the replica's
	// status
	ReplicaStatusReason string `json:"replica_status_reason"`
	// RevisionID is the deployment revision ID associated with this replica
	RevisionID string `json:"revision_id"`
	// VolumePreloadCompletedAt is the timestamp when the volume preload completed
	VolumePreloadCompletedAt string `json:"volume_preload_completed_at"`
	// VolumePreloadStartedAt is the timestamp when the volume preload started
	VolumePreloadStartedAt string `json:"volume_preload_started_at"`
	// VolumePreloadStatus is the status of the volume preload (e.g., "InProgress",
	// "Completed", "Failed")
	VolumePreloadStatus string `json:"volume_preload_status"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Image                    respjson.Field
		ReplicaReadySince        respjson.Field
		ReplicaStatus            respjson.Field
		ReplicaStatusMessage     respjson.Field
		ReplicaStatusReason      respjson.Field
		RevisionID               respjson.Field
		VolumePreloadCompletedAt respjson.Field
		VolumePreloadStartedAt   respjson.Field
		VolumePreloadStatus      respjson.Field
		ExtraFields              map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (DeploymentReplicaEvent) RawJSON added in v0.6.0

func (r DeploymentReplicaEvent) RawJSON() string

Returns the unmodified JSON received from the API

func (*DeploymentReplicaEvent) UnmarshalJSON added in v0.6.0

func (r *DeploymentReplicaEvent) UnmarshalJSON(data []byte) error

type DeploymentStatus added in v0.6.0

type DeploymentStatus string

Status represents the overall status of the deployment (e.g., Updating, Scaling, Ready, Failed)

const (
	DeploymentStatusUpdating     DeploymentStatus = "Updating"
	DeploymentStatusScaling      DeploymentStatus = "Scaling"
	DeploymentStatusReady        DeploymentStatus = "Ready"
	DeploymentStatusFailed       DeploymentStatus = "Failed"
	DeploymentStatusScaledToZero DeploymentStatus = "ScaledToZero"
)

type DeploymentVolume added in v0.6.0

type DeploymentVolume struct {
	// MountPath is the path in the container where the volume mounts (e.g., "/data").
	MountPath string `json:"mount_path" api:"required"`
	// Name is the name of the volume to mount. Must reference an existing volume by
	// name or ID
	Name string `json:"name" api:"required"`
	// Version is the volume version to mount. On create, defaults to the latest
	// version. On update, defaults to the currently mounted version.
	Version int64 `json:"version"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MountPath   respjson.Field
		Name        respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (DeploymentVolume) RawJSON added in v0.6.0

func (r DeploymentVolume) RawJSON() string

Returns the unmodified JSON received from the API

func (*DeploymentVolume) UnmarshalJSON added in v0.6.0

func (r *DeploymentVolume) UnmarshalJSON(data []byte) error

type Embedding

type Embedding struct {
	Data  []EmbeddingData `json:"data" api:"required"`
	Model string          `json:"model" api:"required"`
	// The object type, which is always `list`.
	Object constant.List `json:"object" default:"list"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Model       respjson.Field
		Object      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (Embedding) RawJSON

func (r Embedding) RawJSON() string

Returns the unmodified JSON received from the API

func (*Embedding) UnmarshalJSON

func (r *Embedding) UnmarshalJSON(data []byte) error

type EmbeddingData

type EmbeddingData struct {
	Embedding []float64 `json:"embedding" api:"required"`
	Index     int64     `json:"index" api:"required"`
	// The object type, which is always `embedding`.
	Object constant.Embedding `json:"object" default:"embedding"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Embedding   respjson.Field
		Index       respjson.Field
		Object      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (EmbeddingData) RawJSON

func (r EmbeddingData) RawJSON() string

Returns the unmodified JSON received from the API

func (*EmbeddingData) UnmarshalJSON

func (r *EmbeddingData) UnmarshalJSON(data []byte) error

type EmbeddingNewParams

type EmbeddingNewParams struct {
	// A string providing the text for the model to embed.
	Input EmbeddingNewParamsInputUnion `json:"input,omitzero" api:"required"`
	// The name of the embedding model to use.
	//
	// [See all of Together AI's embedding models](https://docs.together.ai/docs/serverless-models#embedding-models)
	Model EmbeddingNewParamsModel `json:"model,omitzero" api:"required"`
	// contains filtered or unexported fields
}

func (EmbeddingNewParams) MarshalJSON

func (r EmbeddingNewParams) MarshalJSON() (data []byte, err error)

func (*EmbeddingNewParams) UnmarshalJSON

func (r *EmbeddingNewParams) UnmarshalJSON(data []byte) error

type EmbeddingNewParamsInputUnion

type EmbeddingNewParamsInputUnion struct {
	OfString      param.Opt[string] `json:",omitzero,inline"`
	OfStringArray []string          `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (EmbeddingNewParamsInputUnion) MarshalJSON

func (u EmbeddingNewParamsInputUnion) MarshalJSON() ([]byte, error)

func (*EmbeddingNewParamsInputUnion) UnmarshalJSON

func (u *EmbeddingNewParamsInputUnion) UnmarshalJSON(data []byte) error

type EmbeddingNewParamsModel

type EmbeddingNewParamsModel string

The name of the embedding model to use.

[See all of Together AI's embedding models](https://docs.together.ai/docs/serverless-models#embedding-models)

const (
	EmbeddingNewParamsModelWhereIsAIUaeLargeV1                  EmbeddingNewParamsModel = "WhereIsAI/UAE-Large-V1"
	EmbeddingNewParamsModelBaaiBgeLargeEnV1_5                   EmbeddingNewParamsModel = "BAAI/bge-large-en-v1.5"
	EmbeddingNewParamsModelBaaiBgeBaseEnV1_5                    EmbeddingNewParamsModel = "BAAI/bge-base-en-v1.5"
	EmbeddingNewParamsModelTogethercomputerM2Bert80M8kRetrieval EmbeddingNewParamsModel = "togethercomputer/m2-bert-80M-8k-retrieval"
)

type EmbeddingService

type EmbeddingService struct {
	Options []option.RequestOption
}

EmbeddingService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEmbeddingService method instead.

func NewEmbeddingService

func NewEmbeddingService(opts ...option.RequestOption) (r EmbeddingService)

NewEmbeddingService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*EmbeddingService) New

func (r *EmbeddingService) New(ctx context.Context, body EmbeddingNewParams, opts ...option.RequestOption) (res *Embedding, err error)

Generate vector embeddings for one or more text inputs. Returns numerical arrays representing semantic meaning, useful for search, classification, and retrieval.

type EndpointListAvzonesResponse

type EndpointListAvzonesResponse struct {
	Avzones []string `json:"avzones" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Avzones     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

List of unique availability zones

func (EndpointListAvzonesResponse) RawJSON

func (r EndpointListAvzonesResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*EndpointListAvzonesResponse) UnmarshalJSON

func (r *EndpointListAvzonesResponse) UnmarshalJSON(data []byte) error

type EndpointListHardwareParams added in v0.6.0

type EndpointListHardwareParams struct {
	// Filter hardware configurations by model compatibility. When provided, the
	// response includes availability status for each compatible configuration.
	// [See all of Together AI's dedicated models](https://docs.together.ai/docs/dedicated-models)
	Model param.Opt[string] `query:"model,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (EndpointListHardwareParams) URLQuery added in v0.6.0

func (r EndpointListHardwareParams) URLQuery() (v url.Values, err error)

URLQuery serializes EndpointListHardwareParams's query parameters as `url.Values`.

type EndpointListHardwareResponse added in v0.6.0

type EndpointListHardwareResponse struct {
	Data []EndpointListHardwareResponseData `json:"data" api:"required"`
	// The object type, which is always `list`.
	Object constant.List `json:"object" default:"list"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Object      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (EndpointListHardwareResponse) RawJSON added in v0.6.0

Returns the unmodified JSON received from the API

func (*EndpointListHardwareResponse) UnmarshalJSON added in v0.6.0

func (r *EndpointListHardwareResponse) UnmarshalJSON(data []byte) error

type EndpointListHardwareResponseData added in v0.6.0

type EndpointListHardwareResponseData struct {
	// Unique identifier for the hardware configuration
	ID string `json:"id" api:"required"`
	// The object type, which is always `hardware`.
	Object constant.Hardware `json:"object" default:"hardware"`
	// Pricing details for using an endpoint
	Pricing EndpointListHardwareResponseDataPricing `json:"pricing" api:"required"`
	// Detailed specifications of a hardware configuration
	Specs EndpointListHardwareResponseDataSpecs `json:"specs" api:"required"`
	// Timestamp of when the hardware status was last updated
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// Indicates the current availability status of a hardware configuration
	Availability EndpointListHardwareResponseDataAvailability `json:"availability"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID           respjson.Field
		Object       respjson.Field
		Pricing      respjson.Field
		Specs        respjson.Field
		UpdatedAt    respjson.Field
		Availability respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Hardware configuration details with optional availability status

func (EndpointListHardwareResponseData) RawJSON added in v0.6.0

Returns the unmodified JSON received from the API

func (*EndpointListHardwareResponseData) UnmarshalJSON added in v0.6.0

func (r *EndpointListHardwareResponseData) UnmarshalJSON(data []byte) error

type EndpointListHardwareResponseDataAvailability added in v0.6.0

type EndpointListHardwareResponseDataAvailability struct {
	// The availability status of the hardware configuration
	//
	// Any of "available", "unavailable", "insufficient".
	Status string `json:"status" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Indicates the current availability status of a hardware configuration

func (EndpointListHardwareResponseDataAvailability) RawJSON added in v0.6.0

Returns the unmodified JSON received from the API

func (*EndpointListHardwareResponseDataAvailability) UnmarshalJSON added in v0.6.0

func (r *EndpointListHardwareResponseDataAvailability) UnmarshalJSON(data []byte) error

type EndpointListHardwareResponseDataPricing added in v0.6.0

type EndpointListHardwareResponseDataPricing struct {
	// Cost per minute of endpoint uptime in cents
	CentsPerMinute float64 `json:"cents_per_minute" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CentsPerMinute respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Pricing details for using an endpoint

func (EndpointListHardwareResponseDataPricing) RawJSON added in v0.6.0

Returns the unmodified JSON received from the API

func (*EndpointListHardwareResponseDataPricing) UnmarshalJSON added in v0.6.0

func (r *EndpointListHardwareResponseDataPricing) UnmarshalJSON(data []byte) error

type EndpointListHardwareResponseDataSpecs added in v0.6.0

type EndpointListHardwareResponseDataSpecs struct {
	// Number of GPUs in this configuration
	GPUCount int64 `json:"gpu_count" api:"required"`
	// The GPU interconnect technology
	GPULink string `json:"gpu_link" api:"required"`
	// Amount of GPU memory in GB
	GPUMemory float64 `json:"gpu_memory" api:"required"`
	// The type/model of GPU
	GPUType string `json:"gpu_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		GPUCount    respjson.Field
		GPULink     respjson.Field
		GPUMemory   respjson.Field
		GPUType     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Detailed specifications of a hardware configuration

func (EndpointListHardwareResponseDataSpecs) RawJSON added in v0.6.0

Returns the unmodified JSON received from the API

func (*EndpointListHardwareResponseDataSpecs) UnmarshalJSON added in v0.6.0

func (r *EndpointListHardwareResponseDataSpecs) UnmarshalJSON(data []byte) error

type EndpointListParams

type EndpointListParams struct {
	// If true, return only endpoints owned by the caller
	Mine param.Opt[bool] `query:"mine,omitzero" json:"-"`
	// Filter endpoints by type
	//
	// Any of "dedicated", "serverless".
	Type EndpointListParamsType `query:"type,omitzero" json:"-"`
	// Filter endpoints by usage type
	//
	// Any of "on-demand", "reserved".
	UsageType EndpointListParamsUsageType `query:"usage_type,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (EndpointListParams) URLQuery

func (r EndpointListParams) URLQuery() (v url.Values, err error)

URLQuery serializes EndpointListParams's query parameters as `url.Values`.

type EndpointListParamsType

type EndpointListParamsType string

Filter endpoints by type

const (
	EndpointListParamsTypeDedicated  EndpointListParamsType = "dedicated"
	EndpointListParamsTypeServerless EndpointListParamsType = "serverless"
)

type EndpointListParamsUsageType

type EndpointListParamsUsageType string

Filter endpoints by usage type

const (
	EndpointListParamsUsageTypeOnDemand EndpointListParamsUsageType = "on-demand"
	EndpointListParamsUsageTypeReserved EndpointListParamsUsageType = "reserved"
)

type EndpointListResponse

type EndpointListResponse struct {
	Data []EndpointListResponseData `json:"data" api:"required"`
	// The object type, which is always `list`.
	Object constant.List `json:"object" default:"list"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Object      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (EndpointListResponse) RawJSON

func (r EndpointListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*EndpointListResponse) UnmarshalJSON

func (r *EndpointListResponse) UnmarshalJSON(data []byte) error

type EndpointListResponseData

type EndpointListResponseData struct {
	// Unique identifier for the endpoint
	ID string `json:"id" api:"required"`
	// Timestamp when the endpoint was created
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// The model deployed on this endpoint
	Model string `json:"model" api:"required"`
	// System name for the endpoint
	Name string `json:"name" api:"required"`
	// The object type, which is always `endpoint`.
	Object constant.Endpoint `json:"object" default:"endpoint"`
	// The owner of this endpoint
	Owner string `json:"owner" api:"required"`
	// Current state of the endpoint
	//
	// Any of "PENDING", "STARTING", "STARTED", "STOPPING", "STOPPED", "ERROR".
	State string `json:"state" api:"required"`
	// The type of endpoint
	//
	// Any of "serverless", "dedicated".
	Type string `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		Model       respjson.Field
		Name        respjson.Field
		Object      respjson.Field
		Owner       respjson.Field
		State       respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Details about an endpoint when listed via the list endpoint

func (EndpointListResponseData) RawJSON

func (r EndpointListResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*EndpointListResponseData) UnmarshalJSON

func (r *EndpointListResponseData) UnmarshalJSON(data []byte) error

type EndpointNewParams

type EndpointNewParams struct {
	// Configuration for automatic scaling of the endpoint
	Autoscaling AutoscalingParam `json:"autoscaling,omitzero" api:"required"`
	// The hardware configuration to use for this endpoint
	Hardware string `json:"hardware" api:"required"`
	// The model to deploy on this endpoint
	Model string `json:"model" api:"required"`
	// The number of minutes of inactivity after which the endpoint stops
	// automatically. Set to null, omit, or set to 0 to disable automatic timeout.
	InactiveTimeout param.Opt[int64] `json:"inactive_timeout,omitzero"`
	// Create the endpoint in a specified availability zone (e.g., us-central-4b)
	AvailabilityZone param.Opt[string] `json:"availability_zone,omitzero"`
	// This parameter is deprecated and no longer has any effect.
	DisablePromptCache param.Opt[bool] `json:"disable_prompt_cache,omitzero"`
	// Whether to disable speculative decoding for this endpoint
	DisableSpeculativeDecoding param.Opt[bool] `json:"disable_speculative_decoding,omitzero"`
	// A human-readable name for the endpoint
	DisplayName param.Opt[string] `json:"display_name,omitzero"`
	// The desired state of the endpoint
	//
	// Any of "STARTED", "STOPPED".
	State EndpointNewParamsState `json:"state,omitzero"`
	// contains filtered or unexported fields
}

func (EndpointNewParams) MarshalJSON

func (r EndpointNewParams) MarshalJSON() (data []byte, err error)

func (*EndpointNewParams) UnmarshalJSON

func (r *EndpointNewParams) UnmarshalJSON(data []byte) error

type EndpointNewParamsState

type EndpointNewParamsState string

The desired state of the endpoint

const (
	EndpointNewParamsStateStarted EndpointNewParamsState = "STARTED"
	EndpointNewParamsStateStopped EndpointNewParamsState = "STOPPED"
)

type EndpointService

type EndpointService struct {
	Options []option.RequestOption
}

EndpointService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEndpointService method instead.

func NewEndpointService

func NewEndpointService(opts ...option.RequestOption) (r EndpointService)

NewEndpointService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*EndpointService) Delete

func (r *EndpointService) Delete(ctx context.Context, endpointID string, opts ...option.RequestOption) (err error)

Permanently deletes an endpoint. This action cannot be undone.

func (*EndpointService) Get

func (r *EndpointService) Get(ctx context.Context, endpointID string, opts ...option.RequestOption) (res *DedicatedEndpoint, err error)

Retrieves details about a specific endpoint, including its current state, configuration, and scaling settings.

func (*EndpointService) List

Returns a list of all endpoints associated with your account. You can filter the results by type (dedicated or serverless).

func (*EndpointService) ListAvzones

func (r *EndpointService) ListAvzones(ctx context.Context, opts ...option.RequestOption) (res *EndpointListAvzonesResponse, err error)

List all available availability zones.

func (*EndpointService) ListHardware added in v0.6.0

Returns a list of available hardware configurations for deploying models. When a model parameter is provided, it returns only hardware configurations compatible with that model, including their current availability status.

func (*EndpointService) New

Creates a new dedicated endpoint for serving models. The endpoint starts automatically after creation. You can deploy any supported model on hardware configurations that meet the model's requirements.

func (*EndpointService) Update

func (r *EndpointService) Update(ctx context.Context, endpointID string, body EndpointUpdateParams, opts ...option.RequestOption) (res *DedicatedEndpoint, err error)

Updates an existing endpoint's configuration. You can modify the display name, autoscaling settings, or change the endpoint's state (start/stop).

type EndpointUpdateParams

type EndpointUpdateParams struct {
	// The number of minutes of inactivity after which the endpoint stops
	// automatically. Set to 0 to disable automatic timeout.
	InactiveTimeout param.Opt[int64] `json:"inactive_timeout,omitzero"`
	// A human-readable name for the endpoint
	DisplayName param.Opt[string] `json:"display_name,omitzero"`
	// New autoscaling configuration for the endpoint
	Autoscaling AutoscalingParam `json:"autoscaling,omitzero"`
	// The desired state of the endpoint
	//
	// Any of "STARTED", "STOPPED".
	State EndpointUpdateParamsState `json:"state,omitzero"`
	// contains filtered or unexported fields
}

func (EndpointUpdateParams) MarshalJSON

func (r EndpointUpdateParams) MarshalJSON() (data []byte, err error)

func (*EndpointUpdateParams) UnmarshalJSON

func (r *EndpointUpdateParams) UnmarshalJSON(data []byte) error

type EndpointUpdateParamsState

type EndpointUpdateParamsState string

The desired state of the endpoint

const (
	EndpointUpdateParamsStateStarted EndpointUpdateParamsState = "STARTED"
	EndpointUpdateParamsStateStopped EndpointUpdateParamsState = "STOPPED"
)

type Error

type Error = apierror.Error

type EvalListParams

type EvalListParams struct {
	// Limit the number of results
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Filter evaluation jobs by status
	Status param.Opt[string] `query:"status,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (EvalListParams) URLQuery

func (r EvalListParams) URLQuery() (v url.Values, err error)

URLQuery serializes EvalListParams's query parameters as `url.Values`.

type EvalNewParams

type EvalNewParams struct {
	// Type-specific parameters for the evaluation
	Parameters EvalNewParamsParametersUnion `json:"parameters,omitzero" api:"required"`
	// The type of evaluation to perform
	//
	// Any of "classify", "score", "compare".
	Type EvalNewParamsType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

func (EvalNewParams) MarshalJSON

func (r EvalNewParams) MarshalJSON() (data []byte, err error)

func (*EvalNewParams) UnmarshalJSON

func (r *EvalNewParams) UnmarshalJSON(data []byte) error

type EvalNewParamsParametersEvaluationClassifyParameters

type EvalNewParamsParametersEvaluationClassifyParameters struct {
	// Data file ID
	InputDataFilePath string                                                   `json:"input_data_file_path" api:"required"`
	Judge             EvalNewParamsParametersEvaluationClassifyParametersJudge `json:"judge,omitzero" api:"required"`
	// List of possible classification labels
	Labels []string `json:"labels,omitzero" api:"required"`
	// List of labels that are considered passing
	PassLabels []string `json:"pass_labels,omitzero" api:"required"`
	// Column name in the input dataset containing pre-generated responses
	ModelToEvaluate EvalNewParamsParametersEvaluationClassifyParametersModelToEvaluateUnion `json:"model_to_evaluate,omitzero"`
	// contains filtered or unexported fields
}

The properties InputDataFilePath, Judge, Labels, PassLabels are required.

func (EvalNewParamsParametersEvaluationClassifyParameters) MarshalJSON

func (r EvalNewParamsParametersEvaluationClassifyParameters) MarshalJSON() (data []byte, err error)

func (*EvalNewParamsParametersEvaluationClassifyParameters) UnmarshalJSON

type EvalNewParamsParametersEvaluationClassifyParametersJudge

type EvalNewParamsParametersEvaluationClassifyParametersJudge struct {
	// Name of the judge model
	Model string `json:"model" api:"required"`
	// Source of the judge model inference: - `serverless`: Together's shared
	// serverless inference API. Default concurrency: 25 workers. - `dedicated`: A
	// Together dedicated deployment endpoint. Default concurrency: 5 workers (minimum
	// enforced even if num_workers is set lower).
	//
	//   - `external`: An external inference API (e.g. OpenAI, Anthropic, Google,
	//     OpenRouter). Requires `external_api_token` and `external_base_url`. Default
	//     concurrency: 2 workers for first-party APIs, 20 for proxy/aggregator
	//     endpoints.
	//
	// Any of "serverless", "dedicated", "external".
	ModelSource string `json:"model_source,omitzero" api:"required"`
	// System prompt template for the judge
	SystemTemplate string `json:"system_template" api:"required"`
	// Bearer/API token for the external judge model provider. Required when
	// model_source is 'external'.
	ExternalAPIToken param.Opt[string] `json:"external_api_token,omitzero"`
	// Base URL of the external inference API for the judge. Must be OpenAI-compatible.
	// Required when model_source is 'external'.
	ExternalBaseURL param.Opt[string] `json:"external_base_url,omitzero"`
	// Maximum number of tokens the judge model may generate. Defaults to 32768 if
	// omitted. Set higher for reasoning judges (e.g. o-series, Gemini) that spend
	// tokens on internal chain-of-thought before emitting the verdict JSON.
	MaxTokens param.Opt[int64] `json:"max_tokens,omitzero"`
	// Number of concurrent inference workers for the judge. Overrides the
	// source-specific default (serverless: 25, dedicated: 5, external: 2–20). For
	// dedicated endpoints the value is clamped to a minimum of 5 regardless of what is
	// set here.
	NumWorkers param.Opt[int64] `json:"num_workers,omitzero"`
	// Sampling temperature for the judge model. Defaults to 0.05 if omitted.
	Temperature param.Opt[float64] `json:"temperature,omitzero"`
	// contains filtered or unexported fields
}

The properties Model, ModelSource, SystemTemplate are required.

func (EvalNewParamsParametersEvaluationClassifyParametersJudge) MarshalJSON

func (*EvalNewParamsParametersEvaluationClassifyParametersJudge) UnmarshalJSON

type EvalNewParamsParametersEvaluationClassifyParametersModelToEvaluateEvaluationModelRequest

type EvalNewParamsParametersEvaluationClassifyParametersModelToEvaluateEvaluationModelRequest struct {
	// User message template. Supports Jinja2 variables referencing dataset columns.
	InputTemplate string `json:"input_template" api:"required"`
	// Maximum number of tokens to generate.
	MaxTokens int64 `json:"max_tokens" api:"required"`
	// Name of the model to evaluate
	Model string `json:"model" api:"required"`
	// Source of the model inference: - `serverless`: Together's shared serverless
	// inference API. Default concurrency: 25 workers. - `dedicated`: A Together
	// dedicated deployment endpoint. Default concurrency: 5 workers (minimum enforced
	// even if num_workers is set lower). Authentication uses the requesting user's
	// Together API token automatically.
	//
	//   - `external`: An external inference API (e.g. OpenAI, Anthropic, Google,
	//     OpenRouter). Requires `external_api_token` and `external_base_url`. Default
	//     concurrency: 2 workers for first-party APIs (OpenAI, Anthropic, Google), 20
	//     for proxy/aggregator endpoints.
	//
	// Any of "serverless", "dedicated", "external".
	ModelSource string `json:"model_source,omitzero" api:"required"`
	// System prompt template. Supports Jinja2 variables referencing dataset columns.
	SystemTemplate string `json:"system_template" api:"required"`
	// Sampling temperature for generation.
	Temperature float64 `json:"temperature" api:"required"`
	// Bearer/API token for the external model provider. Required when model_source is
	// 'external'.
	ExternalAPIToken param.Opt[string] `json:"external_api_token,omitzero"`
	// Base URL of the external inference API. Must be OpenAI-compatible. Required when
	// model_source is 'external'.
	ExternalBaseURL param.Opt[string] `json:"external_base_url,omitzero"`
	// Number of concurrent inference workers. Overrides the source-specific default
	// (serverless: 25, dedicated: 5, external: 2–20). For dedicated endpoints the
	// value is clamped to a minimum of 5 regardless of what is set here.
	NumWorkers param.Opt[int64] `json:"num_workers,omitzero"`
	// contains filtered or unexported fields
}

The properties InputTemplate, MaxTokens, Model, ModelSource, SystemTemplate, Temperature are required.

func (EvalNewParamsParametersEvaluationClassifyParametersModelToEvaluateEvaluationModelRequest) MarshalJSON

func (*EvalNewParamsParametersEvaluationClassifyParametersModelToEvaluateEvaluationModelRequest) UnmarshalJSON

type EvalNewParamsParametersEvaluationClassifyParametersModelToEvaluateUnion

type EvalNewParamsParametersEvaluationClassifyParametersModelToEvaluateUnion struct {
	OfString                                                                              param.Opt[string]                                                                         `json:",omitzero,inline"`
	OfEvalNewsParametersEvaluationClassifyParametersModelToEvaluateEvaluationModelRequest *EvalNewParamsParametersEvaluationClassifyParametersModelToEvaluateEvaluationModelRequest `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (EvalNewParamsParametersEvaluationClassifyParametersModelToEvaluateUnion) MarshalJSON

func (*EvalNewParamsParametersEvaluationClassifyParametersModelToEvaluateUnion) UnmarshalJSON

type EvalNewParamsParametersEvaluationCompareParameters

type EvalNewParamsParametersEvaluationCompareParameters struct {
	// Data file ID
	InputDataFilePath string                                                  `json:"input_data_file_path" api:"required"`
	Judge             EvalNewParamsParametersEvaluationCompareParametersJudge `json:"judge,omitzero" api:"required"`
	// When false (default), the judge runs twice per sample: once with model A's
	// response first (original order) and once with model B's response first (flipped
	// order). The two verdicts are reconciled to cancel out position bias. When true,
	// only the original-order pass is run, halving judge cost and latency at the
	// expense of position-bias correction. The result file will not contain
	// flipped-order judge fields when this is true.
	DisablePositionBiasCorrection param.Opt[bool] `json:"disable_position_bias_correction,omitzero"`
	// Either an EvaluationModelRequest for generation or a string column name from the
	// dataset (when responses are pre-generated). When both model_a and model_b are
	// EvaluationModelRequest objects, their inference runs execute in parallel to
	// reduce total wall-clock time.
	ModelA EvalNewParamsParametersEvaluationCompareParametersModelAUnion `json:"model_a,omitzero"`
	// Either an EvaluationModelRequest for generation or a string column name from the
	// dataset (when responses are pre-generated). When both model_a and model_b are
	// EvaluationModelRequest objects, their inference runs execute in parallel to
	// reduce total wall-clock time.
	ModelB EvalNewParamsParametersEvaluationCompareParametersModelBUnion `json:"model_b,omitzero"`
	// contains filtered or unexported fields
}

The properties InputDataFilePath, Judge are required.

func (EvalNewParamsParametersEvaluationCompareParameters) MarshalJSON

func (r EvalNewParamsParametersEvaluationCompareParameters) MarshalJSON() (data []byte, err error)

func (*EvalNewParamsParametersEvaluationCompareParameters) UnmarshalJSON

type EvalNewParamsParametersEvaluationCompareParametersJudge

type EvalNewParamsParametersEvaluationCompareParametersJudge struct {
	// Name of the judge model
	Model string `json:"model" api:"required"`
	// Source of the judge model inference: - `serverless`: Together's shared
	// serverless inference API. Default concurrency: 25 workers. - `dedicated`: A
	// Together dedicated deployment endpoint. Default concurrency: 5 workers (minimum
	// enforced even if num_workers is set lower).
	//
	//   - `external`: An external inference API (e.g. OpenAI, Anthropic, Google,
	//     OpenRouter). Requires `external_api_token` and `external_base_url`. Default
	//     concurrency: 2 workers for first-party APIs, 20 for proxy/aggregator
	//     endpoints.
	//
	// Any of "serverless", "dedicated", "external".
	ModelSource string `json:"model_source,omitzero" api:"required"`
	// System prompt template for the judge
	SystemTemplate string `json:"system_template" api:"required"`
	// Bearer/API token for the external judge model provider. Required when
	// model_source is 'external'.
	ExternalAPIToken param.Opt[string] `json:"external_api_token,omitzero"`
	// Base URL of the external inference API for the judge. Must be OpenAI-compatible.
	// Required when model_source is 'external'.
	ExternalBaseURL param.Opt[string] `json:"external_base_url,omitzero"`
	// Maximum number of tokens the judge model may generate. Defaults to 32768 if
	// omitted. Set higher for reasoning judges (e.g. o-series, Gemini) that spend
	// tokens on internal chain-of-thought before emitting the verdict JSON.
	MaxTokens param.Opt[int64] `json:"max_tokens,omitzero"`
	// Number of concurrent inference workers for the judge. Overrides the
	// source-specific default (serverless: 25, dedicated: 5, external: 2–20). For
	// dedicated endpoints the value is clamped to a minimum of 5 regardless of what is
	// set here.
	NumWorkers param.Opt[int64] `json:"num_workers,omitzero"`
	// Sampling temperature for the judge model. Defaults to 0.05 if omitted.
	Temperature param.Opt[float64] `json:"temperature,omitzero"`
	// contains filtered or unexported fields
}

The properties Model, ModelSource, SystemTemplate are required.

func (EvalNewParamsParametersEvaluationCompareParametersJudge) MarshalJSON

func (*EvalNewParamsParametersEvaluationCompareParametersJudge) UnmarshalJSON

type EvalNewParamsParametersEvaluationCompareParametersModelAEvaluationModelRequest

type EvalNewParamsParametersEvaluationCompareParametersModelAEvaluationModelRequest struct {
	// User message template. Supports Jinja2 variables referencing dataset columns.
	InputTemplate string `json:"input_template" api:"required"`
	// Maximum number of tokens to generate.
	MaxTokens int64 `json:"max_tokens" api:"required"`
	// Name of the model to evaluate
	Model string `json:"model" api:"required"`
	// Source of the model inference: - `serverless`: Together's shared serverless
	// inference API. Default concurrency: 25 workers. - `dedicated`: A Together
	// dedicated deployment endpoint. Default concurrency: 5 workers (minimum enforced
	// even if num_workers is set lower). Authentication uses the requesting user's
	// Together API token automatically.
	//
	//   - `external`: An external inference API (e.g. OpenAI, Anthropic, Google,
	//     OpenRouter). Requires `external_api_token` and `external_base_url`. Default
	//     concurrency: 2 workers for first-party APIs (OpenAI, Anthropic, Google), 20
	//     for proxy/aggregator endpoints.
	//
	// Any of "serverless", "dedicated", "external".
	ModelSource string `json:"model_source,omitzero" api:"required"`
	// System prompt template. Supports Jinja2 variables referencing dataset columns.
	SystemTemplate string `json:"system_template" api:"required"`
	// Sampling temperature for generation.
	Temperature float64 `json:"temperature" api:"required"`
	// Bearer/API token for the external model provider. Required when model_source is
	// 'external'.
	ExternalAPIToken param.Opt[string] `json:"external_api_token,omitzero"`
	// Base URL of the external inference API. Must be OpenAI-compatible. Required when
	// model_source is 'external'.
	ExternalBaseURL param.Opt[string] `json:"external_base_url,omitzero"`
	// Number of concurrent inference workers. Overrides the source-specific default
	// (serverless: 25, dedicated: 5, external: 2–20). For dedicated endpoints the
	// value is clamped to a minimum of 5 regardless of what is set here.
	NumWorkers param.Opt[int64] `json:"num_workers,omitzero"`
	// contains filtered or unexported fields
}

The properties InputTemplate, MaxTokens, Model, ModelSource, SystemTemplate, Temperature are required.

func (EvalNewParamsParametersEvaluationCompareParametersModelAEvaluationModelRequest) MarshalJSON

func (*EvalNewParamsParametersEvaluationCompareParametersModelAEvaluationModelRequest) UnmarshalJSON

type EvalNewParamsParametersEvaluationCompareParametersModelAUnion

type EvalNewParamsParametersEvaluationCompareParametersModelAUnion struct {
	OfEvalNewsParametersEvaluationCompareParametersModelAEvaluationModelRequest *EvalNewParamsParametersEvaluationCompareParametersModelAEvaluationModelRequest `json:",omitzero,inline"`
	OfString                                                                    param.Opt[string]                                                               `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (EvalNewParamsParametersEvaluationCompareParametersModelAUnion) MarshalJSON

func (*EvalNewParamsParametersEvaluationCompareParametersModelAUnion) UnmarshalJSON

type EvalNewParamsParametersEvaluationCompareParametersModelBEvaluationModelRequest

type EvalNewParamsParametersEvaluationCompareParametersModelBEvaluationModelRequest struct {
	// User message template. Supports Jinja2 variables referencing dataset columns.
	InputTemplate string `json:"input_template" api:"required"`
	// Maximum number of tokens to generate.
	MaxTokens int64 `json:"max_tokens" api:"required"`
	// Name of the model to evaluate
	Model string `json:"model" api:"required"`
	// Source of the model inference: - `serverless`: Together's shared serverless
	// inference API. Default concurrency: 25 workers. - `dedicated`: A Together
	// dedicated deployment endpoint. Default concurrency: 5 workers (minimum enforced
	// even if num_workers is set lower). Authentication uses the requesting user's
	// Together API token automatically.
	//
	//   - `external`: An external inference API (e.g. OpenAI, Anthropic, Google,
	//     OpenRouter). Requires `external_api_token` and `external_base_url`. Default
	//     concurrency: 2 workers for first-party APIs (OpenAI, Anthropic, Google), 20
	//     for proxy/aggregator endpoints.
	//
	// Any of "serverless", "dedicated", "external".
	ModelSource string `json:"model_source,omitzero" api:"required"`
	// System prompt template. Supports Jinja2 variables referencing dataset columns.
	SystemTemplate string `json:"system_template" api:"required"`
	// Sampling temperature for generation.
	Temperature float64 `json:"temperature" api:"required"`
	// Bearer/API token for the external model provider. Required when model_source is
	// 'external'.
	ExternalAPIToken param.Opt[string] `json:"external_api_token,omitzero"`
	// Base URL of the external inference API. Must be OpenAI-compatible. Required when
	// model_source is 'external'.
	ExternalBaseURL param.Opt[string] `json:"external_base_url,omitzero"`
	// Number of concurrent inference workers. Overrides the source-specific default
	// (serverless: 25, dedicated: 5, external: 2–20). For dedicated endpoints the
	// value is clamped to a minimum of 5 regardless of what is set here.
	NumWorkers param.Opt[int64] `json:"num_workers,omitzero"`
	// contains filtered or unexported fields
}

The properties InputTemplate, MaxTokens, Model, ModelSource, SystemTemplate, Temperature are required.

func (EvalNewParamsParametersEvaluationCompareParametersModelBEvaluationModelRequest) MarshalJSON

func (*EvalNewParamsParametersEvaluationCompareParametersModelBEvaluationModelRequest) UnmarshalJSON

type EvalNewParamsParametersEvaluationCompareParametersModelBUnion

type EvalNewParamsParametersEvaluationCompareParametersModelBUnion struct {
	OfEvalNewsParametersEvaluationCompareParametersModelBEvaluationModelRequest *EvalNewParamsParametersEvaluationCompareParametersModelBEvaluationModelRequest `json:",omitzero,inline"`
	OfString                                                                    param.Opt[string]                                                               `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (EvalNewParamsParametersEvaluationCompareParametersModelBUnion) MarshalJSON

func (*EvalNewParamsParametersEvaluationCompareParametersModelBUnion) UnmarshalJSON

type EvalNewParamsParametersEvaluationScoreParameters

type EvalNewParamsParametersEvaluationScoreParameters struct {
	// Data file ID
	InputDataFilePath string                                                `json:"input_data_file_path" api:"required"`
	Judge             EvalNewParamsParametersEvaluationScoreParametersJudge `json:"judge,omitzero" api:"required"`
	// Maximum possible score
	MaxScore float64 `json:"max_score" api:"required"`
	// Minimum possible score
	MinScore float64 `json:"min_score" api:"required"`
	// Score threshold for passing
	PassThreshold float64 `json:"pass_threshold" api:"required"`
	// Column name in the input dataset containing pre-generated responses
	ModelToEvaluate EvalNewParamsParametersEvaluationScoreParametersModelToEvaluateUnion `json:"model_to_evaluate,omitzero"`
	// contains filtered or unexported fields
}

The properties InputDataFilePath, Judge, MaxScore, MinScore, PassThreshold are required.

func (EvalNewParamsParametersEvaluationScoreParameters) MarshalJSON

func (r EvalNewParamsParametersEvaluationScoreParameters) MarshalJSON() (data []byte, err error)

func (*EvalNewParamsParametersEvaluationScoreParameters) UnmarshalJSON

type EvalNewParamsParametersEvaluationScoreParametersJudge

type EvalNewParamsParametersEvaluationScoreParametersJudge struct {
	// Name of the judge model
	Model string `json:"model" api:"required"`
	// Source of the judge model inference: - `serverless`: Together's shared
	// serverless inference API. Default concurrency: 25 workers. - `dedicated`: A
	// Together dedicated deployment endpoint. Default concurrency: 5 workers (minimum
	// enforced even if num_workers is set lower).
	//
	//   - `external`: An external inference API (e.g. OpenAI, Anthropic, Google,
	//     OpenRouter). Requires `external_api_token` and `external_base_url`. Default
	//     concurrency: 2 workers for first-party APIs, 20 for proxy/aggregator
	//     endpoints.
	//
	// Any of "serverless", "dedicated", "external".
	ModelSource string `json:"model_source,omitzero" api:"required"`
	// System prompt template for the judge
	SystemTemplate string `json:"system_template" api:"required"`
	// Bearer/API token for the external judge model provider. Required when
	// model_source is 'external'.
	ExternalAPIToken param.Opt[string] `json:"external_api_token,omitzero"`
	// Base URL of the external inference API for the judge. Must be OpenAI-compatible.
	// Required when model_source is 'external'.
	ExternalBaseURL param.Opt[string] `json:"external_base_url,omitzero"`
	// Maximum number of tokens the judge model may generate. Defaults to 32768 if
	// omitted. Set higher for reasoning judges (e.g. o-series, Gemini) that spend
	// tokens on internal chain-of-thought before emitting the verdict JSON.
	MaxTokens param.Opt[int64] `json:"max_tokens,omitzero"`
	// Number of concurrent inference workers for the judge. Overrides the
	// source-specific default (serverless: 25, dedicated: 5, external: 2–20). For
	// dedicated endpoints the value is clamped to a minimum of 5 regardless of what is
	// set here.
	NumWorkers param.Opt[int64] `json:"num_workers,omitzero"`
	// Sampling temperature for the judge model. Defaults to 0.05 if omitted.
	Temperature param.Opt[float64] `json:"temperature,omitzero"`
	// contains filtered or unexported fields
}

The properties Model, ModelSource, SystemTemplate are required.

func (EvalNewParamsParametersEvaluationScoreParametersJudge) MarshalJSON

func (*EvalNewParamsParametersEvaluationScoreParametersJudge) UnmarshalJSON

type EvalNewParamsParametersEvaluationScoreParametersModelToEvaluateEvaluationModelRequest

type EvalNewParamsParametersEvaluationScoreParametersModelToEvaluateEvaluationModelRequest struct {
	// User message template. Supports Jinja2 variables referencing dataset columns.
	InputTemplate string `json:"input_template" api:"required"`
	// Maximum number of tokens to generate.
	MaxTokens int64 `json:"max_tokens" api:"required"`
	// Name of the model to evaluate
	Model string `json:"model" api:"required"`
	// Source of the model inference: - `serverless`: Together's shared serverless
	// inference API. Default concurrency: 25 workers. - `dedicated`: A Together
	// dedicated deployment endpoint. Default concurrency: 5 workers (minimum enforced
	// even if num_workers is set lower). Authentication uses the requesting user's
	// Together API token automatically.
	//
	//   - `external`: An external inference API (e.g. OpenAI, Anthropic, Google,
	//     OpenRouter). Requires `external_api_token` and `external_base_url`. Default
	//     concurrency: 2 workers for first-party APIs (OpenAI, Anthropic, Google), 20
	//     for proxy/aggregator endpoints.
	//
	// Any of "serverless", "dedicated", "external".
	ModelSource string `json:"model_source,omitzero" api:"required"`
	// System prompt template. Supports Jinja2 variables referencing dataset columns.
	SystemTemplate string `json:"system_template" api:"required"`
	// Sampling temperature for generation.
	Temperature float64 `json:"temperature" api:"required"`
	// Bearer/API token for the external model provider. Required when model_source is
	// 'external'.
	ExternalAPIToken param.Opt[string] `json:"external_api_token,omitzero"`
	// Base URL of the external inference API. Must be OpenAI-compatible. Required when
	// model_source is 'external'.
	ExternalBaseURL param.Opt[string] `json:"external_base_url,omitzero"`
	// Number of concurrent inference workers. Overrides the source-specific default
	// (serverless: 25, dedicated: 5, external: 2–20). For dedicated endpoints the
	// value is clamped to a minimum of 5 regardless of what is set here.
	NumWorkers param.Opt[int64] `json:"num_workers,omitzero"`
	// contains filtered or unexported fields
}

The properties InputTemplate, MaxTokens, Model, ModelSource, SystemTemplate, Temperature are required.

func (EvalNewParamsParametersEvaluationScoreParametersModelToEvaluateEvaluationModelRequest) MarshalJSON

func (*EvalNewParamsParametersEvaluationScoreParametersModelToEvaluateEvaluationModelRequest) UnmarshalJSON

type EvalNewParamsParametersEvaluationScoreParametersModelToEvaluateUnion

type EvalNewParamsParametersEvaluationScoreParametersModelToEvaluateUnion struct {
	OfString                                                                           param.Opt[string]                                                                      `json:",omitzero,inline"`
	OfEvalNewsParametersEvaluationScoreParametersModelToEvaluateEvaluationModelRequest *EvalNewParamsParametersEvaluationScoreParametersModelToEvaluateEvaluationModelRequest `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (EvalNewParamsParametersEvaluationScoreParametersModelToEvaluateUnion) MarshalJSON

func (*EvalNewParamsParametersEvaluationScoreParametersModelToEvaluateUnion) UnmarshalJSON

type EvalNewParamsParametersUnion

type EvalNewParamsParametersUnion struct {
	OfEvalNewsParametersEvaluationClassifyParameters *EvalNewParamsParametersEvaluationClassifyParameters `json:",omitzero,inline"`
	OfEvalNewsParametersEvaluationScoreParameters    *EvalNewParamsParametersEvaluationScoreParameters    `json:",omitzero,inline"`
	OfEvalNewsParametersEvaluationCompareParameters  *EvalNewParamsParametersEvaluationCompareParameters  `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (EvalNewParamsParametersUnion) GetDisablePositionBiasCorrection added in v0.10.0

func (u EvalNewParamsParametersUnion) GetDisablePositionBiasCorrection() *bool

Returns a pointer to the underlying variant's property, if present.

func (EvalNewParamsParametersUnion) GetInputDataFilePath

func (u EvalNewParamsParametersUnion) GetInputDataFilePath() *string

Returns a pointer to the underlying variant's property, if present.

func (EvalNewParamsParametersUnion) GetJudge

func (u EvalNewParamsParametersUnion) GetJudge() (res evalNewParamsParametersUnionJudge)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (EvalNewParamsParametersUnion) GetLabels

func (u EvalNewParamsParametersUnion) GetLabels() []string

Returns a pointer to the underlying variant's property, if present.

func (EvalNewParamsParametersUnion) GetMaxScore

func (u EvalNewParamsParametersUnion) GetMaxScore() *float64

Returns a pointer to the underlying variant's property, if present.

func (EvalNewParamsParametersUnion) GetMinScore

func (u EvalNewParamsParametersUnion) GetMinScore() *float64

Returns a pointer to the underlying variant's property, if present.

func (EvalNewParamsParametersUnion) GetModelA

Returns a pointer to the underlying variant's property, if present.

func (EvalNewParamsParametersUnion) GetModelB

Returns a pointer to the underlying variant's property, if present.

func (EvalNewParamsParametersUnion) GetModelToEvaluate

func (u EvalNewParamsParametersUnion) GetModelToEvaluate() (res evalNewParamsParametersUnionModelToEvaluate)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (EvalNewParamsParametersUnion) GetPassLabels

func (u EvalNewParamsParametersUnion) GetPassLabels() []string

Returns a pointer to the underlying variant's property, if present.

func (EvalNewParamsParametersUnion) GetPassThreshold

func (u EvalNewParamsParametersUnion) GetPassThreshold() *float64

Returns a pointer to the underlying variant's property, if present.

func (EvalNewParamsParametersUnion) MarshalJSON

func (u EvalNewParamsParametersUnion) MarshalJSON() ([]byte, error)

func (*EvalNewParamsParametersUnion) UnmarshalJSON

func (u *EvalNewParamsParametersUnion) UnmarshalJSON(data []byte) error

type EvalNewParamsType

type EvalNewParamsType string

The type of evaluation to perform

const (
	EvalNewParamsTypeClassify EvalNewParamsType = "classify"
	EvalNewParamsTypeScore    EvalNewParamsType = "score"
	EvalNewParamsTypeCompare  EvalNewParamsType = "compare"
)

type EvalNewResponse

type EvalNewResponse struct {
	// Initial status of the job
	//
	// Any of "pending".
	Status EvalNewResponseStatus `json:"status"`
	// The ID of the created evaluation job
	WorkflowID string `json:"workflow_id"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Status      respjson.Field
		WorkflowID  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (EvalNewResponse) RawJSON

func (r EvalNewResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*EvalNewResponse) UnmarshalJSON

func (r *EvalNewResponse) UnmarshalJSON(data []byte) error

type EvalNewResponseStatus

type EvalNewResponseStatus string

Initial status of the job

const (
	EvalNewResponseStatusPending EvalNewResponseStatus = "pending"
)

type EvalService

type EvalService struct {
	Options []option.RequestOption
}

EvalService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEvalService method instead.

func NewEvalService

func NewEvalService(opts ...option.RequestOption) (r EvalService)

NewEvalService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*EvalService) Get

func (r *EvalService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *EvaluationJob, err error)

Get evaluation job details

func (*EvalService) List

func (r *EvalService) List(ctx context.Context, query EvalListParams, opts ...option.RequestOption) (res *[]EvaluationJob, err error)

Get all evaluation jobs

func (*EvalService) New

func (r *EvalService) New(ctx context.Context, body EvalNewParams, opts ...option.RequestOption) (res *EvalNewResponse, err error)

Create an evaluation job

func (*EvalService) Status

func (r *EvalService) Status(ctx context.Context, id string, opts ...option.RequestOption) (res *EvalStatusResponse, err error)

Get evaluation job status and results

type EvalStatusResponse

type EvalStatusResponse struct {
	// The results of the evaluation job
	Results EvalStatusResponseResultsUnion `json:"results"`
	// The status of the evaluation job
	//
	// Any of "completed", "error", "user_error", "running", "queued", "pending".
	Status EvalStatusResponseStatus `json:"status"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Results     respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (EvalStatusResponse) RawJSON

func (r EvalStatusResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*EvalStatusResponse) UnmarshalJSON

func (r *EvalStatusResponse) UnmarshalJSON(data []byte) error

type EvalStatusResponseResultsEvaluationClassifyResults

type EvalStatusResponseResultsEvaluationClassifyResults struct {
	// Number of failed generations.
	GenerationFailCount float64 `json:"generation_fail_count" api:"nullable" format:"integer"`
	// Number of invalid labels
	InvalidLabelCount float64 `json:"invalid_label_count" api:"nullable"`
	// Number of failed judge generations
	JudgeFailCount float64 `json:"judge_fail_count" api:"nullable" format:"integer"`
	// JSON string representing label counts
	LabelCounts string `json:"label_counts"`
	// Pecentage of pass labels.
	PassPercentage float64 `json:"pass_percentage" api:"nullable" format:"integer"`
	// Data File ID
	ResultFileID string `json:"result_file_id"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		GenerationFailCount respjson.Field
		InvalidLabelCount   respjson.Field
		JudgeFailCount      respjson.Field
		LabelCounts         respjson.Field
		PassPercentage      respjson.Field
		ResultFileID        respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (EvalStatusResponseResultsEvaluationClassifyResults) RawJSON

Returns the unmodified JSON received from the API

func (*EvalStatusResponseResultsEvaluationClassifyResults) UnmarshalJSON

type EvalStatusResponseResultsEvaluationCompareResults

type EvalStatusResponseResultsEvaluationCompareResults struct {
	// Number of samples where model A was judged the winner
	AWins int64 `json:"A_wins"`
	// Number of samples where model B was judged the winner
	BWins int64 `json:"B_wins"`
	// Number of generation failures across model A and model B.
	GenerationFailCount float64 `json:"generation_fail_count" api:"nullable" format:"integer"`
	// Number of judge inference failures. In the default two-pass mode
	// (disable_position_bias_correction=false) this is the combined failure count from
	// both the original-order and flipped-order judge passes.
	JudgeFailCount float64 `json:"judge_fail_count" api:"nullable" format:"integer"`
	// File ID of the detailed output file. Each row contains the original input fields
	// plus judge outputs. In two-pass mode the file includes both original-order and
	// flipped-order judge fields; in single-pass mode
	// (disable_position_bias_correction=true) only original-order fields are present.
	ResultFileID string `json:"result_file_id"`
	// Number of samples that resulted in a tie
	Ties int64 `json:"Ties"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AWins               respjson.Field
		BWins               respjson.Field
		GenerationFailCount respjson.Field
		JudgeFailCount      respjson.Field
		ResultFileID        respjson.Field
		Ties                respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (EvalStatusResponseResultsEvaluationCompareResults) RawJSON

Returns the unmodified JSON received from the API

func (*EvalStatusResponseResultsEvaluationCompareResults) UnmarshalJSON

type EvalStatusResponseResultsEvaluationScoreResults

type EvalStatusResponseResultsEvaluationScoreResults struct {
	AggregatedScores EvalStatusResponseResultsEvaluationScoreResultsAggregatedScores `json:"aggregated_scores"`
	// number of failed samples generated from model
	FailedSamples float64 `json:"failed_samples" format:"integer"`
	// Number of failed generations.
	GenerationFailCount float64 `json:"generation_fail_count" api:"nullable" format:"integer"`
	// number of invalid scores generated from model
	InvalidScoreCount float64 `json:"invalid_score_count" format:"integer"`
	// Number of failed judge generations
	JudgeFailCount float64 `json:"judge_fail_count" api:"nullable" format:"integer"`
	// Data File ID
	ResultFileID string `json:"result_file_id"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AggregatedScores    respjson.Field
		FailedSamples       respjson.Field
		GenerationFailCount respjson.Field
		InvalidScoreCount   respjson.Field
		JudgeFailCount      respjson.Field
		ResultFileID        respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (EvalStatusResponseResultsEvaluationScoreResults) RawJSON

Returns the unmodified JSON received from the API

func (*EvalStatusResponseResultsEvaluationScoreResults) UnmarshalJSON

type EvalStatusResponseResultsEvaluationScoreResultsAggregatedScores

type EvalStatusResponseResultsEvaluationScoreResultsAggregatedScores struct {
	MeanScore      float64 `json:"mean_score"`
	PassPercentage float64 `json:"pass_percentage"`
	StdScore       float64 `json:"std_score"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MeanScore      respjson.Field
		PassPercentage respjson.Field
		StdScore       respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (EvalStatusResponseResultsEvaluationScoreResultsAggregatedScores) RawJSON

Returns the unmodified JSON received from the API

func (*EvalStatusResponseResultsEvaluationScoreResultsAggregatedScores) UnmarshalJSON

type EvalStatusResponseResultsUnion

type EvalStatusResponseResultsUnion struct {
	GenerationFailCount float64 `json:"generation_fail_count"`
	// This field is from variant [EvalStatusResponseResultsEvaluationClassifyResults].
	InvalidLabelCount float64 `json:"invalid_label_count"`
	JudgeFailCount    float64 `json:"judge_fail_count"`
	// This field is from variant [EvalStatusResponseResultsEvaluationClassifyResults].
	LabelCounts string `json:"label_counts"`
	// This field is from variant [EvalStatusResponseResultsEvaluationClassifyResults].
	PassPercentage float64 `json:"pass_percentage"`
	ResultFileID   string  `json:"result_file_id"`
	// This field is from variant [EvalStatusResponseResultsEvaluationScoreResults].
	AggregatedScores EvalStatusResponseResultsEvaluationScoreResultsAggregatedScores `json:"aggregated_scores"`
	// This field is from variant [EvalStatusResponseResultsEvaluationScoreResults].
	FailedSamples float64 `json:"failed_samples"`
	// This field is from variant [EvalStatusResponseResultsEvaluationScoreResults].
	InvalidScoreCount float64 `json:"invalid_score_count"`
	// This field is from variant [EvalStatusResponseResultsEvaluationCompareResults].
	AWins int64 `json:"A_wins"`
	// This field is from variant [EvalStatusResponseResultsEvaluationCompareResults].
	BWins int64 `json:"B_wins"`
	// This field is from variant [EvalStatusResponseResultsEvaluationCompareResults].
	Ties int64 `json:"Ties"`
	JSON struct {
		GenerationFailCount respjson.Field
		InvalidLabelCount   respjson.Field
		JudgeFailCount      respjson.Field
		LabelCounts         respjson.Field
		PassPercentage      respjson.Field
		ResultFileID        respjson.Field
		AggregatedScores    respjson.Field
		FailedSamples       respjson.Field
		InvalidScoreCount   respjson.Field
		AWins               respjson.Field
		BWins               respjson.Field
		Ties                respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

EvalStatusResponseResultsUnion contains all possible properties and values from EvalStatusResponseResultsEvaluationClassifyResults, EvalStatusResponseResultsEvaluationScoreResults, EvalStatusResponseResultsEvaluationCompareResults.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (EvalStatusResponseResultsUnion) AsEvalStatusResponseResultsEvaluationClassifyResults

func (u EvalStatusResponseResultsUnion) AsEvalStatusResponseResultsEvaluationClassifyResults() (v EvalStatusResponseResultsEvaluationClassifyResults)

func (EvalStatusResponseResultsUnion) AsEvalStatusResponseResultsEvaluationCompareResults

func (u EvalStatusResponseResultsUnion) AsEvalStatusResponseResultsEvaluationCompareResults() (v EvalStatusResponseResultsEvaluationCompareResults)

func (EvalStatusResponseResultsUnion) AsEvalStatusResponseResultsEvaluationScoreResults

func (u EvalStatusResponseResultsUnion) AsEvalStatusResponseResultsEvaluationScoreResults() (v EvalStatusResponseResultsEvaluationScoreResults)

func (EvalStatusResponseResultsUnion) RawJSON

Returns the unmodified JSON received from the API

func (*EvalStatusResponseResultsUnion) UnmarshalJSON

func (r *EvalStatusResponseResultsUnion) UnmarshalJSON(data []byte) error

type EvalStatusResponseStatus

type EvalStatusResponseStatus string

The status of the evaluation job

const (
	EvalStatusResponseStatusCompleted EvalStatusResponseStatus = "completed"
	EvalStatusResponseStatusError     EvalStatusResponseStatus = "error"
	EvalStatusResponseStatusUserError EvalStatusResponseStatus = "user_error"
	EvalStatusResponseStatusRunning   EvalStatusResponseStatus = "running"
	EvalStatusResponseStatusQueued    EvalStatusResponseStatus = "queued"
	EvalStatusResponseStatusPending   EvalStatusResponseStatus = "pending"
)

type EvaluationJob

type EvaluationJob struct {
	// When the job was created
	CreatedAt time.Time `json:"created_at" format:"date-time"`
	// ID of the job owner (admin only)
	OwnerID string `json:"owner_id"`
	// The parameters used for this evaluation
	Parameters map[string]any `json:"parameters"`
	// Results of the evaluation (when completed)
	Results EvaluationJobResultsUnion `json:"results" api:"nullable"`
	// Current status of the job
	//
	// Any of "pending", "queued", "running", "completed", "error", "user_error".
	Status EvaluationJobStatus `json:"status"`
	// History of status updates (admin only)
	StatusUpdates []EvaluationJobStatusUpdate `json:"status_updates"`
	// The type of evaluation
	//
	// Any of "classify", "score", "compare".
	Type EvaluationJobType `json:"type"`
	// When the job was last updated
	UpdatedAt time.Time `json:"updated_at" format:"date-time"`
	// The evaluation job ID
	WorkflowID string `json:"workflow_id"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreatedAt     respjson.Field
		OwnerID       respjson.Field
		Parameters    respjson.Field
		Results       respjson.Field
		Status        respjson.Field
		StatusUpdates respjson.Field
		Type          respjson.Field
		UpdatedAt     respjson.Field
		WorkflowID    respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (EvaluationJob) RawJSON

func (r EvaluationJob) RawJSON() string

Returns the unmodified JSON received from the API

func (*EvaluationJob) UnmarshalJSON

func (r *EvaluationJob) UnmarshalJSON(data []byte) error

type EvaluationJobResultsError

type EvaluationJobResultsError struct {
	Error string `json:"error"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Error       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (EvaluationJobResultsError) RawJSON

func (r EvaluationJobResultsError) RawJSON() string

Returns the unmodified JSON received from the API

func (*EvaluationJobResultsError) UnmarshalJSON

func (r *EvaluationJobResultsError) UnmarshalJSON(data []byte) error

type EvaluationJobResultsEvaluationClassifyResults

type EvaluationJobResultsEvaluationClassifyResults struct {
	// Number of failed generations.
	GenerationFailCount float64 `json:"generation_fail_count" api:"nullable" format:"integer"`
	// Number of invalid labels
	InvalidLabelCount float64 `json:"invalid_label_count" api:"nullable"`
	// Number of failed judge generations
	JudgeFailCount float64 `json:"judge_fail_count" api:"nullable" format:"integer"`
	// JSON string representing label counts
	LabelCounts string `json:"label_counts"`
	// Pecentage of pass labels.
	PassPercentage float64 `json:"pass_percentage" api:"nullable" format:"integer"`
	// Data File ID
	ResultFileID string `json:"result_file_id"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		GenerationFailCount respjson.Field
		InvalidLabelCount   respjson.Field
		JudgeFailCount      respjson.Field
		LabelCounts         respjson.Field
		PassPercentage      respjson.Field
		ResultFileID        respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (EvaluationJobResultsEvaluationClassifyResults) RawJSON

Returns the unmodified JSON received from the API

func (*EvaluationJobResultsEvaluationClassifyResults) UnmarshalJSON

func (r *EvaluationJobResultsEvaluationClassifyResults) UnmarshalJSON(data []byte) error

type EvaluationJobResultsEvaluationCompareResults

type EvaluationJobResultsEvaluationCompareResults struct {
	// Number of samples where model A was judged the winner
	AWins int64 `json:"A_wins"`
	// Number of samples where model B was judged the winner
	BWins int64 `json:"B_wins"`
	// Number of generation failures across model A and model B.
	GenerationFailCount float64 `json:"generation_fail_count" api:"nullable" format:"integer"`
	// Number of judge inference failures. In the default two-pass mode
	// (disable_position_bias_correction=false) this is the combined failure count from
	// both the original-order and flipped-order judge passes.
	JudgeFailCount float64 `json:"judge_fail_count" api:"nullable" format:"integer"`
	// File ID of the detailed output file. Each row contains the original input fields
	// plus judge outputs. In two-pass mode the file includes both original-order and
	// flipped-order judge fields; in single-pass mode
	// (disable_position_bias_correction=true) only original-order fields are present.
	ResultFileID string `json:"result_file_id"`
	// Number of samples that resulted in a tie
	Ties int64 `json:"Ties"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AWins               respjson.Field
		BWins               respjson.Field
		GenerationFailCount respjson.Field
		JudgeFailCount      respjson.Field
		ResultFileID        respjson.Field
		Ties                respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (EvaluationJobResultsEvaluationCompareResults) RawJSON

Returns the unmodified JSON received from the API

func (*EvaluationJobResultsEvaluationCompareResults) UnmarshalJSON

func (r *EvaluationJobResultsEvaluationCompareResults) UnmarshalJSON(data []byte) error

type EvaluationJobResultsEvaluationScoreResults

type EvaluationJobResultsEvaluationScoreResults struct {
	AggregatedScores EvaluationJobResultsEvaluationScoreResultsAggregatedScores `json:"aggregated_scores"`
	// number of failed samples generated from model
	FailedSamples float64 `json:"failed_samples" format:"integer"`
	// Number of failed generations.
	GenerationFailCount float64 `json:"generation_fail_count" api:"nullable" format:"integer"`
	// number of invalid scores generated from model
	InvalidScoreCount float64 `json:"invalid_score_count" format:"integer"`
	// Number of failed judge generations
	JudgeFailCount float64 `json:"judge_fail_count" api:"nullable" format:"integer"`
	// Data File ID
	ResultFileID string `json:"result_file_id"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AggregatedScores    respjson.Field
		FailedSamples       respjson.Field
		GenerationFailCount respjson.Field
		InvalidScoreCount   respjson.Field
		JudgeFailCount      respjson.Field
		ResultFileID        respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (EvaluationJobResultsEvaluationScoreResults) RawJSON

Returns the unmodified JSON received from the API

func (*EvaluationJobResultsEvaluationScoreResults) UnmarshalJSON

func (r *EvaluationJobResultsEvaluationScoreResults) UnmarshalJSON(data []byte) error

type EvaluationJobResultsEvaluationScoreResultsAggregatedScores

type EvaluationJobResultsEvaluationScoreResultsAggregatedScores struct {
	MeanScore      float64 `json:"mean_score"`
	PassPercentage float64 `json:"pass_percentage"`
	StdScore       float64 `json:"std_score"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MeanScore      respjson.Field
		PassPercentage respjson.Field
		StdScore       respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (EvaluationJobResultsEvaluationScoreResultsAggregatedScores) RawJSON

Returns the unmodified JSON received from the API

func (*EvaluationJobResultsEvaluationScoreResultsAggregatedScores) UnmarshalJSON

type EvaluationJobResultsUnion

type EvaluationJobResultsUnion struct {
	GenerationFailCount float64 `json:"generation_fail_count"`
	// This field is from variant [EvaluationJobResultsEvaluationClassifyResults].
	InvalidLabelCount float64 `json:"invalid_label_count"`
	JudgeFailCount    float64 `json:"judge_fail_count"`
	// This field is from variant [EvaluationJobResultsEvaluationClassifyResults].
	LabelCounts string `json:"label_counts"`
	// This field is from variant [EvaluationJobResultsEvaluationClassifyResults].
	PassPercentage float64 `json:"pass_percentage"`
	ResultFileID   string  `json:"result_file_id"`
	// This field is from variant [EvaluationJobResultsEvaluationScoreResults].
	AggregatedScores EvaluationJobResultsEvaluationScoreResultsAggregatedScores `json:"aggregated_scores"`
	// This field is from variant [EvaluationJobResultsEvaluationScoreResults].
	FailedSamples float64 `json:"failed_samples"`
	// This field is from variant [EvaluationJobResultsEvaluationScoreResults].
	InvalidScoreCount float64 `json:"invalid_score_count"`
	// This field is from variant [EvaluationJobResultsEvaluationCompareResults].
	AWins int64 `json:"A_wins"`
	// This field is from variant [EvaluationJobResultsEvaluationCompareResults].
	BWins int64 `json:"B_wins"`
	// This field is from variant [EvaluationJobResultsEvaluationCompareResults].
	Ties int64 `json:"Ties"`
	// This field is from variant [EvaluationJobResultsError].
	Error string `json:"error"`
	JSON  struct {
		GenerationFailCount respjson.Field
		InvalidLabelCount   respjson.Field
		JudgeFailCount      respjson.Field
		LabelCounts         respjson.Field
		PassPercentage      respjson.Field
		ResultFileID        respjson.Field
		AggregatedScores    respjson.Field
		FailedSamples       respjson.Field
		InvalidScoreCount   respjson.Field
		AWins               respjson.Field
		BWins               respjson.Field
		Ties                respjson.Field
		Error               respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

EvaluationJobResultsUnion contains all possible properties and values from EvaluationJobResultsEvaluationClassifyResults, EvaluationJobResultsEvaluationScoreResults, EvaluationJobResultsEvaluationCompareResults, EvaluationJobResultsError.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (EvaluationJobResultsUnion) AsEvaluationJobResultsError

func (u EvaluationJobResultsUnion) AsEvaluationJobResultsError() (v EvaluationJobResultsError)

func (EvaluationJobResultsUnion) AsEvaluationJobResultsEvaluationClassifyResults

func (u EvaluationJobResultsUnion) AsEvaluationJobResultsEvaluationClassifyResults() (v EvaluationJobResultsEvaluationClassifyResults)

func (EvaluationJobResultsUnion) AsEvaluationJobResultsEvaluationCompareResults

func (u EvaluationJobResultsUnion) AsEvaluationJobResultsEvaluationCompareResults() (v EvaluationJobResultsEvaluationCompareResults)

func (EvaluationJobResultsUnion) AsEvaluationJobResultsEvaluationScoreResults

func (u EvaluationJobResultsUnion) AsEvaluationJobResultsEvaluationScoreResults() (v EvaluationJobResultsEvaluationScoreResults)

func (EvaluationJobResultsUnion) RawJSON

func (u EvaluationJobResultsUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*EvaluationJobResultsUnion) UnmarshalJSON

func (r *EvaluationJobResultsUnion) UnmarshalJSON(data []byte) error

type EvaluationJobStatus

type EvaluationJobStatus string

Current status of the job

const (
	EvaluationJobStatusPending   EvaluationJobStatus = "pending"
	EvaluationJobStatusQueued    EvaluationJobStatus = "queued"
	EvaluationJobStatusRunning   EvaluationJobStatus = "running"
	EvaluationJobStatusCompleted EvaluationJobStatus = "completed"
	EvaluationJobStatusError     EvaluationJobStatus = "error"
	EvaluationJobStatusUserError EvaluationJobStatus = "user_error"
)

type EvaluationJobStatusUpdate

type EvaluationJobStatusUpdate struct {
	// Additional message for this update
	Message string `json:"message"`
	// The status at this update
	Status string `json:"status"`
	// When this update occurred
	Timestamp time.Time `json:"timestamp" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Status      respjson.Field
		Timestamp   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (EvaluationJobStatusUpdate) RawJSON

func (r EvaluationJobStatusUpdate) RawJSON() string

Returns the unmodified JSON received from the API

func (*EvaluationJobStatusUpdate) UnmarshalJSON

func (r *EvaluationJobStatusUpdate) UnmarshalJSON(data []byte) error

type EvaluationJobType

type EvaluationJobType string

The type of evaluation

const (
	EvaluationJobTypeClassify EvaluationJobType = "classify"
	EvaluationJobTypeScore    EvaluationJobType = "score"
	EvaluationJobTypeCompare  EvaluationJobType = "compare"
)

type ExecuteResponseFailedExecution

type ExecuteResponseFailedExecution struct {
	Data   any                                        `json:"data" api:"required"`
	Errors []ExecuteResponseFailedExecutionErrorUnion `json:"errors" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Errors      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ExecuteResponseFailedExecution) RawJSON

Returns the unmodified JSON received from the API

func (*ExecuteResponseFailedExecution) UnmarshalJSON

func (r *ExecuteResponseFailedExecution) UnmarshalJSON(data []byte) error

type ExecuteResponseFailedExecutionErrorUnion

type ExecuteResponseFailedExecutionErrorUnion struct {
	// This field will be present if the value is a [string] instead of an object.
	OfString string `json:",inline"`
	// This field will be present if the value is a [any] instead of an object.
	OfExecuteResponseFailedExecutionErrorMapItem any `json:",inline"`
	JSON                                         struct {
		OfString                                     respjson.Field
		OfExecuteResponseFailedExecutionErrorMapItem respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

ExecuteResponseFailedExecutionErrorUnion contains all possible properties and values from [string], [map[string]any].

Use the methods beginning with 'As' to cast the union to one of its variants.

If the underlying value is not a json object, one of the following properties will be valid: OfString OfExecuteResponseFailedExecutionErrorMapItem]

func (ExecuteResponseFailedExecutionErrorUnion) AsAnyMap

func (ExecuteResponseFailedExecutionErrorUnion) AsString

func (ExecuteResponseFailedExecutionErrorUnion) RawJSON

Returns the unmodified JSON received from the API

func (*ExecuteResponseFailedExecutionErrorUnion) UnmarshalJSON

func (r *ExecuteResponseFailedExecutionErrorUnion) UnmarshalJSON(data []byte) error

type ExecuteResponseSuccessfulExecution

type ExecuteResponseSuccessfulExecution struct {
	Data   ExecuteResponseSuccessfulExecutionData `json:"data" api:"required"`
	Errors any                                    `json:"errors" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Errors      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ExecuteResponseSuccessfulExecution) RawJSON

Returns the unmodified JSON received from the API

func (*ExecuteResponseSuccessfulExecution) UnmarshalJSON

func (r *ExecuteResponseSuccessfulExecution) UnmarshalJSON(data []byte) error

type ExecuteResponseSuccessfulExecutionData

type ExecuteResponseSuccessfulExecutionData struct {
	Outputs []ExecuteResponseSuccessfulExecutionDataOutputUnion `json:"outputs" api:"required"`
	// Identifier of the current session. Used to make follow-up calls.
	SessionID string `json:"session_id" api:"required"`
	// Status of the execution. Currently only supports success.
	//
	// Any of "success".
	Status string `json:"status"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Outputs     respjson.Field
		SessionID   respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ExecuteResponseSuccessfulExecutionData) RawJSON

Returns the unmodified JSON received from the API

func (*ExecuteResponseSuccessfulExecutionData) UnmarshalJSON

func (r *ExecuteResponseSuccessfulExecutionData) UnmarshalJSON(data []byte) error

type ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput

type ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput struct {
	Data ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData `json:"data" api:"required"`
	// Any of "display_data", "execute_result".
	Type string `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput) RawJSON

Returns the unmodified JSON received from the API

func (*ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput) UnmarshalJSON

type ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData

type ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData struct {
	ApplicationGeoJson           map[string]any `json:"application/geo+json"`
	ApplicationJavascript        string         `json:"application/javascript"`
	ApplicationJson              map[string]any `json:"application/json"`
	ApplicationPdf               string         `json:"application/pdf" format:"byte"`
	ApplicationVndVegaV5Json     map[string]any `json:"application/vnd.vega.v5+json"`
	ApplicationVndVegaliteV4Json map[string]any `json:"application/vnd.vegalite.v4+json"`
	ImageGif                     string         `json:"image/gif" format:"byte"`
	ImageJpeg                    string         `json:"image/jpeg" format:"byte"`
	ImagePng                     string         `json:"image/png" format:"byte"`
	ImageSvgXml                  string         `json:"image/svg+xml"`
	TextHTML                     string         `json:"text/html"`
	TextLatex                    string         `json:"text/latex"`
	TextMarkdown                 string         `json:"text/markdown"`
	TextPlain                    string         `json:"text/plain"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ApplicationGeoJson           respjson.Field
		ApplicationJavascript        respjson.Field
		ApplicationJson              respjson.Field
		ApplicationPdf               respjson.Field
		ApplicationVndVegaV5Json     respjson.Field
		ApplicationVndVegaliteV4Json respjson.Field
		ImageGif                     respjson.Field
		ImageJpeg                    respjson.Field
		ImagePng                     respjson.Field
		ImageSvgXml                  respjson.Field
		TextHTML                     respjson.Field
		TextLatex                    respjson.Field
		TextMarkdown                 respjson.Field
		TextPlain                    respjson.Field
		ExtraFields                  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData) RawJSON

Returns the unmodified JSON received from the API

func (*ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData) UnmarshalJSON

type ExecuteResponseSuccessfulExecutionDataOutputError

type ExecuteResponseSuccessfulExecutionDataOutputError struct {
	Data string         `json:"data" api:"required"`
	Type constant.Error `json:"type" default:"error"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Errors and exceptions that occurred. If this output type is present, your code did not execute successfully.

func (ExecuteResponseSuccessfulExecutionDataOutputError) RawJSON

Returns the unmodified JSON received from the API

func (*ExecuteResponseSuccessfulExecutionDataOutputError) UnmarshalJSON

type ExecuteResponseSuccessfulExecutionDataOutputStreamOutput

type ExecuteResponseSuccessfulExecutionDataOutputStreamOutput struct {
	Data string `json:"data" api:"required"`
	// Any of "stdout", "stderr".
	Type string `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Outputs that were printed to stdout or stderr

func (ExecuteResponseSuccessfulExecutionDataOutputStreamOutput) RawJSON

Returns the unmodified JSON received from the API

func (*ExecuteResponseSuccessfulExecutionDataOutputStreamOutput) UnmarshalJSON

type ExecuteResponseSuccessfulExecutionDataOutputUnion

type ExecuteResponseSuccessfulExecutionDataOutputUnion struct {
	// This field is a union of [string], [string],
	// [ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData]
	Data ExecuteResponseSuccessfulExecutionDataOutputUnionData `json:"data"`
	// Any of nil, "error", nil.
	Type string `json:"type"`
	JSON struct {
		Data respjson.Field
		Type respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

ExecuteResponseSuccessfulExecutionDataOutputUnion contains all possible properties and values from ExecuteResponseSuccessfulExecutionDataOutputStreamOutput, ExecuteResponseSuccessfulExecutionDataOutputError, ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput.

Use the [ExecuteResponseSuccessfulExecutionDataOutputUnion.AsAny] method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (ExecuteResponseSuccessfulExecutionDataOutputUnion) AsDisplayorExecuteOutput

func (ExecuteResponseSuccessfulExecutionDataOutputUnion) AsError

func (ExecuteResponseSuccessfulExecutionDataOutputUnion) AsStreamOutput

func (ExecuteResponseSuccessfulExecutionDataOutputUnion) RawJSON

Returns the unmodified JSON received from the API

func (*ExecuteResponseSuccessfulExecutionDataOutputUnion) UnmarshalJSON

type ExecuteResponseSuccessfulExecutionDataOutputUnionData

type ExecuteResponseSuccessfulExecutionDataOutputUnionData struct {
	// This field will be present if the value is a [string] instead of an object.
	OfString string `json:",inline"`
	// This field is from variant
	// [ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData].
	ApplicationGeoJson map[string]any `json:"application/geo+json"`
	// This field is from variant
	// [ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData].
	ApplicationJavascript string `json:"application/javascript"`
	// This field is from variant
	// [ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData].
	ApplicationJson map[string]any `json:"application/json"`
	// This field is from variant
	// [ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData].
	ApplicationPdf string `json:"application/pdf"`
	// This field is from variant
	// [ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData].
	ApplicationVndVegaV5Json map[string]any `json:"application/vnd.vega.v5+json"`
	// This field is from variant
	// [ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData].
	ApplicationVndVegaliteV4Json map[string]any `json:"application/vnd.vegalite.v4+json"`
	// This field is from variant
	// [ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData].
	ImageGif string `json:"image/gif"`
	// This field is from variant
	// [ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData].
	ImageJpeg string `json:"image/jpeg"`
	// This field is from variant
	// [ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData].
	ImagePng string `json:"image/png"`
	// This field is from variant
	// [ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData].
	ImageSvgXml string `json:"image/svg+xml"`
	// This field is from variant
	// [ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData].
	TextHTML string `json:"text/html"`
	// This field is from variant
	// [ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData].
	TextLatex string `json:"text/latex"`
	// This field is from variant
	// [ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData].
	TextMarkdown string `json:"text/markdown"`
	// This field is from variant
	// [ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData].
	TextPlain string `json:"text/plain"`
	JSON      struct {
		OfString                     respjson.Field
		ApplicationGeoJson           respjson.Field
		ApplicationJavascript        respjson.Field
		ApplicationJson              respjson.Field
		ApplicationPdf               respjson.Field
		ApplicationVndVegaV5Json     respjson.Field
		ApplicationVndVegaliteV4Json respjson.Field
		ImageGif                     respjson.Field
		ImageJpeg                    respjson.Field
		ImagePng                     respjson.Field
		ImageSvgXml                  respjson.Field
		TextHTML                     respjson.Field
		TextLatex                    respjson.Field
		TextMarkdown                 respjson.Field
		TextPlain                    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

ExecuteResponseSuccessfulExecutionDataOutputUnionData is an implicit subunion of ExecuteResponseSuccessfulExecutionDataOutputUnion. ExecuteResponseSuccessfulExecutionDataOutputUnionData provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the ExecuteResponseSuccessfulExecutionDataOutputUnion.

If the underlying value is not a json object, one of the following properties will be valid: OfString]

func (*ExecuteResponseSuccessfulExecutionDataOutputUnionData) UnmarshalJSON

type ExecuteResponseUnion

type ExecuteResponseUnion struct {
	// This field is a union of [ExecuteResponseSuccessfulExecutionData], [any]
	Data ExecuteResponseUnionData `json:"data"`
	// This field is a union of [any], [[]ExecuteResponseFailedExecutionErrorUnion]
	Errors ExecuteResponseUnionErrors `json:"errors"`
	JSON   struct {
		Data   respjson.Field
		Errors respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

ExecuteResponseUnion contains all possible properties and values from ExecuteResponseSuccessfulExecution, ExecuteResponseFailedExecution.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (ExecuteResponseUnion) AsFailedExecution

func (u ExecuteResponseUnion) AsFailedExecution() (v ExecuteResponseFailedExecution)

func (ExecuteResponseUnion) AsSuccessfulExecution

func (u ExecuteResponseUnion) AsSuccessfulExecution() (v ExecuteResponseSuccessfulExecution)

func (ExecuteResponseUnion) RawJSON

func (u ExecuteResponseUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*ExecuteResponseUnion) UnmarshalJSON

func (r *ExecuteResponseUnion) UnmarshalJSON(data []byte) error

type ExecuteResponseUnionData

type ExecuteResponseUnionData struct {
	// This field will be present if the value is a [any] instead of an object.
	OfExecuteResponseFailedExecutionData any `json:",inline"`
	// This field is from variant [ExecuteResponseSuccessfulExecutionData].
	Outputs []ExecuteResponseSuccessfulExecutionDataOutputUnion `json:"outputs"`
	// This field is from variant [ExecuteResponseSuccessfulExecutionData].
	SessionID string `json:"session_id"`
	// This field is from variant [ExecuteResponseSuccessfulExecutionData].
	Status string `json:"status"`
	JSON   struct {
		OfExecuteResponseFailedExecutionData respjson.Field
		Outputs                              respjson.Field
		SessionID                            respjson.Field
		Status                               respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

ExecuteResponseUnionData is an implicit subunion of ExecuteResponseUnion. ExecuteResponseUnionData provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the ExecuteResponseUnion.

If the underlying value is not a json object, one of the following properties will be valid: OfExecuteResponseFailedExecutionData]

func (*ExecuteResponseUnionData) UnmarshalJSON

func (r *ExecuteResponseUnionData) UnmarshalJSON(data []byte) error

type ExecuteResponseUnionErrors

type ExecuteResponseUnionErrors struct {
	// This field will be present if the value is a [any] instead of an object.
	OfExecuteResponseSuccessfulExecutionErrors any `json:",inline"`
	// This field will be present if the value is a
	// [[]ExecuteResponseFailedExecutionErrorUnion] instead of an object.
	OfExecuteResponseFailedExecutionErrors []ExecuteResponseFailedExecutionErrorUnion `json:",inline"`
	JSON                                   struct {
		OfExecuteResponseSuccessfulExecutionErrors respjson.Field
		OfExecuteResponseFailedExecutionErrors     respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

ExecuteResponseUnionErrors is an implicit subunion of ExecuteResponseUnion. ExecuteResponseUnionErrors provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the ExecuteResponseUnion.

If the underlying value is not a json object, one of the following properties will be valid: OfExecuteResponseSuccessfulExecutionErrors OfExecuteResponseFailedExecutionErrors]

func (*ExecuteResponseUnionErrors) UnmarshalJSON

func (r *ExecuteResponseUnionErrors) UnmarshalJSON(data []byte) error

type FileDeleteResponse

type FileDeleteResponse struct {
	ID      string `json:"id"`
	Deleted bool   `json:"deleted"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Deleted     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FileDeleteResponse) RawJSON

func (r FileDeleteResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*FileDeleteResponse) UnmarshalJSON

func (r *FileDeleteResponse) UnmarshalJSON(data []byte) error

type FileList

type FileList struct {
	Data []FileResponse `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FileList) RawJSON

func (r FileList) RawJSON() string

Returns the unmodified JSON received from the API

func (*FileList) UnmarshalJSON

func (r *FileList) UnmarshalJSON(data []byte) error

type FilePurpose

type FilePurpose string

The purpose of the file

const (
	FilePurposeFineTune FilePurpose = "fine-tune"
	FilePurposeEval     FilePurpose = "eval"
	FilePurposeBatchAPI FilePurpose = "batch-api"
)

type FileResponse

type FileResponse struct {
	// ID of the file.
	ID string `json:"id" api:"required"`
	// The number of bytes in the file.
	Bytes int64 `json:"bytes" api:"required"`
	// The timestamp when the file was created.
	CreatedAt int64 `json:"created_at" api:"required"`
	// The name of the file as it was uploaded.
	Filename string `json:"filename" api:"required"`
	// The type of the file such as `jsonl`, `csv`, or `parquet`.
	//
	// Any of "csv", "jsonl", "parquet".
	FileType FileType `json:"FileType" api:"required"`
	// The object type, which is always `file`.
	Object constant.File `json:"object" default:"file"`
	// Whether the file has been parsed and analyzed for correctness for fine-tuning.
	Processed bool `json:"Processed" api:"required"`
	// The purpose of the file as it was uploaded.
	//
	// Any of "fine-tune", "eval", "batch-api".
	Purpose FilePurpose `json:"purpose" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Bytes       respjson.Field
		CreatedAt   respjson.Field
		Filename    respjson.Field
		FileType    respjson.Field
		Object      respjson.Field
		Processed   respjson.Field
		Purpose     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Structured information describing a file uploaded to Together.

func (FileResponse) RawJSON

func (r FileResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*FileResponse) UnmarshalJSON

func (r *FileResponse) UnmarshalJSON(data []byte) error

type FileService

type FileService struct {
	Options []option.RequestOption
}

FileService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewFileService method instead.

func NewFileService

func NewFileService(opts ...option.RequestOption) (r FileService)

NewFileService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*FileService) Content

func (r *FileService) Content(ctx context.Context, id string, opts ...option.RequestOption) (res *http.Response, err error)

Get the contents of a single uploaded data file.

func (*FileService) Delete

func (r *FileService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (res *FileDeleteResponse, err error)

Delete a previously uploaded data file.

func (*FileService) Get

func (r *FileService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *FileResponse, err error)

Retrieve the metadata for a single uploaded data file.

func (*FileService) List

func (r *FileService) List(ctx context.Context, opts ...option.RequestOption) (res *FileList, err error)

List the metadata for all uploaded data files.

func (*FileService) Upload

func (r *FileService) Upload(ctx context.Context, body FileUploadParams, opts ...option.RequestOption) (res *FileResponse, err error)

Upload a file with specified purpose, file name, and file type.

type FileType

type FileType string

The type of the file

const (
	FileTypeCsv     FileType = "csv"
	FileTypeJSONL   FileType = "jsonl"
	FileTypeParquet FileType = "parquet"
)

type FileUploadParams

type FileUploadParams struct {
	// The content of the file being uploaded
	File io.Reader `json:"file,omitzero" api:"required" format:"binary"`
	// The name of the file being uploaded
	FileName string `json:"file_name" api:"required"`
	// The purpose of the file
	//
	// Any of "fine-tune", "eval", "batch-api".
	Purpose FilePurpose `json:"purpose,omitzero" api:"required"`
	// The type of the file
	//
	// Any of "csv", "jsonl", "parquet".
	FileType FileType `json:"file_type,omitzero"`
	// contains filtered or unexported fields
}

func (FileUploadParams) MarshalMultipart

func (r FileUploadParams) MarshalMultipart() (data []byte, contentType string, err error)

type FineTuningCancelResponse

type FineTuningCancelResponse struct {
	// Unique identifier for the fine-tune job
	ID string `json:"id" api:"required"`
	// Creation timestamp of the fine-tune job
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Any of "pending", "queued", "running", "compressing", "uploading",
	// "cancel_requested", "cancelled", "error", "completed".
	Status FineTuningCancelResponseStatus `json:"status" api:"required"`
	// Last update timestamp of the fine-tune job
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// Batch size used for training
	BatchSize int64 `json:"batch_size"`
	// Events related to this fine-tune job
	Events []FinetuneEvent `json:"events"`
	// Checkpoint used to continue training
	FromCheckpoint string `json:"from_checkpoint"`
	// Hugging Face Hub repo to start training from
	FromHfModel string `json:"from_hf_model"`
	// The revision of the Hugging Face Hub model to continue training from
	HfModelRevision string `json:"hf_model_revision"`
	// Learning rate used for training
	LearningRate float64 `json:"learning_rate"`
	// Learning rate scheduler configuration
	LrScheduler FineTuningCancelResponseLrScheduler `json:"lr_scheduler"`
	// Maximum gradient norm for clipping
	MaxGradNorm float64 `json:"max_grad_norm"`
	// Maximum sequence length to use for training. If not specified, uses the maximum
	// allowed for the model and training method.
	MaxSeqLength int64 `json:"max_seq_length"`
	// Base model used for fine-tuning
	Model           string `json:"model"`
	ModelOutputName string `json:"model_output_name"`
	// Number of checkpoints saved during training
	NCheckpoints int64 `json:"n_checkpoints"`
	// Number of training epochs
	NEpochs int64 `json:"n_epochs"`
	// Number of evaluations during training
	NEvals int64 `json:"n_evals"`
	// Owner address information
	OwnerAddress string `json:"owner_address"`
	// Whether sequence packing is being used for training.
	Packing bool `json:"packing"`
	// Progress information for the fine-tuning job
	Progress FineTuningCancelResponseProgress `json:"progress"`
	// Random seed used for training. Integer when set; null if not stored (e.g. legacy
	// jobs) or no explicit seed was recorded.
	RandomSeed int64 `json:"random_seed" api:"nullable"`
	// Start timestamp of the current stage of the fine-tune job
	StartedAt time.Time `json:"started_at" format:"date-time"`
	// Suffix added to the fine-tuned model name
	Suffix string `json:"suffix"`
	// Count of tokens processed
	TokenCount int64 `json:"token_count"`
	// Total price for the fine-tuning job
	TotalPrice int64 `json:"total_price"`
	// File-ID of the training file
	TrainingFile string `json:"training_file"`
	// Method of training used
	TrainingMethod FineTuningCancelResponseTrainingMethodUnion `json:"training_method"`
	// Type of training used (full or LoRA)
	TrainingType FineTuningCancelResponseTrainingTypeUnion `json:"training_type"`
	// Identifier for who created the job.
	UserID string `json:"user_id"`
	// File-ID of the validation file
	ValidationFile string `json:"validation_file"`
	// Weights & Biases run name
	WandbName string `json:"wandb_name"`
	// Weights & Biases project name
	WandbProjectName string `json:"wandb_project_name"`
	// Ratio of warmup steps
	WarmupRatio float64 `json:"warmup_ratio"`
	// Weight decay value used
	WeightDecay float64 `json:"weight_decay"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID               respjson.Field
		CreatedAt        respjson.Field
		Status           respjson.Field
		UpdatedAt        respjson.Field
		BatchSize        respjson.Field
		Events           respjson.Field
		FromCheckpoint   respjson.Field
		FromHfModel      respjson.Field
		HfModelRevision  respjson.Field
		LearningRate     respjson.Field
		LrScheduler      respjson.Field
		MaxGradNorm      respjson.Field
		MaxSeqLength     respjson.Field
		Model            respjson.Field
		ModelOutputName  respjson.Field
		NCheckpoints     respjson.Field
		NEpochs          respjson.Field
		NEvals           respjson.Field
		OwnerAddress     respjson.Field
		Packing          respjson.Field
		Progress         respjson.Field
		RandomSeed       respjson.Field
		StartedAt        respjson.Field
		Suffix           respjson.Field
		TokenCount       respjson.Field
		TotalPrice       respjson.Field
		TrainingFile     respjson.Field
		TrainingMethod   respjson.Field
		TrainingType     respjson.Field
		UserID           respjson.Field
		ValidationFile   respjson.Field
		WandbName        respjson.Field
		WandbProjectName respjson.Field
		WarmupRatio      respjson.Field
		WeightDecay      respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A truncated version of the fine-tune response, used for POST /fine-tunes, GET /fine-tunes and POST /fine-tunes/{id}/cancel endpoints

func (FineTuningCancelResponse) RawJSON

func (r FineTuningCancelResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*FineTuningCancelResponse) UnmarshalJSON

func (r *FineTuningCancelResponse) UnmarshalJSON(data []byte) error

type FineTuningCancelResponseLrScheduler

type FineTuningCancelResponseLrScheduler struct {
	// Any of "linear", "cosine".
	LrSchedulerType string                                                  `json:"lr_scheduler_type" api:"required"`
	LrSchedulerArgs FineTuningCancelResponseLrSchedulerLrSchedulerArgsUnion `json:"lr_scheduler_args"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		LrSchedulerType respjson.Field
		LrSchedulerArgs respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Learning rate scheduler configuration

func (FineTuningCancelResponseLrScheduler) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningCancelResponseLrScheduler) UnmarshalJSON

func (r *FineTuningCancelResponseLrScheduler) UnmarshalJSON(data []byte) error

type FineTuningCancelResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs

type FineTuningCancelResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs struct {
	// The ratio of the final learning rate to the peak learning rate
	MinLrRatio float64 `json:"min_lr_ratio" api:"required"`
	// Number or fraction of cycles for the cosine learning rate scheduler
	NumCycles float64 `json:"num_cycles" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MinLrRatio  respjson.Field
		NumCycles   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningCancelResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningCancelResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs) UnmarshalJSON

type FineTuningCancelResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs

type FineTuningCancelResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs struct {
	// The ratio of the final learning rate to the peak learning rate
	MinLrRatio float64 `json:"min_lr_ratio"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MinLrRatio  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningCancelResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningCancelResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs) UnmarshalJSON

type FineTuningCancelResponseLrSchedulerLrSchedulerArgsUnion

type FineTuningCancelResponseLrSchedulerLrSchedulerArgsUnion struct {
	MinLrRatio float64 `json:"min_lr_ratio"`
	// This field is from variant
	// [FineTuningCancelResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs].
	NumCycles float64 `json:"num_cycles"`
	JSON      struct {
		MinLrRatio respjson.Field
		NumCycles  respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FineTuningCancelResponseLrSchedulerLrSchedulerArgsUnion contains all possible properties and values from FineTuningCancelResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs, FineTuningCancelResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (FineTuningCancelResponseLrSchedulerLrSchedulerArgsUnion) AsFineTuningCancelResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs

func (u FineTuningCancelResponseLrSchedulerLrSchedulerArgsUnion) AsFineTuningCancelResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs() (v FineTuningCancelResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs)

func (FineTuningCancelResponseLrSchedulerLrSchedulerArgsUnion) AsFineTuningCancelResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs

func (u FineTuningCancelResponseLrSchedulerLrSchedulerArgsUnion) AsFineTuningCancelResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs() (v FineTuningCancelResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs)

func (FineTuningCancelResponseLrSchedulerLrSchedulerArgsUnion) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningCancelResponseLrSchedulerLrSchedulerArgsUnion) UnmarshalJSON

type FineTuningCancelResponseProgress added in v0.2.0

type FineTuningCancelResponseProgress struct {
	// Whether time estimate is available
	EstimateAvailable bool `json:"estimate_available" api:"required"`
	// Estimated time remaining in seconds for the fine-tuning job to next state
	SecondsRemaining int64 `json:"seconds_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		EstimateAvailable respjson.Field
		SecondsRemaining  respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Progress information for the fine-tuning job

func (FineTuningCancelResponseProgress) RawJSON added in v0.2.0

Returns the unmodified JSON received from the API

func (*FineTuningCancelResponseProgress) UnmarshalJSON added in v0.2.0

func (r *FineTuningCancelResponseProgress) UnmarshalJSON(data []byte) error

type FineTuningCancelResponseStatus

type FineTuningCancelResponseStatus string
const (
	FineTuningCancelResponseStatusPending         FineTuningCancelResponseStatus = "pending"
	FineTuningCancelResponseStatusQueued          FineTuningCancelResponseStatus = "queued"
	FineTuningCancelResponseStatusRunning         FineTuningCancelResponseStatus = "running"
	FineTuningCancelResponseStatusCompressing     FineTuningCancelResponseStatus = "compressing"
	FineTuningCancelResponseStatusUploading       FineTuningCancelResponseStatus = "uploading"
	FineTuningCancelResponseStatusCancelRequested FineTuningCancelResponseStatus = "cancel_requested"
	FineTuningCancelResponseStatusCancelled       FineTuningCancelResponseStatus = "cancelled"
	FineTuningCancelResponseStatusError           FineTuningCancelResponseStatus = "error"
	FineTuningCancelResponseStatusCompleted       FineTuningCancelResponseStatus = "completed"
)

type FineTuningCancelResponseTrainingMethodTrainingMethodDpo

type FineTuningCancelResponseTrainingMethodTrainingMethodDpo struct {
	// Any of "dpo".
	Method                        string  `json:"method" api:"required"`
	DpoBeta                       float64 `json:"dpo_beta"`
	DpoNormalizeLogratiosByLength bool    `json:"dpo_normalize_logratios_by_length"`
	DpoReferenceFree              bool    `json:"dpo_reference_free"`
	RpoAlpha                      float64 `json:"rpo_alpha"`
	SimpoGamma                    float64 `json:"simpo_gamma"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Method                        respjson.Field
		DpoBeta                       respjson.Field
		DpoNormalizeLogratiosByLength respjson.Field
		DpoReferenceFree              respjson.Field
		RpoAlpha                      respjson.Field
		SimpoGamma                    respjson.Field
		ExtraFields                   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningCancelResponseTrainingMethodTrainingMethodDpo) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningCancelResponseTrainingMethodTrainingMethodDpo) UnmarshalJSON

type FineTuningCancelResponseTrainingMethodTrainingMethodSft

type FineTuningCancelResponseTrainingMethodTrainingMethodSft struct {
	// Any of "sft".
	Method string `json:"method" api:"required"`
	// Whether to mask user messages in conversational data or prompts in instruction
	// data.
	TrainOnInputs FineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion `json:"train_on_inputs" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Method        respjson.Field
		TrainOnInputs respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningCancelResponseTrainingMethodTrainingMethodSft) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningCancelResponseTrainingMethodTrainingMethodSft) UnmarshalJSON

type FineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsString

type FineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsString string
const (
	FineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsStringAuto FineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsString = "auto"
)

type FineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion

type FineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion struct {
	// This field will be present if the value is a [bool] instead of an object.
	OfBool bool `json:",inline"`
	// This field will be present if the value is a [string] instead of an object.
	OfFineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsString string `json:",inline"`
	JSON                                                                         struct {
		OfBool                                                                       respjson.Field
		OfFineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsString respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion contains all possible properties and values from [bool], [string].

Use the methods beginning with 'As' to cast the union to one of its variants.

If the underlying value is not a json object, one of the following properties will be valid: OfBool OfFineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsString]

func (FineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsBool

func (FineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsFineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsString

func (u FineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsFineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsString() (v string)

func (FineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) UnmarshalJSON

type FineTuningCancelResponseTrainingMethodUnion

type FineTuningCancelResponseTrainingMethodUnion struct {
	Method string `json:"method"`
	// This field is from variant
	// [FineTuningCancelResponseTrainingMethodTrainingMethodSft].
	TrainOnInputs FineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion `json:"train_on_inputs"`
	// This field is from variant
	// [FineTuningCancelResponseTrainingMethodTrainingMethodDpo].
	DpoBeta float64 `json:"dpo_beta"`
	// This field is from variant
	// [FineTuningCancelResponseTrainingMethodTrainingMethodDpo].
	DpoNormalizeLogratiosByLength bool `json:"dpo_normalize_logratios_by_length"`
	// This field is from variant
	// [FineTuningCancelResponseTrainingMethodTrainingMethodDpo].
	DpoReferenceFree bool `json:"dpo_reference_free"`
	// This field is from variant
	// [FineTuningCancelResponseTrainingMethodTrainingMethodDpo].
	RpoAlpha float64 `json:"rpo_alpha"`
	// This field is from variant
	// [FineTuningCancelResponseTrainingMethodTrainingMethodDpo].
	SimpoGamma float64 `json:"simpo_gamma"`
	JSON       struct {
		Method                        respjson.Field
		TrainOnInputs                 respjson.Field
		DpoBeta                       respjson.Field
		DpoNormalizeLogratiosByLength respjson.Field
		DpoReferenceFree              respjson.Field
		RpoAlpha                      respjson.Field
		SimpoGamma                    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FineTuningCancelResponseTrainingMethodUnion contains all possible properties and values from FineTuningCancelResponseTrainingMethodTrainingMethodSft, FineTuningCancelResponseTrainingMethodTrainingMethodDpo.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (FineTuningCancelResponseTrainingMethodUnion) AsFineTuningCancelResponseTrainingMethodTrainingMethodDpo

func (u FineTuningCancelResponseTrainingMethodUnion) AsFineTuningCancelResponseTrainingMethodTrainingMethodDpo() (v FineTuningCancelResponseTrainingMethodTrainingMethodDpo)

func (FineTuningCancelResponseTrainingMethodUnion) AsFineTuningCancelResponseTrainingMethodTrainingMethodSft

func (u FineTuningCancelResponseTrainingMethodUnion) AsFineTuningCancelResponseTrainingMethodTrainingMethodSft() (v FineTuningCancelResponseTrainingMethodTrainingMethodSft)

func (FineTuningCancelResponseTrainingMethodUnion) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningCancelResponseTrainingMethodUnion) UnmarshalJSON

func (r *FineTuningCancelResponseTrainingMethodUnion) UnmarshalJSON(data []byte) error

type FineTuningCancelResponseTrainingTypeFullTrainingType

type FineTuningCancelResponseTrainingTypeFullTrainingType struct {
	// Any of "Full".
	Type string `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningCancelResponseTrainingTypeFullTrainingType) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningCancelResponseTrainingTypeFullTrainingType) UnmarshalJSON

type FineTuningCancelResponseTrainingTypeLoRaTrainingType

type FineTuningCancelResponseTrainingTypeLoRaTrainingType struct {
	LoraAlpha int64 `json:"lora_alpha" api:"required"`
	LoraR     int64 `json:"lora_r" api:"required"`
	// Any of "Lora".
	Type                 string  `json:"type" api:"required"`
	LoraDropout          float64 `json:"lora_dropout"`
	LoraTrainableModules string  `json:"lora_trainable_modules"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		LoraAlpha            respjson.Field
		LoraR                respjson.Field
		Type                 respjson.Field
		LoraDropout          respjson.Field
		LoraTrainableModules respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningCancelResponseTrainingTypeLoRaTrainingType) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningCancelResponseTrainingTypeLoRaTrainingType) UnmarshalJSON

type FineTuningCancelResponseTrainingTypeUnion

type FineTuningCancelResponseTrainingTypeUnion struct {
	Type string `json:"type"`
	// This field is from variant
	// [FineTuningCancelResponseTrainingTypeLoRaTrainingType].
	LoraAlpha int64 `json:"lora_alpha"`
	// This field is from variant
	// [FineTuningCancelResponseTrainingTypeLoRaTrainingType].
	LoraR int64 `json:"lora_r"`
	// This field is from variant
	// [FineTuningCancelResponseTrainingTypeLoRaTrainingType].
	LoraDropout float64 `json:"lora_dropout"`
	// This field is from variant
	// [FineTuningCancelResponseTrainingTypeLoRaTrainingType].
	LoraTrainableModules string `json:"lora_trainable_modules"`
	JSON                 struct {
		Type                 respjson.Field
		LoraAlpha            respjson.Field
		LoraR                respjson.Field
		LoraDropout          respjson.Field
		LoraTrainableModules respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FineTuningCancelResponseTrainingTypeUnion contains all possible properties and values from FineTuningCancelResponseTrainingTypeFullTrainingType, FineTuningCancelResponseTrainingTypeLoRaTrainingType.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (FineTuningCancelResponseTrainingTypeUnion) AsFineTuningCancelResponseTrainingTypeFullTrainingType

func (u FineTuningCancelResponseTrainingTypeUnion) AsFineTuningCancelResponseTrainingTypeFullTrainingType() (v FineTuningCancelResponseTrainingTypeFullTrainingType)

func (FineTuningCancelResponseTrainingTypeUnion) AsFineTuningCancelResponseTrainingTypeLoRaTrainingType

func (u FineTuningCancelResponseTrainingTypeUnion) AsFineTuningCancelResponseTrainingTypeLoRaTrainingType() (v FineTuningCancelResponseTrainingTypeLoRaTrainingType)

func (FineTuningCancelResponseTrainingTypeUnion) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningCancelResponseTrainingTypeUnion) UnmarshalJSON

func (r *FineTuningCancelResponseTrainingTypeUnion) UnmarshalJSON(data []byte) error

type FineTuningContentParams

type FineTuningContentParams struct {
	// Fine-tune ID to download. A string that starts with `ft-`.
	FtID string `query:"ft_id" api:"required" json:"-"`
	// Specifies step number for checkpoint to download. Ignores `checkpoint` value if
	// set.
	CheckpointStep param.Opt[int64] `query:"checkpoint_step,omitzero" json:"-"`
	// Specifies checkpoint type to download - `merged` vs `adapter`. This field is
	// required if the checkpoint_step is not set.
	//
	// Any of "merged", "adapter", "model_output_path".
	Checkpoint FineTuningContentParamsCheckpoint `query:"checkpoint,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (FineTuningContentParams) URLQuery

func (r FineTuningContentParams) URLQuery() (v url.Values, err error)

URLQuery serializes FineTuningContentParams's query parameters as `url.Values`.

type FineTuningContentParamsCheckpoint

type FineTuningContentParamsCheckpoint string

Specifies checkpoint type to download - `merged` vs `adapter`. This field is required if the checkpoint_step is not set.

const (
	FineTuningContentParamsCheckpointMerged          FineTuningContentParamsCheckpoint = "merged"
	FineTuningContentParamsCheckpointAdapter         FineTuningContentParamsCheckpoint = "adapter"
	FineTuningContentParamsCheckpointModelOutputPath FineTuningContentParamsCheckpoint = "model_output_path"
)

type FineTuningDeleteParams

type FineTuningDeleteParams struct {
	// Deprecated and unused parameter.
	Force param.Opt[bool] `query:"force,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (FineTuningDeleteParams) URLQuery

func (r FineTuningDeleteParams) URLQuery() (v url.Values, err error)

URLQuery serializes FineTuningDeleteParams's query parameters as `url.Values`.

type FineTuningDeleteResponse

type FineTuningDeleteResponse struct {
	// Message indicating the result of the deletion
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningDeleteResponse) RawJSON

func (r FineTuningDeleteResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*FineTuningDeleteResponse) UnmarshalJSON

func (r *FineTuningDeleteResponse) UnmarshalJSON(data []byte) error

type FineTuningEstimatePriceParams added in v0.2.0

type FineTuningEstimatePriceParams struct {
	// File-ID of a training file uploaded to the Together API
	TrainingFile string `json:"training_file" api:"required"`
	// The checkpoint identifier to continue training from a previous fine-tuning job.
	// Format is `{$JOB_ID}` or `{$OUTPUT_MODEL_NAME}` or `{$JOB_ID}:{$STEP}` or
	// `{$OUTPUT_MODEL_NAME}:{$STEP}`. The step value is optional; without it, uses the
	// final checkpoint.
	FromCheckpoint param.Opt[string] `json:"from_checkpoint,omitzero"`
	// Name of the base model to run fine-tune job on
	Model param.Opt[string] `json:"model,omitzero"`
	// Number of complete passes through the training dataset (higher values may
	// improve results but increase cost and risk of overfitting)
	NEpochs param.Opt[int64] `json:"n_epochs,omitzero"`
	// Number of evaluations to be run on a given validation set during training
	NEvals param.Opt[int64] `json:"n_evals,omitzero"`
	// File-ID of a validation file uploaded to the Together API
	ValidationFile param.Opt[string] `json:"validation_file,omitzero"`
	// The training type to use. Defaults to LoRA if not provided.
	TrainingType FineTuningEstimatePriceParamsTrainingTypeUnion `json:"training_type,omitzero"`
	// The training method to use. 'sft' for Supervised Fine-Tuning or 'dpo' for Direct
	// Preference Optimization.
	TrainingMethod FineTuningEstimatePriceParamsTrainingMethodUnion `json:"training_method,omitzero"`
	// contains filtered or unexported fields
}

func (FineTuningEstimatePriceParams) MarshalJSON added in v0.2.0

func (r FineTuningEstimatePriceParams) MarshalJSON() (data []byte, err error)

func (*FineTuningEstimatePriceParams) UnmarshalJSON added in v0.2.0

func (r *FineTuningEstimatePriceParams) UnmarshalJSON(data []byte) error

type FineTuningEstimatePriceParamsTrainingMethodTrainingMethodDpo added in v0.2.0

type FineTuningEstimatePriceParamsTrainingMethodTrainingMethodDpo struct {
	// Any of "dpo".
	Method                        string             `json:"method,omitzero" api:"required"`
	DpoBeta                       param.Opt[float64] `json:"dpo_beta,omitzero"`
	DpoNormalizeLogratiosByLength param.Opt[bool]    `json:"dpo_normalize_logratios_by_length,omitzero"`
	DpoReferenceFree              param.Opt[bool]    `json:"dpo_reference_free,omitzero"`
	RpoAlpha                      param.Opt[float64] `json:"rpo_alpha,omitzero"`
	SimpoGamma                    param.Opt[float64] `json:"simpo_gamma,omitzero"`
	// contains filtered or unexported fields
}

The property Method is required.

func (FineTuningEstimatePriceParamsTrainingMethodTrainingMethodDpo) MarshalJSON added in v0.2.0

func (*FineTuningEstimatePriceParamsTrainingMethodTrainingMethodDpo) UnmarshalJSON added in v0.2.0

type FineTuningEstimatePriceParamsTrainingMethodTrainingMethodSft added in v0.2.0

type FineTuningEstimatePriceParamsTrainingMethodTrainingMethodSft struct {
	// Any of "sft".
	Method string `json:"method,omitzero" api:"required"`
	// Whether to mask user messages in conversational data or prompts in instruction
	// data.
	TrainOnInputs FineTuningEstimatePriceParamsTrainingMethodTrainingMethodSftTrainOnInputsUnion `json:"train_on_inputs,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The properties Method, TrainOnInputs are required.

func (FineTuningEstimatePriceParamsTrainingMethodTrainingMethodSft) MarshalJSON added in v0.2.0

func (*FineTuningEstimatePriceParamsTrainingMethodTrainingMethodSft) UnmarshalJSON added in v0.2.0

type FineTuningEstimatePriceParamsTrainingMethodTrainingMethodSftTrainOnInputsString added in v0.2.0

type FineTuningEstimatePriceParamsTrainingMethodTrainingMethodSftTrainOnInputsString string
const (
	FineTuningEstimatePriceParamsTrainingMethodTrainingMethodSftTrainOnInputsStringAuto FineTuningEstimatePriceParamsTrainingMethodTrainingMethodSftTrainOnInputsString = "auto"
)

type FineTuningEstimatePriceParamsTrainingMethodTrainingMethodSftTrainOnInputsUnion added in v0.2.0

type FineTuningEstimatePriceParamsTrainingMethodTrainingMethodSftTrainOnInputsUnion struct {
	OfBool param.Opt[bool] `json:",omitzero,inline"`
	// Check if union is this variant with
	// !param.IsOmitted(union.OfFineTuningEstimatePricesTrainingMethodTrainingMethodSftTrainOnInputsString)
	OfFineTuningEstimatePricesTrainingMethodTrainingMethodSftTrainOnInputsString param.Opt[string] `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (FineTuningEstimatePriceParamsTrainingMethodTrainingMethodSftTrainOnInputsUnion) MarshalJSON added in v0.2.0

func (*FineTuningEstimatePriceParamsTrainingMethodTrainingMethodSftTrainOnInputsUnion) UnmarshalJSON added in v0.2.0

type FineTuningEstimatePriceParamsTrainingMethodUnion added in v0.2.0

type FineTuningEstimatePriceParamsTrainingMethodUnion struct {
	OfFineTuningEstimatePricesTrainingMethodTrainingMethodSft *FineTuningEstimatePriceParamsTrainingMethodTrainingMethodSft `json:",omitzero,inline"`
	OfFineTuningEstimatePricesTrainingMethodTrainingMethodDpo *FineTuningEstimatePriceParamsTrainingMethodTrainingMethodDpo `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (FineTuningEstimatePriceParamsTrainingMethodUnion) GetDpoBeta added in v0.2.0

Returns a pointer to the underlying variant's property, if present.

func (FineTuningEstimatePriceParamsTrainingMethodUnion) GetDpoNormalizeLogratiosByLength added in v0.2.0

func (u FineTuningEstimatePriceParamsTrainingMethodUnion) GetDpoNormalizeLogratiosByLength() *bool

Returns a pointer to the underlying variant's property, if present.

func (FineTuningEstimatePriceParamsTrainingMethodUnion) GetDpoReferenceFree added in v0.2.0

func (u FineTuningEstimatePriceParamsTrainingMethodUnion) GetDpoReferenceFree() *bool

Returns a pointer to the underlying variant's property, if present.

func (FineTuningEstimatePriceParamsTrainingMethodUnion) GetMethod added in v0.2.0

Returns a pointer to the underlying variant's property, if present.

func (FineTuningEstimatePriceParamsTrainingMethodUnion) GetRpoAlpha added in v0.2.0

Returns a pointer to the underlying variant's property, if present.

func (FineTuningEstimatePriceParamsTrainingMethodUnion) GetSimpoGamma added in v0.2.0

Returns a pointer to the underlying variant's property, if present.

func (FineTuningEstimatePriceParamsTrainingMethodUnion) GetTrainOnInputs added in v0.2.0

Returns a pointer to the underlying variant's property, if present.

func (FineTuningEstimatePriceParamsTrainingMethodUnion) MarshalJSON added in v0.2.0

func (*FineTuningEstimatePriceParamsTrainingMethodUnion) UnmarshalJSON added in v0.2.0

type FineTuningEstimatePriceParamsTrainingTypeFullTrainingType added in v0.2.0

type FineTuningEstimatePriceParamsTrainingTypeFullTrainingType struct {
	// Any of "Full".
	Type string `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The property Type is required.

func (FineTuningEstimatePriceParamsTrainingTypeFullTrainingType) MarshalJSON added in v0.2.0

func (*FineTuningEstimatePriceParamsTrainingTypeFullTrainingType) UnmarshalJSON added in v0.2.0

type FineTuningEstimatePriceParamsTrainingTypeLoRaTrainingType added in v0.2.0

type FineTuningEstimatePriceParamsTrainingTypeLoRaTrainingType struct {
	LoraAlpha int64 `json:"lora_alpha" api:"required"`
	LoraR     int64 `json:"lora_r" api:"required"`
	// Any of "Lora".
	Type                 string             `json:"type,omitzero" api:"required"`
	LoraDropout          param.Opt[float64] `json:"lora_dropout,omitzero"`
	LoraTrainableModules param.Opt[string]  `json:"lora_trainable_modules,omitzero"`
	// contains filtered or unexported fields
}

The properties LoraAlpha, LoraR, Type are required.

func (FineTuningEstimatePriceParamsTrainingTypeLoRaTrainingType) MarshalJSON added in v0.2.0

func (*FineTuningEstimatePriceParamsTrainingTypeLoRaTrainingType) UnmarshalJSON added in v0.2.0

type FineTuningEstimatePriceParamsTrainingTypeUnion added in v0.2.0

type FineTuningEstimatePriceParamsTrainingTypeUnion struct {
	OfFineTuningEstimatePricesTrainingTypeFullTrainingType *FineTuningEstimatePriceParamsTrainingTypeFullTrainingType `json:",omitzero,inline"`
	OfFineTuningEstimatePricesTrainingTypeLoRaTrainingType *FineTuningEstimatePriceParamsTrainingTypeLoRaTrainingType `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (FineTuningEstimatePriceParamsTrainingTypeUnion) GetLoraAlpha added in v0.2.0

Returns a pointer to the underlying variant's property, if present.

func (FineTuningEstimatePriceParamsTrainingTypeUnion) GetLoraDropout added in v0.2.0

Returns a pointer to the underlying variant's property, if present.

func (FineTuningEstimatePriceParamsTrainingTypeUnion) GetLoraR added in v0.2.0

Returns a pointer to the underlying variant's property, if present.

func (FineTuningEstimatePriceParamsTrainingTypeUnion) GetLoraTrainableModules added in v0.2.0

func (u FineTuningEstimatePriceParamsTrainingTypeUnion) GetLoraTrainableModules() *string

Returns a pointer to the underlying variant's property, if present.

func (FineTuningEstimatePriceParamsTrainingTypeUnion) GetType added in v0.2.0

Returns a pointer to the underlying variant's property, if present.

func (FineTuningEstimatePriceParamsTrainingTypeUnion) MarshalJSON added in v0.2.0

func (*FineTuningEstimatePriceParamsTrainingTypeUnion) UnmarshalJSON added in v0.2.0

type FineTuningEstimatePriceResponse added in v0.2.0

type FineTuningEstimatePriceResponse struct {
	// Whether you are allowed to proceed with the fine-tuning job.
	AllowedToProceed bool `json:"allowed_to_proceed"`
	// The estimated number of tokens for evaluation
	EstimatedEvalTokenCount float64 `json:"estimated_eval_token_count"`
	// The price of the fine-tuning job
	EstimatedTotalPrice float64 `json:"estimated_total_price"`
	// The estimated number of tokens to be trained
	EstimatedTrainTokenCount float64 `json:"estimated_train_token_count"`
	// Your credit limit in dollars.
	UserLimit float64 `json:"user_limit"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AllowedToProceed         respjson.Field
		EstimatedEvalTokenCount  respjson.Field
		EstimatedTotalPrice      respjson.Field
		EstimatedTrainTokenCount respjson.Field
		UserLimit                respjson.Field
		ExtraFields              map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningEstimatePriceResponse) RawJSON added in v0.2.0

Returns the unmodified JSON received from the API

func (*FineTuningEstimatePriceResponse) UnmarshalJSON added in v0.2.0

func (r *FineTuningEstimatePriceResponse) UnmarshalJSON(data []byte) error

type FineTuningListCheckpointsResponse

type FineTuningListCheckpointsResponse struct {
	Data []FineTuningListCheckpointsResponseData `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningListCheckpointsResponse) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningListCheckpointsResponse) UnmarshalJSON

func (r *FineTuningListCheckpointsResponse) UnmarshalJSON(data []byte) error

type FineTuningListCheckpointsResponseData

type FineTuningListCheckpointsResponseData struct {
	CheckpointType string `json:"checkpoint_type" api:"required"`
	CreatedAt      string `json:"created_at" api:"required"`
	Path           string `json:"path" api:"required"`
	Step           int64  `json:"step" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CheckpointType respjson.Field
		CreatedAt      respjson.Field
		Path           respjson.Field
		Step           respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningListCheckpointsResponseData) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningListCheckpointsResponseData) UnmarshalJSON

func (r *FineTuningListCheckpointsResponseData) UnmarshalJSON(data []byte) error

type FineTuningListEventsResponse

type FineTuningListEventsResponse struct {
	Data []FinetuneEvent `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningListEventsResponse) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningListEventsResponse) UnmarshalJSON

func (r *FineTuningListEventsResponse) UnmarshalJSON(data []byte) error

type FineTuningListMetricsParams added in v0.10.0

type FineTuningListMetricsParams struct {
	// Return only metrics with global_step >= this value.
	GlobalStepFrom param.Opt[int64] `query:"global_step_from,omitzero" json:"-"`
	// Return only metrics with global_step <= this value.
	GlobalStepTo param.Opt[int64] `query:"global_step_to,omitzero" json:"-"`
	// Return only metrics logged at or after this ISO-8601 timestamp.
	LoggedAtFrom param.Opt[time.Time] `query:"logged_at_from,omitzero" format:"date-time" json:"-"`
	// Return only metrics logged at or before this ISO-8601 timestamp.
	LoggedAtTo param.Opt[time.Time] `query:"logged_at_to,omitzero" format:"date-time" json:"-"`
	// Number of (uniformly sampled) train metrics to return.
	Resolution param.Opt[int64] `query:"resolution,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (FineTuningListMetricsParams) URLQuery added in v0.10.0

func (r FineTuningListMetricsParams) URLQuery() (v url.Values, err error)

URLQuery serializes FineTuningListMetricsParams's query parameters as `url.Values`.

type FineTuningListMetricsResponse added in v0.10.0

type FineTuningListMetricsResponse struct {
	Metrics []map[string]float64 `json:"metrics"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Metrics     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningListMetricsResponse) RawJSON added in v0.10.0

Returns the unmodified JSON received from the API

func (*FineTuningListMetricsResponse) UnmarshalJSON added in v0.10.0

func (r *FineTuningListMetricsResponse) UnmarshalJSON(data []byte) error

type FineTuningListResponse

type FineTuningListResponse struct {
	Data []FineTuningListResponseData `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningListResponse) RawJSON

func (r FineTuningListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*FineTuningListResponse) UnmarshalJSON

func (r *FineTuningListResponse) UnmarshalJSON(data []byte) error

type FineTuningListResponseData

type FineTuningListResponseData struct {
	// Unique identifier for the fine-tune job
	ID string `json:"id" api:"required"`
	// Creation timestamp of the fine-tune job
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Any of "pending", "queued", "running", "compressing", "uploading",
	// "cancel_requested", "cancelled", "error", "completed".
	Status string `json:"status" api:"required"`
	// Last update timestamp of the fine-tune job
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// Batch size used for training
	BatchSize int64 `json:"batch_size"`
	// Events related to this fine-tune job
	Events []FinetuneEvent `json:"events"`
	// Checkpoint used to continue training
	FromCheckpoint string `json:"from_checkpoint"`
	// Hugging Face Hub repo to start training from
	FromHfModel string `json:"from_hf_model"`
	// The revision of the Hugging Face Hub model to continue training from
	HfModelRevision string `json:"hf_model_revision"`
	// Learning rate used for training
	LearningRate float64 `json:"learning_rate"`
	// Learning rate scheduler configuration
	LrScheduler FineTuningListResponseDataLrScheduler `json:"lr_scheduler"`
	// Maximum gradient norm for clipping
	MaxGradNorm float64 `json:"max_grad_norm"`
	// Maximum sequence length to use for training. If not specified, uses the maximum
	// allowed for the model and training method.
	MaxSeqLength int64 `json:"max_seq_length"`
	// Base model used for fine-tuning
	Model           string `json:"model"`
	ModelOutputName string `json:"model_output_name"`
	// Number of checkpoints saved during training
	NCheckpoints int64 `json:"n_checkpoints"`
	// Number of training epochs
	NEpochs int64 `json:"n_epochs"`
	// Number of evaluations during training
	NEvals int64 `json:"n_evals"`
	// Owner address information
	OwnerAddress string `json:"owner_address"`
	// Whether sequence packing is being used for training.
	Packing bool `json:"packing"`
	// Progress information for the fine-tuning job
	Progress FineTuningListResponseDataProgress `json:"progress"`
	// Random seed used for training. Integer when set; null if not stored (e.g. legacy
	// jobs) or no explicit seed was recorded.
	RandomSeed int64 `json:"random_seed" api:"nullable"`
	// Start timestamp of the current stage of the fine-tune job
	StartedAt time.Time `json:"started_at" format:"date-time"`
	// Suffix added to the fine-tuned model name
	Suffix string `json:"suffix"`
	// Count of tokens processed
	TokenCount int64 `json:"token_count"`
	// Total price for the fine-tuning job
	TotalPrice int64 `json:"total_price"`
	// File-ID of the training file
	TrainingFile string `json:"training_file"`
	// Method of training used
	TrainingMethod FineTuningListResponseDataTrainingMethodUnion `json:"training_method"`
	// Type of training used (full or LoRA)
	TrainingType FineTuningListResponseDataTrainingTypeUnion `json:"training_type"`
	// Identifier for who created the job.
	UserID string `json:"user_id"`
	// File-ID of the validation file
	ValidationFile string `json:"validation_file"`
	// Weights & Biases run name
	WandbName string `json:"wandb_name"`
	// Weights & Biases project name
	WandbProjectName string `json:"wandb_project_name"`
	// Ratio of warmup steps
	WarmupRatio float64 `json:"warmup_ratio"`
	// Weight decay value used
	WeightDecay float64 `json:"weight_decay"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID               respjson.Field
		CreatedAt        respjson.Field
		Status           respjson.Field
		UpdatedAt        respjson.Field
		BatchSize        respjson.Field
		Events           respjson.Field
		FromCheckpoint   respjson.Field
		FromHfModel      respjson.Field
		HfModelRevision  respjson.Field
		LearningRate     respjson.Field
		LrScheduler      respjson.Field
		MaxGradNorm      respjson.Field
		MaxSeqLength     respjson.Field
		Model            respjson.Field
		ModelOutputName  respjson.Field
		NCheckpoints     respjson.Field
		NEpochs          respjson.Field
		NEvals           respjson.Field
		OwnerAddress     respjson.Field
		Packing          respjson.Field
		Progress         respjson.Field
		RandomSeed       respjson.Field
		StartedAt        respjson.Field
		Suffix           respjson.Field
		TokenCount       respjson.Field
		TotalPrice       respjson.Field
		TrainingFile     respjson.Field
		TrainingMethod   respjson.Field
		TrainingType     respjson.Field
		UserID           respjson.Field
		ValidationFile   respjson.Field
		WandbName        respjson.Field
		WandbProjectName respjson.Field
		WarmupRatio      respjson.Field
		WeightDecay      respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A truncated version of the fine-tune response, used for POST /fine-tunes, GET /fine-tunes and POST /fine-tunes/{id}/cancel endpoints

func (FineTuningListResponseData) RawJSON

func (r FineTuningListResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*FineTuningListResponseData) UnmarshalJSON

func (r *FineTuningListResponseData) UnmarshalJSON(data []byte) error

type FineTuningListResponseDataLrScheduler

type FineTuningListResponseDataLrScheduler struct {
	// Any of "linear", "cosine".
	LrSchedulerType string                                                    `json:"lr_scheduler_type" api:"required"`
	LrSchedulerArgs FineTuningListResponseDataLrSchedulerLrSchedulerArgsUnion `json:"lr_scheduler_args"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		LrSchedulerType respjson.Field
		LrSchedulerArgs respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Learning rate scheduler configuration

func (FineTuningListResponseDataLrScheduler) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningListResponseDataLrScheduler) UnmarshalJSON

func (r *FineTuningListResponseDataLrScheduler) UnmarshalJSON(data []byte) error

type FineTuningListResponseDataLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs

type FineTuningListResponseDataLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs struct {
	// The ratio of the final learning rate to the peak learning rate
	MinLrRatio float64 `json:"min_lr_ratio" api:"required"`
	// Number or fraction of cycles for the cosine learning rate scheduler
	NumCycles float64 `json:"num_cycles" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MinLrRatio  respjson.Field
		NumCycles   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningListResponseDataLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningListResponseDataLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs) UnmarshalJSON

type FineTuningListResponseDataLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs

type FineTuningListResponseDataLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs struct {
	// The ratio of the final learning rate to the peak learning rate
	MinLrRatio float64 `json:"min_lr_ratio"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MinLrRatio  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningListResponseDataLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningListResponseDataLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs) UnmarshalJSON

type FineTuningListResponseDataLrSchedulerLrSchedulerArgsUnion

type FineTuningListResponseDataLrSchedulerLrSchedulerArgsUnion struct {
	MinLrRatio float64 `json:"min_lr_ratio"`
	// This field is from variant
	// [FineTuningListResponseDataLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs].
	NumCycles float64 `json:"num_cycles"`
	JSON      struct {
		MinLrRatio respjson.Field
		NumCycles  respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FineTuningListResponseDataLrSchedulerLrSchedulerArgsUnion contains all possible properties and values from FineTuningListResponseDataLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs, FineTuningListResponseDataLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (FineTuningListResponseDataLrSchedulerLrSchedulerArgsUnion) AsFineTuningListResponseDataLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs

func (u FineTuningListResponseDataLrSchedulerLrSchedulerArgsUnion) AsFineTuningListResponseDataLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs() (v FineTuningListResponseDataLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs)

func (FineTuningListResponseDataLrSchedulerLrSchedulerArgsUnion) AsFineTuningListResponseDataLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs

func (u FineTuningListResponseDataLrSchedulerLrSchedulerArgsUnion) AsFineTuningListResponseDataLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs() (v FineTuningListResponseDataLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs)

func (FineTuningListResponseDataLrSchedulerLrSchedulerArgsUnion) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningListResponseDataLrSchedulerLrSchedulerArgsUnion) UnmarshalJSON

type FineTuningListResponseDataProgress added in v0.2.0

type FineTuningListResponseDataProgress struct {
	// Whether time estimate is available
	EstimateAvailable bool `json:"estimate_available" api:"required"`
	// Estimated time remaining in seconds for the fine-tuning job to next state
	SecondsRemaining int64 `json:"seconds_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		EstimateAvailable respjson.Field
		SecondsRemaining  respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Progress information for the fine-tuning job

func (FineTuningListResponseDataProgress) RawJSON added in v0.2.0

Returns the unmodified JSON received from the API

func (*FineTuningListResponseDataProgress) UnmarshalJSON added in v0.2.0

func (r *FineTuningListResponseDataProgress) UnmarshalJSON(data []byte) error

type FineTuningListResponseDataTrainingMethodTrainingMethodDpo

type FineTuningListResponseDataTrainingMethodTrainingMethodDpo struct {
	// Any of "dpo".
	Method                        string  `json:"method" api:"required"`
	DpoBeta                       float64 `json:"dpo_beta"`
	DpoNormalizeLogratiosByLength bool    `json:"dpo_normalize_logratios_by_length"`
	DpoReferenceFree              bool    `json:"dpo_reference_free"`
	RpoAlpha                      float64 `json:"rpo_alpha"`
	SimpoGamma                    float64 `json:"simpo_gamma"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Method                        respjson.Field
		DpoBeta                       respjson.Field
		DpoNormalizeLogratiosByLength respjson.Field
		DpoReferenceFree              respjson.Field
		RpoAlpha                      respjson.Field
		SimpoGamma                    respjson.Field
		ExtraFields                   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningListResponseDataTrainingMethodTrainingMethodDpo) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningListResponseDataTrainingMethodTrainingMethodDpo) UnmarshalJSON

type FineTuningListResponseDataTrainingMethodTrainingMethodSft

type FineTuningListResponseDataTrainingMethodTrainingMethodSft struct {
	// Any of "sft".
	Method string `json:"method" api:"required"`
	// Whether to mask user messages in conversational data or prompts in instruction
	// data.
	TrainOnInputs FineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsUnion `json:"train_on_inputs" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Method        respjson.Field
		TrainOnInputs respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningListResponseDataTrainingMethodTrainingMethodSft) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningListResponseDataTrainingMethodTrainingMethodSft) UnmarshalJSON

type FineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsString

type FineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsString string
const (
	FineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsStringAuto FineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsString = "auto"
)

type FineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsUnion

type FineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsUnion struct {
	// This field will be present if the value is a [bool] instead of an object.
	OfBool bool `json:",inline"`
	// This field will be present if the value is a [string] instead of an object.
	OfFineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsString string `json:",inline"`
	JSON                                                                           struct {
		OfBool                                                                         respjson.Field
		OfFineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsString respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsUnion contains all possible properties and values from [bool], [string].

Use the methods beginning with 'As' to cast the union to one of its variants.

If the underlying value is not a json object, one of the following properties will be valid: OfBool OfFineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsString]

func (FineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsBool

func (FineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsFineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsString

func (u FineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsFineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsString() (v string)

func (FineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsUnion) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsUnion) UnmarshalJSON

type FineTuningListResponseDataTrainingMethodUnion

type FineTuningListResponseDataTrainingMethodUnion struct {
	Method string `json:"method"`
	// This field is from variant
	// [FineTuningListResponseDataTrainingMethodTrainingMethodSft].
	TrainOnInputs FineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsUnion `json:"train_on_inputs"`
	// This field is from variant
	// [FineTuningListResponseDataTrainingMethodTrainingMethodDpo].
	DpoBeta float64 `json:"dpo_beta"`
	// This field is from variant
	// [FineTuningListResponseDataTrainingMethodTrainingMethodDpo].
	DpoNormalizeLogratiosByLength bool `json:"dpo_normalize_logratios_by_length"`
	// This field is from variant
	// [FineTuningListResponseDataTrainingMethodTrainingMethodDpo].
	DpoReferenceFree bool `json:"dpo_reference_free"`
	// This field is from variant
	// [FineTuningListResponseDataTrainingMethodTrainingMethodDpo].
	RpoAlpha float64 `json:"rpo_alpha"`
	// This field is from variant
	// [FineTuningListResponseDataTrainingMethodTrainingMethodDpo].
	SimpoGamma float64 `json:"simpo_gamma"`
	JSON       struct {
		Method                        respjson.Field
		TrainOnInputs                 respjson.Field
		DpoBeta                       respjson.Field
		DpoNormalizeLogratiosByLength respjson.Field
		DpoReferenceFree              respjson.Field
		RpoAlpha                      respjson.Field
		SimpoGamma                    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FineTuningListResponseDataTrainingMethodUnion contains all possible properties and values from FineTuningListResponseDataTrainingMethodTrainingMethodSft, FineTuningListResponseDataTrainingMethodTrainingMethodDpo.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (FineTuningListResponseDataTrainingMethodUnion) AsFineTuningListResponseDataTrainingMethodTrainingMethodDpo

func (u FineTuningListResponseDataTrainingMethodUnion) AsFineTuningListResponseDataTrainingMethodTrainingMethodDpo() (v FineTuningListResponseDataTrainingMethodTrainingMethodDpo)

func (FineTuningListResponseDataTrainingMethodUnion) AsFineTuningListResponseDataTrainingMethodTrainingMethodSft

func (u FineTuningListResponseDataTrainingMethodUnion) AsFineTuningListResponseDataTrainingMethodTrainingMethodSft() (v FineTuningListResponseDataTrainingMethodTrainingMethodSft)

func (FineTuningListResponseDataTrainingMethodUnion) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningListResponseDataTrainingMethodUnion) UnmarshalJSON

func (r *FineTuningListResponseDataTrainingMethodUnion) UnmarshalJSON(data []byte) error

type FineTuningListResponseDataTrainingTypeFullTrainingType

type FineTuningListResponseDataTrainingTypeFullTrainingType struct {
	// Any of "Full".
	Type string `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningListResponseDataTrainingTypeFullTrainingType) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningListResponseDataTrainingTypeFullTrainingType) UnmarshalJSON

type FineTuningListResponseDataTrainingTypeLoRaTrainingType

type FineTuningListResponseDataTrainingTypeLoRaTrainingType struct {
	LoraAlpha int64 `json:"lora_alpha" api:"required"`
	LoraR     int64 `json:"lora_r" api:"required"`
	// Any of "Lora".
	Type                 string  `json:"type" api:"required"`
	LoraDropout          float64 `json:"lora_dropout"`
	LoraTrainableModules string  `json:"lora_trainable_modules"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		LoraAlpha            respjson.Field
		LoraR                respjson.Field
		Type                 respjson.Field
		LoraDropout          respjson.Field
		LoraTrainableModules respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningListResponseDataTrainingTypeLoRaTrainingType) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningListResponseDataTrainingTypeLoRaTrainingType) UnmarshalJSON

type FineTuningListResponseDataTrainingTypeUnion

type FineTuningListResponseDataTrainingTypeUnion struct {
	Type string `json:"type"`
	// This field is from variant
	// [FineTuningListResponseDataTrainingTypeLoRaTrainingType].
	LoraAlpha int64 `json:"lora_alpha"`
	// This field is from variant
	// [FineTuningListResponseDataTrainingTypeLoRaTrainingType].
	LoraR int64 `json:"lora_r"`
	// This field is from variant
	// [FineTuningListResponseDataTrainingTypeLoRaTrainingType].
	LoraDropout float64 `json:"lora_dropout"`
	// This field is from variant
	// [FineTuningListResponseDataTrainingTypeLoRaTrainingType].
	LoraTrainableModules string `json:"lora_trainable_modules"`
	JSON                 struct {
		Type                 respjson.Field
		LoraAlpha            respjson.Field
		LoraR                respjson.Field
		LoraDropout          respjson.Field
		LoraTrainableModules respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FineTuningListResponseDataTrainingTypeUnion contains all possible properties and values from FineTuningListResponseDataTrainingTypeFullTrainingType, FineTuningListResponseDataTrainingTypeLoRaTrainingType.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (FineTuningListResponseDataTrainingTypeUnion) AsFineTuningListResponseDataTrainingTypeFullTrainingType

func (u FineTuningListResponseDataTrainingTypeUnion) AsFineTuningListResponseDataTrainingTypeFullTrainingType() (v FineTuningListResponseDataTrainingTypeFullTrainingType)

func (FineTuningListResponseDataTrainingTypeUnion) AsFineTuningListResponseDataTrainingTypeLoRaTrainingType

func (u FineTuningListResponseDataTrainingTypeUnion) AsFineTuningListResponseDataTrainingTypeLoRaTrainingType() (v FineTuningListResponseDataTrainingTypeLoRaTrainingType)

func (FineTuningListResponseDataTrainingTypeUnion) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningListResponseDataTrainingTypeUnion) UnmarshalJSON

func (r *FineTuningListResponseDataTrainingTypeUnion) UnmarshalJSON(data []byte) error

type FineTuningNewParams

type FineTuningNewParams struct {
	// Name of the base model to run fine-tune job on
	Model string `json:"model" api:"required"`
	// File-ID of a training file uploaded to the Together API
	TrainingFile string `json:"training_file" api:"required"`
	// Random seed for reproducible training. When set, the same seed produces the same
	// run (e.g. data shuffle, init). If omitted or null, the server applies its
	// default seed (e.g. 42).
	RandomSeed param.Opt[int64] `json:"random_seed,omitzero"`
	// The checkpoint identifier to continue training from a previous fine-tuning job.
	// Format is `{$JOB_ID}` or `{$OUTPUT_MODEL_NAME}` or `{$JOB_ID}:{$STEP}` or
	// `{$OUTPUT_MODEL_NAME}:{$STEP}`. The step value is optional; without it, uses the
	// final checkpoint.
	FromCheckpoint param.Opt[string] `json:"from_checkpoint,omitzero"`
	// The Hugging Face Hub repo to start training from. Should be as close as possible
	// to the base model (specified by the `model` argument) in terms of architecture
	// and size.
	FromHfModel param.Opt[string] `json:"from_hf_model,omitzero"`
	// Number of steps to accumulate gradients before performing a weight update. If
	// omitted or set to 0, the model default is used.
	GradientAccumulationSteps param.Opt[int64] `json:"gradient_accumulation_steps,omitzero"`
	// The API token for the Hugging Face Hub.
	HfAPIToken param.Opt[string] `json:"hf_api_token,omitzero"`
	// The revision of the Hugging Face Hub model to continue training from. E.g.,
	// hf_model_revision=main (default, used if the argument is not provided) or
	// hf_model_revision='607a30d783dfa663caf39e06633721c8d4cfcd7e' (specific commit).
	HfModelRevision param.Opt[string] `json:"hf_model_revision,omitzero"`
	// The name of the Hugging Face repository to upload the fine-tuned model to.
	HfOutputRepoName param.Opt[string] `json:"hf_output_repo_name,omitzero"`
	// Controls how quickly the model adapts to new information (too high may cause
	// instability, too low may slow convergence)
	LearningRate param.Opt[float64] `json:"learning_rate,omitzero"`
	// Max gradient norm to be used for gradient clipping. Set to 0 to disable.
	MaxGradNorm param.Opt[float64] `json:"max_grad_norm,omitzero"`
	// Maximum sequence length to use for training. If not specified, the maximum
	// allowed for the model and training method will be used.
	MaxSeqLength param.Opt[int64] `json:"max_seq_length,omitzero"`
	// Number of intermediate model versions saved during training for evaluation
	NCheckpoints param.Opt[int64] `json:"n_checkpoints,omitzero"`
	// Number of complete passes through the training dataset (higher values may
	// improve results but increase cost and risk of overfitting)
	NEpochs param.Opt[int64] `json:"n_epochs,omitzero"`
	// Number of evaluations to be run on a given validation set during training
	NEvals param.Opt[int64] `json:"n_evals,omitzero"`
	// Whether to use sequence packing for training.
	Packing param.Opt[bool] `json:"packing,omitzero"`
	// Suffix to add to your fine-tuned model name. Must be at most 64 characters long.
	Suffix param.Opt[string] `json:"suffix,omitzero"`
	// File-ID of a validation file uploaded to the Together API
	ValidationFile param.Opt[string] `json:"validation_file,omitzero"`
	// Integration key for tracking experiments and model metrics on W&B platform
	WandbAPIKey param.Opt[string] `json:"wandb_api_key,omitzero"`
	// The base URL of a dedicated Weights & Biases instance.
	WandbBaseURL param.Opt[string] `json:"wandb_base_url,omitzero"`
	// The Weights & Biases entity for your run.
	WandbEntity param.Opt[string] `json:"wandb_entity,omitzero"`
	// The Weights & Biases name for your run.
	WandbName param.Opt[string] `json:"wandb_name,omitzero"`
	// The Weights & Biases project for your run. If not specified, uses `together` as
	// the project name.
	WandbProjectName param.Opt[string] `json:"wandb_project_name,omitzero"`
	// The percent of steps at the start of training to linearly increase the learning
	// rate.
	WarmupRatio param.Opt[float64] `json:"warmup_ratio,omitzero"`
	// Weight decay. Regularization parameter for the optimizer.
	WeightDecay param.Opt[float64] `json:"weight_decay,omitzero"`
	// The training type to use. Defaults to LoRA if not provided.
	TrainingType FineTuningNewParamsTrainingTypeUnion `json:"training_type,omitzero"`
	// Number of training examples processed together (larger batches use more memory
	// but may train faster). Defaults to "max". We use training optimizations like
	// packing, so the effective batch size may be different than the value you set.
	BatchSize FineTuningNewParamsBatchSizeUnion `json:"batch_size,omitzero"`
	// The learning rate scheduler to use. It specifies how the learning rate is
	// adjusted during training.
	LrScheduler      FineTuningNewParamsLrScheduler      `json:"lr_scheduler,omitzero"`
	MultimodalParams FineTuningNewParamsMultimodalParams `json:"multimodal_params,omitzero"`
	// Whether to mask user messages in conversational data or prompts in instruction
	// data.
	TrainOnInputs FineTuningNewParamsTrainOnInputsUnion `json:"train_on_inputs,omitzero"`
	// The training method to use. 'sft' for Supervised Fine-Tuning or 'dpo' for Direct
	// Preference Optimization.
	TrainingMethod FineTuningNewParamsTrainingMethodUnion `json:"training_method,omitzero"`
	// contains filtered or unexported fields
}

func (FineTuningNewParams) MarshalJSON

func (r FineTuningNewParams) MarshalJSON() (data []byte, err error)

func (*FineTuningNewParams) UnmarshalJSON

func (r *FineTuningNewParams) UnmarshalJSON(data []byte) error

type FineTuningNewParamsBatchSizeString

type FineTuningNewParamsBatchSizeString string
const (
	FineTuningNewParamsBatchSizeStringMax FineTuningNewParamsBatchSizeString = "max"
)

type FineTuningNewParamsBatchSizeUnion

type FineTuningNewParamsBatchSizeUnion struct {
	OfInt param.Opt[int64] `json:",omitzero,inline"`
	// Check if union is this variant with
	// !param.IsOmitted(union.OfFineTuningNewsBatchSizeString)
	OfFineTuningNewsBatchSizeString param.Opt[string] `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (FineTuningNewParamsBatchSizeUnion) MarshalJSON

func (u FineTuningNewParamsBatchSizeUnion) MarshalJSON() ([]byte, error)

func (*FineTuningNewParamsBatchSizeUnion) UnmarshalJSON

func (u *FineTuningNewParamsBatchSizeUnion) UnmarshalJSON(data []byte) error

type FineTuningNewParamsLrScheduler

type FineTuningNewParamsLrScheduler struct {
	// Any of "linear", "cosine".
	LrSchedulerType string                                             `json:"lr_scheduler_type,omitzero" api:"required"`
	LrSchedulerArgs FineTuningNewParamsLrSchedulerLrSchedulerArgsUnion `json:"lr_scheduler_args,omitzero"`
	// contains filtered or unexported fields
}

The learning rate scheduler to use. It specifies how the learning rate is adjusted during training.

The property LrSchedulerType is required.

func (FineTuningNewParamsLrScheduler) MarshalJSON

func (r FineTuningNewParamsLrScheduler) MarshalJSON() (data []byte, err error)

func (*FineTuningNewParamsLrScheduler) UnmarshalJSON

func (r *FineTuningNewParamsLrScheduler) UnmarshalJSON(data []byte) error

type FineTuningNewParamsLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs

type FineTuningNewParamsLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs struct {
	// The ratio of the final learning rate to the peak learning rate
	MinLrRatio float64 `json:"min_lr_ratio" api:"required"`
	// Number or fraction of cycles for the cosine learning rate scheduler
	NumCycles float64 `json:"num_cycles" api:"required"`
	// contains filtered or unexported fields
}

The properties MinLrRatio, NumCycles are required.

func (FineTuningNewParamsLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs) MarshalJSON

func (*FineTuningNewParamsLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs) UnmarshalJSON

type FineTuningNewParamsLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs

type FineTuningNewParamsLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs struct {
	// The ratio of the final learning rate to the peak learning rate
	MinLrRatio param.Opt[float64] `json:"min_lr_ratio,omitzero"`
	// contains filtered or unexported fields
}

func (FineTuningNewParamsLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs) MarshalJSON

func (*FineTuningNewParamsLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs) UnmarshalJSON

type FineTuningNewParamsLrSchedulerLrSchedulerArgsUnion

type FineTuningNewParamsLrSchedulerLrSchedulerArgsUnion struct {
	OfFineTuningNewsLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs *FineTuningNewParamsLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs `json:",omitzero,inline"`
	OfFineTuningNewsLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs *FineTuningNewParamsLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (FineTuningNewParamsLrSchedulerLrSchedulerArgsUnion) GetMinLrRatio

Returns a pointer to the underlying variant's property, if present.

func (FineTuningNewParamsLrSchedulerLrSchedulerArgsUnion) GetNumCycles

Returns a pointer to the underlying variant's property, if present.

func (FineTuningNewParamsLrSchedulerLrSchedulerArgsUnion) MarshalJSON

func (*FineTuningNewParamsLrSchedulerLrSchedulerArgsUnion) UnmarshalJSON

type FineTuningNewParamsMultimodalParams added in v0.4.0

type FineTuningNewParamsMultimodalParams struct {
	// Whether to train the vision encoder of the model. Only available for multimodal
	// models.
	TrainVision param.Opt[bool] `json:"train_vision,omitzero"`
	// contains filtered or unexported fields
}

func (FineTuningNewParamsMultimodalParams) MarshalJSON added in v0.4.0

func (r FineTuningNewParamsMultimodalParams) MarshalJSON() (data []byte, err error)

func (*FineTuningNewParamsMultimodalParams) UnmarshalJSON added in v0.4.0

func (r *FineTuningNewParamsMultimodalParams) UnmarshalJSON(data []byte) error

type FineTuningNewParamsTrainOnInputsString

type FineTuningNewParamsTrainOnInputsString string
const (
	FineTuningNewParamsTrainOnInputsStringAuto FineTuningNewParamsTrainOnInputsString = "auto"
)

type FineTuningNewParamsTrainOnInputsUnion

type FineTuningNewParamsTrainOnInputsUnion struct {
	OfBool param.Opt[bool] `json:",omitzero,inline"`
	// Check if union is this variant with
	// !param.IsOmitted(union.OfFineTuningNewsTrainOnInputsString)
	OfFineTuningNewsTrainOnInputsString param.Opt[string] `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (FineTuningNewParamsTrainOnInputsUnion) MarshalJSON

func (u FineTuningNewParamsTrainOnInputsUnion) MarshalJSON() ([]byte, error)

func (*FineTuningNewParamsTrainOnInputsUnion) UnmarshalJSON

func (u *FineTuningNewParamsTrainOnInputsUnion) UnmarshalJSON(data []byte) error

type FineTuningNewParamsTrainingMethodTrainingMethodDpo

type FineTuningNewParamsTrainingMethodTrainingMethodDpo struct {
	// Any of "dpo".
	Method                        string             `json:"method,omitzero" api:"required"`
	DpoBeta                       param.Opt[float64] `json:"dpo_beta,omitzero"`
	DpoNormalizeLogratiosByLength param.Opt[bool]    `json:"dpo_normalize_logratios_by_length,omitzero"`
	DpoReferenceFree              param.Opt[bool]    `json:"dpo_reference_free,omitzero"`
	RpoAlpha                      param.Opt[float64] `json:"rpo_alpha,omitzero"`
	SimpoGamma                    param.Opt[float64] `json:"simpo_gamma,omitzero"`
	// contains filtered or unexported fields
}

The property Method is required.

func (FineTuningNewParamsTrainingMethodTrainingMethodDpo) MarshalJSON

func (r FineTuningNewParamsTrainingMethodTrainingMethodDpo) MarshalJSON() (data []byte, err error)

func (*FineTuningNewParamsTrainingMethodTrainingMethodDpo) UnmarshalJSON

type FineTuningNewParamsTrainingMethodTrainingMethodSft

type FineTuningNewParamsTrainingMethodTrainingMethodSft struct {
	// Any of "sft".
	Method string `json:"method,omitzero" api:"required"`
	// Whether to mask user messages in conversational data or prompts in instruction
	// data.
	TrainOnInputs FineTuningNewParamsTrainingMethodTrainingMethodSftTrainOnInputsUnion `json:"train_on_inputs,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The properties Method, TrainOnInputs are required.

func (FineTuningNewParamsTrainingMethodTrainingMethodSft) MarshalJSON

func (r FineTuningNewParamsTrainingMethodTrainingMethodSft) MarshalJSON() (data []byte, err error)

func (*FineTuningNewParamsTrainingMethodTrainingMethodSft) UnmarshalJSON

type FineTuningNewParamsTrainingMethodTrainingMethodSftTrainOnInputsString

type FineTuningNewParamsTrainingMethodTrainingMethodSftTrainOnInputsString string
const (
	FineTuningNewParamsTrainingMethodTrainingMethodSftTrainOnInputsStringAuto FineTuningNewParamsTrainingMethodTrainingMethodSftTrainOnInputsString = "auto"
)

type FineTuningNewParamsTrainingMethodTrainingMethodSftTrainOnInputsUnion

type FineTuningNewParamsTrainingMethodTrainingMethodSftTrainOnInputsUnion struct {
	OfBool param.Opt[bool] `json:",omitzero,inline"`
	// Check if union is this variant with
	// !param.IsOmitted(union.OfFineTuningNewsTrainingMethodTrainingMethodSftTrainOnInputsString)
	OfFineTuningNewsTrainingMethodTrainingMethodSftTrainOnInputsString param.Opt[string] `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (FineTuningNewParamsTrainingMethodTrainingMethodSftTrainOnInputsUnion) MarshalJSON

func (*FineTuningNewParamsTrainingMethodTrainingMethodSftTrainOnInputsUnion) UnmarshalJSON

type FineTuningNewParamsTrainingMethodUnion

type FineTuningNewParamsTrainingMethodUnion struct {
	OfFineTuningNewsTrainingMethodTrainingMethodSft *FineTuningNewParamsTrainingMethodTrainingMethodSft `json:",omitzero,inline"`
	OfFineTuningNewsTrainingMethodTrainingMethodDpo *FineTuningNewParamsTrainingMethodTrainingMethodDpo `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (FineTuningNewParamsTrainingMethodUnion) GetDpoBeta

Returns a pointer to the underlying variant's property, if present.

func (FineTuningNewParamsTrainingMethodUnion) GetDpoNormalizeLogratiosByLength

func (u FineTuningNewParamsTrainingMethodUnion) GetDpoNormalizeLogratiosByLength() *bool

Returns a pointer to the underlying variant's property, if present.

func (FineTuningNewParamsTrainingMethodUnion) GetDpoReferenceFree

func (u FineTuningNewParamsTrainingMethodUnion) GetDpoReferenceFree() *bool

Returns a pointer to the underlying variant's property, if present.

func (FineTuningNewParamsTrainingMethodUnion) GetMethod

Returns a pointer to the underlying variant's property, if present.

func (FineTuningNewParamsTrainingMethodUnion) GetRpoAlpha

Returns a pointer to the underlying variant's property, if present.

func (FineTuningNewParamsTrainingMethodUnion) GetSimpoGamma

Returns a pointer to the underlying variant's property, if present.

func (FineTuningNewParamsTrainingMethodUnion) GetTrainOnInputs

Returns a pointer to the underlying variant's property, if present.

func (FineTuningNewParamsTrainingMethodUnion) MarshalJSON

func (u FineTuningNewParamsTrainingMethodUnion) MarshalJSON() ([]byte, error)

func (*FineTuningNewParamsTrainingMethodUnion) UnmarshalJSON

func (u *FineTuningNewParamsTrainingMethodUnion) UnmarshalJSON(data []byte) error

type FineTuningNewParamsTrainingTypeFullTrainingType

type FineTuningNewParamsTrainingTypeFullTrainingType struct {
	// Any of "Full".
	Type string `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The property Type is required.

func (FineTuningNewParamsTrainingTypeFullTrainingType) MarshalJSON

func (r FineTuningNewParamsTrainingTypeFullTrainingType) MarshalJSON() (data []byte, err error)

func (*FineTuningNewParamsTrainingTypeFullTrainingType) UnmarshalJSON

type FineTuningNewParamsTrainingTypeLoRaTrainingType

type FineTuningNewParamsTrainingTypeLoRaTrainingType struct {
	LoraAlpha int64 `json:"lora_alpha" api:"required"`
	LoraR     int64 `json:"lora_r" api:"required"`
	// Any of "Lora".
	Type                 string             `json:"type,omitzero" api:"required"`
	LoraDropout          param.Opt[float64] `json:"lora_dropout,omitzero"`
	LoraTrainableModules param.Opt[string]  `json:"lora_trainable_modules,omitzero"`
	// contains filtered or unexported fields
}

The properties LoraAlpha, LoraR, Type are required.

func (FineTuningNewParamsTrainingTypeLoRaTrainingType) MarshalJSON

func (r FineTuningNewParamsTrainingTypeLoRaTrainingType) MarshalJSON() (data []byte, err error)

func (*FineTuningNewParamsTrainingTypeLoRaTrainingType) UnmarshalJSON

type FineTuningNewParamsTrainingTypeUnion

type FineTuningNewParamsTrainingTypeUnion struct {
	OfFineTuningNewsTrainingTypeFullTrainingType *FineTuningNewParamsTrainingTypeFullTrainingType `json:",omitzero,inline"`
	OfFineTuningNewsTrainingTypeLoRaTrainingType *FineTuningNewParamsTrainingTypeLoRaTrainingType `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (FineTuningNewParamsTrainingTypeUnion) GetLoraAlpha

func (u FineTuningNewParamsTrainingTypeUnion) GetLoraAlpha() *int64

Returns a pointer to the underlying variant's property, if present.

func (FineTuningNewParamsTrainingTypeUnion) GetLoraDropout

func (u FineTuningNewParamsTrainingTypeUnion) GetLoraDropout() *float64

Returns a pointer to the underlying variant's property, if present.

func (FineTuningNewParamsTrainingTypeUnion) GetLoraR

Returns a pointer to the underlying variant's property, if present.

func (FineTuningNewParamsTrainingTypeUnion) GetLoraTrainableModules

func (u FineTuningNewParamsTrainingTypeUnion) GetLoraTrainableModules() *string

Returns a pointer to the underlying variant's property, if present.

func (FineTuningNewParamsTrainingTypeUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (FineTuningNewParamsTrainingTypeUnion) MarshalJSON

func (u FineTuningNewParamsTrainingTypeUnion) MarshalJSON() ([]byte, error)

func (*FineTuningNewParamsTrainingTypeUnion) UnmarshalJSON

func (u *FineTuningNewParamsTrainingTypeUnion) UnmarshalJSON(data []byte) error

type FineTuningNewResponse

type FineTuningNewResponse struct {
	// Unique identifier for the fine-tune job
	ID string `json:"id" api:"required"`
	// Creation timestamp of the fine-tune job
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Any of "pending", "queued", "running", "compressing", "uploading",
	// "cancel_requested", "cancelled", "error", "completed".
	Status FineTuningNewResponseStatus `json:"status" api:"required"`
	// Last update timestamp of the fine-tune job
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// Batch size used for training
	BatchSize int64 `json:"batch_size"`
	// Events related to this fine-tune job
	Events []FinetuneEvent `json:"events"`
	// Checkpoint used to continue training
	FromCheckpoint string `json:"from_checkpoint"`
	// Hugging Face Hub repo to start training from
	FromHfModel string `json:"from_hf_model"`
	// The revision of the Hugging Face Hub model to continue training from
	HfModelRevision string `json:"hf_model_revision"`
	// Learning rate used for training
	LearningRate float64 `json:"learning_rate"`
	// Learning rate scheduler configuration
	LrScheduler FineTuningNewResponseLrScheduler `json:"lr_scheduler"`
	// Maximum gradient norm for clipping
	MaxGradNorm float64 `json:"max_grad_norm"`
	// Maximum sequence length to use for training. If not specified, uses the maximum
	// allowed for the model and training method.
	MaxSeqLength int64 `json:"max_seq_length"`
	// Base model used for fine-tuning
	Model           string `json:"model"`
	ModelOutputName string `json:"model_output_name"`
	// Number of checkpoints saved during training
	NCheckpoints int64 `json:"n_checkpoints"`
	// Number of training epochs
	NEpochs int64 `json:"n_epochs"`
	// Number of evaluations during training
	NEvals int64 `json:"n_evals"`
	// Owner address information
	OwnerAddress string `json:"owner_address"`
	// Whether sequence packing is being used for training.
	Packing bool `json:"packing"`
	// Progress information for the fine-tuning job
	Progress FineTuningNewResponseProgress `json:"progress"`
	// Random seed used for training. Integer when set; null if not stored (e.g. legacy
	// jobs) or no explicit seed was recorded.
	RandomSeed int64 `json:"random_seed" api:"nullable"`
	// Start timestamp of the current stage of the fine-tune job
	StartedAt time.Time `json:"started_at" format:"date-time"`
	// Suffix added to the fine-tuned model name
	Suffix string `json:"suffix"`
	// Count of tokens processed
	TokenCount int64 `json:"token_count"`
	// Total price for the fine-tuning job
	TotalPrice int64 `json:"total_price"`
	// File-ID of the training file
	TrainingFile string `json:"training_file"`
	// Method of training used
	TrainingMethod FineTuningNewResponseTrainingMethodUnion `json:"training_method"`
	// Type of training used (full or LoRA)
	TrainingType FineTuningNewResponseTrainingTypeUnion `json:"training_type"`
	// Identifier for who created the job.
	UserID string `json:"user_id"`
	// File-ID of the validation file
	ValidationFile string `json:"validation_file"`
	// Weights & Biases run name
	WandbName string `json:"wandb_name"`
	// Weights & Biases project name
	WandbProjectName string `json:"wandb_project_name"`
	// Ratio of warmup steps
	WarmupRatio float64 `json:"warmup_ratio"`
	// Weight decay value used
	WeightDecay float64 `json:"weight_decay"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID               respjson.Field
		CreatedAt        respjson.Field
		Status           respjson.Field
		UpdatedAt        respjson.Field
		BatchSize        respjson.Field
		Events           respjson.Field
		FromCheckpoint   respjson.Field
		FromHfModel      respjson.Field
		HfModelRevision  respjson.Field
		LearningRate     respjson.Field
		LrScheduler      respjson.Field
		MaxGradNorm      respjson.Field
		MaxSeqLength     respjson.Field
		Model            respjson.Field
		ModelOutputName  respjson.Field
		NCheckpoints     respjson.Field
		NEpochs          respjson.Field
		NEvals           respjson.Field
		OwnerAddress     respjson.Field
		Packing          respjson.Field
		Progress         respjson.Field
		RandomSeed       respjson.Field
		StartedAt        respjson.Field
		Suffix           respjson.Field
		TokenCount       respjson.Field
		TotalPrice       respjson.Field
		TrainingFile     respjson.Field
		TrainingMethod   respjson.Field
		TrainingType     respjson.Field
		UserID           respjson.Field
		ValidationFile   respjson.Field
		WandbName        respjson.Field
		WandbProjectName respjson.Field
		WarmupRatio      respjson.Field
		WeightDecay      respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A truncated version of the fine-tune response, used for POST /fine-tunes, GET /fine-tunes and POST /fine-tunes/{id}/cancel endpoints

func (FineTuningNewResponse) RawJSON

func (r FineTuningNewResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*FineTuningNewResponse) UnmarshalJSON

func (r *FineTuningNewResponse) UnmarshalJSON(data []byte) error

type FineTuningNewResponseLrScheduler

type FineTuningNewResponseLrScheduler struct {
	// Any of "linear", "cosine".
	LrSchedulerType string                                               `json:"lr_scheduler_type" api:"required"`
	LrSchedulerArgs FineTuningNewResponseLrSchedulerLrSchedulerArgsUnion `json:"lr_scheduler_args"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		LrSchedulerType respjson.Field
		LrSchedulerArgs respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Learning rate scheduler configuration

func (FineTuningNewResponseLrScheduler) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningNewResponseLrScheduler) UnmarshalJSON

func (r *FineTuningNewResponseLrScheduler) UnmarshalJSON(data []byte) error

type FineTuningNewResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs

type FineTuningNewResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs struct {
	// The ratio of the final learning rate to the peak learning rate
	MinLrRatio float64 `json:"min_lr_ratio" api:"required"`
	// Number or fraction of cycles for the cosine learning rate scheduler
	NumCycles float64 `json:"num_cycles" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MinLrRatio  respjson.Field
		NumCycles   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningNewResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningNewResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs) UnmarshalJSON

type FineTuningNewResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs

type FineTuningNewResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs struct {
	// The ratio of the final learning rate to the peak learning rate
	MinLrRatio float64 `json:"min_lr_ratio"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MinLrRatio  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningNewResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningNewResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs) UnmarshalJSON

type FineTuningNewResponseLrSchedulerLrSchedulerArgsUnion

type FineTuningNewResponseLrSchedulerLrSchedulerArgsUnion struct {
	MinLrRatio float64 `json:"min_lr_ratio"`
	// This field is from variant
	// [FineTuningNewResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs].
	NumCycles float64 `json:"num_cycles"`
	JSON      struct {
		MinLrRatio respjson.Field
		NumCycles  respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FineTuningNewResponseLrSchedulerLrSchedulerArgsUnion contains all possible properties and values from FineTuningNewResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs, FineTuningNewResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (FineTuningNewResponseLrSchedulerLrSchedulerArgsUnion) AsFineTuningNewResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs

func (u FineTuningNewResponseLrSchedulerLrSchedulerArgsUnion) AsFineTuningNewResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs() (v FineTuningNewResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs)

func (FineTuningNewResponseLrSchedulerLrSchedulerArgsUnion) AsFineTuningNewResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs

func (u FineTuningNewResponseLrSchedulerLrSchedulerArgsUnion) AsFineTuningNewResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs() (v FineTuningNewResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs)

func (FineTuningNewResponseLrSchedulerLrSchedulerArgsUnion) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningNewResponseLrSchedulerLrSchedulerArgsUnion) UnmarshalJSON

type FineTuningNewResponseProgress added in v0.2.0

type FineTuningNewResponseProgress struct {
	// Whether time estimate is available
	EstimateAvailable bool `json:"estimate_available" api:"required"`
	// Estimated time remaining in seconds for the fine-tuning job to next state
	SecondsRemaining int64 `json:"seconds_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		EstimateAvailable respjson.Field
		SecondsRemaining  respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Progress information for the fine-tuning job

func (FineTuningNewResponseProgress) RawJSON added in v0.2.0

Returns the unmodified JSON received from the API

func (*FineTuningNewResponseProgress) UnmarshalJSON added in v0.2.0

func (r *FineTuningNewResponseProgress) UnmarshalJSON(data []byte) error

type FineTuningNewResponseStatus

type FineTuningNewResponseStatus string
const (
	FineTuningNewResponseStatusPending         FineTuningNewResponseStatus = "pending"
	FineTuningNewResponseStatusQueued          FineTuningNewResponseStatus = "queued"
	FineTuningNewResponseStatusRunning         FineTuningNewResponseStatus = "running"
	FineTuningNewResponseStatusCompressing     FineTuningNewResponseStatus = "compressing"
	FineTuningNewResponseStatusUploading       FineTuningNewResponseStatus = "uploading"
	FineTuningNewResponseStatusCancelRequested FineTuningNewResponseStatus = "cancel_requested"
	FineTuningNewResponseStatusCancelled       FineTuningNewResponseStatus = "cancelled"
	FineTuningNewResponseStatusError           FineTuningNewResponseStatus = "error"
	FineTuningNewResponseStatusCompleted       FineTuningNewResponseStatus = "completed"
)

type FineTuningNewResponseTrainingMethodTrainingMethodDpo

type FineTuningNewResponseTrainingMethodTrainingMethodDpo struct {
	// Any of "dpo".
	Method                        string  `json:"method" api:"required"`
	DpoBeta                       float64 `json:"dpo_beta"`
	DpoNormalizeLogratiosByLength bool    `json:"dpo_normalize_logratios_by_length"`
	DpoReferenceFree              bool    `json:"dpo_reference_free"`
	RpoAlpha                      float64 `json:"rpo_alpha"`
	SimpoGamma                    float64 `json:"simpo_gamma"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Method                        respjson.Field
		DpoBeta                       respjson.Field
		DpoNormalizeLogratiosByLength respjson.Field
		DpoReferenceFree              respjson.Field
		RpoAlpha                      respjson.Field
		SimpoGamma                    respjson.Field
		ExtraFields                   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningNewResponseTrainingMethodTrainingMethodDpo) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningNewResponseTrainingMethodTrainingMethodDpo) UnmarshalJSON

type FineTuningNewResponseTrainingMethodTrainingMethodSft

type FineTuningNewResponseTrainingMethodTrainingMethodSft struct {
	// Any of "sft".
	Method string `json:"method" api:"required"`
	// Whether to mask user messages in conversational data or prompts in instruction
	// data.
	TrainOnInputs FineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion `json:"train_on_inputs" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Method        respjson.Field
		TrainOnInputs respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningNewResponseTrainingMethodTrainingMethodSft) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningNewResponseTrainingMethodTrainingMethodSft) UnmarshalJSON

type FineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsString

type FineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsString string
const (
	FineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsStringAuto FineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsString = "auto"
)

type FineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion

type FineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion struct {
	// This field will be present if the value is a [bool] instead of an object.
	OfBool bool `json:",inline"`
	// This field will be present if the value is a [string] instead of an object.
	OfFineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsString string `json:",inline"`
	JSON                                                                      struct {
		OfBool                                                                    respjson.Field
		OfFineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsString respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion contains all possible properties and values from [bool], [string].

Use the methods beginning with 'As' to cast the union to one of its variants.

If the underlying value is not a json object, one of the following properties will be valid: OfBool OfFineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsString]

func (FineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsBool

func (FineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsFineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsString

func (u FineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsFineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsString() (v string)

func (FineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) UnmarshalJSON

type FineTuningNewResponseTrainingMethodUnion

type FineTuningNewResponseTrainingMethodUnion struct {
	Method string `json:"method"`
	// This field is from variant
	// [FineTuningNewResponseTrainingMethodTrainingMethodSft].
	TrainOnInputs FineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion `json:"train_on_inputs"`
	// This field is from variant
	// [FineTuningNewResponseTrainingMethodTrainingMethodDpo].
	DpoBeta float64 `json:"dpo_beta"`
	// This field is from variant
	// [FineTuningNewResponseTrainingMethodTrainingMethodDpo].
	DpoNormalizeLogratiosByLength bool `json:"dpo_normalize_logratios_by_length"`
	// This field is from variant
	// [FineTuningNewResponseTrainingMethodTrainingMethodDpo].
	DpoReferenceFree bool `json:"dpo_reference_free"`
	// This field is from variant
	// [FineTuningNewResponseTrainingMethodTrainingMethodDpo].
	RpoAlpha float64 `json:"rpo_alpha"`
	// This field is from variant
	// [FineTuningNewResponseTrainingMethodTrainingMethodDpo].
	SimpoGamma float64 `json:"simpo_gamma"`
	JSON       struct {
		Method                        respjson.Field
		TrainOnInputs                 respjson.Field
		DpoBeta                       respjson.Field
		DpoNormalizeLogratiosByLength respjson.Field
		DpoReferenceFree              respjson.Field
		RpoAlpha                      respjson.Field
		SimpoGamma                    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FineTuningNewResponseTrainingMethodUnion contains all possible properties and values from FineTuningNewResponseTrainingMethodTrainingMethodSft, FineTuningNewResponseTrainingMethodTrainingMethodDpo.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (FineTuningNewResponseTrainingMethodUnion) AsFineTuningNewResponseTrainingMethodTrainingMethodDpo

func (u FineTuningNewResponseTrainingMethodUnion) AsFineTuningNewResponseTrainingMethodTrainingMethodDpo() (v FineTuningNewResponseTrainingMethodTrainingMethodDpo)

func (FineTuningNewResponseTrainingMethodUnion) AsFineTuningNewResponseTrainingMethodTrainingMethodSft

func (u FineTuningNewResponseTrainingMethodUnion) AsFineTuningNewResponseTrainingMethodTrainingMethodSft() (v FineTuningNewResponseTrainingMethodTrainingMethodSft)

func (FineTuningNewResponseTrainingMethodUnion) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningNewResponseTrainingMethodUnion) UnmarshalJSON

func (r *FineTuningNewResponseTrainingMethodUnion) UnmarshalJSON(data []byte) error

type FineTuningNewResponseTrainingTypeFullTrainingType

type FineTuningNewResponseTrainingTypeFullTrainingType struct {
	// Any of "Full".
	Type string `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningNewResponseTrainingTypeFullTrainingType) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningNewResponseTrainingTypeFullTrainingType) UnmarshalJSON

type FineTuningNewResponseTrainingTypeLoRaTrainingType

type FineTuningNewResponseTrainingTypeLoRaTrainingType struct {
	LoraAlpha int64 `json:"lora_alpha" api:"required"`
	LoraR     int64 `json:"lora_r" api:"required"`
	// Any of "Lora".
	Type                 string  `json:"type" api:"required"`
	LoraDropout          float64 `json:"lora_dropout"`
	LoraTrainableModules string  `json:"lora_trainable_modules"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		LoraAlpha            respjson.Field
		LoraR                respjson.Field
		Type                 respjson.Field
		LoraDropout          respjson.Field
		LoraTrainableModules respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningNewResponseTrainingTypeLoRaTrainingType) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningNewResponseTrainingTypeLoRaTrainingType) UnmarshalJSON

type FineTuningNewResponseTrainingTypeUnion

type FineTuningNewResponseTrainingTypeUnion struct {
	Type string `json:"type"`
	// This field is from variant [FineTuningNewResponseTrainingTypeLoRaTrainingType].
	LoraAlpha int64 `json:"lora_alpha"`
	// This field is from variant [FineTuningNewResponseTrainingTypeLoRaTrainingType].
	LoraR int64 `json:"lora_r"`
	// This field is from variant [FineTuningNewResponseTrainingTypeLoRaTrainingType].
	LoraDropout float64 `json:"lora_dropout"`
	// This field is from variant [FineTuningNewResponseTrainingTypeLoRaTrainingType].
	LoraTrainableModules string `json:"lora_trainable_modules"`
	JSON                 struct {
		Type                 respjson.Field
		LoraAlpha            respjson.Field
		LoraR                respjson.Field
		LoraDropout          respjson.Field
		LoraTrainableModules respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FineTuningNewResponseTrainingTypeUnion contains all possible properties and values from FineTuningNewResponseTrainingTypeFullTrainingType, FineTuningNewResponseTrainingTypeLoRaTrainingType.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (FineTuningNewResponseTrainingTypeUnion) AsFineTuningNewResponseTrainingTypeFullTrainingType

func (u FineTuningNewResponseTrainingTypeUnion) AsFineTuningNewResponseTrainingTypeFullTrainingType() (v FineTuningNewResponseTrainingTypeFullTrainingType)

func (FineTuningNewResponseTrainingTypeUnion) AsFineTuningNewResponseTrainingTypeLoRaTrainingType

func (u FineTuningNewResponseTrainingTypeUnion) AsFineTuningNewResponseTrainingTypeLoRaTrainingType() (v FineTuningNewResponseTrainingTypeLoRaTrainingType)

func (FineTuningNewResponseTrainingTypeUnion) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningNewResponseTrainingTypeUnion) UnmarshalJSON

func (r *FineTuningNewResponseTrainingTypeUnion) UnmarshalJSON(data []byte) error

type FineTuningService

type FineTuningService struct {
	Options []option.RequestOption
}

FineTuningService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewFineTuningService method instead.

func NewFineTuningService

func NewFineTuningService(opts ...option.RequestOption) (r FineTuningService)

NewFineTuningService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*FineTuningService) Cancel

Cancel a currently running fine-tuning job. Returns a FinetuneResponseTruncated object.

func (*FineTuningService) Content

func (r *FineTuningService) Content(ctx context.Context, query FineTuningContentParams, opts ...option.RequestOption) (res *http.Response, err error)

Receive a compressed fine-tuned model or checkpoint.

func (*FineTuningService) Delete

Delete a fine-tuning job.

func (*FineTuningService) EstimatePrice added in v0.2.0

Estimate the price of a fine-tuning job.

func (*FineTuningService) Get

func (r *FineTuningService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *FinetuneResponse, err error)

List the metadata for a single fine-tuning job.

func (*FineTuningService) List

List the metadata for all fine-tuning jobs. Returns a list of FinetuneResponseTruncated objects.

func (*FineTuningService) ListCheckpoints

func (r *FineTuningService) ListCheckpoints(ctx context.Context, id string, opts ...option.RequestOption) (res *FineTuningListCheckpointsResponse, err error)

List the checkpoints for a single fine-tuning job.

func (*FineTuningService) ListEvents

func (r *FineTuningService) ListEvents(ctx context.Context, id string, opts ...option.RequestOption) (res *FineTuningListEventsResponse, err error)

List the events for a single fine-tuning job.

func (*FineTuningService) ListMetrics added in v0.10.0

Retrieves recorded training metrics for a fine-tuning job in chronological order. All query parameters are optional: omit them to retrieve all metrics.

func (*FineTuningService) New

Create a fine-tuning job with the provided model and training data.

type FinetuneEvent

type FinetuneEvent struct {
	CheckpointPath string `json:"checkpoint_path" api:"required"`
	CreatedAt      string `json:"created_at" api:"required"`
	Hash           string `json:"hash" api:"required"`
	Message        string `json:"message" api:"required"`
	ModelPath      string `json:"model_path" api:"required"`
	// The object type, which is always `fine-tune-event`.
	Object         constant.FineTuneEvent `json:"object" default:"fine-tune-event"`
	ParamCount     int64                  `json:"param_count" api:"required"`
	Step           int64                  `json:"step" api:"required"`
	TokenCount     int64                  `json:"token_count" api:"required"`
	TotalSteps     int64                  `json:"total_steps" api:"required"`
	TrainingOffset int64                  `json:"training_offset" api:"required"`
	// Any of "job_pending", "job_start", "job_stopped", "model_downloading",
	// "model_download_complete", "training_data_downloading",
	// "training_data_download_complete", "validation_data_downloading",
	// "validation_data_download_complete", "wandb_init", "training_start",
	// "checkpoint_save", "billing_limit", "epoch_complete", "training_complete",
	// "model_compressing", "model_compression_complete", "model_uploading",
	// "model_upload_complete", "job_complete", "job_error", "cancel_requested",
	// "job_restarted", "refund", "warning".
	Type     FinetuneEventType `json:"type" api:"required"`
	WandbURL string            `json:"wandb_url" api:"required"`
	// Any of "info", "warning", "error", "legacy_info", "legacy_iwarning",
	// "legacy_ierror".
	Level FinetuneEventLevel `json:"level" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CheckpointPath respjson.Field
		CreatedAt      respjson.Field
		Hash           respjson.Field
		Message        respjson.Field
		ModelPath      respjson.Field
		Object         respjson.Field
		ParamCount     respjson.Field
		Step           respjson.Field
		TokenCount     respjson.Field
		TotalSteps     respjson.Field
		TrainingOffset respjson.Field
		Type           respjson.Field
		WandbURL       respjson.Field
		Level          respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FinetuneEvent) RawJSON

func (r FinetuneEvent) RawJSON() string

Returns the unmodified JSON received from the API

func (*FinetuneEvent) UnmarshalJSON

func (r *FinetuneEvent) UnmarshalJSON(data []byte) error

type FinetuneEventLevel

type FinetuneEventLevel string
const (
	FinetuneEventLevelInfo           FinetuneEventLevel = "info"
	FinetuneEventLevelWarning        FinetuneEventLevel = "warning"
	FinetuneEventLevelError          FinetuneEventLevel = "error"
	FinetuneEventLevelLegacyInfo     FinetuneEventLevel = "legacy_info"
	FinetuneEventLevelLegacyIwarning FinetuneEventLevel = "legacy_iwarning"
	FinetuneEventLevelLegacyIerror   FinetuneEventLevel = "legacy_ierror"
)

type FinetuneEventType

type FinetuneEventType string
const (
	FinetuneEventTypeJobPending                     FinetuneEventType = "job_pending"
	FinetuneEventTypeJobStart                       FinetuneEventType = "job_start"
	FinetuneEventTypeJobStopped                     FinetuneEventType = "job_stopped"
	FinetuneEventTypeModelDownloading               FinetuneEventType = "model_downloading"
	FinetuneEventTypeModelDownloadComplete          FinetuneEventType = "model_download_complete"
	FinetuneEventTypeTrainingDataDownloading        FinetuneEventType = "training_data_downloading"
	FinetuneEventTypeTrainingDataDownloadComplete   FinetuneEventType = "training_data_download_complete"
	FinetuneEventTypeValidationDataDownloading      FinetuneEventType = "validation_data_downloading"
	FinetuneEventTypeValidationDataDownloadComplete FinetuneEventType = "validation_data_download_complete"
	FinetuneEventTypeWandbInit                      FinetuneEventType = "wandb_init"
	FinetuneEventTypeTrainingStart                  FinetuneEventType = "training_start"
	FinetuneEventTypeCheckpointSave                 FinetuneEventType = "checkpoint_save"
	FinetuneEventTypeBillingLimit                   FinetuneEventType = "billing_limit"
	FinetuneEventTypeEpochComplete                  FinetuneEventType = "epoch_complete"
	FinetuneEventTypeTrainingComplete               FinetuneEventType = "training_complete"
	FinetuneEventTypeModelCompressing               FinetuneEventType = "model_compressing"
	FinetuneEventTypeModelCompressionComplete       FinetuneEventType = "model_compression_complete"
	FinetuneEventTypeModelUploading                 FinetuneEventType = "model_uploading"
	FinetuneEventTypeModelUploadComplete            FinetuneEventType = "model_upload_complete"
	FinetuneEventTypeJobComplete                    FinetuneEventType = "job_complete"
	FinetuneEventTypeJobError                       FinetuneEventType = "job_error"
	FinetuneEventTypeCancelRequested                FinetuneEventType = "cancel_requested"
	FinetuneEventTypeJobRestarted                   FinetuneEventType = "job_restarted"
	FinetuneEventTypeRefund                         FinetuneEventType = "refund"
	FinetuneEventTypeWarning                        FinetuneEventType = "warning"
)

type FinetuneResponse

type FinetuneResponse struct {
	ID string `json:"id" api:"required" format:"uuid"`
	// Any of "pending", "queued", "running", "compressing", "uploading",
	// "cancel_requested", "cancelled", "error", "completed".
	Status           FinetuneResponseStatus           `json:"status" api:"required"`
	BatchSize        FinetuneResponseBatchSizeUnion   `json:"batch_size"`
	CreatedAt        time.Time                        `json:"created_at" format:"date-time"`
	EpochsCompleted  int64                            `json:"epochs_completed"`
	EvalSteps        int64                            `json:"eval_steps"`
	Events           []FinetuneEvent                  `json:"events"`
	FromCheckpoint   string                           `json:"from_checkpoint"`
	FromHfModel      string                           `json:"from_hf_model"`
	HfModelRevision  string                           `json:"hf_model_revision"`
	JobID            string                           `json:"job_id"`
	LearningRate     float64                          `json:"learning_rate"`
	LrScheduler      FinetuneResponseLrScheduler      `json:"lr_scheduler"`
	MaxGradNorm      float64                          `json:"max_grad_norm"`
	Model            string                           `json:"model"`
	ModelOutputName  string                           `json:"model_output_name"`
	ModelOutputPath  string                           `json:"model_output_path"`
	MultimodalParams FinetuneResponseMultimodalParams `json:"multimodal_params"`
	NCheckpoints     int64                            `json:"n_checkpoints"`
	NEpochs          int64                            `json:"n_epochs"`
	NEvals           int64                            `json:"n_evals"`
	ParamCount       int64                            `json:"param_count"`
	// Progress information for a fine-tuning job
	Progress             FinetuneResponseProgress            `json:"progress"`
	QueueDepth           int64                               `json:"queue_depth"`
	StartedAt            time.Time                           `json:"started_at" format:"date-time"`
	TokenCount           int64                               `json:"token_count"`
	TotalPrice           int64                               `json:"total_price"`
	TrainOnInputs        FinetuneResponseTrainOnInputsUnion  `json:"train_on_inputs"`
	TrainingFile         string                              `json:"training_file"`
	TrainingMethod       FinetuneResponseTrainingMethodUnion `json:"training_method"`
	TrainingType         FinetuneResponseTrainingTypeUnion   `json:"training_type"`
	TrainingfileNumlines int64                               `json:"trainingfile_numlines"`
	TrainingfileSize     int64                               `json:"trainingfile_size"`
	UpdatedAt            time.Time                           `json:"updated_at" format:"date-time"`
	ValidationFile       string                              `json:"validation_file"`
	WandbProjectName     string                              `json:"wandb_project_name"`
	WandbURL             string                              `json:"wandb_url"`
	WarmupRatio          float64                             `json:"warmup_ratio"`
	WeightDecay          float64                             `json:"weight_decay"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                   respjson.Field
		Status               respjson.Field
		BatchSize            respjson.Field
		CreatedAt            respjson.Field
		EpochsCompleted      respjson.Field
		EvalSteps            respjson.Field
		Events               respjson.Field
		FromCheckpoint       respjson.Field
		FromHfModel          respjson.Field
		HfModelRevision      respjson.Field
		JobID                respjson.Field
		LearningRate         respjson.Field
		LrScheduler          respjson.Field
		MaxGradNorm          respjson.Field
		Model                respjson.Field
		ModelOutputName      respjson.Field
		ModelOutputPath      respjson.Field
		MultimodalParams     respjson.Field
		NCheckpoints         respjson.Field
		NEpochs              respjson.Field
		NEvals               respjson.Field
		ParamCount           respjson.Field
		Progress             respjson.Field
		QueueDepth           respjson.Field
		StartedAt            respjson.Field
		TokenCount           respjson.Field
		TotalPrice           respjson.Field
		TrainOnInputs        respjson.Field
		TrainingFile         respjson.Field
		TrainingMethod       respjson.Field
		TrainingType         respjson.Field
		TrainingfileNumlines respjson.Field
		TrainingfileSize     respjson.Field
		UpdatedAt            respjson.Field
		ValidationFile       respjson.Field
		WandbProjectName     respjson.Field
		WandbURL             respjson.Field
		WarmupRatio          respjson.Field
		WeightDecay          respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FinetuneResponse) RawJSON

func (r FinetuneResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*FinetuneResponse) UnmarshalJSON

func (r *FinetuneResponse) UnmarshalJSON(data []byte) error

type FinetuneResponseBatchSizeString

type FinetuneResponseBatchSizeString string
const (
	FinetuneResponseBatchSizeStringMax FinetuneResponseBatchSizeString = "max"
)

type FinetuneResponseBatchSizeUnion

type FinetuneResponseBatchSizeUnion struct {
	// This field will be present if the value is a [int64] instead of an object.
	OfInt int64 `json:",inline"`
	// This field will be present if the value is a [string] instead of an object.
	OfFinetuneResponseBatchSizeString string `json:",inline"`
	JSON                              struct {
		OfInt                             respjson.Field
		OfFinetuneResponseBatchSizeString respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FinetuneResponseBatchSizeUnion contains all possible properties and values from [int64], [string].

Use the methods beginning with 'As' to cast the union to one of its variants.

If the underlying value is not a json object, one of the following properties will be valid: OfInt OfFinetuneResponseBatchSizeString]

func (FinetuneResponseBatchSizeUnion) AsFinetuneResponseBatchSizeString

func (u FinetuneResponseBatchSizeUnion) AsFinetuneResponseBatchSizeString() (v string)

func (FinetuneResponseBatchSizeUnion) AsInt

func (u FinetuneResponseBatchSizeUnion) AsInt() (v int64)

func (FinetuneResponseBatchSizeUnion) RawJSON

Returns the unmodified JSON received from the API

func (*FinetuneResponseBatchSizeUnion) UnmarshalJSON

func (r *FinetuneResponseBatchSizeUnion) UnmarshalJSON(data []byte) error

type FinetuneResponseLrScheduler

type FinetuneResponseLrScheduler struct {
	// Any of "linear", "cosine".
	LrSchedulerType string                                          `json:"lr_scheduler_type" api:"required"`
	LrSchedulerArgs FinetuneResponseLrSchedulerLrSchedulerArgsUnion `json:"lr_scheduler_args"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		LrSchedulerType respjson.Field
		LrSchedulerArgs respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FinetuneResponseLrScheduler) RawJSON

func (r FinetuneResponseLrScheduler) RawJSON() string

Returns the unmodified JSON received from the API

func (*FinetuneResponseLrScheduler) UnmarshalJSON

func (r *FinetuneResponseLrScheduler) UnmarshalJSON(data []byte) error

type FinetuneResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs

type FinetuneResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs struct {
	// The ratio of the final learning rate to the peak learning rate
	MinLrRatio float64 `json:"min_lr_ratio" api:"required"`
	// Number or fraction of cycles for the cosine learning rate scheduler
	NumCycles float64 `json:"num_cycles" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MinLrRatio  respjson.Field
		NumCycles   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FinetuneResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs) RawJSON

Returns the unmodified JSON received from the API

func (*FinetuneResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs) UnmarshalJSON

type FinetuneResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs

type FinetuneResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs struct {
	// The ratio of the final learning rate to the peak learning rate
	MinLrRatio float64 `json:"min_lr_ratio"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MinLrRatio  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FinetuneResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs) RawJSON

Returns the unmodified JSON received from the API

func (*FinetuneResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs) UnmarshalJSON

type FinetuneResponseLrSchedulerLrSchedulerArgsUnion

type FinetuneResponseLrSchedulerLrSchedulerArgsUnion struct {
	MinLrRatio float64 `json:"min_lr_ratio"`
	// This field is from variant
	// [FinetuneResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs].
	NumCycles float64 `json:"num_cycles"`
	JSON      struct {
		MinLrRatio respjson.Field
		NumCycles  respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FinetuneResponseLrSchedulerLrSchedulerArgsUnion contains all possible properties and values from FinetuneResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs, FinetuneResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (FinetuneResponseLrSchedulerLrSchedulerArgsUnion) AsFinetuneResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs

func (u FinetuneResponseLrSchedulerLrSchedulerArgsUnion) AsFinetuneResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs() (v FinetuneResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs)

func (FinetuneResponseLrSchedulerLrSchedulerArgsUnion) AsFinetuneResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs

func (u FinetuneResponseLrSchedulerLrSchedulerArgsUnion) AsFinetuneResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs() (v FinetuneResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs)

func (FinetuneResponseLrSchedulerLrSchedulerArgsUnion) RawJSON

Returns the unmodified JSON received from the API

func (*FinetuneResponseLrSchedulerLrSchedulerArgsUnion) UnmarshalJSON

type FinetuneResponseMultimodalParams added in v0.4.0

type FinetuneResponseMultimodalParams struct {
	// Whether to train the vision encoder of the model. Only available for multimodal
	// models.
	TrainVision bool `json:"train_vision"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		TrainVision respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FinetuneResponseMultimodalParams) RawJSON added in v0.4.0

Returns the unmodified JSON received from the API

func (*FinetuneResponseMultimodalParams) UnmarshalJSON added in v0.4.0

func (r *FinetuneResponseMultimodalParams) UnmarshalJSON(data []byte) error

type FinetuneResponseProgress added in v0.2.0

type FinetuneResponseProgress struct {
	// Whether time estimate is available
	EstimateAvailable bool `json:"estimate_available" api:"required"`
	// Estimated time remaining in seconds for the fine-tuning job to next state
	SecondsRemaining int64 `json:"seconds_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		EstimateAvailable respjson.Field
		SecondsRemaining  respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Progress information for a fine-tuning job

func (FinetuneResponseProgress) RawJSON added in v0.2.0

func (r FinetuneResponseProgress) RawJSON() string

Returns the unmodified JSON received from the API

func (*FinetuneResponseProgress) UnmarshalJSON added in v0.2.0

func (r *FinetuneResponseProgress) UnmarshalJSON(data []byte) error

type FinetuneResponseStatus

type FinetuneResponseStatus string
const (
	FinetuneResponseStatusPending         FinetuneResponseStatus = "pending"
	FinetuneResponseStatusQueued          FinetuneResponseStatus = "queued"
	FinetuneResponseStatusRunning         FinetuneResponseStatus = "running"
	FinetuneResponseStatusCompressing     FinetuneResponseStatus = "compressing"
	FinetuneResponseStatusUploading       FinetuneResponseStatus = "uploading"
	FinetuneResponseStatusCancelRequested FinetuneResponseStatus = "cancel_requested"
	FinetuneResponseStatusCancelled       FinetuneResponseStatus = "cancelled"
	FinetuneResponseStatusError           FinetuneResponseStatus = "error"
	FinetuneResponseStatusCompleted       FinetuneResponseStatus = "completed"
)

type FinetuneResponseTrainOnInputsString

type FinetuneResponseTrainOnInputsString string
const (
	FinetuneResponseTrainOnInputsStringAuto FinetuneResponseTrainOnInputsString = "auto"
)

type FinetuneResponseTrainOnInputsUnion

type FinetuneResponseTrainOnInputsUnion struct {
	// This field will be present if the value is a [bool] instead of an object.
	OfBool bool `json:",inline"`
	// This field will be present if the value is a [string] instead of an object.
	OfFinetuneResponseTrainOnInputsString string `json:",inline"`
	JSON                                  struct {
		OfBool                                respjson.Field
		OfFinetuneResponseTrainOnInputsString respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FinetuneResponseTrainOnInputsUnion contains all possible properties and values from [bool], [string].

Use the methods beginning with 'As' to cast the union to one of its variants.

If the underlying value is not a json object, one of the following properties will be valid: OfBool OfFinetuneResponseTrainOnInputsString]

func (FinetuneResponseTrainOnInputsUnion) AsBool

func (FinetuneResponseTrainOnInputsUnion) AsFinetuneResponseTrainOnInputsString

func (u FinetuneResponseTrainOnInputsUnion) AsFinetuneResponseTrainOnInputsString() (v string)

func (FinetuneResponseTrainOnInputsUnion) RawJSON

Returns the unmodified JSON received from the API

func (*FinetuneResponseTrainOnInputsUnion) UnmarshalJSON

func (r *FinetuneResponseTrainOnInputsUnion) UnmarshalJSON(data []byte) error

type FinetuneResponseTrainingMethodTrainingMethodDpo

type FinetuneResponseTrainingMethodTrainingMethodDpo struct {
	// Any of "dpo".
	Method                        string  `json:"method" api:"required"`
	DpoBeta                       float64 `json:"dpo_beta"`
	DpoNormalizeLogratiosByLength bool    `json:"dpo_normalize_logratios_by_length"`
	DpoReferenceFree              bool    `json:"dpo_reference_free"`
	RpoAlpha                      float64 `json:"rpo_alpha"`
	SimpoGamma                    float64 `json:"simpo_gamma"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Method                        respjson.Field
		DpoBeta                       respjson.Field
		DpoNormalizeLogratiosByLength respjson.Field
		DpoReferenceFree              respjson.Field
		RpoAlpha                      respjson.Field
		SimpoGamma                    respjson.Field
		ExtraFields                   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FinetuneResponseTrainingMethodTrainingMethodDpo) RawJSON

Returns the unmodified JSON received from the API

func (*FinetuneResponseTrainingMethodTrainingMethodDpo) UnmarshalJSON

type FinetuneResponseTrainingMethodTrainingMethodSft

type FinetuneResponseTrainingMethodTrainingMethodSft struct {
	// Any of "sft".
	Method string `json:"method" api:"required"`
	// Whether to mask user messages in conversational data or prompts in instruction
	// data.
	TrainOnInputs FinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion `json:"train_on_inputs" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Method        respjson.Field
		TrainOnInputs respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FinetuneResponseTrainingMethodTrainingMethodSft) RawJSON

Returns the unmodified JSON received from the API

func (*FinetuneResponseTrainingMethodTrainingMethodSft) UnmarshalJSON

type FinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsString

type FinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsString string
const (
	FinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsStringAuto FinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsString = "auto"
)

type FinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion

type FinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion struct {
	// This field will be present if the value is a [bool] instead of an object.
	OfBool bool `json:",inline"`
	// This field will be present if the value is a [string] instead of an object.
	OfFinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsString string `json:",inline"`
	JSON                                                                 struct {
		OfBool                                                               respjson.Field
		OfFinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsString respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion contains all possible properties and values from [bool], [string].

Use the methods beginning with 'As' to cast the union to one of its variants.

If the underlying value is not a json object, one of the following properties will be valid: OfBool OfFinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsString]

func (FinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsBool

func (FinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsFinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsString

func (u FinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsFinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsString() (v string)

func (FinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) RawJSON

Returns the unmodified JSON received from the API

func (*FinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) UnmarshalJSON

type FinetuneResponseTrainingMethodUnion

type FinetuneResponseTrainingMethodUnion struct {
	Method string `json:"method"`
	// This field is from variant [FinetuneResponseTrainingMethodTrainingMethodSft].
	TrainOnInputs FinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion `json:"train_on_inputs"`
	// This field is from variant [FinetuneResponseTrainingMethodTrainingMethodDpo].
	DpoBeta float64 `json:"dpo_beta"`
	// This field is from variant [FinetuneResponseTrainingMethodTrainingMethodDpo].
	DpoNormalizeLogratiosByLength bool `json:"dpo_normalize_logratios_by_length"`
	// This field is from variant [FinetuneResponseTrainingMethodTrainingMethodDpo].
	DpoReferenceFree bool `json:"dpo_reference_free"`
	// This field is from variant [FinetuneResponseTrainingMethodTrainingMethodDpo].
	RpoAlpha float64 `json:"rpo_alpha"`
	// This field is from variant [FinetuneResponseTrainingMethodTrainingMethodDpo].
	SimpoGamma float64 `json:"simpo_gamma"`
	JSON       struct {
		Method                        respjson.Field
		TrainOnInputs                 respjson.Field
		DpoBeta                       respjson.Field
		DpoNormalizeLogratiosByLength respjson.Field
		DpoReferenceFree              respjson.Field
		RpoAlpha                      respjson.Field
		SimpoGamma                    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FinetuneResponseTrainingMethodUnion contains all possible properties and values from FinetuneResponseTrainingMethodTrainingMethodSft, FinetuneResponseTrainingMethodTrainingMethodDpo.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (FinetuneResponseTrainingMethodUnion) AsFinetuneResponseTrainingMethodTrainingMethodDpo

func (u FinetuneResponseTrainingMethodUnion) AsFinetuneResponseTrainingMethodTrainingMethodDpo() (v FinetuneResponseTrainingMethodTrainingMethodDpo)

func (FinetuneResponseTrainingMethodUnion) AsFinetuneResponseTrainingMethodTrainingMethodSft

func (u FinetuneResponseTrainingMethodUnion) AsFinetuneResponseTrainingMethodTrainingMethodSft() (v FinetuneResponseTrainingMethodTrainingMethodSft)

func (FinetuneResponseTrainingMethodUnion) RawJSON

Returns the unmodified JSON received from the API

func (*FinetuneResponseTrainingMethodUnion) UnmarshalJSON

func (r *FinetuneResponseTrainingMethodUnion) UnmarshalJSON(data []byte) error

type FinetuneResponseTrainingTypeFullTrainingType

type FinetuneResponseTrainingTypeFullTrainingType struct {
	// Any of "Full".
	Type string `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FinetuneResponseTrainingTypeFullTrainingType) RawJSON

Returns the unmodified JSON received from the API

func (*FinetuneResponseTrainingTypeFullTrainingType) UnmarshalJSON

func (r *FinetuneResponseTrainingTypeFullTrainingType) UnmarshalJSON(data []byte) error

type FinetuneResponseTrainingTypeLoRaTrainingType

type FinetuneResponseTrainingTypeLoRaTrainingType struct {
	LoraAlpha int64 `json:"lora_alpha" api:"required"`
	LoraR     int64 `json:"lora_r" api:"required"`
	// Any of "Lora".
	Type                 string  `json:"type" api:"required"`
	LoraDropout          float64 `json:"lora_dropout"`
	LoraTrainableModules string  `json:"lora_trainable_modules"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		LoraAlpha            respjson.Field
		LoraR                respjson.Field
		Type                 respjson.Field
		LoraDropout          respjson.Field
		LoraTrainableModules respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FinetuneResponseTrainingTypeLoRaTrainingType) RawJSON

Returns the unmodified JSON received from the API

func (*FinetuneResponseTrainingTypeLoRaTrainingType) UnmarshalJSON

func (r *FinetuneResponseTrainingTypeLoRaTrainingType) UnmarshalJSON(data []byte) error

type FinetuneResponseTrainingTypeUnion

type FinetuneResponseTrainingTypeUnion struct {
	Type string `json:"type"`
	// This field is from variant [FinetuneResponseTrainingTypeLoRaTrainingType].
	LoraAlpha int64 `json:"lora_alpha"`
	// This field is from variant [FinetuneResponseTrainingTypeLoRaTrainingType].
	LoraR int64 `json:"lora_r"`
	// This field is from variant [FinetuneResponseTrainingTypeLoRaTrainingType].
	LoraDropout float64 `json:"lora_dropout"`
	// This field is from variant [FinetuneResponseTrainingTypeLoRaTrainingType].
	LoraTrainableModules string `json:"lora_trainable_modules"`
	JSON                 struct {
		Type                 respjson.Field
		LoraAlpha            respjson.Field
		LoraR                respjson.Field
		LoraDropout          respjson.Field
		LoraTrainableModules respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FinetuneResponseTrainingTypeUnion contains all possible properties and values from FinetuneResponseTrainingTypeFullTrainingType, FinetuneResponseTrainingTypeLoRaTrainingType.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (FinetuneResponseTrainingTypeUnion) AsFinetuneResponseTrainingTypeFullTrainingType

func (u FinetuneResponseTrainingTypeUnion) AsFinetuneResponseTrainingTypeFullTrainingType() (v FinetuneResponseTrainingTypeFullTrainingType)

func (FinetuneResponseTrainingTypeUnion) AsFinetuneResponseTrainingTypeLoRaTrainingType

func (u FinetuneResponseTrainingTypeUnion) AsFinetuneResponseTrainingTypeLoRaTrainingType() (v FinetuneResponseTrainingTypeLoRaTrainingType)

func (FinetuneResponseTrainingTypeUnion) RawJSON

Returns the unmodified JSON received from the API

func (*FinetuneResponseTrainingTypeUnion) UnmarshalJSON

func (r *FinetuneResponseTrainingTypeUnion) UnmarshalJSON(data []byte) error

type ImageDataB64

type ImageDataB64 struct {
	B64Json string `json:"b64_json" api:"required"`
	Index   int64  `json:"index" api:"required"`
	// Any of "b64_json".
	Type ImageDataB64Type `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		B64Json     respjson.Field
		Index       respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ImageDataB64) RawJSON

func (r ImageDataB64) RawJSON() string

Returns the unmodified JSON received from the API

func (*ImageDataB64) UnmarshalJSON

func (r *ImageDataB64) UnmarshalJSON(data []byte) error

type ImageDataB64Type

type ImageDataB64Type string
const (
	ImageDataB64TypeB64Json ImageDataB64Type = "b64_json"
)

type ImageDataURL

type ImageDataURL struct {
	Index int64 `json:"index" api:"required"`
	// Any of "url".
	Type ImageDataURLType `json:"type" api:"required"`
	URL  string           `json:"url" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Index       respjson.Field
		Type        respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ImageDataURL) RawJSON

func (r ImageDataURL) RawJSON() string

Returns the unmodified JSON received from the API

func (*ImageDataURL) UnmarshalJSON

func (r *ImageDataURL) UnmarshalJSON(data []byte) error

type ImageDataURLType

type ImageDataURLType string
const (
	ImageDataURLTypeURL ImageDataURLType = "url"
)

type ImageFile

type ImageFile struct {
	ID    string               `json:"id" api:"required"`
	Data  []ImageFileDataUnion `json:"data" api:"required"`
	Model string               `json:"model" api:"required"`
	// The object type, which is always `list`.
	Object constant.List `json:"object" default:"list"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Data        respjson.Field
		Model       respjson.Field
		Object      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ImageFile) RawJSON

func (r ImageFile) RawJSON() string

Returns the unmodified JSON received from the API

func (*ImageFile) UnmarshalJSON

func (r *ImageFile) UnmarshalJSON(data []byte) error

type ImageFileDataUnion

type ImageFileDataUnion struct {
	// This field is from variant [ImageDataB64].
	B64Json string `json:"b64_json"`
	Index   int64  `json:"index"`
	// Any of "b64_json", "url".
	Type string `json:"type"`
	// This field is from variant [ImageDataURL].
	URL  string `json:"url"`
	JSON struct {
		B64Json respjson.Field
		Index   respjson.Field
		Type    respjson.Field
		URL     respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

ImageFileDataUnion contains all possible properties and values from ImageDataB64, ImageDataURL.

Use the ImageFileDataUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (ImageFileDataUnion) AsAny

func (u ImageFileDataUnion) AsAny() anyImageFileData

Use the following switch statement to find the correct variant

switch variant := ImageFileDataUnion.AsAny().(type) {
case together.ImageDataB64:
case together.ImageDataURL:
default:
  fmt.Errorf("no variant present")
}

func (ImageFileDataUnion) AsB64Json

func (u ImageFileDataUnion) AsB64Json() (v ImageDataB64)

func (ImageFileDataUnion) AsURL

func (u ImageFileDataUnion) AsURL() (v ImageDataURL)

func (ImageFileDataUnion) RawJSON

func (u ImageFileDataUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*ImageFileDataUnion) UnmarshalJSON

func (r *ImageFileDataUnion) UnmarshalJSON(data []byte) error

type ImageGenerateParams

type ImageGenerateParams struct {
	// The model to use for image generation.
	//
	// [See all of Together AI's image models](https://docs.together.ai/docs/serverless-models#image-models)
	Model ImageGenerateParamsModel `json:"model,omitzero" api:"required"`
	// A description of the desired images. Maximum length varies by model.
	Prompt string `json:"prompt" api:"required"`
	// If true, disables the safety checker for image generation.
	DisableSafetyChecker param.Opt[bool] `json:"disable_safety_checker,omitzero"`
	// Adjusts the alignment of the generated image with the input prompt. Higher
	// values (e.g., 8-10) make the output more faithful to the prompt, while lower
	// values (e.g., 1-5) encourage more creative freedom.
	GuidanceScale param.Opt[float64] `json:"guidance_scale,omitzero"`
	// Height of the image to generate in number of pixels.
	Height param.Opt[int64] `json:"height,omitzero"`
	// URL of an image to use for image models that support it.
	ImageURL param.Opt[string] `json:"image_url,omitzero"`
	// Number of image results to generate.
	N param.Opt[int64] `json:"n,omitzero"`
	// The prompt or prompts not to guide the image generation.
	NegativePrompt param.Opt[string] `json:"negative_prompt,omitzero"`
	// Seed used for generation. Can be used to reproduce image generations.
	Seed param.Opt[int64] `json:"seed,omitzero"`
	// Number of generation steps.
	Steps param.Opt[int64] `json:"steps,omitzero"`
	// Width of the image to generate in number of pixels.
	Width param.Opt[int64] `json:"width,omitzero"`
	// An array of objects that define LoRAs (Low-Rank Adaptations) to influence the
	// generated image.
	ImageLoras []ImageGenerateParamsImageLora `json:"image_loras,omitzero"`
	// The format of the image response. Can be either be `jpeg` or `png`. Defaults to
	// `jpeg`.
	//
	// Any of "jpeg", "png".
	OutputFormat ImageGenerateParamsOutputFormat `json:"output_format,omitzero"`
	// An array of image URLs that guide the overall appearance and style of the
	// generated image. These reference images influence the visual characteristics
	// consistently across the generation.
	ReferenceImages []string `json:"reference_images,omitzero"`
	// Format of the image response. Can be either a base64 string or a URL.
	//
	// Any of "base64", "url".
	ResponseFormat ImageGenerateParamsResponseFormat `json:"response_format,omitzero"`
	// contains filtered or unexported fields
}

func (ImageGenerateParams) MarshalJSON

func (r ImageGenerateParams) MarshalJSON() (data []byte, err error)

func (*ImageGenerateParams) UnmarshalJSON

func (r *ImageGenerateParams) UnmarshalJSON(data []byte) error

type ImageGenerateParamsImageLora

type ImageGenerateParamsImageLora struct {
	// The URL of the LoRA to apply (e.g.
	// https://huggingface.co/strangerzonehf/Flux-Midjourney-Mix2-LoRA).
	Path string `json:"path" api:"required"`
	// The strength of the LoRA's influence. Most LoRA's recommend a value of 1.
	Scale float64 `json:"scale" api:"required"`
	// contains filtered or unexported fields
}

The properties Path, Scale are required.

func (ImageGenerateParamsImageLora) MarshalJSON

func (r ImageGenerateParamsImageLora) MarshalJSON() (data []byte, err error)

func (*ImageGenerateParamsImageLora) UnmarshalJSON

func (r *ImageGenerateParamsImageLora) UnmarshalJSON(data []byte) error

type ImageGenerateParamsModel

type ImageGenerateParamsModel string

The model to use for image generation.

[See all of Together AI's image models](https://docs.together.ai/docs/serverless-models#image-models)

const (
	ImageGenerateParamsModelBlackForestLabsFlux1SchnellFree ImageGenerateParamsModel = "black-forest-labs/FLUX.1-schnell-Free"
	ImageGenerateParamsModelBlackForestLabsFlux1Schnell     ImageGenerateParamsModel = "black-forest-labs/FLUX.1-schnell"
	ImageGenerateParamsModelBlackForestLabsFlux1_1Pro       ImageGenerateParamsModel = "black-forest-labs/FLUX.1.1-pro"
)

type ImageGenerateParamsOutputFormat

type ImageGenerateParamsOutputFormat string

The format of the image response. Can be either be `jpeg` or `png`. Defaults to `jpeg`.

const (
	ImageGenerateParamsOutputFormatJpeg ImageGenerateParamsOutputFormat = "jpeg"
	ImageGenerateParamsOutputFormatPng  ImageGenerateParamsOutputFormat = "png"
)

type ImageGenerateParamsResponseFormat

type ImageGenerateParamsResponseFormat string

Format of the image response. Can be either a base64 string or a URL.

const (
	ImageGenerateParamsResponseFormatBase64 ImageGenerateParamsResponseFormat = "base64"
	ImageGenerateParamsResponseFormatURL    ImageGenerateParamsResponseFormat = "url"
)

type ImageService

type ImageService struct {
	Options []option.RequestOption
}

ImageService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewImageService method instead.

func NewImageService

func NewImageService(opts ...option.RequestOption) (r ImageService)

NewImageService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ImageService) Generate

func (r *ImageService) Generate(ctx context.Context, body ImageGenerateParams, opts ...option.RequestOption) (res *ImageFile, err error)

Use an image model to generate an image for a given prompt.

type LogProbs

type LogProbs struct {
	// List of token IDs corresponding to the logprobs
	TokenIDs []float64 `json:"token_ids"`
	// List of token log probabilities
	TokenLogprobs []float64 `json:"token_logprobs"`
	// List of token strings
	Tokens []string `json:"tokens"`
	// Top log probabilities for the tokens.
	TopLogprobs map[string]float64 `json:"top_logprobs"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		TokenIDs      respjson.Field
		TokenLogprobs respjson.Field
		Tokens        respjson.Field
		TopLogprobs   respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogProbs) RawJSON

func (r LogProbs) RawJSON() string

Returns the unmodified JSON received from the API

func (*LogProbs) UnmarshalJSON

func (r *LogProbs) UnmarshalJSON(data []byte) error

type ModelListParams added in v0.2.0

type ModelListParams struct {
	// Filter models to only return dedicated models
	Dedicated param.Opt[bool] `query:"dedicated,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (ModelListParams) URLQuery added in v0.2.0

func (r ModelListParams) URLQuery() (v url.Values, err error)

URLQuery serializes ModelListParams's query parameters as `url.Values`.

type ModelObject

type ModelObject struct {
	ID      string `json:"id" api:"required"`
	Created int64  `json:"created" api:"required"`
	// The object type, which is always `model`.
	Object constant.Model `json:"object" default:"model"`
	// Any of "chat", "language", "code", "image", "embedding", "moderation", "rerank".
	Type          ModelObjectType    `json:"type" api:"required"`
	ContextLength int64              `json:"context_length"`
	DisplayName   string             `json:"display_name"`
	License       string             `json:"license"`
	Link          string             `json:"link"`
	Organization  string             `json:"organization"`
	Pricing       ModelObjectPricing `json:"pricing"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		Created       respjson.Field
		Object        respjson.Field
		Type          respjson.Field
		ContextLength respjson.Field
		DisplayName   respjson.Field
		License       respjson.Field
		Link          respjson.Field
		Organization  respjson.Field
		Pricing       respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ModelObject) RawJSON

func (r ModelObject) RawJSON() string

Returns the unmodified JSON received from the API

func (*ModelObject) UnmarshalJSON

func (r *ModelObject) UnmarshalJSON(data []byte) error

type ModelObjectPricing

type ModelObjectPricing struct {
	Base        float64 `json:"base" api:"required"`
	Finetune    float64 `json:"finetune" api:"required"`
	Hourly      float64 `json:"hourly" api:"required"`
	Input       float64 `json:"input" api:"required"`
	Output      float64 `json:"output" api:"required"`
	CachedInput float64 `json:"cached_input"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Base        respjson.Field
		Finetune    respjson.Field
		Hourly      respjson.Field
		Input       respjson.Field
		Output      respjson.Field
		CachedInput respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ModelObjectPricing) RawJSON

func (r ModelObjectPricing) RawJSON() string

Returns the unmodified JSON received from the API

func (*ModelObjectPricing) UnmarshalJSON

func (r *ModelObjectPricing) UnmarshalJSON(data []byte) error

type ModelObjectType

type ModelObjectType string
const (
	ModelObjectTypeChat       ModelObjectType = "chat"
	ModelObjectTypeLanguage   ModelObjectType = "language"
	ModelObjectTypeCode       ModelObjectType = "code"
	ModelObjectTypeImage      ModelObjectType = "image"
	ModelObjectTypeEmbedding  ModelObjectType = "embedding"
	ModelObjectTypeModeration ModelObjectType = "moderation"
	ModelObjectTypeRerank     ModelObjectType = "rerank"
)

type ModelService

type ModelService struct {
	Options []option.RequestOption
	Uploads ModelUploadService
}

ModelService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewModelService method instead.

func NewModelService

func NewModelService(opts ...option.RequestOption) (r ModelService)

NewModelService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ModelService) List

func (r *ModelService) List(ctx context.Context, query ModelListParams, opts ...option.RequestOption) (res *[]ModelObject, err error)

Lists all of Together's open-source models and metadata including pricing, chat template, and context.

func (*ModelService) Upload

func (r *ModelService) Upload(ctx context.Context, body ModelUploadParams, opts ...option.RequestOption) (res *ModelUploadResponse, err error)

Upload a custom model or adapter from Hugging Face or S3

type ModelUploadParams

type ModelUploadParams struct {
	// The name to give to your uploaded model
	ModelName string `json:"model_name" api:"required"`
	// The source location of the model (Hugging Face repo or S3 path)
	ModelSource string `json:"model_source" api:"required"`
	// The base model to use for an adapter if setting it to run against a serverless
	// pool. Only used for model_type `adapter`.
	BaseModel param.Opt[string] `json:"base_model,omitzero"`
	// A description of your model
	Description param.Opt[string] `json:"description,omitzero"`
	// Hugging Face token (if uploading from Hugging Face)
	HfToken param.Opt[string] `json:"hf_token,omitzero"`
	// The lora pool to use for an adapter if setting it to run against, say, a
	// dedicated pool. Only used for model_type `adapter`.
	LoraModel param.Opt[string] `json:"lora_model,omitzero"`
	// Whether the model is a full model or an adapter
	//
	// Any of "model", "adapter".
	ModelType ModelUploadParamsModelType `json:"model_type,omitzero"`
	// contains filtered or unexported fields
}

func (ModelUploadParams) MarshalJSON

func (r ModelUploadParams) MarshalJSON() (data []byte, err error)

func (*ModelUploadParams) UnmarshalJSON

func (r *ModelUploadParams) UnmarshalJSON(data []byte) error

type ModelUploadParamsModelType

type ModelUploadParamsModelType string

Whether the model is a full model or an adapter

const (
	ModelUploadParamsModelTypeModel   ModelUploadParamsModelType = "model"
	ModelUploadParamsModelTypeAdapter ModelUploadParamsModelType = "adapter"
)

type ModelUploadResponse

type ModelUploadResponse struct {
	Data    ModelUploadResponseData `json:"data" api:"required"`
	Message string                  `json:"message" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ModelUploadResponse) RawJSON

func (r ModelUploadResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ModelUploadResponse) UnmarshalJSON

func (r *ModelUploadResponse) UnmarshalJSON(data []byte) error

type ModelUploadResponseData

type ModelUploadResponseData struct {
	JobID       string `json:"job_id" api:"required"`
	ModelID     string `json:"model_id" api:"required"`
	ModelName   string `json:"model_name" api:"required"`
	ModelSource string `json:"model_source" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		JobID       respjson.Field
		ModelID     respjson.Field
		ModelName   respjson.Field
		ModelSource respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ModelUploadResponseData) RawJSON

func (r ModelUploadResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*ModelUploadResponseData) UnmarshalJSON

func (r *ModelUploadResponseData) UnmarshalJSON(data []byte) error

type ModelUploadService added in v0.6.0

type ModelUploadService struct {
	Options []option.RequestOption
}

ModelUploadService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewModelUploadService method instead.

func NewModelUploadService added in v0.6.0

func NewModelUploadService(opts ...option.RequestOption) (r ModelUploadService)

NewModelUploadService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ModelUploadService) Status added in v0.6.0

func (r *ModelUploadService) Status(ctx context.Context, jobID string, opts ...option.RequestOption) (res *ModelUploadStatusResponse, err error)

Get the status of a specific job

type ModelUploadStatusResponse added in v0.6.0

type ModelUploadStatusResponse struct {
	Args      ModelUploadStatusResponseArgs `json:"args" api:"required"`
	CreatedAt time.Time                     `json:"created_at" api:"required" format:"date-time"`
	JobID     string                        `json:"job_id" api:"required"`
	// Any of "Queued", "Running", "Complete", "Failed".
	Status        ModelUploadStatusResponseStatus         `json:"status" api:"required"`
	StatusUpdates []ModelUploadStatusResponseStatusUpdate `json:"status_updates" api:"required"`
	Type          string                                  `json:"type" api:"required"`
	UpdatedAt     time.Time                               `json:"updated_at" api:"required" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Args          respjson.Field
		CreatedAt     respjson.Field
		JobID         respjson.Field
		Status        respjson.Field
		StatusUpdates respjson.Field
		Type          respjson.Field
		UpdatedAt     respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ModelUploadStatusResponse) RawJSON added in v0.6.0

func (r ModelUploadStatusResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ModelUploadStatusResponse) UnmarshalJSON added in v0.6.0

func (r *ModelUploadStatusResponse) UnmarshalJSON(data []byte) error

type ModelUploadStatusResponseArgs added in v0.6.0

type ModelUploadStatusResponseArgs struct {
	Description string `json:"description"`
	ModelName   string `json:"modelName"`
	ModelSource string `json:"modelSource"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Description respjson.Field
		ModelName   respjson.Field
		ModelSource respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ModelUploadStatusResponseArgs) RawJSON added in v0.6.0

Returns the unmodified JSON received from the API

func (*ModelUploadStatusResponseArgs) UnmarshalJSON added in v0.6.0

func (r *ModelUploadStatusResponseArgs) UnmarshalJSON(data []byte) error

type ModelUploadStatusResponseStatus added in v0.6.0

type ModelUploadStatusResponseStatus string
const (
	ModelUploadStatusResponseStatusQueued   ModelUploadStatusResponseStatus = "Queued"
	ModelUploadStatusResponseStatusRunning  ModelUploadStatusResponseStatus = "Running"
	ModelUploadStatusResponseStatusComplete ModelUploadStatusResponseStatus = "Complete"
	ModelUploadStatusResponseStatusFailed   ModelUploadStatusResponseStatus = "Failed"
)

type ModelUploadStatusResponseStatusUpdate added in v0.6.0

type ModelUploadStatusResponseStatusUpdate struct {
	Message   string    `json:"message" api:"required"`
	Status    string    `json:"status" api:"required"`
	Timestamp time.Time `json:"timestamp" api:"required" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Status      respjson.Field
		Timestamp   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ModelUploadStatusResponseStatusUpdate) RawJSON added in v0.6.0

Returns the unmodified JSON received from the API

func (*ModelUploadStatusResponseStatusUpdate) UnmarshalJSON added in v0.6.0

func (r *ModelUploadStatusResponseStatusUpdate) UnmarshalJSON(data []byte) error

type Remediation added in v0.10.0

type Remediation struct {
	ID         string `json:"id" api:"required"`
	ClusterID  string `json:"cluster_id" api:"required"`
	InstanceID string `json:"instance_id" api:"required"`
	// Remediation mode specifies how the remediation should be performed.
	//
	//   - `REMEDIATION_MODE_VM_ONLY`: Deletes the VM and provisions a new one on any
	//     available host.
	//   - `REMEDIATION_MODE_HOST_AWARE`: Cordons the host, deletes the VM, and
	//     provisions a new one on a different host.
	//
	// Any of "REMEDIATION_MODE_VM_ONLY", "REMEDIATION_MODE_HOST_AWARE",
	// "REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT", "REMEDIATION_MODE_REBOOT_VM".
	Mode RemediationMode `json:"mode" api:"required"`
	// RemediationState represents the lifecycle state of a remediation.
	//
	//   - `PENDING_APPROVAL`: Awaiting approval before processing can begin.
	//   - `PENDING`: Approved and queued for processing.
	//   - `RUNNING`: Actively being processed.
	//   - `SUCCEEDED`: Successfully completed.
	//   - `FAILED`: Failed with an error.
	//   - `CANCELLED`: Cancelled by user or system.
	//   - `AUTO_RESOLVED`: The underlying issue was automatically resolved before
	//     processing.
	//
	// Any of "PENDING_APPROVAL", "PENDING", "RUNNING", "SUCCEEDED", "FAILED",
	// "CANCELLED", "AUTO_RESOLVED".
	State RemediationState `json:"state" api:"required"`
	// RemediationTrigger specifies how the remediation was triggered.
	//
	//   - `REMEDIATION_TRIGGER_MANUAL`: A user-initiated remediation (either via web UI
	//     or API call).
	//   - `REMEDIATION_TRIGGER_AUTOMATED`: A system-initiated remediation that requires
	//     approval.
	//
	// Any of "REMEDIATION_TRIGGER_MANUAL", "REMEDIATION_TRIGGER_AUTOMATED".
	Trigger RemediationTrigger `json:"trigger" api:"required"`
	// Active health check run ID (UUID) that triggered this remediation.
	ActiveHealthCheckRunID string `json:"active_health_check_run_id"`
	// When the remediation was created.
	CreateTime time.Time `json:"create_time" format:"date-time"`
	// When the remediation completed.
	EndTime time.Time `json:"end_time" format:"date-time"`
	// Error message if the remediation failed.
	ErrorMessage string `json:"error_message"`
	// Display name of the targeted instance.
	InstanceName string `json:"instance_name"`
	// Passive health check event ID that triggered this remediation.
	PassiveHealthCheckEventID string `json:"passive_health_check_event_id"`
	// User-provided reason for the remediation.
	Reason string `json:"reason"`
	// Who requested the remediation.
	RequestedBy string `json:"requested_by"`
	// Review comment.
	ReviewComment string `json:"review_comment"`
	// When the remediation was reviewed.
	ReviewTime time.Time `json:"review_time" format:"date-time"`
	// Who reviewed the remediation.
	ReviewedBy string `json:"reviewed_by"`
	// When processing started.
	StartTime time.Time `json:"start_time" format:"date-time"`
	// When the remediation was last updated.
	UpdateTime time.Time `json:"update_time" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                        respjson.Field
		ClusterID                 respjson.Field
		InstanceID                respjson.Field
		Mode                      respjson.Field
		State                     respjson.Field
		Trigger                   respjson.Field
		ActiveHealthCheckRunID    respjson.Field
		CreateTime                respjson.Field
		EndTime                   respjson.Field
		ErrorMessage              respjson.Field
		InstanceName              respjson.Field
		PassiveHealthCheckEventID respjson.Field
		Reason                    respjson.Field
		RequestedBy               respjson.Field
		ReviewComment             respjson.Field
		ReviewTime                respjson.Field
		ReviewedBy                respjson.Field
		StartTime                 respjson.Field
		UpdateTime                respjson.Field
		ExtraFields               map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Remediation represents a node remediation request for an instance. An instance can have multiple remediations over time (e.g., failed attempts followed by retries).

func (Remediation) RawJSON added in v0.10.0

func (r Remediation) RawJSON() string

Returns the unmodified JSON received from the API

func (Remediation) ToParam added in v0.10.0

func (r Remediation) ToParam() RemediationParam

ToParam converts this Remediation to a RemediationParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with RemediationParam.Overrides()

func (*Remediation) UnmarshalJSON added in v0.10.0

func (r *Remediation) UnmarshalJSON(data []byte) error

type RemediationMode added in v0.10.0

type RemediationMode string

Remediation mode specifies how the remediation should be performed.

  • `REMEDIATION_MODE_VM_ONLY`: Deletes the VM and provisions a new one on any available host.
  • `REMEDIATION_MODE_HOST_AWARE`: Cordons the host, deletes the VM, and provisions a new one on a different host.
const (
	RemediationModeRemediationModeVmOnly                  RemediationMode = "REMEDIATION_MODE_VM_ONLY"
	RemediationModeRemediationModeHostAware               RemediationMode = "REMEDIATION_MODE_HOST_AWARE"
	RemediationModeRemediationModeEvictWithoutReplacement RemediationMode = "REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT"
	RemediationModeRemediationModeRebootVm                RemediationMode = "REMEDIATION_MODE_REBOOT_VM"
)

type RemediationParam added in v0.10.0

type RemediationParam struct {
	// Remediation mode specifies how the remediation should be performed.
	//
	//   - `REMEDIATION_MODE_VM_ONLY`: Deletes the VM and provisions a new one on any
	//     available host.
	//   - `REMEDIATION_MODE_HOST_AWARE`: Cordons the host, deletes the VM, and
	//     provisions a new one on a different host.
	//
	// Any of "REMEDIATION_MODE_VM_ONLY", "REMEDIATION_MODE_HOST_AWARE",
	// "REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT", "REMEDIATION_MODE_REBOOT_VM".
	Mode RemediationMode `json:"mode,omitzero" api:"required"`
	// User-provided reason for the remediation.
	Reason param.Opt[string] `json:"reason,omitzero"`
	// contains filtered or unexported fields
}

Remediation represents a node remediation request for an instance. An instance can have multiple remediations over time (e.g., failed attempts followed by retries).

The properties ID, ClusterID, InstanceID, Mode, State, Trigger are required.

func (RemediationParam) MarshalJSON added in v0.10.0

func (r RemediationParam) MarshalJSON() (data []byte, err error)

func (*RemediationParam) UnmarshalJSON added in v0.10.0

func (r *RemediationParam) UnmarshalJSON(data []byte) error

type RemediationState added in v0.10.0

type RemediationState string

RemediationState represents the lifecycle state of a remediation.

  • `PENDING_APPROVAL`: Awaiting approval before processing can begin.
  • `PENDING`: Approved and queued for processing.
  • `RUNNING`: Actively being processed.
  • `SUCCEEDED`: Successfully completed.
  • `FAILED`: Failed with an error.
  • `CANCELLED`: Cancelled by user or system.
  • `AUTO_RESOLVED`: The underlying issue was automatically resolved before processing.
const (
	RemediationStatePendingApproval RemediationState = "PENDING_APPROVAL"
	RemediationStatePending         RemediationState = "PENDING"
	RemediationStateRunning         RemediationState = "RUNNING"
	RemediationStateSucceeded       RemediationState = "SUCCEEDED"
	RemediationStateFailed          RemediationState = "FAILED"
	RemediationStateCancelled       RemediationState = "CANCELLED"
	RemediationStateAutoResolved    RemediationState = "AUTO_RESOLVED"
)

type RemediationTrigger added in v0.10.0

type RemediationTrigger string

RemediationTrigger specifies how the remediation was triggered.

  • `REMEDIATION_TRIGGER_MANUAL`: A user-initiated remediation (either via web UI or API call).
  • `REMEDIATION_TRIGGER_AUTOMATED`: A system-initiated remediation that requires approval.
const (
	RemediationTriggerRemediationTriggerManual    RemediationTrigger = "REMEDIATION_TRIGGER_MANUAL"
	RemediationTriggerRemediationTriggerAutomated RemediationTrigger = "REMEDIATION_TRIGGER_AUTOMATED"
)

type RerankNewParams

type RerankNewParams struct {
	// List of documents, which can be either strings or objects.
	Documents RerankNewParamsDocumentsUnion `json:"documents,omitzero" api:"required"`
	// The model to be used for the rerank request.
	//
	// [See all of Together AI's rerank models](https://docs.together.ai/docs/serverless-models#rerank-models)
	Model RerankNewParamsModel `json:"model,omitzero" api:"required"`
	// The search query to be used for ranking.
	Query string `json:"query" api:"required"`
	// Whether to return supplied documents with the response.
	ReturnDocuments param.Opt[bool] `json:"return_documents,omitzero"`
	// The number of top results to return.
	TopN param.Opt[int64] `json:"top_n,omitzero"`
	// List of keys in the JSON Object document to rank by. Defaults to use all
	// supplied keys for ranking.
	RankFields []string `json:"rank_fields,omitzero"`
	// contains filtered or unexported fields
}

func (RerankNewParams) MarshalJSON

func (r RerankNewParams) MarshalJSON() (data []byte, err error)

func (*RerankNewParams) UnmarshalJSON

func (r *RerankNewParams) UnmarshalJSON(data []byte) error

type RerankNewParamsDocumentsUnion

type RerankNewParamsDocumentsUnion struct {
	OfMapOfAnyMap []map[string]any `json:",omitzero,inline"`
	OfStringArray []string         `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (RerankNewParamsDocumentsUnion) MarshalJSON

func (u RerankNewParamsDocumentsUnion) MarshalJSON() ([]byte, error)

func (*RerankNewParamsDocumentsUnion) UnmarshalJSON

func (u *RerankNewParamsDocumentsUnion) UnmarshalJSON(data []byte) error

type RerankNewParamsModel

type RerankNewParamsModel string

The model to be used for the rerank request.

[See all of Together AI's rerank models](https://docs.together.ai/docs/serverless-models#rerank-models)

const (
	RerankNewParamsModelSalesforceLlamaRankV1 RerankNewParamsModel = "Salesforce/Llama-Rank-v1"
)

type RerankNewResponse

type RerankNewResponse struct {
	// The model to be used for the rerank request.
	Model string `json:"model" api:"required"`
	// The object type, which is always `rerank`.
	Object  constant.Rerank           `json:"object" default:"rerank"`
	Results []RerankNewResponseResult `json:"results" api:"required"`
	// Request ID
	ID    string              `json:"id"`
	Usage ChatCompletionUsage `json:"usage" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Model       respjson.Field
		Object      respjson.Field
		Results     respjson.Field
		ID          respjson.Field
		Usage       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (RerankNewResponse) RawJSON

func (r RerankNewResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*RerankNewResponse) UnmarshalJSON

func (r *RerankNewResponse) UnmarshalJSON(data []byte) error

type RerankNewResponseResult

type RerankNewResponseResult struct {
	Document       RerankNewResponseResultDocument `json:"document" api:"required"`
	Index          int64                           `json:"index" api:"required"`
	RelevanceScore float64                         `json:"relevance_score" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Document       respjson.Field
		Index          respjson.Field
		RelevanceScore respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (RerankNewResponseResult) RawJSON

func (r RerankNewResponseResult) RawJSON() string

Returns the unmodified JSON received from the API

func (*RerankNewResponseResult) UnmarshalJSON

func (r *RerankNewResponseResult) UnmarshalJSON(data []byte) error

type RerankNewResponseResultDocument

type RerankNewResponseResultDocument struct {
	Text string `json:"text" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Text        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (RerankNewResponseResultDocument) RawJSON

Returns the unmodified JSON received from the API

func (*RerankNewResponseResultDocument) UnmarshalJSON

func (r *RerankNewResponseResultDocument) UnmarshalJSON(data []byte) error

type RerankService

type RerankService struct {
	Options []option.RequestOption
}

RerankService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewRerankService method instead.

func NewRerankService

func NewRerankService(opts ...option.RequestOption) (r RerankService)

NewRerankService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*RerankService) New

Rerank a list of documents by relevance to a query. Returns a relevance score and ordering index for each document.

type Secret added in v0.6.0

type Secret struct {
	// ID is the unique identifier for this secret
	ID string `json:"id"`
	// CreatedAt is the ISO8601 timestamp when this secret was created
	CreatedAt string `json:"created_at"`
	// CreatedBy is the identifier of who created this secret.
	CreatedBy string `json:"created_by"`
	// Description is a human-readable description of the secret's purpose
	Description string `json:"description"`
	// LastUpdatedBy is the identifier of who last updated this secret.
	LastUpdatedBy string `json:"last_updated_by"`
	// Name is the name/key of the secret
	Name string `json:"name"`
	// The object type, which is always `secret`.
	//
	// Any of "secret".
	Object SecretObject `json:"object"`
	// UpdatedAt is the ISO8601 timestamp when this secret was last updated
	UpdatedAt string `json:"updated_at"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		CreatedAt     respjson.Field
		CreatedBy     respjson.Field
		Description   respjson.Field
		LastUpdatedBy respjson.Field
		Name          respjson.Field
		Object        respjson.Field
		UpdatedAt     respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (Secret) RawJSON added in v0.6.0

func (r Secret) RawJSON() string

Returns the unmodified JSON received from the API

func (*Secret) UnmarshalJSON added in v0.6.0

func (r *Secret) UnmarshalJSON(data []byte) error

type SecretObject added in v0.7.0

type SecretObject string

The object type, which is always `secret`.

const (
	SecretObjectSecret SecretObject = "secret"
)

type SessionListResponse

type SessionListResponse struct {
	Data   SessionListResponseData         `json:"data"`
	Errors []SessionListResponseErrorUnion `json:"errors"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Errors      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (SessionListResponse) RawJSON

func (r SessionListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*SessionListResponse) UnmarshalJSON

func (r *SessionListResponse) UnmarshalJSON(data []byte) error

type SessionListResponseData

type SessionListResponseData struct {
	Sessions []SessionListResponseDataSession `json:"sessions" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Sessions    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (SessionListResponseData) RawJSON

func (r SessionListResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*SessionListResponseData) UnmarshalJSON

func (r *SessionListResponseData) UnmarshalJSON(data []byte) error

type SessionListResponseDataSession

type SessionListResponseDataSession struct {
	// Session Identifier. Used to make follow-up calls.
	ID            string    `json:"id" api:"required"`
	ExecuteCount  int64     `json:"execute_count" api:"required"`
	ExpiresAt     time.Time `json:"expires_at" api:"required" format:"date-time"`
	LastExecuteAt time.Time `json:"last_execute_at" api:"required" format:"date-time"`
	StartedAt     time.Time `json:"started_at" api:"required" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		ExecuteCount  respjson.Field
		ExpiresAt     respjson.Field
		LastExecuteAt respjson.Field
		StartedAt     respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (SessionListResponseDataSession) RawJSON

Returns the unmodified JSON received from the API

func (*SessionListResponseDataSession) UnmarshalJSON

func (r *SessionListResponseDataSession) UnmarshalJSON(data []byte) error

type SessionListResponseErrorUnion

type SessionListResponseErrorUnion struct {
	// This field will be present if the value is a [string] instead of an object.
	OfString string `json:",inline"`
	// This field will be present if the value is a [any] instead of an object.
	OfSessionListResponseErrorMapItem any `json:",inline"`
	JSON                              struct {
		OfString                          respjson.Field
		OfSessionListResponseErrorMapItem respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

SessionListResponseErrorUnion contains all possible properties and values from [string], [map[string]any].

Use the methods beginning with 'As' to cast the union to one of its variants.

If the underlying value is not a json object, one of the following properties will be valid: OfString OfSessionListResponseErrorMapItem]

func (SessionListResponseErrorUnion) AsAnyMap

func (u SessionListResponseErrorUnion) AsAnyMap() (v map[string]any)

func (SessionListResponseErrorUnion) AsString

func (u SessionListResponseErrorUnion) AsString() (v string)

func (SessionListResponseErrorUnion) RawJSON

Returns the unmodified JSON received from the API

func (*SessionListResponseErrorUnion) UnmarshalJSON

func (r *SessionListResponseErrorUnion) UnmarshalJSON(data []byte) error

type ToolChoice

type ToolChoice struct {
	ID       string             `json:"id" api:"required"`
	Function ToolChoiceFunction `json:"function" api:"required"`
	Index    float64            `json:"index" api:"required"`
	// Any of "function".
	Type ToolChoiceType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Function    respjson.Field
		Index       respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ToolChoice) RawJSON

func (r ToolChoice) RawJSON() string

Returns the unmodified JSON received from the API

func (ToolChoice) ToParam

func (r ToolChoice) ToParam() ToolChoiceParam

ToParam converts this ToolChoice to a ToolChoiceParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ToolChoiceParam.Overrides()

func (*ToolChoice) UnmarshalJSON

func (r *ToolChoice) UnmarshalJSON(data []byte) error

type ToolChoiceFunction

type ToolChoiceFunction struct {
	Arguments string `json:"arguments" api:"required"`
	Name      string `json:"name" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Arguments   respjson.Field
		Name        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ToolChoiceFunction) RawJSON

func (r ToolChoiceFunction) RawJSON() string

Returns the unmodified JSON received from the API

func (*ToolChoiceFunction) UnmarshalJSON

func (r *ToolChoiceFunction) UnmarshalJSON(data []byte) error

type ToolChoiceFunctionParam

type ToolChoiceFunctionParam struct {
	Arguments string `json:"arguments" api:"required"`
	Name      string `json:"name" api:"required"`
	// contains filtered or unexported fields
}

The properties Arguments, Name are required.

func (ToolChoiceFunctionParam) MarshalJSON

func (r ToolChoiceFunctionParam) MarshalJSON() (data []byte, err error)

func (*ToolChoiceFunctionParam) UnmarshalJSON

func (r *ToolChoiceFunctionParam) UnmarshalJSON(data []byte) error

type ToolChoiceParam

type ToolChoiceParam struct {
	ID       string                  `json:"id" api:"required"`
	Function ToolChoiceFunctionParam `json:"function,omitzero" api:"required"`
	Index    float64                 `json:"index" api:"required"`
	// Any of "function".
	Type ToolChoiceType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The properties ID, Function, Index, Type are required.

func (ToolChoiceParam) MarshalJSON

func (r ToolChoiceParam) MarshalJSON() (data []byte, err error)

func (*ToolChoiceParam) UnmarshalJSON

func (r *ToolChoiceParam) UnmarshalJSON(data []byte) error

type ToolChoiceType

type ToolChoiceType string
const (
	ToolChoiceTypeFunction ToolChoiceType = "function"
)

type ToolsFunctionParam

type ToolsFunctionParam struct {
	Description param.Opt[string] `json:"description,omitzero"`
	Name        param.Opt[string] `json:"name,omitzero"`
	// A map of parameter names to their values.
	Parameters map[string]any `json:"parameters,omitzero"`
	// contains filtered or unexported fields
}

func (ToolsFunctionParam) MarshalJSON

func (r ToolsFunctionParam) MarshalJSON() (data []byte, err error)

func (*ToolsFunctionParam) UnmarshalJSON

func (r *ToolsFunctionParam) UnmarshalJSON(data []byte) error

type ToolsParam

type ToolsParam struct {
	Type     param.Opt[string]  `json:"type,omitzero"`
	Function ToolsFunctionParam `json:"function,omitzero"`
	// contains filtered or unexported fields
}

func (ToolsParam) MarshalJSON

func (r ToolsParam) MarshalJSON() (data []byte, err error)

func (*ToolsParam) UnmarshalJSON

func (r *ToolsParam) UnmarshalJSON(data []byte) error

type VideoJob

type VideoJob struct {
	// Unique identifier for the video job.
	ID string `json:"id" api:"required"`
	// Unix timestamp (seconds) for when the job was created.
	CreatedAt float64 `json:"created_at" api:"required"`
	// The video generation model that produced the job.
	Model string `json:"model" api:"required"`
	// Duration of the generated clip in seconds.
	Seconds string `json:"seconds" api:"required"`
	// The resolution of the generated video.
	Size string `json:"size" api:"required"`
	// Current lifecycle status of the video job.
	//
	// Any of "in_progress", "completed", "failed".
	Status VideoJobStatus `json:"status" api:"required"`
	// Unix timestamp (seconds) for when the job completed, if finished.
	CompletedAt float64 `json:"completed_at"`
	// Error payload that explains why generation failed, if applicable.
	Error VideoJobError `json:"error"`
	// The object type, which is always video.
	//
	// Any of "video".
	Object VideoJobObject `json:"object"`
	// Available upon completion, the outputs provides the cost charged and the hosted
	// url to access the video
	Outputs VideoJobOutputs `json:"outputs"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		Model       respjson.Field
		Seconds     respjson.Field
		Size        respjson.Field
		Status      respjson.Field
		CompletedAt respjson.Field
		Error       respjson.Field
		Object      respjson.Field
		Outputs     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Structured information describing a generated video job.

func (VideoJob) RawJSON

func (r VideoJob) RawJSON() string

Returns the unmodified JSON received from the API

func (*VideoJob) UnmarshalJSON

func (r *VideoJob) UnmarshalJSON(data []byte) error

type VideoJobError

type VideoJobError struct {
	Message string `json:"message" api:"required"`
	Code    string `json:"code"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Code        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error payload that explains why generation failed, if applicable.

func (VideoJobError) RawJSON

func (r VideoJobError) RawJSON() string

Returns the unmodified JSON received from the API

func (*VideoJobError) UnmarshalJSON

func (r *VideoJobError) UnmarshalJSON(data []byte) error

type VideoJobObject

type VideoJobObject string

The object type, which is always video.

const (
	VideoJobObjectVideo VideoJobObject = "video"
)

type VideoJobOutputs

type VideoJobOutputs struct {
	// The cost of generated video charged to the owners account.
	Cost int64 `json:"cost" api:"required"`
	// URL hosting the generated video
	VideoURL string `json:"video_url" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Cost        respjson.Field
		VideoURL    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Available upon completion, the outputs provides the cost charged and the hosted url to access the video

func (VideoJobOutputs) RawJSON

func (r VideoJobOutputs) RawJSON() string

Returns the unmodified JSON received from the API

func (*VideoJobOutputs) UnmarshalJSON

func (r *VideoJobOutputs) UnmarshalJSON(data []byte) error

type VideoJobStatus

type VideoJobStatus string

Current lifecycle status of the video job.

const (
	VideoJobStatusInProgress VideoJobStatus = "in_progress"
	VideoJobStatusCompleted  VideoJobStatus = "completed"
	VideoJobStatusFailed     VideoJobStatus = "failed"
)

type VideoNewParams

type VideoNewParams struct {
	// The model to be used for the video creation request.
	Model string `json:"model" api:"required"`
	// Frames per second. Defaults to 24.
	Fps param.Opt[int64] `json:"fps,omitzero"`
	// Whether to generate audio for the video.
	GenerateAudio param.Opt[bool] `json:"generate_audio,omitzero"`
	// Controls how closely the video generation follows your prompt. Higher values
	// make the model adhere more strictly to your text description, while lower values
	// allow more creative freedom. guidence_scale affects both visual content and
	// temporal consistency.Recommended range is 6.0-10.0 for most video models. Values
	// above 12 may cause over-guidance artifacts or unnatural motion patterns.
	GuidanceScale param.Opt[int64] `json:"guidance_scale,omitzero"`
	Height        param.Opt[int64] `json:"height,omitzero"`
	// Similar to prompt, but specifies what to avoid instead of what to include
	NegativePrompt param.Opt[string] `json:"negative_prompt,omitzero"`
	// Compression quality. Defaults to 20.
	OutputQuality param.Opt[int64] `json:"output_quality,omitzero"`
	// Text prompt that describes the video to generate.
	Prompt param.Opt[string] `json:"prompt,omitzero"`
	// Aspect ratio of the video.
	Ratio param.Opt[string] `json:"ratio,omitzero"`
	// Video resolution.
	Resolution param.Opt[string] `json:"resolution,omitzero"`
	// Clip duration in seconds.
	Seconds param.Opt[string] `json:"seconds,omitzero"`
	// Seed to use in initializing the video generation. Using the same seed allows
	// deterministic video generation. If not provided a random seed is generated for
	// each request.
	Seed param.Opt[int64] `json:"seed,omitzero"`
	// The number of denoising steps the model performs during video generation. More
	// steps typically result in higher quality output but require longer processing
	// time.
	Steps param.Opt[int64] `json:"steps,omitzero"`
	Width param.Opt[int64] `json:"width,omitzero"`
	// Deprecated: use media.frame_images instead. Array of images to guide video
	// generation, similar to keyframes.
	FrameImages []VideoNewParamsFrameImage `json:"frame_images,omitzero"`
	// Media inputs for video generation. The accepted fields depend on the model type
	// (e.g. i2v, r2v, t2v, videoedit).
	Media VideoNewParamsMedia `json:"media,omitzero"`
	// Specifies the format of the output video. Defaults to MP4.
	//
	// Any of "MP4", "WEBM".
	OutputFormat VideoNewParamsOutputFormat `json:"output_format,omitzero"`
	// Deprecated: use media.reference_images instead. Unlike frame_images which
	// constrain specific timeline positions, reference images guide the general
	// appearance that should appear consistently across the video.
	ReferenceImages []string `json:"reference_images,omitzero"`
	// contains filtered or unexported fields
}

func (VideoNewParams) MarshalJSON

func (r VideoNewParams) MarshalJSON() (data []byte, err error)

func (*VideoNewParams) UnmarshalJSON

func (r *VideoNewParams) UnmarshalJSON(data []byte) error

type VideoNewParamsFrameImage

type VideoNewParamsFrameImage struct {
	// URL path to hosted image that is used for a frame
	InputImage string `json:"input_image" api:"required"`
	// Optional param to specify where to insert the frame. If this is omitted, the
	// following heuristics are applied:
	//
	// - frame_images size is one, frame is first.
	// - If size is two, frames are first and last.
	// - If size is larger, frames are first, last and evenly spaced between.
	Frame VideoNewParamsFrameImageFrameUnion `json:"frame,omitzero"`
	// contains filtered or unexported fields
}

The property InputImage is required.

func (VideoNewParamsFrameImage) MarshalJSON

func (r VideoNewParamsFrameImage) MarshalJSON() (data []byte, err error)

func (*VideoNewParamsFrameImage) UnmarshalJSON

func (r *VideoNewParamsFrameImage) UnmarshalJSON(data []byte) error

type VideoNewParamsFrameImageFrameString

type VideoNewParamsFrameImageFrameString string
const (
	VideoNewParamsFrameImageFrameStringFirst VideoNewParamsFrameImageFrameString = "first"
	VideoNewParamsFrameImageFrameStringLast  VideoNewParamsFrameImageFrameString = "last"
)

type VideoNewParamsFrameImageFrameUnion

type VideoNewParamsFrameImageFrameUnion struct {
	OfFloat param.Opt[float64] `json:",omitzero,inline"`
	// Check if union is this variant with
	// !param.IsOmitted(union.OfVideoNewsFrameImageFrameString)
	OfVideoNewsFrameImageFrameString param.Opt[string] `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (VideoNewParamsFrameImageFrameUnion) MarshalJSON

func (u VideoNewParamsFrameImageFrameUnion) MarshalJSON() ([]byte, error)

func (*VideoNewParamsFrameImageFrameUnion) UnmarshalJSON

func (u *VideoNewParamsFrameImageFrameUnion) UnmarshalJSON(data []byte) error

type VideoNewParamsMedia added in v0.9.0

type VideoNewParamsMedia struct {
	// Array of audio inputs. Each element accepts a URL string or an object with an
	// "audio" key.
	AudioInputs []VideoNewParamsMediaAudioInputUnion `json:"audio_inputs,omitzero"`
	// Array of images to guide video generation at specific timeline positions.
	FrameImages []VideoNewParamsMediaFrameImage `json:"frame_images,omitzero"`
	// Array of video clips to use as starting clips.
	FrameVideos []VideoNewParamsMediaFrameVideo `json:"frame_videos,omitzero"`
	// Array of image URLs that guide the general appearance across the video.
	ReferenceImages []string `json:"reference_images,omitzero"`
	// Array of reference videos.
	ReferenceVideos []VideoNewParamsMediaReferenceVideo `json:"reference_videos,omitzero"`
	// Source video to edit. Accepts a URL string or an object with a "video" key.
	SourceVideo VideoNewParamsMediaSourceVideoUnion `json:"source_video,omitzero"`
	// contains filtered or unexported fields
}

Media inputs for video generation. The accepted fields depend on the model type (e.g. i2v, r2v, t2v, videoedit).

func (VideoNewParamsMedia) MarshalJSON added in v0.9.0

func (r VideoNewParamsMedia) MarshalJSON() (data []byte, err error)

func (*VideoNewParamsMedia) UnmarshalJSON added in v0.9.0

func (r *VideoNewParamsMedia) UnmarshalJSON(data []byte) error

type VideoNewParamsMediaAudioInputAudioRef added in v0.10.0

type VideoNewParamsMediaAudioInputAudioRef struct {
	// URL of the audio.
	Audio string `json:"audio" api:"required"`
	// contains filtered or unexported fields
}

The property Audio is required.

func (VideoNewParamsMediaAudioInputAudioRef) MarshalJSON added in v0.10.0

func (r VideoNewParamsMediaAudioInputAudioRef) MarshalJSON() (data []byte, err error)

func (*VideoNewParamsMediaAudioInputAudioRef) UnmarshalJSON added in v0.10.0

func (r *VideoNewParamsMediaAudioInputAudioRef) UnmarshalJSON(data []byte) error

type VideoNewParamsMediaAudioInputUnion added in v0.10.0

type VideoNewParamsMediaAudioInputUnion struct {
	OfString                           param.Opt[string]                      `json:",omitzero,inline"`
	OfVideoNewsMediaAudioInputAudioRef *VideoNewParamsMediaAudioInputAudioRef `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (VideoNewParamsMediaAudioInputUnion) MarshalJSON added in v0.10.0

func (u VideoNewParamsMediaAudioInputUnion) MarshalJSON() ([]byte, error)

func (*VideoNewParamsMediaAudioInputUnion) UnmarshalJSON added in v0.10.0

func (u *VideoNewParamsMediaAudioInputUnion) UnmarshalJSON(data []byte) error

type VideoNewParamsMediaFrameImage added in v0.9.0

type VideoNewParamsMediaFrameImage struct {
	// URL path to hosted image that is used for a frame
	InputImage string `json:"input_image" api:"required"`
	// Optional param to specify where to insert the frame. If this is omitted, the
	// following heuristics are applied:
	//
	// - frame_images size is one, frame is first.
	// - If size is two, frames are first and last.
	// - If size is larger, frames are first, last and evenly spaced between.
	Frame VideoNewParamsMediaFrameImageFrameUnion `json:"frame,omitzero"`
	// contains filtered or unexported fields
}

The property InputImage is required.

func (VideoNewParamsMediaFrameImage) MarshalJSON added in v0.9.0

func (r VideoNewParamsMediaFrameImage) MarshalJSON() (data []byte, err error)

func (*VideoNewParamsMediaFrameImage) UnmarshalJSON added in v0.9.0

func (r *VideoNewParamsMediaFrameImage) UnmarshalJSON(data []byte) error

type VideoNewParamsMediaFrameImageFrameString added in v0.9.0

type VideoNewParamsMediaFrameImageFrameString string
const (
	VideoNewParamsMediaFrameImageFrameStringFirst VideoNewParamsMediaFrameImageFrameString = "first"
	VideoNewParamsMediaFrameImageFrameStringLast  VideoNewParamsMediaFrameImageFrameString = "last"
)

type VideoNewParamsMediaFrameImageFrameUnion added in v0.9.0

type VideoNewParamsMediaFrameImageFrameUnion struct {
	OfFloat param.Opt[float64] `json:",omitzero,inline"`
	// Check if union is this variant with
	// !param.IsOmitted(union.OfVideoNewsMediaFrameImageFrameString)
	OfVideoNewsMediaFrameImageFrameString param.Opt[string] `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (VideoNewParamsMediaFrameImageFrameUnion) MarshalJSON added in v0.9.0

func (u VideoNewParamsMediaFrameImageFrameUnion) MarshalJSON() ([]byte, error)

func (*VideoNewParamsMediaFrameImageFrameUnion) UnmarshalJSON added in v0.9.0

func (u *VideoNewParamsMediaFrameImageFrameUnion) UnmarshalJSON(data []byte) error

type VideoNewParamsMediaFrameVideo added in v0.9.0

type VideoNewParamsMediaFrameVideo struct {
	// URL of the video.
	Video string `json:"video" api:"required"`
	// contains filtered or unexported fields
}

The property Video is required.

func (VideoNewParamsMediaFrameVideo) MarshalJSON added in v0.9.0

func (r VideoNewParamsMediaFrameVideo) MarshalJSON() (data []byte, err error)

func (*VideoNewParamsMediaFrameVideo) UnmarshalJSON added in v0.9.0

func (r *VideoNewParamsMediaFrameVideo) UnmarshalJSON(data []byte) error

type VideoNewParamsMediaReferenceVideo added in v0.9.0

type VideoNewParamsMediaReferenceVideo struct {
	// URL of the video.
	Video string `json:"video" api:"required"`
	// contains filtered or unexported fields
}

The property Video is required.

func (VideoNewParamsMediaReferenceVideo) MarshalJSON added in v0.9.0

func (r VideoNewParamsMediaReferenceVideo) MarshalJSON() (data []byte, err error)

func (*VideoNewParamsMediaReferenceVideo) UnmarshalJSON added in v0.9.0

func (r *VideoNewParamsMediaReferenceVideo) UnmarshalJSON(data []byte) error

type VideoNewParamsMediaSourceVideoUnion added in v0.10.0

type VideoNewParamsMediaSourceVideoUnion struct {
	OfString                            param.Opt[string]                       `json:",omitzero,inline"`
	OfVideoNewsMediaSourceVideoVideoRef *VideoNewParamsMediaSourceVideoVideoRef `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (VideoNewParamsMediaSourceVideoUnion) MarshalJSON added in v0.10.0

func (u VideoNewParamsMediaSourceVideoUnion) MarshalJSON() ([]byte, error)

func (*VideoNewParamsMediaSourceVideoUnion) UnmarshalJSON added in v0.10.0

func (u *VideoNewParamsMediaSourceVideoUnion) UnmarshalJSON(data []byte) error

type VideoNewParamsMediaSourceVideoVideoRef added in v0.10.0

type VideoNewParamsMediaSourceVideoVideoRef struct {
	// URL of the video.
	Video string `json:"video" api:"required"`
	// contains filtered or unexported fields
}

The property Video is required.

func (VideoNewParamsMediaSourceVideoVideoRef) MarshalJSON added in v0.10.0

func (r VideoNewParamsMediaSourceVideoVideoRef) MarshalJSON() (data []byte, err error)

func (*VideoNewParamsMediaSourceVideoVideoRef) UnmarshalJSON added in v0.10.0

func (r *VideoNewParamsMediaSourceVideoVideoRef) UnmarshalJSON(data []byte) error

type VideoNewParamsOutputFormat

type VideoNewParamsOutputFormat string

Specifies the format of the output video. Defaults to MP4.

const (
	VideoNewParamsOutputFormatMP4  VideoNewParamsOutputFormat = "MP4"
	VideoNewParamsOutputFormatWebm VideoNewParamsOutputFormat = "WEBM"
)

type VideoService

type VideoService struct {
	Options []option.RequestOption
}

VideoService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewVideoService method instead.

func NewVideoService

func NewVideoService(opts ...option.RequestOption) (r VideoService)

NewVideoService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*VideoService) Get

func (r *VideoService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *VideoJob, err error)

Fetch video metadata

func (*VideoService) New

func (r *VideoService) New(ctx context.Context, body VideoNewParams, opts ...option.RequestOption) (res *VideoJob, err error)

Create a video

type Volume added in v0.6.0

type Volume struct {
	// ID is the unique identifier for this volume
	ID      string        `json:"id"`
	Content VolumeContent `json:"content"`
	// CreatedAt is the ISO8601 timestamp when this volume was created
	CreatedAt string `json:"created_at"`
	// CurrentVersion is the current version number of this volume
	CurrentVersion int64 `json:"current_version"`
	// MountedBy is the list of deployment IDs currently mounting current volume
	// version
	MountedBy []string `json:"mounted_by"`
	// Name is the name of the volume
	Name string `json:"name"`
	// Object is the type identifier for this response (always "volume")
	Object string `json:"object"`
	// Any of "readOnly".
	Type VolumeType `json:"type"`
	// UpdatedAt is the ISO8601 timestamp when this volume was last updated
	UpdatedAt string `json:"updated_at"`
	// VersionHistory contains previous versions of this volume, keyed by version
	// number
	VersionHistory map[string]VolumeVersionHistory `json:"version_history"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		Content        respjson.Field
		CreatedAt      respjson.Field
		CurrentVersion respjson.Field
		MountedBy      respjson.Field
		Name           respjson.Field
		Object         respjson.Field
		Type           respjson.Field
		UpdatedAt      respjson.Field
		VersionHistory respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (Volume) RawJSON added in v0.6.0

func (r Volume) RawJSON() string

Returns the unmodified JSON received from the API

func (*Volume) UnmarshalJSON added in v0.6.0

func (r *Volume) UnmarshalJSON(data []byte) error

type VolumeContent added in v0.6.0

type VolumeContent struct {
	// Files is the list of files to preload into the volume, if the volume content
	// type is "files".
	Files []VolumeContentFile `json:"files"`
	// SourcePrefix is the file path prefix for the content to be preloaded into the
	// volume
	SourcePrefix string `json:"source_prefix"`
	// Type is the content type (currently only "files" is supported which allows
	// preloading files uploaded via Files API into the volume)
	//
	// Any of "files".
	Type string `json:"type"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Files        respjson.Field
		SourcePrefix respjson.Field
		Type         respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (VolumeContent) RawJSON added in v0.6.0

func (r VolumeContent) RawJSON() string

Returns the unmodified JSON received from the API

func (*VolumeContent) UnmarshalJSON added in v0.6.0

func (r *VolumeContent) UnmarshalJSON(data []byte) error

type VolumeContentFile added in v0.7.0

type VolumeContentFile struct {
	// LastModified is the timestamp when the file was last modified
	LastModified string `json:"last_modified"`
	// Name is the filename including extension (e.g., "model_weights.bin")
	Name string `json:"name"`
	// Size is the file size in bytes
	Size int64 `json:"size"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		LastModified respjson.Field
		Name         respjson.Field
		Size         respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (VolumeContentFile) RawJSON added in v0.7.0

func (r VolumeContentFile) RawJSON() string

Returns the unmodified JSON received from the API

func (*VolumeContentFile) UnmarshalJSON added in v0.7.0

func (r *VolumeContentFile) UnmarshalJSON(data []byte) error

type VolumeType added in v0.6.0

type VolumeType string
const (
	VolumeTypeReadOnly VolumeType = "readOnly"
)

type VolumeVersionHistory added in v0.7.0

type VolumeVersionHistory struct {
	// Content specifies the new content to preload to this volume.
	Content   VolumeVersionHistoryContent `json:"content"`
	MountedBy []string                    `json:"mounted_by"`
	Version   int64                       `json:"version"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content     respjson.Field
		MountedBy   respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (VolumeVersionHistory) RawJSON added in v0.7.0

func (r VolumeVersionHistory) RawJSON() string

Returns the unmodified JSON received from the API

func (*VolumeVersionHistory) UnmarshalJSON added in v0.7.0

func (r *VolumeVersionHistory) UnmarshalJSON(data []byte) error

type VolumeVersionHistoryContent added in v0.7.0

type VolumeVersionHistoryContent struct {
	// SourcePrefix is the file path prefix for the content to be preloaded into the
	// volume
	SourcePrefix string `json:"source_prefix"`
	// Type is the content type (currently only "files" is supported which allows
	// preloading files uploaded via Files API into the volume)
	//
	// Any of "files".
	Type string `json:"type"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		SourcePrefix respjson.Field
		Type         respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Content specifies the new content to preload to this volume.

func (VolumeVersionHistoryContent) RawJSON added in v0.7.0

func (r VolumeVersionHistoryContent) RawJSON() string

Returns the unmodified JSON received from the API

func (*VolumeVersionHistoryContent) UnmarshalJSON added in v0.7.0

func (r *VolumeVersionHistoryContent) UnmarshalJSON(data []byte) error

Directories

Path Synopsis
encoding/json
Package json implements encoding and decoding of JSON as defined in RFC 7159.
Package json implements encoding and decoding of JSON as defined in RFC 7159.
encoding/json/shims
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
packages
shared

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL