Documentation
¶
Index ¶
- func Bool(b bool) param.Opt[bool]
- func BoolPtr(v bool) *bool
- func DefaultClientOptions() []option.RequestOption
- func File(rdr io.Reader, filename string, contentType string) file
- func Float(f float64) param.Opt[float64]
- func FloatPtr(v float64) *float64
- func Int(i int64) param.Opt[int64]
- func IntPtr(v int64) *int64
- func Opt[T comparable](v T) param.Opt[T]
- func Ptr[T any](v T) *T
- func String(s string) param.Opt[string]
- func StringPtr(v string) *string
- func Time(t time.Time) param.Opt[time.Time]
- func TimePtr(v time.Time) *time.Time
- type AbExperiment
- type AbMember
- type AbMemberParam
- type AbMemberRole
- type AdamwOptimizerConfig
- type AdamwOptimizerParams
- type AudioService
- type AudioSpeechNewParams
- type AudioSpeechNewParamsExtraParams
- type AudioSpeechNewParamsModel
- type AudioSpeechNewParamsResponseEncoding
- type AudioSpeechNewParamsResponseFormat
- type AudioSpeechService
- func (r *AudioSpeechService) New(ctx context.Context, body AudioSpeechNewParams, opts ...option.RequestOption) (res *http.Response, err error)
- func (r *AudioSpeechService) NewStreaming(ctx context.Context, body AudioSpeechNewParams, opts ...option.RequestOption) (stream *ssestream.Stream[AudioSpeechStreamChunk])
- type AudioSpeechStreamChunk
- type AudioTranscriptionNewParams
- type AudioTranscriptionNewParamsFileUnion
- type AudioTranscriptionNewParamsModel
- type AudioTranscriptionNewParamsResponseFormat
- type AudioTranscriptionNewParamsTimestampGranularitiesString
- type AudioTranscriptionNewParamsTimestampGranularitiesUnion
- type AudioTranscriptionNewResponseAudioTranscriptionJsonResponse
- type AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponse
- type AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSegment
- type AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSpeakerSegment
- type AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSpeakerSegmentWord
- type AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseWord
- type AudioTranscriptionNewResponseUnion
- func (u AudioTranscriptionNewResponseUnion) AsAudioTranscriptionNewResponseAudioTranscriptionJsonResponse() (v AudioTranscriptionNewResponseAudioTranscriptionJsonResponse)
- func (u AudioTranscriptionNewResponseUnion) AsAudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponse() (v AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponse)
- func (u AudioTranscriptionNewResponseUnion) RawJSON() string
- func (r *AudioTranscriptionNewResponseUnion) UnmarshalJSON(data []byte) error
- type AudioTranscriptionService
- type AudioTranslationNewParams
- type AudioTranslationNewParamsFileUnion
- type AudioTranslationNewParamsModel
- type AudioTranslationNewParamsResponseFormat
- type AudioTranslationNewParamsTimestampGranularitiesString
- type AudioTranslationNewParamsTimestampGranularitiesUnion
- type AudioTranslationNewResponseAudioTranslationJsonResponse
- type AudioTranslationNewResponseAudioTranslationVerboseJsonResponse
- type AudioTranslationNewResponseAudioTranslationVerboseJsonResponseSegment
- type AudioTranslationNewResponseAudioTranslationVerboseJsonResponseWord
- type AudioTranslationNewResponseUnion
- func (u AudioTranslationNewResponseUnion) AsAudioTranslationNewResponseAudioTranslationJsonResponse() (v AudioTranslationNewResponseAudioTranslationJsonResponse)
- func (u AudioTranslationNewResponseUnion) AsAudioTranslationNewResponseAudioTranslationVerboseJsonResponse() (v AudioTranslationNewResponseAudioTranslationVerboseJsonResponse)
- func (u AudioTranslationNewResponseUnion) RawJSON() string
- func (r *AudioTranslationNewResponseUnion) UnmarshalJSON(data []byte) error
- type AudioTranslationService
- type AudioVoiceListResponse
- type AudioVoiceListResponseData
- type AudioVoiceListResponseDataVoice
- type AudioVoiceService
- type Autoscaling
- type AutoscalingParam
- type BatchJob
- type BatchJobStatus
- type BatchNewParams
- type BatchNewParamsEndpoint
- type BatchNewResponse
- type BatchService
- func (r *BatchService) Cancel(ctx context.Context, id string, opts ...option.RequestOption) (res *BatchJob, err error)
- func (r *BatchService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *BatchJob, err error)
- func (r *BatchService) List(ctx context.Context, opts ...option.RequestOption) (res *[]BatchJob, err error)
- func (r *BatchService) New(ctx context.Context, body BatchNewParams, opts ...option.RequestOption) (res *BatchNewResponse, err error)
- type BetaClusterDeleteResponse
- type BetaClusterListParams
- type BetaClusterListRegionsResponse
- type BetaClusterListRegionsResponseRegion
- type BetaClusterListRegionsResponseRegionDriverVersion
- type BetaClusterListResponse
- type BetaClusterNewParams
- type BetaClusterNewParamsAcceptanceTestsParams
- type BetaClusterNewParamsAddOn
- type BetaClusterNewParamsAddOnConfig
- type BetaClusterNewParamsAddOnConfigDashboard
- type BetaClusterNewParamsAddOnConfigHeadlamp
- type BetaClusterNewParamsAddOnConfigIngress
- type BetaClusterNewParamsAddOnConfigSlurmWeb
- type BetaClusterNewParamsAddOnConfigTorchpass
- type BetaClusterNewParamsBillingType
- type BetaClusterNewParamsClusterConfig
- type BetaClusterNewParamsClusterConfigIngress
- type BetaClusterNewParamsClusterConfigObservability
- type BetaClusterNewParamsClusterConfigSlurmStartupScripts
- type BetaClusterNewParamsClusterType
- type BetaClusterNewParamsGPUType
- type BetaClusterNewParamsOidcConfig
- type BetaClusterNewParamsSharedVolume
- type BetaClusterRemediationApproveParams
- type BetaClusterRemediationApproveParamsMode
- type BetaClusterRemediationCancelParams
- type BetaClusterRemediationGetParams
- type BetaClusterRemediationListParams
- type BetaClusterRemediationListResponse
- type BetaClusterRemediationNewParams
- type BetaClusterRemediationRejectParams
- type BetaClusterRemediationService
- func (r *BetaClusterRemediationService) Approve(ctx context.Context, remediationID string, ...) (res *Remediation, err error)
- func (r *BetaClusterRemediationService) Cancel(ctx context.Context, remediationID string, ...) (res *Remediation, err error)
- func (r *BetaClusterRemediationService) Get(ctx context.Context, remediationID string, ...) (res *Remediation, err error)
- func (r *BetaClusterRemediationService) List(ctx context.Context, instanceID string, ...) (res *BetaClusterRemediationListResponse, err error)
- func (r *BetaClusterRemediationService) New(ctx context.Context, instanceID string, params BetaClusterRemediationNewParams, ...) (res *Remediation, err error)
- func (r *BetaClusterRemediationService) Reject(ctx context.Context, remediationID string, ...) (res *Remediation, err error)
- type BetaClusterService
- func (r *BetaClusterService) Delete(ctx context.Context, clusterID string, opts ...option.RequestOption) (res *BetaClusterDeleteResponse, err error)
- func (r *BetaClusterService) Get(ctx context.Context, clusterID string, opts ...option.RequestOption) (res *Cluster, err error)
- func (r *BetaClusterService) List(ctx context.Context, query BetaClusterListParams, opts ...option.RequestOption) (res *BetaClusterListResponse, err error)
- func (r *BetaClusterService) ListRegions(ctx context.Context, opts ...option.RequestOption) (res *BetaClusterListRegionsResponse, err error)
- func (r *BetaClusterService) New(ctx context.Context, body BetaClusterNewParams, opts ...option.RequestOption) (res *Cluster, err error)
- func (r *BetaClusterService) Update(ctx context.Context, clusterID string, body BetaClusterUpdateParams, ...) (res *Cluster, err error)
- type BetaClusterStorageDeleteResponse
- type BetaClusterStorageListParams
- type BetaClusterStorageListResponse
- type BetaClusterStorageNewParams
- type BetaClusterStorageService
- func (r *BetaClusterStorageService) Delete(ctx context.Context, volumeID string, opts ...option.RequestOption) (res *BetaClusterStorageDeleteResponse, err error)
- func (r *BetaClusterStorageService) Get(ctx context.Context, volumeID string, opts ...option.RequestOption) (res *ClusterStorage, err error)
- func (r *BetaClusterStorageService) List(ctx context.Context, query BetaClusterStorageListParams, ...) (res *BetaClusterStorageListResponse, err error)
- func (r *BetaClusterStorageService) New(ctx context.Context, body BetaClusterStorageNewParams, ...) (res *ClusterStorage, err error)
- func (r *BetaClusterStorageService) Update(ctx context.Context, body BetaClusterStorageUpdateParams, ...) (res *ClusterStorage, err error)
- type BetaClusterStorageUpdateParams
- type BetaClusterUpdateParams
- type BetaClusterUpdateParamsAddOn
- type BetaClusterUpdateParamsAddOnConfig
- type BetaClusterUpdateParamsAddOnConfigDashboard
- type BetaClusterUpdateParamsAddOnConfigHeadlamp
- type BetaClusterUpdateParamsAddOnConfigIngress
- type BetaClusterUpdateParamsAddOnConfigSlurmWeb
- type BetaClusterUpdateParamsAddOnConfigTorchpass
- type BetaClusterUpdateParamsClusterConfig
- type BetaClusterUpdateParamsClusterConfigIngress
- type BetaClusterUpdateParamsClusterConfigObservability
- type BetaClusterUpdateParamsClusterConfigSlurmStartupScripts
- type BetaClusterUpdateParamsClusterType
- type BetaEndpointAbExperimentDeleteParams
- type BetaEndpointAbExperimentDeleteResponse
- type BetaEndpointAbExperimentGetParams
- type BetaEndpointAbExperimentListParams
- type BetaEndpointAbExperimentNewParams
- type BetaEndpointAbExperimentService
- func (r *BetaEndpointAbExperimentService) Delete(ctx context.Context, id string, params BetaEndpointAbExperimentDeleteParams, ...) (res *BetaEndpointAbExperimentDeleteResponse, err error)
- func (r *BetaEndpointAbExperimentService) Get(ctx context.Context, id string, query BetaEndpointAbExperimentGetParams, ...) (res *AbExperiment, err error)
- func (r *BetaEndpointAbExperimentService) List(ctx context.Context, endpointID string, ...) (res *pagination.CursorPagination[AbExperiment], err error)
- func (r *BetaEndpointAbExperimentService) ListAutoPaging(ctx context.Context, endpointID string, ...) *pagination.CursorPaginationAutoPager[AbExperiment]
- func (r *BetaEndpointAbExperimentService) New(ctx context.Context, endpointID string, ...) (res *AbExperiment, err error)
- func (r *BetaEndpointAbExperimentService) Update(ctx context.Context, id string, params BetaEndpointAbExperimentUpdateParams, ...) (res *AbExperiment, err error)
- type BetaEndpointAbExperimentUpdateParams
- type BetaEndpointAdapterDeleteParams
- type BetaEndpointAdapterDeleteResponse
- type BetaEndpointAdapterGetParams
- type BetaEndpointAdapterGetResponse
- type BetaEndpointAdapterGetResponsePerCluster
- type BetaEndpointAdapterListParams
- type BetaEndpointAdapterListResponse
- type BetaEndpointAdapterListResponsePerCluster
- type BetaEndpointAdapterNewParams
- type BetaEndpointAdapterNewResponse
- type BetaEndpointAdapterNewResponsePerCluster
- type BetaEndpointAdapterService
- func (r *BetaEndpointAdapterService) Delete(ctx context.Context, id string, params BetaEndpointAdapterDeleteParams, ...) (res *BetaEndpointAdapterDeleteResponse, err error)
- func (r *BetaEndpointAdapterService) Get(ctx context.Context, id string, query BetaEndpointAdapterGetParams, ...) (res *BetaEndpointAdapterGetResponse, err error)
- func (r *BetaEndpointAdapterService) List(ctx context.Context, endpointID string, deploymentID string, ...) (res *pagination.CursorPagination[BetaEndpointAdapterListResponse], err error)
- func (r *BetaEndpointAdapterService) ListAutoPaging(ctx context.Context, endpointID string, deploymentID string, ...) *pagination.CursorPaginationAutoPager[BetaEndpointAdapterListResponse]
- func (r *BetaEndpointAdapterService) New(ctx context.Context, params BetaEndpointAdapterNewParams, ...) (res *BetaEndpointAdapterNewResponse, err error)
- func (r *BetaEndpointAdapterService) Update(ctx context.Context, id string, params BetaEndpointAdapterUpdateParams, ...) (res *BetaEndpointAdapterUpdateResponse, err error)
- type BetaEndpointAdapterUpdateParams
- type BetaEndpointAdapterUpdateResponse
- type BetaEndpointAdapterUpdateResponsePerCluster
- type BetaEndpointAnalyticsParams
- type BetaEndpointAnalyticsResponse
- type BetaEndpointAnalyticsResponseDeploymentAnalytics
- type BetaEndpointAnalyticsResponseDeploymentAnalyticsMetrics
- type BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsErrorMetrics
- type BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsLatencyMetrics
- type BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsRequestMetrics
- type BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsResourceUtilization
- type BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsThroughputMetrics
- type BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsTimeRange
- type BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsTokenMetrics
- type BetaEndpointAnalyticsResponseDeploymentAnalyticsTimeRange
- type BetaEndpointAnalyticsResponseDeploymentAnalyticsTimeSeries
- type BetaEndpointAnalyticsResponseMetrics
- type BetaEndpointAnalyticsResponseMetricsDeploymentMetric
- type BetaEndpointAnalyticsResponseMetricsDeploymentMetricErrorMetrics
- type BetaEndpointAnalyticsResponseMetricsDeploymentMetricLatencyMetrics
- type BetaEndpointAnalyticsResponseMetricsDeploymentMetricRequestMetrics
- type BetaEndpointAnalyticsResponseMetricsDeploymentMetricResourceUtilization
- type BetaEndpointAnalyticsResponseMetricsDeploymentMetricThroughputMetrics
- type BetaEndpointAnalyticsResponseMetricsDeploymentMetricTimeRange
- type BetaEndpointAnalyticsResponseMetricsDeploymentMetricTokenMetrics
- type BetaEndpointAnalyticsResponseMetricsErrorMetrics
- type BetaEndpointAnalyticsResponseMetricsLatencyMetrics
- type BetaEndpointAnalyticsResponseMetricsRequestMetrics
- type BetaEndpointAnalyticsResponseMetricsResourceUtilization
- type BetaEndpointAnalyticsResponseMetricsThroughputMetrics
- type BetaEndpointAnalyticsResponseMetricsTimeRange
- type BetaEndpointAnalyticsResponseMetricsTokenMetrics
- type BetaEndpointAnalyticsResponseTimeRange
- type BetaEndpointAnalyticsResponseTimeSeries
- type BetaEndpointDeleteParams
- type BetaEndpointDeleteResponse
- type BetaEndpointDeploymentDeleteParams
- type BetaEndpointDeploymentDeleteResponse
- type BetaEndpointDeploymentGetParams
- type BetaEndpointDeploymentListParams
- type BetaEndpointDeploymentNewParams
- type BetaEndpointDeploymentNewParamsPlacementInline
- type BetaEndpointDeploymentNewParamsPlacementProfile
- type BetaEndpointDeploymentNewParamsPlacementUnion
- type BetaEndpointDeploymentService
- func (r *BetaEndpointDeploymentService) Delete(ctx context.Context, id string, params BetaEndpointDeploymentDeleteParams, ...) (res *BetaEndpointDeploymentDeleteResponse, err error)
- func (r *BetaEndpointDeploymentService) Get(ctx context.Context, id string, query BetaEndpointDeploymentGetParams, ...) (res *EndpointDeployment, err error)
- func (r *BetaEndpointDeploymentService) List(ctx context.Context, endpointID string, ...) (res *pagination.CursorPagination[EndpointDeployment], err error)
- func (r *BetaEndpointDeploymentService) ListAutoPaging(ctx context.Context, endpointID string, ...) *pagination.CursorPaginationAutoPager[EndpointDeployment]
- func (r *BetaEndpointDeploymentService) New(ctx context.Context, endpointID string, params BetaEndpointDeploymentNewParams, ...) (res *EndpointDeployment, err error)
- func (r *BetaEndpointDeploymentService) Update(ctx context.Context, id string, params BetaEndpointDeploymentUpdateParams, ...) (res *EndpointDeployment, err error)
- type BetaEndpointDeploymentUpdateParams
- type BetaEndpointGetParams
- type BetaEndpointHardwareListResponse
- type BetaEndpointHardwareService
- type BetaEndpointListEventsParams
- type BetaEndpointListEventsParamsMinLevel
- type BetaEndpointListEventsResponse
- type BetaEndpointListEventsResponseLevel
- type BetaEndpointListEventsResponseSourceKind
- type BetaEndpointListOrgScopedParams
- type BetaEndpointListParams
- type BetaEndpointNewParams
- type BetaEndpointNewParamsVisibility
- type BetaEndpointPlacementProfileGetParams
- type BetaEndpointPlacementProfileListParams
- type BetaEndpointPlacementProfileService
- func (r *BetaEndpointPlacementProfileService) Get(ctx context.Context, id string, query BetaEndpointPlacementProfileGetParams, ...) (res *PlacementProfile, err error)
- func (r *BetaEndpointPlacementProfileService) List(ctx context.Context, params BetaEndpointPlacementProfileListParams, ...) (res *pagination.CursorPagination[PlacementProfile], err error)
- func (r *BetaEndpointPlacementProfileService) ListAutoPaging(ctx context.Context, params BetaEndpointPlacementProfileListParams, ...) *pagination.CursorPaginationAutoPager[PlacementProfile]
- type BetaEndpointService
- func (r *BetaEndpointService) Analytics(ctx context.Context, id string, params BetaEndpointAnalyticsParams, ...) (res *BetaEndpointAnalyticsResponse, err error)
- func (r *BetaEndpointService) Delete(ctx context.Context, id string, params BetaEndpointDeleteParams, ...) (res *BetaEndpointDeleteResponse, err error)
- func (r *BetaEndpointService) Get(ctx context.Context, id string, query BetaEndpointGetParams, ...) (res *Endpoint, err error)
- func (r *BetaEndpointService) List(ctx context.Context, params BetaEndpointListParams, ...) (res *pagination.CursorPagination[Endpoint], err error)
- func (r *BetaEndpointService) ListAutoPaging(ctx context.Context, params BetaEndpointListParams, ...) *pagination.CursorPaginationAutoPager[Endpoint]
- func (r *BetaEndpointService) ListEvents(ctx context.Context, id string, params BetaEndpointListEventsParams, ...) (res *pagination.CursorPagination[BetaEndpointListEventsResponse], err error)
- func (r *BetaEndpointService) ListEventsAutoPaging(ctx context.Context, id string, params BetaEndpointListEventsParams, ...) *pagination.CursorPaginationAutoPager[BetaEndpointListEventsResponse]
- func (r *BetaEndpointService) ListOrgScoped(ctx context.Context, organizationID string, ...) (res *pagination.CursorPagination[Endpoint], err error)
- func (r *BetaEndpointService) ListOrgScopedAutoPaging(ctx context.Context, organizationID string, ...) *pagination.CursorPaginationAutoPager[Endpoint]
- func (r *BetaEndpointService) New(ctx context.Context, params BetaEndpointNewParams, ...) (res *Endpoint, err error)
- func (r *BetaEndpointService) Update(ctx context.Context, id string, params BetaEndpointUpdateParams, ...) (res *Endpoint, err error)
- type BetaEndpointShadowExperimentDeleteParams
- type BetaEndpointShadowExperimentDeleteResponse
- type BetaEndpointShadowExperimentGetParams
- type BetaEndpointShadowExperimentListParams
- type BetaEndpointShadowExperimentNewParams
- type BetaEndpointShadowExperimentNewParamsTarget
- type BetaEndpointShadowExperimentService
- func (r *BetaEndpointShadowExperimentService) Delete(ctx context.Context, id string, ...) (res *BetaEndpointShadowExperimentDeleteResponse, err error)
- func (r *BetaEndpointShadowExperimentService) Get(ctx context.Context, id string, query BetaEndpointShadowExperimentGetParams, ...) (res *ShadowExperiment, err error)
- func (r *BetaEndpointShadowExperimentService) List(ctx context.Context, endpointID string, ...) (res *pagination.CursorPagination[ShadowExperiment], err error)
- func (r *BetaEndpointShadowExperimentService) ListAutoPaging(ctx context.Context, endpointID string, ...) *pagination.CursorPaginationAutoPager[ShadowExperiment]
- func (r *BetaEndpointShadowExperimentService) New(ctx context.Context, endpointID string, ...) (res *ShadowExperiment, err error)
- func (r *BetaEndpointShadowExperimentService) Update(ctx context.Context, id string, ...) (res *ShadowExperiment, err error)
- type BetaEndpointShadowExperimentTargetDeleteParams
- type BetaEndpointShadowExperimentTargetDeleteResponse
- type BetaEndpointShadowExperimentTargetGetParams
- type BetaEndpointShadowExperimentTargetListParams
- type BetaEndpointShadowExperimentTargetNewParams
- type BetaEndpointShadowExperimentTargetService
- func (r *BetaEndpointShadowExperimentTargetService) Delete(ctx context.Context, id string, ...) (res *BetaEndpointShadowExperimentTargetDeleteResponse, err error)
- func (r *BetaEndpointShadowExperimentTargetService) Get(ctx context.Context, id string, ...) (res *ShadowExperimentTarget, err error)
- func (r *BetaEndpointShadowExperimentTargetService) List(ctx context.Context, endpointID string, experimentID string, ...) (res *pagination.CursorPagination[ShadowExperimentTarget], err error)
- func (r *BetaEndpointShadowExperimentTargetService) ListAutoPaging(ctx context.Context, endpointID string, experimentID string, ...) *pagination.CursorPaginationAutoPager[ShadowExperimentTarget]
- func (r *BetaEndpointShadowExperimentTargetService) New(ctx context.Context, params BetaEndpointShadowExperimentTargetNewParams, ...) (res *ShadowExperimentTarget, err error)
- func (r *BetaEndpointShadowExperimentTargetService) Update(ctx context.Context, id string, ...) (res *ShadowExperimentTarget, err error)
- type BetaEndpointShadowExperimentTargetUpdateParams
- type BetaEndpointShadowExperimentUpdateParams
- type BetaEndpointUpdateParams
- type BetaEndpointUpdateParamsVisibility
- type BetaJigDeployParams
- type BetaJigDeployParamsAutoscalingCustomMetricAutoscalingConfig
- type BetaJigDeployParamsAutoscalingHTTPAutoscalingConfig
- type BetaJigDeployParamsAutoscalingQueueAutoscalingConfig
- type BetaJigDeployParamsAutoscalingUnion
- func (u BetaJigDeployParamsAutoscalingUnion) GetCustomMetricName() *string
- func (u BetaJigDeployParamsAutoscalingUnion) GetMetric() *string
- func (u BetaJigDeployParamsAutoscalingUnion) GetModel() *string
- func (u BetaJigDeployParamsAutoscalingUnion) GetTarget() *float64
- func (u BetaJigDeployParamsAutoscalingUnion) GetTimeIntervalMinutes() *int64
- func (u BetaJigDeployParamsAutoscalingUnion) MarshalJSON() ([]byte, error)
- func (u *BetaJigDeployParamsAutoscalingUnion) UnmarshalJSON(data []byte) error
- type BetaJigDeployParamsEnvironmentVariable
- type BetaJigDeployParamsGPUType
- type BetaJigDeployParamsVolume
- type BetaJigDestroyResponse
- type BetaJigGetLogsParams
- type BetaJigListResponse
- type BetaJigListResponseObject
- type BetaJigQueueCancelParams
- type BetaJigQueueCancelResponse
- type BetaJigQueueCancelResponseStatus
- type BetaJigQueueClearParams
- type BetaJigQueueClearResponse
- type BetaJigQueueGetParams
- type BetaJigQueueGetResponse
- type BetaJigQueueGetResponseStatus
- type BetaJigQueueMetricsParams
- type BetaJigQueueMetricsResponse
- type BetaJigQueueService
- func (r *BetaJigQueueService) Cancel(ctx context.Context, body BetaJigQueueCancelParams, ...) (res *BetaJigQueueCancelResponse, err error)
- func (r *BetaJigQueueService) Clear(ctx context.Context, body BetaJigQueueClearParams, ...) (res *BetaJigQueueClearResponse, err error)
- func (r *BetaJigQueueService) Get(ctx context.Context, query BetaJigQueueGetParams, opts ...option.RequestOption) (res *BetaJigQueueGetResponse, err error)
- func (r *BetaJigQueueService) Metrics(ctx context.Context, query BetaJigQueueMetricsParams, ...) (res *BetaJigQueueMetricsResponse, err error)
- func (r *BetaJigQueueService) Submit(ctx context.Context, body BetaJigQueueSubmitParams, ...) (res *BetaJigQueueSubmitResponse, err error)
- type BetaJigQueueSubmitParams
- type BetaJigQueueSubmitResponse
- type BetaJigSecretDeleteResponse
- type BetaJigSecretListResponse
- type BetaJigSecretListResponseObject
- type BetaJigSecretNewParams
- type BetaJigSecretService
- func (r *BetaJigSecretService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (res *BetaJigSecretDeleteResponse, err error)
- func (r *BetaJigSecretService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Secret, err error)
- func (r *BetaJigSecretService) List(ctx context.Context, opts ...option.RequestOption) (res *BetaJigSecretListResponse, err error)
- func (r *BetaJigSecretService) New(ctx context.Context, body BetaJigSecretNewParams, opts ...option.RequestOption) (res *Secret, err error)
- func (r *BetaJigSecretService) Update(ctx context.Context, id string, body BetaJigSecretUpdateParams, ...) (res *Secret, err error)
- type BetaJigSecretUpdateParams
- type BetaJigService
- func (r *BetaJigService) Deploy(ctx context.Context, body BetaJigDeployParams, opts ...option.RequestOption) (res *Deployment, err error)
- func (r *BetaJigService) Destroy(ctx context.Context, id string, opts ...option.RequestOption) (res *BetaJigDestroyResponse, err error)
- func (r *BetaJigService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Deployment, err error)
- func (r *BetaJigService) GetLogs(ctx context.Context, id string, query BetaJigGetLogsParams, ...) (res *DeploymentLogs, err error)
- func (r *BetaJigService) List(ctx context.Context, opts ...option.RequestOption) (res *BetaJigListResponse, err error)
- func (r *BetaJigService) Update(ctx context.Context, id string, body BetaJigUpdateParams, ...) (res *Deployment, err error)
- type BetaJigUpdateParams
- type BetaJigUpdateParamsAutoscalingCustomMetricAutoscalingConfig
- type BetaJigUpdateParamsAutoscalingHTTPAutoscalingConfig
- type BetaJigUpdateParamsAutoscalingQueueAutoscalingConfig
- type BetaJigUpdateParamsAutoscalingUnion
- func (u BetaJigUpdateParamsAutoscalingUnion) GetCustomMetricName() *string
- func (u BetaJigUpdateParamsAutoscalingUnion) GetMetric() *string
- func (u BetaJigUpdateParamsAutoscalingUnion) GetModel() *string
- func (u BetaJigUpdateParamsAutoscalingUnion) GetTarget() *float64
- func (u BetaJigUpdateParamsAutoscalingUnion) GetTimeIntervalMinutes() *int64
- func (u BetaJigUpdateParamsAutoscalingUnion) MarshalJSON() ([]byte, error)
- func (u *BetaJigUpdateParamsAutoscalingUnion) UnmarshalJSON(data []byte) error
- type BetaJigUpdateParamsEnvironmentVariable
- type BetaJigUpdateParamsGPUType
- type BetaJigUpdateParamsVolume
- type BetaJigVolumeDeleteResponse
- type BetaJigVolumeGetParams
- type BetaJigVolumeListResponse
- type BetaJigVolumeListResponseObject
- type BetaJigVolumeNewParams
- type BetaJigVolumeNewParamsContent
- type BetaJigVolumeNewParamsType
- type BetaJigVolumeService
- func (r *BetaJigVolumeService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (res *BetaJigVolumeDeleteResponse, err error)
- func (r *BetaJigVolumeService) Get(ctx context.Context, id string, query BetaJigVolumeGetParams, ...) (res *Volume, err error)
- func (r *BetaJigVolumeService) List(ctx context.Context, opts ...option.RequestOption) (res *BetaJigVolumeListResponse, err error)
- func (r *BetaJigVolumeService) New(ctx context.Context, body BetaJigVolumeNewParams, opts ...option.RequestOption) (res *Volume, err error)
- func (r *BetaJigVolumeService) Update(ctx context.Context, id string, body BetaJigVolumeUpdateParams, ...) (res *Volume, err error)
- type BetaJigVolumeUpdateParams
- type BetaJigVolumeUpdateParamsContent
- type BetaJigVolumeUpdateParamsType
- type BetaModelConfigGetParams
- type BetaModelConfigListParams
- type BetaModelConfigService
- func (r *BetaModelConfigService) Get(ctx context.Context, id string, query BetaModelConfigGetParams, ...) (res *Config, err error)
- func (r *BetaModelConfigService) List(ctx context.Context, params BetaModelConfigListParams, ...) (res *pagination.CursorPagination[Config], err error)
- func (r *BetaModelConfigService) ListAutoPaging(ctx context.Context, params BetaModelConfigListParams, ...) *pagination.CursorPaginationAutoPager[Config]
- type BetaModelDeleteParams
- type BetaModelDeleteResponse
- type BetaModelGetParams
- type BetaModelListFilesParams
- type BetaModelListFilesResponse
- type BetaModelListFilesResponseData
- type BetaModelListOrgScopedParams
- type BetaModelListParams
- type BetaModelListParamsVisibility
- type BetaModelListRevisionsParams
- type BetaModelListRevisionsResponse
- type BetaModelListRevisionsResponseData
- type BetaModelListRevisionsResponseDataValidationError
- type BetaModelListRevisionsResponseObject
- type BetaModelListSupportedParams
- type BetaModelListSupportedParamsModality
- type BetaModelListSupportedParamsProduct
- type BetaModelNewParams
- type BetaModelRemoteUploadEventsParams
- type BetaModelRemoteUploadEventsResponse
- type BetaModelRemoteUploadEventsResponseData
- type BetaModelRemoteUploadGetParams
- type BetaModelRemoteUploadGetResponse
- type BetaModelRemoteUploadGetResponseStatus
- type BetaModelRemoteUploadListParams
- type BetaModelRemoteUploadListResponse
- type BetaModelRemoteUploadListResponseStatus
- type BetaModelRemoteUploadNewParams
- type BetaModelRemoteUploadNewResponse
- type BetaModelRemoteUploadNewResponseStatus
- type BetaModelRemoteUploadService
- func (r *BetaModelRemoteUploadService) Events(ctx context.Context, id string, params BetaModelRemoteUploadEventsParams, ...) (res *BetaModelRemoteUploadEventsResponse, err error)
- func (r *BetaModelRemoteUploadService) Get(ctx context.Context, id string, query BetaModelRemoteUploadGetParams, ...) (res *BetaModelRemoteUploadGetResponse, err error)
- func (r *BetaModelRemoteUploadService) List(ctx context.Context, params BetaModelRemoteUploadListParams, ...) (res *pagination.CursorPagination[BetaModelRemoteUploadListResponse], err error)
- func (r *BetaModelRemoteUploadService) ListAutoPaging(ctx context.Context, params BetaModelRemoteUploadListParams, ...) *pagination.CursorPaginationAutoPager[BetaModelRemoteUploadListResponse]
- func (r *BetaModelRemoteUploadService) New(ctx context.Context, params BetaModelRemoteUploadNewParams, ...) (res *BetaModelRemoteUploadNewResponse, err error)
- type BetaModelService
- func (r *BetaModelService) Delete(ctx context.Context, id string, body BetaModelDeleteParams, ...) (res *BetaModelDeleteResponse, err error)
- func (r *BetaModelService) Get(ctx context.Context, id string, query BetaModelGetParams, ...) (res *Model, err error)
- func (r *BetaModelService) GetSupported(ctx context.Context, id string, opts ...option.RequestOption) (res *SupportedModel, err error)
- func (r *BetaModelService) List(ctx context.Context, params BetaModelListParams, opts ...option.RequestOption) (res *pagination.CursorPagination[Model], err error)
- func (r *BetaModelService) ListAutoPaging(ctx context.Context, params BetaModelListParams, opts ...option.RequestOption) *pagination.CursorPaginationAutoPager[Model]
- func (r *BetaModelService) ListFiles(ctx context.Context, id string, params BetaModelListFilesParams, ...) (res *BetaModelListFilesResponse, err error)
- func (r *BetaModelService) ListOrgScoped(ctx context.Context, organizationID string, query BetaModelListOrgScopedParams, ...) (res *pagination.CursorPagination[Model], err error)
- func (r *BetaModelService) ListOrgScopedAutoPaging(ctx context.Context, organizationID string, query BetaModelListOrgScopedParams, ...) *pagination.CursorPaginationAutoPager[Model]
- func (r *BetaModelService) ListRevisions(ctx context.Context, id string, query BetaModelListRevisionsParams, ...) (res *BetaModelListRevisionsResponse, err error)
- func (r *BetaModelService) ListSupported(ctx context.Context, query BetaModelListSupportedParams, ...) (res *pagination.CursorPagination[SupportedModel], err error)
- func (r *BetaModelService) ListSupportedAutoPaging(ctx context.Context, query BetaModelListSupportedParams, ...) *pagination.CursorPaginationAutoPager[SupportedModel]
- func (r *BetaModelService) New(ctx context.Context, params BetaModelNewParams, opts ...option.RequestOption) (res *Model, err error)
- func (r *BetaModelService) Update(ctx context.Context, id string, params BetaModelUpdateParams, ...) (res *Model, err error)
- type BetaModelUpdateParams
- type BetaModelUpdateParamsVisibility
- type BetaRlCheckpointDownloadParams
- type BetaRlCheckpointService
- type BetaRlModelResourceEstimateCostParams
- type BetaRlModelResourceEstimateCostParamsComputeConfig
- type BetaRlModelResourceListParams
- type BetaRlModelResourceNewParams
- type BetaRlModelResourceNewParamsComputeConfig
- type BetaRlModelResourceService
- func (r *BetaRlModelResourceService) EstimateCost(ctx context.Context, body BetaRlModelResourceEstimateCostParams, ...) (res *ModelResourcesEstimateCostResponse, err error)
- func (r *BetaRlModelResourceService) Get(ctx context.Context, modelResourcesID string, opts ...option.RequestOption) (res *ModelResources, err error)
- func (r *BetaRlModelResourceService) List(ctx context.Context, query BetaRlModelResourceListParams, ...) (res *ModelResourcesListResponse, err error)
- func (r *BetaRlModelResourceService) New(ctx context.Context, body BetaRlModelResourceNewParams, ...) (res *ModelResources, err error)
- func (r *BetaRlModelResourceService) Stop(ctx context.Context, modelResourcesID string, ...) (res *ModelResources, err error)
- type BetaRlModelResourceStopParams
- type BetaRlOperationCustomForwardBackwardParams
- type BetaRlOperationCustomForwardBackwardParamsGradient
- type BetaRlOperationCustomForwardBackwardParamsSample
- type BetaRlOperationForwardBackwardParams
- type BetaRlOperationForwardBackwardParamsSample
- type BetaRlOperationForwardParams
- type BetaRlOperationForwardParamsSample
- type BetaRlOperationGetCustomForwardBackwardParams
- type BetaRlOperationGetForwardBackwardParams
- type BetaRlOperationGetForwardParams
- type BetaRlOperationGetInferenceCheckpointParams
- type BetaRlOperationGetOptimStepParams
- type BetaRlOperationGetSampleParams
- type BetaRlOperationGetTrainingCheckpointParams
- type BetaRlOperationOptimStepParams
- type BetaRlOperationSampleParams
- type BetaRlOperationService
- func (r *BetaRlOperationService) CustomForwardBackward(ctx context.Context, sessionID string, ...) (res *CustomForwardBackwardOperation, err error)
- func (r *BetaRlOperationService) Forward(ctx context.Context, sessionID string, body BetaRlOperationForwardParams, ...) (res *ForwardOperation, err error)
- func (r *BetaRlOperationService) ForwardBackward(ctx context.Context, sessionID string, ...) (res *ForwardBackwardOperation, err error)
- func (r *BetaRlOperationService) GetCustomForwardBackward(ctx context.Context, operationID string, ...) (res *CustomForwardBackwardOperation, err error)
- func (r *BetaRlOperationService) GetForward(ctx context.Context, operationID string, query BetaRlOperationGetForwardParams, ...) (res *ForwardOperation, err error)
- func (r *BetaRlOperationService) GetForwardBackward(ctx context.Context, operationID string, ...) (res *ForwardBackwardOperation, err error)
- func (r *BetaRlOperationService) GetInferenceCheckpoint(ctx context.Context, operationID string, ...) (res *InferenceCheckpointOperation, err error)
- func (r *BetaRlOperationService) GetOptimStep(ctx context.Context, operationID string, ...) (res *OptimStepOperation, err error)
- func (r *BetaRlOperationService) GetSample(ctx context.Context, operationID string, query BetaRlOperationGetSampleParams, ...) (res *SampleOperation, err error)
- func (r *BetaRlOperationService) GetTrainingCheckpoint(ctx context.Context, operationID string, ...) (res *TrainingCheckpointOperation, err error)
- func (r *BetaRlOperationService) NewInferenceCheckpoint(ctx context.Context, sessionID string, opts ...option.RequestOption) (res *InferenceCheckpointOperation, err error)
- func (r *BetaRlOperationService) NewTrainingCheckpoint(ctx context.Context, sessionID string, opts ...option.RequestOption) (res *TrainingCheckpointOperation, err error)
- func (r *BetaRlOperationService) OptimStep(ctx context.Context, sessionID string, body BetaRlOperationOptimStepParams, ...) (res *OptimStepOperation, err error)
- func (r *BetaRlOperationService) Sample(ctx context.Context, sessionID string, body BetaRlOperationSampleParams, ...) (res *SampleOperation, err error)
- type BetaRlService
- type BetaRlSessionListParams
- type BetaRlSessionNewParams
- type BetaRlSessionService
- func (r *BetaRlSessionService) Get(ctx context.Context, sessionID string, opts ...option.RequestOption) (res *TrainingSession, err error)
- func (r *BetaRlSessionService) List(ctx context.Context, query BetaRlSessionListParams, ...) (res *TrainingSessionsListResponse, err error)
- func (r *BetaRlSessionService) New(ctx context.Context, body BetaRlSessionNewParams, opts ...option.RequestOption) (res *TrainingSession, err error)
- func (r *BetaRlSessionService) Stop(ctx context.Context, sessionID string, opts ...option.RequestOption) (res *TrainingSession, err error)
- type BetaRlSupportedModelService
- type BetaService
- type ChatCompletion
- type ChatCompletionChoice
- type ChatCompletionChoiceMessage
- type ChatCompletionChoiceMessageFunctionCalldeprecated
- type ChatCompletionChunk
- type ChatCompletionChunkChoice
- type ChatCompletionChunkChoiceDelta
- type ChatCompletionChunkChoiceDeltaFunctionCalldeprecated
- type ChatCompletionNewParams
- type ChatCompletionNewParamsCompliance
- type ChatCompletionNewParamsContextLengthExceededBehavior
- type ChatCompletionNewParamsFunctionCallName
- type ChatCompletionNewParamsFunctionCallString
- type ChatCompletionNewParamsFunctionCallUnion
- type ChatCompletionNewParamsMessageChatCompletionAssistantMessageParam
- type ChatCompletionNewParamsMessageChatCompletionAssistantMessageParamFunctionCalldeprecated
- type ChatCompletionNewParamsMessageChatCompletionFunctionMessageParamdeprecated
- type ChatCompletionNewParamsMessageChatCompletionSystemMessageParam
- type ChatCompletionNewParamsMessageChatCompletionToolMessageParam
- type ChatCompletionNewParamsMessageChatCompletionUserMessageParam
- type ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemAudio
- func (r ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemAudio) MarshalJSON() (data []byte, err error)
- func (r *ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemAudio) UnmarshalJSON(data []byte) error
- type ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemAudioAudioURL
- func (r ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemAudioAudioURL) MarshalJSON() (data []byte, err error)
- func (r *ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemAudioAudioURL) UnmarshalJSON(data []byte) error
- type ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemInputAudio
- func (r ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemInputAudio) MarshalJSON() (data []byte, err error)
- func (r *ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemInputAudio) UnmarshalJSON(data []byte) error
- type ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemInputAudioInputAudio
- func (r ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemInputAudioInputAudio) MarshalJSON() (data []byte, err error)
- func (r *ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemInputAudioInputAudio) UnmarshalJSON(data []byte) error
- type ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion
- func (u ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion) GetAudioURL() ...
- func (u ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion) GetImageURL() *ChatCompletionStructuredMessageImageURLImageURLParam
- func (u ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion) GetInputAudio() ...
- func (u ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion) GetText() *string
- func (u ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion) GetType() *string
- func (u ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion) GetVideoURL() *ChatCompletionStructuredMessageVideoURLVideoURLParam
- func (u ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion) MarshalJSON() ([]byte, error)
- func (u *ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion) UnmarshalJSON(data []byte) error
- type ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentUnion
- type ChatCompletionNewParamsMessageUnion
- func (u ChatCompletionNewParamsMessageUnion) GetContent() (res chatCompletionNewParamsMessageUnionContent)
- func (u ChatCompletionNewParamsMessageUnion) GetFunctionCall() *ChatCompletionNewParamsMessageChatCompletionAssistantMessageParamFunctionCall
- func (u ChatCompletionNewParamsMessageUnion) GetName() *string
- func (u ChatCompletionNewParamsMessageUnion) GetRole() *string
- func (u ChatCompletionNewParamsMessageUnion) GetToolCallID() *string
- func (u ChatCompletionNewParamsMessageUnion) GetToolCalls() []ToolChoiceParam
- func (u ChatCompletionNewParamsMessageUnion) MarshalJSON() ([]byte, error)
- func (u *ChatCompletionNewParamsMessageUnion) UnmarshalJSON(data []byte) error
- type ChatCompletionNewParamsReasoning
- type ChatCompletionNewParamsReasoningEffort
- type ChatCompletionNewParamsResponseFormatJsonObject
- type ChatCompletionNewParamsResponseFormatJsonSchema
- type ChatCompletionNewParamsResponseFormatJsonSchemaJsonSchema
- type ChatCompletionNewParamsResponseFormatText
- type ChatCompletionNewParamsResponseFormatUnion
- func (u ChatCompletionNewParamsResponseFormatUnion) GetJsonSchema() *ChatCompletionNewParamsResponseFormatJsonSchemaJsonSchema
- func (u ChatCompletionNewParamsResponseFormatUnion) GetType() *string
- func (u ChatCompletionNewParamsResponseFormatUnion) MarshalJSON() ([]byte, error)
- func (u *ChatCompletionNewParamsResponseFormatUnion) UnmarshalJSON(data []byte) error
- type ChatCompletionNewParamsToolChoiceUnion
- type ChatCompletionPrompt
- type ChatCompletionPromptItem
- type ChatCompletionService
- type ChatCompletionStructuredMessageImageURLImageURLParam
- type ChatCompletionStructuredMessageImageURLParam
- type ChatCompletionStructuredMessageImageURLType
- type ChatCompletionStructuredMessageTextParam
- type ChatCompletionStructuredMessageTextType
- type ChatCompletionStructuredMessageVideoURLParam
- type ChatCompletionStructuredMessageVideoURLType
- type ChatCompletionStructuredMessageVideoURLVideoURLParam
- type ChatCompletionUsage
- type ChatCompletionWarning
- type ChatService
- type CheckpointDownloadResponse
- type CheckpointFile
- type CheckpointFileSizeUnion
- type CheckpointVariant
- type CispoLossInputsParam
- type CispoLossParams
- type Client
- func (r *Client) Delete(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, ...) error
- func (r *Client) Get(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Patch(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Post(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Put(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Whoami(ctx context.Context, opts ...option.RequestOption) (res *WhoamiResponse, err error)
- type Cluster
- type ClusterAddOn
- type ClusterAddOnConfig
- type ClusterAddOnConfigDashboard
- type ClusterAddOnConfigHeadlamp
- type ClusterAddOnConfigIngress
- type ClusterAddOnConfigSlurmWeb
- type ClusterAddOnConfigTorchpass
- type ClusterAddOnState
- type ClusterAddOnStateDashboard
- type ClusterAddOnStateHeadlamp
- type ClusterAddOnStateIngress
- type ClusterAddOnStateSlurmWeb
- type ClusterAddOnStateTorchpass
- type ClusterBillingType
- type ClusterClusterConfig
- type ClusterClusterConfigIngress
- type ClusterClusterConfigObservability
- type ClusterClusterConfigSlurmStartupScripts
- type ClusterClusterType
- type ClusterControlPlaneNode
- type ClusterControlPlaneNodePhaseTransition
- type ClusterDeletedGPUWorkerNode
- type ClusterDeletedGPUWorkerNodePhaseTransition
- type ClusterGPUType
- type ClusterGPUWorkerNode
- type ClusterGPUWorkerNodePhaseTransition
- type ClusterNodeLifecycleEvent
- type ClusterOidcConfig
- type ClusterPhaseTransition
- type ClusterStatus
- type ClusterStorage
- type ClusterStorageStatus
- type ClusterVolume
- type CodeInterpreterExecuteParams
- type CodeInterpreterExecuteParamsFile
- type CodeInterpreterExecuteParamsLanguage
- type CodeInterpreterService
- type CodeInterpreterSessionService
- type Completion
- type CompletionChoice
- type CompletionChunk
- type CompletionChunkChoice
- type CompletionChunkChoiceDelta
- type CompletionChunkChoiceDeltaFunctionCalldeprecated
- type CompletionChunkFinishReason
- type CompletionChunkObject
- type CompletionChunkToken
- type CompletionNewParams
- type CompletionNewParamsModel
- type CompletionNewParamsSafetyModel
- type CompletionService
- type Config
- type ConfigCertification
- type ConfigSelector
- type ContainerDeploymentStatus
- type CrossEntropyLossParams
- type CustomForwardBackwardOperation
- type CustomForwardBackwardResult
- type DType
- type DedicatedEndpoint
- type DedicatedEndpointState
- type DedicatedEndpointType
- type Deployment
- type DeploymentAutoscaling
- type DeploymentAutoscalingCustomMetricAutoscalingConfig
- type DeploymentAutoscalingHTTPAutoscalingConfig
- type DeploymentAutoscalingParam
- type DeploymentAutoscalingQueueAutoscalingConfig
- type DeploymentAutoscalingScalingMetric
- type DeploymentAutoscalingScalingMetricParam
- type DeploymentAutoscalingUnion
- func (u DeploymentAutoscalingUnion) AsDeploymentAutoscalingCustomMetricAutoscalingConfig() (v DeploymentAutoscalingCustomMetricAutoscalingConfig)
- func (u DeploymentAutoscalingUnion) AsDeploymentAutoscalingHTTPAutoscalingConfig() (v DeploymentAutoscalingHTTPAutoscalingConfig)
- func (u DeploymentAutoscalingUnion) AsDeploymentAutoscalingQueueAutoscalingConfig() (v DeploymentAutoscalingQueueAutoscalingConfig)
- func (u DeploymentAutoscalingUnion) RawJSON() string
- func (r *DeploymentAutoscalingUnion) UnmarshalJSON(data []byte) error
- type DeploymentEnvironmentVariable
- type DeploymentGPUType
- type DeploymentLogs
- type DeploymentObject
- type DeploymentPlacementConfig
- type DeploymentPlacementConfigConstraint
- type DeploymentPlacementConfigParam
- type DeploymentReplicaEvent
- type DeploymentStatus
- type DeploymentStatusState
- type DeploymentVolume
- type DroLossInputsParam
- type DroLossParams
- type Embedding
- type EmbeddingData
- type EmbeddingNewParams
- type EmbeddingNewParamsInputUnion
- type EmbeddingNewParamsModel
- type EmbeddingService
- type Endpoint
- type EndpointAdapterAddParams
- type EndpointAdapterAddResponse
- type EndpointAdapterListResponse
- type EndpointAdapterListResponseData
- type EndpointAdapterRemoveParams
- type EndpointAdapterRemoveResponse
- type EndpointAdapterService
- func (r *EndpointAdapterService) Add(ctx context.Context, endpointID string, body EndpointAdapterAddParams, ...) (res *EndpointAdapterAddResponse, err error)
- func (r *EndpointAdapterService) List(ctx context.Context, endpointID string, opts ...option.RequestOption) (res *EndpointAdapterListResponse, err error)
- func (r *EndpointAdapterService) Remove(ctx context.Context, endpointID string, body EndpointAdapterRemoveParams, ...) (res *EndpointAdapterRemoveResponse, err error)
- type EndpointDeployment
- type EndpointDeploymentAutoscaling
- type EndpointDeploymentPlacementInline
- type EndpointDeploymentPlacementProfile
- type EndpointDeploymentPlacementUnion
- func (u EndpointDeploymentPlacementUnion) AsInline() (v EndpointDeploymentPlacementInline)
- func (u EndpointDeploymentPlacementUnion) AsProfile() (v EndpointDeploymentPlacementProfile)
- func (u EndpointDeploymentPlacementUnion) RawJSON() string
- func (r *EndpointDeploymentPlacementUnion) UnmarshalJSON(data []byte) error
- type EndpointDeploymentRuntimeInfo
- type EndpointDeploymentSummary
- type EndpointDeploymentSummaryAutoscaling
- type EndpointDeploymentSummaryState
- type EndpointDeploymentSummaryTrafficMode
- type EndpointDeploymentTrafficMode
- type EndpointEndpointType
- type EndpointListAvzonesResponse
- type EndpointListHardwareParams
- type EndpointListHardwareResponse
- type EndpointListHardwareResponseData
- type EndpointListHardwareResponseDataAvailability
- type EndpointListHardwareResponseDataPricing
- type EndpointListHardwareResponseDataSpecs
- type EndpointListParams
- type EndpointListParamsType
- type EndpointListParamsUsageType
- type EndpointListResponse
- type EndpointListResponseData
- type EndpointNewParams
- type EndpointNewParamsState
- type EndpointService
- func (r *EndpointService) Delete(ctx context.Context, endpointID string, opts ...option.RequestOption) (err error)
- func (r *EndpointService) Get(ctx context.Context, endpointID string, opts ...option.RequestOption) (res *DedicatedEndpoint, err error)
- func (r *EndpointService) List(ctx context.Context, query EndpointListParams, opts ...option.RequestOption) (res *EndpointListResponse, err error)
- func (r *EndpointService) ListAvzones(ctx context.Context, opts ...option.RequestOption) (res *EndpointListAvzonesResponse, err error)
- func (r *EndpointService) ListHardware(ctx context.Context, query EndpointListHardwareParams, ...) (res *EndpointListHardwareResponse, err error)
- func (r *EndpointService) New(ctx context.Context, body EndpointNewParams, opts ...option.RequestOption) (res *DedicatedEndpoint, err error)
- func (r *EndpointService) Update(ctx context.Context, endpointID string, body EndpointUpdateParams, ...) (res *DedicatedEndpoint, err error)
- type EndpointTrafficSplitEntry
- type EndpointTrafficSplitEntryParam
- type EndpointUpdateParams
- type EndpointUpdateParamsState
- type EndpointVisibility
- type Error
- type EvalListParams
- type EvalNewParams
- type EvalNewParamsParametersEvaluationClassifyParameters
- type EvalNewParamsParametersEvaluationClassifyParametersJudge
- type EvalNewParamsParametersEvaluationClassifyParametersModelToEvaluateEvaluationModelRequest
- type EvalNewParamsParametersEvaluationClassifyParametersModelToEvaluateUnion
- type EvalNewParamsParametersEvaluationCompareParameters
- type EvalNewParamsParametersEvaluationCompareParametersJudge
- type EvalNewParamsParametersEvaluationCompareParametersModelAEvaluationModelRequest
- type EvalNewParamsParametersEvaluationCompareParametersModelAUnion
- type EvalNewParamsParametersEvaluationCompareParametersModelBEvaluationModelRequest
- type EvalNewParamsParametersEvaluationCompareParametersModelBUnion
- type EvalNewParamsParametersEvaluationScoreParameters
- type EvalNewParamsParametersEvaluationScoreParametersJudge
- type EvalNewParamsParametersEvaluationScoreParametersModelToEvaluateEvaluationModelRequest
- type EvalNewParamsParametersEvaluationScoreParametersModelToEvaluateUnion
- type EvalNewParamsParametersUnion
- func (u EvalNewParamsParametersUnion) GetDisablePositionBiasCorrection() *bool
- func (u EvalNewParamsParametersUnion) GetInputDataFilePath() *string
- func (u EvalNewParamsParametersUnion) GetJudge() (res evalNewParamsParametersUnionJudge)
- func (u EvalNewParamsParametersUnion) GetLabels() []string
- func (u EvalNewParamsParametersUnion) GetMaxScore() *float64
- func (u EvalNewParamsParametersUnion) GetMinScore() *float64
- func (u EvalNewParamsParametersUnion) GetModelA() *EvalNewParamsParametersEvaluationCompareParametersModelAUnion
- func (u EvalNewParamsParametersUnion) GetModelB() *EvalNewParamsParametersEvaluationCompareParametersModelBUnion
- func (u EvalNewParamsParametersUnion) GetModelToEvaluate() (res evalNewParamsParametersUnionModelToEvaluate)
- func (u EvalNewParamsParametersUnion) GetPassLabels() []string
- func (u EvalNewParamsParametersUnion) GetPassThreshold() *float64
- func (u EvalNewParamsParametersUnion) MarshalJSON() ([]byte, error)
- func (u *EvalNewParamsParametersUnion) UnmarshalJSON(data []byte) error
- type EvalNewParamsType
- type EvalNewResponse
- type EvalNewResponseStatus
- type EvalService
- func (r *EvalService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *EvaluationJob, err error)
- func (r *EvalService) List(ctx context.Context, query EvalListParams, opts ...option.RequestOption) (res *[]EvaluationJob, err error)
- func (r *EvalService) New(ctx context.Context, body EvalNewParams, opts ...option.RequestOption) (res *EvalNewResponse, err error)
- func (r *EvalService) Status(ctx context.Context, id string, opts ...option.RequestOption) (res *EvalStatusResponse, err error)
- type EvalStatusResponse
- type EvalStatusResponseResultsEvaluationClassifyResults
- type EvalStatusResponseResultsEvaluationCompareResults
- type EvalStatusResponseResultsEvaluationScoreResults
- type EvalStatusResponseResultsEvaluationScoreResultsAggregatedScores
- type EvalStatusResponseResultsUnion
- func (u EvalStatusResponseResultsUnion) AsEvalStatusResponseResultsEvaluationClassifyResults() (v EvalStatusResponseResultsEvaluationClassifyResults)
- func (u EvalStatusResponseResultsUnion) AsEvalStatusResponseResultsEvaluationCompareResults() (v EvalStatusResponseResultsEvaluationCompareResults)
- func (u EvalStatusResponseResultsUnion) AsEvalStatusResponseResultsEvaluationScoreResults() (v EvalStatusResponseResultsEvaluationScoreResults)
- func (u EvalStatusResponseResultsUnion) RawJSON() string
- func (r *EvalStatusResponseResultsUnion) UnmarshalJSON(data []byte) error
- type EvalStatusResponseStatus
- type EvaluationJob
- type EvaluationJobResultsError
- type EvaluationJobResultsEvaluationClassifyResults
- type EvaluationJobResultsEvaluationCompareResults
- type EvaluationJobResultsEvaluationScoreResults
- type EvaluationJobResultsEvaluationScoreResultsAggregatedScores
- type EvaluationJobResultsUnion
- func (u EvaluationJobResultsUnion) AsEvaluationJobResultsError() (v EvaluationJobResultsError)
- func (u EvaluationJobResultsUnion) AsEvaluationJobResultsEvaluationClassifyResults() (v EvaluationJobResultsEvaluationClassifyResults)
- func (u EvaluationJobResultsUnion) AsEvaluationJobResultsEvaluationCompareResults() (v EvaluationJobResultsEvaluationCompareResults)
- func (u EvaluationJobResultsUnion) AsEvaluationJobResultsEvaluationScoreResults() (v EvaluationJobResultsEvaluationScoreResults)
- func (u EvaluationJobResultsUnion) RawJSON() string
- func (r *EvaluationJobResultsUnion) UnmarshalJSON(data []byte) error
- type EvaluationJobStatus
- type EvaluationJobStatusUpdate
- type EvaluationJobType
- type ExecuteResponseFailedExecution
- type ExecuteResponseFailedExecutionErrorUnion
- func (u ExecuteResponseFailedExecutionErrorUnion) AsAnyMap() (v map[string]any)
- func (u ExecuteResponseFailedExecutionErrorUnion) AsString() (v string)
- func (u ExecuteResponseFailedExecutionErrorUnion) RawJSON() string
- func (r *ExecuteResponseFailedExecutionErrorUnion) UnmarshalJSON(data []byte) error
- type ExecuteResponseSuccessfulExecution
- type ExecuteResponseSuccessfulExecutionData
- type ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput
- type ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData
- type ExecuteResponseSuccessfulExecutionDataOutputError
- type ExecuteResponseSuccessfulExecutionDataOutputStreamOutput
- type ExecuteResponseSuccessfulExecutionDataOutputUnion
- func (u ExecuteResponseSuccessfulExecutionDataOutputUnion) AsDisplayorExecuteOutput() (v ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput)
- func (u ExecuteResponseSuccessfulExecutionDataOutputUnion) AsError() (v ExecuteResponseSuccessfulExecutionDataOutputError)
- func (u ExecuteResponseSuccessfulExecutionDataOutputUnion) AsStreamOutput() (v ExecuteResponseSuccessfulExecutionDataOutputStreamOutput)
- func (u ExecuteResponseSuccessfulExecutionDataOutputUnion) RawJSON() string
- func (r *ExecuteResponseSuccessfulExecutionDataOutputUnion) UnmarshalJSON(data []byte) error
- type ExecuteResponseSuccessfulExecutionDataOutputUnionData
- type ExecuteResponseUnion
- type ExecuteResponseUnionData
- type ExecuteResponseUnionErrors
- type FileDeleteResponse
- type FileList
- type FilePurpose
- type FileResponse
- type FileResponseProcessingStatus
- type FileResponseValidationReport
- type FileService
- func (r *FileService) Content(ctx context.Context, id string, opts ...option.RequestOption) (res *http.Response, err error)
- func (r *FileService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (res *FileDeleteResponse, err error)
- func (r *FileService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *FileResponse, err error)
- func (r *FileService) List(ctx context.Context, opts ...option.RequestOption) (res *FileList, err error)
- func (r *FileService) Upload(ctx context.Context, body FileUploadParams, opts ...option.RequestOption) (res *FileResponse, err error)
- type FileType
- type FileUploadParams
- type FineTunePreviewResponse
- type FineTunePreviewResponseDatasetFormat
- type FineTunePreviewRow
- type FineTuningCancelResponse
- type FineTuningCancelResponseLrScheduler
- type FineTuningCancelResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs
- type FineTuningCancelResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs
- type FineTuningCancelResponseLrSchedulerLrSchedulerArgsUnion
- func (u FineTuningCancelResponseLrSchedulerLrSchedulerArgsUnion) AsFineTuningCancelResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs() (v FineTuningCancelResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs)
- func (u FineTuningCancelResponseLrSchedulerLrSchedulerArgsUnion) AsFineTuningCancelResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs() (v FineTuningCancelResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs)
- func (u FineTuningCancelResponseLrSchedulerLrSchedulerArgsUnion) RawJSON() string
- func (r *FineTuningCancelResponseLrSchedulerLrSchedulerArgsUnion) UnmarshalJSON(data []byte) error
- type FineTuningCancelResponseProgress
- type FineTuningCancelResponseStatus
- type FineTuningCancelResponseTrainingMethodTrainingMethodDpo
- type FineTuningCancelResponseTrainingMethodTrainingMethodSft
- type FineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsString
- type FineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion
- func (u FineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsBool() (v bool)
- func (u FineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsFineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsString() (v string)
- func (u FineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) RawJSON() string
- func (r *FineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) UnmarshalJSON(data []byte) error
- type FineTuningCancelResponseTrainingMethodUnion
- func (u FineTuningCancelResponseTrainingMethodUnion) AsFineTuningCancelResponseTrainingMethodTrainingMethodDpo() (v FineTuningCancelResponseTrainingMethodTrainingMethodDpo)
- func (u FineTuningCancelResponseTrainingMethodUnion) AsFineTuningCancelResponseTrainingMethodTrainingMethodSft() (v FineTuningCancelResponseTrainingMethodTrainingMethodSft)
- func (u FineTuningCancelResponseTrainingMethodUnion) RawJSON() string
- func (r *FineTuningCancelResponseTrainingMethodUnion) UnmarshalJSON(data []byte) error
- type FineTuningCancelResponseTrainingTypeFullTrainingType
- type FineTuningCancelResponseTrainingTypeLoRaTrainingType
- type FineTuningCancelResponseTrainingTypeUnion
- func (u FineTuningCancelResponseTrainingTypeUnion) AsFineTuningCancelResponseTrainingTypeFullTrainingType() (v FineTuningCancelResponseTrainingTypeFullTrainingType)
- func (u FineTuningCancelResponseTrainingTypeUnion) AsFineTuningCancelResponseTrainingTypeLoRaTrainingType() (v FineTuningCancelResponseTrainingTypeLoRaTrainingType)
- func (u FineTuningCancelResponseTrainingTypeUnion) RawJSON() string
- func (r *FineTuningCancelResponseTrainingTypeUnion) UnmarshalJSON(data []byte) error
- type FineTuningContentParams
- type FineTuningContentParamsCheckpoint
- type FineTuningDeleteParams
- type FineTuningDeleteResponse
- type FineTuningEstimatePriceParams
- type FineTuningEstimatePriceParamsTrainingMethodTrainingMethodDpo
- type FineTuningEstimatePriceParamsTrainingMethodTrainingMethodSft
- type FineTuningEstimatePriceParamsTrainingMethodTrainingMethodSftTrainOnInputsString
- type FineTuningEstimatePriceParamsTrainingMethodTrainingMethodSftTrainOnInputsUnion
- type FineTuningEstimatePriceParamsTrainingMethodUnion
- func (u FineTuningEstimatePriceParamsTrainingMethodUnion) GetDpoBeta() *float64
- func (u FineTuningEstimatePriceParamsTrainingMethodUnion) GetDpoNormalizeLogratiosByLength() *bool
- func (u FineTuningEstimatePriceParamsTrainingMethodUnion) GetDpoReferenceFree() *bool
- func (u FineTuningEstimatePriceParamsTrainingMethodUnion) GetMethod() *string
- func (u FineTuningEstimatePriceParamsTrainingMethodUnion) GetRpoAlpha() *float64
- func (u FineTuningEstimatePriceParamsTrainingMethodUnion) GetSimpoGamma() *float64
- func (u FineTuningEstimatePriceParamsTrainingMethodUnion) GetTrainOnInputs() ...
- func (u FineTuningEstimatePriceParamsTrainingMethodUnion) MarshalJSON() ([]byte, error)
- func (u *FineTuningEstimatePriceParamsTrainingMethodUnion) UnmarshalJSON(data []byte) error
- type FineTuningEstimatePriceParamsTrainingTypeFullTrainingType
- type FineTuningEstimatePriceParamsTrainingTypeLoRaTrainingType
- type FineTuningEstimatePriceParamsTrainingTypeUnion
- func (u FineTuningEstimatePriceParamsTrainingTypeUnion) GetLoraAlpha() *int64
- func (u FineTuningEstimatePriceParamsTrainingTypeUnion) GetLoraDropout() *float64
- func (u FineTuningEstimatePriceParamsTrainingTypeUnion) GetLoraR() *int64
- func (u FineTuningEstimatePriceParamsTrainingTypeUnion) GetLoraTrainableModules() *string
- func (u FineTuningEstimatePriceParamsTrainingTypeUnion) GetType() *string
- func (u FineTuningEstimatePriceParamsTrainingTypeUnion) MarshalJSON() ([]byte, error)
- func (u *FineTuningEstimatePriceParamsTrainingTypeUnion) UnmarshalJSON(data []byte) error
- type FineTuningEstimatePriceResponseAvailableEstimate
- type FineTuningEstimatePriceResponseUnavailableEstimate
- type FineTuningEstimatePriceResponseUnion
- func (u FineTuningEstimatePriceResponseUnion) AsAvailableEstimate() (v FineTuningEstimatePriceResponseAvailableEstimate)
- func (u FineTuningEstimatePriceResponseUnion) AsUnavailableEstimate() (v FineTuningEstimatePriceResponseUnavailableEstimate)
- func (u FineTuningEstimatePriceResponseUnion) RawJSON() string
- func (r *FineTuningEstimatePriceResponseUnion) UnmarshalJSON(data []byte) error
- type FineTuningListCheckpointsResponse
- type FineTuningListCheckpointsResponseData
- type FineTuningListEventsResponse
- type FineTuningListMetricsParams
- type FineTuningListMetricsResponse
- type FineTuningListResponse
- type FineTuningListResponseData
- type FineTuningListResponseDataLrScheduler
- type FineTuningListResponseDataLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs
- type FineTuningListResponseDataLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs
- type FineTuningListResponseDataLrSchedulerLrSchedulerArgsUnion
- func (u FineTuningListResponseDataLrSchedulerLrSchedulerArgsUnion) AsFineTuningListResponseDataLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs() (v FineTuningListResponseDataLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs)
- func (u FineTuningListResponseDataLrSchedulerLrSchedulerArgsUnion) AsFineTuningListResponseDataLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs() (v FineTuningListResponseDataLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs)
- func (u FineTuningListResponseDataLrSchedulerLrSchedulerArgsUnion) RawJSON() string
- func (r *FineTuningListResponseDataLrSchedulerLrSchedulerArgsUnion) UnmarshalJSON(data []byte) error
- type FineTuningListResponseDataProgress
- type FineTuningListResponseDataTrainingMethodTrainingMethodDpo
- type FineTuningListResponseDataTrainingMethodTrainingMethodSft
- type FineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsString
- type FineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsUnion
- func (u FineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsBool() (v bool)
- func (u FineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsFineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsString() (v string)
- func (u FineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsUnion) RawJSON() string
- func (r *FineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsUnion) UnmarshalJSON(data []byte) error
- type FineTuningListResponseDataTrainingMethodUnion
- func (u FineTuningListResponseDataTrainingMethodUnion) AsFineTuningListResponseDataTrainingMethodTrainingMethodDpo() (v FineTuningListResponseDataTrainingMethodTrainingMethodDpo)
- func (u FineTuningListResponseDataTrainingMethodUnion) AsFineTuningListResponseDataTrainingMethodTrainingMethodSft() (v FineTuningListResponseDataTrainingMethodTrainingMethodSft)
- func (u FineTuningListResponseDataTrainingMethodUnion) RawJSON() string
- func (r *FineTuningListResponseDataTrainingMethodUnion) UnmarshalJSON(data []byte) error
- type FineTuningListResponseDataTrainingTypeFullTrainingType
- type FineTuningListResponseDataTrainingTypeLoRaTrainingType
- type FineTuningListResponseDataTrainingTypeUnion
- func (u FineTuningListResponseDataTrainingTypeUnion) AsFineTuningListResponseDataTrainingTypeFullTrainingType() (v FineTuningListResponseDataTrainingTypeFullTrainingType)
- func (u FineTuningListResponseDataTrainingTypeUnion) AsFineTuningListResponseDataTrainingTypeLoRaTrainingType() (v FineTuningListResponseDataTrainingTypeLoRaTrainingType)
- func (u FineTuningListResponseDataTrainingTypeUnion) RawJSON() string
- func (r *FineTuningListResponseDataTrainingTypeUnion) UnmarshalJSON(data []byte) error
- type FineTuningModelLimitsParams
- type FineTuningNewParams
- type FineTuningNewParamsBatchSizeString
- type FineTuningNewParamsBatchSizeUnion
- type FineTuningNewParamsLrScheduler
- type FineTuningNewParamsLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs
- type FineTuningNewParamsLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs
- type FineTuningNewParamsLrSchedulerLrSchedulerArgsUnion
- func (u FineTuningNewParamsLrSchedulerLrSchedulerArgsUnion) GetMinLrRatio() *float64
- func (u FineTuningNewParamsLrSchedulerLrSchedulerArgsUnion) GetNumCycles() *float64
- func (u FineTuningNewParamsLrSchedulerLrSchedulerArgsUnion) MarshalJSON() ([]byte, error)
- func (u *FineTuningNewParamsLrSchedulerLrSchedulerArgsUnion) UnmarshalJSON(data []byte) error
- type FineTuningNewParamsMultimodalParams
- type FineTuningNewParamsTrainOnInputsString
- type FineTuningNewParamsTrainOnInputsUnion
- type FineTuningNewParamsTrainingMethodTrainingMethodDpo
- type FineTuningNewParamsTrainingMethodTrainingMethodSft
- type FineTuningNewParamsTrainingMethodTrainingMethodSftTrainOnInputsString
- type FineTuningNewParamsTrainingMethodTrainingMethodSftTrainOnInputsUnion
- type FineTuningNewParamsTrainingMethodUnion
- func (u FineTuningNewParamsTrainingMethodUnion) GetDpoBeta() *float64
- func (u FineTuningNewParamsTrainingMethodUnion) GetDpoNormalizeLogratiosByLength() *bool
- func (u FineTuningNewParamsTrainingMethodUnion) GetDpoReferenceFree() *bool
- func (u FineTuningNewParamsTrainingMethodUnion) GetMethod() *string
- func (u FineTuningNewParamsTrainingMethodUnion) GetRpoAlpha() *float64
- func (u FineTuningNewParamsTrainingMethodUnion) GetSimpoGamma() *float64
- func (u FineTuningNewParamsTrainingMethodUnion) GetTrainOnInputs() *FineTuningNewParamsTrainingMethodTrainingMethodSftTrainOnInputsUnion
- func (u FineTuningNewParamsTrainingMethodUnion) MarshalJSON() ([]byte, error)
- func (u *FineTuningNewParamsTrainingMethodUnion) UnmarshalJSON(data []byte) error
- type FineTuningNewParamsTrainingTypeFullTrainingType
- type FineTuningNewParamsTrainingTypeLoRaTrainingType
- type FineTuningNewParamsTrainingTypeUnion
- func (u FineTuningNewParamsTrainingTypeUnion) GetLoraAlpha() *int64
- func (u FineTuningNewParamsTrainingTypeUnion) GetLoraDropout() *float64
- func (u FineTuningNewParamsTrainingTypeUnion) GetLoraR() *int64
- func (u FineTuningNewParamsTrainingTypeUnion) GetLoraTrainableModules() *string
- func (u FineTuningNewParamsTrainingTypeUnion) GetType() *string
- func (u FineTuningNewParamsTrainingTypeUnion) MarshalJSON() ([]byte, error)
- func (u *FineTuningNewParamsTrainingTypeUnion) UnmarshalJSON(data []byte) error
- type FineTuningNewResponse
- type FineTuningNewResponseLrScheduler
- type FineTuningNewResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs
- type FineTuningNewResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs
- type FineTuningNewResponseLrSchedulerLrSchedulerArgsUnion
- func (u FineTuningNewResponseLrSchedulerLrSchedulerArgsUnion) AsFineTuningNewResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs() (v FineTuningNewResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs)
- func (u FineTuningNewResponseLrSchedulerLrSchedulerArgsUnion) AsFineTuningNewResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs() (v FineTuningNewResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs)
- func (u FineTuningNewResponseLrSchedulerLrSchedulerArgsUnion) RawJSON() string
- func (r *FineTuningNewResponseLrSchedulerLrSchedulerArgsUnion) UnmarshalJSON(data []byte) error
- type FineTuningNewResponseProgress
- type FineTuningNewResponseStatus
- type FineTuningNewResponseTrainingMethodTrainingMethodDpo
- type FineTuningNewResponseTrainingMethodTrainingMethodSft
- type FineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsString
- type FineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion
- func (u FineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsBool() (v bool)
- func (u FineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsFineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsString() (v string)
- func (u FineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) RawJSON() string
- func (r *FineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) UnmarshalJSON(data []byte) error
- type FineTuningNewResponseTrainingMethodUnion
- func (u FineTuningNewResponseTrainingMethodUnion) AsFineTuningNewResponseTrainingMethodTrainingMethodDpo() (v FineTuningNewResponseTrainingMethodTrainingMethodDpo)
- func (u FineTuningNewResponseTrainingMethodUnion) AsFineTuningNewResponseTrainingMethodTrainingMethodSft() (v FineTuningNewResponseTrainingMethodTrainingMethodSft)
- func (u FineTuningNewResponseTrainingMethodUnion) RawJSON() string
- func (r *FineTuningNewResponseTrainingMethodUnion) UnmarshalJSON(data []byte) error
- type FineTuningNewResponseTrainingTypeFullTrainingType
- type FineTuningNewResponseTrainingTypeLoRaTrainingType
- type FineTuningNewResponseTrainingTypeUnion
- func (u FineTuningNewResponseTrainingTypeUnion) AsFineTuningNewResponseTrainingTypeFullTrainingType() (v FineTuningNewResponseTrainingTypeFullTrainingType)
- func (u FineTuningNewResponseTrainingTypeUnion) AsFineTuningNewResponseTrainingTypeLoRaTrainingType() (v FineTuningNewResponseTrainingTypeLoRaTrainingType)
- func (u FineTuningNewResponseTrainingTypeUnion) RawJSON() string
- func (r *FineTuningNewResponseTrainingTypeUnion) UnmarshalJSON(data []byte) error
- type FineTuningPreviewParams
- type FineTuningPreviewParamsTrainingMethod
- type FineTuningService
- func (r *FineTuningService) Cancel(ctx context.Context, id string, opts ...option.RequestOption) (res *FineTuningCancelResponse, err error)
- func (r *FineTuningService) Content(ctx context.Context, query FineTuningContentParams, ...) (res *http.Response, err error)
- func (r *FineTuningService) Delete(ctx context.Context, id string, body FineTuningDeleteParams, ...) (res *FineTuningDeleteResponse, err error)
- func (r *FineTuningService) EstimatePrice(ctx context.Context, body FineTuningEstimatePriceParams, ...) (res *FineTuningEstimatePriceResponseUnion, err error)
- func (r *FineTuningService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *FinetuneResponse, err error)
- func (r *FineTuningService) List(ctx context.Context, opts ...option.RequestOption) (res *FineTuningListResponse, err error)
- func (r *FineTuningService) ListCheckpoints(ctx context.Context, id string, opts ...option.RequestOption) (res *FineTuningListCheckpointsResponse, err error)
- func (r *FineTuningService) ListEvents(ctx context.Context, id string, opts ...option.RequestOption) (res *FineTuningListEventsResponse, err error)
- func (r *FineTuningService) ListMetrics(ctx context.Context, id string, query FineTuningListMetricsParams, ...) (res *FineTuningListMetricsResponse, err error)
- func (r *FineTuningService) ModelLimits(ctx context.Context, query FineTuningModelLimitsParams, ...) (res *FinetuneModelLimits, err error)
- func (r *FineTuningService) New(ctx context.Context, body FineTuningNewParams, opts ...option.RequestOption) (res *FineTuningNewResponse, err error)
- func (r *FineTuningService) Preview(ctx context.Context, body FineTuningPreviewParams, ...) (res *FineTunePreviewResponse, err error)
- type FinetuneEvent
- type FinetuneEventLevel
- type FinetuneEventType
- type FinetuneModelLimits
- type FinetuneModelLimitsFullTraining
- type FinetuneModelLimitsLoraTraining
- type FinetuneResponse
- type FinetuneResponseBatchSizeString
- type FinetuneResponseBatchSizeUnion
- type FinetuneResponseLrScheduler
- type FinetuneResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs
- type FinetuneResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs
- type FinetuneResponseLrSchedulerLrSchedulerArgsUnion
- func (u FinetuneResponseLrSchedulerLrSchedulerArgsUnion) AsFinetuneResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs() (v FinetuneResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs)
- func (u FinetuneResponseLrSchedulerLrSchedulerArgsUnion) AsFinetuneResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs() (v FinetuneResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs)
- func (u FinetuneResponseLrSchedulerLrSchedulerArgsUnion) RawJSON() string
- func (r *FinetuneResponseLrSchedulerLrSchedulerArgsUnion) UnmarshalJSON(data []byte) error
- type FinetuneResponseMultimodalParams
- type FinetuneResponseProgress
- type FinetuneResponseStatus
- type FinetuneResponseTrainOnInputsString
- type FinetuneResponseTrainOnInputsUnion
- type FinetuneResponseTrainingMethodTrainingMethodDpo
- type FinetuneResponseTrainingMethodTrainingMethodSft
- type FinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsString
- type FinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion
- func (u FinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsBool() (v bool)
- func (u FinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsFinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsString() (v string)
- func (u FinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) RawJSON() string
- func (r *FinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) UnmarshalJSON(data []byte) error
- type FinetuneResponseTrainingMethodUnion
- func (u FinetuneResponseTrainingMethodUnion) AsFinetuneResponseTrainingMethodTrainingMethodDpo() (v FinetuneResponseTrainingMethodTrainingMethodDpo)
- func (u FinetuneResponseTrainingMethodUnion) AsFinetuneResponseTrainingMethodTrainingMethodSft() (v FinetuneResponseTrainingMethodTrainingMethodSft)
- func (u FinetuneResponseTrainingMethodUnion) RawJSON() string
- func (r *FinetuneResponseTrainingMethodUnion) UnmarshalJSON(data []byte) error
- type FinetuneResponseTrainingTypeFullTrainingType
- type FinetuneResponseTrainingTypeLoRaTrainingType
- type FinetuneResponseTrainingTypeUnion
- func (u FinetuneResponseTrainingTypeUnion) AsFinetuneResponseTrainingTypeFullTrainingType() (v FinetuneResponseTrainingTypeFullTrainingType)
- func (u FinetuneResponseTrainingTypeUnion) AsFinetuneResponseTrainingTypeLoRaTrainingType() (v FinetuneResponseTrainingTypeLoRaTrainingType)
- func (u FinetuneResponseTrainingTypeUnion) RawJSON() string
- func (r *FinetuneResponseTrainingTypeUnion) UnmarshalJSON(data []byte) error
- type ForwardBackwardOperation
- type ForwardBackwardResult
- type ForwardOperation
- type ForwardResult
- type ForwardResultLogprob
- type GrpoLossAggregationType
- type GrpoLossInputsParam
- type GrpoLossParams
- type GrpoLossRatioType
- type ImageDataB64
- type ImageDataB64Type
- type ImageDataURL
- type ImageDataURLType
- type ImageFile
- type ImageFileDataUnion
- type ImageGenerateParams
- type ImageGenerateParamsImageLora
- type ImageGenerateParamsModel
- type ImageGenerateParamsOutputFormat
- type ImageGenerateParamsResponseFormat
- type ImageService
- type ImportanceSamplingLossInputsParam
- type InferenceCheckpoint
- type InferenceCheckpointOperation
- type InferenceCheckpointRegistration
- type InferenceCheckpointResult
- type InferenceCheckpointStepUnion
- type InferenceInstanceType
- type InferenceInstanceTypeRegion
- type InferenceInstanceTypeRegionHeadroom
- type LogProbs
- type LoraConfig
- type LoraConfigParam
- type LossAdvantagesParam
- type LossConfigParam
- type LossInputsParam
- type LossLogprobsParam
- type LossMaskDataUnionParam
- type LossMaskParam
- type LossTargetTokensDataUnionParam
- type LossTargetTokensParam
- type LossType
- type Model
- type ModelInputChunkEncodedTextParam
- type ModelInputChunkEncodedTextTokenUnionParam
- type ModelInputChunkParam
- type ModelInputParam
- type ModelListParams
- type ModelObject
- type ModelObjectPricing
- type ModelObjectType
- type ModelResources
- type ModelResourcesComputeConfig
- type ModelResourcesError
- type ModelResourcesErrorCode
- type ModelResourcesEstimateCostResponse
- type ModelResourcesListResponse
- type ModelResourcesListResponseMeta
- type ModelResourcesStatus
- type ModelService
- type ModelUploadParams
- type ModelUploadParamsModelType
- type ModelUploadResponse
- type ModelUploadResponseData
- type ModelUploadService
- type ModelUploadStatusResponse
- type ModelUploadStatusResponseArgs
- type ModelUploadStatusResponseStatus
- type ModelUploadStatusResponseStatusUpdate
- type ModelVisibility
- type ModelWeights
- type ModelWeightsParameters
- type ModelWeightsParametersByDtype
- type MuonOptimizerConfig
- type MuonOptimizerConfigParam
- type MuonOptimizerParams
- type MuonScalingStrategy
- type OptimStepOperation
- type OptimStepResult
- type OptimStepResultStepUnion
- type OptimizerConfig
- type OptimizerConfigParam
- type PlacementProfile
- type PolicyVersionSegment
- type PolicyVersionSegmentParam
- type PpoLossInputsParam
- type PpoLossParams
- type Remediation
- type RemediationLinkedAlert
- type RemediationLinkedAlertParam
- type RemediationMode
- type RemediationParam
- type RemediationState
- type RemediationTrigger
- type RerankNewParams
- type RerankNewParamsDocumentsUnion
- type RerankNewParamsModel
- type RerankNewResponse
- type RerankNewResponseResult
- type RerankNewResponseResultDocument
- type RerankService
- type RlSupportedModel
- type RlSupportedModelGeneratorConfig
- type RlSupportedModelGeneratorConfigSamplingDefaults
- type RlSupportedModelTrainerConfig
- type RlSupportedModelTrainerConfigFull
- type RlSupportedModelTrainerConfigLora
- type RlSupportedModels
- type SampleOperation
- type SampleOperationOutput
- type SampleResult
- type SampledSequence
- type SampledSequenceTokenUnion
- type SamplingParams
- type SamplingParamsSeedUnion
- type Secret
- type SecretObject
- type SessionListResponse
- type SessionListResponseData
- type SessionListResponseDataSession
- type SessionListResponseErrorUnion
- type ShadowAdaptiveKeyBasedSamplingParam
- type ShadowAdaptiveUniformSamplingParam
- type ShadowEndpointSourceParam
- type ShadowEndpointSourceSamplingAdaptiveKeyBasedParam
- type ShadowEndpointSourceSamplingAdaptiveUniformParam
- type ShadowEndpointSourceSamplingKeyBasedParam
- type ShadowEndpointSourceSamplingUniformParam
- type ShadowEndpointSourceSamplingUnionParam
- type ShadowExperiment
- type ShadowExperimentSource
- type ShadowExperimentSourceEndpoint
- type ShadowExperimentSourceEndpointSamplingAdaptiveKeyBased
- type ShadowExperimentSourceEndpointSamplingAdaptiveKeyBasedAdaptiveKeyBased
- type ShadowExperimentSourceEndpointSamplingAdaptiveUniform
- type ShadowExperimentSourceEndpointSamplingAdaptiveUniformAdaptiveUniform
- type ShadowExperimentSourceEndpointSamplingKeyBased
- type ShadowExperimentSourceEndpointSamplingKeyBasedKeyBased
- type ShadowExperimentSourceEndpointSamplingUniform
- type ShadowExperimentSourceEndpointSamplingUniformUniform
- type ShadowExperimentSourceEndpointSamplingUnion
- func (u ShadowExperimentSourceEndpointSamplingUnion) AsAdaptiveKeyBased() (v ShadowExperimentSourceEndpointSamplingAdaptiveKeyBased)
- func (u ShadowExperimentSourceEndpointSamplingUnion) AsAdaptiveUniform() (v ShadowExperimentSourceEndpointSamplingAdaptiveUniform)
- func (u ShadowExperimentSourceEndpointSamplingUnion) AsKeyBased() (v ShadowExperimentSourceEndpointSamplingKeyBased)
- func (u ShadowExperimentSourceEndpointSamplingUnion) AsUniform() (v ShadowExperimentSourceEndpointSamplingUniform)
- func (u ShadowExperimentSourceEndpointSamplingUnion) RawJSON() string
- func (r *ShadowExperimentSourceEndpointSamplingUnion) UnmarshalJSON(data []byte) error
- type ShadowExperimentState
- type ShadowExperimentTarget
- type ShadowKeyBasedSamplingParam
- type ShadowSourceParam
- type ShadowUniformSamplingParam
- type StopReason
- type SupportedModel
- type SupportedModelDeploymentProfile
- type SupportedModelPerformanceBenchmarks
- type SupportedModelStatus
- type ToolChoice
- type ToolChoiceFunction
- type ToolChoiceFunctionParam
- type ToolChoiceParam
- type ToolChoiceType
- type ToolsFunctionParam
- type ToolsParam
- type TrainingCheckpoint
- type TrainingCheckpointOperation
- type TrainingCheckpointResult
- type TrainingCheckpointStepUnion
- type TrainingOperationError
- type TrainingOperationErrorCode
- type TrainingOperationStatus
- type TrainingSession
- type TrainingSessionError
- type TrainingSessionErrorCode
- type TrainingSessionStatus
- type TrainingSessionStepUnion
- type TrainingSessionsListResponse
- type TrainingSessionsListResponseMeta
- type VideoJob
- type VideoJobError
- type VideoJobObject
- type VideoJobOutputs
- type VideoJobStatus
- type VideoNewParams
- type VideoNewParamsFrameImage
- type VideoNewParamsFrameImageFrameString
- type VideoNewParamsFrameImageFrameUnion
- type VideoNewParamsMedia
- type VideoNewParamsMediaAudioInputAudioRef
- type VideoNewParamsMediaAudioInputUnion
- type VideoNewParamsMediaFrameImage
- type VideoNewParamsMediaFrameImageFrameString
- type VideoNewParamsMediaFrameImageFrameUnion
- type VideoNewParamsMediaFrameVideo
- type VideoNewParamsMediaReferenceVideo
- type VideoNewParamsMediaSourceVideoUnion
- type VideoNewParamsMediaSourceVideoVideoRef
- type VideoNewParamsOutputFormat
- type VideoService
- type Volume
- type VolumeContent
- type VolumeContentFile
- type VolumeType
- type VolumeVersionHistory
- type VolumeVersionHistoryContent
- type WeightSyncType
- type WhoamiResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultClientOptions ¶
func DefaultClientOptions() []option.RequestOption
DefaultClientOptions read from the environment (TOGETHER_API_KEY, TOGETHER_PROJECT_ID, TOGETHER_BASE_URL). This should be used to initialize new clients.
func Opt ¶
func Opt[T comparable](v T) param.Opt[T]
Types ¶
type AbExperiment ¶ added in v0.11.0
type AbExperiment struct {
// Output only. Unique A/B experiment identifier.
ID string `json:"id" api:"required"`
// Output only. Timestamp when the A/B experiment was created.
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
// Output only. Identifier of the principal that created the A/B experiment.
CreatedBy string `json:"createdBy" api:"required"`
// Output only. Endpoint this A/B experiment belongs to.
EndpointID string `json:"endpointId" api:"required"`
// Optional opaque version tag for optimistic concurrency control.
Etag string `json:"etag" api:"required"`
// Two to 20 participating deployments with exactly one control and percentages
// that add up to 100.
Members []AbMember `json:"members" api:"required"`
// Human-readable A/B experiment name, unique within the endpoint.
Name string `json:"name" api:"required"`
// Output only. Project that owns the parent endpoint.
ProjectID string `json:"projectId" api:"required"`
// Output only. Timestamp when the A/B experiment was last updated.
UpdatedAt time.Time `json:"updatedAt" api:"required" format:"date-time"`
// Optional free-form description.
Description string `json:"description"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
CreatedBy respjson.Field
EndpointID respjson.Field
Etag respjson.Field
Members respjson.Field
Name respjson.Field
ProjectID respjson.Field
UpdatedAt respjson.Field
Description respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Managed cohort split that subdivides a control deployment's live traffic among the control and one or more variants.
func (AbExperiment) RawJSON ¶ added in v0.11.0
func (r AbExperiment) RawJSON() string
Returns the unmodified JSON received from the API
func (*AbExperiment) UnmarshalJSON ¶ added in v0.11.0
func (r *AbExperiment) UnmarshalJSON(data []byte) error
type AbMember ¶ added in v0.11.0
type AbMember struct {
// Deployment under the parent endpoint.
DeploymentID string `json:"deploymentId" api:"required"`
// Integer traffic percent in [1, 100]. Percentages across all members must sum
// to 100.
Percent int64 `json:"percent" api:"required"`
// Role of this deployment within the A/B experiment.
//
// Any of "AB_EXPERIMENT_MEMBER_ROLE_CONTROL", "AB_EXPERIMENT_MEMBER_ROLE_VARIANT".
Role AbMemberRole `json:"role" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
DeploymentID respjson.Field
Percent respjson.Field
Role respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Deployment participating in an A/B experiment.
func (AbMember) ToParam ¶ added in v0.11.0
func (r AbMember) ToParam() AbMemberParam
ToParam converts this AbMember to a AbMemberParam.
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 AbMemberParam.Overrides()
func (*AbMember) UnmarshalJSON ¶ added in v0.11.0
type AbMemberParam ¶ added in v0.11.0
type AbMemberParam struct {
// Deployment under the parent endpoint.
DeploymentID string `json:"deploymentId" api:"required"`
// Integer traffic percent in [1, 100]. Percentages across all members must sum
// to 100.
Percent int64 `json:"percent" api:"required"`
// Role of this deployment within the A/B experiment.
//
// Any of "AB_EXPERIMENT_MEMBER_ROLE_CONTROL", "AB_EXPERIMENT_MEMBER_ROLE_VARIANT".
Role AbMemberRole `json:"role,omitzero" api:"required"`
// contains filtered or unexported fields
}
Deployment participating in an A/B experiment.
The properties DeploymentID, Percent, Role are required.
func (AbMemberParam) MarshalJSON ¶ added in v0.11.0
func (r AbMemberParam) MarshalJSON() (data []byte, err error)
func (*AbMemberParam) UnmarshalJSON ¶ added in v0.11.0
func (r *AbMemberParam) UnmarshalJSON(data []byte) error
type AbMemberRole ¶ added in v0.11.0
type AbMemberRole string
Role of this deployment within the A/B experiment.
const ( AbMemberRoleAbExperimentMemberRoleControl AbMemberRole = "AB_EXPERIMENT_MEMBER_ROLE_CONTROL" AbMemberRoleAbExperimentMemberRoleVariant AbMemberRole = "AB_EXPERIMENT_MEMBER_ROLE_VARIANT" )
type AdamwOptimizerConfig ¶ added in v0.12.0
type AdamwOptimizerConfig = any
type AdamwOptimizerParams ¶ added in v0.12.0
type AdamwOptimizerParams struct {
// Exponential decay rate for the first-moment estimate
Beta1 param.Opt[float64] `json:"beta1,omitzero"`
// Exponential decay rate for the second-moment estimate
Beta2 param.Opt[float64] `json:"beta2,omitzero"`
// Epsilon for numerical stability
Eps param.Opt[float64] `json:"eps,omitzero"`
// Learning rate for the AdamW-tuned parameters
LearningRate param.Opt[float64] `json:"learning_rate,omitzero"`
// Weight decay coefficient
WeightDecay param.Opt[float64] `json:"weight_decay,omitzero"`
// contains filtered or unexported fields
}
Per-step AdamW optimizer overrides.
func (AdamwOptimizerParams) MarshalJSON ¶ added in v0.12.0
func (r AdamwOptimizerParams) MarshalJSON() (data []byte, err error)
func (*AdamwOptimizerParams) UnmarshalJSON ¶ added in v0.12.0
func (r *AdamwOptimizerParams) UnmarshalJSON(data []byte) error
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 ¶
func (r *AudioSpeechService) New(ctx context.Context, body AudioSpeechNewParams, opts ...option.RequestOption) (res *http.Response, err error)
Generate audio from input text
func (*AudioSpeechService) NewStreaming ¶
func (r *AudioSpeechService) NewStreaming(ctx context.Context, body AudioSpeechNewParams, opts ...option.RequestOption) (stream *ssestream.Stream[AudioSpeechStreamChunk])
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. Maximum duration 4 hours; longer audio is
// rejected with `audio_too_long`. Binary uploads are additionally capped at 500 MB
// (HTTP 413); URL-fetched audio is capped at 1 GB.
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 (u AudioTranscriptionNewParamsTimestampGranularitiesUnion) MarshalJSON() ([]byte, error)
func (*AudioTranscriptionNewParamsTimestampGranularitiesUnion) UnmarshalJSON ¶
func (u *AudioTranscriptionNewParamsTimestampGranularitiesUnion) UnmarshalJSON(data []byte) error
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 ¶
func (r AudioTranscriptionNewResponseAudioTranscriptionJsonResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*AudioTranscriptionNewResponseAudioTranscriptionJsonResponse) UnmarshalJSON ¶
func (r *AudioTranscriptionNewResponseAudioTranscriptionJsonResponse) UnmarshalJSON(data []byte) error
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 ¶
func (r AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponse) UnmarshalJSON ¶
func (r *AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponse) UnmarshalJSON(data []byte) error
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 ¶
func (r AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSegment) RawJSON() string
Returns the unmodified JSON received from the API
func (*AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSegment) UnmarshalJSON ¶
func (r *AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSegment) UnmarshalJSON(data []byte) error
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 ¶
func (r AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSpeakerSegment) RawJSON() string
Returns the unmodified JSON received from the API
func (*AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSpeakerSegment) UnmarshalJSON ¶
func (r *AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSpeakerSegment) UnmarshalJSON(data []byte) error
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 ¶
func (r AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSpeakerSegmentWord) RawJSON() string
Returns the unmodified JSON received from the API
func (*AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSpeakerSegmentWord) UnmarshalJSON ¶
func (r *AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSpeakerSegmentWord) UnmarshalJSON(data []byte) error
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 ¶
func (r AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseWord) RawJSON() string
Returns the unmodified JSON received from the API
func (*AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseWord) UnmarshalJSON ¶
func (r *AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseWord) UnmarshalJSON(data []byte) error
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 ¶
func (u AudioTranscriptionNewResponseUnion) RawJSON() string
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 ¶
func (r *AudioTranscriptionService) New(ctx context.Context, body AudioTranscriptionNewParams, opts ...option.RequestOption) (res *AudioTranscriptionNewResponseUnion, err error)
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. Maximum duration 4 hours; longer audio is
// rejected with `audio_too_long`. Binary uploads are additionally capped at 500 MB
// (HTTP 413); URL-fetched audio is capped at 1 GB.
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 (u AudioTranslationNewParamsTimestampGranularitiesUnion) MarshalJSON() ([]byte, error)
func (*AudioTranslationNewParamsTimestampGranularitiesUnion) UnmarshalJSON ¶
func (u *AudioTranslationNewParamsTimestampGranularitiesUnion) UnmarshalJSON(data []byte) error
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 ¶
func (r AudioTranslationNewResponseAudioTranslationJsonResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*AudioTranslationNewResponseAudioTranslationJsonResponse) UnmarshalJSON ¶
func (r *AudioTranslationNewResponseAudioTranslationJsonResponse) UnmarshalJSON(data []byte) error
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 ¶
func (r AudioTranslationNewResponseAudioTranslationVerboseJsonResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*AudioTranslationNewResponseAudioTranslationVerboseJsonResponse) UnmarshalJSON ¶
func (r *AudioTranslationNewResponseAudioTranslationVerboseJsonResponse) UnmarshalJSON(data []byte) error
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 ¶
func (r AudioTranslationNewResponseAudioTranslationVerboseJsonResponseSegment) RawJSON() string
Returns the unmodified JSON received from the API
func (*AudioTranslationNewResponseAudioTranslationVerboseJsonResponseSegment) UnmarshalJSON ¶
func (r *AudioTranslationNewResponseAudioTranslationVerboseJsonResponseSegment) UnmarshalJSON(data []byte) error
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 ¶
func (r AudioTranslationNewResponseAudioTranslationVerboseJsonResponseWord) RawJSON() string
Returns the unmodified JSON received from the API
func (*AudioTranslationNewResponseAudioTranslationVerboseJsonResponseWord) UnmarshalJSON ¶
func (r *AudioTranslationNewResponseAudioTranslationVerboseJsonResponseWord) UnmarshalJSON(data []byte) error
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 ¶
func (u AudioTranslationNewResponseUnion) RawJSON() string
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 ¶
func (r *AudioTranslationService) New(ctx context.Context, body AudioTranslationNewParams, opts ...option.RequestOption) (res *AudioTranslationNewResponseUnion, err error)
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 ¶
func (r AudioVoiceListResponseDataVoice) RawJSON() string
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 ¶
func (r *AudioVoiceService) List(ctx context.Context, opts ...option.RequestOption) (res *AudioVoiceListResponse, err error)
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) UnmarshalJSON ¶
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.
//
// Use [option.WithProjectID] on the client to set a global default for this field.
ProjectID param.Opt[string] `query:"projectId,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
func (r BetaClusterListRegionsResponse) RawJSON() string
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
func (r BetaClusterListRegionsResponseRegion) RawJSON() string
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
func (r BetaClusterListRegionsResponseRegionDriverVersion) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaClusterListRegionsResponseRegionDriverVersion) UnmarshalJSON ¶ added in v0.10.0
func (r *BetaClusterListRegionsResponseRegionDriverVersion) UnmarshalJSON(data []byte) error
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 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"`
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"`
// Skip storage-performance acceptance test.
StorageSkipped param.Opt[bool] `json:"storage_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', 'torchpass'.
AddOnType string `json:"add_on_type" api:"required"`
// Human-readable name for this add-on instance.
Name string `json:"name" api:"required"`
// Configuration for a cluster add-on.
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"`
// Configuration for the Headlamp Kubernetes dashboard add-on.
Headlamp BetaClusterNewParamsAddOnConfigHeadlamp `json:"headlamp,omitzero"`
Ingress BetaClusterNewParamsAddOnConfigIngress `json:"ingress,omitzero"`
// Configuration for the Slurm Web add-on.
SlurmWeb BetaClusterNewParamsAddOnConfigSlurmWeb `json:"slurm_web,omitzero"`
// Configuration for the Model Aware TorchPass add-on.
Torchpass BetaClusterNewParamsAddOnConfigTorchpass `json:"torchpass,omitzero"`
// contains filtered or unexported fields
}
Configuration for a cluster add-on.
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 BetaClusterNewParamsAddOnConfigHeadlamp ¶ added in v0.12.0
type BetaClusterNewParamsAddOnConfigHeadlamp struct {
// Whether to enable the Headlamp Kubernetes dashboard add-on.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// contains filtered or unexported fields
}
Configuration for the Headlamp Kubernetes dashboard add-on.
func (BetaClusterNewParamsAddOnConfigHeadlamp) MarshalJSON ¶ added in v0.12.0
func (r BetaClusterNewParamsAddOnConfigHeadlamp) MarshalJSON() (data []byte, err error)
func (*BetaClusterNewParamsAddOnConfigHeadlamp) UnmarshalJSON ¶ added in v0.12.0
func (r *BetaClusterNewParamsAddOnConfigHeadlamp) 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 BetaClusterNewParamsAddOnConfigSlurmWeb ¶ added in v0.12.0
type BetaClusterNewParamsAddOnConfigSlurmWeb struct {
// Whether to enable the Slurm Web add-on.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// contains filtered or unexported fields
}
Configuration for the Slurm Web add-on.
func (BetaClusterNewParamsAddOnConfigSlurmWeb) MarshalJSON ¶ added in v0.12.0
func (r BetaClusterNewParamsAddOnConfigSlurmWeb) MarshalJSON() (data []byte, err error)
func (*BetaClusterNewParamsAddOnConfigSlurmWeb) UnmarshalJSON ¶ added in v0.12.0
func (r *BetaClusterNewParamsAddOnConfigSlurmWeb) UnmarshalJSON(data []byte) error
type BetaClusterNewParamsAddOnConfigTorchpass ¶ added in v0.11.0
type BetaClusterNewParamsAddOnConfigTorchpass struct {
// Whether to enable the Model Aware TorchPass add-on.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// contains filtered or unexported fields
}
Configuration for the Model Aware TorchPass add-on.
func (BetaClusterNewParamsAddOnConfigTorchpass) MarshalJSON ¶ added in v0.11.0
func (r BetaClusterNewParamsAddOnConfigTorchpass) MarshalJSON() (data []byte, err error)
func (*BetaClusterNewParamsAddOnConfigTorchpass) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaClusterNewParamsAddOnConfigTorchpass) 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"`
// NVIDIA Network Operator chart/version for the tenant cluster (e.g. v24.7.0).
// When omitted, a service default is applied.
NetworkOperatorVersion param.Opt[string] `json:"network_operator_version,omitzero"`
// Whether this cluster uses a per-cluster SSH certificate authority for
// OIDC-signed SSH access.
SSHCaEnabled param.Opt[bool] `json:"ssh_ca_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
func (r *BetaClusterNewParamsClusterConfigObservability) UnmarshalJSON(data []byte) error
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
func (r *BetaClusterNewParamsClusterConfigSlurmStartupScripts) UnmarshalJSON(data []byte) error
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 string `json:"region" api:"required"`
SizeTib int64 `json:"size_tib" api:"required"`
VolumeName string `json:"volume_name" api:"required"`
IsLifecycleIndependent param.Opt[bool] `json:"is_lifecycle_independent,omitzero"`
// is used.
ProjectID param.Opt[string] `json:"project_id,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:"-"`
// Approval comment explaining the decision.
Comment param.Opt[string] `json:"comment,omitzero"`
// Remediation mode to use after approval. When omitted, the remediation keeps its
// existing mode.
//
// - `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.
// - `REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT`: Evicts the VM without
// provisioning a replacement.
// - `REMEDIATION_MODE_REBOOT_VM`: Reboots the VM in place.
// - `REMEDIATION_MODE_HOST_POWER_CYCLE`: Power-cycles the bare-metal host after
// cordoning it. This mode cannot be set as an approval override; create a host
// power-cycle remediation directly.
//
// Any of "REMEDIATION_MODE_VM_ONLY", "REMEDIATION_MODE_HOST_AWARE",
// "REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT", "REMEDIATION_MODE_REBOOT_VM",
// "REMEDIATION_MODE_HOST_POWER_CYCLE".
Mode BetaClusterRemediationApproveParamsMode `json:"mode,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 BetaClusterRemediationApproveParamsMode ¶ added in v0.11.0
type BetaClusterRemediationApproveParamsMode string
Remediation mode to use after approval. When omitted, the remediation keeps its existing mode.
- `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.
- `REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT`: Evicts the VM without provisioning a replacement.
- `REMEDIATION_MODE_REBOOT_VM`: Reboots the VM in place.
- `REMEDIATION_MODE_HOST_POWER_CYCLE`: Power-cycles the bare-metal host after cordoning it. This mode cannot be set as an approval override; create a host power-cycle remediation directly.
const ( BetaClusterRemediationApproveParamsModeRemediationModeVmOnly BetaClusterRemediationApproveParamsMode = "REMEDIATION_MODE_VM_ONLY" BetaClusterRemediationApproveParamsModeRemediationModeHostAware BetaClusterRemediationApproveParamsMode = "REMEDIATION_MODE_HOST_AWARE" BetaClusterRemediationApproveParamsModeRemediationModeEvictWithoutReplacement BetaClusterRemediationApproveParamsMode = "REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT" BetaClusterRemediationApproveParamsModeRemediationModeRebootVm BetaClusterRemediationApproveParamsMode = "REMEDIATION_MODE_REBOOT_VM" BetaClusterRemediationApproveParamsModeRemediationModeHostPowerCycle BetaClusterRemediationApproveParamsMode = "REMEDIATION_MODE_HOST_POWER_CYCLE" )
type BetaClusterRemediationCancelParams ¶ added in v0.10.0
type BetaClusterRemediationGetParams ¶ added in v0.10.0
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",
// "REMEDIATION_MODE_HOST_POWER_CYCLE".
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.
// - `QUARANTINING`: Cordoning or preparing the host before remediation.
// - `QUARANTINED`: Host has been cordoned or isolated for remediation.
//
// Any of "PENDING_APPROVAL", "PENDING", "RUNNING", "SUCCEEDED", "FAILED",
// "CANCELLED", "AUTO_RESOLVED", "QUARANTINING", "QUARANTINED".
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
func (r BetaClusterRemediationListResponse) RawJSON() string
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
func (r *BetaClusterRemediationService) Approve(ctx context.Context, remediationID string, params BetaClusterRemediationApproveParams, opts ...option.RequestOption) (res *Remediation, err error)
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
func (r *BetaClusterRemediationService) Cancel(ctx context.Context, remediationID string, body BetaClusterRemediationCancelParams, opts ...option.RequestOption) (res *Remediation, err error)
Cancels a pending remediation.
Only remediations in PENDING_APPROVAL or PENDING state can be cancelled.
func (*BetaClusterRemediationService) Get ¶ added in v0.10.0
func (r *BetaClusterRemediationService) Get(ctx context.Context, remediationID string, query BetaClusterRemediationGetParams, opts ...option.RequestOption) (res *Remediation, err error)
Retrieve the status of a specific remdiation on a specific instance in a specific cluster.
func (*BetaClusterRemediationService) List ¶ added in v0.10.0
func (r *BetaClusterRemediationService) List(ctx context.Context, instanceID string, params BetaClusterRemediationListParams, opts ...option.RequestOption) (res *BetaClusterRemediationListResponse, err error)
Lists remediations for an instance or cluster.
func (*BetaClusterRemediationService) New ¶ added in v0.10.0
func (r *BetaClusterRemediationService) New(ctx context.Context, instanceID string, params BetaClusterRemediationNewParams, opts ...option.RequestOption) (res *Remediation, err error)
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
func (r *BetaClusterRemediationService) Reject(ctx context.Context, remediationID string, params BetaClusterRemediationRejectParams, opts ...option.RequestOption) (res *Remediation, err error)
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
func (r *BetaClusterService) List(ctx context.Context, query BetaClusterListParams, opts ...option.RequestOption) (res *BetaClusterListResponse, err error)
List all GPU clusters.
func (*BetaClusterService) ListRegions ¶ added in v0.4.0
func (r *BetaClusterService) ListRegions(ctx context.Context, opts ...option.RequestOption) (res *BetaClusterListRegionsResponse, err error)
List regions and corresponding supported driver versions
func (*BetaClusterService) New ¶ added in v0.4.0
func (r *BetaClusterService) New(ctx context.Context, body BetaClusterNewParams, opts ...option.RequestOption) (res *Cluster, err error)
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
func (r BetaClusterStorageDeleteResponse) RawJSON() string
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.
//
// Use [option.WithProjectID] on the client to set a global default for this field.
ProjectID param.Opt[string] `query:"projectId,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
func (r BetaClusterStorageListResponse) RawJSON() string
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"`
// Project ID that will own the volume. When omitted, the caller's default project
// is used.
ProjectID param.Opt[string] `json:"project_id,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
func (r *BetaClusterStorageService) Delete(ctx context.Context, volumeID string, opts ...option.RequestOption) (res *BetaClusterStorageDeleteResponse, err error)
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
func (r *BetaClusterStorageService) List(ctx context.Context, query BetaClusterStorageListParams, opts ...option.RequestOption) (res *BetaClusterStorageListResponse, err error)
List all shared volumes.
func (*BetaClusterStorageService) New ¶ added in v0.4.0
func (r *BetaClusterStorageService) New(ctx context.Context, body BetaClusterStorageNewParams, opts ...option.RequestOption) (res *ClusterStorage, err error)
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
func (r *BetaClusterStorageService) Update(ctx context.Context, body BetaClusterStorageUpdateParams, opts ...option.RequestOption) (res *ClusterStorage, err error)
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 {
// Number of GPUs to draw from the cluster's capacity pool. Only valid for clusters
// created with a capacity_pool_id. Must be a multiple of 8 and not exceed
// num_gpus. When omitted, the current value is preserved.
NumCapacityPoolGPUs param.Opt[int64] `json:"num_capacity_pool_gpus,omitzero"`
// 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"`
// Configuration for a cluster add-on.
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"`
// Configuration for the Headlamp Kubernetes dashboard add-on.
Headlamp BetaClusterUpdateParamsAddOnConfigHeadlamp `json:"headlamp,omitzero"`
Ingress BetaClusterUpdateParamsAddOnConfigIngress `json:"ingress,omitzero"`
// Configuration for the Slurm Web add-on.
SlurmWeb BetaClusterUpdateParamsAddOnConfigSlurmWeb `json:"slurm_web,omitzero"`
// Configuration for the Model Aware TorchPass add-on.
Torchpass BetaClusterUpdateParamsAddOnConfigTorchpass `json:"torchpass,omitzero"`
// contains filtered or unexported fields
}
Configuration for a cluster add-on.
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 BetaClusterUpdateParamsAddOnConfigHeadlamp ¶ added in v0.12.0
type BetaClusterUpdateParamsAddOnConfigHeadlamp struct {
// Whether to enable the Headlamp Kubernetes dashboard add-on.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// contains filtered or unexported fields
}
Configuration for the Headlamp Kubernetes dashboard add-on.
func (BetaClusterUpdateParamsAddOnConfigHeadlamp) MarshalJSON ¶ added in v0.12.0
func (r BetaClusterUpdateParamsAddOnConfigHeadlamp) MarshalJSON() (data []byte, err error)
func (*BetaClusterUpdateParamsAddOnConfigHeadlamp) UnmarshalJSON ¶ added in v0.12.0
func (r *BetaClusterUpdateParamsAddOnConfigHeadlamp) 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 BetaClusterUpdateParamsAddOnConfigSlurmWeb ¶ added in v0.12.0
type BetaClusterUpdateParamsAddOnConfigSlurmWeb struct {
// Whether to enable the Slurm Web add-on.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// contains filtered or unexported fields
}
Configuration for the Slurm Web add-on.
func (BetaClusterUpdateParamsAddOnConfigSlurmWeb) MarshalJSON ¶ added in v0.12.0
func (r BetaClusterUpdateParamsAddOnConfigSlurmWeb) MarshalJSON() (data []byte, err error)
func (*BetaClusterUpdateParamsAddOnConfigSlurmWeb) UnmarshalJSON ¶ added in v0.12.0
func (r *BetaClusterUpdateParamsAddOnConfigSlurmWeb) UnmarshalJSON(data []byte) error
type BetaClusterUpdateParamsAddOnConfigTorchpass ¶ added in v0.11.0
type BetaClusterUpdateParamsAddOnConfigTorchpass struct {
// Whether to enable the Model Aware TorchPass add-on.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// contains filtered or unexported fields
}
Configuration for the Model Aware TorchPass add-on.
func (BetaClusterUpdateParamsAddOnConfigTorchpass) MarshalJSON ¶ added in v0.11.0
func (r BetaClusterUpdateParamsAddOnConfigTorchpass) MarshalJSON() (data []byte, err error)
func (*BetaClusterUpdateParamsAddOnConfigTorchpass) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaClusterUpdateParamsAddOnConfigTorchpass) 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"`
// NVIDIA Network Operator chart/version for the tenant cluster (e.g. v24.7.0).
// When omitted, a service default is applied.
NetworkOperatorVersion param.Opt[string] `json:"network_operator_version,omitzero"`
// Whether this cluster uses a per-cluster SSH certificate authority for
// OIDC-signed SSH access.
SSHCaEnabled param.Opt[bool] `json:"ssh_ca_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
func (r *BetaClusterUpdateParamsClusterConfigObservability) UnmarshalJSON(data []byte) error
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 (r BetaClusterUpdateParamsClusterConfigSlurmStartupScripts) MarshalJSON() (data []byte, err error)
func (*BetaClusterUpdateParamsClusterConfigSlurmStartupScripts) UnmarshalJSON ¶ added in v0.10.0
func (r *BetaClusterUpdateParamsClusterConfigSlurmStartupScripts) UnmarshalJSON(data []byte) error
type BetaClusterUpdateParamsClusterType ¶ added in v0.4.0
type BetaClusterUpdateParamsClusterType string
Type of cluster to update.
const ( BetaClusterUpdateParamsClusterTypeKubernetes BetaClusterUpdateParamsClusterType = "KUBERNETES" BetaClusterUpdateParamsClusterTypeSlurm BetaClusterUpdateParamsClusterType = "SLURM" )
type BetaEndpointAbExperimentDeleteParams ¶ added in v0.11.0
type BetaEndpointAbExperimentDeleteParams struct {
// Project identifier.
//
// Use [option.WithProjectID] on the client to set a global default for this field.
ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
// Endpoint identifier.
EndpointID string `path:"endpointId" api:"required" json:"-"`
// Etag for optimistic concurrency. If set, the delete is rejected if the current
// etag does not match.
Etag param.Opt[string] `query:"etag,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (BetaEndpointAbExperimentDeleteParams) URLQuery ¶ added in v0.11.0
func (r BetaEndpointAbExperimentDeleteParams) URLQuery() (v url.Values, err error)
URLQuery serializes BetaEndpointAbExperimentDeleteParams's query parameters as `url.Values`.
type BetaEndpointAbExperimentDeleteResponse ¶ added in v0.11.0
type BetaEndpointAbExperimentDeleteResponse 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:"-"`
}
Empty response returned after a successful delete operation.
func (BetaEndpointAbExperimentDeleteResponse) RawJSON ¶ added in v0.11.0
func (r BetaEndpointAbExperimentDeleteResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointAbExperimentDeleteResponse) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAbExperimentDeleteResponse) UnmarshalJSON(data []byte) error
type BetaEndpointAbExperimentGetParams ¶ added in v0.11.0
type BetaEndpointAbExperimentGetParams struct {
// Project identifier.
//
// Use [option.WithProjectID] on the client to set a global default for this field.
ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
// Endpoint identifier.
EndpointID string `path:"endpointId" api:"required" json:"-"`
// contains filtered or unexported fields
}
type BetaEndpointAbExperimentListParams ¶ added in v0.11.0
type BetaEndpointAbExperimentListParams struct {
// Project identifier.
//
// Use [option.WithProjectID] on the client to set a global default for this field.
ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
// Cursor from a previous A/B experiment list response.
After param.Opt[string] `query:"after,omitzero" json:"-"`
// Maximum number of A/B experiments to return. Max 500, defaults to 50.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (BetaEndpointAbExperimentListParams) URLQuery ¶ added in v0.11.0
func (r BetaEndpointAbExperimentListParams) URLQuery() (v url.Values, err error)
URLQuery serializes BetaEndpointAbExperimentListParams's query parameters as `url.Values`.
type BetaEndpointAbExperimentNewParams ¶ added in v0.11.0
type BetaEndpointAbExperimentNewParams struct {
// Project identifier.
//
// Use [option.WithProjectID] on the client to set a global default for this field.
ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
// Two to 20 participating deployments with exactly one control. Integer traffic
// percentages across all members must add up to 100.
Members []AbMemberParam `json:"members,omitzero" api:"required"`
// Human-readable A/B experiment name, unique within the endpoint.
Name string `json:"name" api:"required"`
// Optional free-form description.
Description param.Opt[string] `json:"description,omitzero"`
// contains filtered or unexported fields
}
func (BetaEndpointAbExperimentNewParams) MarshalJSON ¶ added in v0.11.0
func (r BetaEndpointAbExperimentNewParams) MarshalJSON() (data []byte, err error)
func (*BetaEndpointAbExperimentNewParams) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAbExperimentNewParams) UnmarshalJSON(data []byte) error
type BetaEndpointAbExperimentService ¶ added in v0.11.0
type BetaEndpointAbExperimentService struct {
Options []option.RequestOption
}
BetaEndpointAbExperimentService 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 NewBetaEndpointAbExperimentService method instead.
func NewBetaEndpointAbExperimentService ¶ added in v0.11.0
func NewBetaEndpointAbExperimentService(opts ...option.RequestOption) (r BetaEndpointAbExperimentService)
NewBetaEndpointAbExperimentService 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 (*BetaEndpointAbExperimentService) Delete ¶ added in v0.11.0
func (r *BetaEndpointAbExperimentService) Delete(ctx context.Context, id string, params BetaEndpointAbExperimentDeleteParams, opts ...option.RequestOption) (res *BetaEndpointAbExperimentDeleteResponse, err error)
Deletes an A/B experiment and removes its managed traffic split. The deployments themselves are not deleted.
func (*BetaEndpointAbExperimentService) Get ¶ added in v0.11.0
func (r *BetaEndpointAbExperimentService) Get(ctx context.Context, id string, query BetaEndpointAbExperimentGetParams, opts ...option.RequestOption) (res *AbExperiment, err error)
Retrieves an A/B experiment and its participating deployments, roles, and traffic percentages.
func (*BetaEndpointAbExperimentService) List ¶ added in v0.11.0
func (r *BetaEndpointAbExperimentService) List(ctx context.Context, endpointID string, params BetaEndpointAbExperimentListParams, opts ...option.RequestOption) (res *pagination.CursorPagination[AbExperiment], err error)
Lists the managed live-traffic experiments configured for an endpoint.
func (*BetaEndpointAbExperimentService) ListAutoPaging ¶ added in v0.11.0
func (r *BetaEndpointAbExperimentService) ListAutoPaging(ctx context.Context, endpointID string, params BetaEndpointAbExperimentListParams, opts ...option.RequestOption) *pagination.CursorPaginationAutoPager[AbExperiment]
Lists the managed live-traffic experiments configured for an endpoint.
func (*BetaEndpointAbExperimentService) New ¶ added in v0.11.0
func (r *BetaEndpointAbExperimentService) New(ctx context.Context, endpointID string, params BetaEndpointAbExperimentNewParams, opts ...option.RequestOption) (res *AbExperiment, err error)
Creates a managed control/variant split across two to 20 deployments under the same endpoint. Exactly one member is the control, member percentages must add up to 100, and the split applies only to traffic that the endpoint would otherwise send to the control.
func (*BetaEndpointAbExperimentService) Update ¶ added in v0.11.0
func (r *BetaEndpointAbExperimentService) Update(ctx context.Context, id string, params BetaEndpointAbExperimentUpdateParams, opts ...option.RequestOption) (res *AbExperiment, err error)
Updates an experiment's description or member traffic percentages. Use the experiment etag for optimistic concurrency.
type BetaEndpointAbExperimentUpdateParams ¶ added in v0.11.0
type BetaEndpointAbExperimentUpdateParams struct {
// Project identifier.
//
// Use [option.WithProjectID] on the client to set a global default for this field.
ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
// Endpoint identifier.
EndpointID string `path:"endpointId" api:"required" json:"-"`
// Fields to update. If omitted, all mutable fields are overwritten.
UpdateMask param.Opt[string] `query:"updateMask,omitzero" json:"-"`
// Updated free-form description.
Description param.Opt[string] `json:"description,omitzero"`
// Opaque version tag from a prior read for optimistic concurrency.
Etag param.Opt[string] `json:"etag,omitzero"`
// Complete replacement member set. Requires two to 20 deployments, exactly one
// control, and percentages that add up to 100.
Members []AbMemberParam `json:"members,omitzero"`
// contains filtered or unexported fields
}
func (BetaEndpointAbExperimentUpdateParams) MarshalJSON ¶ added in v0.11.0
func (r BetaEndpointAbExperimentUpdateParams) MarshalJSON() (data []byte, err error)
func (BetaEndpointAbExperimentUpdateParams) URLQuery ¶ added in v0.11.0
func (r BetaEndpointAbExperimentUpdateParams) URLQuery() (v url.Values, err error)
URLQuery serializes BetaEndpointAbExperimentUpdateParams's query parameters as `url.Values`.
func (*BetaEndpointAbExperimentUpdateParams) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAbExperimentUpdateParams) UnmarshalJSON(data []byte) error
type BetaEndpointAdapterDeleteParams ¶ added in v0.11.0
type BetaEndpointAdapterDeleteParams struct {
// Project identifier.
//
// Use [option.WithProjectID] on the client to set a global default for this field.
ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
// Endpoint identifier.
EndpointID string `path:"endpointId" api:"required" json:"-"`
// Deployment identifier.
DeploymentID string `path:"deploymentId" api:"required" json:"-"`
// Adapter etag from a previous add, update, get, or list response. The removal is
// rejected if the adapter changed after that response.
Etag string `query:"etag" api:"required" json:"-"`
// contains filtered or unexported fields
}
func (BetaEndpointAdapterDeleteParams) URLQuery ¶ added in v0.11.0
func (r BetaEndpointAdapterDeleteParams) URLQuery() (v url.Values, err error)
URLQuery serializes BetaEndpointAdapterDeleteParams's query parameters as `url.Values`.
type BetaEndpointAdapterDeleteResponse ¶ added in v0.11.0
type BetaEndpointAdapterDeleteResponse 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:"-"`
}
Empty response returned after a successful delete operation.
func (BetaEndpointAdapterDeleteResponse) RawJSON ¶ added in v0.11.0
func (r BetaEndpointAdapterDeleteResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointAdapterDeleteResponse) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAdapterDeleteResponse) UnmarshalJSON(data []byte) error
type BetaEndpointAdapterGetParams ¶ added in v0.11.0
type BetaEndpointAdapterGetParams struct {
// Project identifier.
//
// Use [option.WithProjectID] on the client to set a global default for this field.
ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
// Endpoint identifier.
EndpointID string `path:"endpointId" api:"required" json:"-"`
// Deployment identifier.
DeploymentID string `path:"deploymentId" api:"required" json:"-"`
// contains filtered or unexported fields
}
type BetaEndpointAdapterGetResponse ¶ added in v0.11.0
type BetaEndpointAdapterGetResponse struct {
// Adapter model identifier attached to the deployment.
AdapterModelID string `json:"adapterModelId" api:"required"`
// Adapter revision pinned on the deployment.
DesiredRevisionID string `json:"desiredRevisionId" api:"required"`
// Row-level etag required for UpdateAdapter and RemoveAdapter.
Etag string `json:"etag" api:"required"`
// Per-cluster adapter load state reported by the controller.
PerCluster []BetaEndpointAdapterGetResponsePerCluster `json:"perCluster" api:"required"`
// Resource name of the adapter model, using
// projects/{projectId}/models/{adapterModelId}.
AdapterModel string `json:"adapterModel"`
// Resource name of the adapter model revision pinned on the deployment, using
// projects/{projectId}/models/{adapterModelId}/revisions/{revisionId}.
DesiredRevision string `json:"desiredRevision"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AdapterModelID respjson.Field
DesiredRevisionID respjson.Field
Etag respjson.Field
PerCluster respjson.Field
AdapterModel respjson.Field
DesiredRevision respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Adapter attached to a deployment with desired revision and observed load state.
func (BetaEndpointAdapterGetResponse) RawJSON ¶ added in v0.11.0
func (r BetaEndpointAdapterGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointAdapterGetResponse) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAdapterGetResponse) UnmarshalJSON(data []byte) error
type BetaEndpointAdapterGetResponsePerCluster ¶ added in v0.11.0
type BetaEndpointAdapterGetResponsePerCluster struct {
// Adapter model identifier for this status row.
AdapterModelID string `json:"adapterModelId" api:"required"`
// Cluster reporting this adapter status.
ClusterID string `json:"clusterId" api:"required"`
// Number of pods that failed to load the adapter.
FailedPodCount int64 `json:"failedPodCount" api:"required"`
// Number of pods with the adapter ready to serve.
ReadyPodCount int64 `json:"readyPodCount" api:"required"`
// Current adapter load state in this cluster.
//
// Any of "ADAPTER_LOAD_STATE_PENDING", "ADAPTER_LOAD_STATE_LOADING",
// "ADAPTER_LOAD_STATE_READY", "ADAPTER_LOAD_STATE_REMOVING",
// "ADAPTER_LOAD_STATE_FAILED".
State string `json:"state" api:"required"`
// Total pods expected to report adapter load state.
TotalPodCount int64 `json:"totalPodCount" api:"required"`
// Resource name of the adapter model, using
// projects/{projectId}/models/{adapterModelId}.
AdapterModel string `json:"adapterModel"`
// Time when the adapter first reached READY in this cluster.
LoadedAt time.Time `json:"loadedAt" format:"date-time"`
// Human-readable details about the current adapter state.
Message string `json:"message"`
// Adapter row etag observed by the controller when it wrote this status.
RealizedEtag string `json:"realizedEtag"`
// Resource name of the adapter model revision currently loaded in this cluster,
// using projects/{projectId}/models/{adapterModelId}/revisions/{revisionId}.
RealizedRevision string `json:"realizedRevision"`
// Adapter revision currently loaded on pods in this cluster.
RealizedRevisionID string `json:"realizedRevisionId"`
// Stable reason code for the current adapter state.
Reason string `json:"reason"`
// Time when this adapter status was last updated.
UpdatedAt time.Time `json:"updatedAt" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AdapterModelID respjson.Field
ClusterID respjson.Field
FailedPodCount respjson.Field
ReadyPodCount respjson.Field
State respjson.Field
TotalPodCount respjson.Field
AdapterModel respjson.Field
LoadedAt respjson.Field
Message respjson.Field
RealizedEtag respjson.Field
RealizedRevision respjson.Field
RealizedRevisionID respjson.Field
Reason respjson.Field
UpdatedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Controller-reported load state for an adapter on one deployment cluster.
func (BetaEndpointAdapterGetResponsePerCluster) RawJSON ¶ added in v0.11.0
func (r BetaEndpointAdapterGetResponsePerCluster) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointAdapterGetResponsePerCluster) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAdapterGetResponsePerCluster) UnmarshalJSON(data []byte) error
type BetaEndpointAdapterListParams ¶ added in v0.11.0
type BetaEndpointAdapterListParams struct {
// Project identifier.
//
// Use [option.WithProjectID] on the client to set a global default for this field.
ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
// Cursor from a previous adapter list response.
After param.Opt[string] `query:"after,omitzero" json:"-"`
// Maximum number of adapters to return.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (BetaEndpointAdapterListParams) URLQuery ¶ added in v0.11.0
func (r BetaEndpointAdapterListParams) URLQuery() (v url.Values, err error)
URLQuery serializes BetaEndpointAdapterListParams's query parameters as `url.Values`.
type BetaEndpointAdapterListResponse ¶ added in v0.11.0
type BetaEndpointAdapterListResponse struct {
// Adapter model identifier attached to the deployment.
AdapterModelID string `json:"adapterModelId" api:"required"`
// Adapter revision pinned on the deployment.
DesiredRevisionID string `json:"desiredRevisionId" api:"required"`
// Row-level etag required for UpdateAdapter and RemoveAdapter.
Etag string `json:"etag" api:"required"`
// Per-cluster adapter load state reported by the controller.
PerCluster []BetaEndpointAdapterListResponsePerCluster `json:"perCluster" api:"required"`
// Resource name of the adapter model, using
// projects/{projectId}/models/{adapterModelId}.
AdapterModel string `json:"adapterModel"`
// Resource name of the adapter model revision pinned on the deployment, using
// projects/{projectId}/models/{adapterModelId}/revisions/{revisionId}.
DesiredRevision string `json:"desiredRevision"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AdapterModelID respjson.Field
DesiredRevisionID respjson.Field
Etag respjson.Field
PerCluster respjson.Field
AdapterModel respjson.Field
DesiredRevision respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Adapter attached to a deployment with desired revision and observed load state.
func (BetaEndpointAdapterListResponse) RawJSON ¶ added in v0.11.0
func (r BetaEndpointAdapterListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointAdapterListResponse) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAdapterListResponse) UnmarshalJSON(data []byte) error
type BetaEndpointAdapterListResponsePerCluster ¶ added in v0.11.0
type BetaEndpointAdapterListResponsePerCluster struct {
// Adapter model identifier for this status row.
AdapterModelID string `json:"adapterModelId" api:"required"`
// Cluster reporting this adapter status.
ClusterID string `json:"clusterId" api:"required"`
// Number of pods that failed to load the adapter.
FailedPodCount int64 `json:"failedPodCount" api:"required"`
// Number of pods with the adapter ready to serve.
ReadyPodCount int64 `json:"readyPodCount" api:"required"`
// Current adapter load state in this cluster.
//
// Any of "ADAPTER_LOAD_STATE_PENDING", "ADAPTER_LOAD_STATE_LOADING",
// "ADAPTER_LOAD_STATE_READY", "ADAPTER_LOAD_STATE_REMOVING",
// "ADAPTER_LOAD_STATE_FAILED".
State string `json:"state" api:"required"`
// Total pods expected to report adapter load state.
TotalPodCount int64 `json:"totalPodCount" api:"required"`
// Resource name of the adapter model, using
// projects/{projectId}/models/{adapterModelId}.
AdapterModel string `json:"adapterModel"`
// Time when the adapter first reached READY in this cluster.
LoadedAt time.Time `json:"loadedAt" format:"date-time"`
// Human-readable details about the current adapter state.
Message string `json:"message"`
// Adapter row etag observed by the controller when it wrote this status.
RealizedEtag string `json:"realizedEtag"`
// Resource name of the adapter model revision currently loaded in this cluster,
// using projects/{projectId}/models/{adapterModelId}/revisions/{revisionId}.
RealizedRevision string `json:"realizedRevision"`
// Adapter revision currently loaded on pods in this cluster.
RealizedRevisionID string `json:"realizedRevisionId"`
// Stable reason code for the current adapter state.
Reason string `json:"reason"`
// Time when this adapter status was last updated.
UpdatedAt time.Time `json:"updatedAt" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AdapterModelID respjson.Field
ClusterID respjson.Field
FailedPodCount respjson.Field
ReadyPodCount respjson.Field
State respjson.Field
TotalPodCount respjson.Field
AdapterModel respjson.Field
LoadedAt respjson.Field
Message respjson.Field
RealizedEtag respjson.Field
RealizedRevision respjson.Field
RealizedRevisionID respjson.Field
Reason respjson.Field
UpdatedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Controller-reported load state for an adapter on one deployment cluster.
func (BetaEndpointAdapterListResponsePerCluster) RawJSON ¶ added in v0.11.0
func (r BetaEndpointAdapterListResponsePerCluster) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointAdapterListResponsePerCluster) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAdapterListResponsePerCluster) UnmarshalJSON(data []byte) error
type BetaEndpointAdapterNewParams ¶ added in v0.11.0
type BetaEndpointAdapterNewParams struct {
// Project identifier.
//
// Use [option.WithProjectID] on the client to set a global default for this field.
ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
// Endpoint identifier.
EndpointID string `path:"endpointId" api:"required" json:"-"`
// Deployment identifier.
DeploymentID string `path:"deploymentId" api:"required" json:"-"`
// Adapter model identifier to attach.
AdapterModelID string `json:"adapterModelId" api:"required"`
// Optional adapter revision to pin. If omitted, the latest revision is resolved at
// request time.
AdapterRevisionID param.Opt[string] `json:"adapterRevisionId,omitzero"`
// Whether to evict the oldest adapter if the deployment is at adapter capacity.
Force param.Opt[bool] `json:"force,omitzero"`
// contains filtered or unexported fields
}
func (BetaEndpointAdapterNewParams) MarshalJSON ¶ added in v0.11.0
func (r BetaEndpointAdapterNewParams) MarshalJSON() (data []byte, err error)
func (*BetaEndpointAdapterNewParams) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAdapterNewParams) UnmarshalJSON(data []byte) error
type BetaEndpointAdapterNewResponse ¶ added in v0.11.0
type BetaEndpointAdapterNewResponse struct {
// Adapter model identifier attached to the deployment.
AdapterModelID string `json:"adapterModelId" api:"required"`
// Adapter revision pinned on the deployment.
DesiredRevisionID string `json:"desiredRevisionId" api:"required"`
// Row-level etag required for UpdateAdapter and RemoveAdapter.
Etag string `json:"etag" api:"required"`
// Per-cluster adapter load state reported by the controller.
PerCluster []BetaEndpointAdapterNewResponsePerCluster `json:"perCluster" api:"required"`
// Resource name of the adapter model, using
// projects/{projectId}/models/{adapterModelId}.
AdapterModel string `json:"adapterModel"`
// Resource name of the adapter model revision pinned on the deployment, using
// projects/{projectId}/models/{adapterModelId}/revisions/{revisionId}.
DesiredRevision string `json:"desiredRevision"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AdapterModelID respjson.Field
DesiredRevisionID respjson.Field
Etag respjson.Field
PerCluster respjson.Field
AdapterModel respjson.Field
DesiredRevision respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Adapter attached to a deployment with desired revision and observed load state.
func (BetaEndpointAdapterNewResponse) RawJSON ¶ added in v0.11.0
func (r BetaEndpointAdapterNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointAdapterNewResponse) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAdapterNewResponse) UnmarshalJSON(data []byte) error
type BetaEndpointAdapterNewResponsePerCluster ¶ added in v0.11.0
type BetaEndpointAdapterNewResponsePerCluster struct {
// Adapter model identifier for this status row.
AdapterModelID string `json:"adapterModelId" api:"required"`
// Cluster reporting this adapter status.
ClusterID string `json:"clusterId" api:"required"`
// Number of pods that failed to load the adapter.
FailedPodCount int64 `json:"failedPodCount" api:"required"`
// Number of pods with the adapter ready to serve.
ReadyPodCount int64 `json:"readyPodCount" api:"required"`
// Current adapter load state in this cluster.
//
// Any of "ADAPTER_LOAD_STATE_PENDING", "ADAPTER_LOAD_STATE_LOADING",
// "ADAPTER_LOAD_STATE_READY", "ADAPTER_LOAD_STATE_REMOVING",
// "ADAPTER_LOAD_STATE_FAILED".
State string `json:"state" api:"required"`
// Total pods expected to report adapter load state.
TotalPodCount int64 `json:"totalPodCount" api:"required"`
// Resource name of the adapter model, using
// projects/{projectId}/models/{adapterModelId}.
AdapterModel string `json:"adapterModel"`
// Time when the adapter first reached READY in this cluster.
LoadedAt time.Time `json:"loadedAt" format:"date-time"`
// Human-readable details about the current adapter state.
Message string `json:"message"`
// Adapter row etag observed by the controller when it wrote this status.
RealizedEtag string `json:"realizedEtag"`
// Resource name of the adapter model revision currently loaded in this cluster,
// using projects/{projectId}/models/{adapterModelId}/revisions/{revisionId}.
RealizedRevision string `json:"realizedRevision"`
// Adapter revision currently loaded on pods in this cluster.
RealizedRevisionID string `json:"realizedRevisionId"`
// Stable reason code for the current adapter state.
Reason string `json:"reason"`
// Time when this adapter status was last updated.
UpdatedAt time.Time `json:"updatedAt" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AdapterModelID respjson.Field
ClusterID respjson.Field
FailedPodCount respjson.Field
ReadyPodCount respjson.Field
State respjson.Field
TotalPodCount respjson.Field
AdapterModel respjson.Field
LoadedAt respjson.Field
Message respjson.Field
RealizedEtag respjson.Field
RealizedRevision respjson.Field
RealizedRevisionID respjson.Field
Reason respjson.Field
UpdatedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Controller-reported load state for an adapter on one deployment cluster.
func (BetaEndpointAdapterNewResponsePerCluster) RawJSON ¶ added in v0.11.0
func (r BetaEndpointAdapterNewResponsePerCluster) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointAdapterNewResponsePerCluster) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAdapterNewResponsePerCluster) UnmarshalJSON(data []byte) error
type BetaEndpointAdapterService ¶ added in v0.11.0
type BetaEndpointAdapterService struct {
Options []option.RequestOption
}
BetaEndpointAdapterService 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 NewBetaEndpointAdapterService method instead.
func NewBetaEndpointAdapterService ¶ added in v0.11.0
func NewBetaEndpointAdapterService(opts ...option.RequestOption) (r BetaEndpointAdapterService)
NewBetaEndpointAdapterService 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 (*BetaEndpointAdapterService) Delete ¶ added in v0.11.0
func (r *BetaEndpointAdapterService) Delete(ctx context.Context, id string, params BetaEndpointAdapterDeleteParams, opts ...option.RequestOption) (res *BetaEndpointAdapterDeleteResponse, err error)
Detaches an adapter from a deployment using its row-level etag for optimistic concurrency.
func (*BetaEndpointAdapterService) Get ¶ added in v0.11.0
func (r *BetaEndpointAdapterService) Get(ctx context.Context, id string, query BetaEndpointAdapterGetParams, opts ...option.RequestOption) (res *BetaEndpointAdapterGetResponse, err error)
Gets an attached adapter and its per-cluster load state.
func (*BetaEndpointAdapterService) List ¶ added in v0.11.0
func (r *BetaEndpointAdapterService) List(ctx context.Context, endpointID string, deploymentID string, params BetaEndpointAdapterListParams, opts ...option.RequestOption) (res *pagination.CursorPagination[BetaEndpointAdapterListResponse], err error)
Lists LoRA adapters attached to a deployment with per-cluster load state.
func (*BetaEndpointAdapterService) ListAutoPaging ¶ added in v0.11.0
func (r *BetaEndpointAdapterService) ListAutoPaging(ctx context.Context, endpointID string, deploymentID string, params BetaEndpointAdapterListParams, opts ...option.RequestOption) *pagination.CursorPaginationAutoPager[BetaEndpointAdapterListResponse]
Lists LoRA adapters attached to a deployment with per-cluster load state.
func (*BetaEndpointAdapterService) New ¶ added in v0.11.0
func (r *BetaEndpointAdapterService) New(ctx context.Context, params BetaEndpointAdapterNewParams, opts ...option.RequestOption) (res *BetaEndpointAdapterNewResponse, err error)
Attaches a LoRA adapter to a deployment. If the deployment is at adapter capacity, force can evict the oldest adapter.
func (*BetaEndpointAdapterService) Update ¶ added in v0.11.0
func (r *BetaEndpointAdapterService) Update(ctx context.Context, id string, params BetaEndpointAdapterUpdateParams, opts ...option.RequestOption) (res *BetaEndpointAdapterUpdateResponse, err error)
Updates the pinned revision of an attached adapter using its row-level etag for optimistic concurrency.
type BetaEndpointAdapterUpdateParams ¶ added in v0.11.0
type BetaEndpointAdapterUpdateParams struct {
// Project identifier.
//
// Use [option.WithProjectID] on the client to set a global default for this field.
ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
// Endpoint identifier.
EndpointID string `path:"endpointId" api:"required" json:"-"`
// Deployment identifier.
DeploymentID string `path:"deploymentId" api:"required" json:"-"`
// New adapter revision to pin.
AdapterRevisionID string `json:"adapterRevisionId" api:"required"`
// Row-level etag from a prior AddAdapter, UpdateAdapter, GetAdapter, or
// ListAdapters response.
Etag string `json:"etag" api:"required"`
// contains filtered or unexported fields
}
func (BetaEndpointAdapterUpdateParams) MarshalJSON ¶ added in v0.11.0
func (r BetaEndpointAdapterUpdateParams) MarshalJSON() (data []byte, err error)
func (*BetaEndpointAdapterUpdateParams) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAdapterUpdateParams) UnmarshalJSON(data []byte) error
type BetaEndpointAdapterUpdateResponse ¶ added in v0.11.0
type BetaEndpointAdapterUpdateResponse struct {
// Adapter model identifier attached to the deployment.
AdapterModelID string `json:"adapterModelId" api:"required"`
// Adapter revision pinned on the deployment.
DesiredRevisionID string `json:"desiredRevisionId" api:"required"`
// Row-level etag required for UpdateAdapter and RemoveAdapter.
Etag string `json:"etag" api:"required"`
// Per-cluster adapter load state reported by the controller.
PerCluster []BetaEndpointAdapterUpdateResponsePerCluster `json:"perCluster" api:"required"`
// Resource name of the adapter model, using
// projects/{projectId}/models/{adapterModelId}.
AdapterModel string `json:"adapterModel"`
// Resource name of the adapter model revision pinned on the deployment, using
// projects/{projectId}/models/{adapterModelId}/revisions/{revisionId}.
DesiredRevision string `json:"desiredRevision"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AdapterModelID respjson.Field
DesiredRevisionID respjson.Field
Etag respjson.Field
PerCluster respjson.Field
AdapterModel respjson.Field
DesiredRevision respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Adapter attached to a deployment with desired revision and observed load state.
func (BetaEndpointAdapterUpdateResponse) RawJSON ¶ added in v0.11.0
func (r BetaEndpointAdapterUpdateResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointAdapterUpdateResponse) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAdapterUpdateResponse) UnmarshalJSON(data []byte) error
type BetaEndpointAdapterUpdateResponsePerCluster ¶ added in v0.11.0
type BetaEndpointAdapterUpdateResponsePerCluster struct {
// Adapter model identifier for this status row.
AdapterModelID string `json:"adapterModelId" api:"required"`
// Cluster reporting this adapter status.
ClusterID string `json:"clusterId" api:"required"`
// Number of pods that failed to load the adapter.
FailedPodCount int64 `json:"failedPodCount" api:"required"`
// Number of pods with the adapter ready to serve.
ReadyPodCount int64 `json:"readyPodCount" api:"required"`
// Current adapter load state in this cluster.
//
// Any of "ADAPTER_LOAD_STATE_PENDING", "ADAPTER_LOAD_STATE_LOADING",
// "ADAPTER_LOAD_STATE_READY", "ADAPTER_LOAD_STATE_REMOVING",
// "ADAPTER_LOAD_STATE_FAILED".
State string `json:"state" api:"required"`
// Total pods expected to report adapter load state.
TotalPodCount int64 `json:"totalPodCount" api:"required"`
// Resource name of the adapter model, using
// projects/{projectId}/models/{adapterModelId}.
AdapterModel string `json:"adapterModel"`
// Time when the adapter first reached READY in this cluster.
LoadedAt time.Time `json:"loadedAt" format:"date-time"`
// Human-readable details about the current adapter state.
Message string `json:"message"`
// Adapter row etag observed by the controller when it wrote this status.
RealizedEtag string `json:"realizedEtag"`
// Resource name of the adapter model revision currently loaded in this cluster,
// using projects/{projectId}/models/{adapterModelId}/revisions/{revisionId}.
RealizedRevision string `json:"realizedRevision"`
// Adapter revision currently loaded on pods in this cluster.
RealizedRevisionID string `json:"realizedRevisionId"`
// Stable reason code for the current adapter state.
Reason string `json:"reason"`
// Time when this adapter status was last updated.
UpdatedAt time.Time `json:"updatedAt" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AdapterModelID respjson.Field
ClusterID respjson.Field
FailedPodCount respjson.Field
ReadyPodCount respjson.Field
State respjson.Field
TotalPodCount respjson.Field
AdapterModel respjson.Field
LoadedAt respjson.Field
Message respjson.Field
RealizedEtag respjson.Field
RealizedRevision respjson.Field
RealizedRevisionID respjson.Field
Reason respjson.Field
UpdatedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Controller-reported load state for an adapter on one deployment cluster.
func (BetaEndpointAdapterUpdateResponsePerCluster) RawJSON ¶ added in v0.11.0
func (r BetaEndpointAdapterUpdateResponsePerCluster) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointAdapterUpdateResponsePerCluster) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAdapterUpdateResponsePerCluster) UnmarshalJSON(data []byte) error
type BetaEndpointAnalyticsParams ¶ added in v0.11.0
type BetaEndpointAnalyticsParams struct {
// Project identifier.
//
// Use [option.WithProjectID] on the client to set a global default for this field.
ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
// Restrict to a single deployment under this endpoint.
DeploymentID param.Opt[string] `query:"deploymentId,omitzero" json:"-"`
// Exclusive end of the time range. Defaults to now if unset.
EndTime param.Opt[time.Time] `query:"endTime,omitzero" format:"date-time" json:"-"`
// Time-series bucket duration, such as `1m`, `1h`, or `1d`. Defaults to `1d`.
Granularity param.Opt[string] `query:"granularity,omitzero" json:"-"`
// When true, include per-bucket time series in the response.
IncludeTimeSeries param.Opt[bool] `query:"includeTimeSeries,omitzero" json:"-"`
// Inclusive start of the time range. Defaults to 24 hours ago if unset.
StartTime param.Opt[time.Time] `query:"startTime,omitzero" format:"date-time" json:"-"`
// contains filtered or unexported fields
}
func (BetaEndpointAnalyticsParams) URLQuery ¶ added in v0.11.0
func (r BetaEndpointAnalyticsParams) URLQuery() (v url.Values, err error)
URLQuery serializes BetaEndpointAnalyticsParams's query parameters as `url.Values`.
type BetaEndpointAnalyticsResponse ¶ added in v0.11.0
type BetaEndpointAnalyticsResponse struct {
// Per-deployment analytics.
DeploymentAnalytics []BetaEndpointAnalyticsResponseDeploymentAnalytics `json:"deploymentAnalytics"`
// ID of the endpoint summarized by these analytics.
EndpointID string `json:"endpointId"`
// Operational metrics aggregated across all deployments receiving traffic for an
// endpoint.
Metrics BetaEndpointAnalyticsResponseMetrics `json:"metrics"`
// Closed-open time range covered by the analytics.
TimeRange BetaEndpointAnalyticsResponseTimeRange `json:"timeRange"`
// Per-bucket metric samples, included only when `includeTimeSeries` is true.
TimeSeries []BetaEndpointAnalyticsResponseTimeSeries `json:"timeSeries"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
DeploymentAnalytics respjson.Field
EndpointID respjson.Field
Metrics respjson.Field
TimeRange respjson.Field
TimeSeries respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Endpoint-wide usage and performance analytics with optional time-series and per-deployment breakdowns.
func (BetaEndpointAnalyticsResponse) RawJSON ¶ added in v0.11.0
func (r BetaEndpointAnalyticsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointAnalyticsResponse) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAnalyticsResponse) UnmarshalJSON(data []byte) error
type BetaEndpointAnalyticsResponseDeploymentAnalytics ¶ added in v0.11.0
type BetaEndpointAnalyticsResponseDeploymentAnalytics struct {
// ID of the deployment summarized by these analytics.
DeploymentID string `json:"deploymentId"`
// ID of the deployment's parent endpoint.
EndpointID string `json:"endpointId"`
// Aggregate operational metrics for the deployment.
Metrics BetaEndpointAnalyticsResponseDeploymentAnalyticsMetrics `json:"metrics"`
// Closed-open time range covered by the analytics.
TimeRange BetaEndpointAnalyticsResponseDeploymentAnalyticsTimeRange `json:"timeRange"`
// Per-bucket metric samples for the deployment.
TimeSeries []BetaEndpointAnalyticsResponseDeploymentAnalyticsTimeSeries `json:"timeSeries"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
DeploymentID respjson.Field
EndpointID respjson.Field
Metrics respjson.Field
TimeRange respjson.Field
TimeSeries respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Usage and performance analytics for one deployment under an endpoint.
func (BetaEndpointAnalyticsResponseDeploymentAnalytics) RawJSON ¶ added in v0.11.0
func (r BetaEndpointAnalyticsResponseDeploymentAnalytics) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointAnalyticsResponseDeploymentAnalytics) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAnalyticsResponseDeploymentAnalytics) UnmarshalJSON(data []byte) error
type BetaEndpointAnalyticsResponseDeploymentAnalyticsMetrics ¶ added in v0.11.0
type BetaEndpointAnalyticsResponseDeploymentAnalyticsMetrics struct {
// ID of the deployment summarized by these metrics.
DeploymentID string `json:"deploymentId"`
// ID of the deployment's parent endpoint.
EndpointID string `json:"endpointId"`
// Error rate and counts by error type.
ErrorMetrics BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsErrorMetrics `json:"errorMetrics"`
// Time-to-first-token, end-to-end, and inter-token latency percentiles.
LatencyMetrics BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsLatencyMetrics `json:"latencyMetrics"`
// Request counts and rates.
RequestMetrics BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsRequestMetrics `json:"requestMetrics"`
// Average CPU, GPU, memory, and network utilization.
ResourceUtilization BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsResourceUtilization `json:"resourceUtilization"`
// Token, request, and batching throughput.
ThroughputMetrics BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsThroughputMetrics `json:"throughputMetrics"`
// Closed-open time range covered by the metrics.
TimeRange BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsTimeRange `json:"timeRange"`
// Input and output token totals and averages.
TokenMetrics BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsTokenMetrics `json:"tokenMetrics"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
DeploymentID respjson.Field
EndpointID respjson.Field
ErrorMetrics respjson.Field
LatencyMetrics respjson.Field
RequestMetrics respjson.Field
ResourceUtilization respjson.Field
ThroughputMetrics respjson.Field
TimeRange respjson.Field
TokenMetrics respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Aggregate operational metrics for the deployment.
func (BetaEndpointAnalyticsResponseDeploymentAnalyticsMetrics) RawJSON ¶ added in v0.11.0
func (r BetaEndpointAnalyticsResponseDeploymentAnalyticsMetrics) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointAnalyticsResponseDeploymentAnalyticsMetrics) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAnalyticsResponseDeploymentAnalyticsMetrics) UnmarshalJSON(data []byte) error
type BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsErrorMetrics ¶ added in v0.11.0
type BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsErrorMetrics struct {
// Percentage in [0, 100].
ErrorRate float64 `json:"errorRate"`
// Counts of errors keyed by error type (e.g. HTTP status code or error kind).
ErrorsByType map[string]string `json:"errorsByType"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ErrorRate respjson.Field
ErrorsByType respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Error rate and counts by error type.
func (BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsErrorMetrics) RawJSON ¶ added in v0.11.0
func (r BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsErrorMetrics) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsErrorMetrics) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsErrorMetrics) UnmarshalJSON(data []byte) error
type BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsLatencyMetrics ¶ added in v0.11.0
type BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsLatencyMetrics struct {
// 50th-percentile inter-token latency, in milliseconds.
ItlP50Ms float64 `json:"itlP50Ms"`
// 90th-percentile inter-token latency, in milliseconds.
ItlP90Ms float64 `json:"itlP90Ms"`
// 99th-percentile inter-token latency, in milliseconds.
ItlP99Ms float64 `json:"itlP99Ms"`
// 50th-percentile end-to-end request latency, in milliseconds.
LatencyP50Ms float64 `json:"latencyP50Ms"`
// 90th-percentile end-to-end request latency, in milliseconds.
LatencyP90Ms float64 `json:"latencyP90Ms"`
// 99th-percentile end-to-end request latency, in milliseconds.
LatencyP99Ms float64 `json:"latencyP99Ms"`
// 50th-percentile time to first token, in milliseconds.
TtftP50Ms float64 `json:"ttftP50Ms"`
// 90th-percentile time to first token, in milliseconds.
TtftP90Ms float64 `json:"ttftP90Ms"`
// 99th-percentile time to first token, in milliseconds.
TtftP99Ms float64 `json:"ttftP99Ms"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ItlP50Ms respjson.Field
ItlP90Ms respjson.Field
ItlP99Ms respjson.Field
LatencyP50Ms respjson.Field
LatencyP90Ms respjson.Field
LatencyP99Ms respjson.Field
TtftP50Ms respjson.Field
TtftP90Ms respjson.Field
TtftP99Ms respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Time-to-first-token, end-to-end, and inter-token latency percentiles.
func (BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsLatencyMetrics) RawJSON ¶ added in v0.11.0
func (r BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsLatencyMetrics) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsLatencyMetrics) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsLatencyMetrics) UnmarshalJSON(data []byte) error
type BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsRequestMetrics ¶ added in v0.11.0
type BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsRequestMetrics struct {
// Requests that failed during the time range.
FailedRequests string `json:"failedRequests"`
// Request counts keyed by HTTP status code.
RequestsByStatusCode map[string]string `json:"requestsByStatusCode"`
// Average requests per second over the time range.
RequestsPerSecond float64 `json:"requestsPerSecond"`
// Requests completed successfully during the time range.
SuccessfulRequests string `json:"successfulRequests"`
// Total requests received during the time range.
TotalRequests string `json:"totalRequests"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
FailedRequests respjson.Field
RequestsByStatusCode respjson.Field
RequestsPerSecond respjson.Field
SuccessfulRequests respjson.Field
TotalRequests respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Request counts and rates.
func (BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsRequestMetrics) RawJSON ¶ added in v0.11.0
func (r BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsRequestMetrics) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsRequestMetrics) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsRequestMetrics) UnmarshalJSON(data []byte) error
type BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsResourceUtilization ¶ added in v0.11.0
type BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsResourceUtilization struct {
// Average CPU utilization across replicas, as a percentage.
CPUUtilization float64 `json:"cpuUtilization"`
// Average GPU memory utilization across replicas, as a percentage.
GPUMemoryUtilization float64 `json:"gpuMemoryUtilization"`
// Average GPU compute utilization across replicas, as a percentage.
GPUUtilization float64 `json:"gpuUtilization"`
// Average system memory utilization across replicas, as a percentage.
MemoryUtilization float64 `json:"memoryUtilization"`
// Average network throughput across replicas, in megabits per second.
NetworkBandwidthMbps float64 `json:"networkBandwidthMbps"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CPUUtilization respjson.Field
GPUMemoryUtilization respjson.Field
GPUUtilization respjson.Field
MemoryUtilization respjson.Field
NetworkBandwidthMbps respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Average CPU, GPU, memory, and network utilization.
func (BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsResourceUtilization) RawJSON ¶ added in v0.11.0
func (r BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsResourceUtilization) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsResourceUtilization) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsResourceUtilization) UnmarshalJSON(data []byte) error
type BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsThroughputMetrics ¶ added in v0.11.0
type BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsThroughputMetrics struct {
// Average number of batches queued or in flight in the serving engine.
AvgBatchDepth float64 `json:"avgBatchDepth"`
// Average number of requests processed in each runtime batch.
AvgBatchSize float64 `json:"avgBatchSize"`
// Average completed requests per second.
RequestsPerSecond float64 `json:"requestsPerSecond"`
// Average generated tokens per second.
TokensPerSecond float64 `json:"tokensPerSecond"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AvgBatchDepth respjson.Field
AvgBatchSize respjson.Field
RequestsPerSecond respjson.Field
TokensPerSecond respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Token, request, and batching throughput.
func (BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsThroughputMetrics) RawJSON ¶ added in v0.11.0
func (r BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsThroughputMetrics) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsThroughputMetrics) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsThroughputMetrics) UnmarshalJSON(data []byte) error
type BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsTimeRange ¶ added in v0.11.0
type BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsTimeRange struct {
// Exclusive end of the time range.
EndTime time.Time `json:"endTime" format:"date-time"`
// Inclusive start of the time range.
StartTime time.Time `json:"startTime" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
EndTime respjson.Field
StartTime respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Closed-open time range covered by the metrics.
func (BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsTimeRange) RawJSON ¶ added in v0.11.0
func (r BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsTimeRange) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsTimeRange) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsTimeRange) UnmarshalJSON(data []byte) error
type BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsTokenMetrics ¶ added in v0.11.0
type BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsTokenMetrics struct {
// Average input tokens per request.
AvgInputTokens float64 `json:"avgInputTokens"`
// Average output tokens per request.
AvgOutputTokens float64 `json:"avgOutputTokens"`
// Total input tokens processed during the time range.
TotalInputTokens string `json:"totalInputTokens"`
// Total output tokens generated during the time range.
TotalOutputTokens string `json:"totalOutputTokens"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AvgInputTokens respjson.Field
AvgOutputTokens respjson.Field
TotalInputTokens respjson.Field
TotalOutputTokens respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Input and output token totals and averages.
func (BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsTokenMetrics) RawJSON ¶ added in v0.11.0
func (r BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsTokenMetrics) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsTokenMetrics) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAnalyticsResponseDeploymentAnalyticsMetricsTokenMetrics) UnmarshalJSON(data []byte) error
type BetaEndpointAnalyticsResponseDeploymentAnalyticsTimeRange ¶ added in v0.11.0
type BetaEndpointAnalyticsResponseDeploymentAnalyticsTimeRange struct {
// Exclusive end of the time range.
EndTime time.Time `json:"endTime" format:"date-time"`
// Inclusive start of the time range.
StartTime time.Time `json:"startTime" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
EndTime respjson.Field
StartTime respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Closed-open time range covered by the analytics.
func (BetaEndpointAnalyticsResponseDeploymentAnalyticsTimeRange) RawJSON ¶ added in v0.11.0
func (r BetaEndpointAnalyticsResponseDeploymentAnalyticsTimeRange) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointAnalyticsResponseDeploymentAnalyticsTimeRange) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAnalyticsResponseDeploymentAnalyticsTimeRange) UnmarshalJSON(data []byte) error
type BetaEndpointAnalyticsResponseDeploymentAnalyticsTimeSeries ¶ added in v0.11.0
type BetaEndpointAnalyticsResponseDeploymentAnalyticsTimeSeries struct {
// Start time of the metric bucket.
Timestamp time.Time `json:"timestamp" format:"date-time"`
// Metric names mapped to their numeric values for this bucket.
Values map[string]float64 `json:"values"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Timestamp respjson.Field
Values respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Timestamped bucket containing one or more named metric values.
func (BetaEndpointAnalyticsResponseDeploymentAnalyticsTimeSeries) RawJSON ¶ added in v0.11.0
func (r BetaEndpointAnalyticsResponseDeploymentAnalyticsTimeSeries) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointAnalyticsResponseDeploymentAnalyticsTimeSeries) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAnalyticsResponseDeploymentAnalyticsTimeSeries) UnmarshalJSON(data []byte) error
type BetaEndpointAnalyticsResponseMetrics ¶ added in v0.11.0
type BetaEndpointAnalyticsResponseMetrics struct {
// Per-deployment breakdown, if the endpoint has multiple deployments.
DeploymentMetrics []BetaEndpointAnalyticsResponseMetricsDeploymentMetric `json:"deploymentMetrics"`
// The endpoint these metrics describe.
EndpointID string `json:"endpointId"`
// Error rate and counts by error type.
ErrorMetrics BetaEndpointAnalyticsResponseMetricsErrorMetrics `json:"errorMetrics"`
// Time-to-first-token, end-to-end, and inter-token latency percentiles.
LatencyMetrics BetaEndpointAnalyticsResponseMetricsLatencyMetrics `json:"latencyMetrics"`
// Request counts and rates.
RequestMetrics BetaEndpointAnalyticsResponseMetricsRequestMetrics `json:"requestMetrics"`
// Average CPU, GPU, memory, and network utilization.
ResourceUtilization BetaEndpointAnalyticsResponseMetricsResourceUtilization `json:"resourceUtilization"`
// Token, request, and batching throughput.
ThroughputMetrics BetaEndpointAnalyticsResponseMetricsThroughputMetrics `json:"throughputMetrics"`
// Closed-open time range used by metrics and analytics responses.
TimeRange BetaEndpointAnalyticsResponseMetricsTimeRange `json:"timeRange"`
// Input and output token totals and averages.
TokenMetrics BetaEndpointAnalyticsResponseMetricsTokenMetrics `json:"tokenMetrics"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
DeploymentMetrics respjson.Field
EndpointID respjson.Field
ErrorMetrics respjson.Field
LatencyMetrics respjson.Field
RequestMetrics respjson.Field
ResourceUtilization respjson.Field
ThroughputMetrics respjson.Field
TimeRange respjson.Field
TokenMetrics respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Operational metrics aggregated across all deployments receiving traffic for an endpoint.
func (BetaEndpointAnalyticsResponseMetrics) RawJSON ¶ added in v0.11.0
func (r BetaEndpointAnalyticsResponseMetrics) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointAnalyticsResponseMetrics) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAnalyticsResponseMetrics) UnmarshalJSON(data []byte) error
type BetaEndpointAnalyticsResponseMetricsDeploymentMetric ¶ added in v0.11.0
type BetaEndpointAnalyticsResponseMetricsDeploymentMetric struct {
// ID of the deployment summarized by these metrics.
DeploymentID string `json:"deploymentId"`
// ID of the deployment's parent endpoint.
EndpointID string `json:"endpointId"`
// Error rate and counts by error type.
ErrorMetrics BetaEndpointAnalyticsResponseMetricsDeploymentMetricErrorMetrics `json:"errorMetrics"`
// Time-to-first-token, end-to-end, and inter-token latency percentiles.
LatencyMetrics BetaEndpointAnalyticsResponseMetricsDeploymentMetricLatencyMetrics `json:"latencyMetrics"`
// Request counts and rates.
RequestMetrics BetaEndpointAnalyticsResponseMetricsDeploymentMetricRequestMetrics `json:"requestMetrics"`
// Average CPU, GPU, memory, and network utilization.
ResourceUtilization BetaEndpointAnalyticsResponseMetricsDeploymentMetricResourceUtilization `json:"resourceUtilization"`
// Token, request, and batching throughput.
ThroughputMetrics BetaEndpointAnalyticsResponseMetricsDeploymentMetricThroughputMetrics `json:"throughputMetrics"`
// Closed-open time range covered by the metrics.
TimeRange BetaEndpointAnalyticsResponseMetricsDeploymentMetricTimeRange `json:"timeRange"`
// Input and output token totals and averages.
TokenMetrics BetaEndpointAnalyticsResponseMetricsDeploymentMetricTokenMetrics `json:"tokenMetrics"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
DeploymentID respjson.Field
EndpointID respjson.Field
ErrorMetrics respjson.Field
LatencyMetrics respjson.Field
RequestMetrics respjson.Field
ResourceUtilization respjson.Field
ThroughputMetrics respjson.Field
TimeRange respjson.Field
TokenMetrics respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Operational metrics for one deployment under an endpoint.
func (BetaEndpointAnalyticsResponseMetricsDeploymentMetric) RawJSON ¶ added in v0.11.0
func (r BetaEndpointAnalyticsResponseMetricsDeploymentMetric) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointAnalyticsResponseMetricsDeploymentMetric) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAnalyticsResponseMetricsDeploymentMetric) UnmarshalJSON(data []byte) error
type BetaEndpointAnalyticsResponseMetricsDeploymentMetricErrorMetrics ¶ added in v0.11.0
type BetaEndpointAnalyticsResponseMetricsDeploymentMetricErrorMetrics struct {
// Percentage in [0, 100].
ErrorRate float64 `json:"errorRate"`
// Counts of errors keyed by error type (e.g. HTTP status code or error kind).
ErrorsByType map[string]string `json:"errorsByType"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ErrorRate respjson.Field
ErrorsByType respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Error rate and counts by error type.
func (BetaEndpointAnalyticsResponseMetricsDeploymentMetricErrorMetrics) RawJSON ¶ added in v0.11.0
func (r BetaEndpointAnalyticsResponseMetricsDeploymentMetricErrorMetrics) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointAnalyticsResponseMetricsDeploymentMetricErrorMetrics) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAnalyticsResponseMetricsDeploymentMetricErrorMetrics) UnmarshalJSON(data []byte) error
type BetaEndpointAnalyticsResponseMetricsDeploymentMetricLatencyMetrics ¶ added in v0.11.0
type BetaEndpointAnalyticsResponseMetricsDeploymentMetricLatencyMetrics struct {
// 50th-percentile inter-token latency, in milliseconds.
ItlP50Ms float64 `json:"itlP50Ms"`
// 90th-percentile inter-token latency, in milliseconds.
ItlP90Ms float64 `json:"itlP90Ms"`
// 99th-percentile inter-token latency, in milliseconds.
ItlP99Ms float64 `json:"itlP99Ms"`
// 50th-percentile end-to-end request latency, in milliseconds.
LatencyP50Ms float64 `json:"latencyP50Ms"`
// 90th-percentile end-to-end request latency, in milliseconds.
LatencyP90Ms float64 `json:"latencyP90Ms"`
// 99th-percentile end-to-end request latency, in milliseconds.
LatencyP99Ms float64 `json:"latencyP99Ms"`
// 50th-percentile time to first token, in milliseconds.
TtftP50Ms float64 `json:"ttftP50Ms"`
// 90th-percentile time to first token, in milliseconds.
TtftP90Ms float64 `json:"ttftP90Ms"`
// 99th-percentile time to first token, in milliseconds.
TtftP99Ms float64 `json:"ttftP99Ms"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ItlP50Ms respjson.Field
ItlP90Ms respjson.Field
ItlP99Ms respjson.Field
LatencyP50Ms respjson.Field
LatencyP90Ms respjson.Field
LatencyP99Ms respjson.Field
TtftP50Ms respjson.Field
TtftP90Ms respjson.Field
TtftP99Ms respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Time-to-first-token, end-to-end, and inter-token latency percentiles.
func (BetaEndpointAnalyticsResponseMetricsDeploymentMetricLatencyMetrics) RawJSON ¶ added in v0.11.0
func (r BetaEndpointAnalyticsResponseMetricsDeploymentMetricLatencyMetrics) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointAnalyticsResponseMetricsDeploymentMetricLatencyMetrics) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAnalyticsResponseMetricsDeploymentMetricLatencyMetrics) UnmarshalJSON(data []byte) error
type BetaEndpointAnalyticsResponseMetricsDeploymentMetricRequestMetrics ¶ added in v0.11.0
type BetaEndpointAnalyticsResponseMetricsDeploymentMetricRequestMetrics struct {
// Requests that failed during the time range.
FailedRequests string `json:"failedRequests"`
// Request counts keyed by HTTP status code.
RequestsByStatusCode map[string]string `json:"requestsByStatusCode"`
// Average requests per second over the time range.
RequestsPerSecond float64 `json:"requestsPerSecond"`
// Requests completed successfully during the time range.
SuccessfulRequests string `json:"successfulRequests"`
// Total requests received during the time range.
TotalRequests string `json:"totalRequests"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
FailedRequests respjson.Field
RequestsByStatusCode respjson.Field
RequestsPerSecond respjson.Field
SuccessfulRequests respjson.Field
TotalRequests respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Request counts and rates.
func (BetaEndpointAnalyticsResponseMetricsDeploymentMetricRequestMetrics) RawJSON ¶ added in v0.11.0
func (r BetaEndpointAnalyticsResponseMetricsDeploymentMetricRequestMetrics) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointAnalyticsResponseMetricsDeploymentMetricRequestMetrics) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAnalyticsResponseMetricsDeploymentMetricRequestMetrics) UnmarshalJSON(data []byte) error
type BetaEndpointAnalyticsResponseMetricsDeploymentMetricResourceUtilization ¶ added in v0.11.0
type BetaEndpointAnalyticsResponseMetricsDeploymentMetricResourceUtilization struct {
// Average CPU utilization across replicas, as a percentage.
CPUUtilization float64 `json:"cpuUtilization"`
// Average GPU memory utilization across replicas, as a percentage.
GPUMemoryUtilization float64 `json:"gpuMemoryUtilization"`
// Average GPU compute utilization across replicas, as a percentage.
GPUUtilization float64 `json:"gpuUtilization"`
// Average system memory utilization across replicas, as a percentage.
MemoryUtilization float64 `json:"memoryUtilization"`
// Average network throughput across replicas, in megabits per second.
NetworkBandwidthMbps float64 `json:"networkBandwidthMbps"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CPUUtilization respjson.Field
GPUMemoryUtilization respjson.Field
GPUUtilization respjson.Field
MemoryUtilization respjson.Field
NetworkBandwidthMbps respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Average CPU, GPU, memory, and network utilization.
func (BetaEndpointAnalyticsResponseMetricsDeploymentMetricResourceUtilization) RawJSON ¶ added in v0.11.0
func (r BetaEndpointAnalyticsResponseMetricsDeploymentMetricResourceUtilization) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointAnalyticsResponseMetricsDeploymentMetricResourceUtilization) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAnalyticsResponseMetricsDeploymentMetricResourceUtilization) UnmarshalJSON(data []byte) error
type BetaEndpointAnalyticsResponseMetricsDeploymentMetricThroughputMetrics ¶ added in v0.11.0
type BetaEndpointAnalyticsResponseMetricsDeploymentMetricThroughputMetrics struct {
// Average number of batches queued or in flight in the serving engine.
AvgBatchDepth float64 `json:"avgBatchDepth"`
// Average number of requests processed in each runtime batch.
AvgBatchSize float64 `json:"avgBatchSize"`
// Average completed requests per second.
RequestsPerSecond float64 `json:"requestsPerSecond"`
// Average generated tokens per second.
TokensPerSecond float64 `json:"tokensPerSecond"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AvgBatchDepth respjson.Field
AvgBatchSize respjson.Field
RequestsPerSecond respjson.Field
TokensPerSecond respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Token, request, and batching throughput.
func (BetaEndpointAnalyticsResponseMetricsDeploymentMetricThroughputMetrics) RawJSON ¶ added in v0.11.0
func (r BetaEndpointAnalyticsResponseMetricsDeploymentMetricThroughputMetrics) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointAnalyticsResponseMetricsDeploymentMetricThroughputMetrics) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAnalyticsResponseMetricsDeploymentMetricThroughputMetrics) UnmarshalJSON(data []byte) error
type BetaEndpointAnalyticsResponseMetricsDeploymentMetricTimeRange ¶ added in v0.11.0
type BetaEndpointAnalyticsResponseMetricsDeploymentMetricTimeRange struct {
// Exclusive end of the time range.
EndTime time.Time `json:"endTime" format:"date-time"`
// Inclusive start of the time range.
StartTime time.Time `json:"startTime" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
EndTime respjson.Field
StartTime respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Closed-open time range covered by the metrics.
func (BetaEndpointAnalyticsResponseMetricsDeploymentMetricTimeRange) RawJSON ¶ added in v0.11.0
func (r BetaEndpointAnalyticsResponseMetricsDeploymentMetricTimeRange) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointAnalyticsResponseMetricsDeploymentMetricTimeRange) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAnalyticsResponseMetricsDeploymentMetricTimeRange) UnmarshalJSON(data []byte) error
type BetaEndpointAnalyticsResponseMetricsDeploymentMetricTokenMetrics ¶ added in v0.11.0
type BetaEndpointAnalyticsResponseMetricsDeploymentMetricTokenMetrics struct {
// Average input tokens per request.
AvgInputTokens float64 `json:"avgInputTokens"`
// Average output tokens per request.
AvgOutputTokens float64 `json:"avgOutputTokens"`
// Total input tokens processed during the time range.
TotalInputTokens string `json:"totalInputTokens"`
// Total output tokens generated during the time range.
TotalOutputTokens string `json:"totalOutputTokens"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AvgInputTokens respjson.Field
AvgOutputTokens respjson.Field
TotalInputTokens respjson.Field
TotalOutputTokens respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Input and output token totals and averages.
func (BetaEndpointAnalyticsResponseMetricsDeploymentMetricTokenMetrics) RawJSON ¶ added in v0.11.0
func (r BetaEndpointAnalyticsResponseMetricsDeploymentMetricTokenMetrics) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointAnalyticsResponseMetricsDeploymentMetricTokenMetrics) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAnalyticsResponseMetricsDeploymentMetricTokenMetrics) UnmarshalJSON(data []byte) error
type BetaEndpointAnalyticsResponseMetricsErrorMetrics ¶ added in v0.11.0
type BetaEndpointAnalyticsResponseMetricsErrorMetrics struct {
// Percentage in [0, 100].
ErrorRate float64 `json:"errorRate"`
// Counts of errors keyed by error type (e.g. HTTP status code or error kind).
ErrorsByType map[string]string `json:"errorsByType"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ErrorRate respjson.Field
ErrorsByType respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Error rate and counts by error type.
func (BetaEndpointAnalyticsResponseMetricsErrorMetrics) RawJSON ¶ added in v0.11.0
func (r BetaEndpointAnalyticsResponseMetricsErrorMetrics) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointAnalyticsResponseMetricsErrorMetrics) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAnalyticsResponseMetricsErrorMetrics) UnmarshalJSON(data []byte) error
type BetaEndpointAnalyticsResponseMetricsLatencyMetrics ¶ added in v0.11.0
type BetaEndpointAnalyticsResponseMetricsLatencyMetrics struct {
// 50th-percentile inter-token latency, in milliseconds.
ItlP50Ms float64 `json:"itlP50Ms"`
// 90th-percentile inter-token latency, in milliseconds.
ItlP90Ms float64 `json:"itlP90Ms"`
// 99th-percentile inter-token latency, in milliseconds.
ItlP99Ms float64 `json:"itlP99Ms"`
// 50th-percentile end-to-end request latency, in milliseconds.
LatencyP50Ms float64 `json:"latencyP50Ms"`
// 90th-percentile end-to-end request latency, in milliseconds.
LatencyP90Ms float64 `json:"latencyP90Ms"`
// 99th-percentile end-to-end request latency, in milliseconds.
LatencyP99Ms float64 `json:"latencyP99Ms"`
// 50th-percentile time to first token, in milliseconds.
TtftP50Ms float64 `json:"ttftP50Ms"`
// 90th-percentile time to first token, in milliseconds.
TtftP90Ms float64 `json:"ttftP90Ms"`
// 99th-percentile time to first token, in milliseconds.
TtftP99Ms float64 `json:"ttftP99Ms"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ItlP50Ms respjson.Field
ItlP90Ms respjson.Field
ItlP99Ms respjson.Field
LatencyP50Ms respjson.Field
LatencyP90Ms respjson.Field
LatencyP99Ms respjson.Field
TtftP50Ms respjson.Field
TtftP90Ms respjson.Field
TtftP99Ms respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Time-to-first-token, end-to-end, and inter-token latency percentiles.
func (BetaEndpointAnalyticsResponseMetricsLatencyMetrics) RawJSON ¶ added in v0.11.0
func (r BetaEndpointAnalyticsResponseMetricsLatencyMetrics) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointAnalyticsResponseMetricsLatencyMetrics) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAnalyticsResponseMetricsLatencyMetrics) UnmarshalJSON(data []byte) error
type BetaEndpointAnalyticsResponseMetricsRequestMetrics ¶ added in v0.11.0
type BetaEndpointAnalyticsResponseMetricsRequestMetrics struct {
// Requests that failed during the time range.
FailedRequests string `json:"failedRequests"`
// Request counts keyed by HTTP status code.
RequestsByStatusCode map[string]string `json:"requestsByStatusCode"`
// Average requests per second over the time range.
RequestsPerSecond float64 `json:"requestsPerSecond"`
// Requests completed successfully during the time range.
SuccessfulRequests string `json:"successfulRequests"`
// Total requests received during the time range.
TotalRequests string `json:"totalRequests"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
FailedRequests respjson.Field
RequestsByStatusCode respjson.Field
RequestsPerSecond respjson.Field
SuccessfulRequests respjson.Field
TotalRequests respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Request counts and rates.
func (BetaEndpointAnalyticsResponseMetricsRequestMetrics) RawJSON ¶ added in v0.11.0
func (r BetaEndpointAnalyticsResponseMetricsRequestMetrics) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointAnalyticsResponseMetricsRequestMetrics) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAnalyticsResponseMetricsRequestMetrics) UnmarshalJSON(data []byte) error
type BetaEndpointAnalyticsResponseMetricsResourceUtilization ¶ added in v0.11.0
type BetaEndpointAnalyticsResponseMetricsResourceUtilization struct {
// Average CPU utilization across replicas, as a percentage.
CPUUtilization float64 `json:"cpuUtilization"`
// Average GPU memory utilization across replicas, as a percentage.
GPUMemoryUtilization float64 `json:"gpuMemoryUtilization"`
// Average GPU compute utilization across replicas, as a percentage.
GPUUtilization float64 `json:"gpuUtilization"`
// Average system memory utilization across replicas, as a percentage.
MemoryUtilization float64 `json:"memoryUtilization"`
// Average network throughput across replicas, in megabits per second.
NetworkBandwidthMbps float64 `json:"networkBandwidthMbps"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CPUUtilization respjson.Field
GPUMemoryUtilization respjson.Field
GPUUtilization respjson.Field
MemoryUtilization respjson.Field
NetworkBandwidthMbps respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Average CPU, GPU, memory, and network utilization.
func (BetaEndpointAnalyticsResponseMetricsResourceUtilization) RawJSON ¶ added in v0.11.0
func (r BetaEndpointAnalyticsResponseMetricsResourceUtilization) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointAnalyticsResponseMetricsResourceUtilization) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAnalyticsResponseMetricsResourceUtilization) UnmarshalJSON(data []byte) error
type BetaEndpointAnalyticsResponseMetricsThroughputMetrics ¶ added in v0.11.0
type BetaEndpointAnalyticsResponseMetricsThroughputMetrics struct {
// Average number of batches queued or in flight in the serving engine.
AvgBatchDepth float64 `json:"avgBatchDepth"`
// Average number of requests processed in each runtime batch.
AvgBatchSize float64 `json:"avgBatchSize"`
// Average completed requests per second.
RequestsPerSecond float64 `json:"requestsPerSecond"`
// Average generated tokens per second.
TokensPerSecond float64 `json:"tokensPerSecond"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AvgBatchDepth respjson.Field
AvgBatchSize respjson.Field
RequestsPerSecond respjson.Field
TokensPerSecond respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Token, request, and batching throughput.
func (BetaEndpointAnalyticsResponseMetricsThroughputMetrics) RawJSON ¶ added in v0.11.0
func (r BetaEndpointAnalyticsResponseMetricsThroughputMetrics) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointAnalyticsResponseMetricsThroughputMetrics) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAnalyticsResponseMetricsThroughputMetrics) UnmarshalJSON(data []byte) error
type BetaEndpointAnalyticsResponseMetricsTimeRange ¶ added in v0.11.0
type BetaEndpointAnalyticsResponseMetricsTimeRange struct {
// Exclusive end of the time range.
EndTime time.Time `json:"endTime" format:"date-time"`
// Inclusive start of the time range.
StartTime time.Time `json:"startTime" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
EndTime respjson.Field
StartTime respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Closed-open time range used by metrics and analytics responses.
func (BetaEndpointAnalyticsResponseMetricsTimeRange) RawJSON ¶ added in v0.11.0
func (r BetaEndpointAnalyticsResponseMetricsTimeRange) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointAnalyticsResponseMetricsTimeRange) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAnalyticsResponseMetricsTimeRange) UnmarshalJSON(data []byte) error
type BetaEndpointAnalyticsResponseMetricsTokenMetrics ¶ added in v0.11.0
type BetaEndpointAnalyticsResponseMetricsTokenMetrics struct {
// Average input tokens per request.
AvgInputTokens float64 `json:"avgInputTokens"`
// Average output tokens per request.
AvgOutputTokens float64 `json:"avgOutputTokens"`
// Total input tokens processed during the time range.
TotalInputTokens string `json:"totalInputTokens"`
// Total output tokens generated during the time range.
TotalOutputTokens string `json:"totalOutputTokens"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AvgInputTokens respjson.Field
AvgOutputTokens respjson.Field
TotalInputTokens respjson.Field
TotalOutputTokens respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Input and output token totals and averages.
func (BetaEndpointAnalyticsResponseMetricsTokenMetrics) RawJSON ¶ added in v0.11.0
func (r BetaEndpointAnalyticsResponseMetricsTokenMetrics) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointAnalyticsResponseMetricsTokenMetrics) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAnalyticsResponseMetricsTokenMetrics) UnmarshalJSON(data []byte) error
type BetaEndpointAnalyticsResponseTimeRange ¶ added in v0.11.0
type BetaEndpointAnalyticsResponseTimeRange struct {
// Exclusive end of the time range.
EndTime time.Time `json:"endTime" format:"date-time"`
// Inclusive start of the time range.
StartTime time.Time `json:"startTime" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
EndTime respjson.Field
StartTime respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Closed-open time range covered by the analytics.
func (BetaEndpointAnalyticsResponseTimeRange) RawJSON ¶ added in v0.11.0
func (r BetaEndpointAnalyticsResponseTimeRange) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointAnalyticsResponseTimeRange) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAnalyticsResponseTimeRange) UnmarshalJSON(data []byte) error
type BetaEndpointAnalyticsResponseTimeSeries ¶ added in v0.11.0
type BetaEndpointAnalyticsResponseTimeSeries struct {
// Start time of the metric bucket.
Timestamp time.Time `json:"timestamp" format:"date-time"`
// Metric names mapped to their numeric values for this bucket.
Values map[string]float64 `json:"values"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Timestamp respjson.Field
Values respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Timestamped bucket containing one or more named metric values.
func (BetaEndpointAnalyticsResponseTimeSeries) RawJSON ¶ added in v0.11.0
func (r BetaEndpointAnalyticsResponseTimeSeries) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointAnalyticsResponseTimeSeries) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointAnalyticsResponseTimeSeries) UnmarshalJSON(data []byte) error
type BetaEndpointDeleteParams ¶ added in v0.11.0
type BetaEndpointDeleteParams struct {
// Project identifier.
//
// Use [option.WithProjectID] on the client to set a global default for this field.
ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
// Etag for optimistic concurrency. If set, the delete is rejected if the current
// etag does not match.
Etag param.Opt[string] `query:"etag,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (BetaEndpointDeleteParams) URLQuery ¶ added in v0.11.0
func (r BetaEndpointDeleteParams) URLQuery() (v url.Values, err error)
URLQuery serializes BetaEndpointDeleteParams's query parameters as `url.Values`.
type BetaEndpointDeleteResponse ¶ added in v0.11.0
type BetaEndpointDeleteResponse 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:"-"`
}
Empty response returned after a successful delete operation.
func (BetaEndpointDeleteResponse) RawJSON ¶ added in v0.11.0
func (r BetaEndpointDeleteResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointDeleteResponse) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointDeleteResponse) UnmarshalJSON(data []byte) error
type BetaEndpointDeploymentDeleteParams ¶ added in v0.11.0
type BetaEndpointDeploymentDeleteParams struct {
// Project identifier.
//
// Use [option.WithProjectID] on the client to set a global default for this field.
ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
// Endpoint identifier.
EndpointID string `path:"endpointId" api:"required" json:"-"`
// Etag for optimistic concurrency. If set, the delete is rejected if the current
// etag does not match.
Etag param.Opt[string] `query:"etag,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (BetaEndpointDeploymentDeleteParams) URLQuery ¶ added in v0.11.0
func (r BetaEndpointDeploymentDeleteParams) URLQuery() (v url.Values, err error)
URLQuery serializes BetaEndpointDeploymentDeleteParams's query parameters as `url.Values`.
type BetaEndpointDeploymentDeleteResponse ¶ added in v0.11.0
type BetaEndpointDeploymentDeleteResponse 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:"-"`
}
Empty response returned after a successful delete operation.
func (BetaEndpointDeploymentDeleteResponse) RawJSON ¶ added in v0.11.0
func (r BetaEndpointDeploymentDeleteResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointDeploymentDeleteResponse) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointDeploymentDeleteResponse) UnmarshalJSON(data []byte) error
type BetaEndpointDeploymentGetParams ¶ added in v0.11.0
type BetaEndpointDeploymentGetParams struct {
// Project identifier.
//
// Use [option.WithProjectID] on the client to set a global default for this field.
ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
// Endpoint identifier.
EndpointID string `path:"endpointId" api:"required" json:"-"`
// contains filtered or unexported fields
}
type BetaEndpointDeploymentListParams ¶ added in v0.11.0
type BetaEndpointDeploymentListParams struct {
// ID of the project that owns the endpoint.
//
// Use [option.WithProjectID] on the client to set a global default for this field.
ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
// Cursor from a previous deployment list response.
After param.Opt[string] `query:"after,omitzero" json:"-"`
// Filter expression using `name`, `state`, `model`, `created_at`, or `updated_at`
// with comparison operators and AND/OR/NOT; `state` takes a DeploymentState enum
// name and `model` takes a model resource name. `name` supports substring matching
// with `:` and prefix/suffix wildcards with `*`, and accepts a bare deployment
// name or `<project_slug>/<endpoint_name>/<deployment_name>`.
Filter param.Opt[string] `query:"filter,omitzero" json:"-"`
// Maximum number of deployments to return. Max 500, defaults to 50.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Sort field for the results. Supports `created_at` or `updated_at`, optionally
// followed by `asc` or `desc`.
OrderBy param.Opt[string] `query:"orderBy,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (BetaEndpointDeploymentListParams) URLQuery ¶ added in v0.11.0
func (r BetaEndpointDeploymentListParams) URLQuery() (v url.Values, err error)
URLQuery serializes BetaEndpointDeploymentListParams's query parameters as `url.Values`.
type BetaEndpointDeploymentNewParams ¶ added in v0.11.0
type BetaEndpointDeploymentNewParams struct {
// ID of the project that owns the endpoint.
//
// Use [option.WithProjectID] on the client to set a global default for this field.
ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
// Autoscaling configuration for a deployment.
Autoscaling DeploymentAutoscalingParam `json:"autoscaling,omitzero" api:"required"`
// Name for the deployment within its endpoint. Returned as a fully-qualified
// endpoint string.
Name string `json:"name" api:"required"`
// When true, validates the request without creating or provisioning a deployment.
ValidateOnly param.Opt[bool] `query:"validateOnly,omitzero" json:"-"`
// Immutable config revision in the form
// `projects/{projectId}/configs/{configRevisionId}`. The config must be compatible
// with the model.
Config param.Opt[string] `json:"config,omitzero"`
// Deprecated. Use `config`. Config revision identifier to deploy, accepted when
// `config` is unset.
ConfigID param.Opt[string] `json:"configId,omitzero"`
// Enables dynamic loading of LoRA adapters on the deployment.
EnableLora param.Opt[bool] `json:"enableLora,omitzero"`
// Model resource name in the form
// `projects/{projectId}/models/{modelId}[/revisions/{revisionId}]`. Omit the
// revision segment to pin the latest revision at creation time.
Model param.Opt[string] `json:"model,omitzero"`
// Deprecated. Use `model`. Model identifier to serve, accepted when `model` is
// unset.
ModelID param.Opt[string] `json:"modelId,omitzero"`
// Deprecated. Use `model` with a /revisions/{revisionId} segment. If omitted, the
// latest revision is resolved at creation.
ModelRevisionID param.Opt[string] `json:"modelRevisionId,omitzero"`
// Placement controls where a deployment is scheduled.
Placement BetaEndpointDeploymentNewParamsPlacementUnion `json:"placement,omitzero"`
// contains filtered or unexported fields
}
func (BetaEndpointDeploymentNewParams) MarshalJSON ¶ added in v0.11.0
func (r BetaEndpointDeploymentNewParams) MarshalJSON() (data []byte, err error)
func (BetaEndpointDeploymentNewParams) URLQuery ¶ added in v0.11.0
func (r BetaEndpointDeploymentNewParams) URLQuery() (v url.Values, err error)
URLQuery serializes BetaEndpointDeploymentNewParams's query parameters as `url.Values`.
func (*BetaEndpointDeploymentNewParams) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointDeploymentNewParams) UnmarshalJSON(data []byte) error
type BetaEndpointDeploymentNewParamsPlacementInline ¶ added in v0.11.0
type BetaEndpointDeploymentNewParamsPlacementInline struct {
// Inline placement parameters expanded into scheduling rules by the server.
Inline DeploymentPlacementConfigParam `json:"inline,omitzero" api:"required"`
// contains filtered or unexported fields
}
The property Inline is required.
func (BetaEndpointDeploymentNewParamsPlacementInline) MarshalJSON ¶ added in v0.11.0
func (r BetaEndpointDeploymentNewParamsPlacementInline) MarshalJSON() (data []byte, err error)
func (*BetaEndpointDeploymentNewParamsPlacementInline) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointDeploymentNewParamsPlacementInline) UnmarshalJSON(data []byte) error
type BetaEndpointDeploymentNewParamsPlacementProfile ¶ added in v0.11.0
type BetaEndpointDeploymentNewParamsPlacementProfile struct {
// UID of a saved placement profile.
Profile string `json:"profile" api:"required"`
// contains filtered or unexported fields
}
The property Profile is required.
func (BetaEndpointDeploymentNewParamsPlacementProfile) MarshalJSON ¶ added in v0.11.0
func (r BetaEndpointDeploymentNewParamsPlacementProfile) MarshalJSON() (data []byte, err error)
func (*BetaEndpointDeploymentNewParamsPlacementProfile) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointDeploymentNewParamsPlacementProfile) UnmarshalJSON(data []byte) error
type BetaEndpointDeploymentNewParamsPlacementUnion ¶ added in v0.11.0
type BetaEndpointDeploymentNewParamsPlacementUnion struct {
OfInline *BetaEndpointDeploymentNewParamsPlacementInline `json:",omitzero,inline"`
OfProfile *BetaEndpointDeploymentNewParamsPlacementProfile `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 (BetaEndpointDeploymentNewParamsPlacementUnion) MarshalJSON ¶ added in v0.11.0
func (u BetaEndpointDeploymentNewParamsPlacementUnion) MarshalJSON() ([]byte, error)
func (*BetaEndpointDeploymentNewParamsPlacementUnion) UnmarshalJSON ¶ added in v0.11.0
func (u *BetaEndpointDeploymentNewParamsPlacementUnion) UnmarshalJSON(data []byte) error
type BetaEndpointDeploymentService ¶ added in v0.11.0
type BetaEndpointDeploymentService struct {
Options []option.RequestOption
}
BetaEndpointDeploymentService 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 NewBetaEndpointDeploymentService method instead.
func NewBetaEndpointDeploymentService ¶ added in v0.11.0
func NewBetaEndpointDeploymentService(opts ...option.RequestOption) (r BetaEndpointDeploymentService)
NewBetaEndpointDeploymentService 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 (*BetaEndpointDeploymentService) Delete ¶ added in v0.11.0
func (r *BetaEndpointDeploymentService) Delete(ctx context.Context, id string, params BetaEndpointDeploymentDeleteParams, opts ...option.RequestOption) (res *BetaEndpointDeploymentDeleteResponse, err error)
Permanently deletes a deployment from its endpoint. Remove the deployment from live traffic first; use `etag` to reject the request if it changed after it was read.
func (*BetaEndpointDeploymentService) Get ¶ added in v0.11.0
func (r *BetaEndpointDeploymentService) Get(ctx context.Context, id string, query BetaEndpointDeploymentGetParams, opts ...option.RequestOption) (res *EndpointDeployment, err error)
Retrieves a deployment's desired configuration, placement, runtime information, and current provisioning status.
func (*BetaEndpointDeploymentService) List ¶ added in v0.11.0
func (r *BetaEndpointDeploymentService) List(ctx context.Context, endpointID string, params BetaEndpointDeploymentListParams, opts ...option.RequestOption) (res *pagination.CursorPagination[EndpointDeployment], err error)
Lists the deployments attached to an endpoint, including their model, configuration, scaling settings, placement, and current status.
func (*BetaEndpointDeploymentService) ListAutoPaging ¶ added in v0.11.0
func (r *BetaEndpointDeploymentService) ListAutoPaging(ctx context.Context, endpointID string, params BetaEndpointDeploymentListParams, opts ...option.RequestOption) *pagination.CursorPaginationAutoPager[EndpointDeployment]
Lists the deployments attached to an endpoint, including their model, configuration, scaling settings, placement, and current status.
func (*BetaEndpointDeploymentService) New ¶ added in v0.11.0
func (r *BetaEndpointDeploymentService) New(ctx context.Context, endpointID string, params BetaEndpointDeploymentNewParams, opts ...option.RequestOption) (res *EndpointDeployment, err error)
Creates a model deployment under an endpoint. The deployment provisions asynchronously; monitor its status before routing live traffic to it.
func (*BetaEndpointDeploymentService) Update ¶ added in v0.11.0
func (r *BetaEndpointDeploymentService) Update(ctx context.Context, id string, params BetaEndpointDeploymentUpdateParams, opts ...option.RequestOption) (res *EndpointDeployment, err error)
Updates mutable deployment fields such as its model, configuration, autoscaling bounds, or LoRA support. Changes that affect serving may trigger asynchronous reprovisioning.
type BetaEndpointDeploymentUpdateParams ¶ added in v0.11.0
type BetaEndpointDeploymentUpdateParams struct {
// Project identifier.
//
// Use [option.WithProjectID] on the client to set a global default for this field.
ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
// Endpoint identifier.
EndpointID string `path:"endpointId" api:"required" json:"-"`
// Fields to update. If not set, the fields populated on `deployment` are updated.
UpdateMask param.Opt[string] `query:"updateMask,omitzero" json:"-"`
// Current deployment version. The update is rejected if this value no longer
// matches.
Etag param.Opt[string] `json:"etag,omitzero"`
// Updated endpoint string.
Name param.Opt[string] `json:"name,omitzero"`
// Autoscaling configuration for a deployment.
Autoscaling DeploymentAutoscalingParam `json:"autoscaling,omitzero"`
// contains filtered or unexported fields
}
func (BetaEndpointDeploymentUpdateParams) MarshalJSON ¶ added in v0.11.0
func (r BetaEndpointDeploymentUpdateParams) MarshalJSON() (data []byte, err error)
func (BetaEndpointDeploymentUpdateParams) URLQuery ¶ added in v0.11.0
func (r BetaEndpointDeploymentUpdateParams) URLQuery() (v url.Values, err error)
URLQuery serializes BetaEndpointDeploymentUpdateParams's query parameters as `url.Values`.
func (*BetaEndpointDeploymentUpdateParams) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointDeploymentUpdateParams) UnmarshalJSON(data []byte) error
type BetaEndpointGetParams ¶ added in v0.11.0
type BetaEndpointHardwareListResponse ¶ added in v0.11.0
type BetaEndpointHardwareListResponse struct {
// Instance types available for inference.
Data []InferenceInstanceType `json:"data" api:"required"`
// Object type. Always `list`.
Object constant.List `json:"object" default:"list"`
// Cursor for the next page. Always null today because this catalog is returned in
// full.
NextCursor string `json:"next_cursor"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Object respjson.Field
NextCursor respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Hardware instance types available for inference deployments.
func (BetaEndpointHardwareListResponse) RawJSON ¶ added in v0.11.0
func (r BetaEndpointHardwareListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointHardwareListResponse) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointHardwareListResponse) UnmarshalJSON(data []byte) error
type BetaEndpointHardwareService ¶ added in v0.11.0
type BetaEndpointHardwareService struct {
Options []option.RequestOption
}
BetaEndpointHardwareService 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 NewBetaEndpointHardwareService method instead.
func NewBetaEndpointHardwareService ¶ added in v0.11.0
func NewBetaEndpointHardwareService(opts ...option.RequestOption) (r BetaEndpointHardwareService)
NewBetaEndpointHardwareService 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 (*BetaEndpointHardwareService) Get ¶ added in v0.11.0
func (r *BetaEndpointHardwareService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *InferenceInstanceType, err error)
Retrieves the GPU resources, pricing, regional availability, and best-effort capacity headroom for one inference instance type.
func (*BetaEndpointHardwareService) List ¶ added in v0.11.0
func (r *BetaEndpointHardwareService) List(ctx context.Context, opts ...option.RequestOption) (res *BetaEndpointHardwareListResponse, err error)
Lists hardware instance types currently available to inference deployments, including GPU resources, pricing, regions, and best-effort capacity headroom.
type BetaEndpointListEventsParams ¶ added in v0.11.0
type BetaEndpointListEventsParams struct {
// Project identifier.
//
// Use [option.WithProjectID] on the client to set a global default for this field.
ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
// Cursor from a previous endpoint event list response.
After param.Opt[string] `query:"after,omitzero" json:"-"`
// Maximum number of events to return. Max 10000, defaults to 50.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Return only events at or after this time.
Since param.Opt[time.Time] `query:"since,omitzero" format:"date-time" json:"-"`
// ID of a subject associated with the event, such as a rollout. Combined with
// other filters using AND.
SubjectID param.Opt[string] `query:"subjectId,omitzero" json:"-"`
// Return only events strictly before this time.
Until param.Opt[time.Time] `query:"until,omitzero" format:"date-time" json:"-"`
// Deployment IDs whose events should be included. Every ID must belong to the
// endpoint. Supplying this filter excludes endpoint-scoped events unless
// `SOURCE_KIND_ENDPOINT` is also included in `sourceKinds`.
DeploymentIDs []string `query:"deploymentIds,omitzero" json:"-"`
// Minimum severity. Omit to disable severity filtering.
//
// Any of "LEVEL_DEBUG", "LEVEL_INFO", "LEVEL_WARN", "LEVEL_ERROR".
MinLevel BetaEndpointListEventsParamsMinLevel `query:"minLevel,omitzero" json:"-"`
// Resource kinds whose events should be included. Omit to include both endpoint-
// and deployment-scoped events.
//
// Any of "SOURCE_KIND_ENDPOINT", "SOURCE_KIND_DEPLOYMENT".
SourceKinds []string `query:"sourceKinds,omitzero" json:"-"`
// Event types to include, such as `deployment.scaled` or `condition.set`. Combined
// with other filters using AND.
Types []string `query:"types,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (BetaEndpointListEventsParams) URLQuery ¶ added in v0.11.0
func (r BetaEndpointListEventsParams) URLQuery() (v url.Values, err error)
URLQuery serializes BetaEndpointListEventsParams's query parameters as `url.Values`.
type BetaEndpointListEventsParamsMinLevel ¶ added in v0.11.0
type BetaEndpointListEventsParamsMinLevel string
Minimum severity. Omit to disable severity filtering.
const ( BetaEndpointListEventsParamsMinLevelLevelDebug BetaEndpointListEventsParamsMinLevel = "LEVEL_DEBUG" BetaEndpointListEventsParamsMinLevelLevelInfo BetaEndpointListEventsParamsMinLevel = "LEVEL_INFO" BetaEndpointListEventsParamsMinLevelLevelWarn BetaEndpointListEventsParamsMinLevel = "LEVEL_WARN" BetaEndpointListEventsParamsMinLevelLevelError BetaEndpointListEventsParamsMinLevel = "LEVEL_ERROR" )
type BetaEndpointListEventsResponse ¶ added in v0.11.0
type BetaEndpointListEventsResponse struct {
// Output only. Unique event identifier.
ID string `json:"id" api:"required"`
// Output only. Event creation time.
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
// Output only. The endpoint this event belongs to. Always set.
EndpointID string `json:"endpointId" api:"required"`
// Output only. Severity level.
//
// Any of "LEVEL_DEBUG", "LEVEL_INFO", "LEVEL_WARN", "LEVEL_ERROR".
Level BetaEndpointListEventsResponseLevel `json:"level" api:"required"`
// Output only. Service, cluster, or controller that emitted the event.
Source string `json:"source" api:"required"`
// Output only. Whether this row describes the endpoint or one of its deployments.
//
// Any of "SOURCE_KIND_ENDPOINT", "SOURCE_KIND_DEPLOYMENT".
SourceKind BetaEndpointListEventsResponseSourceKind `json:"sourceKind" api:"required"`
// Output only. Stable event type, such as `endpoint.updated`,
// `deployment.created`, `deployment.scaled`, `condition.set`, or `pod.log`.
Type string `json:"type" api:"required"`
// ID of the cluster associated with a cluster-scoped event.
ClusterID string `json:"clusterId"`
// Stable public component label associated with a replica event, such as `engine`,
// `model-download`, or `sidecar`.
ContainerName string `json:"containerName"`
// Output only. Deployment associated with the event when `sourceKind` is
// `SOURCE_KIND_DEPLOYMENT`.
DeploymentID string `json:"deploymentId"`
// Short diagnostic log excerpt captured with a pod event, for example during a
// crash, out-of-memory termination, or image pull failure. This field is truncated
// and is not a streaming log API.
LogExcerpt string `json:"logExcerpt"`
// Output only. Human-readable description of the event. Short and stable; not
// structured data.
Message string `json:"message"`
// Resource name at the time of the event. Populated by: deployment.created,
// deployment.deleted, endpoint.created, endpoint.deleted
Name string `json:"name"`
// New replica count for a `deployment.scaled` event.
NewReplicas int64 `json:"newReplicas"`
// Opaque node handle for correlating replica failures on the same node. Omitted
// when the replica is unscheduled or the node is unknown.
NodeID string `json:"nodeId"`
// Replica-count transition. Populated by: deployment.scaled
OldReplicas int64 `json:"oldReplicas"`
// Field-mask paths that were modified. Populated by: deployment.updated,
// endpoint.updated
Paths []string `json:"paths"`
// Stable condition reason, such as `AllReplicasReady`, `ReplicasProgressing`, or
// `ApplySuccessful`.
Reason string `json:"reason"`
// Opaque replica identity associated with a `pod.*` event, stable for grouping
// events from the same replica.
ReplicaID string `json:"replicaId"`
// Deployment subservice associated with the event, such as `model-deployment` or
// `speculator-deployment`.
ServiceType string `json:"serviceType"`
// Condition status for `condition.set` and `cluster_condition.set`: `True`,
// `False`, or `Unknown`. The condition type is carried in `subjectId`.
Status string `json:"status"`
// Output only. ID of the event's subject, such as a rollout, shadow target, or
// condition type.
SubjectID string `json:"subjectId"`
// Target version. Populated by `target.created`; the target ID is carried in
// `subjectId`.
Version int64 `json:"version"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
EndpointID respjson.Field
Level respjson.Field
Source respjson.Field
SourceKind respjson.Field
Type respjson.Field
ClusterID respjson.Field
ContainerName respjson.Field
DeploymentID respjson.Field
LogExcerpt respjson.Field
Message respjson.Field
Name respjson.Field
NewReplicas respjson.Field
NodeID respjson.Field
OldReplicas respjson.Field
Paths respjson.Field
Reason respjson.Field
ReplicaID respjson.Field
ServiceType respjson.Field
Status respjson.Field
SubjectID respjson.Field
Version respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
One endpoint- or deployment-scoped entry in an endpoint's combined audit and lifecycle feed.
func (BetaEndpointListEventsResponse) RawJSON ¶ added in v0.11.0
func (r BetaEndpointListEventsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointListEventsResponse) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointListEventsResponse) UnmarshalJSON(data []byte) error
type BetaEndpointListEventsResponseLevel ¶ added in v0.11.0
type BetaEndpointListEventsResponseLevel string
Output only. Severity level.
const ( BetaEndpointListEventsResponseLevelLevelDebug BetaEndpointListEventsResponseLevel = "LEVEL_DEBUG" BetaEndpointListEventsResponseLevelLevelInfo BetaEndpointListEventsResponseLevel = "LEVEL_INFO" BetaEndpointListEventsResponseLevelLevelWarn BetaEndpointListEventsResponseLevel = "LEVEL_WARN" BetaEndpointListEventsResponseLevelLevelError BetaEndpointListEventsResponseLevel = "LEVEL_ERROR" )
type BetaEndpointListEventsResponseSourceKind ¶ added in v0.11.0
type BetaEndpointListEventsResponseSourceKind string
Output only. Whether this row describes the endpoint or one of its deployments.
const ( BetaEndpointListEventsResponseSourceKindSourceKindEndpoint BetaEndpointListEventsResponseSourceKind = "SOURCE_KIND_ENDPOINT" BetaEndpointListEventsResponseSourceKindSourceKindDeployment BetaEndpointListEventsResponseSourceKind = "SOURCE_KIND_DEPLOYMENT" )
type BetaEndpointListOrgScopedParams ¶ added in v0.11.0
type BetaEndpointListOrgScopedParams struct {
// Cursor from a previous list response.
After param.Opt[string] `query:"after,omitzero" json:"-"`
// Filter expression using `name`, `created_at`, or `updated_at` with comparison
// operators and AND/OR/NOT; timestamps must be RFC 3339 strings. `name` supports
// substring matching with `:` and prefix/suffix wildcards with `*`, and must be a
// bare endpoint name.
Filter param.Opt[string] `query:"filter,omitzero" json:"-"`
// Maximum number of results to return.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Sort field for the results. Supports `created_at` or `updated_at`, optionally
// followed by `asc` or `desc`.
OrderBy param.Opt[string] `query:"orderBy,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (BetaEndpointListOrgScopedParams) URLQuery ¶ added in v0.11.0
func (r BetaEndpointListOrgScopedParams) URLQuery() (v url.Values, err error)
URLQuery serializes BetaEndpointListOrgScopedParams's query parameters as `url.Values`.
type BetaEndpointListParams ¶ added in v0.11.0
type BetaEndpointListParams struct {
// Project identifier.
//
// Use [option.WithProjectID] on the client to set a global default for this field.
ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
// Cursor from a previous response.
After param.Opt[string] `query:"after,omitzero" json:"-"`
// Filter expression using `name`, `created_at`, or `updated_at` with comparison
// operators and AND/OR/NOT; timestamps must be RFC 3339 strings. `name` supports
// substring matching with `:` and prefix/suffix wildcards with `*`, and accepts a
// bare endpoint name or `<project_slug>/<endpoint_name>`.
Filter param.Opt[string] `query:"filter,omitzero" json:"-"`
// Maximum number of endpoints to return.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Sort field for the results. Supports `created_at` or `updated_at`, optionally
// followed by `asc` or `desc`.
OrderBy param.Opt[string] `query:"orderBy,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (BetaEndpointListParams) URLQuery ¶ added in v0.11.0
func (r BetaEndpointListParams) URLQuery() (v url.Values, err error)
URLQuery serializes BetaEndpointListParams's query parameters as `url.Values`.
type BetaEndpointNewParams ¶ added in v0.11.0
type BetaEndpointNewParams struct {
// Project identifier.
//
// Use [option.WithProjectID] on the client to set a global default for this field.
ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
// Inference-addressable endpoint name to create.
Name string `json:"name" api:"required"`
// Who can discover the endpoint. `VISIBILITY_PRIVATE` restricts it to the project;
// `VISIBILITY_INTERNAL` shares it with the organization.
//
// Any of "VISIBILITY_PRIVATE", "VISIBILITY_INTERNAL".
Visibility BetaEndpointNewParamsVisibility `json:"visibility,omitzero"`
// contains filtered or unexported fields
}
func (BetaEndpointNewParams) MarshalJSON ¶ added in v0.11.0
func (r BetaEndpointNewParams) MarshalJSON() (data []byte, err error)
func (*BetaEndpointNewParams) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointNewParams) UnmarshalJSON(data []byte) error
type BetaEndpointNewParamsVisibility ¶ added in v0.11.0
type BetaEndpointNewParamsVisibility string
Who can discover the endpoint. `VISIBILITY_PRIVATE` restricts it to the project; `VISIBILITY_INTERNAL` shares it with the organization.
const ( BetaEndpointNewParamsVisibilityVisibilityPrivate BetaEndpointNewParamsVisibility = "VISIBILITY_PRIVATE" BetaEndpointNewParamsVisibilityVisibilityInternal BetaEndpointNewParamsVisibility = "VISIBILITY_INTERNAL" )
type BetaEndpointPlacementProfileGetParams ¶ added in v0.11.0
type BetaEndpointPlacementProfileListParams ¶ added in v0.11.0
type BetaEndpointPlacementProfileListParams struct {
// Project identifier.
//
// Use [option.WithProjectID] on the client to set a global default for this field.
ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
// Cursor from a previous placement profile list response.
After param.Opt[string] `query:"after,omitzero" json:"-"`
// Maximum number of profiles to return. Max 500, defaults to 50.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (BetaEndpointPlacementProfileListParams) URLQuery ¶ added in v0.11.0
func (r BetaEndpointPlacementProfileListParams) URLQuery() (v url.Values, err error)
URLQuery serializes BetaEndpointPlacementProfileListParams's query parameters as `url.Values`.
type BetaEndpointPlacementProfileService ¶ added in v0.11.0
type BetaEndpointPlacementProfileService struct {
Options []option.RequestOption
}
BetaEndpointPlacementProfileService 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 NewBetaEndpointPlacementProfileService method instead.
func NewBetaEndpointPlacementProfileService ¶ added in v0.11.0
func NewBetaEndpointPlacementProfileService(opts ...option.RequestOption) (r BetaEndpointPlacementProfileService)
NewBetaEndpointPlacementProfileService 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 (*BetaEndpointPlacementProfileService) Get ¶ added in v0.11.0
func (r *BetaEndpointPlacementProfileService) Get(ctx context.Context, id string, query BetaEndpointPlacementProfileGetParams, opts ...option.RequestOption) (res *PlacementProfile, err error)
Retrieves a reusable placement profile and its ordered region preferences.
func (*BetaEndpointPlacementProfileService) List ¶ added in v0.11.0
func (r *BetaEndpointPlacementProfileService) List(ctx context.Context, params BetaEndpointPlacementProfileListParams, opts ...option.RequestOption) (res *pagination.CursorPagination[PlacementProfile], err error)
Lists reusable, project-visible placement policies that control the regions where deployments may be scheduled.
func (*BetaEndpointPlacementProfileService) ListAutoPaging ¶ added in v0.11.0
func (r *BetaEndpointPlacementProfileService) ListAutoPaging(ctx context.Context, params BetaEndpointPlacementProfileListParams, opts ...option.RequestOption) *pagination.CursorPaginationAutoPager[PlacementProfile]
Lists reusable, project-visible placement policies that control the regions where deployments may be scheduled.
type BetaEndpointService ¶ added in v0.11.0
type BetaEndpointService struct {
Options []option.RequestOption
PlacementProfiles BetaEndpointPlacementProfileService
AbExperiments BetaEndpointAbExperimentService
ShadowExperiments BetaEndpointShadowExperimentService
Hardware BetaEndpointHardwareService
Adapters BetaEndpointAdapterService
Deployments BetaEndpointDeploymentService
}
BetaEndpointService 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 NewBetaEndpointService method instead.
func NewBetaEndpointService ¶ added in v0.11.0
func NewBetaEndpointService(opts ...option.RequestOption) (r BetaEndpointService)
NewBetaEndpointService 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 (*BetaEndpointService) Analytics ¶ added in v0.11.0
func (r *BetaEndpointService) Analytics(ctx context.Context, id string, params BetaEndpointAnalyticsParams, opts ...option.RequestOption) (res *BetaEndpointAnalyticsResponse, err error)
Returns aggregated request, token, latency, throughput, error, and resource-utilization metrics for an endpoint over a time range. Optionally includes time-series buckets and a per-deployment breakdown.
func (*BetaEndpointService) Delete ¶ added in v0.11.0
func (r *BetaEndpointService) Delete(ctx context.Context, id string, params BetaEndpointDeleteParams, opts ...option.RequestOption) (res *BetaEndpointDeleteResponse, err error)
Permanently deletes an endpoint. Delete its deployments first; use `etag` to reject the request if the endpoint changed after it was read.
func (*BetaEndpointService) Get ¶ added in v0.11.0
func (r *BetaEndpointService) Get(ctx context.Context, id string, query BetaEndpointGetParams, opts ...option.RequestOption) (res *Endpoint, err error)
Retrieves an endpoint and lightweight summaries of the deployments attached to it.
func (*BetaEndpointService) List ¶ added in v0.11.0
func (r *BetaEndpointService) List(ctx context.Context, params BetaEndpointListParams, opts ...option.RequestOption) (res *pagination.CursorPagination[Endpoint], err error)
Lists the dedicated inference endpoints owned by the specified project.
func (*BetaEndpointService) ListAutoPaging ¶ added in v0.11.0
func (r *BetaEndpointService) ListAutoPaging(ctx context.Context, params BetaEndpointListParams, opts ...option.RequestOption) *pagination.CursorPaginationAutoPager[Endpoint]
Lists the dedicated inference endpoints owned by the specified project.
func (*BetaEndpointService) ListEvents ¶ added in v0.11.0
func (r *BetaEndpointService) ListEvents(ctx context.Context, id string, params BetaEndpointListEventsParams, opts ...option.RequestOption) (res *pagination.CursorPagination[BetaEndpointListEventsResponse], err error)
Lists an endpoint's audit and lifecycle events newest first. The feed combines endpoint changes with provisioning, scaling, readiness, rollout, and other events from deployments under the endpoint.
func (*BetaEndpointService) ListEventsAutoPaging ¶ added in v0.11.0
func (r *BetaEndpointService) ListEventsAutoPaging(ctx context.Context, id string, params BetaEndpointListEventsParams, opts ...option.RequestOption) *pagination.CursorPaginationAutoPager[BetaEndpointListEventsResponse]
Lists an endpoint's audit and lifecycle events newest first. The feed combines endpoint changes with provisioning, scaling, readiness, rollout, and other events from deployments under the endpoint.
func (*BetaEndpointService) ListOrgScoped ¶ added in v0.11.0
func (r *BetaEndpointService) ListOrgScoped(ctx context.Context, organizationID string, query BetaEndpointListOrgScopedParams, opts ...option.RequestOption) (res *pagination.CursorPagination[Endpoint], err error)
Lists endpoints shared with every project in the specified organization. Project-private and public endpoints are not included.
func (*BetaEndpointService) ListOrgScopedAutoPaging ¶ added in v0.11.0
func (r *BetaEndpointService) ListOrgScopedAutoPaging(ctx context.Context, organizationID string, query BetaEndpointListOrgScopedParams, opts ...option.RequestOption) *pagination.CursorPaginationAutoPager[Endpoint]
Lists endpoints shared with every project in the specified organization. Project-private and public endpoints are not included.
func (*BetaEndpointService) New ¶ added in v0.11.0
func (r *BetaEndpointService) New(ctx context.Context, params BetaEndpointNewParams, opts ...option.RequestOption) (res *Endpoint, err error)
Creates a stable, inference-addressable endpoint. Add one or more deployments and configure its traffic split before sending inference requests to the endpoint name.
func (*BetaEndpointService) Update ¶ added in v0.11.0
func (r *BetaEndpointService) Update(ctx context.Context, id string, params BetaEndpointUpdateParams, opts ...option.RequestOption) (res *Endpoint, err error)
Updates mutable endpoint fields such as its endpoint string, visibility, or deployment traffic split. Use `updateMask` to select fields explicitly and `etag` in the request body for optimistic concurrency.
type BetaEndpointShadowExperimentDeleteParams ¶ added in v0.11.0
type BetaEndpointShadowExperimentDeleteParams struct {
// Project identifier.
//
// Use [option.WithProjectID] on the client to set a global default for this field.
ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
// Endpoint identifier.
EndpointID string `path:"endpointId" api:"required" json:"-"`
// Etag for optimistic concurrency.
Etag param.Opt[string] `query:"etag,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (BetaEndpointShadowExperimentDeleteParams) URLQuery ¶ added in v0.11.0
func (r BetaEndpointShadowExperimentDeleteParams) URLQuery() (v url.Values, err error)
URLQuery serializes BetaEndpointShadowExperimentDeleteParams's query parameters as `url.Values`.
type BetaEndpointShadowExperimentDeleteResponse ¶ added in v0.11.0
type BetaEndpointShadowExperimentDeleteResponse 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:"-"`
}
Empty response returned after a successful delete operation.
func (BetaEndpointShadowExperimentDeleteResponse) RawJSON ¶ added in v0.11.0
func (r BetaEndpointShadowExperimentDeleteResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointShadowExperimentDeleteResponse) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointShadowExperimentDeleteResponse) UnmarshalJSON(data []byte) error
type BetaEndpointShadowExperimentGetParams ¶ added in v0.11.0
type BetaEndpointShadowExperimentGetParams struct {
// Project identifier.
//
// Use [option.WithProjectID] on the client to set a global default for this field.
ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
// Endpoint identifier.
EndpointID string `path:"endpointId" api:"required" json:"-"`
// contains filtered or unexported fields
}
type BetaEndpointShadowExperimentListParams ¶ added in v0.11.0
type BetaEndpointShadowExperimentListParams struct {
// Project identifier.
//
// Use [option.WithProjectID] on the client to set a global default for this field.
ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
// Cursor from a previous shadow experiment list response.
After param.Opt[string] `query:"after,omitzero" json:"-"`
// Whether to include target deployments in each returned shadow experiment.
IncludeTargets param.Opt[bool] `query:"includeTargets,omitzero" json:"-"`
// Maximum number of shadow experiments to return. Max 500, defaults to 50.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (BetaEndpointShadowExperimentListParams) URLQuery ¶ added in v0.11.0
func (r BetaEndpointShadowExperimentListParams) URLQuery() (v url.Values, err error)
URLQuery serializes BetaEndpointShadowExperimentListParams's query parameters as `url.Values`.
type BetaEndpointShadowExperimentNewParams ¶ added in v0.11.0
type BetaEndpointShadowExperimentNewParams struct {
// Project identifier.
//
// Use [option.WithProjectID] on the client to set a global default for this field.
ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
// Human-readable shadow experiment name, unique within the endpoint. At most 256
// characters.
Name string `json:"name" api:"required"`
// Traffic source for a shadow experiment. The public API supports endpoint sources
// only.
Source ShadowSourceParam `json:"source,omitzero" api:"required"`
// Optional initial target deployments. At most 100 targets; manage later changes
// through the target APIs.
Targets []BetaEndpointShadowExperimentNewParamsTarget `json:"targets,omitzero"`
// contains filtered or unexported fields
}
func (BetaEndpointShadowExperimentNewParams) MarshalJSON ¶ added in v0.11.0
func (r BetaEndpointShadowExperimentNewParams) MarshalJSON() (data []byte, err error)
func (*BetaEndpointShadowExperimentNewParams) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointShadowExperimentNewParams) UnmarshalJSON(data []byte) error
type BetaEndpointShadowExperimentNewParamsTarget ¶ added in v0.11.0
type BetaEndpointShadowExperimentNewParamsTarget struct {
// Human-readable target name, unique within the shadow experiment. At most 256
// characters.
Name string `json:"name" api:"required"`
// Deployment under the parent endpoint that receives mirrored traffic. Exclude it
// from the endpoint's live traffic split.
TargetDeploymentID string `json:"targetDeploymentId" api:"required"`
// Optional free-form target description.
Description param.Opt[string] `json:"description,omitzero"`
// contains filtered or unexported fields
}
Deployment under the parent endpoint that should receive mirrored requests from a shadow experiment.
The properties Name, TargetDeploymentID are required.
func (BetaEndpointShadowExperimentNewParamsTarget) MarshalJSON ¶ added in v0.11.0
func (r BetaEndpointShadowExperimentNewParamsTarget) MarshalJSON() (data []byte, err error)
func (*BetaEndpointShadowExperimentNewParamsTarget) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointShadowExperimentNewParamsTarget) UnmarshalJSON(data []byte) error
type BetaEndpointShadowExperimentService ¶ added in v0.11.0
type BetaEndpointShadowExperimentService struct {
Options []option.RequestOption
Targets BetaEndpointShadowExperimentTargetService
}
BetaEndpointShadowExperimentService 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 NewBetaEndpointShadowExperimentService method instead.
func NewBetaEndpointShadowExperimentService ¶ added in v0.11.0
func NewBetaEndpointShadowExperimentService(opts ...option.RequestOption) (r BetaEndpointShadowExperimentService)
NewBetaEndpointShadowExperimentService 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 (*BetaEndpointShadowExperimentService) Delete ¶ added in v0.11.0
func (r *BetaEndpointShadowExperimentService) Delete(ctx context.Context, id string, params BetaEndpointShadowExperimentDeleteParams, opts ...option.RequestOption) (res *BetaEndpointShadowExperimentDeleteResponse, err error)
Deletes a shadow experiment and its target records. The underlying deployments are not deleted.
func (*BetaEndpointShadowExperimentService) Get ¶ added in v0.11.0
func (r *BetaEndpointShadowExperimentService) Get(ctx context.Context, id string, query BetaEndpointShadowExperimentGetParams, opts ...option.RequestOption) (res *ShadowExperiment, err error)
Retrieves a shadow experiment, including its sampling strategy and target deployments.
func (*BetaEndpointShadowExperimentService) List ¶ added in v0.11.0
func (r *BetaEndpointShadowExperimentService) List(ctx context.Context, endpointID string, params BetaEndpointShadowExperimentListParams, opts ...option.RequestOption) (res *pagination.CursorPagination[ShadowExperiment], err error)
Lists experiments that mirror sampled endpoint traffic to target deployments without affecting client responses. Set `includeTargets=true` to include target details inline.
func (*BetaEndpointShadowExperimentService) ListAutoPaging ¶ added in v0.11.0
func (r *BetaEndpointShadowExperimentService) ListAutoPaging(ctx context.Context, endpointID string, params BetaEndpointShadowExperimentListParams, opts ...option.RequestOption) *pagination.CursorPaginationAutoPager[ShadowExperiment]
Lists experiments that mirror sampled endpoint traffic to target deployments without affecting client responses. Set `includeTargets=true` to include target details inline.
func (*BetaEndpointShadowExperimentService) New ¶ added in v0.11.0
func (r *BetaEndpointShadowExperimentService) New(ctx context.Context, endpointID string, params BetaEndpointShadowExperimentNewParams, opts ...option.RequestOption) (res *ShadowExperiment, err error)
Creates an experiment that mirrors a sampled portion of endpoint traffic to one or more target deployments without returning their responses to clients. Add a description with the update operation after creation.
func (*BetaEndpointShadowExperimentService) Update ¶ added in v0.11.0
func (r *BetaEndpointShadowExperimentService) Update(ctx context.Context, id string, params BetaEndpointShadowExperimentUpdateParams, opts ...option.RequestOption) (res *ShadowExperiment, err error)
Updates a shadow experiment's description or source sampling strategy. `updateMask` is required; source changes also require the current `etag` in the request body.
type BetaEndpointShadowExperimentTargetDeleteParams ¶ added in v0.11.0
type BetaEndpointShadowExperimentTargetDeleteParams struct {
// Project identifier.
//
// Use [option.WithProjectID] on the client to set a global default for this field.
ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
// Endpoint identifier.
EndpointID string `path:"endpointId" api:"required" json:"-"`
// Shadow experiment identifier.
ExperimentID string `path:"experimentId" api:"required" json:"-"`
// Etag for optimistic concurrency.
Etag param.Opt[string] `query:"etag,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (BetaEndpointShadowExperimentTargetDeleteParams) URLQuery ¶ added in v0.11.0
func (r BetaEndpointShadowExperimentTargetDeleteParams) URLQuery() (v url.Values, err error)
URLQuery serializes BetaEndpointShadowExperimentTargetDeleteParams's query parameters as `url.Values`.
type BetaEndpointShadowExperimentTargetDeleteResponse ¶ added in v0.11.0
type BetaEndpointShadowExperimentTargetDeleteResponse 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:"-"`
}
Empty response returned after a successful delete operation.
func (BetaEndpointShadowExperimentTargetDeleteResponse) RawJSON ¶ added in v0.11.0
func (r BetaEndpointShadowExperimentTargetDeleteResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaEndpointShadowExperimentTargetDeleteResponse) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointShadowExperimentTargetDeleteResponse) UnmarshalJSON(data []byte) error
type BetaEndpointShadowExperimentTargetGetParams ¶ added in v0.11.0
type BetaEndpointShadowExperimentTargetGetParams struct {
// Project identifier.
//
// Use [option.WithProjectID] on the client to set a global default for this field.
ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
// Endpoint identifier.
EndpointID string `path:"endpointId" api:"required" json:"-"`
// Shadow experiment identifier.
ExperimentID string `path:"experimentId" api:"required" json:"-"`
// contains filtered or unexported fields
}
type BetaEndpointShadowExperimentTargetListParams ¶ added in v0.11.0
type BetaEndpointShadowExperimentTargetListParams struct {
// Project identifier.
//
// Use [option.WithProjectID] on the client to set a global default for this field.
ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
// Cursor from a previous shadow experiment target list response.
After param.Opt[string] `query:"after,omitzero" json:"-"`
// Maximum number of targets to return. Max 500, defaults to 50.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (BetaEndpointShadowExperimentTargetListParams) URLQuery ¶ added in v0.11.0
func (r BetaEndpointShadowExperimentTargetListParams) URLQuery() (v url.Values, err error)
URLQuery serializes BetaEndpointShadowExperimentTargetListParams's query parameters as `url.Values`.
type BetaEndpointShadowExperimentTargetNewParams ¶ added in v0.11.0
type BetaEndpointShadowExperimentTargetNewParams struct {
// Project identifier.
//
// Use [option.WithProjectID] on the client to set a global default for this field.
ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
// Endpoint identifier.
EndpointID string `path:"endpointId" api:"required" json:"-"`
// Shadow experiment identifier.
ExperimentID string `path:"experimentId" api:"required" json:"-"`
// Human-readable target name, unique within the shadow experiment. At most 256
// characters.
Name string `json:"name" api:"required"`
// Deployment under the parent endpoint that receives mirrored traffic. Exclude it
// from the endpoint's live traffic split.
TargetDeploymentID string `json:"targetDeploymentId" api:"required"`
// Optional free-form target description.
Description param.Opt[string] `json:"description,omitzero"`
// contains filtered or unexported fields
}
func (BetaEndpointShadowExperimentTargetNewParams) MarshalJSON ¶ added in v0.11.0
func (r BetaEndpointShadowExperimentTargetNewParams) MarshalJSON() (data []byte, err error)
func (*BetaEndpointShadowExperimentTargetNewParams) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointShadowExperimentTargetNewParams) UnmarshalJSON(data []byte) error
type BetaEndpointShadowExperimentTargetService ¶ added in v0.11.0
type BetaEndpointShadowExperimentTargetService struct {
Options []option.RequestOption
}
BetaEndpointShadowExperimentTargetService 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 NewBetaEndpointShadowExperimentTargetService method instead.
func NewBetaEndpointShadowExperimentTargetService ¶ added in v0.11.0
func NewBetaEndpointShadowExperimentTargetService(opts ...option.RequestOption) (r BetaEndpointShadowExperimentTargetService)
NewBetaEndpointShadowExperimentTargetService 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 (*BetaEndpointShadowExperimentTargetService) Delete ¶ added in v0.11.0
func (r *BetaEndpointShadowExperimentTargetService) Delete(ctx context.Context, id string, params BetaEndpointShadowExperimentTargetDeleteParams, opts ...option.RequestOption) (res *BetaEndpointShadowExperimentTargetDeleteResponse, err error)
Removes a target from a shadow experiment without deleting the underlying deployment.
func (*BetaEndpointShadowExperimentTargetService) Get ¶ added in v0.11.0
func (r *BetaEndpointShadowExperimentTargetService) Get(ctx context.Context, id string, query BetaEndpointShadowExperimentTargetGetParams, opts ...option.RequestOption) (res *ShadowExperimentTarget, err error)
Retrieves one target configured to receive mirrored requests from a shadow experiment.
func (*BetaEndpointShadowExperimentTargetService) List ¶ added in v0.11.0
func (r *BetaEndpointShadowExperimentTargetService) List(ctx context.Context, endpointID string, experimentID string, params BetaEndpointShadowExperimentTargetListParams, opts ...option.RequestOption) (res *pagination.CursorPagination[ShadowExperimentTarget], err error)
Lists the deployments that receive mirrored requests from a shadow experiment.
func (*BetaEndpointShadowExperimentTargetService) ListAutoPaging ¶ added in v0.11.0
func (r *BetaEndpointShadowExperimentTargetService) ListAutoPaging(ctx context.Context, endpointID string, experimentID string, params BetaEndpointShadowExperimentTargetListParams, opts ...option.RequestOption) *pagination.CursorPaginationAutoPager[ShadowExperimentTarget]
Lists the deployments that receive mirrored requests from a shadow experiment.
func (*BetaEndpointShadowExperimentTargetService) New ¶ added in v0.11.0
func (r *BetaEndpointShadowExperimentTargetService) New(ctx context.Context, params BetaEndpointShadowExperimentTargetNewParams, opts ...option.RequestOption) (res *ShadowExperimentTarget, err error)
Adds a deployment under the same endpoint as a target for mirrored requests.
func (*BetaEndpointShadowExperimentTargetService) Update ¶ added in v0.11.0
func (r *BetaEndpointShadowExperimentTargetService) Update(ctx context.Context, id string, params BetaEndpointShadowExperimentTargetUpdateParams, opts ...option.RequestOption) (res *ShadowExperimentTarget, err error)
Updates a shadow target's name, deployment, or description. `updateMask` is required and must select at least one mutable field.
type BetaEndpointShadowExperimentTargetUpdateParams ¶ added in v0.11.0
type BetaEndpointShadowExperimentTargetUpdateParams struct {
// Project identifier.
//
// Use [option.WithProjectID] on the client to set a global default for this field.
ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
// Endpoint identifier.
EndpointID string `path:"endpointId" api:"required" json:"-"`
// Shadow experiment identifier.
ExperimentID string `path:"experimentId" api:"required" json:"-"`
// Comma-separated fields to update. Supported fields are `name`,
// `targetDeploymentId`, and `description`.
UpdateMask string `query:"updateMask" api:"required" json:"-"`
// Updated free-form target description.
Description param.Opt[string] `json:"description,omitzero"`
// Opaque version tag from a prior read for optimistic concurrency.
Etag param.Opt[string] `json:"etag,omitzero"`
// Updated human-readable target name.
Name param.Opt[string] `json:"name,omitzero"`
// Replacement deployment under the parent endpoint. Exclude it from the endpoint's
// live traffic split.
TargetDeploymentID param.Opt[string] `json:"targetDeploymentId,omitzero"`
// contains filtered or unexported fields
}
func (BetaEndpointShadowExperimentTargetUpdateParams) MarshalJSON ¶ added in v0.11.0
func (r BetaEndpointShadowExperimentTargetUpdateParams) MarshalJSON() (data []byte, err error)
func (BetaEndpointShadowExperimentTargetUpdateParams) URLQuery ¶ added in v0.11.0
func (r BetaEndpointShadowExperimentTargetUpdateParams) URLQuery() (v url.Values, err error)
URLQuery serializes BetaEndpointShadowExperimentTargetUpdateParams's query parameters as `url.Values`.
func (*BetaEndpointShadowExperimentTargetUpdateParams) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointShadowExperimentTargetUpdateParams) UnmarshalJSON(data []byte) error
type BetaEndpointShadowExperimentUpdateParams ¶ added in v0.11.0
type BetaEndpointShadowExperimentUpdateParams struct {
// Project identifier.
//
// Use [option.WithProjectID] on the client to set a global default for this field.
ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
// Endpoint identifier.
EndpointID string `path:"endpointId" api:"required" json:"-"`
// Required fields to update, such as description or source.
UpdateMask string `query:"updateMask" api:"required" json:"-"`
// Updated free-form description.
Description param.Opt[string] `json:"description,omitzero"`
// Opaque version tag from a prior read for optimistic concurrency.
Etag param.Opt[string] `json:"etag,omitzero"`
// Traffic source for a shadow experiment. The public API supports endpoint sources
// only.
Source ShadowSourceParam `json:"source,omitzero"`
// contains filtered or unexported fields
}
func (BetaEndpointShadowExperimentUpdateParams) MarshalJSON ¶ added in v0.11.0
func (r BetaEndpointShadowExperimentUpdateParams) MarshalJSON() (data []byte, err error)
func (BetaEndpointShadowExperimentUpdateParams) URLQuery ¶ added in v0.11.0
func (r BetaEndpointShadowExperimentUpdateParams) URLQuery() (v url.Values, err error)
URLQuery serializes BetaEndpointShadowExperimentUpdateParams's query parameters as `url.Values`.
func (*BetaEndpointShadowExperimentUpdateParams) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointShadowExperimentUpdateParams) UnmarshalJSON(data []byte) error
type BetaEndpointUpdateParams ¶ added in v0.11.0
type BetaEndpointUpdateParams struct {
// Project identifier.
//
// Use [option.WithProjectID] on the client to set a global default for this field.
ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
// Fields to update. If not set, the fields populated are updated.
UpdateMask param.Opt[string] `query:"updateMask,omitzero" json:"-"`
// Current endpoint version. The update is rejected if this value no longer
// matches.
Etag param.Opt[string] `json:"etag,omitzero"`
// Updated endpoint string.
Name param.Opt[string] `json:"name,omitzero"`
// Replacement live traffic split. Use an empty list to stop routing live traffic.
TrafficSplit []EndpointTrafficSplitEntryParam `json:"trafficSplit,omitzero"`
// Who can discover the endpoint. `VISIBILITY_PRIVATE` restricts it to the project;
// `VISIBILITY_INTERNAL` shares it with the organization.
//
// Any of "VISIBILITY_PRIVATE", "VISIBILITY_INTERNAL".
Visibility BetaEndpointUpdateParamsVisibility `json:"visibility,omitzero"`
// contains filtered or unexported fields
}
func (BetaEndpointUpdateParams) MarshalJSON ¶ added in v0.11.0
func (r BetaEndpointUpdateParams) MarshalJSON() (data []byte, err error)
func (BetaEndpointUpdateParams) URLQuery ¶ added in v0.11.0
func (r BetaEndpointUpdateParams) URLQuery() (v url.Values, err error)
URLQuery serializes BetaEndpointUpdateParams's query parameters as `url.Values`.
func (*BetaEndpointUpdateParams) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaEndpointUpdateParams) UnmarshalJSON(data []byte) error
type BetaEndpointUpdateParamsVisibility ¶ added in v0.11.0
type BetaEndpointUpdateParamsVisibility string
Who can discover the endpoint. `VISIBILITY_PRIVATE` restricts it to the project; `VISIBILITY_INTERNAL` shares it with the organization.
const ( BetaEndpointUpdateParamsVisibilityVisibilityPrivate BetaEndpointUpdateParamsVisibility = "VISIBILITY_PRIVATE" BetaEndpointUpdateParamsVisibilityVisibilityInternal BetaEndpointUpdateParamsVisibility = "VISIBILITY_INTERNAL" )
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. 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 (r BetaJigDeployParamsAutoscalingCustomMetricAutoscalingConfig) MarshalJSON() (data []byte, err error)
func (*BetaJigDeployParamsAutoscalingCustomMetricAutoscalingConfig) UnmarshalJSON ¶ added in v0.7.0
func (r *BetaJigDeployParamsAutoscalingCustomMetricAutoscalingConfig) UnmarshalJSON(data []byte) error
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
func (r *BetaJigDeployParamsAutoscalingHTTPAutoscalingConfig) UnmarshalJSON(data []byte) error
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
func (r *BetaJigDeployParamsAutoscalingQueueAutoscalingConfig) UnmarshalJSON(data []byte) error
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
func (u BetaJigDeployParamsAutoscalingUnion) GetMetric() *string
Returns a pointer to the underlying variant's property, if present.
func (BetaJigDeployParamsAutoscalingUnion) GetModel ¶ added in v0.7.0
func (u BetaJigDeployParamsAutoscalingUnion) GetModel() *string
Returns a pointer to the underlying variant's property, if present.
func (BetaJigDeployParamsAutoscalingUnion) GetTarget ¶ added in v0.7.0
func (u BetaJigDeployParamsAutoscalingUnion) GetTarget() *float64
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 BetaJigQueueClearParams ¶ added in v0.11.0
type BetaJigQueueClearParams struct {
// Model identifier whose pending jobs should be canceled
Model string `json:"model" api:"required"`
// contains filtered or unexported fields
}
func (BetaJigQueueClearParams) MarshalJSON ¶ added in v0.11.0
func (r BetaJigQueueClearParams) MarshalJSON() (data []byte, err error)
func (*BetaJigQueueClearParams) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaJigQueueClearParams) UnmarshalJSON(data []byte) error
type BetaJigQueueClearResponse ¶ added in v0.11.0
type BetaJigQueueClearResponse struct {
// Number of pending jobs that were canceled
CanceledCount int64 `json:"canceled_count" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CanceledCount respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Count of pending jobs canceled by the clear operation.
func (BetaJigQueueClearResponse) RawJSON ¶ added in v0.11.0
func (r BetaJigQueueClearResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaJigQueueClearResponse) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaJigQueueClearResponse) UnmarshalJSON(data []byte) error
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
func (r *BetaJigQueueService) Cancel(ctx context.Context, body BetaJigQueueCancelParams, opts ...option.RequestOption) (res *BetaJigQueueCancelResponse, err error)
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) Clear ¶ added in v0.11.0
func (r *BetaJigQueueService) Clear(ctx context.Context, body BetaJigQueueClearParams, opts ...option.RequestOption) (res *BetaJigQueueClearResponse, err error)
Cancel all pending jobs for the given model. Running jobs are left untouched. Returns the number of jobs that were canceled.
func (*BetaJigQueueService) Get ¶ added in v0.6.0
func (r *BetaJigQueueService) Get(ctx context.Context, query BetaJigQueueGetParams, opts ...option.RequestOption) (res *BetaJigQueueGetResponse, err error)
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
func (r *BetaJigQueueService) Metrics(ctx context.Context, query BetaJigQueueMetricsParams, opts ...option.RequestOption) (res *BetaJigQueueMetricsResponse, err error)
Get the current queue statistics for a model, including pending and running job counts.
func (*BetaJigQueueService) Submit ¶ added in v0.6.0
func (r *BetaJigQueueService) Submit(ctx context.Context, body BetaJigQueueSubmitParams, opts ...option.RequestOption) (res *BetaJigQueueSubmitResponse, err error)
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
func (r *BetaJigSecretService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (res *BetaJigSecretDeleteResponse, err error)
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
func (r *BetaJigSecretService) List(ctx context.Context, opts ...option.RequestOption) (res *BetaJigSecretListResponse, err error)
Retrieve all secrets in your project
func (*BetaJigSecretService) New ¶ added in v0.6.0
func (r *BetaJigSecretService) New(ctx context.Context, body BetaJigSecretNewParams, opts ...option.RequestOption) (res *Secret, err error)
Create a new secret to store sensitive configuration values
func (*BetaJigSecretService) Update ¶ added in v0.6.0
func (r *BetaJigSecretService) Update(ctx context.Context, id string, body BetaJigSecretUpdateParams, opts ...option.RequestOption) (res *Secret, err error)
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. 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 (r BetaJigUpdateParamsAutoscalingCustomMetricAutoscalingConfig) MarshalJSON() (data []byte, err error)
func (*BetaJigUpdateParamsAutoscalingCustomMetricAutoscalingConfig) UnmarshalJSON ¶ added in v0.7.0
func (r *BetaJigUpdateParamsAutoscalingCustomMetricAutoscalingConfig) UnmarshalJSON(data []byte) error
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
func (r *BetaJigUpdateParamsAutoscalingHTTPAutoscalingConfig) UnmarshalJSON(data []byte) error
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
func (r *BetaJigUpdateParamsAutoscalingQueueAutoscalingConfig) UnmarshalJSON(data []byte) error
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
func (u BetaJigUpdateParamsAutoscalingUnion) GetMetric() *string
Returns a pointer to the underlying variant's property, if present.
func (BetaJigUpdateParamsAutoscalingUnion) GetModel ¶ added in v0.7.0
func (u BetaJigUpdateParamsAutoscalingUnion) GetModel() *string
Returns a pointer to the underlying variant's property, if present.
func (BetaJigUpdateParamsAutoscalingUnion) GetTarget ¶ added in v0.7.0
func (u BetaJigUpdateParamsAutoscalingUnion) GetTarget() *float64
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
func (r *BetaJigVolumeService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (res *BetaJigVolumeDeleteResponse, err error)
Delete an existing volume
func (*BetaJigVolumeService) Get ¶ added in v0.6.0
func (r *BetaJigVolumeService) Get(ctx context.Context, id string, query BetaJigVolumeGetParams, opts ...option.RequestOption) (res *Volume, err error)
Retrieve details of a specific volume by its ID or name
func (*BetaJigVolumeService) List ¶ added in v0.6.0
func (r *BetaJigVolumeService) List(ctx context.Context, opts ...option.RequestOption) (res *BetaJigVolumeListResponse, err error)
Retrieve all volumes in your project
func (*BetaJigVolumeService) New ¶ added in v0.6.0
func (r *BetaJigVolumeService) New(ctx context.Context, body BetaJigVolumeNewParams, opts ...option.RequestOption) (res *Volume, err error)
Create a new volume to preload files in deployments
func (*BetaJigVolumeService) Update ¶ added in v0.6.0
func (r *BetaJigVolumeService) Update(ctx context.Context, id string, body BetaJigVolumeUpdateParams, opts ...option.RequestOption) (res *Volume, err error)
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 BetaModelConfigGetParams ¶ added in v0.11.0
type BetaModelConfigListParams ¶ added in v0.11.0
type BetaModelConfigListParams struct {
// Project identifier.
//
// Use [option.WithProjectID] on the client to set a global default for this field.
ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
// Cursor from a previous list response.
After param.Opt[string] `query:"after,omitzero" json:"-"`
// Maximum number of results to return.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Model resource-name filter using `projects/{projectId}/models/{modelId}`;
// alternative to `referenceModelId`. If both are set, they must agree.
ReferenceModel param.Opt[string] `query:"referenceModel,omitzero" json:"-"`
// Deprecated. Use `referenceModel`. Reference model identifier filter; if both are
// set, they must agree.
ReferenceModelID param.Opt[string] `query:"referenceModelId,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (BetaModelConfigListParams) URLQuery ¶ added in v0.11.0
func (r BetaModelConfigListParams) URLQuery() (v url.Values, err error)
URLQuery serializes BetaModelConfigListParams's query parameters as `url.Values`.
type BetaModelConfigService ¶ added in v0.11.0
type BetaModelConfigService struct {
Options []option.RequestOption
}
BetaModelConfigService 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 NewBetaModelConfigService method instead.
func NewBetaModelConfigService ¶ added in v0.11.0
func NewBetaModelConfigService(opts ...option.RequestOption) (r BetaModelConfigService)
NewBetaModelConfigService 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 (*BetaModelConfigService) Get ¶ added in v0.11.0
func (r *BetaModelConfigService) Get(ctx context.Context, id string, query BetaModelConfigGetParams, opts ...option.RequestOption) (res *Config, err error)
Retrieves a model configuration revision by ID, including its runtime selectors and certifications.
func (*BetaModelConfigService) List ¶ added in v0.11.0
func (r *BetaModelConfigService) List(ctx context.Context, params BetaModelConfigListParams, opts ...option.RequestOption) (res *pagination.CursorPagination[Config], err error)
Lists production-ready configuration revisions compatible with a reference model. Specify the model with `referenceModel` or the deprecated `referenceModelId`; if both are supplied, they must identify the same model. Results include public configurations and configurations owned by the specified project.
func (*BetaModelConfigService) ListAutoPaging ¶ added in v0.11.0
func (r *BetaModelConfigService) ListAutoPaging(ctx context.Context, params BetaModelConfigListParams, opts ...option.RequestOption) *pagination.CursorPaginationAutoPager[Config]
Lists production-ready configuration revisions compatible with a reference model. Specify the model with `referenceModel` or the deprecated `referenceModelId`; if both are supplied, they must identify the same model. Results include public configurations and configurations owned by the specified project.
type BetaModelDeleteParams ¶ added in v0.11.0
type BetaModelDeleteResponse ¶ added in v0.11.0
type BetaModelDeleteResponse 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:"-"`
}
Empty response returned after a successful delete operation.
func (BetaModelDeleteResponse) RawJSON ¶ added in v0.11.0
func (r BetaModelDeleteResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaModelDeleteResponse) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaModelDeleteResponse) UnmarshalJSON(data []byte) error
type BetaModelGetParams ¶ added in v0.11.0
type BetaModelListFilesParams ¶ added in v0.11.0
type BetaModelListFilesParams struct {
// Project identifier.
//
// Use [option.WithProjectID] on the client to set a global default for this field.
ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
// Revision identifier to read from.
RevisionID param.Opt[string] `query:"revisionId,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (BetaModelListFilesParams) URLQuery ¶ added in v0.11.0
func (r BetaModelListFilesParams) URLQuery() (v url.Values, err error)
URLQuery serializes BetaModelListFilesParams's query parameters as `url.Values`.
type BetaModelListFilesResponse ¶ added in v0.11.0
type BetaModelListFilesResponse struct {
// Files in the selected model revision.
Data []BetaModelListFilesResponseData `json:"data" api:"required"`
Object constant.List `json:"object" default:"list"`
// Cursor for the next page. Null if there are no more results.
NextCursor string `json:"next_cursor"`
// Time when the listed model revision was created.
RevisionCreatedAt time.Time `json:"revisionCreatedAt" format:"date-time"`
// ID of the model revision whose files are listed.
RevisionID string `json:"revisionId"`
// Total size of all files in the revision, in bytes.
TotalSizeBytes string `json:"totalSizeBytes"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Object respjson.Field
NextCursor respjson.Field
RevisionCreatedAt respjson.Field
RevisionID respjson.Field
TotalSizeBytes respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Files and aggregate size information for one model revision.
func (BetaModelListFilesResponse) RawJSON ¶ added in v0.11.0
func (r BetaModelListFilesResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaModelListFilesResponse) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaModelListFilesResponse) UnmarshalJSON(data []byte) error
type BetaModelListFilesResponseData ¶ added in v0.11.0
type BetaModelListFilesResponseData struct {
// Content hash for integrity verification and upload deduplication.
Hash string `json:"hash"`
// File path within the model revision.
Path string `json:"path"`
// File size in bytes.
SizeBytes string `json:"sizeBytes"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Hash respjson.Field
Path respjson.Field
SizeBytes respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Metadata for one file in a model revision.
func (BetaModelListFilesResponseData) RawJSON ¶ added in v0.11.0
func (r BetaModelListFilesResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaModelListFilesResponseData) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaModelListFilesResponseData) UnmarshalJSON(data []byte) error
type BetaModelListOrgScopedParams ¶ added in v0.11.0
type BetaModelListOrgScopedParams struct {
// Cursor from a previous list response.
After param.Opt[string] `query:"after,omitzero" json:"-"`
// Maximum number of results to return.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (BetaModelListOrgScopedParams) URLQuery ¶ added in v0.11.0
func (r BetaModelListOrgScopedParams) URLQuery() (v url.Values, err error)
URLQuery serializes BetaModelListOrgScopedParams's query parameters as `url.Values`.
type BetaModelListParams ¶ added in v0.11.0
type BetaModelListParams struct {
// Project identifier.
//
// Use [option.WithProjectID] on the client to set a global default for this field.
ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
// Cursor from a previous model list response.
After param.Opt[string] `query:"after,omitzero" json:"-"`
// Maximum number of models to return.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Organization whose shared models should be included. Defaults to the
// authenticated project's organization.
OrganizationID param.Opt[string] `query:"organizationId,omitzero" json:"-"`
// Model visibility. Private means it is scoped to the project. Internal means it
// is scoped to the organization.
//
// Any of "VISIBILITY_PRIVATE", "VISIBILITY_INTERNAL".
Visibility BetaModelListParamsVisibility `query:"visibility,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (BetaModelListParams) URLQuery ¶ added in v0.11.0
func (r BetaModelListParams) URLQuery() (v url.Values, err error)
URLQuery serializes BetaModelListParams's query parameters as `url.Values`.
type BetaModelListParamsVisibility ¶ added in v0.11.0
type BetaModelListParamsVisibility string
Model visibility. Private means it is scoped to the project. Internal means it is scoped to the organization.
const ( BetaModelListParamsVisibilityVisibilityPrivate BetaModelListParamsVisibility = "VISIBILITY_PRIVATE" BetaModelListParamsVisibilityVisibilityInternal BetaModelListParamsVisibility = "VISIBILITY_INTERNAL" )
type BetaModelListRevisionsParams ¶ added in v0.11.0
type BetaModelListRevisionsResponse ¶ added in v0.11.0
type BetaModelListRevisionsResponse struct {
// Immutable revisions available for the model.
Data []BetaModelListRevisionsResponseData `json:"data"`
// Cursor for the next page. Null if there are no more results.
NextCursor string `json:"next_cursor"`
// Object type. Always `list`.
//
// Any of "list".
Object BetaModelListRevisionsResponseObject `json:"object"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
NextCursor respjson.Field
Object respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Immutable model revisions and pagination metadata.
func (BetaModelListRevisionsResponse) RawJSON ¶ added in v0.11.0
func (r BetaModelListRevisionsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaModelListRevisionsResponse) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaModelListRevisionsResponse) UnmarshalJSON(data []byte) error
type BetaModelListRevisionsResponseData ¶ added in v0.11.0
type BetaModelListRevisionsResponseData struct {
// Timestamp when the revision was created.
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
// Revision identifier.
RevisionID string `json:"revisionId" api:"required"`
// Timestamp when validation most recently ran for the revision.
LastValidatedAt time.Time `json:"lastValidatedAt" format:"date-time"`
// Validation errors reported for the revision.
ValidationErrors []BetaModelListRevisionsResponseDataValidationError `json:"validationErrors"`
// Current validation status for the revision.
//
// Any of "REVISION_VALIDATION_STATUS_PENDING",
// "REVISION_VALIDATION_STATUS_SUCCESS", "REVISION_VALIDATION_STATUS_FAILED",
// "REVISION_VALIDATION_STATUS_ERROR".
ValidationStatus string `json:"validationStatus"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CreatedAt respjson.Field
RevisionID respjson.Field
LastValidatedAt respjson.Field
ValidationErrors respjson.Field
ValidationStatus respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Revision metadata for a volume object.
func (BetaModelListRevisionsResponseData) RawJSON ¶ added in v0.11.0
func (r BetaModelListRevisionsResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaModelListRevisionsResponseData) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaModelListRevisionsResponseData) UnmarshalJSON(data []byte) error
type BetaModelListRevisionsResponseDataValidationError ¶ added in v0.11.0
type BetaModelListRevisionsResponseDataValidationError struct {
// Human-readable validation error message.
Message string `json:"message"`
// Validation rule that produced the error.
Rule string `json:"rule"`
// Severity level reported by the validation rule.
Severity string `json:"severity"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
Rule respjson.Field
Severity respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
One validation error reported for a model revision.
func (BetaModelListRevisionsResponseDataValidationError) RawJSON ¶ added in v0.11.0
func (r BetaModelListRevisionsResponseDataValidationError) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaModelListRevisionsResponseDataValidationError) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaModelListRevisionsResponseDataValidationError) UnmarshalJSON(data []byte) error
type BetaModelListRevisionsResponseObject ¶ added in v0.11.0
type BetaModelListRevisionsResponseObject string
Object type. Always `list`.
const (
BetaModelListRevisionsResponseObjectList BetaModelListRevisionsResponseObject = "list"
)
type BetaModelListSupportedParams ¶ added in v0.11.0
type BetaModelListSupportedParams struct {
// Cursor from a previous supported-model list response.
After param.Opt[string] `query:"after,omitzero" json:"-"`
// Maximum number of models to return.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Case-insensitive search across model IDs, names, and descriptions.
Search param.Opt[string] `query:"search,omitzero" json:"-"`
// Filter models by input modality.
//
// Any of "MODALITY_TEXT", "MODALITY_IMAGE", "MODALITY_AUDIO", "MODALITY_VIDEO".
Modality BetaModelListSupportedParamsModality `query:"modality,omitzero" json:"-"`
// Filter models by product surface.
//
// Any of "PRODUCT_SERVERLESS", "PRODUCT_DEDICATED", "PRODUCT_FINE_TUNING".
Product BetaModelListSupportedParamsProduct `query:"product,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (BetaModelListSupportedParams) URLQuery ¶ added in v0.11.0
func (r BetaModelListSupportedParams) URLQuery() (v url.Values, err error)
URLQuery serializes BetaModelListSupportedParams's query parameters as `url.Values`.
type BetaModelListSupportedParamsModality ¶ added in v0.11.0
type BetaModelListSupportedParamsModality string
Filter models by input modality.
const ( BetaModelListSupportedParamsModalityModalityText BetaModelListSupportedParamsModality = "MODALITY_TEXT" BetaModelListSupportedParamsModalityModalityImage BetaModelListSupportedParamsModality = "MODALITY_IMAGE" BetaModelListSupportedParamsModalityModalityAudio BetaModelListSupportedParamsModality = "MODALITY_AUDIO" BetaModelListSupportedParamsModalityModalityVideo BetaModelListSupportedParamsModality = "MODALITY_VIDEO" )
type BetaModelListSupportedParamsProduct ¶ added in v0.11.0
type BetaModelListSupportedParamsProduct string
Filter models by product surface.
const ( BetaModelListSupportedParamsProductProductServerless BetaModelListSupportedParamsProduct = "PRODUCT_SERVERLESS" BetaModelListSupportedParamsProductProductDedicated BetaModelListSupportedParamsProduct = "PRODUCT_DEDICATED" BetaModelListSupportedParamsProductProductFineTuning BetaModelListSupportedParamsProduct = "PRODUCT_FINE_TUNING" )
type BetaModelNewParams ¶ added in v0.11.0
type BetaModelNewParams struct {
// Project identifier.
//
// Use [option.WithProjectID] on the client to set a global default for this field.
ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
// ID of the supported base model from which this model was derived.
BaseModelID string `json:"baseModelId" api:"required"`
// Name for the custom model. May be bare or qualified as
// `<project_slug>/<model_name>`; a supplied project slug must match the project in
// the request path.
Name string `json:"name" api:"required"`
// Volume type to create. Use `model` or `adapter`; plural `models` and `adapters`
// are also accepted.
Type string `json:"type" api:"required"`
// Human-readable description of the model and its intended use.
Description param.Opt[string] `json:"description,omitzero"`
// contains filtered or unexported fields
}
func (BetaModelNewParams) MarshalJSON ¶ added in v0.11.0
func (r BetaModelNewParams) MarshalJSON() (data []byte, err error)
func (*BetaModelNewParams) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaModelNewParams) UnmarshalJSON(data []byte) error
type BetaModelRemoteUploadEventsParams ¶ added in v0.11.0
type BetaModelRemoteUploadEventsParams struct {
// Project identifier.
//
// Use [option.WithProjectID] on the client to set a global default for this field.
ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
// Cursor from a previous remote upload event list response.
After param.Opt[string] `query:"after,omitzero" json:"-"`
// Maximum number of events to return.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (BetaModelRemoteUploadEventsParams) URLQuery ¶ added in v0.11.0
func (r BetaModelRemoteUploadEventsParams) URLQuery() (v url.Values, err error)
URLQuery serializes BetaModelRemoteUploadEventsParams's query parameters as `url.Values`.
type BetaModelRemoteUploadEventsResponse ¶ added in v0.11.0
type BetaModelRemoteUploadEventsResponse struct {
// Events for the remote upload.
Data []BetaModelRemoteUploadEventsResponseData `json:"data" api:"required"`
// Object type. Always `list`.
Object constant.List `json:"object" default:"list"`
// Cursor for the next page. Null if there are no more results.
NextCursor string `json:"next_cursor"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Object respjson.Field
NextCursor respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Status and diagnostic events for a remote model import job.
func (BetaModelRemoteUploadEventsResponse) RawJSON ¶ added in v0.11.0
func (r BetaModelRemoteUploadEventsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaModelRemoteUploadEventsResponse) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaModelRemoteUploadEventsResponse) UnmarshalJSON(data []byte) error
type BetaModelRemoteUploadEventsResponseData ¶ added in v0.11.0
type BetaModelRemoteUploadEventsResponseData struct {
// Unique event identifier.
ID string `json:"id" api:"required"`
// Time when the event was recorded.
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
// Severity of the event.
//
// Any of "LEVEL_DEBUG", "LEVEL_INFO", "LEVEL_WARN", "LEVEL_ERROR".
Level string `json:"level" api:"required"`
// Human-readable progress or diagnostic message.
Message string `json:"message" api:"required"`
// Stable event type emitted by the importer, such as `download.started`.
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
Level respjson.Field
Message respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Progress or diagnostic event emitted while importing remote model files.
func (BetaModelRemoteUploadEventsResponseData) RawJSON ¶ added in v0.11.0
func (r BetaModelRemoteUploadEventsResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaModelRemoteUploadEventsResponseData) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaModelRemoteUploadEventsResponseData) UnmarshalJSON(data []byte) error
type BetaModelRemoteUploadGetParams ¶ added in v0.11.0
type BetaModelRemoteUploadGetResponse ¶ added in v0.11.0
type BetaModelRemoteUploadGetResponse struct {
// Unique ID of the remote model import job.
ID string `json:"id" api:"required"`
// Time when the import job was created.
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
// ID of the registered model receiving the imported files.
ModelID string `json:"modelId" api:"required"`
// ID of the project that owns the import job.
ProjectID string `json:"projectId" api:"required"`
// Hugging Face repository or presigned URL being imported.
RemoteURL string `json:"remoteUrl" api:"required"`
// Current lifecycle state of the asynchronous import job.
//
// Any of "REMOTE_UPLOAD_STATUS_PENDING", "REMOTE_UPLOAD_STATUS_RUNNING",
// "REMOTE_UPLOAD_STATUS_ERROR", "REMOTE_UPLOAD_STATUS_SUCCEEDED",
// "REMOTE_UPLOAD_STATUS_FAILED".
Status BetaModelRemoteUploadGetResponseStatus `json:"status" api:"required"`
// Maximum worker restarts allowed before the job fails permanently.
MaxRestarts int64 `json:"maxRestarts"`
// Number of times the import worker has restarted this job.
RestartCount int64 `json:"restartCount"`
// Human-readable progress or failure detail for the current status.
StatusMessage string `json:"statusMessage"`
// Time when the import job was last updated.
UpdatedAt time.Time `json:"updatedAt" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
ModelID respjson.Field
ProjectID respjson.Field
RemoteURL respjson.Field
Status respjson.Field
MaxRestarts respjson.Field
RestartCount respjson.Field
StatusMessage respjson.Field
UpdatedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Asynchronous job that imports remote files into a registered model and creates a model revision.
func (BetaModelRemoteUploadGetResponse) RawJSON ¶ added in v0.11.0
func (r BetaModelRemoteUploadGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaModelRemoteUploadGetResponse) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaModelRemoteUploadGetResponse) UnmarshalJSON(data []byte) error
type BetaModelRemoteUploadGetResponseStatus ¶ added in v0.11.0
type BetaModelRemoteUploadGetResponseStatus string
Current lifecycle state of the asynchronous import job.
const ( BetaModelRemoteUploadGetResponseStatusRemoteUploadStatusPending BetaModelRemoteUploadGetResponseStatus = "REMOTE_UPLOAD_STATUS_PENDING" BetaModelRemoteUploadGetResponseStatusRemoteUploadStatusRunning BetaModelRemoteUploadGetResponseStatus = "REMOTE_UPLOAD_STATUS_RUNNING" BetaModelRemoteUploadGetResponseStatusRemoteUploadStatusError BetaModelRemoteUploadGetResponseStatus = "REMOTE_UPLOAD_STATUS_ERROR" BetaModelRemoteUploadGetResponseStatusRemoteUploadStatusSucceeded BetaModelRemoteUploadGetResponseStatus = "REMOTE_UPLOAD_STATUS_SUCCEEDED" BetaModelRemoteUploadGetResponseStatusRemoteUploadStatusFailed BetaModelRemoteUploadGetResponseStatus = "REMOTE_UPLOAD_STATUS_FAILED" )
type BetaModelRemoteUploadListParams ¶ added in v0.11.0
type BetaModelRemoteUploadListParams struct {
// Project identifier.
//
// Use [option.WithProjectID] on the client to set a global default for this field.
ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
// Cursor from a previous remote upload list response.
After param.Opt[string] `query:"after,omitzero" json:"-"`
// Maximum number of uploads to return.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (BetaModelRemoteUploadListParams) URLQuery ¶ added in v0.11.0
func (r BetaModelRemoteUploadListParams) URLQuery() (v url.Values, err error)
URLQuery serializes BetaModelRemoteUploadListParams's query parameters as `url.Values`.
type BetaModelRemoteUploadListResponse ¶ added in v0.11.0
type BetaModelRemoteUploadListResponse struct {
// Unique ID of the remote model import job.
ID string `json:"id" api:"required"`
// Time when the import job was created.
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
// ID of the registered model receiving the imported files.
ModelID string `json:"modelId" api:"required"`
// ID of the project that owns the import job.
ProjectID string `json:"projectId" api:"required"`
// Hugging Face repository or presigned URL being imported.
RemoteURL string `json:"remoteUrl" api:"required"`
// Current lifecycle state of the asynchronous import job.
//
// Any of "REMOTE_UPLOAD_STATUS_PENDING", "REMOTE_UPLOAD_STATUS_RUNNING",
// "REMOTE_UPLOAD_STATUS_ERROR", "REMOTE_UPLOAD_STATUS_SUCCEEDED",
// "REMOTE_UPLOAD_STATUS_FAILED".
Status BetaModelRemoteUploadListResponseStatus `json:"status" api:"required"`
// Maximum worker restarts allowed before the job fails permanently.
MaxRestarts int64 `json:"maxRestarts"`
// Number of times the import worker has restarted this job.
RestartCount int64 `json:"restartCount"`
// Human-readable progress or failure detail for the current status.
StatusMessage string `json:"statusMessage"`
// Time when the import job was last updated.
UpdatedAt time.Time `json:"updatedAt" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
ModelID respjson.Field
ProjectID respjson.Field
RemoteURL respjson.Field
Status respjson.Field
MaxRestarts respjson.Field
RestartCount respjson.Field
StatusMessage respjson.Field
UpdatedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Asynchronous job that imports remote files into a registered model and creates a model revision.
func (BetaModelRemoteUploadListResponse) RawJSON ¶ added in v0.11.0
func (r BetaModelRemoteUploadListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaModelRemoteUploadListResponse) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaModelRemoteUploadListResponse) UnmarshalJSON(data []byte) error
type BetaModelRemoteUploadListResponseStatus ¶ added in v0.11.0
type BetaModelRemoteUploadListResponseStatus string
Current lifecycle state of the asynchronous import job.
const ( BetaModelRemoteUploadListResponseStatusRemoteUploadStatusPending BetaModelRemoteUploadListResponseStatus = "REMOTE_UPLOAD_STATUS_PENDING" BetaModelRemoteUploadListResponseStatusRemoteUploadStatusRunning BetaModelRemoteUploadListResponseStatus = "REMOTE_UPLOAD_STATUS_RUNNING" BetaModelRemoteUploadListResponseStatusRemoteUploadStatusError BetaModelRemoteUploadListResponseStatus = "REMOTE_UPLOAD_STATUS_ERROR" BetaModelRemoteUploadListResponseStatusRemoteUploadStatusSucceeded BetaModelRemoteUploadListResponseStatus = "REMOTE_UPLOAD_STATUS_SUCCEEDED" BetaModelRemoteUploadListResponseStatusRemoteUploadStatusFailed BetaModelRemoteUploadListResponseStatus = "REMOTE_UPLOAD_STATUS_FAILED" )
type BetaModelRemoteUploadNewParams ¶ added in v0.11.0
type BetaModelRemoteUploadNewParams struct {
// Project identifier.
//
// Use [option.WithProjectID] on the client to set a global default for this field.
ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
// ID of the registered model that will receive the imported files.
ModelID string `json:"modelId" api:"required"`
// Hugging Face repository URL or presigned archive URL to import.
RemoteURL string `json:"remoteUrl" api:"required"`
// Optional source credential used to access a private remote location. The value
// is write-only and is not returned.
Token param.Opt[string] `json:"token,omitzero"`
// contains filtered or unexported fields
}
func (BetaModelRemoteUploadNewParams) MarshalJSON ¶ added in v0.11.0
func (r BetaModelRemoteUploadNewParams) MarshalJSON() (data []byte, err error)
func (*BetaModelRemoteUploadNewParams) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaModelRemoteUploadNewParams) UnmarshalJSON(data []byte) error
type BetaModelRemoteUploadNewResponse ¶ added in v0.11.0
type BetaModelRemoteUploadNewResponse struct {
// Unique ID of the remote model import job.
ID string `json:"id" api:"required"`
// Time when the import job was created.
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
// ID of the registered model receiving the imported files.
ModelID string `json:"modelId" api:"required"`
// ID of the project that owns the import job.
ProjectID string `json:"projectId" api:"required"`
// Hugging Face repository or presigned URL being imported.
RemoteURL string `json:"remoteUrl" api:"required"`
// Current lifecycle state of the asynchronous import job.
//
// Any of "REMOTE_UPLOAD_STATUS_PENDING", "REMOTE_UPLOAD_STATUS_RUNNING",
// "REMOTE_UPLOAD_STATUS_ERROR", "REMOTE_UPLOAD_STATUS_SUCCEEDED",
// "REMOTE_UPLOAD_STATUS_FAILED".
Status BetaModelRemoteUploadNewResponseStatus `json:"status" api:"required"`
// Maximum worker restarts allowed before the job fails permanently.
MaxRestarts int64 `json:"maxRestarts"`
// Number of times the import worker has restarted this job.
RestartCount int64 `json:"restartCount"`
// Human-readable progress or failure detail for the current status.
StatusMessage string `json:"statusMessage"`
// Time when the import job was last updated.
UpdatedAt time.Time `json:"updatedAt" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
ModelID respjson.Field
ProjectID respjson.Field
RemoteURL respjson.Field
Status respjson.Field
MaxRestarts respjson.Field
RestartCount respjson.Field
StatusMessage respjson.Field
UpdatedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Asynchronous job that imports remote files into a registered model and creates a model revision.
func (BetaModelRemoteUploadNewResponse) RawJSON ¶ added in v0.11.0
func (r BetaModelRemoteUploadNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaModelRemoteUploadNewResponse) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaModelRemoteUploadNewResponse) UnmarshalJSON(data []byte) error
type BetaModelRemoteUploadNewResponseStatus ¶ added in v0.11.0
type BetaModelRemoteUploadNewResponseStatus string
Current lifecycle state of the asynchronous import job.
const ( BetaModelRemoteUploadNewResponseStatusRemoteUploadStatusPending BetaModelRemoteUploadNewResponseStatus = "REMOTE_UPLOAD_STATUS_PENDING" BetaModelRemoteUploadNewResponseStatusRemoteUploadStatusRunning BetaModelRemoteUploadNewResponseStatus = "REMOTE_UPLOAD_STATUS_RUNNING" BetaModelRemoteUploadNewResponseStatusRemoteUploadStatusError BetaModelRemoteUploadNewResponseStatus = "REMOTE_UPLOAD_STATUS_ERROR" BetaModelRemoteUploadNewResponseStatusRemoteUploadStatusSucceeded BetaModelRemoteUploadNewResponseStatus = "REMOTE_UPLOAD_STATUS_SUCCEEDED" BetaModelRemoteUploadNewResponseStatusRemoteUploadStatusFailed BetaModelRemoteUploadNewResponseStatus = "REMOTE_UPLOAD_STATUS_FAILED" )
type BetaModelRemoteUploadService ¶ added in v0.11.0
type BetaModelRemoteUploadService struct {
Options []option.RequestOption
}
BetaModelRemoteUploadService 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 NewBetaModelRemoteUploadService method instead.
func NewBetaModelRemoteUploadService ¶ added in v0.11.0
func NewBetaModelRemoteUploadService(opts ...option.RequestOption) (r BetaModelRemoteUploadService)
NewBetaModelRemoteUploadService 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 (*BetaModelRemoteUploadService) Events ¶ added in v0.11.0
func (r *BetaModelRemoteUploadService) Events(ctx context.Context, id string, params BetaModelRemoteUploadEventsParams, opts ...option.RequestOption) (res *BetaModelRemoteUploadEventsResponse, err error)
Lists progress and diagnostic events for a remote model import job.
func (*BetaModelRemoteUploadService) Get ¶ added in v0.11.0
func (r *BetaModelRemoteUploadService) Get(ctx context.Context, id string, query BetaModelRemoteUploadGetParams, opts ...option.RequestOption) (res *BetaModelRemoteUploadGetResponse, err error)
Retrieves the status, progress details, retry counts, and timestamps for a remote model import job.
func (*BetaModelRemoteUploadService) List ¶ added in v0.11.0
func (r *BetaModelRemoteUploadService) List(ctx context.Context, params BetaModelRemoteUploadListParams, opts ...option.RequestOption) (res *pagination.CursorPagination[BetaModelRemoteUploadListResponse], err error)
Lists asynchronous jobs that import model files from Hugging Face or a presigned remote URL.
func (*BetaModelRemoteUploadService) ListAutoPaging ¶ added in v0.11.0
func (r *BetaModelRemoteUploadService) ListAutoPaging(ctx context.Context, params BetaModelRemoteUploadListParams, opts ...option.RequestOption) *pagination.CursorPaginationAutoPager[BetaModelRemoteUploadListResponse]
Lists asynchronous jobs that import model files from Hugging Face or a presigned remote URL.
func (*BetaModelRemoteUploadService) New ¶ added in v0.11.0
func (r *BetaModelRemoteUploadService) New(ctx context.Context, params BetaModelRemoteUploadNewParams, opts ...option.RequestOption) (res *BetaModelRemoteUploadNewResponse, err error)
Starts an asynchronous job that imports model files from Hugging Face or a presigned URL into a registered model and creates a model revision when the import completes.
type BetaModelService ¶ added in v0.11.0
type BetaModelService struct {
Options []option.RequestOption
RemoteUploads BetaModelRemoteUploadService
Configs BetaModelConfigService
}
BetaModelService 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 NewBetaModelService method instead.
func NewBetaModelService ¶ added in v0.11.0
func NewBetaModelService(opts ...option.RequestOption) (r BetaModelService)
NewBetaModelService 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 (*BetaModelService) Delete ¶ added in v0.11.0
func (r *BetaModelService) Delete(ctx context.Context, id string, body BetaModelDeleteParams, opts ...option.RequestOption) (res *BetaModelDeleteResponse, err error)
Permanently deletes a custom model resource. The model must not be in use by an active deployment.
func (*BetaModelService) Get ¶ added in v0.11.0
func (r *BetaModelService) Get(ctx context.Context, id string, query BetaModelGetParams, opts ...option.RequestOption) (res *Model, err error)
Retrieves a custom model's metadata, visibility, weight information, and base-model relationship.
func (*BetaModelService) GetSupported ¶ added in v0.11.0
func (r *BetaModelService) GetSupported(ctx context.Context, id string, opts ...option.RequestOption) (res *SupportedModel, err error)
Retrieves a Together-hosted base model and the certified model, configuration, hardware, and performance profiles available for deployment.
func (*BetaModelService) List ¶ added in v0.11.0
func (r *BetaModelService) List(ctx context.Context, params BetaModelListParams, opts ...option.RequestOption) (res *pagination.CursorPagination[Model], err error)
Lists custom model resources owned by the specified project. Use the organization endpoint to list models shared across projects or the supported-model catalog to discover Together-hosted base models.
func (*BetaModelService) ListAutoPaging ¶ added in v0.11.0
func (r *BetaModelService) ListAutoPaging(ctx context.Context, params BetaModelListParams, opts ...option.RequestOption) *pagination.CursorPaginationAutoPager[Model]
Lists custom model resources owned by the specified project. Use the organization endpoint to list models shared across projects or the supported-model catalog to discover Together-hosted base models.
func (*BetaModelService) ListFiles ¶ added in v0.11.0
func (r *BetaModelService) ListFiles(ctx context.Context, id string, params BetaModelListFilesParams, opts ...option.RequestOption) (res *BetaModelListFilesResponse, err error)
Lists files in the latest or specified revision of a model, including paths, sizes, and content hashes.
func (*BetaModelService) ListOrgScoped ¶ added in v0.11.0
func (r *BetaModelService) ListOrgScoped(ctx context.Context, organizationID string, query BetaModelListOrgScopedParams, opts ...option.RequestOption) (res *pagination.CursorPagination[Model], err error)
Lists custom models shared with every project in the specified organization. Project-private and public models are not included.
func (*BetaModelService) ListOrgScopedAutoPaging ¶ added in v0.11.0
func (r *BetaModelService) ListOrgScopedAutoPaging(ctx context.Context, organizationID string, query BetaModelListOrgScopedParams, opts ...option.RequestOption) *pagination.CursorPaginationAutoPager[Model]
Lists custom models shared with every project in the specified organization. Project-private and public models are not included.
func (*BetaModelService) ListRevisions ¶ added in v0.11.0
func (r *BetaModelService) ListRevisions(ctx context.Context, id string, query BetaModelListRevisionsParams, opts ...option.RequestOption) (res *BetaModelListRevisionsResponse, err error)
Lists the immutable file revisions available for a custom model, newest first.
func (*BetaModelService) ListSupported ¶ added in v0.11.0
func (r *BetaModelService) ListSupported(ctx context.Context, query BetaModelListSupportedParams, opts ...option.RequestOption) (res *pagination.CursorPagination[SupportedModel], err error)
Lists Together-hosted base models that can be deployed for dedicated inference, together with their capabilities and certified deployment profiles.
func (*BetaModelService) ListSupportedAutoPaging ¶ added in v0.11.0
func (r *BetaModelService) ListSupportedAutoPaging(ctx context.Context, query BetaModelListSupportedParams, opts ...option.RequestOption) *pagination.CursorPaginationAutoPager[SupportedModel]
Lists Together-hosted base models that can be deployed for dedicated inference, together with their capabilities and certified deployment profiles.
func (*BetaModelService) New ¶ added in v0.11.0
func (r *BetaModelService) New(ctx context.Context, params BetaModelNewParams, opts ...option.RequestOption) (res *Model, err error)
Registers a custom model resource in the project. Registration creates the model's metadata; upload or import model files separately before deploying it.
func (*BetaModelService) Update ¶ added in v0.11.0
func (r *BetaModelService) Update(ctx context.Context, id string, params BetaModelUpdateParams, opts ...option.RequestOption) (res *Model, err error)
Updates mutable model metadata such as its inference name, description, base model, or visibility.
type BetaModelUpdateParams ¶ added in v0.11.0
type BetaModelUpdateParams struct {
// Project identifier.
//
// Use [option.WithProjectID] on the client to set a global default for this field.
ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
// Fields to update. If omitted, all mutable fields are overwritten.
UpdateMask param.Opt[string] `query:"updateMask,omitzero" format:"field-mask" json:"-"`
// Updated user-facing model description.
Description param.Opt[string] `json:"description,omitzero"`
// Updated inference-addressable model name.
Name param.Opt[string] `json:"name,omitzero"`
// Who can discover the model. `VISIBILITY_PRIVATE` restricts it to the project;
// `VISIBILITY_INTERNAL` shares it with the organization.
//
// Any of "VISIBILITY_PRIVATE", "VISIBILITY_INTERNAL".
Visibility BetaModelUpdateParamsVisibility `json:"visibility,omitzero"`
// contains filtered or unexported fields
}
func (BetaModelUpdateParams) MarshalJSON ¶ added in v0.11.0
func (r BetaModelUpdateParams) MarshalJSON() (data []byte, err error)
func (BetaModelUpdateParams) URLQuery ¶ added in v0.11.0
func (r BetaModelUpdateParams) URLQuery() (v url.Values, err error)
URLQuery serializes BetaModelUpdateParams's query parameters as `url.Values`.
func (*BetaModelUpdateParams) UnmarshalJSON ¶ added in v0.11.0
func (r *BetaModelUpdateParams) UnmarshalJSON(data []byte) error
type BetaModelUpdateParamsVisibility ¶ added in v0.11.0
type BetaModelUpdateParamsVisibility string
Who can discover the model. `VISIBILITY_PRIVATE` restricts it to the project; `VISIBILITY_INTERNAL` shares it with the organization.
const ( BetaModelUpdateParamsVisibilityVisibilityPrivate BetaModelUpdateParamsVisibility = "VISIBILITY_PRIVATE" BetaModelUpdateParamsVisibilityVisibilityInternal BetaModelUpdateParamsVisibility = "VISIBILITY_INTERNAL" )
type BetaRlCheckpointDownloadParams ¶ added in v0.12.0
type BetaRlCheckpointDownloadParams struct {
// Checkpoint variant to download: merged (full model) or adapter (LoRA weights
// only)
//
// Any of "CHECKPOINT_VARIANT_UNSPECIFIED", "CHECKPOINT_VARIANT_MERGED",
// "CHECKPOINT_VARIANT_ADAPTER".
Variant CheckpointVariant `query:"variant,omitzero" api:"required" json:"-"`
// contains filtered or unexported fields
}
func (BetaRlCheckpointDownloadParams) URLQuery ¶ added in v0.12.0
func (r BetaRlCheckpointDownloadParams) URLQuery() (v url.Values, err error)
URLQuery serializes BetaRlCheckpointDownloadParams's query parameters as `url.Values`.
type BetaRlCheckpointService ¶ added in v0.12.0
type BetaRlCheckpointService struct {
Options []option.RequestOption
}
BetaRlCheckpointService 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 NewBetaRlCheckpointService method instead.
func NewBetaRlCheckpointService ¶ added in v0.12.0
func NewBetaRlCheckpointService(opts ...option.RequestOption) (r BetaRlCheckpointService)
NewBetaRlCheckpointService 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 (*BetaRlCheckpointService) Download ¶ added in v0.12.0
func (r *BetaRlCheckpointService) Download(ctx context.Context, id string, query BetaRlCheckpointDownloadParams, opts ...option.RequestOption) (res *CheckpointDownloadResponse, err error)
Returns presigned URLs for downloading a checkpoint's model files. Only inference checkpoints support downloading.
type BetaRlModelResourceEstimateCostParams ¶ added in v0.12.0
type BetaRlModelResourceEstimateCostParams struct {
// Base model to provision the resource for
BaseModel string `json:"base_model" api:"required"`
// Whether the resource hosts LoRA sessions or a single full-weight session
LoraEnabled param.Opt[bool] `json:"lora_enabled,omitzero"`
// Compute layout to provision.
ComputeConfig BetaRlModelResourceEstimateCostParamsComputeConfig `json:"compute_config,omitzero"`
// Optimizer configuration for this resource.
OptimizerConfig OptimizerConfigParam `json:"optimizer_config,omitzero"`
// contains filtered or unexported fields
}
func (BetaRlModelResourceEstimateCostParams) MarshalJSON ¶ added in v0.12.0
func (r BetaRlModelResourceEstimateCostParams) MarshalJSON() (data []byte, err error)
func (*BetaRlModelResourceEstimateCostParams) UnmarshalJSON ¶ added in v0.12.0
func (r *BetaRlModelResourceEstimateCostParams) UnmarshalJSON(data []byte) error
type BetaRlModelResourceEstimateCostParamsComputeConfig ¶ added in v0.12.0
type BetaRlModelResourceEstimateCostParamsComputeConfig struct {
// Number of generator replicas. 0 runs the trainer only, with no generator.
NumGeneratorReplicas param.Opt[int64] `json:"num_generator_replicas,omitzero"`
// contains filtered or unexported fields
}
Compute layout to provision.
func (BetaRlModelResourceEstimateCostParamsComputeConfig) MarshalJSON ¶ added in v0.12.0
func (r BetaRlModelResourceEstimateCostParamsComputeConfig) MarshalJSON() (data []byte, err error)
func (*BetaRlModelResourceEstimateCostParamsComputeConfig) UnmarshalJSON ¶ added in v0.12.0
func (r *BetaRlModelResourceEstimateCostParamsComputeConfig) UnmarshalJSON(data []byte) error
type BetaRlModelResourceListParams ¶ added in v0.12.0
type BetaRlModelResourceListParams struct {
// Cursor for pagination
After param.Opt[string] `query:"after,omitzero" json:"-"`
// Filter resources in the current project by the creator ID. Pass "me" to show
// resources you created.
CreatedBy param.Opt[string] `query:"created_by,omitzero" json:"-"`
// Maximum number of resources to return (1-100)
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Status filters. When omitted, resources in any status are returned.
//
// Any of "MODEL_RESOURCES_STATUS_PENDING", "MODEL_RESOURCES_STATUS_CREATING",
// "MODEL_RESOURCES_STATUS_READY", "MODEL_RESOURCES_STATUS_ERROR",
// "MODEL_RESOURCES_STATUS_STOPPED", "MODEL_RESOURCES_STATUS_STOPPING".
Status []string `query:"status,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (BetaRlModelResourceListParams) URLQuery ¶ added in v0.12.0
func (r BetaRlModelResourceListParams) URLQuery() (v url.Values, err error)
URLQuery serializes BetaRlModelResourceListParams's query parameters as `url.Values`.
type BetaRlModelResourceNewParams ¶ added in v0.12.0
type BetaRlModelResourceNewParams struct {
// Base model to provision the resource for
BaseModel string `json:"base_model" api:"required"`
// Whether the resource hosts LoRA sessions or a single full-weight session
LoraEnabled param.Opt[bool] `json:"lora_enabled,omitzero"`
// Compute layout to provision.
ComputeConfig BetaRlModelResourceNewParamsComputeConfig `json:"compute_config,omitzero"`
// Optimizer configuration for this resource.
OptimizerConfig OptimizerConfigParam `json:"optimizer_config,omitzero"`
// contains filtered or unexported fields
}
func (BetaRlModelResourceNewParams) MarshalJSON ¶ added in v0.12.0
func (r BetaRlModelResourceNewParams) MarshalJSON() (data []byte, err error)
func (*BetaRlModelResourceNewParams) UnmarshalJSON ¶ added in v0.12.0
func (r *BetaRlModelResourceNewParams) UnmarshalJSON(data []byte) error
type BetaRlModelResourceNewParamsComputeConfig ¶ added in v0.12.0
type BetaRlModelResourceNewParamsComputeConfig struct {
// Number of generator replicas. 0 runs the trainer only, with no generator.
NumGeneratorReplicas param.Opt[int64] `json:"num_generator_replicas,omitzero"`
// contains filtered or unexported fields
}
Compute layout to provision.
func (BetaRlModelResourceNewParamsComputeConfig) MarshalJSON ¶ added in v0.12.0
func (r BetaRlModelResourceNewParamsComputeConfig) MarshalJSON() (data []byte, err error)
func (*BetaRlModelResourceNewParamsComputeConfig) UnmarshalJSON ¶ added in v0.12.0
func (r *BetaRlModelResourceNewParamsComputeConfig) UnmarshalJSON(data []byte) error
type BetaRlModelResourceService ¶ added in v0.12.0
type BetaRlModelResourceService struct {
Options []option.RequestOption
}
BetaRlModelResourceService 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 NewBetaRlModelResourceService method instead.
func NewBetaRlModelResourceService ¶ added in v0.12.0
func NewBetaRlModelResourceService(opts ...option.RequestOption) (r BetaRlModelResourceService)
NewBetaRlModelResourceService 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 (*BetaRlModelResourceService) EstimateCost ¶ added in v0.12.0
func (r *BetaRlModelResourceService) EstimateCost(ctx context.Context, body BetaRlModelResourceEstimateCostParams, opts ...option.RequestOption) (res *ModelResourcesEstimateCostResponse, err error)
Estimates a model resource's on-demand hourly price without creating it.
func (*BetaRlModelResourceService) Get ¶ added in v0.12.0
func (r *BetaRlModelResourceService) Get(ctx context.Context, modelResourcesID string, opts ...option.RequestOption) (res *ModelResources, err error)
Gets a model resource by its ID and returns its details.
func (*BetaRlModelResourceService) List ¶ added in v0.12.0
func (r *BetaRlModelResourceService) List(ctx context.Context, query BetaRlModelResourceListParams, opts ...option.RequestOption) (res *ModelResourcesListResponse, err error)
Lists the caller's model resources.
func (*BetaRlModelResourceService) New ¶ added in v0.12.0
func (r *BetaRlModelResourceService) New(ctx context.Context, body BetaRlModelResourceNewParams, opts ...option.RequestOption) (res *ModelResources, err error)
Provisions a standalone model resource that training sessions can attach to.
func (*BetaRlModelResourceService) Stop ¶ added in v0.12.0
func (r *BetaRlModelResourceService) Stop(ctx context.Context, modelResourcesID string, body BetaRlModelResourceStopParams, opts ...option.RequestOption) (res *ModelResources, err error)
Stops every session attached to the resource and tears down its GPU pods.
type BetaRlModelResourceStopParams ¶ added in v0.12.0
type BetaRlModelResourceStopParams struct {
// Stop the resource even if active training sessions are attached
Force param.Opt[bool] `query:"force,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (BetaRlModelResourceStopParams) URLQuery ¶ added in v0.12.0
func (r BetaRlModelResourceStopParams) URLQuery() (v url.Values, err error)
URLQuery serializes BetaRlModelResourceStopParams's query parameters as `url.Values`.
type BetaRlOperationCustomForwardBackwardParams ¶ added in v0.12.0
type BetaRlOperationCustomForwardBackwardParams struct {
// Per-sample per-token gradients of the loss with respect to log-probabilities
Gradients []BetaRlOperationCustomForwardBackwardParamsGradient `json:"gradients,omitzero" api:"required"`
// Batch of training samples
Samples []BetaRlOperationCustomForwardBackwardParamsSample `json:"samples,omitzero" api:"required"`
// contains filtered or unexported fields
}
func (BetaRlOperationCustomForwardBackwardParams) MarshalJSON ¶ added in v0.12.0
func (r BetaRlOperationCustomForwardBackwardParams) MarshalJSON() (data []byte, err error)
func (*BetaRlOperationCustomForwardBackwardParams) UnmarshalJSON ¶ added in v0.12.0
func (r *BetaRlOperationCustomForwardBackwardParams) UnmarshalJSON(data []byte) error
type BetaRlOperationCustomForwardBackwardParamsGradient ¶ added in v0.12.0
type BetaRlOperationCustomForwardBackwardParamsGradient struct {
// Float array of per-token gradients (d loss / d log p)
Data []float64 `json:"data,omitzero" api:"required"`
// Data type of the float array
//
// Any of "D_TYPE_UNSPECIFIED", "D_TYPE_INT64", "D_TYPE_FLOAT32",
// "D_TYPE_BFLOAT16".
Dtype DType `json:"dtype,omitzero"`
// contains filtered or unexported fields
}
Per-token gradients of the loss with respect to target log-probabilities
The property Data is required.
func (BetaRlOperationCustomForwardBackwardParamsGradient) MarshalJSON ¶ added in v0.12.0
func (r BetaRlOperationCustomForwardBackwardParamsGradient) MarshalJSON() (data []byte, err error)
func (*BetaRlOperationCustomForwardBackwardParamsGradient) UnmarshalJSON ¶ added in v0.12.0
func (r *BetaRlOperationCustomForwardBackwardParamsGradient) UnmarshalJSON(data []byte) error
type BetaRlOperationCustomForwardBackwardParamsSample ¶ added in v0.12.0
type BetaRlOperationCustomForwardBackwardParamsSample struct {
// Loss function inputs
LossInputs LossInputsParam `json:"loss_inputs,omitzero" api:"required"`
// Model input
ModelInput ModelInputParam `json:"model_input,omitzero" api:"required"`
// Policy versions associated with this sample's tokens
PolicySegments []PolicyVersionSegmentParam `json:"policy_segments,omitzero" api:"required"`
// contains filtered or unexported fields
}
The properties LossInputs, ModelInput, PolicySegments are required.
func (BetaRlOperationCustomForwardBackwardParamsSample) MarshalJSON ¶ added in v0.12.0
func (r BetaRlOperationCustomForwardBackwardParamsSample) MarshalJSON() (data []byte, err error)
func (*BetaRlOperationCustomForwardBackwardParamsSample) UnmarshalJSON ¶ added in v0.12.0
func (r *BetaRlOperationCustomForwardBackwardParamsSample) UnmarshalJSON(data []byte) error
type BetaRlOperationForwardBackwardParams ¶ added in v0.12.0
type BetaRlOperationForwardBackwardParams struct {
// Loss function configuration
Loss LossConfigParam `json:"loss,omitzero" api:"required"`
// Batch of training samples to process
Samples []BetaRlOperationForwardBackwardParamsSample `json:"samples,omitzero" api:"required"`
// contains filtered or unexported fields
}
func (BetaRlOperationForwardBackwardParams) MarshalJSON ¶ added in v0.12.0
func (r BetaRlOperationForwardBackwardParams) MarshalJSON() (data []byte, err error)
func (*BetaRlOperationForwardBackwardParams) UnmarshalJSON ¶ added in v0.12.0
func (r *BetaRlOperationForwardBackwardParams) UnmarshalJSON(data []byte) error
type BetaRlOperationForwardBackwardParamsSample ¶ added in v0.12.0
type BetaRlOperationForwardBackwardParamsSample struct {
// Loss function inputs
LossInputs LossInputsParam `json:"loss_inputs,omitzero" api:"required"`
// Model input
ModelInput ModelInputParam `json:"model_input,omitzero" api:"required"`
// Policy versions associated with this sample's tokens
PolicySegments []PolicyVersionSegmentParam `json:"policy_segments,omitzero" api:"required"`
// contains filtered or unexported fields
}
The properties LossInputs, ModelInput, PolicySegments are required.
func (BetaRlOperationForwardBackwardParamsSample) MarshalJSON ¶ added in v0.12.0
func (r BetaRlOperationForwardBackwardParamsSample) MarshalJSON() (data []byte, err error)
func (*BetaRlOperationForwardBackwardParamsSample) UnmarshalJSON ¶ added in v0.12.0
func (r *BetaRlOperationForwardBackwardParamsSample) UnmarshalJSON(data []byte) error
type BetaRlOperationForwardParams ¶ added in v0.12.0
type BetaRlOperationForwardParams struct {
// Batch of training samples for which to compute per-token log-probabilities
Samples []BetaRlOperationForwardParamsSample `json:"samples,omitzero" api:"required"`
// contains filtered or unexported fields
}
func (BetaRlOperationForwardParams) MarshalJSON ¶ added in v0.12.0
func (r BetaRlOperationForwardParams) MarshalJSON() (data []byte, err error)
func (*BetaRlOperationForwardParams) UnmarshalJSON ¶ added in v0.12.0
func (r *BetaRlOperationForwardParams) UnmarshalJSON(data []byte) error
type BetaRlOperationForwardParamsSample ¶ added in v0.12.0
type BetaRlOperationForwardParamsSample struct {
// Loss function inputs
LossInputs LossInputsParam `json:"loss_inputs,omitzero" api:"required"`
// Model input
ModelInput ModelInputParam `json:"model_input,omitzero" api:"required"`
// Policy versions associated with this sample's tokens
PolicySegments []PolicyVersionSegmentParam `json:"policy_segments,omitzero" api:"required"`
// contains filtered or unexported fields
}
The properties LossInputs, ModelInput, PolicySegments are required.
func (BetaRlOperationForwardParamsSample) MarshalJSON ¶ added in v0.12.0
func (r BetaRlOperationForwardParamsSample) MarshalJSON() (data []byte, err error)
func (*BetaRlOperationForwardParamsSample) UnmarshalJSON ¶ added in v0.12.0
func (r *BetaRlOperationForwardParamsSample) UnmarshalJSON(data []byte) error
type BetaRlOperationGetCustomForwardBackwardParams ¶ added in v0.12.0
type BetaRlOperationGetCustomForwardBackwardParams struct {
// Training session ID
SessionID string `path:"session_id" api:"required" json:"-"`
// contains filtered or unexported fields
}
type BetaRlOperationGetForwardBackwardParams ¶ added in v0.12.0
type BetaRlOperationGetForwardBackwardParams struct {
// Training session ID
SessionID string `path:"session_id" api:"required" json:"-"`
// contains filtered or unexported fields
}
type BetaRlOperationGetForwardParams ¶ added in v0.12.0
type BetaRlOperationGetForwardParams struct {
// Training session ID
SessionID string `path:"session_id" api:"required" json:"-"`
// contains filtered or unexported fields
}
type BetaRlOperationGetInferenceCheckpointParams ¶ added in v0.12.0
type BetaRlOperationGetInferenceCheckpointParams struct {
// Training session ID
SessionID string `path:"session_id" api:"required" json:"-"`
// contains filtered or unexported fields
}
type BetaRlOperationGetOptimStepParams ¶ added in v0.12.0
type BetaRlOperationGetOptimStepParams struct {
// Training session ID
SessionID string `path:"session_id" api:"required" json:"-"`
// contains filtered or unexported fields
}
type BetaRlOperationGetSampleParams ¶ added in v0.12.0
type BetaRlOperationGetSampleParams struct {
// Training session ID
SessionID string `path:"session_id" api:"required" json:"-"`
// contains filtered or unexported fields
}
type BetaRlOperationGetTrainingCheckpointParams ¶ added in v0.12.0
type BetaRlOperationGetTrainingCheckpointParams struct {
// Training session ID
SessionID string `path:"session_id" api:"required" json:"-"`
// contains filtered or unexported fields
}
type BetaRlOperationOptimStepParams ¶ added in v0.12.0
type BetaRlOperationOptimStepParams struct {
// How the trainer's updated weights are propagated to the generator after this
// optimizer step. See `WeightSyncType` for accepted values.
//
// Any of "WEIGHT_SYNC_TYPE_UNSPECIFIED", "WEIGHT_SYNC_TYPE_SYNCHRONOUS",
// "WEIGHT_SYNC_TYPE_BACKGROUND_PUBLISH", "WEIGHT_SYNC_TYPE_PIPELINE".
WeightSyncType WeightSyncType `json:"weight_sync_type,omitzero" api:"required"`
// Maximum gradient norm for this step, gradients across all model parameters are
// clipped to this value. Set to 0 to disable gradient clipping. When unset,
// gradients are clipped to the session default (1.0).
MaxGradNorm param.Opt[float64] `json:"max_grad_norm,omitzero"`
// Per-step AdamW optimizer overrides.
AdamwParams AdamwOptimizerParams `json:"adamw_params,omitzero"`
// Per-step Muon optimizer overrides
MuonParams MuonOptimizerParams `json:"muon_params,omitzero"`
// contains filtered or unexported fields
}
func (BetaRlOperationOptimStepParams) MarshalJSON ¶ added in v0.12.0
func (r BetaRlOperationOptimStepParams) MarshalJSON() (data []byte, err error)
func (*BetaRlOperationOptimStepParams) UnmarshalJSON ¶ added in v0.12.0
func (r *BetaRlOperationOptimStepParams) UnmarshalJSON(data []byte) error
type BetaRlOperationSampleParams ¶ added in v0.12.0
type BetaRlOperationSampleParams struct {
// Model inputs to sample from
ModelInputs []ModelInputParam `json:"model_inputs,omitzero" api:"required"`
// Number of completions to generate per prompt
NumSamples param.Opt[int64] `json:"num_samples,omitzero"`
// Optional sampling parameters
SamplingParams SamplingParams `json:"sampling_params,omitzero"`
// contains filtered or unexported fields
}
func (BetaRlOperationSampleParams) MarshalJSON ¶ added in v0.12.0
func (r BetaRlOperationSampleParams) MarshalJSON() (data []byte, err error)
func (*BetaRlOperationSampleParams) UnmarshalJSON ¶ added in v0.12.0
func (r *BetaRlOperationSampleParams) UnmarshalJSON(data []byte) error
type BetaRlOperationService ¶ added in v0.12.0
type BetaRlOperationService struct {
Options []option.RequestOption
}
BetaRlOperationService 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 NewBetaRlOperationService method instead.
func NewBetaRlOperationService ¶ added in v0.12.0
func NewBetaRlOperationService(opts ...option.RequestOption) (r BetaRlOperationService)
NewBetaRlOperationService 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 (*BetaRlOperationService) CustomForwardBackward ¶ added in v0.12.0
func (r *BetaRlOperationService) CustomForwardBackward(ctx context.Context, sessionID string, body BetaRlOperationCustomForwardBackwardParams, opts ...option.RequestOption) (res *CustomForwardBackwardOperation, err error)
Submits a forward-backward pass driven by externally computed gradients of the loss with respect to per-token log-probabilities.
func (*BetaRlOperationService) Forward ¶ added in v0.12.0
func (r *BetaRlOperationService) Forward(ctx context.Context, sessionID string, body BetaRlOperationForwardParams, opts ...option.RequestOption) (res *ForwardOperation, err error)
Submits a forward operation that will asynchronously run a no-grad forward pass and return per-token log-probabilities for each sample.
func (*BetaRlOperationService) ForwardBackward ¶ added in v0.12.0
func (r *BetaRlOperationService) ForwardBackward(ctx context.Context, sessionID string, body BetaRlOperationForwardBackwardParams, opts ...option.RequestOption) (res *ForwardBackwardOperation, err error)
Submits a forward-backward pass operation that will asynchronously compute gradients via backpropagation.
func (*BetaRlOperationService) GetCustomForwardBackward ¶ added in v0.12.0
func (r *BetaRlOperationService) GetCustomForwardBackward(ctx context.Context, operationID string, query BetaRlOperationGetCustomForwardBackwardParams, opts ...option.RequestOption) (res *CustomForwardBackwardOperation, err error)
Retrieves the current status and result of a custom forward-backward operation.
func (*BetaRlOperationService) GetForward ¶ added in v0.12.0
func (r *BetaRlOperationService) GetForward(ctx context.Context, operationID string, query BetaRlOperationGetForwardParams, opts ...option.RequestOption) (res *ForwardOperation, err error)
Retrieves the current status and result of a forward operation.
func (*BetaRlOperationService) GetForwardBackward ¶ added in v0.12.0
func (r *BetaRlOperationService) GetForwardBackward(ctx context.Context, operationID string, query BetaRlOperationGetForwardBackwardParams, opts ...option.RequestOption) (res *ForwardBackwardOperation, err error)
Retrieves the current status and result of a forward-backward operation.
func (*BetaRlOperationService) GetInferenceCheckpoint ¶ added in v0.12.0
func (r *BetaRlOperationService) GetInferenceCheckpoint(ctx context.Context, operationID string, query BetaRlOperationGetInferenceCheckpointParams, opts ...option.RequestOption) (res *InferenceCheckpointOperation, err error)
Retrieves the current status and result of an inference checkpoint operation.
func (*BetaRlOperationService) GetOptimStep ¶ added in v0.12.0
func (r *BetaRlOperationService) GetOptimStep(ctx context.Context, operationID string, query BetaRlOperationGetOptimStepParams, opts ...option.RequestOption) (res *OptimStepOperation, err error)
Retrieves the current status and result of an optim-step operation.
func (*BetaRlOperationService) GetSample ¶ added in v0.12.0
func (r *BetaRlOperationService) GetSample(ctx context.Context, operationID string, query BetaRlOperationGetSampleParams, opts ...option.RequestOption) (res *SampleOperation, err error)
Retrieves the current status and result of a sample operation.
func (*BetaRlOperationService) GetTrainingCheckpoint ¶ added in v0.12.0
func (r *BetaRlOperationService) GetTrainingCheckpoint(ctx context.Context, operationID string, query BetaRlOperationGetTrainingCheckpointParams, opts ...option.RequestOption) (res *TrainingCheckpointOperation, err error)
Retrieves the current status and result of a save training checkpoint operation.
func (*BetaRlOperationService) NewInferenceCheckpoint ¶ added in v0.12.0
func (r *BetaRlOperationService) NewInferenceCheckpoint(ctx context.Context, sessionID string, opts ...option.RequestOption) (res *InferenceCheckpointOperation, err error)
Submits an operation that will asynchronously save the current LoRA adapter as an inference checkpoint and upload it to object storage.
func (*BetaRlOperationService) NewTrainingCheckpoint ¶ added in v0.12.0
func (r *BetaRlOperationService) NewTrainingCheckpoint(ctx context.Context, sessionID string, opts ...option.RequestOption) (res *TrainingCheckpointOperation, err error)
Submits an operation that will asynchronously save the full training state (adapter + optimizer + step).
func (*BetaRlOperationService) OptimStep ¶ added in v0.12.0
func (r *BetaRlOperationService) OptimStep(ctx context.Context, sessionID string, body BetaRlOperationOptimStepParams, opts ...option.RequestOption) (res *OptimStepOperation, err error)
Submits an optimizer step operation that will asynchronously apply accumulated gradients to update model parameters.
func (*BetaRlOperationService) Sample ¶ added in v0.12.0
func (r *BetaRlOperationService) Sample(ctx context.Context, sessionID string, body BetaRlOperationSampleParams, opts ...option.RequestOption) (res *SampleOperation, err error)
Submits a sample operation that will asynchronously generate text completions with logprobs.
type BetaRlService ¶ added in v0.12.0
type BetaRlService struct {
Options []option.RequestOption
Sessions BetaRlSessionService
Operations BetaRlOperationService
Checkpoints BetaRlCheckpointService
ModelResources BetaRlModelResourceService
SupportedModels BetaRlSupportedModelService
}
BetaRlService 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 NewBetaRlService method instead.
func NewBetaRlService ¶ added in v0.12.0
func NewBetaRlService(opts ...option.RequestOption) (r BetaRlService)
NewBetaRlService 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 BetaRlSessionListParams ¶ added in v0.12.0
type BetaRlSessionListParams struct {
// Cursor for pagination (ID of the last session from the previous page)
After param.Opt[string] `query:"after,omitzero" json:"-"`
// Filter sessions in the current project by the creator ID. Pass "me" to show
// sessions you created.
CreatedBy param.Opt[string] `query:"created_by,omitzero" json:"-"`
// Maximum number of sessions to return (1-100)
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Filter sessions by the model resource they are attached to
ModelResourcesID param.Opt[string] `query:"model_resources_id,omitzero" json:"-"`
// Status filters. When omitted, sessions in any status are returned.
//
// Any of "TRAINING_SESSION_STATUS_CREATING", "TRAINING_SESSION_STATUS_RUNNING",
// "TRAINING_SESSION_STATUS_STOPPED", "TRAINING_SESSION_STATUS_STOPPING",
// "TRAINING_SESSION_STATUS_ERROR", "TRAINING_SESSION_STATUS_EXPIRED".
Status []string `query:"status,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (BetaRlSessionListParams) URLQuery ¶ added in v0.12.0
func (r BetaRlSessionListParams) URLQuery() (v url.Values, err error)
URLQuery serializes BetaRlSessionListParams's query parameters as `url.Values`.
type BetaRlSessionNewParams ¶ added in v0.12.0
type BetaRlSessionNewParams struct {
// Model resource to attach the session to. The session runs on that resource's GPU
// pods.
ModelResourcesID string `json:"model_resources_id" api:"required"`
// Checkpoint ID to resume from
ResumeFromCheckpointID param.Opt[string] `json:"resume_from_checkpoint_id,omitzero"`
// HuggingFace repo (or hf://) to resume model weights from. Accepts either a full
// model or a PEFT adapter directory. Mutually exclusive with
// resume_from_checkpoint_id.
ResumeFromHfCheckpoint param.Opt[string] `json:"resume_from_hf_checkpoint,omitzero"`
// LoRA adapter configuration for the session
LoraConfig LoraConfigParam `json:"lora_config,omitzero"`
// contains filtered or unexported fields
}
func (BetaRlSessionNewParams) MarshalJSON ¶ added in v0.12.0
func (r BetaRlSessionNewParams) MarshalJSON() (data []byte, err error)
func (*BetaRlSessionNewParams) UnmarshalJSON ¶ added in v0.12.0
func (r *BetaRlSessionNewParams) UnmarshalJSON(data []byte) error
type BetaRlSessionService ¶ added in v0.12.0
type BetaRlSessionService struct {
Options []option.RequestOption
}
BetaRlSessionService 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 NewBetaRlSessionService method instead.
func NewBetaRlSessionService ¶ added in v0.12.0
func NewBetaRlSessionService(opts ...option.RequestOption) (r BetaRlSessionService)
NewBetaRlSessionService 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 (*BetaRlSessionService) Get ¶ added in v0.12.0
func (r *BetaRlSessionService) Get(ctx context.Context, sessionID string, opts ...option.RequestOption) (res *TrainingSession, err error)
Gets a training session by its ID and returns its details.
func (*BetaRlSessionService) List ¶ added in v0.12.0
func (r *BetaRlSessionService) List(ctx context.Context, query BetaRlSessionListParams, opts ...option.RequestOption) (res *TrainingSessionsListResponse, err error)
Lists all training sessions.
func (*BetaRlSessionService) New ¶ added in v0.12.0
func (r *BetaRlSessionService) New(ctx context.Context, body BetaRlSessionNewParams, opts ...option.RequestOption) (res *TrainingSession, err error)
Creates a training session and returns its details.
func (*BetaRlSessionService) Stop ¶ added in v0.12.0
func (r *BetaRlSessionService) Stop(ctx context.Context, sessionID string, opts ...option.RequestOption) (res *TrainingSession, err error)
Stops a training session.
type BetaRlSupportedModelService ¶ added in v0.12.0
type BetaRlSupportedModelService struct {
Options []option.RequestOption
}
BetaRlSupportedModelService 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 NewBetaRlSupportedModelService method instead.
func NewBetaRlSupportedModelService ¶ added in v0.12.0
func NewBetaRlSupportedModelService(opts ...option.RequestOption) (r BetaRlSupportedModelService)
NewBetaRlSupportedModelService 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 (*BetaRlSupportedModelService) Get ¶ added in v0.12.0
func (r *BetaRlSupportedModelService) Get(ctx context.Context, opts ...option.RequestOption) (res *RlSupportedModels, err error)
Returns the models supported by the RL service and their limits for training/sampling operations.
type BetaService ¶ added in v0.4.0
type BetaService struct {
Options []option.RequestOption
Endpoints BetaEndpointService
Models BetaModelService
Rl BetaRlService
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 ¶
func (r ChatCompletionChoiceMessageFunctionCall) RawJSON() string
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 ¶
func (r ChatCompletionChunkChoiceDelta) RawJSON() string
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 ¶
func (r ChatCompletionChunkChoiceDeltaFunctionCall) RawJSON() string
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 (u ChatCompletionNewParamsFunctionCallUnion) MarshalJSON() ([]byte, error)
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 (r ChatCompletionNewParamsMessageChatCompletionAssistantMessageParam) MarshalJSON() (data []byte, err error)
func (*ChatCompletionNewParamsMessageChatCompletionAssistantMessageParam) UnmarshalJSON ¶
func (r *ChatCompletionNewParamsMessageChatCompletionAssistantMessageParam) UnmarshalJSON(data []byte) error
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 (r ChatCompletionNewParamsMessageChatCompletionAssistantMessageParamFunctionCall) MarshalJSON() (data []byte, err error)
func (*ChatCompletionNewParamsMessageChatCompletionAssistantMessageParamFunctionCall) UnmarshalJSON ¶
func (r *ChatCompletionNewParamsMessageChatCompletionAssistantMessageParamFunctionCall) UnmarshalJSON(data []byte) error
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 (r ChatCompletionNewParamsMessageChatCompletionFunctionMessageParam) MarshalJSON() (data []byte, err error)
func (*ChatCompletionNewParamsMessageChatCompletionFunctionMessageParam) UnmarshalJSON ¶
func (r *ChatCompletionNewParamsMessageChatCompletionFunctionMessageParam) UnmarshalJSON(data []byte) error
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 (r ChatCompletionNewParamsMessageChatCompletionSystemMessageParam) MarshalJSON() (data []byte, err error)
func (*ChatCompletionNewParamsMessageChatCompletionSystemMessageParam) UnmarshalJSON ¶
func (r *ChatCompletionNewParamsMessageChatCompletionSystemMessageParam) UnmarshalJSON(data []byte) error
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 (r ChatCompletionNewParamsMessageChatCompletionToolMessageParam) MarshalJSON() (data []byte, err error)
func (*ChatCompletionNewParamsMessageChatCompletionToolMessageParam) UnmarshalJSON ¶
func (r *ChatCompletionNewParamsMessageChatCompletionToolMessageParam) UnmarshalJSON(data []byte) error
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 (r ChatCompletionNewParamsMessageChatCompletionUserMessageParam) MarshalJSON() (data []byte, err error)
func (*ChatCompletionNewParamsMessageChatCompletionUserMessageParam) UnmarshalJSON ¶
func (r *ChatCompletionNewParamsMessageChatCompletionUserMessageParam) UnmarshalJSON(data []byte) error
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 (r ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemAudio) MarshalJSON() (data []byte, err error)
func (*ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemAudio) UnmarshalJSON ¶
func (r *ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemAudio) UnmarshalJSON(data []byte) error
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 (r ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemAudioAudioURL) MarshalJSON() (data []byte, err error)
func (*ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemAudioAudioURL) UnmarshalJSON ¶
func (r *ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemAudioAudioURL) UnmarshalJSON(data []byte) error
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 (r ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemInputAudio) MarshalJSON() (data []byte, err error)
func (*ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemInputAudio) UnmarshalJSON ¶
func (r *ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemInputAudio) UnmarshalJSON(data []byte) error
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 (r ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemInputAudioInputAudio) MarshalJSON() (data []byte, err error)
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 ¶
func (u ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion) GetAudioURL() *ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemAudioAudioURL
Returns a pointer to the underlying variant's property, if present.
func (ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion) GetImageURL ¶
func (u ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion) GetImageURL() *ChatCompletionStructuredMessageImageURLImageURLParam
Returns a pointer to the underlying variant's property, if present.
func (ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion) GetInputAudio ¶
func (u ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion) GetInputAudio() *ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemInputAudioInputAudio
Returns a pointer to the underlying variant's property, if present.
func (ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion) GetText ¶
func (u ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion) GetText() *string
Returns a pointer to the underlying variant's property, if present.
func (ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion) GetType ¶
func (u ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion) GetType() *string
Returns a pointer to the underlying variant's property, if present.
func (ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion) GetVideoURL ¶
func (u ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion) GetVideoURL() *ChatCompletionStructuredMessageVideoURLVideoURLParam
Returns a pointer to the underlying variant's property, if present.
func (ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion) MarshalJSON ¶
func (*ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion) UnmarshalJSON ¶
func (u *ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion) UnmarshalJSON(data []byte) error
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 (u ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentUnion) MarshalJSON() ([]byte, error)
func (*ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentUnion) UnmarshalJSON ¶
func (u *ChatCompletionNewParamsMessageChatCompletionUserMessageParamContentUnion) UnmarshalJSON(data []byte) error
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 ¶
func (u ChatCompletionNewParamsMessageUnion) GetFunctionCall() *ChatCompletionNewParamsMessageChatCompletionAssistantMessageParamFunctionCall
Returns a pointer to the underlying variant's property, if present.
func (ChatCompletionNewParamsMessageUnion) GetName ¶
func (u ChatCompletionNewParamsMessageUnion) GetName() *string
Returns a pointer to the underlying variant's property, if present.
func (ChatCompletionNewParamsMessageUnion) GetRole ¶
func (u ChatCompletionNewParamsMessageUnion) GetRole() *string
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 ¶
func (u ChatCompletionNewParamsMessageUnion) GetToolCalls() []ToolChoiceParam
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 ¶
func (r *ChatCompletionNewParamsResponseFormatJsonObject) UnmarshalJSON(data []byte) error
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 ¶
func (r *ChatCompletionNewParamsResponseFormatJsonSchema) UnmarshalJSON(data []byte) error
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 (r ChatCompletionNewParamsResponseFormatJsonSchemaJsonSchema) MarshalJSON() (data []byte, err error)
func (*ChatCompletionNewParamsResponseFormatJsonSchemaJsonSchema) UnmarshalJSON ¶
func (r *ChatCompletionNewParamsResponseFormatJsonSchemaJsonSchema) UnmarshalJSON(data []byte) error
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 ¶
func (u ChatCompletionNewParamsResponseFormatUnion) GetJsonSchema() *ChatCompletionNewParamsResponseFormatJsonSchemaJsonSchema
Returns a pointer to the underlying variant's property, if present.
func (ChatCompletionNewParamsResponseFormatUnion) GetType ¶
func (u ChatCompletionNewParamsResponseFormatUnion) GetType() *string
Returns a pointer to the underlying variant's property, if present.
func (ChatCompletionNewParamsResponseFormatUnion) MarshalJSON ¶
func (u ChatCompletionNewParamsResponseFormatUnion) MarshalJSON() ([]byte, error)
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 ¶
func (r *ChatCompletionService) New(ctx context.Context, body ChatCompletionNewParams, opts ...option.RequestOption) (res *ChatCompletion, err error)
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 ¶
func (r *ChatCompletionService) NewStreaming(ctx context.Context, body ChatCompletionNewParams, opts ...option.RequestOption) (stream *ssestream.Stream[ChatCompletionChunk])
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 ¶
func (r *ChatCompletionStructuredMessageImageURLImageURLParam) UnmarshalJSON(data []byte) error
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 ¶
func (r *ChatCompletionStructuredMessageVideoURLVideoURLParam) UnmarshalJSON(data []byte) error
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 CheckpointDownloadResponse ¶ added in v0.12.0
type CheckpointDownloadResponse struct {
// List of files with presigned download URLs
Data []CheckpointFile `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:"-"`
}
Presigned download URLs for a checkpoint's files
func (CheckpointDownloadResponse) RawJSON ¶ added in v0.12.0
func (r CheckpointDownloadResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*CheckpointDownloadResponse) UnmarshalJSON ¶ added in v0.12.0
func (r *CheckpointDownloadResponse) UnmarshalJSON(data []byte) error
type CheckpointFile ¶ added in v0.12.0
type CheckpointFile struct {
// Name of the file
Filename string `json:"filename" api:"required"`
// File size in bytes
Size CheckpointFileSizeUnion `json:"size" api:"required"`
// Presigned URL for downloading the file
URL string `json:"url" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Filename respjson.Field
Size respjson.Field
URL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A downloadable file within a checkpoint
func (CheckpointFile) RawJSON ¶ added in v0.12.0
func (r CheckpointFile) RawJSON() string
Returns the unmodified JSON received from the API
func (*CheckpointFile) UnmarshalJSON ¶ added in v0.12.0
func (r *CheckpointFile) UnmarshalJSON(data []byte) error
type CheckpointFileSizeUnion ¶ added in v0.12.0
type CheckpointFileSizeUnion 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 [int64] instead of an object.
OfInt int64 `json:",inline"`
JSON struct {
OfString respjson.Field
OfInt respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
CheckpointFileSizeUnion contains all possible properties and values from [string], [int64].
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 OfInt]
func (CheckpointFileSizeUnion) AsInt ¶ added in v0.12.0
func (u CheckpointFileSizeUnion) AsInt() (v int64)
func (CheckpointFileSizeUnion) AsString ¶ added in v0.12.0
func (u CheckpointFileSizeUnion) AsString() (v string)
func (CheckpointFileSizeUnion) RawJSON ¶ added in v0.12.0
func (u CheckpointFileSizeUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*CheckpointFileSizeUnion) UnmarshalJSON ¶ added in v0.12.0
func (r *CheckpointFileSizeUnion) UnmarshalJSON(data []byte) error
type CheckpointVariant ¶ added in v0.12.0
type CheckpointVariant string
Checkpoint variant: merged (full model) or adapter (LoRA weights only)
const ( CheckpointVariantCheckpointVariantUnspecified CheckpointVariant = "CHECKPOINT_VARIANT_UNSPECIFIED" CheckpointVariantCheckpointVariantMerged CheckpointVariant = "CHECKPOINT_VARIANT_MERGED" CheckpointVariantCheckpointVariantAdapter CheckpointVariant = "CHECKPOINT_VARIANT_ADAPTER" )
type CispoLossInputsParam ¶ added in v0.12.0
type CispoLossInputsParam struct {
// Per-token advantages for CISPO
Advantages LossAdvantagesParam `json:"advantages,omitzero" api:"required"`
// Generator log probabilities for CISPO
GeneratorLogprobs LossLogprobsParam `json:"generator_logprobs,omitzero" api:"required"`
// contains filtered or unexported fields
}
The properties Advantages, GeneratorLogprobs are required.
func (CispoLossInputsParam) MarshalJSON ¶ added in v0.12.0
func (r CispoLossInputsParam) MarshalJSON() (data []byte, err error)
func (*CispoLossInputsParam) UnmarshalJSON ¶ added in v0.12.0
func (r *CispoLossInputsParam) UnmarshalJSON(data []byte) error
type CispoLossParams ¶ added in v0.12.0
type CispoLossParams struct {
// Upper absolute bound for the importance ratio; the clipped ratio is applied as a
// detached coefficient
ClipHighThreshold param.Opt[float64] `json:"clip_high_threshold,omitzero"`
// Lower absolute bound for the importance ratio; the clipped ratio is applied as a
// detached coefficient
ClipLowThreshold param.Opt[float64] `json:"clip_low_threshold,omitzero"`
// contains filtered or unexported fields
}
func (CispoLossParams) MarshalJSON ¶ added in v0.12.0
func (r CispoLossParams) MarshalJSON() (data []byte, err error)
func (*CispoLossParams) UnmarshalJSON ¶ added in v0.12.0
func (r *CispoLossParams) UnmarshalJSON(data []byte) error
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_PROJECT_ID, 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.
func (*Client) Whoami ¶ added in v0.11.0
func (r *Client) Whoami(ctx context.Context, opts ...option.RequestOption) (res *WhoamiResponse, err error)
Returns identity information about the authenticated API key. Useful for confirming which project and organization a key is scoped to, and for obtaining the project slug used to compose the `model` value (`<project_slug>/<endpoint_slug>`) in dedicated endpoint inference calls. Requires a Bearer API key in the `Authorization` header. Cookie, session, and SLS JWT credentials are not accepted.
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 GPUs to draw from a capacity pool. A component of the overall
// num_gpus, alongside num_reserved_gpus.
NumCapacityPoolGPUs int64 `json:"num_capacity_pool_gpus" 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"`
// Number of prepaid reserved GPUs for this cluster. A component of the overall
// num_gpus, alongside num_capacity_pool_gpus.
NumReservedGPUs int64 `json:"num_reserved_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"`
// Whether the control plane is currently ready.
ControlPlaneReady bool `json:"control_plane_ready"`
CreatedAt time.Time `json:"created_at" format:"date-time"`
// GPU worker nodes retained after they left the live data plane. These are
// separate from gpu_worker_nodes and must not be counted as live capacity.
DeletedGPUWorkerNodes []ClusterDeletedGPUWorkerNode `json:"deleted_gpu_worker_nodes"`
DurationHours int64 `json:"duration_hours"`
// Timestamp when the cluster first reached the Ready phase.
FirstReadyAt time.Time `json:"first_ready_at" format:"date-time"`
InstallTraefik bool `json:"install_traefik"`
// Whether the cluster is managed inside a substrate environment.
IsInSubstrate bool `json:"is_in_substrate"`
// ID of the machine cluster backing this GPU cluster.
MachineClusterID string `json:"machine_cluster_id"`
// Recent node lifecycle events such as scale-up, scale-down, and preemption.
// Combine these with live and deleted node lists to render the cluster timeline.
NodeLifecycleEvents []ClusterNodeLifecycleEvent `json:"node_lifecycle_events"`
// Internal NVIDIA version ID for this cluster's driver and CUDA combination.
NvidiaDriverVersionID string `json:"nvidia_driver_version_id"`
OidcConfig ClusterOidcConfig `json:"oidc_config"`
// Data-volume image name for GPU worker nodes.
OsImage string `json:"os_image"`
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"`
// UMS organization ID associated with this cluster.
UmsOrgID string `json:"ums_org_id"`
// UMS project ID associated with this cluster.
UmsProjectID string `json:"ums_project_id"`
// 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
NumCapacityPoolGPUs respjson.Field
NumCPUWorkers respjson.Field
NumGPUs respjson.Field
NumReservedGPUs 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
ControlPlaneReady respjson.Field
CreatedAt respjson.Field
DeletedGPUWorkerNodes respjson.Field
DurationHours respjson.Field
FirstReadyAt respjson.Field
InstallTraefik respjson.Field
IsInSubstrate respjson.Field
MachineClusterID respjson.Field
NodeLifecycleEvents respjson.Field
NvidiaDriverVersionID respjson.Field
OidcConfig respjson.Field
OsImage respjson.Field
ReservationEndTime respjson.Field
ReservationStartTime respjson.Field
SlurmShmSizeGib respjson.Field
UmsOrgID respjson.Field
UmsProjectID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Cluster) UnmarshalJSON ¶ added in v0.4.0
type ClusterAddOn ¶ added in v0.10.0
type ClusterAddOn struct {
AddOnType string `json:"add_on_type" api:"required"`
// Configuration for a cluster add-on.
Config ClusterAddOnConfig `json:"config" api:"required"`
Name string `json:"name" api:"required"`
// State for a cluster add-on.
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"`
// Configuration for the Headlamp Kubernetes dashboard add-on.
Headlamp ClusterAddOnConfigHeadlamp `json:"headlamp"`
Ingress ClusterAddOnConfigIngress `json:"ingress"`
// Configuration for the Slurm Web add-on.
SlurmWeb ClusterAddOnConfigSlurmWeb `json:"slurm_web"`
// Configuration for the Model Aware TorchPass add-on.
Torchpass ClusterAddOnConfigTorchpass `json:"torchpass"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Dashboard respjson.Field
Headlamp respjson.Field
Ingress respjson.Field
SlurmWeb respjson.Field
Torchpass respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Configuration for a cluster add-on.
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 ClusterAddOnConfigHeadlamp ¶ added in v0.12.0
type ClusterAddOnConfigHeadlamp struct {
// Whether to enable the Headlamp Kubernetes dashboard add-on.
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:"-"`
}
Configuration for the Headlamp Kubernetes dashboard add-on.
func (ClusterAddOnConfigHeadlamp) RawJSON ¶ added in v0.12.0
func (r ClusterAddOnConfigHeadlamp) RawJSON() string
Returns the unmodified JSON received from the API
func (*ClusterAddOnConfigHeadlamp) UnmarshalJSON ¶ added in v0.12.0
func (r *ClusterAddOnConfigHeadlamp) 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 ClusterAddOnConfigSlurmWeb ¶ added in v0.12.0
type ClusterAddOnConfigSlurmWeb struct {
// Whether to enable the Slurm Web add-on.
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:"-"`
}
Configuration for the Slurm Web add-on.
func (ClusterAddOnConfigSlurmWeb) RawJSON ¶ added in v0.12.0
func (r ClusterAddOnConfigSlurmWeb) RawJSON() string
Returns the unmodified JSON received from the API
func (*ClusterAddOnConfigSlurmWeb) UnmarshalJSON ¶ added in v0.12.0
func (r *ClusterAddOnConfigSlurmWeb) UnmarshalJSON(data []byte) error
type ClusterAddOnConfigTorchpass ¶ added in v0.11.0
type ClusterAddOnConfigTorchpass struct {
// Whether to enable the Model Aware TorchPass add-on.
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:"-"`
}
Configuration for the Model Aware TorchPass add-on.
func (ClusterAddOnConfigTorchpass) RawJSON ¶ added in v0.11.0
func (r ClusterAddOnConfigTorchpass) RawJSON() string
Returns the unmodified JSON received from the API
func (*ClusterAddOnConfigTorchpass) UnmarshalJSON ¶ added in v0.11.0
func (r *ClusterAddOnConfigTorchpass) UnmarshalJSON(data []byte) error
type ClusterAddOnState ¶ added in v0.10.0
type ClusterAddOnState struct {
Dashboard ClusterAddOnStateDashboard `json:"dashboard"`
// State for the Headlamp Kubernetes dashboard add-on.
Headlamp ClusterAddOnStateHeadlamp `json:"headlamp"`
Ingress ClusterAddOnStateIngress `json:"ingress"`
// State for the Slurm Web add-on.
SlurmWeb ClusterAddOnStateSlurmWeb `json:"slurm_web"`
// State for the Model Aware TorchPass add-on.
Torchpass ClusterAddOnStateTorchpass `json:"torchpass"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Dashboard respjson.Field
Headlamp respjson.Field
Ingress respjson.Field
SlurmWeb respjson.Field
Torchpass respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
State for a cluster add-on.
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 ClusterAddOnStateHeadlamp ¶ added in v0.12.0
type ClusterAddOnStateHeadlamp 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:"-"`
}
State for the Headlamp Kubernetes dashboard add-on.
func (ClusterAddOnStateHeadlamp) RawJSON ¶ added in v0.12.0
func (r ClusterAddOnStateHeadlamp) RawJSON() string
Returns the unmodified JSON received from the API
func (*ClusterAddOnStateHeadlamp) UnmarshalJSON ¶ added in v0.12.0
func (r *ClusterAddOnStateHeadlamp) 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 ClusterAddOnStateSlurmWeb ¶ added in v0.12.0
type ClusterAddOnStateSlurmWeb 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:"-"`
}
State for the Slurm Web add-on.
func (ClusterAddOnStateSlurmWeb) RawJSON ¶ added in v0.12.0
func (r ClusterAddOnStateSlurmWeb) RawJSON() string
Returns the unmodified JSON received from the API
func (*ClusterAddOnStateSlurmWeb) UnmarshalJSON ¶ added in v0.12.0
func (r *ClusterAddOnStateSlurmWeb) UnmarshalJSON(data []byte) error
type ClusterAddOnStateTorchpass ¶ added in v0.11.0
type ClusterAddOnStateTorchpass 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:"-"`
}
State for the Model Aware TorchPass add-on.
func (ClusterAddOnStateTorchpass) RawJSON ¶ added in v0.11.0
func (r ClusterAddOnStateTorchpass) RawJSON() string
Returns the unmodified JSON received from the API
func (*ClusterAddOnStateTorchpass) UnmarshalJSON ¶ added in v0.11.0
func (r *ClusterAddOnStateTorchpass) 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"`
// NVIDIA Network Operator chart/version for the tenant cluster (e.g. v24.7.0).
// When omitted, a service default is applied.
NetworkOperatorVersion string `json:"network_operator_version"`
Observability ClusterClusterConfigObservability `json:"observability"`
// SlurmStartupScripts carries optional Slurm lifecycle scripts (prolog/epilog,
// init, extra conf).
SlurmStartupScripts ClusterClusterConfigSlurmStartupScripts `json:"slurm_startup_scripts"`
// Whether this cluster uses a per-cluster SSH certificate authority for
// OIDC-signed SSH access.
SSHCaEnabled bool `json:"ssh_ca_enabled"`
// 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
NetworkOperatorVersion respjson.Field
Observability respjson.Field
SlurmStartupScripts respjson.Field
SSHCaEnabled 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
func (r ClusterClusterConfigObservability) RawJSON() string
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
func (r ClusterClusterConfigSlurmStartupScripts) RawJSON() string
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"`
// Public IPv4 address of the control plane node.
PublicIpv4 string `json:"public_ipv4"`
// 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
PublicIpv4 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
func (r ClusterControlPlaneNodePhaseTransition) RawJSON() string
Returns the unmodified JSON received from the API
func (*ClusterControlPlaneNodePhaseTransition) UnmarshalJSON ¶ added in v0.10.0
func (r *ClusterControlPlaneNodePhaseTransition) UnmarshalJSON(data []byte) error
type ClusterDeletedGPUWorkerNode ¶ added in v0.11.0
type ClusterDeletedGPUWorkerNode 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 []ClusterDeletedGPUWorkerNodePhaseTransition `json:"phase_transitions" api:"required"`
Status string `json:"status" api:"required"`
// Whether auto-remediation is enabled for this node's instance.
AutoRemediationEnabled bool `json:"auto_remediation_enabled"`
// Timestamp when the node left the live data plane. Only set for
// deleted_gpu_worker_nodes.
DeletedAt time.Time `json:"deleted_at" format:"date-time"`
// Ephemeral storage size, such as 1Ti.
EphemeralStorage string `json:"ephemeral_storage"`
// Number of InfiniBand HCAs.
IbHcaCount int64 `json:"ib_hca_count"`
// InfiniBand HCA type.
IbHcaType string `json:"ib_hca_type"`
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"`
// Whether this node is marked for deletion by the operator.
MarkedForDeletion bool `json:"marked_for_deletion"`
// Number of NVSwitches.
NvswitchCount int64 `json:"nvswitch_count"`
// NVSwitch type.
NvswitchType string `json:"nvswitch_type"`
// Public IPv4 address of the GPU worker node.
PublicIpv4 string `json:"public_ipv4"`
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
AutoRemediationEnabled respjson.Field
DeletedAt respjson.Field
EphemeralStorage respjson.Field
IbHcaCount respjson.Field
IbHcaType respjson.Field
InstanceID respjson.Field
LatestRemediation respjson.Field
MarkedForDeletion respjson.Field
NvswitchCount respjson.Field
NvswitchType respjson.Field
PublicIpv4 respjson.Field
SlurmWorkerHostname respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ClusterDeletedGPUWorkerNode) RawJSON ¶ added in v0.11.0
func (r ClusterDeletedGPUWorkerNode) RawJSON() string
Returns the unmodified JSON received from the API
func (*ClusterDeletedGPUWorkerNode) UnmarshalJSON ¶ added in v0.11.0
func (r *ClusterDeletedGPUWorkerNode) UnmarshalJSON(data []byte) error
type ClusterDeletedGPUWorkerNodePhaseTransition ¶ added in v0.11.0
type ClusterDeletedGPUWorkerNodePhaseTransition 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 (ClusterDeletedGPUWorkerNodePhaseTransition) RawJSON ¶ added in v0.11.0
func (r ClusterDeletedGPUWorkerNodePhaseTransition) RawJSON() string
Returns the unmodified JSON received from the API
func (*ClusterDeletedGPUWorkerNodePhaseTransition) UnmarshalJSON ¶ added in v0.11.0
func (r *ClusterDeletedGPUWorkerNodePhaseTransition) 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"`
// Whether auto-remediation is enabled for this node's instance.
AutoRemediationEnabled bool `json:"auto_remediation_enabled"`
// Timestamp when the node left the live data plane. Only set for
// deleted_gpu_worker_nodes.
DeletedAt time.Time `json:"deleted_at" format:"date-time"`
// Ephemeral storage size, such as 1Ti.
EphemeralStorage string `json:"ephemeral_storage"`
// Number of InfiniBand HCAs.
IbHcaCount int64 `json:"ib_hca_count"`
// InfiniBand HCA type.
IbHcaType string `json:"ib_hca_type"`
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"`
// Whether this node is marked for deletion by the operator.
MarkedForDeletion bool `json:"marked_for_deletion"`
// Number of NVSwitches.
NvswitchCount int64 `json:"nvswitch_count"`
// NVSwitch type.
NvswitchType string `json:"nvswitch_type"`
// Public IPv4 address of the GPU worker node.
PublicIpv4 string `json:"public_ipv4"`
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
AutoRemediationEnabled respjson.Field
DeletedAt respjson.Field
EphemeralStorage respjson.Field
IbHcaCount respjson.Field
IbHcaType respjson.Field
InstanceID respjson.Field
LatestRemediation respjson.Field
MarkedForDeletion respjson.Field
NvswitchCount respjson.Field
NvswitchType respjson.Field
PublicIpv4 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
func (r ClusterGPUWorkerNodePhaseTransition) RawJSON() string
Returns the unmodified JSON received from the API
func (*ClusterGPUWorkerNodePhaseTransition) UnmarshalJSON ¶ added in v0.10.0
func (r *ClusterGPUWorkerNodePhaseTransition) UnmarshalJSON(data []byte) error
type ClusterNodeLifecycleEvent ¶ added in v0.11.0
type ClusterNodeLifecycleEvent struct {
// Human-readable lifecycle event message.
Message string `json:"message" api:"required"`
// Tenant node name this lifecycle event applies to.
NodeID string `json:"node_id" api:"required"`
// Lifecycle event reason, for example TogetherScaledUp, TogetherScaledDown, or
// TogetherPreempted.
Reason string `json:"reason" api:"required"`
// Event timestamp.
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
NodeID respjson.Field
Reason respjson.Field
Timestamp respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Node lifecycle event included in a GPU cluster timeline.
func (ClusterNodeLifecycleEvent) RawJSON ¶ added in v0.11.0
func (r ClusterNodeLifecycleEvent) RawJSON() string
Returns the unmodified JSON received from the API
func (*ClusterNodeLifecycleEvent) UnmarshalJSON ¶ added in v0.11.0
func (r *ClusterNodeLifecycleEvent) 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" 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 ¶
func (r *CodeInterpreterService) Execute(ctx context.Context, body CodeInterpreterExecuteParams, opts ...option.RequestOption) (res *ExecuteResponseUnion, err error)
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 ¶
func (r *CodeInterpreterSessionService) List(ctx context.Context, opts ...option.RequestOption) (res *SessionListResponse, err error)
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 ¶
func (r CompletionChunkChoiceDeltaFunctionCall) RawJSON() string
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 ¶
func (r *CompletionService) New(ctx context.Context, body CompletionNewParams, opts ...option.RequestOption) (res *Completion, err error)
Generate text completions for a given prompt using a language, code, or image model.
func (*CompletionService) NewStreaming ¶
func (r *CompletionService) NewStreaming(ctx context.Context, body CompletionNewParams, opts ...option.RequestOption) (stream *ssestream.Stream[CompletionChunk])
Generate text completions for a given prompt using a language, code, or image model.
type Config ¶ added in v0.11.0
type Config struct {
// Config revision identifier.
ID string `json:"id" api:"required"`
// Model, hardware, and runtime combinations certified for this config revision.
Certifications []ConfigCertification `json:"certifications" api:"required"`
// ID of the project that owns the config revision. Public configs may be owned by
// a different project than the deployment.
ProjectID string `json:"projectId" api:"required"`
// Resource name of the referenced model, using
// `projects/{modelProject}/models/{modelId}`.
ReferenceModel string `json:"referenceModel" api:"required"`
// Deprecated. Use `referenceModel`. Reference model identifier.
ReferenceModelID string `json:"referenceModelId" api:"required"`
// Hardware and runtime selectors used to place and configure replicas.
Selectors []ConfigSelector `json:"selectors" api:"required"`
// Resource name of the draft model, using
// `projects/{draftProject}/models/{modelId}`; empty when speculative decoding is
// not enabled.
DraftModel string `json:"draftModel"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Certifications respjson.Field
ProjectID respjson.Field
ReferenceModel respjson.Field
ReferenceModelID respjson.Field
Selectors respjson.Field
DraftModel respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Immutable, user-facing configuration revision that defines how a compatible model runs, including engine and hardware selectors.
func (*Config) UnmarshalJSON ¶ added in v0.11.0
type ConfigCertification ¶ added in v0.11.0
type ConfigCertification struct {
// Whether the model and config combination passed certification.
//
// Any of "CERTIFICATION_TYPE_CERTIFIED", "CERTIFICATION_TYPE_UNCERTIFIED".
CertificationType string `json:"certificationType" api:"required"`
// Time when the certification decision was recorded.
CertifiedAt time.Time `json:"certifiedAt" api:"required" format:"date-time"`
// Service or reviewer that recorded the certification.
CertifiedBy string `json:"certifiedBy" api:"required"`
// Resource name of the certified model.
Model string `json:"model" api:"required"`
// Revision identifier of the certified model.
ModelRevisionID string `json:"modelRevisionId" api:"required"`
// Product or serving environment for which the combination was evaluated.
//
// Any of "CERTIFICATION_TARGET_DE_SERVERLESS", "CERTIFICATION_TARGET_MRE".
Target string `json:"target" api:"required"`
// Resource name of the certified draft model.
DraftModel string `json:"draftModel"`
// Revision identifier of the certified draft model.
DraftModelRevisionID string `json:"draftModelRevisionId"`
// Human-readable certification notes or limitations.
Notes string `json:"notes"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CertificationType respjson.Field
CertifiedAt respjson.Field
CertifiedBy respjson.Field
Model respjson.Field
ModelRevisionID respjson.Field
Target respjson.Field
DraftModel respjson.Field
DraftModelRevisionID respjson.Field
Notes respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Certification result for a model, config, and optional draft-model combination.
func (ConfigCertification) RawJSON ¶ added in v0.11.0
func (r ConfigCertification) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConfigCertification) UnmarshalJSON ¶ added in v0.11.0
func (r *ConfigCertification) UnmarshalJSON(data []byte) error
type ConfigSelector ¶ added in v0.11.0
type ConfigSelector struct {
// Selector name, such as GPU type, GPU count, or optimization profile.
Key string `json:"key" api:"required"`
// Required value for the selector.
Value string `json:"value" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Key respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Hardware or runtime requirement expressed as a key-value pair.
func (ConfigSelector) RawJSON ¶ added in v0.11.0
func (r ConfigSelector) RawJSON() string
Returns the unmodified JSON received from the API
func (*ConfigSelector) UnmarshalJSON ¶ added in v0.11.0
func (r *ConfigSelector) UnmarshalJSON(data []byte) error
type ContainerDeploymentStatus ¶ added in v0.11.0
type ContainerDeploymentStatus string
const ( ContainerDeploymentStatusUpdating ContainerDeploymentStatus = "Updating" ContainerDeploymentStatusScaling ContainerDeploymentStatus = "Scaling" ContainerDeploymentStatusReady ContainerDeploymentStatus = "Ready" ContainerDeploymentStatusFailed ContainerDeploymentStatus = "Failed" ContainerDeploymentStatusScaledToZero ContainerDeploymentStatus = "ScaledToZero" )
type CrossEntropyLossParams ¶ added in v0.12.0
type CrossEntropyLossParams struct {
// contains filtered or unexported fields
}
Cross-entropy loss parameters (currently empty).
func (CrossEntropyLossParams) MarshalJSON ¶ added in v0.12.0
func (r CrossEntropyLossParams) MarshalJSON() (data []byte, err error)
func (*CrossEntropyLossParams) UnmarshalJSON ¶ added in v0.12.0
func (r *CrossEntropyLossParams) UnmarshalJSON(data []byte) error
type CustomForwardBackwardOperation ¶ added in v0.12.0
type CustomForwardBackwardOperation struct {
// Operation ID
ID string `json:"id" api:"required"`
// Operation status
//
// Any of "TRAINING_OPERATION_STATUS_UNSPECIFIED",
// "TRAINING_OPERATION_STATUS_PENDING", "TRAINING_OPERATION_STATUS_RUNNING",
// "TRAINING_OPERATION_STATUS_COMPLETED", "TRAINING_OPERATION_STATUS_FAILED".
Status TrainingOperationStatus `json:"status" api:"required"`
// Error details on failure
Error TrainingOperationError `json:"error"`
// Result on success
Output CustomForwardBackwardResult `json:"output"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Status respjson.Field
Error respjson.Field
Output respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Async custom forward-backward pass operation
func (CustomForwardBackwardOperation) RawJSON ¶ added in v0.12.0
func (r CustomForwardBackwardOperation) RawJSON() string
Returns the unmodified JSON received from the API
func (*CustomForwardBackwardOperation) UnmarshalJSON ¶ added in v0.12.0
func (r *CustomForwardBackwardOperation) UnmarshalJSON(data []byte) error
type CustomForwardBackwardResult ¶ added in v0.12.0
type CustomForwardBackwardResult = any
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 ContainerDeploymentStatus `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 DeploymentAutoscaling ¶ added in v0.11.0
type DeploymentAutoscaling struct {
// Maximum number of replicas. Defaults to `minReplicas`; omitting it on update
// preserves the current value.
MaxReplicas int64 `json:"maxReplicas"`
// Minimum number of replicas. Omit on update to preserve the current value. Set
// both `minReplicas` and `maxReplicas` to `0` to stop the deployment.
MinReplicas int64 `json:"minReplicas"`
// Time a lower replica recommendation must remain stable before scaling down.
// Defaults to `5m`.
ScaleDownWindow string `json:"scaleDownWindow"`
// Idle period after which the deployment automatically stops and releases its
// replicas.
ScaleToZeroWindow string `json:"scaleToZeroWindow"`
// Stabilization window before scaling up.
ScaleUpWindow string `json:"scaleUpWindow"`
// Metrics and targets that drive replica recommendations. When omitted, the
// platform uses concurrent in-flight requests per replica.
ScalingMetrics []DeploymentAutoscalingScalingMetric `json:"scalingMetrics"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
MaxReplicas respjson.Field
MinReplicas respjson.Field
ScaleDownWindow respjson.Field
ScaleToZeroWindow respjson.Field
ScaleUpWindow respjson.Field
ScalingMetrics respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Autoscaling configuration for a deployment.
func (DeploymentAutoscaling) RawJSON ¶ added in v0.11.0
func (r DeploymentAutoscaling) RawJSON() string
Returns the unmodified JSON received from the API
func (DeploymentAutoscaling) ToParam ¶ added in v0.11.0
func (r DeploymentAutoscaling) ToParam() DeploymentAutoscalingParam
ToParam converts this DeploymentAutoscaling to a DeploymentAutoscalingParam.
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 DeploymentAutoscalingParam.Overrides()
func (*DeploymentAutoscaling) UnmarshalJSON ¶ added in v0.11.0
func (r *DeploymentAutoscaling) UnmarshalJSON(data []byte) error
type DeploymentAutoscalingCustomMetricAutoscalingConfig ¶ added in v0.7.0
type DeploymentAutoscalingCustomMetricAutoscalingConfig struct {
// CustomMetricName is the Prometheus metric name. 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
func (r DeploymentAutoscalingCustomMetricAutoscalingConfig) RawJSON() string
Returns the unmodified JSON received from the API
func (*DeploymentAutoscalingCustomMetricAutoscalingConfig) UnmarshalJSON ¶ added in v0.7.0
func (r *DeploymentAutoscalingCustomMetricAutoscalingConfig) UnmarshalJSON(data []byte) error
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
func (r DeploymentAutoscalingHTTPAutoscalingConfig) RawJSON() string
Returns the unmodified JSON received from the API
func (*DeploymentAutoscalingHTTPAutoscalingConfig) UnmarshalJSON ¶ added in v0.7.0
func (r *DeploymentAutoscalingHTTPAutoscalingConfig) UnmarshalJSON(data []byte) error
type DeploymentAutoscalingParam ¶ added in v0.11.0
type DeploymentAutoscalingParam struct {
// Maximum number of replicas. Defaults to `minReplicas`; omitting it on update
// preserves the current value.
MaxReplicas param.Opt[int64] `json:"maxReplicas,omitzero"`
// Minimum number of replicas. Omit on update to preserve the current value. Set
// both `minReplicas` and `maxReplicas` to `0` to stop the deployment.
MinReplicas param.Opt[int64] `json:"minReplicas,omitzero"`
// Time a lower replica recommendation must remain stable before scaling down.
// Defaults to `5m`.
ScaleDownWindow param.Opt[string] `json:"scaleDownWindow,omitzero"`
// Idle period after which the deployment automatically stops and releases its
// replicas.
ScaleToZeroWindow param.Opt[string] `json:"scaleToZeroWindow,omitzero"`
// Stabilization window before scaling up.
ScaleUpWindow param.Opt[string] `json:"scaleUpWindow,omitzero"`
// Metrics and targets that drive replica recommendations. When omitted, the
// platform uses concurrent in-flight requests per replica.
ScalingMetrics []DeploymentAutoscalingScalingMetricParam `json:"scalingMetrics,omitzero"`
// contains filtered or unexported fields
}
Autoscaling configuration for a deployment.
func (DeploymentAutoscalingParam) MarshalJSON ¶ added in v0.11.0
func (r DeploymentAutoscalingParam) MarshalJSON() (data []byte, err error)
func (*DeploymentAutoscalingParam) UnmarshalJSON ¶ added in v0.11.0
func (r *DeploymentAutoscalingParam) 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
func (r DeploymentAutoscalingQueueAutoscalingConfig) RawJSON() string
Returns the unmodified JSON received from the API
func (*DeploymentAutoscalingQueueAutoscalingConfig) UnmarshalJSON ¶ added in v0.7.0
func (r *DeploymentAutoscalingQueueAutoscalingConfig) UnmarshalJSON(data []byte) error
type DeploymentAutoscalingScalingMetric ¶ added in v0.11.0
type DeploymentAutoscalingScalingMetric struct {
// Metric name, such as `gpu_utilization`, `ttft`, `inflight_requests`,
// `e2e_latency`, `throughput_per_replica`, or `decoding_speed`.
Name string `json:"name" api:"required"`
// Target interpreted according to `type`. Utilization uses a percentage from 0 to
// 100, value uses an absolute measurement, and average value uses a per-replica
// measurement.
Target float64 `json:"target" api:"required"`
// Whether `target` is an absolute value, a utilization percentage, or a
// per-replica average.
//
// Any of "METRIC_TARGET_TYPE_VALUE", "METRIC_TARGET_TYPE_UTILIZATION",
// "METRIC_TARGET_TYPE_AVERAGE_VALUE".
Type string `json:"type" api:"required"`
// Percentile to evaluate for latency-based metrics: `p50`, `p90`, `p95`, or `p99`.
Percentile string `json:"percentile"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Name respjson.Field
Target respjson.Field
Type respjson.Field
Percentile respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Metric and target used by the autoscaler to recommend a replica count.
func (DeploymentAutoscalingScalingMetric) RawJSON ¶ added in v0.11.0
func (r DeploymentAutoscalingScalingMetric) RawJSON() string
Returns the unmodified JSON received from the API
func (*DeploymentAutoscalingScalingMetric) UnmarshalJSON ¶ added in v0.11.0
func (r *DeploymentAutoscalingScalingMetric) UnmarshalJSON(data []byte) error
type DeploymentAutoscalingScalingMetricParam ¶ added in v0.11.0
type DeploymentAutoscalingScalingMetricParam struct {
// Metric name, such as `gpu_utilization`, `ttft`, `inflight_requests`,
// `e2e_latency`, `throughput_per_replica`, or `decoding_speed`.
Name string `json:"name" api:"required"`
// Target interpreted according to `type`. Utilization uses a percentage from 0 to
// 100, value uses an absolute measurement, and average value uses a per-replica
// measurement.
Target float64 `json:"target" api:"required"`
// Whether `target` is an absolute value, a utilization percentage, or a
// per-replica average.
//
// Any of "METRIC_TARGET_TYPE_VALUE", "METRIC_TARGET_TYPE_UTILIZATION",
// "METRIC_TARGET_TYPE_AVERAGE_VALUE".
Type string `json:"type,omitzero" api:"required"`
// Percentile to evaluate for latency-based metrics: `p50`, `p90`, `p95`, or `p99`.
Percentile param.Opt[string] `json:"percentile,omitzero"`
// contains filtered or unexported fields
}
Metric and target used by the autoscaler to recommend a replica count.
The properties Name, Target, Type are required.
func (DeploymentAutoscalingScalingMetricParam) MarshalJSON ¶ added in v0.11.0
func (r DeploymentAutoscalingScalingMetricParam) MarshalJSON() (data []byte, err error)
func (*DeploymentAutoscalingScalingMetricParam) UnmarshalJSON ¶ added in v0.11.0
func (r *DeploymentAutoscalingScalingMetricParam) 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
func (r DeploymentEnvironmentVariable) RawJSON() string
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 DeploymentPlacementConfig ¶ added in v0.11.0
type DeploymentPlacementConfig struct {
// How strictly the regions list is enforced.
//
// Any of "ENFORCEMENT_REQUIRED", "ENFORCEMENT_PREFERRED".
Constraint DeploymentPlacementConfigConstraint `json:"constraint"`
// Regions where the deployment is allowed to run. Multiple regions allow
// best-effort replica spreading.
Regions []string `json:"regions"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Constraint respjson.Field
Regions respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Inline placement parameters expanded into scheduling rules by the server.
func (DeploymentPlacementConfig) RawJSON ¶ added in v0.11.0
func (r DeploymentPlacementConfig) RawJSON() string
Returns the unmodified JSON received from the API
func (DeploymentPlacementConfig) ToParam ¶ added in v0.11.0
func (r DeploymentPlacementConfig) ToParam() DeploymentPlacementConfigParam
ToParam converts this DeploymentPlacementConfig to a DeploymentPlacementConfigParam.
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 DeploymentPlacementConfigParam.Overrides()
func (*DeploymentPlacementConfig) UnmarshalJSON ¶ added in v0.11.0
func (r *DeploymentPlacementConfig) UnmarshalJSON(data []byte) error
type DeploymentPlacementConfigConstraint ¶ added in v0.11.0
type DeploymentPlacementConfigConstraint string
How strictly the regions list is enforced.
const ( DeploymentPlacementConfigConstraintEnforcementRequired DeploymentPlacementConfigConstraint = "ENFORCEMENT_REQUIRED" DeploymentPlacementConfigConstraintEnforcementPreferred DeploymentPlacementConfigConstraint = "ENFORCEMENT_PREFERRED" )
type DeploymentPlacementConfigParam ¶ added in v0.11.0
type DeploymentPlacementConfigParam struct {
// How strictly the regions list is enforced.
//
// Any of "ENFORCEMENT_REQUIRED", "ENFORCEMENT_PREFERRED".
Constraint DeploymentPlacementConfigConstraint `json:"constraint,omitzero"`
// Regions where the deployment is allowed to run. Multiple regions allow
// best-effort replica spreading.
Regions []string `json:"regions,omitzero"`
// contains filtered or unexported fields
}
Inline placement parameters expanded into scheduling rules by the server.
func (DeploymentPlacementConfigParam) MarshalJSON ¶ added in v0.11.0
func (r DeploymentPlacementConfigParam) MarshalJSON() (data []byte, err error)
func (*DeploymentPlacementConfigParam) UnmarshalJSON ¶ added in v0.11.0
func (r *DeploymentPlacementConfigParam) UnmarshalJSON(data []byte) error
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 struct {
// Human-readable explanation of the current state.
Message string `json:"message" api:"required"`
// High-level lifecycle state.
//
// Any of "DEPLOYMENT_STATE_PROVISIONING", "DEPLOYMENT_STATE_READY",
// "DEPLOYMENT_STATE_SCALING", "DEPLOYMENT_STATE_DEGRADED",
// "DEPLOYMENT_STATE_FAILED", "DEPLOYMENT_STATE_STOPPED",
// "DEPLOYMENT_STATE_STOPPING".
State DeploymentStatusState `json:"state" api:"required"`
// Total replicas actively serving traffic across all clusters.
ReadyReplicas int64 `json:"readyReplicas"`
// Replicas the scheduler has placed on clusters.
ScheduledReplicas int64 `json:"scheduledReplicas"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
State respjson.Field
ReadyReplicas respjson.Field
ScheduledReplicas respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Current status of a deployment, derived at read time from internal state.
func (DeploymentStatus) RawJSON ¶ added in v0.11.0
func (r DeploymentStatus) RawJSON() string
Returns the unmodified JSON received from the API
func (*DeploymentStatus) UnmarshalJSON ¶ added in v0.11.0
func (r *DeploymentStatus) UnmarshalJSON(data []byte) error
type DeploymentStatusState ¶ added in v0.11.0
type DeploymentStatusState string
High-level lifecycle state.
const ( DeploymentStatusStateDeploymentStateProvisioning DeploymentStatusState = "DEPLOYMENT_STATE_PROVISIONING" DeploymentStatusStateDeploymentStateReady DeploymentStatusState = "DEPLOYMENT_STATE_READY" DeploymentStatusStateDeploymentStateScaling DeploymentStatusState = "DEPLOYMENT_STATE_SCALING" DeploymentStatusStateDeploymentStateDegraded DeploymentStatusState = "DEPLOYMENT_STATE_DEGRADED" DeploymentStatusStateDeploymentStateFailed DeploymentStatusState = "DEPLOYMENT_STATE_FAILED" DeploymentStatusStateDeploymentStateStopped DeploymentStatusState = "DEPLOYMENT_STATE_STOPPED" DeploymentStatusStateDeploymentStateStopping DeploymentStatusState = "DEPLOYMENT_STATE_STOPPING" )
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 DroLossInputsParam ¶ added in v0.12.0
type DroLossInputsParam struct {
// Per-token advantages for DRO
Advantages LossAdvantagesParam `json:"advantages,omitzero" api:"required"`
// Generator log probabilities for DRO
GeneratorLogprobs LossLogprobsParam `json:"generator_logprobs,omitzero" api:"required"`
// contains filtered or unexported fields
}
The properties Advantages, GeneratorLogprobs are required.
func (DroLossInputsParam) MarshalJSON ¶ added in v0.12.0
func (r DroLossInputsParam) MarshalJSON() (data []byte, err error)
func (*DroLossInputsParam) UnmarshalJSON ¶ added in v0.12.0
func (r *DroLossInputsParam) UnmarshalJSON(data []byte) error
type DroLossParams ¶ added in v0.12.0
type DroLossParams struct {
// Coefficient on the quadratic log-ratio penalty. Required; there is no default.
Beta float64 `json:"beta" api:"required"`
// contains filtered or unexported fields
}
The property Beta is required.
func (DroLossParams) MarshalJSON ¶ added in v0.12.0
func (r DroLossParams) MarshalJSON() (data []byte, err error)
func (*DroLossParams) UnmarshalJSON ¶ added in v0.12.0
func (r *DroLossParams) 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) UnmarshalJSON ¶
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 Endpoint ¶ added in v0.11.0
type Endpoint struct {
// Unique endpoint identifier.
ID string `json:"id" api:"required"`
// Timestamp when the endpoint was created.
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
// Lightweight summaries of deployments under this endpoint. Retrieve a deployment
// through the endpoint's deployment API for full details.
Deployments []EndpointDeploymentSummary `json:"deployments" api:"required"`
// Serving class of the endpoint.
//
// Any of "ENDPOINT_TYPE_DEDICATED", "ENDPOINT_TYPE_SERVERLESS".
EndpointType EndpointEndpointType `json:"endpointType" api:"required"`
// Opaque version tag for optimistic concurrency control. Supply on update/delete
// to ensure consistent read-modify-write. If not set, the write overwrites based
// on current state.
Etag string `json:"etag" api:"required"`
// Project-qualified endpoint name in the form `<project_slug>/<endpoint_name>`.
// Pass this value as `model` in inference requests. Create and update requests may
// use either a bare endpoint name or the qualified form; a supplied project slug
// must match the project in the request path.
Name string `json:"name" api:"required"`
// ID of the project that owns the endpoint.
ProjectID string `json:"projectId" api:"required"`
// Deployments eligible for live traffic and their capacity weights. An empty list
// leaves the endpoint unrouted.
TrafficSplit []EndpointTrafficSplitEntry `json:"trafficSplit" api:"required"`
// Output only. Timestamp when the endpoint was last updated.
UpdatedAt time.Time `json:"updatedAt" api:"required" format:"date-time"`
// Who can discover the endpoint. `VISIBILITY_PRIVATE` restricts it to the project;
// `VISIBILITY_INTERNAL` shares it with the organization.
//
// Any of "VISIBILITY_PRIVATE", "VISIBILITY_INTERNAL".
Visibility EndpointVisibility `json:"visibility" api:"required"`
// ID of the currently active rollout, or empty if none.
ActiveRolloutID string `json:"activeRolloutId"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
Deployments respjson.Field
EndpointType respjson.Field
Etag respjson.Field
Name respjson.Field
ProjectID respjson.Field
TrafficSplit respjson.Field
UpdatedAt respjson.Field
Visibility respjson.Field
ActiveRolloutID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Stable inference entry point that groups deployments and routes requests among them.
func (*Endpoint) UnmarshalJSON ¶ added in v0.11.0
type EndpointAdapterAddParams ¶ added in v0.11.0
type EndpointAdapterAddParams struct {
// Combined identifier in format "endpoint_name:adapter_model_name".
ModelID string `json:"model_id" api:"required"`
// contains filtered or unexported fields
}
func (EndpointAdapterAddParams) MarshalJSON ¶ added in v0.11.0
func (r EndpointAdapterAddParams) MarshalJSON() (data []byte, err error)
func (*EndpointAdapterAddParams) UnmarshalJSON ¶ added in v0.11.0
func (r *EndpointAdapterAddParams) UnmarshalJSON(data []byte) error
type EndpointAdapterAddResponse ¶ added in v0.11.0
type EndpointAdapterAddResponse struct {
ModelID string `json:"model_id"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ModelID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (EndpointAdapterAddResponse) RawJSON ¶ added in v0.11.0
func (r EndpointAdapterAddResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*EndpointAdapterAddResponse) UnmarshalJSON ¶ added in v0.11.0
func (r *EndpointAdapterAddResponse) UnmarshalJSON(data []byte) error
type EndpointAdapterListResponse ¶ added in v0.11.0
type EndpointAdapterListResponse struct {
Data []EndpointAdapterListResponseData `json:"data"`
Object string `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 (EndpointAdapterListResponse) RawJSON ¶ added in v0.11.0
func (r EndpointAdapterListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*EndpointAdapterListResponse) UnmarshalJSON ¶ added in v0.11.0
func (r *EndpointAdapterListResponse) UnmarshalJSON(data []byte) error
type EndpointAdapterListResponseData ¶ added in v0.11.0
type EndpointAdapterListResponseData struct {
AdapterName string `json:"adapter_name"`
EndpointName string `json:"endpoint_name"`
// Combined endpoint:adapter identifier
ModelID string `json:"model_id"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AdapterName respjson.Field
EndpointName respjson.Field
ModelID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (EndpointAdapterListResponseData) RawJSON ¶ added in v0.11.0
func (r EndpointAdapterListResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*EndpointAdapterListResponseData) UnmarshalJSON ¶ added in v0.11.0
func (r *EndpointAdapterListResponseData) UnmarshalJSON(data []byte) error
type EndpointAdapterRemoveParams ¶ added in v0.11.0
type EndpointAdapterRemoveParams struct {
// Combined identifier in format "endpoint_name:adapter_model_name".
ModelID string `json:"model_id" api:"required"`
// contains filtered or unexported fields
}
func (EndpointAdapterRemoveParams) MarshalJSON ¶ added in v0.11.0
func (r EndpointAdapterRemoveParams) MarshalJSON() (data []byte, err error)
func (*EndpointAdapterRemoveParams) UnmarshalJSON ¶ added in v0.11.0
func (r *EndpointAdapterRemoveParams) UnmarshalJSON(data []byte) error
type EndpointAdapterRemoveResponse ¶ added in v0.11.0
type EndpointAdapterRemoveResponse struct {
Deleted bool `json:"deleted"`
ModelID string `json:"model_id"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Deleted respjson.Field
ModelID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (EndpointAdapterRemoveResponse) RawJSON ¶ added in v0.11.0
func (r EndpointAdapterRemoveResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*EndpointAdapterRemoveResponse) UnmarshalJSON ¶ added in v0.11.0
func (r *EndpointAdapterRemoveResponse) UnmarshalJSON(data []byte) error
type EndpointAdapterService ¶ added in v0.11.0
type EndpointAdapterService struct {
Options []option.RequestOption
}
EndpointAdapterService 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 NewEndpointAdapterService method instead.
func NewEndpointAdapterService ¶ added in v0.11.0
func NewEndpointAdapterService(opts ...option.RequestOption) (r EndpointAdapterService)
NewEndpointAdapterService 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 (*EndpointAdapterService) Add ¶ added in v0.11.0
func (r *EndpointAdapterService) Add(ctx context.Context, endpointID string, body EndpointAdapterAddParams, opts ...option.RequestOption) (res *EndpointAdapterAddResponse, err error)
Adds a LoRA adapter model to a dedicated endpoint. After this call, inference requests to the adapter model name will be routed to the specified endpoint. The endpoint must have LoRA enabled, and the adapter's base model must be compatible with the endpoint's model. The endpoint name prefix in model_id must match the resolved endpoint.
func (*EndpointAdapterService) List ¶ added in v0.11.0
func (r *EndpointAdapterService) List(ctx context.Context, endpointID string, opts ...option.RequestOption) (res *EndpointAdapterListResponse, err error)
Returns all LoRA adapters bound to the specified dedicated endpoint.
func (*EndpointAdapterService) Remove ¶ added in v0.11.0
func (r *EndpointAdapterService) Remove(ctx context.Context, endpointID string, body EndpointAdapterRemoveParams, opts ...option.RequestOption) (res *EndpointAdapterRemoveResponse, err error)
Removes the routing rule that binds an adapter to an endpoint. The adapter must be currently bound to this specific endpoint.
type EndpointDeployment ¶ added in v0.11.0
type EndpointDeployment struct {
// Unique deployment identifier.
ID string `json:"id" api:"required"`
// Replica bounds, timing windows, and metrics that control horizontal scaling.
Autoscaling EndpointDeploymentAutoscaling `json:"autoscaling" api:"required"`
// Immutable config revision in the form
// `projects/{projectId}/configs/{configRevisionId}`.
Config string `json:"config" api:"required"`
// Deprecated. Use `config`. Config revision identifier, populated during
// migration.
ConfigID string `json:"configId" api:"required"`
// Timestamp when the deployment was created.
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
// ID of the endpoint that contains the deployment.
EndpointID string `json:"endpointId" api:"required"`
// Opaque version tag for optimistic concurrency control. Supply on update/delete
// to ensure consistent read-modify-write. If not set, the write overwrites based
// on current state.
Etag string `json:"etag" api:"required"`
// Hardware selected by the deployment config, including GPU type and count.
Hardware string `json:"hardware" api:"required"`
// Pinned model resource in the form
// `projects/{projectId}/models/{modelId}/revisions/{revisionId}`.
Model string `json:"model" api:"required"`
// Deprecated. Use `model`. Model identifier being served, populated during
// migration.
ModelID string `json:"modelId" api:"required"`
// Deprecated. Use `model` with a /revisions/{revisionId} segment. Pin to a
// specific model revision.
ModelRevisionID string `json:"modelRevisionId" api:"required"`
// Project- and endpoint-qualified deployment name in the form
// `<project_slug>/<endpoint_name>/<deployment_name>`. Pass it as `model` in an
// inference request to target this deployment directly instead of using the
// endpoint's traffic split.
Name string `json:"name" api:"required"`
// ID of the project that owns the deployment.
ProjectID string `json:"projectId" api:"required"`
// Current status of a deployment, derived at read time from internal state.
Status DeploymentStatus `json:"status" api:"required"`
// Whether the deployment serves client-visible responses or only mirrored shadow
// traffic.
//
// Any of "TRAFFIC_MODE_LIVE", "TRAFFIC_MODE_SHADOW".
TrafficMode EndpointDeploymentTrafficMode `json:"trafficMode" api:"required"`
// Timestamp when the deployment was last updated.
UpdatedAt time.Time `json:"updatedAt" api:"required" format:"date-time"`
// Number of replicas the autoscaler currently wants across all regions.
DesiredReplicas int64 `json:"desiredReplicas"`
// Whether the deployment can dynamically load LoRA adapters.
EnableLora bool `json:"enableLora"`
// under the current routing configuration. Absent or unrouted deployments are 0.
EstimatedEffectiveTrafficShare float64 `json:"estimatedEffectiveTrafficShare"`
// Placement controls where a deployment is scheduled.
Placement EndpointDeploymentPlacementUnion `json:"placement"`
// Runtime information derived from the deployment's configuration.
RuntimeInfo EndpointDeploymentRuntimeInfo `json:"runtimeInfo"`
// Pinned draft-model resource used for speculative decoding, in the same form as
// `model`. Omitted when speculative decoding is disabled.
Speculator string `json:"speculator"`
// Deprecated. Use `speculator`. Speculative decoding model identifier derived from
// the deployment config.
SpeculatorID string `json:"speculatorId"`
// Deprecated. Use `speculator`. ID of the speculative decoding draft-model
// revision pinned at creation time.
SpeculatorRevisionID string `json:"speculatorRevisionId"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Autoscaling respjson.Field
Config respjson.Field
ConfigID respjson.Field
CreatedAt respjson.Field
EndpointID respjson.Field
Etag respjson.Field
Hardware respjson.Field
Model respjson.Field
ModelID respjson.Field
ModelRevisionID respjson.Field
Name respjson.Field
ProjectID respjson.Field
Status respjson.Field
TrafficMode respjson.Field
UpdatedAt respjson.Field
DesiredReplicas respjson.Field
EnableLora respjson.Field
EstimatedEffectiveTrafficShare respjson.Field
Placement respjson.Field
RuntimeInfo respjson.Field
Speculator respjson.Field
SpeculatorID respjson.Field
SpeculatorRevisionID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Serving workload that binds a model and immutable config to an endpoint and manages its replicas.
func (EndpointDeployment) RawJSON ¶ added in v0.11.0
func (r EndpointDeployment) RawJSON() string
Returns the unmodified JSON received from the API
func (*EndpointDeployment) UnmarshalJSON ¶ added in v0.11.0
func (r *EndpointDeployment) UnmarshalJSON(data []byte) error
type EndpointDeploymentAutoscaling ¶ added in v0.11.0
type EndpointDeploymentAutoscaling 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:"-"`
DeploymentAutoscaling
}
Replica bounds, timing windows, and metrics that control horizontal scaling.
func (EndpointDeploymentAutoscaling) RawJSON ¶ added in v0.11.0
func (r EndpointDeploymentAutoscaling) RawJSON() string
Returns the unmodified JSON received from the API
func (*EndpointDeploymentAutoscaling) UnmarshalJSON ¶ added in v0.11.0
func (r *EndpointDeploymentAutoscaling) UnmarshalJSON(data []byte) error
type EndpointDeploymentPlacementInline ¶ added in v0.11.0
type EndpointDeploymentPlacementInline struct {
// Inline placement parameters expanded into scheduling rules by the server.
Inline DeploymentPlacementConfig `json:"inline" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Inline respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (EndpointDeploymentPlacementInline) RawJSON ¶ added in v0.11.0
func (r EndpointDeploymentPlacementInline) RawJSON() string
Returns the unmodified JSON received from the API
func (*EndpointDeploymentPlacementInline) UnmarshalJSON ¶ added in v0.11.0
func (r *EndpointDeploymentPlacementInline) UnmarshalJSON(data []byte) error
type EndpointDeploymentPlacementProfile ¶ added in v0.11.0
type EndpointDeploymentPlacementProfile struct {
// UID of a saved placement profile.
Profile string `json:"profile" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Profile respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (EndpointDeploymentPlacementProfile) RawJSON ¶ added in v0.11.0
func (r EndpointDeploymentPlacementProfile) RawJSON() string
Returns the unmodified JSON received from the API
func (*EndpointDeploymentPlacementProfile) UnmarshalJSON ¶ added in v0.11.0
func (r *EndpointDeploymentPlacementProfile) UnmarshalJSON(data []byte) error
type EndpointDeploymentPlacementUnion ¶ added in v0.11.0
type EndpointDeploymentPlacementUnion struct {
// This field is from variant [EndpointDeploymentPlacementInline].
Inline DeploymentPlacementConfig `json:"inline"`
// This field is from variant [EndpointDeploymentPlacementProfile].
Profile string `json:"profile"`
JSON struct {
Inline respjson.Field
Profile respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
EndpointDeploymentPlacementUnion contains all possible properties and values from EndpointDeploymentPlacementInline, EndpointDeploymentPlacementProfile.
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: Inline]
func (EndpointDeploymentPlacementUnion) AsInline ¶ added in v0.11.0
func (u EndpointDeploymentPlacementUnion) AsInline() (v EndpointDeploymentPlacementInline)
func (EndpointDeploymentPlacementUnion) AsProfile ¶ added in v0.11.0
func (u EndpointDeploymentPlacementUnion) AsProfile() (v EndpointDeploymentPlacementProfile)
func (EndpointDeploymentPlacementUnion) RawJSON ¶ added in v0.11.0
func (u EndpointDeploymentPlacementUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*EndpointDeploymentPlacementUnion) UnmarshalJSON ¶ added in v0.11.0
func (r *EndpointDeploymentPlacementUnion) UnmarshalJSON(data []byte) error
type EndpointDeploymentRuntimeInfo ¶ added in v0.11.0
type EndpointDeploymentRuntimeInfo struct {
// Serving engine, such as `vllm`, `trtllm`, or `sglang`.
EngineType string `json:"engineType"`
// Version of the serving engine.
EngineVersion string `json:"engineVersion"`
// Whether the runtime accepts tool and function-calling requests.
FunctionCallingSupported bool `json:"functionCallingSupported"`
// Whether the runtime can constrain generation to a structured output schema.
StructuredOutputSupported bool `json:"structuredOutputSupported"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
EngineType respjson.Field
EngineVersion respjson.Field
FunctionCallingSupported respjson.Field
StructuredOutputSupported respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Runtime information derived from the deployment's configuration.
func (EndpointDeploymentRuntimeInfo) RawJSON ¶ added in v0.11.0
func (r EndpointDeploymentRuntimeInfo) RawJSON() string
Returns the unmodified JSON received from the API
func (*EndpointDeploymentRuntimeInfo) UnmarshalJSON ¶ added in v0.11.0
func (r *EndpointDeploymentRuntimeInfo) UnmarshalJSON(data []byte) error
type EndpointDeploymentSummary ¶ added in v0.11.0
type EndpointDeploymentSummary struct {
// Deployment identifier.
ID string `json:"id" api:"required"`
// Autoscaling configuration for the deployment.
Autoscaling EndpointDeploymentSummaryAutoscaling `json:"autoscaling" api:"required"`
// Timestamp when the deployment was created.
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
// deployment.
EstimatedEffectiveTrafficShare float64 `json:"estimatedEffectiveTrafficShare" api:"required"`
// Resource name of the served model in the form
// `projects/{projectId}/models/{modelId}/revisions/{revisionId}`. For public
// models, the model's owning project may differ from the deployment's project.
Model string `json:"model" api:"required"`
// Deprecated. Use `model`. Model identifier being served.
ModelID string `json:"modelId" api:"required"`
// Inference-addressable name in the fully-qualified form
// "<project_slug>/<endpoint_name>/<deployment_name>". Pass it as the "model" field
// when calling the inference API to pin to this deployment.
Name string `json:"name" api:"required"`
// Current state of the deployment.
//
// Any of "DEPLOYMENT_STATE_PROVISIONING", "DEPLOYMENT_STATE_READY",
// "DEPLOYMENT_STATE_SCALING", "DEPLOYMENT_STATE_DEGRADED",
// "DEPLOYMENT_STATE_FAILED", "DEPLOYMENT_STATE_STOPPED",
// "DEPLOYMENT_STATE_STOPPING".
State EndpointDeploymentSummaryState `json:"state" api:"required"`
// Whether the deployment serves client-visible responses or only mirrored shadow
// traffic.
//
// Any of "TRAFFIC_MODE_LIVE", "TRAFFIC_MODE_SHADOW".
TrafficMode EndpointDeploymentSummaryTrafficMode `json:"trafficMode" api:"required"`
// Number of replicas the autoscaler currently wants across all regions.
DesiredReplicas int64 `json:"desiredReplicas"`
// Hardware configuration selected by the deployment's config, such as its GPU type
// and count.
Hardware string `json:"hardware"`
// Number of replicas currently ready to serve requests across all regions.
ReadyReplicas int64 `json:"readyReplicas"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Autoscaling respjson.Field
CreatedAt respjson.Field
EstimatedEffectiveTrafficShare respjson.Field
Model respjson.Field
ModelID respjson.Field
Name respjson.Field
State respjson.Field
TrafficMode respjson.Field
DesiredReplicas respjson.Field
Hardware respjson.Field
ReadyReplicas respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Compact deployment status embedded in an endpoint response.
func (EndpointDeploymentSummary) RawJSON ¶ added in v0.11.0
func (r EndpointDeploymentSummary) RawJSON() string
Returns the unmodified JSON received from the API
func (*EndpointDeploymentSummary) UnmarshalJSON ¶ added in v0.11.0
func (r *EndpointDeploymentSummary) UnmarshalJSON(data []byte) error
type EndpointDeploymentSummaryAutoscaling ¶ added in v0.11.0
type EndpointDeploymentSummaryAutoscaling 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:"-"`
DeploymentAutoscaling
}
Autoscaling configuration for the deployment.
func (EndpointDeploymentSummaryAutoscaling) RawJSON ¶ added in v0.11.0
func (r EndpointDeploymentSummaryAutoscaling) RawJSON() string
Returns the unmodified JSON received from the API
func (*EndpointDeploymentSummaryAutoscaling) UnmarshalJSON ¶ added in v0.11.0
func (r *EndpointDeploymentSummaryAutoscaling) UnmarshalJSON(data []byte) error
type EndpointDeploymentSummaryState ¶ added in v0.11.0
type EndpointDeploymentSummaryState string
Current state of the deployment.
const ( EndpointDeploymentSummaryStateDeploymentStateProvisioning EndpointDeploymentSummaryState = "DEPLOYMENT_STATE_PROVISIONING" EndpointDeploymentSummaryStateDeploymentStateReady EndpointDeploymentSummaryState = "DEPLOYMENT_STATE_READY" EndpointDeploymentSummaryStateDeploymentStateScaling EndpointDeploymentSummaryState = "DEPLOYMENT_STATE_SCALING" EndpointDeploymentSummaryStateDeploymentStateDegraded EndpointDeploymentSummaryState = "DEPLOYMENT_STATE_DEGRADED" EndpointDeploymentSummaryStateDeploymentStateFailed EndpointDeploymentSummaryState = "DEPLOYMENT_STATE_FAILED" EndpointDeploymentSummaryStateDeploymentStateStopped EndpointDeploymentSummaryState = "DEPLOYMENT_STATE_STOPPED" EndpointDeploymentSummaryStateDeploymentStateStopping EndpointDeploymentSummaryState = "DEPLOYMENT_STATE_STOPPING" )
type EndpointDeploymentSummaryTrafficMode ¶ added in v0.11.0
type EndpointDeploymentSummaryTrafficMode string
Whether the deployment serves client-visible responses or only mirrored shadow traffic.
const ( EndpointDeploymentSummaryTrafficModeTrafficModeLive EndpointDeploymentSummaryTrafficMode = "TRAFFIC_MODE_LIVE" EndpointDeploymentSummaryTrafficModeTrafficModeShadow EndpointDeploymentSummaryTrafficMode = "TRAFFIC_MODE_SHADOW" )
type EndpointDeploymentTrafficMode ¶ added in v0.11.0
type EndpointDeploymentTrafficMode string
Whether the deployment serves client-visible responses or only mirrored shadow traffic.
const ( EndpointDeploymentTrafficModeTrafficModeLive EndpointDeploymentTrafficMode = "TRAFFIC_MODE_LIVE" EndpointDeploymentTrafficModeTrafficModeShadow EndpointDeploymentTrafficMode = "TRAFFIC_MODE_SHADOW" )
type EndpointEndpointType ¶ added in v0.11.0
type EndpointEndpointType string
Serving class of the endpoint.
const ( EndpointEndpointTypeEndpointTypeDedicated EndpointEndpointType = "ENDPOINT_TYPE_DEDICATED" EndpointEndpointTypeEndpointTypeServerless EndpointEndpointType = "ENDPOINT_TYPE_SERVERLESS" )
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
func (r EndpointListHardwareResponse) RawJSON() string
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
func (r EndpointListHardwareResponseData) RawJSON() string
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
func (r EndpointListHardwareResponseDataAvailability) RawJSON() string
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
func (r EndpointListHardwareResponseDataPricing) RawJSON() string
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
func (r EndpointListHardwareResponseDataSpecs) RawJSON() string
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
Adapters EndpointAdapterService
}
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 ¶
func (r *EndpointService) List(ctx context.Context, query EndpointListParams, opts ...option.RequestOption) (res *EndpointListResponse, err error)
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
func (r *EndpointService) ListHardware(ctx context.Context, query EndpointListHardwareParams, opts ...option.RequestOption) (res *EndpointListHardwareResponse, err error)
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 ¶
func (r *EndpointService) New(ctx context.Context, body EndpointNewParams, opts ...option.RequestOption) (res *DedicatedEndpoint, err error)
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 EndpointTrafficSplitEntry ¶ added in v0.11.0
type EndpointTrafficSplitEntry struct {
// ID of a deployment under the endpoint that can receive live traffic.
DeploymentID string `json:"deploymentId" api:"required"`
// Non-negative, finite weight applied to each ready replica. A deployment's
// effective routing capacity is `weight * readyReplicas`, and requests are
// distributed in proportion to that capacity. Set to `0` to remove the deployment
// from the live traffic split.
Weight float64 `json:"weight" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
DeploymentID respjson.Field
Weight respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Capacity weight assigned to one deployment in an endpoint's live traffic split.
func (EndpointTrafficSplitEntry) RawJSON ¶ added in v0.11.0
func (r EndpointTrafficSplitEntry) RawJSON() string
Returns the unmodified JSON received from the API
func (EndpointTrafficSplitEntry) ToParam ¶ added in v0.11.0
func (r EndpointTrafficSplitEntry) ToParam() EndpointTrafficSplitEntryParam
ToParam converts this EndpointTrafficSplitEntry to a EndpointTrafficSplitEntryParam.
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 EndpointTrafficSplitEntryParam.Overrides()
func (*EndpointTrafficSplitEntry) UnmarshalJSON ¶ added in v0.11.0
func (r *EndpointTrafficSplitEntry) UnmarshalJSON(data []byte) error
type EndpointTrafficSplitEntryParam ¶ added in v0.11.0
type EndpointTrafficSplitEntryParam struct {
// ID of a deployment under the endpoint that can receive live traffic.
DeploymentID string `json:"deploymentId" api:"required"`
// Non-negative, finite weight applied to each ready replica. A deployment's
// effective routing capacity is `weight * readyReplicas`, and requests are
// distributed in proportion to that capacity. Set to `0` to remove the deployment
// from the live traffic split.
Weight float64 `json:"weight" api:"required"`
// contains filtered or unexported fields
}
Capacity weight assigned to one deployment in an endpoint's live traffic split.
The properties DeploymentID, Weight are required.
func (EndpointTrafficSplitEntryParam) MarshalJSON ¶ added in v0.11.0
func (r EndpointTrafficSplitEntryParam) MarshalJSON() (data []byte, err error)
func (*EndpointTrafficSplitEntryParam) UnmarshalJSON ¶ added in v0.11.0
func (r *EndpointTrafficSplitEntryParam) UnmarshalJSON(data []byte) error
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 EndpointVisibility ¶ added in v0.11.0
type EndpointVisibility string
Who can discover the endpoint. `VISIBILITY_PRIVATE` restricts it to the project; `VISIBILITY_INTERNAL` shares it with the organization.
const ( EndpointVisibilityVisibilityPrivate EndpointVisibility = "VISIBILITY_PRIVATE" EndpointVisibilityVisibilityInternal EndpointVisibility = "VISIBILITY_INTERNAL" )
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 ¶
func (r *EvalNewParamsParametersEvaluationClassifyParameters) UnmarshalJSON(data []byte) error
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 (r EvalNewParamsParametersEvaluationClassifyParametersJudge) MarshalJSON() (data []byte, err error)
func (*EvalNewParamsParametersEvaluationClassifyParametersJudge) UnmarshalJSON ¶
func (r *EvalNewParamsParametersEvaluationClassifyParametersJudge) UnmarshalJSON(data []byte) error
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 (r EvalNewParamsParametersEvaluationClassifyParametersModelToEvaluateEvaluationModelRequest) MarshalJSON() (data []byte, err error)
func (*EvalNewParamsParametersEvaluationClassifyParametersModelToEvaluateEvaluationModelRequest) UnmarshalJSON ¶
func (r *EvalNewParamsParametersEvaluationClassifyParametersModelToEvaluateEvaluationModelRequest) UnmarshalJSON(data []byte) error
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 (u EvalNewParamsParametersEvaluationClassifyParametersModelToEvaluateUnion) MarshalJSON() ([]byte, error)
func (*EvalNewParamsParametersEvaluationClassifyParametersModelToEvaluateUnion) UnmarshalJSON ¶
func (u *EvalNewParamsParametersEvaluationClassifyParametersModelToEvaluateUnion) UnmarshalJSON(data []byte) error
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 ¶
func (r *EvalNewParamsParametersEvaluationCompareParameters) UnmarshalJSON(data []byte) error
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 (r EvalNewParamsParametersEvaluationCompareParametersJudge) MarshalJSON() (data []byte, err error)
func (*EvalNewParamsParametersEvaluationCompareParametersJudge) UnmarshalJSON ¶
func (r *EvalNewParamsParametersEvaluationCompareParametersJudge) UnmarshalJSON(data []byte) error
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 (r EvalNewParamsParametersEvaluationCompareParametersModelAEvaluationModelRequest) MarshalJSON() (data []byte, err error)
func (*EvalNewParamsParametersEvaluationCompareParametersModelAEvaluationModelRequest) UnmarshalJSON ¶
func (r *EvalNewParamsParametersEvaluationCompareParametersModelAEvaluationModelRequest) UnmarshalJSON(data []byte) error
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 (u EvalNewParamsParametersEvaluationCompareParametersModelAUnion) MarshalJSON() ([]byte, error)
func (*EvalNewParamsParametersEvaluationCompareParametersModelAUnion) UnmarshalJSON ¶
func (u *EvalNewParamsParametersEvaluationCompareParametersModelAUnion) UnmarshalJSON(data []byte) error
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 (r EvalNewParamsParametersEvaluationCompareParametersModelBEvaluationModelRequest) MarshalJSON() (data []byte, err error)
func (*EvalNewParamsParametersEvaluationCompareParametersModelBEvaluationModelRequest) UnmarshalJSON ¶
func (r *EvalNewParamsParametersEvaluationCompareParametersModelBEvaluationModelRequest) UnmarshalJSON(data []byte) error
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 (u EvalNewParamsParametersEvaluationCompareParametersModelBUnion) MarshalJSON() ([]byte, error)
func (*EvalNewParamsParametersEvaluationCompareParametersModelBUnion) UnmarshalJSON ¶
func (u *EvalNewParamsParametersEvaluationCompareParametersModelBUnion) UnmarshalJSON(data []byte) error
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 ¶
func (r *EvalNewParamsParametersEvaluationScoreParameters) UnmarshalJSON(data []byte) error
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 (r EvalNewParamsParametersEvaluationScoreParametersJudge) MarshalJSON() (data []byte, err error)
func (*EvalNewParamsParametersEvaluationScoreParametersJudge) UnmarshalJSON ¶
func (r *EvalNewParamsParametersEvaluationScoreParametersJudge) UnmarshalJSON(data []byte) error
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 (r EvalNewParamsParametersEvaluationScoreParametersModelToEvaluateEvaluationModelRequest) MarshalJSON() (data []byte, err error)
func (*EvalNewParamsParametersEvaluationScoreParametersModelToEvaluateEvaluationModelRequest) UnmarshalJSON ¶
func (r *EvalNewParamsParametersEvaluationScoreParametersModelToEvaluateEvaluationModelRequest) UnmarshalJSON(data []byte) error
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 (u EvalNewParamsParametersEvaluationScoreParametersModelToEvaluateUnion) MarshalJSON() ([]byte, error)
func (*EvalNewParamsParametersEvaluationScoreParametersModelToEvaluateUnion) UnmarshalJSON ¶
func (u *EvalNewParamsParametersEvaluationScoreParametersModelToEvaluateUnion) UnmarshalJSON(data []byte) error
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 ¶
func (u EvalNewParamsParametersUnion) GetModelA() *EvalNewParamsParametersEvaluationCompareParametersModelAUnion
Returns a pointer to the underlying variant's property, if present.
func (EvalNewParamsParametersUnion) GetModelB ¶
func (u EvalNewParamsParametersUnion) GetModelB() *EvalNewParamsParametersEvaluationCompareParametersModelBUnion
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"`
// 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"`
// JSON string representing label counts
LabelCounts string `json:"label_counts"`
// Pecentage of pass labels.
PassPercentage float64 `json:"pass_percentage" api:"nullable"`
// 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 ¶
func (r EvalStatusResponseResultsEvaluationClassifyResults) RawJSON() string
Returns the unmodified JSON received from the API
func (*EvalStatusResponseResultsEvaluationClassifyResults) UnmarshalJSON ¶
func (r *EvalStatusResponseResultsEvaluationClassifyResults) UnmarshalJSON(data []byte) error
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"`
// 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"`
// 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 score
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 ¶
func (r EvalStatusResponseResultsEvaluationCompareResults) RawJSON() string
Returns the unmodified JSON received from the API
func (*EvalStatusResponseResultsEvaluationCompareResults) UnmarshalJSON ¶
func (r *EvalStatusResponseResultsEvaluationCompareResults) UnmarshalJSON(data []byte) error
type EvalStatusResponseResultsEvaluationScoreResults ¶
type EvalStatusResponseResultsEvaluationScoreResults struct {
AggregatedScores EvalStatusResponseResultsEvaluationScoreResultsAggregatedScores `json:"aggregated_scores"`
// number of failed samples generated from model
FailedSamples float64 `json:"failed_samples"`
// Number of failed generations.
GenerationFailCount float64 `json:"generation_fail_count" api:"nullable"`
// number of invalid scores generated from model
InvalidScoreCount float64 `json:"invalid_score_count"`
// Number of failed judge generations
JudgeFailCount float64 `json:"judge_fail_count" api:"nullable"`
// 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 ¶
func (r EvalStatusResponseResultsEvaluationScoreResults) RawJSON() string
Returns the unmodified JSON received from the API
func (*EvalStatusResponseResultsEvaluationScoreResults) UnmarshalJSON ¶
func (r *EvalStatusResponseResultsEvaluationScoreResults) UnmarshalJSON(data []byte) error
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 ¶
func (r EvalStatusResponseResultsEvaluationScoreResultsAggregatedScores) RawJSON() string
Returns the unmodified JSON received from the API
func (*EvalStatusResponseResultsEvaluationScoreResultsAggregatedScores) UnmarshalJSON ¶
func (r *EvalStatusResponseResultsEvaluationScoreResultsAggregatedScores) UnmarshalJSON(data []byte) error
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 ¶
func (u EvalStatusResponseResultsUnion) RawJSON() string
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"`
// 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"`
// JSON string representing label counts
LabelCounts string `json:"label_counts"`
// Pecentage of pass labels.
PassPercentage float64 `json:"pass_percentage" api:"nullable"`
// 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 ¶
func (r EvaluationJobResultsEvaluationClassifyResults) RawJSON() string
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"`
// 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"`
// 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 score
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 ¶
func (r EvaluationJobResultsEvaluationCompareResults) RawJSON() string
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"`
// Number of failed generations.
GenerationFailCount float64 `json:"generation_fail_count" api:"nullable"`
// number of invalid scores generated from model
InvalidScoreCount float64 `json:"invalid_score_count"`
// Number of failed judge generations
JudgeFailCount float64 `json:"judge_fail_count" api:"nullable"`
// 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 ¶
func (r EvaluationJobResultsEvaluationScoreResults) RawJSON() string
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 ¶
func (r EvaluationJobResultsEvaluationScoreResultsAggregatedScores) RawJSON() string
Returns the unmodified JSON received from the API
func (*EvaluationJobResultsEvaluationScoreResultsAggregatedScores) UnmarshalJSON ¶
func (r *EvaluationJobResultsEvaluationScoreResultsAggregatedScores) UnmarshalJSON(data []byte) error
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 ¶
func (r ExecuteResponseFailedExecution) RawJSON() string
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 (u ExecuteResponseFailedExecutionErrorUnion) AsAnyMap() (v map[string]any)
func (ExecuteResponseFailedExecutionErrorUnion) AsString ¶
func (u ExecuteResponseFailedExecutionErrorUnion) AsString() (v string)
func (ExecuteResponseFailedExecutionErrorUnion) RawJSON ¶
func (u ExecuteResponseFailedExecutionErrorUnion) RawJSON() string
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 ¶
func (r ExecuteResponseSuccessfulExecution) RawJSON() string
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 ¶
func (r ExecuteResponseSuccessfulExecutionData) RawJSON() string
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 ¶
func (r ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput) RawJSON() string
Returns the unmodified JSON received from the API
func (*ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput) UnmarshalJSON ¶
func (r *ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput) UnmarshalJSON(data []byte) error
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 ¶
func (r ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData) RawJSON() string
Returns the unmodified JSON received from the API
func (*ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData) UnmarshalJSON ¶
func (r *ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData) UnmarshalJSON(data []byte) error
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 ¶
func (r ExecuteResponseSuccessfulExecutionDataOutputError) RawJSON() string
Returns the unmodified JSON received from the API
func (*ExecuteResponseSuccessfulExecutionDataOutputError) UnmarshalJSON ¶
func (r *ExecuteResponseSuccessfulExecutionDataOutputError) UnmarshalJSON(data []byte) error
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 ¶
func (r ExecuteResponseSuccessfulExecutionDataOutputStreamOutput) RawJSON() string
Returns the unmodified JSON received from the API
func (*ExecuteResponseSuccessfulExecutionDataOutputStreamOutput) UnmarshalJSON ¶
func (r *ExecuteResponseSuccessfulExecutionDataOutputStreamOutput) UnmarshalJSON(data []byte) error
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 (u ExecuteResponseSuccessfulExecutionDataOutputUnion) AsDisplayorExecuteOutput() (v ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput)
func (ExecuteResponseSuccessfulExecutionDataOutputUnion) AsStreamOutput ¶
func (u ExecuteResponseSuccessfulExecutionDataOutputUnion) AsStreamOutput() (v ExecuteResponseSuccessfulExecutionDataOutputStreamOutput)
func (ExecuteResponseSuccessfulExecutionDataOutputUnion) RawJSON ¶
func (u ExecuteResponseSuccessfulExecutionDataOutputUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ExecuteResponseSuccessfulExecutionDataOutputUnion) UnmarshalJSON ¶
func (r *ExecuteResponseSuccessfulExecutionDataOutputUnion) UnmarshalJSON(data []byte) error
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 ¶
func (r *ExecuteResponseSuccessfulExecutionDataOutputUnionData) UnmarshalJSON(data []byte) error
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) UnmarshalJSON ¶
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"`
// Deprecated. Whether file has been fully uploaded.
//
// Deprecated: deprecated
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"`
// Lifecycle state of the file validation pipeline. Files for non-`fine-tune`
// purposes skip validation.
//
// Any of "PENDING", "QUEUED", "RUNNING", "COMPLETED", "FAILED", "INVALID_FORMAT".
ProcessingStatus FileResponseProcessingStatus `json:"processing_status"`
// Report produced by the file validation pipeline. Present once validation has
// run; absent on files that bypassed validation (non-`fine-tune` purposes) or have
// not yet been validated.
ValidationReport FileResponseValidationReport `json:"validation_report"`
// 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
ProcessingStatus respjson.Field
ValidationReport 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 FileResponseProcessingStatus ¶ added in v0.11.0
type FileResponseProcessingStatus string
Lifecycle state of the file validation pipeline. Files for non-`fine-tune` purposes skip validation.
const ( FileResponseProcessingStatusPending FileResponseProcessingStatus = "PENDING" FileResponseProcessingStatusQueued FileResponseProcessingStatus = "QUEUED" FileResponseProcessingStatusRunning FileResponseProcessingStatus = "RUNNING" FileResponseProcessingStatusCompleted FileResponseProcessingStatus = "COMPLETED" FileResponseProcessingStatusFailed FileResponseProcessingStatus = "FAILED" FileResponseProcessingStatusInvalidFormat FileResponseProcessingStatus = "INVALID_FORMAT" )
type FileResponseValidationReport ¶ added in v0.11.0
type FileResponseValidationReport struct {
// Whether the file passed validation.
Valid bool `json:"valid" api:"required"`
// Detected dataset format (e.g. `CONVERSATION`, `INSTRUCTION`).
DatasetFormat string `json:"dataset_format"`
// Whether the dataset carries per-message weights (only possible for
// `CONVERSATION` format).
DatasetHasMessageWeights bool `json:"dataset_has_message_weights"`
// Whether the dataset contains parallel tool-use messages.
DatasetHasParallelToolCalls bool `json:"dataset_has_parallel_tool_calls"`
// Whether the dataset contains reasoning content.
DatasetHasReasoning bool `json:"dataset_has_reasoning"`
// Whether the dataset carries per-sample weights.
DatasetHasSampleWeights bool `json:"dataset_has_sample_weights"`
// Whether the dataset contains tool-use messages.
DatasetHasTools bool `json:"dataset_has_tools"`
// Whether the dataset contains multimodal content.
DatasetIsMultimodal bool `json:"dataset_is_multimodal"`
// Human-readable validation error message. Only present when `error_type` is set
// (i.e. user-correctable failures).
Error string `json:"error"`
// Category of validation failure.
//
// Any of "INVALID_FORMAT".
ErrorType string `json:"error_type"`
// ID of the file this report describes.
FileID string `json:"file_id"`
// Number of lines (records) in the dataset.
Nlines int64 `json:"nlines"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Valid respjson.Field
DatasetFormat respjson.Field
DatasetHasMessageWeights respjson.Field
DatasetHasParallelToolCalls respjson.Field
DatasetHasReasoning respjson.Field
DatasetHasSampleWeights respjson.Field
DatasetHasTools respjson.Field
DatasetIsMultimodal respjson.Field
Error respjson.Field
ErrorType respjson.Field
FileID respjson.Field
Nlines respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Report produced by the file validation pipeline. Present once validation has run; absent on files that bypassed validation (non-`fine-tune` purposes) or have not yet been validated.
func (FileResponseValidationReport) RawJSON ¶ added in v0.11.0
func (r FileResponseValidationReport) RawJSON() string
Returns the unmodified JSON received from the API
func (*FileResponseValidationReport) UnmarshalJSON ¶ added in v0.11.0
func (r *FileResponseValidationReport) 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 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 FineTunePreviewResponse ¶ added in v0.12.0
type FineTunePreviewResponse struct {
// Detected SFT dataset format for the sampled rows.
//
// Any of "general", "conversation", "instruction".
DatasetFormat FineTunePreviewResponseDatasetFormat `json:"dataset_format" api:"required"`
// Maximum sequence length configured for the requested model.
MaxSeqLength int64 `json:"max_seq_length" api:"required"`
// Name of the base model used to tokenize the sampled rows.
Model string `json:"model" api:"required"`
// Tokenized preview rows, in the same order as the sampled training file rows.
Rows []FineTunePreviewRow `json:"rows" api:"required"`
// Whether prompt or user-message tokens contribute to training loss.
TrainOnInputs bool `json:"train_on_inputs" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
DatasetFormat respjson.Field
MaxSeqLength respjson.Field
Model respjson.Field
Rows respjson.Field
TrainOnInputs respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Tokenized preview for sampled rows from a fine-tuning training file.
func (FineTunePreviewResponse) RawJSON ¶ added in v0.12.0
func (r FineTunePreviewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*FineTunePreviewResponse) UnmarshalJSON ¶ added in v0.12.0
func (r *FineTunePreviewResponse) UnmarshalJSON(data []byte) error
type FineTunePreviewResponseDatasetFormat ¶ added in v0.12.0
type FineTunePreviewResponseDatasetFormat string
Detected SFT dataset format for the sampled rows.
const ( FineTunePreviewResponseDatasetFormatGeneral FineTunePreviewResponseDatasetFormat = "general" FineTunePreviewResponseDatasetFormatConversation FineTunePreviewResponseDatasetFormat = "conversation" FineTunePreviewResponseDatasetFormatInstruction FineTunePreviewResponseDatasetFormat = "instruction" )
type FineTunePreviewRow ¶ added in v0.12.0
type FineTunePreviewRow struct {
// Token IDs produced for the sampled row.
InputIDs []int64 `json:"input_ids" api:"required"`
// Training labels for each token; masked tokens use -100.
Labels []int64 `json:"labels" api:"required"`
// Total number of tokens in the preview row after truncation.
NumTokens int64 `json:"num_tokens" api:"required"`
// Number of tokens in the row that contribute to training loss.
NumTrainedTokens int64 `json:"num_trained_tokens" api:"required"`
// Raw token strings produced for the sampled row.
Tokens []string `json:"tokens" api:"required"`
// Half-open token index ranges that contribute to training loss.
TrainedSpans [][]int64 `json:"trained_spans" api:"required"`
// Whether the row was truncated to the model maximum sequence length.
Truncated bool `json:"truncated" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
InputIDs respjson.Field
Labels respjson.Field
NumTokens respjson.Field
NumTrainedTokens respjson.Field
Tokens respjson.Field
TrainedSpans respjson.Field
Truncated respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Tokenized representation of one sampled fine-tuning row.
func (FineTunePreviewRow) RawJSON ¶ added in v0.12.0
func (r FineTunePreviewRow) RawJSON() string
Returns the unmodified JSON received from the API
func (*FineTunePreviewRow) UnmarshalJSON ¶ added in v0.12.0
func (r *FineTunePreviewRow) UnmarshalJSON(data []byte) 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"`
// ID of the user who created the fine-tune job.
UserID string `json:"user_id" api:"required"`
// Batch size used for training
BatchSize int64 `json:"batch_size"`
// Whether the early-stopping criterion triggered.
EarlyStopped bool `json:"early_stopped"`
// Best validation loss observed, corresponding to early_stopping_best_step. Null
// if no improving evaluation was recorded.
EarlyStoppingBestMetric float64 `json:"early_stopping_best_metric" api:"nullable"`
// Step associated with the selected early-stopping artifact. When
// early_stopping_best_metric is null, no finite best metric was recorded; this is
// the halt step, not a best-checkpoint step.
EarlyStoppingBestStep int64 `json:"early_stopping_best_step"`
// 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"`
// 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
UserID respjson.Field
BatchSize respjson.Field
EarlyStopped respjson.Field
EarlyStoppingBestMetric respjson.Field
EarlyStoppingBestStep 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
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 ¶
func (r FineTuningCancelResponseLrScheduler) RawJSON() string
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 ¶
func (r FineTuningCancelResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs) RawJSON() string
Returns the unmodified JSON received from the API
func (*FineTuningCancelResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs) UnmarshalJSON ¶
func (r *FineTuningCancelResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs) UnmarshalJSON(data []byte) error
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 ¶
func (r FineTuningCancelResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs) RawJSON() string
Returns the unmodified JSON received from the API
func (*FineTuningCancelResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs) UnmarshalJSON ¶
func (r *FineTuningCancelResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs) UnmarshalJSON(data []byte) error
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 ¶
func (u FineTuningCancelResponseLrSchedulerLrSchedulerArgsUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*FineTuningCancelResponseLrSchedulerLrSchedulerArgsUnion) UnmarshalJSON ¶
func (r *FineTuningCancelResponseLrSchedulerLrSchedulerArgsUnion) UnmarshalJSON(data []byte) error
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
func (r FineTuningCancelResponseProgress) RawJSON() string
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 ¶
func (r FineTuningCancelResponseTrainingMethodTrainingMethodDpo) RawJSON() string
Returns the unmodified JSON received from the API
func (*FineTuningCancelResponseTrainingMethodTrainingMethodDpo) UnmarshalJSON ¶
func (r *FineTuningCancelResponseTrainingMethodTrainingMethodDpo) UnmarshalJSON(data []byte) error
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 ¶
func (r FineTuningCancelResponseTrainingMethodTrainingMethodSft) RawJSON() string
Returns the unmodified JSON received from the API
func (*FineTuningCancelResponseTrainingMethodTrainingMethodSft) UnmarshalJSON ¶
func (r *FineTuningCancelResponseTrainingMethodTrainingMethodSft) UnmarshalJSON(data []byte) error
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 (u FineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsBool() (v bool)
func (FineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsFineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsString ¶
func (u FineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsFineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsString() (v string)
func (FineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) RawJSON ¶
func (u FineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*FineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) UnmarshalJSON ¶
func (r *FineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) UnmarshalJSON(data []byte) error
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 ¶
func (u FineTuningCancelResponseTrainingMethodUnion) RawJSON() string
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 ¶
func (r FineTuningCancelResponseTrainingTypeFullTrainingType) RawJSON() string
Returns the unmodified JSON received from the API
func (*FineTuningCancelResponseTrainingTypeFullTrainingType) UnmarshalJSON ¶
func (r *FineTuningCancelResponseTrainingTypeFullTrainingType) UnmarshalJSON(data []byte) error
type FineTuningCancelResponseTrainingTypeLoRaTrainingType ¶
type FineTuningCancelResponseTrainingTypeLoRaTrainingType struct {
// Scaling factor applied to the LoRA adapter weights.
LoraAlpha int64 `json:"lora_alpha" api:"required"`
// Rank of the LoRA adapter matrices.
LoraR int64 `json:"lora_r" api:"required"`
// Identifies this request as a LoRA fine-tune.
//
// Any of "Lora".
Type string `json:"type" api:"required"`
// Dropout probability applied to LoRA adapter inputs.
LoraDropout float64 `json:"lora_dropout"`
// Comma-separated LoRA target modules. Use `all-linear` for model defaults; MoE
// expert modules (`w_up`, `w_gate`, `w_down`) can be combined with attention
// modules on compatible models. Fine-tunes that target any expert module produce
// adapter-only output.
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:"-"`
}
LoRA training configuration for a fine-tuning job.
func (FineTuningCancelResponseTrainingTypeLoRaTrainingType) RawJSON ¶
func (r FineTuningCancelResponseTrainingTypeLoRaTrainingType) RawJSON() string
Returns the unmodified JSON received from the API
func (*FineTuningCancelResponseTrainingTypeLoRaTrainingType) UnmarshalJSON ¶
func (r *FineTuningCancelResponseTrainingTypeLoRaTrainingType) UnmarshalJSON(data []byte) error
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 ¶
func (u FineTuningCancelResponseTrainingTypeUnion) RawJSON() string
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 the checkpoint step to download from the list checkpoints response. A
// final checkpoint step downloads the final model; 0 or omitted downloads the
// final model by default. 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 (r FineTuningEstimatePriceParamsTrainingMethodTrainingMethodDpo) MarshalJSON() (data []byte, err error)
func (*FineTuningEstimatePriceParamsTrainingMethodTrainingMethodDpo) UnmarshalJSON ¶ added in v0.2.0
func (r *FineTuningEstimatePriceParamsTrainingMethodTrainingMethodDpo) UnmarshalJSON(data []byte) error
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 (r FineTuningEstimatePriceParamsTrainingMethodTrainingMethodSft) MarshalJSON() (data []byte, err error)
func (*FineTuningEstimatePriceParamsTrainingMethodTrainingMethodSft) UnmarshalJSON ¶ added in v0.2.0
func (r *FineTuningEstimatePriceParamsTrainingMethodTrainingMethodSft) UnmarshalJSON(data []byte) error
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 (u FineTuningEstimatePriceParamsTrainingMethodTrainingMethodSftTrainOnInputsUnion) MarshalJSON() ([]byte, error)
func (*FineTuningEstimatePriceParamsTrainingMethodTrainingMethodSftTrainOnInputsUnion) UnmarshalJSON ¶ added in v0.2.0
func (u *FineTuningEstimatePriceParamsTrainingMethodTrainingMethodSftTrainOnInputsUnion) UnmarshalJSON(data []byte) error
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
func (u FineTuningEstimatePriceParamsTrainingMethodUnion) GetDpoBeta() *float64
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
func (u FineTuningEstimatePriceParamsTrainingMethodUnion) GetMethod() *string
Returns a pointer to the underlying variant's property, if present.
func (FineTuningEstimatePriceParamsTrainingMethodUnion) GetRpoAlpha ¶ added in v0.2.0
func (u FineTuningEstimatePriceParamsTrainingMethodUnion) GetRpoAlpha() *float64
Returns a pointer to the underlying variant's property, if present.
func (FineTuningEstimatePriceParamsTrainingMethodUnion) GetSimpoGamma ¶ added in v0.2.0
func (u FineTuningEstimatePriceParamsTrainingMethodUnion) GetSimpoGamma() *float64
Returns a pointer to the underlying variant's property, if present.
func (FineTuningEstimatePriceParamsTrainingMethodUnion) GetTrainOnInputs ¶ added in v0.2.0
func (u FineTuningEstimatePriceParamsTrainingMethodUnion) GetTrainOnInputs() *FineTuningEstimatePriceParamsTrainingMethodTrainingMethodSftTrainOnInputsUnion
Returns a pointer to the underlying variant's property, if present.
func (FineTuningEstimatePriceParamsTrainingMethodUnion) MarshalJSON ¶ added in v0.2.0
func (u FineTuningEstimatePriceParamsTrainingMethodUnion) MarshalJSON() ([]byte, error)
func (*FineTuningEstimatePriceParamsTrainingMethodUnion) UnmarshalJSON ¶ added in v0.2.0
func (u *FineTuningEstimatePriceParamsTrainingMethodUnion) UnmarshalJSON(data []byte) error
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 (r FineTuningEstimatePriceParamsTrainingTypeFullTrainingType) MarshalJSON() (data []byte, err error)
func (*FineTuningEstimatePriceParamsTrainingTypeFullTrainingType) UnmarshalJSON ¶ added in v0.2.0
func (r *FineTuningEstimatePriceParamsTrainingTypeFullTrainingType) UnmarshalJSON(data []byte) error
type FineTuningEstimatePriceParamsTrainingTypeLoRaTrainingType ¶ added in v0.2.0
type FineTuningEstimatePriceParamsTrainingTypeLoRaTrainingType struct {
// Scaling factor applied to the LoRA adapter weights.
LoraAlpha int64 `json:"lora_alpha" api:"required"`
// Rank of the LoRA adapter matrices.
LoraR int64 `json:"lora_r" api:"required"`
// Identifies this request as a LoRA fine-tune.
//
// Any of "Lora".
Type string `json:"type,omitzero" api:"required"`
// Dropout probability applied to LoRA adapter inputs.
LoraDropout param.Opt[float64] `json:"lora_dropout,omitzero"`
// Comma-separated LoRA target modules. Use `all-linear` for model defaults; MoE
// expert modules (`w_up`, `w_gate`, `w_down`) can be combined with attention
// modules on compatible models. Fine-tunes that target any expert module produce
// adapter-only output.
LoraTrainableModules param.Opt[string] `json:"lora_trainable_modules,omitzero"`
// contains filtered or unexported fields
}
LoRA training configuration for a fine-tuning job.
The properties LoraAlpha, LoraR, Type are required.
func (FineTuningEstimatePriceParamsTrainingTypeLoRaTrainingType) MarshalJSON ¶ added in v0.2.0
func (r FineTuningEstimatePriceParamsTrainingTypeLoRaTrainingType) MarshalJSON() (data []byte, err error)
func (*FineTuningEstimatePriceParamsTrainingTypeLoRaTrainingType) UnmarshalJSON ¶ added in v0.2.0
func (r *FineTuningEstimatePriceParamsTrainingTypeLoRaTrainingType) UnmarshalJSON(data []byte) error
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
func (u FineTuningEstimatePriceParamsTrainingTypeUnion) GetLoraAlpha() *int64
Returns a pointer to the underlying variant's property, if present.
func (FineTuningEstimatePriceParamsTrainingTypeUnion) GetLoraDropout ¶ added in v0.2.0
func (u FineTuningEstimatePriceParamsTrainingTypeUnion) GetLoraDropout() *float64
Returns a pointer to the underlying variant's property, if present.
func (FineTuningEstimatePriceParamsTrainingTypeUnion) GetLoraR ¶ added in v0.2.0
func (u FineTuningEstimatePriceParamsTrainingTypeUnion) GetLoraR() *int64
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
func (u FineTuningEstimatePriceParamsTrainingTypeUnion) GetType() *string
Returns a pointer to the underlying variant's property, if present.
func (FineTuningEstimatePriceParamsTrainingTypeUnion) MarshalJSON ¶ added in v0.2.0
func (u FineTuningEstimatePriceParamsTrainingTypeUnion) MarshalJSON() ([]byte, error)
func (*FineTuningEstimatePriceParamsTrainingTypeUnion) UnmarshalJSON ¶ added in v0.2.0
func (u *FineTuningEstimatePriceParamsTrainingTypeUnion) UnmarshalJSON(data []byte) error
type FineTuningEstimatePriceResponseAvailableEstimate ¶ added in v0.11.0
type FineTuningEstimatePriceResponseAvailableEstimate struct {
// Whether price estimation is available for the requested fine-tune job.
EstimationAvailable bool `json:"estimation_available" api:"required"`
// 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 {
EstimationAvailable respjson.Field
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 (FineTuningEstimatePriceResponseAvailableEstimate) RawJSON ¶ added in v0.11.0
func (r FineTuningEstimatePriceResponseAvailableEstimate) RawJSON() string
Returns the unmodified JSON received from the API
func (*FineTuningEstimatePriceResponseAvailableEstimate) UnmarshalJSON ¶ added in v0.11.0
func (r *FineTuningEstimatePriceResponseAvailableEstimate) UnmarshalJSON(data []byte) error
type FineTuningEstimatePriceResponseUnavailableEstimate ¶ added in v0.11.0
type FineTuningEstimatePriceResponseUnavailableEstimate struct {
EstimationAvailable bool `json:"estimation_available" api:"required"`
//
// Any of "multimodal_dataset", "train_file_not_validated",
// "eval_file_not_validated", "train_file_invalid", "eval_file_invalid".
UnavailableReason string `json:"unavailable_reason" api:"required"`
JSON struct {
EstimationAvailable respjson.Field
UnavailableReason respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (FineTuningEstimatePriceResponseUnavailableEstimate) RawJSON ¶ added in v0.11.0
func (r FineTuningEstimatePriceResponseUnavailableEstimate) RawJSON() string
Returns the unmodified JSON received from the API
func (*FineTuningEstimatePriceResponseUnavailableEstimate) UnmarshalJSON ¶ added in v0.11.0
func (r *FineTuningEstimatePriceResponseUnavailableEstimate) UnmarshalJSON(data []byte) error
type FineTuningEstimatePriceResponseUnion ¶ added in v0.11.0
type FineTuningEstimatePriceResponseUnion struct {
EstimationAvailable bool `json:"estimation_available"`
// This field is from variant [FineTuningEstimatePriceResponseAvailableEstimate].
AllowedToProceed bool `json:"allowed_to_proceed"`
// This field is from variant [FineTuningEstimatePriceResponseAvailableEstimate].
EstimatedEvalTokenCount float64 `json:"estimated_eval_token_count"`
// This field is from variant [FineTuningEstimatePriceResponseAvailableEstimate].
EstimatedTotalPrice float64 `json:"estimated_total_price"`
// This field is from variant [FineTuningEstimatePriceResponseAvailableEstimate].
EstimatedTrainTokenCount float64 `json:"estimated_train_token_count"`
// This field is from variant [FineTuningEstimatePriceResponseAvailableEstimate].
UserLimit float64 `json:"user_limit"`
// This field is from variant [FineTuningEstimatePriceResponseUnavailableEstimate].
JSON struct {
EstimationAvailable respjson.Field
AllowedToProceed respjson.Field
EstimatedEvalTokenCount respjson.Field
EstimatedTotalPrice respjson.Field
EstimatedTrainTokenCount respjson.Field
UserLimit respjson.Field
UnavailableReason respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
FineTuningEstimatePriceResponseUnion contains all possible properties and values from FineTuningEstimatePriceResponseAvailableEstimate, FineTuningEstimatePriceResponseUnavailableEstimate.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (FineTuningEstimatePriceResponseUnion) AsAvailableEstimate ¶ added in v0.11.0
func (u FineTuningEstimatePriceResponseUnion) AsAvailableEstimate() (v FineTuningEstimatePriceResponseAvailableEstimate)
func (FineTuningEstimatePriceResponseUnion) AsUnavailableEstimate ¶ added in v0.11.0
func (u FineTuningEstimatePriceResponseUnion) AsUnavailableEstimate() (v FineTuningEstimatePriceResponseUnavailableEstimate)
func (FineTuningEstimatePriceResponseUnion) RawJSON ¶ added in v0.11.0
func (u FineTuningEstimatePriceResponseUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*FineTuningEstimatePriceResponseUnion) UnmarshalJSON ¶ added in v0.11.0
func (r *FineTuningEstimatePriceResponseUnion) 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 ¶
func (r FineTuningListCheckpointsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*FineTuningListCheckpointsResponse) UnmarshalJSON ¶
func (r *FineTuningListCheckpointsResponse) UnmarshalJSON(data []byte) error
type FineTuningListCheckpointsResponseData ¶
type FineTuningListCheckpointsResponseData struct {
// Display label for the checkpoint, including the final or intermediate checkpoint
// step.
CheckpointType string `json:"checkpoint_type" api:"required"`
// Timestamp when the checkpoint was created.
CreatedAt string `json:"created_at" api:"required"`
// Storage path for the checkpoint artifact.
Path string `json:"path" api:"required"`
// Step represented by the checkpoint; final checkpoints use the shipped model
// step.
Step int64 `json:"step" api:"required"`
// Canonical artifact selector for checkpoint download requests.
//
// Any of "model", "adapter".
Checkpoint string `json:"checkpoint"`
// Together model registry object ID for the checkpoint artifact (e.g. `ml_...`).
ObjectID string `json:"object_id"`
// Together model registry name for the checkpoint artifact, formatted as
// `<project_slug>/<checkpoint_name>`.
ObjectName string `json:"object_name"`
// Together model registry revision ID for the checkpoint artifact (e.g. `rv_...`).
ObjectRevisionID string `json:"object_revision_id"`
// 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
Checkpoint respjson.Field
ObjectID respjson.Field
ObjectName respjson.Field
ObjectRevisionID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A checkpoint available for a fine-tuning job.
func (FineTuningListCheckpointsResponseData) RawJSON ¶
func (r FineTuningListCheckpointsResponseData) RawJSON() string
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 ¶
func (r FineTuningListEventsResponse) RawJSON() string
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
func (r FineTuningListMetricsResponse) RawJSON() string
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"`
// ID of the user who created the fine-tune job.
UserID string `json:"user_id" api:"required"`
// Batch size used for training
BatchSize int64 `json:"batch_size"`
// Whether the early-stopping criterion triggered.
EarlyStopped bool `json:"early_stopped"`
// Best validation loss observed, corresponding to early_stopping_best_step. Null
// if no improving evaluation was recorded.
EarlyStoppingBestMetric float64 `json:"early_stopping_best_metric" api:"nullable"`
// Step associated with the selected early-stopping artifact. When
// early_stopping_best_metric is null, no finite best metric was recorded; this is
// the halt step, not a best-checkpoint step.
EarlyStoppingBestStep int64 `json:"early_stopping_best_step"`
// 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"`
// 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
UserID respjson.Field
BatchSize respjson.Field
EarlyStopped respjson.Field
EarlyStoppingBestMetric respjson.Field
EarlyStoppingBestStep 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
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 ¶
func (r FineTuningListResponseDataLrScheduler) RawJSON() string
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 ¶
func (r FineTuningListResponseDataLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs) RawJSON() string
Returns the unmodified JSON received from the API
func (*FineTuningListResponseDataLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs) UnmarshalJSON ¶
func (r *FineTuningListResponseDataLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs) UnmarshalJSON(data []byte) error
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 ¶
func (r FineTuningListResponseDataLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs) RawJSON() string
Returns the unmodified JSON received from the API
func (*FineTuningListResponseDataLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs) UnmarshalJSON ¶
func (r *FineTuningListResponseDataLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs) UnmarshalJSON(data []byte) error
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 ¶
func (u FineTuningListResponseDataLrSchedulerLrSchedulerArgsUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*FineTuningListResponseDataLrSchedulerLrSchedulerArgsUnion) UnmarshalJSON ¶
func (r *FineTuningListResponseDataLrSchedulerLrSchedulerArgsUnion) UnmarshalJSON(data []byte) error
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
func (r FineTuningListResponseDataProgress) RawJSON() string
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 ¶
func (r FineTuningListResponseDataTrainingMethodTrainingMethodDpo) RawJSON() string
Returns the unmodified JSON received from the API
func (*FineTuningListResponseDataTrainingMethodTrainingMethodDpo) UnmarshalJSON ¶
func (r *FineTuningListResponseDataTrainingMethodTrainingMethodDpo) UnmarshalJSON(data []byte) error
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 ¶
func (r FineTuningListResponseDataTrainingMethodTrainingMethodSft) RawJSON() string
Returns the unmodified JSON received from the API
func (*FineTuningListResponseDataTrainingMethodTrainingMethodSft) UnmarshalJSON ¶
func (r *FineTuningListResponseDataTrainingMethodTrainingMethodSft) UnmarshalJSON(data []byte) error
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 (u FineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsBool() (v bool)
func (FineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsFineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsString ¶
func (u FineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsFineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsString() (v string)
func (FineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsUnion) RawJSON ¶
func (u FineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*FineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsUnion) UnmarshalJSON ¶
func (r *FineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsUnion) UnmarshalJSON(data []byte) error
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 ¶
func (u FineTuningListResponseDataTrainingMethodUnion) RawJSON() string
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 ¶
func (r FineTuningListResponseDataTrainingTypeFullTrainingType) RawJSON() string
Returns the unmodified JSON received from the API
func (*FineTuningListResponseDataTrainingTypeFullTrainingType) UnmarshalJSON ¶
func (r *FineTuningListResponseDataTrainingTypeFullTrainingType) UnmarshalJSON(data []byte) error
type FineTuningListResponseDataTrainingTypeLoRaTrainingType ¶
type FineTuningListResponseDataTrainingTypeLoRaTrainingType struct {
// Scaling factor applied to the LoRA adapter weights.
LoraAlpha int64 `json:"lora_alpha" api:"required"`
// Rank of the LoRA adapter matrices.
LoraR int64 `json:"lora_r" api:"required"`
// Identifies this request as a LoRA fine-tune.
//
// Any of "Lora".
Type string `json:"type" api:"required"`
// Dropout probability applied to LoRA adapter inputs.
LoraDropout float64 `json:"lora_dropout"`
// Comma-separated LoRA target modules. Use `all-linear` for model defaults; MoE
// expert modules (`w_up`, `w_gate`, `w_down`) can be combined with attention
// modules on compatible models. Fine-tunes that target any expert module produce
// adapter-only output.
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:"-"`
}
LoRA training configuration for a fine-tuning job.
func (FineTuningListResponseDataTrainingTypeLoRaTrainingType) RawJSON ¶
func (r FineTuningListResponseDataTrainingTypeLoRaTrainingType) RawJSON() string
Returns the unmodified JSON received from the API
func (*FineTuningListResponseDataTrainingTypeLoRaTrainingType) UnmarshalJSON ¶
func (r *FineTuningListResponseDataTrainingTypeLoRaTrainingType) UnmarshalJSON(data []byte) error
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 ¶
func (u FineTuningListResponseDataTrainingTypeUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*FineTuningListResponseDataTrainingTypeUnion) UnmarshalJSON ¶
func (r *FineTuningListResponseDataTrainingTypeUnion) UnmarshalJSON(data []byte) error
type FineTuningModelLimitsParams ¶ added in v0.11.0
type FineTuningModelLimitsParams struct {
// The model name to get limits for.
ModelName string `query:"model_name" api:"required" json:"-"`
// contains filtered or unexported fields
}
func (FineTuningModelLimitsParams) URLQuery ¶ added in v0.11.0
func (r FineTuningModelLimitsParams) URLQuery() (v url.Values, err error)
URLQuery serializes FineTuningModelLimitsParams's query parameters as `url.Values`.
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"`
// Number of initial evaluations excluded from the early-stopping decision. These
// still establish the baseline validation loss but do not count toward patience.
// Set to 0 to disable warmup; if omitted, defaults to 1. Only applies when
// early_stopping_enabled is true.
EarlyStoppingWarmupEvals param.Opt[int64] `json:"early_stopping_warmup_evals,omitzero"`
// 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"`
// Whether to stop training early when validation loss stops improving. Requires a
// validation_file, and n_evals must be at least early_stopping_patience +
// early_stopping_warmup_evals + 1 so a plateau can be detected.
EarlyStoppingEnabled param.Opt[bool] `json:"early_stopping_enabled,omitzero"`
// Minimum decrease in validation loss for an evaluation to count as an
// improvement. Larger values treat small gains as non-improvements, causing
// training to stop sooner. Only applies when early_stopping_enabled is true.
EarlyStoppingMinDelta param.Opt[float64] `json:"early_stopping_min_delta,omitzero"`
// Number of consecutive evaluations with no improvement in validation loss to
// allow before stopping. Only applies when early_stopping_enabled is true.
EarlyStoppingPatience param.Opt[int64] `json:"early_stopping_patience,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. This flag has no effect if the
// training data is in Parquet format.
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 (r FineTuningNewParamsLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs) MarshalJSON() (data []byte, err error)
func (*FineTuningNewParamsLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs) UnmarshalJSON ¶
func (r *FineTuningNewParamsLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs) UnmarshalJSON(data []byte) error
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 (r FineTuningNewParamsLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs) MarshalJSON() (data []byte, err error)
func (*FineTuningNewParamsLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs) UnmarshalJSON ¶
func (r *FineTuningNewParamsLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs) UnmarshalJSON(data []byte) error
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 ¶
func (u FineTuningNewParamsLrSchedulerLrSchedulerArgsUnion) GetMinLrRatio() *float64
Returns a pointer to the underlying variant's property, if present.
func (FineTuningNewParamsLrSchedulerLrSchedulerArgsUnion) GetNumCycles ¶
func (u FineTuningNewParamsLrSchedulerLrSchedulerArgsUnion) GetNumCycles() *float64
Returns a pointer to the underlying variant's property, if present.
func (FineTuningNewParamsLrSchedulerLrSchedulerArgsUnion) MarshalJSON ¶
func (u FineTuningNewParamsLrSchedulerLrSchedulerArgsUnion) MarshalJSON() ([]byte, error)
func (*FineTuningNewParamsLrSchedulerLrSchedulerArgsUnion) UnmarshalJSON ¶
func (u *FineTuningNewParamsLrSchedulerLrSchedulerArgsUnion) UnmarshalJSON(data []byte) error
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 ¶
func (r *FineTuningNewParamsTrainingMethodTrainingMethodDpo) UnmarshalJSON(data []byte) error
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 ¶
func (r *FineTuningNewParamsTrainingMethodTrainingMethodSft) UnmarshalJSON(data []byte) error
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 (u FineTuningNewParamsTrainingMethodTrainingMethodSftTrainOnInputsUnion) MarshalJSON() ([]byte, error)
func (*FineTuningNewParamsTrainingMethodTrainingMethodSftTrainOnInputsUnion) UnmarshalJSON ¶
func (u *FineTuningNewParamsTrainingMethodTrainingMethodSftTrainOnInputsUnion) UnmarshalJSON(data []byte) error
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 ¶
func (u FineTuningNewParamsTrainingMethodUnion) GetDpoBeta() *float64
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 ¶
func (u FineTuningNewParamsTrainingMethodUnion) GetMethod() *string
Returns a pointer to the underlying variant's property, if present.
func (FineTuningNewParamsTrainingMethodUnion) GetRpoAlpha ¶
func (u FineTuningNewParamsTrainingMethodUnion) GetRpoAlpha() *float64
Returns a pointer to the underlying variant's property, if present.
func (FineTuningNewParamsTrainingMethodUnion) GetSimpoGamma ¶
func (u FineTuningNewParamsTrainingMethodUnion) GetSimpoGamma() *float64
Returns a pointer to the underlying variant's property, if present.
func (FineTuningNewParamsTrainingMethodUnion) GetTrainOnInputs ¶
func (u FineTuningNewParamsTrainingMethodUnion) GetTrainOnInputs() *FineTuningNewParamsTrainingMethodTrainingMethodSftTrainOnInputsUnion
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 ¶
func (r *FineTuningNewParamsTrainingTypeFullTrainingType) UnmarshalJSON(data []byte) error
type FineTuningNewParamsTrainingTypeLoRaTrainingType ¶
type FineTuningNewParamsTrainingTypeLoRaTrainingType struct {
// Scaling factor applied to the LoRA adapter weights.
LoraAlpha int64 `json:"lora_alpha" api:"required"`
// Rank of the LoRA adapter matrices.
LoraR int64 `json:"lora_r" api:"required"`
// Identifies this request as a LoRA fine-tune.
//
// Any of "Lora".
Type string `json:"type,omitzero" api:"required"`
// Dropout probability applied to LoRA adapter inputs.
LoraDropout param.Opt[float64] `json:"lora_dropout,omitzero"`
// Comma-separated LoRA target modules. Use `all-linear` for model defaults; MoE
// expert modules (`w_up`, `w_gate`, `w_down`) can be combined with attention
// modules on compatible models. Fine-tunes that target any expert module produce
// adapter-only output.
LoraTrainableModules param.Opt[string] `json:"lora_trainable_modules,omitzero"`
// contains filtered or unexported fields
}
LoRA training configuration for a fine-tuning job.
The properties LoraAlpha, LoraR, Type are required.
func (FineTuningNewParamsTrainingTypeLoRaTrainingType) MarshalJSON ¶
func (r FineTuningNewParamsTrainingTypeLoRaTrainingType) MarshalJSON() (data []byte, err error)
func (*FineTuningNewParamsTrainingTypeLoRaTrainingType) UnmarshalJSON ¶
func (r *FineTuningNewParamsTrainingTypeLoRaTrainingType) UnmarshalJSON(data []byte) error
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 ¶
func (u FineTuningNewParamsTrainingTypeUnion) GetLoraR() *int64
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 ¶
func (u FineTuningNewParamsTrainingTypeUnion) GetType() *string
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"`
// ID of the user who created the fine-tune job.
UserID string `json:"user_id" api:"required"`
// Batch size used for training
BatchSize int64 `json:"batch_size"`
// Whether the early-stopping criterion triggered.
EarlyStopped bool `json:"early_stopped"`
// Best validation loss observed, corresponding to early_stopping_best_step. Null
// if no improving evaluation was recorded.
EarlyStoppingBestMetric float64 `json:"early_stopping_best_metric" api:"nullable"`
// Step associated with the selected early-stopping artifact. When
// early_stopping_best_metric is null, no finite best metric was recorded; this is
// the halt step, not a best-checkpoint step.
EarlyStoppingBestStep int64 `json:"early_stopping_best_step"`
// 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"`
// 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
UserID respjson.Field
BatchSize respjson.Field
EarlyStopped respjson.Field
EarlyStoppingBestMetric respjson.Field
EarlyStoppingBestStep 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
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 ¶
func (r FineTuningNewResponseLrScheduler) RawJSON() string
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 ¶
func (r FineTuningNewResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs) RawJSON() string
Returns the unmodified JSON received from the API
func (*FineTuningNewResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs) UnmarshalJSON ¶
func (r *FineTuningNewResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs) UnmarshalJSON(data []byte) error
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 ¶
func (r FineTuningNewResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs) RawJSON() string
Returns the unmodified JSON received from the API
func (*FineTuningNewResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs) UnmarshalJSON ¶
func (r *FineTuningNewResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs) UnmarshalJSON(data []byte) error
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 ¶
func (u FineTuningNewResponseLrSchedulerLrSchedulerArgsUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*FineTuningNewResponseLrSchedulerLrSchedulerArgsUnion) UnmarshalJSON ¶
func (r *FineTuningNewResponseLrSchedulerLrSchedulerArgsUnion) UnmarshalJSON(data []byte) error
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
func (r FineTuningNewResponseProgress) RawJSON() string
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 ¶
func (r FineTuningNewResponseTrainingMethodTrainingMethodDpo) RawJSON() string
Returns the unmodified JSON received from the API
func (*FineTuningNewResponseTrainingMethodTrainingMethodDpo) UnmarshalJSON ¶
func (r *FineTuningNewResponseTrainingMethodTrainingMethodDpo) UnmarshalJSON(data []byte) error
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 ¶
func (r FineTuningNewResponseTrainingMethodTrainingMethodSft) RawJSON() string
Returns the unmodified JSON received from the API
func (*FineTuningNewResponseTrainingMethodTrainingMethodSft) UnmarshalJSON ¶
func (r *FineTuningNewResponseTrainingMethodTrainingMethodSft) UnmarshalJSON(data []byte) error
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 (u FineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsBool() (v bool)
func (FineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsFineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsString ¶
func (u FineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsFineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsString() (v string)
func (FineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) RawJSON ¶
func (u FineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*FineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) UnmarshalJSON ¶
func (r *FineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) UnmarshalJSON(data []byte) error
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 ¶
func (u FineTuningNewResponseTrainingMethodUnion) RawJSON() string
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 ¶
func (r FineTuningNewResponseTrainingTypeFullTrainingType) RawJSON() string
Returns the unmodified JSON received from the API
func (*FineTuningNewResponseTrainingTypeFullTrainingType) UnmarshalJSON ¶
func (r *FineTuningNewResponseTrainingTypeFullTrainingType) UnmarshalJSON(data []byte) error
type FineTuningNewResponseTrainingTypeLoRaTrainingType ¶
type FineTuningNewResponseTrainingTypeLoRaTrainingType struct {
// Scaling factor applied to the LoRA adapter weights.
LoraAlpha int64 `json:"lora_alpha" api:"required"`
// Rank of the LoRA adapter matrices.
LoraR int64 `json:"lora_r" api:"required"`
// Identifies this request as a LoRA fine-tune.
//
// Any of "Lora".
Type string `json:"type" api:"required"`
// Dropout probability applied to LoRA adapter inputs.
LoraDropout float64 `json:"lora_dropout"`
// Comma-separated LoRA target modules. Use `all-linear` for model defaults; MoE
// expert modules (`w_up`, `w_gate`, `w_down`) can be combined with attention
// modules on compatible models. Fine-tunes that target any expert module produce
// adapter-only output.
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:"-"`
}
LoRA training configuration for a fine-tuning job.
func (FineTuningNewResponseTrainingTypeLoRaTrainingType) RawJSON ¶
func (r FineTuningNewResponseTrainingTypeLoRaTrainingType) RawJSON() string
Returns the unmodified JSON received from the API
func (*FineTuningNewResponseTrainingTypeLoRaTrainingType) UnmarshalJSON ¶
func (r *FineTuningNewResponseTrainingTypeLoRaTrainingType) UnmarshalJSON(data []byte) error
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 ¶
func (u FineTuningNewResponseTrainingTypeUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*FineTuningNewResponseTrainingTypeUnion) UnmarshalJSON ¶
func (r *FineTuningNewResponseTrainingTypeUnion) UnmarshalJSON(data []byte) error
type FineTuningPreviewParams ¶ added in v0.12.0
type FineTuningPreviewParams struct {
// Name of the base model whose tokenizer and chat template will be used.
Model string `json:"model" api:"required"`
// File-ID of the uploaded JSONL training file to sample for preview.
TrainingFile string `json:"training_file" api:"required"`
// Maximum number of rows from the start of the training file to tokenize.
TopK param.Opt[int64] `json:"top_k,omitzero"`
// Whether prompt or user-message tokens should contribute to training loss in the
// preview.
TrainOnInputs param.Opt[bool] `json:"train_on_inputs,omitzero"`
// Fine-tuning method to preview. Only supervised fine-tuning is currently
// supported.
//
// Any of "sft".
TrainingMethod FineTuningPreviewParamsTrainingMethod `json:"training_method,omitzero"`
// contains filtered or unexported fields
}
func (FineTuningPreviewParams) MarshalJSON ¶ added in v0.12.0
func (r FineTuningPreviewParams) MarshalJSON() (data []byte, err error)
func (*FineTuningPreviewParams) UnmarshalJSON ¶ added in v0.12.0
func (r *FineTuningPreviewParams) UnmarshalJSON(data []byte) error
type FineTuningPreviewParamsTrainingMethod ¶ added in v0.12.0
type FineTuningPreviewParamsTrainingMethod string
Fine-tuning method to preview. Only supervised fine-tuning is currently supported.
const (
FineTuningPreviewParamsTrainingMethodSft FineTuningPreviewParamsTrainingMethod = "sft"
)
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 ¶
func (r *FineTuningService) Cancel(ctx context.Context, id string, opts ...option.RequestOption) (res *FineTuningCancelResponse, err error)
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 ¶
func (r *FineTuningService) Delete(ctx context.Context, id string, body FineTuningDeleteParams, opts ...option.RequestOption) (res *FineTuningDeleteResponse, err error)
Delete a fine-tuning job.
func (*FineTuningService) EstimatePrice ¶ added in v0.2.0
func (r *FineTuningService) EstimatePrice(ctx context.Context, body FineTuningEstimatePriceParams, opts ...option.RequestOption) (res *FineTuningEstimatePriceResponseUnion, err error)
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 ¶
func (r *FineTuningService) List(ctx context.Context, opts ...option.RequestOption) (res *FineTuningListResponse, err error)
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
func (r *FineTuningService) ListMetrics(ctx context.Context, id string, query FineTuningListMetricsParams, opts ...option.RequestOption) (res *FineTuningListMetricsResponse, err error)
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) ModelLimits ¶ added in v0.11.0
func (r *FineTuningService) ModelLimits(ctx context.Context, query FineTuningModelLimitsParams, opts ...option.RequestOption) (res *FinetuneModelLimits, err error)
Get model limits for a specific fine-tuning model.
func (*FineTuningService) New ¶
func (r *FineTuningService) New(ctx context.Context, body FineTuningNewParams, opts ...option.RequestOption) (res *FineTuningNewResponse, err error)
Create a fine-tuning job with the provided model and training data.
func (*FineTuningService) Preview ¶ added in v0.12.0
func (r *FineTuningService) Preview(ctx context.Context, body FineTuningPreviewParams, opts ...option.RequestOption) (res *FineTunePreviewResponse, err error)
Preview how sampled rows from a fine-tuning training file will be tokenized before packing.
type FinetuneEvent ¶
type FinetuneEvent struct {
CreatedAt string `json:"created_at" api:"required"`
Message string `json:"message" api:"required"`
// The object type, which is always `fine-tune-event`.
Object constant.FineTuneEvent `json:"object" default:"fine-tune-event"`
// 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", "early_stopped".
Type FinetuneEventType `json:"type" api:"required"`
CheckpointPath string `json:"checkpoint_path"`
// For early_stopped events, the best validation loss observed. Null if no
// improving evaluation was recorded.
EarlyStoppingBestMetricValue float64 `json:"early_stopping_best_metric_value" api:"nullable"`
// For early_stopped events, the selected best-checkpoint step when a finite best
// metric exists. If early_stopping_best_metric_value is null, this is the halt
// step.
EarlyStoppingBestStep int64 `json:"early_stopping_best_step" api:"nullable"`
// Any of "info", "warning", "error", "legacy_info", "legacy_iwarning",
// "legacy_ierror".
Level FinetuneEventLevel `json:"level" api:"nullable"`
ModelPath string `json:"model_path"`
ParamCount int64 `json:"param_count"`
Step int64 `json:"step"`
TokenCount int64 `json:"token_count"`
TotalSteps int64 `json:"total_steps"`
WandbURL string `json:"wandb_url"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CreatedAt respjson.Field
Message respjson.Field
Object respjson.Field
Type respjson.Field
CheckpointPath respjson.Field
EarlyStoppingBestMetricValue respjson.Field
EarlyStoppingBestStep respjson.Field
Level respjson.Field
ModelPath respjson.Field
ParamCount respjson.Field
Step respjson.Field
TokenCount respjson.Field
TotalSteps respjson.Field
WandbURL 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" FinetuneEventTypeEarlyStopped FinetuneEventType = "early_stopped" )
type FinetuneModelLimits ¶ added in v0.11.0
type FinetuneModelLimits struct {
// Default gradient accumulation steps used when a fine-tune request omits the
// value or sets it to 0.
DefaultGradientAccumulationSteps int64 `json:"default_gradient_accumulation_steps" api:"required"`
// Limits for LoRA training.
LoraTraining FinetuneModelLimitsLoraTraining `json:"lora_training" api:"required"`
// Maximum learning rate.
MaxLearningRate float64 `json:"max_learning_rate" api:"required"`
// Maximum number of checkpoints that can be saved during a fine-tuning job.
MaxNumCheckpoints int64 `json:"max_num_checkpoints" api:"required"`
// Maximum number of training epochs.
MaxNumEpochs int64 `json:"max_num_epochs" api:"required"`
// Maximum number of evaluations.
MaxNumEvals int64 `json:"max_num_evals" api:"required"`
// Maximum sequence length supported for DPO training.
MaxSeqLengthDpo int64 `json:"max_seq_length_dpo" api:"required"`
// Maximum sequence length supported for SFT training.
MaxSeqLengthSft int64 `json:"max_seq_length_sft" api:"required"`
// Whether a merged checkpoint (the base model with the trained LoRA adapter fused
// in) is produced for LoRA fine-tunes of this model, in addition to the standalone
// adapter.
MergeOutputLora bool `json:"merge_output_lora" api:"required"`
// Minimum learning rate.
MinLearningRate float64 `json:"min_learning_rate" api:"required"`
// Minimum value allowed for the max_seq_length hyperparameter.
MinMaxSeqLength int64 `json:"min_max_seq_length" api:"required"`
// The name of the model.
ModelName string `json:"model_name" api:"required"`
// Whether the model supports full (non-LoRA) fine-tuning. When false, only LoRA
// fine-tuning is available and the full_training limits are reported as zero.
SupportsFullTraining bool `json:"supports_full_training" api:"required"`
// Whether the model supports reasoning.
SupportsReasoning bool `json:"supports_reasoning" api:"required"`
// Whether the model supports tool/function calling.
SupportsTools bool `json:"supports_tools" api:"required"`
// Whether the model supports vision/multimodal inputs.
SupportsVision bool `json:"supports_vision" api:"required"`
// Limits for full training.
FullTraining FinetuneModelLimitsFullTraining `json:"full_training"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
DefaultGradientAccumulationSteps respjson.Field
LoraTraining respjson.Field
MaxLearningRate respjson.Field
MaxNumCheckpoints respjson.Field
MaxNumEpochs respjson.Field
MaxNumEvals respjson.Field
MaxSeqLengthDpo respjson.Field
MaxSeqLengthSft respjson.Field
MergeOutputLora respjson.Field
MinLearningRate respjson.Field
MinMaxSeqLength respjson.Field
ModelName respjson.Field
SupportsFullTraining respjson.Field
SupportsReasoning respjson.Field
SupportsTools respjson.Field
SupportsVision respjson.Field
FullTraining respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Model limits for fine-tuning.
func (FinetuneModelLimits) RawJSON ¶ added in v0.11.0
func (r FinetuneModelLimits) RawJSON() string
Returns the unmodified JSON received from the API
func (*FinetuneModelLimits) UnmarshalJSON ¶ added in v0.11.0
func (r *FinetuneModelLimits) UnmarshalJSON(data []byte) error
type FinetuneModelLimitsFullTraining ¶ added in v0.11.0
type FinetuneModelLimitsFullTraining struct {
// Maximum batch size for SFT full training.
MaxBatchSize int64 `json:"max_batch_size" api:"required"`
// Maximum batch size for DPO full training.
MaxBatchSizeDpo int64 `json:"max_batch_size_dpo" api:"required"`
// Minimum batch size for full training.
MinBatchSize int64 `json:"min_batch_size" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
MaxBatchSize respjson.Field
MaxBatchSizeDpo respjson.Field
MinBatchSize respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Limits for full training.
func (FinetuneModelLimitsFullTraining) RawJSON ¶ added in v0.11.0
func (r FinetuneModelLimitsFullTraining) RawJSON() string
Returns the unmodified JSON received from the API
func (*FinetuneModelLimitsFullTraining) UnmarshalJSON ¶ added in v0.11.0
func (r *FinetuneModelLimitsFullTraining) UnmarshalJSON(data []byte) error
type FinetuneModelLimitsLoraTraining ¶ added in v0.11.0
type FinetuneModelLimitsLoraTraining struct {
// Maximum batch size for SFT LoRA training.
MaxBatchSize int64 `json:"max_batch_size" api:"required"`
// Maximum batch size for DPO LoRA training.
MaxBatchSizeDpo int64 `json:"max_batch_size_dpo" api:"required"`
// Maximum LoRA rank.
MaxRank int64 `json:"max_rank" api:"required"`
// Minimum batch size for LoRA training.
MinBatchSize int64 `json:"min_batch_size" api:"required"`
// Available target modules for LoRA.
TargetModules []string `json:"target_modules" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
MaxBatchSize respjson.Field
MaxBatchSizeDpo respjson.Field
MaxRank respjson.Field
MinBatchSize respjson.Field
TargetModules respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Limits for LoRA training.
func (FinetuneModelLimitsLoraTraining) RawJSON ¶ added in v0.11.0
func (r FinetuneModelLimitsLoraTraining) RawJSON() string
Returns the unmodified JSON received from the API
func (*FinetuneModelLimitsLoraTraining) UnmarshalJSON ¶ added in v0.11.0
func (r *FinetuneModelLimitsLoraTraining) UnmarshalJSON(data []byte) error
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"`
// ID of the user who created the fine-tune job.
UserID string `json:"user_id" api:"required"`
// Together model registry object ID for the final adapter weights on LoRA jobs.
AdapterObjectID string `json:"adapter_object_id"`
// Together model registry name for the final adapter weights on LoRA jobs,
// formatted as `<project_slug>/<model_name>-adapter`.
AdapterObjectName string `json:"adapter_object_name"`
// Together model registry revision ID for the final adapter weights on LoRA jobs.
AdapterObjectRevisionID string `json:"adapter_object_revision_id"`
BatchSize FinetuneResponseBatchSizeUnion `json:"batch_size"`
CreatedAt time.Time `json:"created_at" format:"date-time"`
// Whether the early-stopping criterion triggered.
EarlyStopped bool `json:"early_stopped"`
// Best validation loss observed, corresponding to early_stopping_best_step. Null
// if no improving evaluation was recorded (for example, a non-finite first
// evaluation).
EarlyStoppingBestMetric float64 `json:"early_stopping_best_metric" api:"nullable"`
// Step associated with the selected early-stopping artifact. When
// early_stopping_best_metric is null, no finite best metric was recorded; this is
// the halt step, not a best-checkpoint step.
EarlyStoppingBestStep int64 `json:"early_stopping_best_step"`
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"`
// Together model registry object ID for the final model weights (e.g. `ml_...`).
ModelObjectID string `json:"model_object_id"`
// Together model registry name for the final model weights, formatted as
// `<project_slug>/<model_name>`.
ModelObjectName string `json:"model_object_name"`
// Together model registry revision ID for the final model weights (e.g. `rv_...`).
ModelObjectRevisionID string `json:"model_object_revision_id"`
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"`
// LoRA training configuration for a fine-tuning job.
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
UserID respjson.Field
AdapterObjectID respjson.Field
AdapterObjectName respjson.Field
AdapterObjectRevisionID respjson.Field
BatchSize respjson.Field
CreatedAt respjson.Field
EarlyStopped respjson.Field
EarlyStoppingBestMetric respjson.Field
EarlyStoppingBestStep 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
ModelObjectID respjson.Field
ModelObjectName respjson.Field
ModelObjectRevisionID 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 ¶
func (u FinetuneResponseBatchSizeUnion) RawJSON() string
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 ¶
func (r FinetuneResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs) RawJSON() string
Returns the unmodified JSON received from the API
func (*FinetuneResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs) UnmarshalJSON ¶
func (r *FinetuneResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs) UnmarshalJSON(data []byte) error
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 ¶
func (r FinetuneResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs) RawJSON() string
Returns the unmodified JSON received from the API
func (*FinetuneResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs) UnmarshalJSON ¶
func (r *FinetuneResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs) UnmarshalJSON(data []byte) error
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 ¶
func (u FinetuneResponseLrSchedulerLrSchedulerArgsUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*FinetuneResponseLrSchedulerLrSchedulerArgsUnion) UnmarshalJSON ¶
func (r *FinetuneResponseLrSchedulerLrSchedulerArgsUnion) UnmarshalJSON(data []byte) error
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
func (r FinetuneResponseMultimodalParams) RawJSON() string
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 (u FinetuneResponseTrainOnInputsUnion) AsBool() (v bool)
func (FinetuneResponseTrainOnInputsUnion) AsFinetuneResponseTrainOnInputsString ¶
func (u FinetuneResponseTrainOnInputsUnion) AsFinetuneResponseTrainOnInputsString() (v string)
func (FinetuneResponseTrainOnInputsUnion) RawJSON ¶
func (u FinetuneResponseTrainOnInputsUnion) RawJSON() string
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 ¶
func (r FinetuneResponseTrainingMethodTrainingMethodDpo) RawJSON() string
Returns the unmodified JSON received from the API
func (*FinetuneResponseTrainingMethodTrainingMethodDpo) UnmarshalJSON ¶
func (r *FinetuneResponseTrainingMethodTrainingMethodDpo) UnmarshalJSON(data []byte) error
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 ¶
func (r FinetuneResponseTrainingMethodTrainingMethodSft) RawJSON() string
Returns the unmodified JSON received from the API
func (*FinetuneResponseTrainingMethodTrainingMethodSft) UnmarshalJSON ¶
func (r *FinetuneResponseTrainingMethodTrainingMethodSft) UnmarshalJSON(data []byte) error
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 (u FinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsBool() (v bool)
func (FinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsFinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsString ¶
func (u FinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsFinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsString() (v string)
func (FinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) RawJSON ¶
func (u FinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*FinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) UnmarshalJSON ¶
func (r *FinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) UnmarshalJSON(data []byte) error
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 ¶
func (u FinetuneResponseTrainingMethodUnion) RawJSON() string
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 ¶
func (r FinetuneResponseTrainingTypeFullTrainingType) RawJSON() string
Returns the unmodified JSON received from the API
func (*FinetuneResponseTrainingTypeFullTrainingType) UnmarshalJSON ¶
func (r *FinetuneResponseTrainingTypeFullTrainingType) UnmarshalJSON(data []byte) error
type FinetuneResponseTrainingTypeLoRaTrainingType ¶
type FinetuneResponseTrainingTypeLoRaTrainingType struct {
// Scaling factor applied to the LoRA adapter weights.
LoraAlpha int64 `json:"lora_alpha" api:"required"`
// Rank of the LoRA adapter matrices.
LoraR int64 `json:"lora_r" api:"required"`
// Identifies this request as a LoRA fine-tune.
//
// Any of "Lora".
Type string `json:"type" api:"required"`
// Dropout probability applied to LoRA adapter inputs.
LoraDropout float64 `json:"lora_dropout"`
// Comma-separated LoRA target modules. Use `all-linear` for model defaults; MoE
// expert modules (`w_up`, `w_gate`, `w_down`) can be combined with attention
// modules on compatible models. Fine-tunes that target any expert module produce
// adapter-only output.
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:"-"`
}
LoRA training configuration for a fine-tuning job.
func (FinetuneResponseTrainingTypeLoRaTrainingType) RawJSON ¶
func (r FinetuneResponseTrainingTypeLoRaTrainingType) RawJSON() string
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 ¶
func (u FinetuneResponseTrainingTypeUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*FinetuneResponseTrainingTypeUnion) UnmarshalJSON ¶
func (r *FinetuneResponseTrainingTypeUnion) UnmarshalJSON(data []byte) error
type ForwardBackwardOperation ¶ added in v0.12.0
type ForwardBackwardOperation struct {
// Operation ID
ID string `json:"id" api:"required"`
// Operation status
//
// Any of "TRAINING_OPERATION_STATUS_UNSPECIFIED",
// "TRAINING_OPERATION_STATUS_PENDING", "TRAINING_OPERATION_STATUS_RUNNING",
// "TRAINING_OPERATION_STATUS_COMPLETED", "TRAINING_OPERATION_STATUS_FAILED".
Status TrainingOperationStatus `json:"status" api:"required"`
// Error details on failure
Error TrainingOperationError `json:"error"`
// Result on success
Output ForwardBackwardResult `json:"output"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Status respjson.Field
Error respjson.Field
Output respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Async forward-backward pass operation
func (ForwardBackwardOperation) RawJSON ¶ added in v0.12.0
func (r ForwardBackwardOperation) RawJSON() string
Returns the unmodified JSON received from the API
func (*ForwardBackwardOperation) UnmarshalJSON ¶ added in v0.12.0
func (r *ForwardBackwardOperation) UnmarshalJSON(data []byte) error
type ForwardBackwardResult ¶ added in v0.12.0
type ForwardBackwardResult struct {
// Loss value
Loss float64 `json:"loss" api:"required"`
// Loss-specific metrics (e.g., KL divergence, clip fraction for GRPO)
Metrics map[string]float64 `json:"metrics"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Loss respjson.Field
Metrics respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Result of a forward-backward pass operation
func (ForwardBackwardResult) RawJSON ¶ added in v0.12.0
func (r ForwardBackwardResult) RawJSON() string
Returns the unmodified JSON received from the API
func (*ForwardBackwardResult) UnmarshalJSON ¶ added in v0.12.0
func (r *ForwardBackwardResult) UnmarshalJSON(data []byte) error
type ForwardOperation ¶ added in v0.12.0
type ForwardOperation struct {
// Operation ID
ID string `json:"id" api:"required"`
// Operation status
//
// Any of "TRAINING_OPERATION_STATUS_UNSPECIFIED",
// "TRAINING_OPERATION_STATUS_PENDING", "TRAINING_OPERATION_STATUS_RUNNING",
// "TRAINING_OPERATION_STATUS_COMPLETED", "TRAINING_OPERATION_STATUS_FAILED".
Status TrainingOperationStatus `json:"status" api:"required"`
// Error details on failure
Error TrainingOperationError `json:"error"`
// Result on success
Output ForwardResult `json:"output"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Status respjson.Field
Error respjson.Field
Output respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Async forward pass operation
func (ForwardOperation) RawJSON ¶ added in v0.12.0
func (r ForwardOperation) RawJSON() string
Returns the unmodified JSON received from the API
func (*ForwardOperation) UnmarshalJSON ¶ added in v0.12.0
func (r *ForwardOperation) UnmarshalJSON(data []byte) error
type ForwardResult ¶ added in v0.12.0
type ForwardResult struct {
// Per-sample per-token log-probabilities
Logprobs []ForwardResultLogprob `json:"logprobs" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Logprobs respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Result of a forward pass operation
func (ForwardResult) RawJSON ¶ added in v0.12.0
func (r ForwardResult) RawJSON() string
Returns the unmodified JSON received from the API
func (*ForwardResult) UnmarshalJSON ¶ added in v0.12.0
func (r *ForwardResult) UnmarshalJSON(data []byte) error
type ForwardResultLogprob ¶ added in v0.12.0
type ForwardResultLogprob struct {
// Float array of per-token log probabilities
Data []float64 `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:"-"`
}
Per-token log-probabilities from the target model
func (ForwardResultLogprob) RawJSON ¶ added in v0.12.0
func (r ForwardResultLogprob) RawJSON() string
Returns the unmodified JSON received from the API
func (*ForwardResultLogprob) UnmarshalJSON ¶ added in v0.12.0
func (r *ForwardResultLogprob) UnmarshalJSON(data []byte) error
type GrpoLossAggregationType ¶ added in v0.12.0
type GrpoLossAggregationType string
const ( GrpoLossAggregationTypeGrpoLossAggregationTypeUnspecified GrpoLossAggregationType = "GRPO_LOSS_AGGREGATION_TYPE_UNSPECIFIED" GrpoLossAggregationTypeGrpoLossAggregationTypeFixedHorizon GrpoLossAggregationType = "GRPO_LOSS_AGGREGATION_TYPE_FIXED_HORIZON" GrpoLossAggregationTypeGrpoLossAggregationTypeTokenMean GrpoLossAggregationType = "GRPO_LOSS_AGGREGATION_TYPE_TOKEN_MEAN" GrpoLossAggregationTypeGrpoLossAggregationTypeSequenceMean GrpoLossAggregationType = "GRPO_LOSS_AGGREGATION_TYPE_SEQUENCE_MEAN" )
type GrpoLossInputsParam ¶ added in v0.12.0
type GrpoLossInputsParam struct {
// Per-token advantages for GRPO
Advantages LossAdvantagesParam `json:"advantages,omitzero" api:"required"`
// Generator log probabilities for GRPO
GeneratorLogprobs LossLogprobsParam `json:"generator_logprobs,omitzero" api:"required"`
// Reference model log probabilities (required if beta > 0)
ReferenceLogprobs LossLogprobsParam `json:"reference_logprobs,omitzero"`
// contains filtered or unexported fields
}
The properties Advantages, GeneratorLogprobs are required.
func (GrpoLossInputsParam) MarshalJSON ¶ added in v0.12.0
func (r GrpoLossInputsParam) MarshalJSON() (data []byte, err error)
func (*GrpoLossInputsParam) UnmarshalJSON ¶ added in v0.12.0
func (r *GrpoLossInputsParam) UnmarshalJSON(data []byte) error
type GrpoLossParams ¶ added in v0.12.0
type GrpoLossParams struct {
// KL penalty coefficient
Beta param.Opt[float64] `json:"beta,omitzero"`
// Upper clip threshold for the importance-sampling ratio. The ratio is clamped to
// this bound; tighter clipping makes policy updates more conservative. Must
// be >= 1.
ClipHighThreshold param.Opt[float64] `json:"clip_high_threshold,omitzero"`
// Lower clip threshold for the importance-sampling ratio. The ratio is clamped to
// this bound; tighter clipping makes policy updates more conservative. Must be
// <= 1.
ClipLowThreshold param.Opt[float64] `json:"clip_low_threshold,omitzero"`
// Aggregation type for loss computation
//
// Any of "GRPO_LOSS_AGGREGATION_TYPE_UNSPECIFIED",
// "GRPO_LOSS_AGGREGATION_TYPE_FIXED_HORIZON",
// "GRPO_LOSS_AGGREGATION_TYPE_TOKEN_MEAN",
// "GRPO_LOSS_AGGREGATION_TYPE_SEQUENCE_MEAN".
AggType GrpoLossAggregationType `json:"agg_type,omitzero"`
// Controls how the importance-sampling ratio is computed in GRPO loss. Defaults to
// token-level ratios, which is the standard GRPO behavior. Use sequence-level
// ratios to enable GSPO-style loss calculation instead.
//
// Any of "GRPO_LOSS_RATIO_TYPE_TOKEN", "GRPO_LOSS_RATIO_TYPE_SEQUENCE".
RatioType GrpoLossRatioType `json:"ratio_type,omitzero"`
// contains filtered or unexported fields
}
func (GrpoLossParams) MarshalJSON ¶ added in v0.12.0
func (r GrpoLossParams) MarshalJSON() (data []byte, err error)
func (*GrpoLossParams) UnmarshalJSON ¶ added in v0.12.0
func (r *GrpoLossParams) UnmarshalJSON(data []byte) error
type GrpoLossRatioType ¶ added in v0.12.0
type GrpoLossRatioType string
Controls whether GRPO loss uses token-level or sequence-level importance ratios.
const ( GrpoLossRatioTypeGrpoLossRatioTypeToken GrpoLossRatioType = "GRPO_LOSS_RATIO_TYPE_TOKEN" GrpoLossRatioTypeGrpoLossRatioTypeSequence GrpoLossRatioType = "GRPO_LOSS_RATIO_TYPE_SEQUENCE" )
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) UnmarshalJSON ¶
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 ImportanceSamplingLossInputsParam ¶ added in v0.12.0
type ImportanceSamplingLossInputsParam struct {
// Per-token advantages for importance sampling
Advantages LossAdvantagesParam `json:"advantages,omitzero" api:"required"`
// Generator log probabilities for importance sampling
GeneratorLogprobs LossLogprobsParam `json:"generator_logprobs,omitzero" api:"required"`
// contains filtered or unexported fields
}
Loss inputs for unclipped importance-sampling policy-gradient updates.
The properties Advantages, GeneratorLogprobs are required.
func (ImportanceSamplingLossInputsParam) MarshalJSON ¶ added in v0.12.0
func (r ImportanceSamplingLossInputsParam) MarshalJSON() (data []byte, err error)
func (*ImportanceSamplingLossInputsParam) UnmarshalJSON ¶ added in v0.12.0
func (r *ImportanceSamplingLossInputsParam) UnmarshalJSON(data []byte) error
type InferenceCheckpoint ¶ added in v0.12.0
type InferenceCheckpoint struct {
// Unique identifier for the checkpoint
ID string `json:"id" api:"required"`
// Timestamp when the checkpoint was created
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// Training step at time of save
Step InferenceCheckpointStepUnion `json:"step" api:"required"`
// Model registration details
Registration InferenceCheckpointRegistration `json:"registration"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
Step respjson.Field
Registration respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Saved inference checkpoint
func (InferenceCheckpoint) RawJSON ¶ added in v0.12.0
func (r InferenceCheckpoint) RawJSON() string
Returns the unmodified JSON received from the API
func (*InferenceCheckpoint) UnmarshalJSON ¶ added in v0.12.0
func (r *InferenceCheckpoint) UnmarshalJSON(data []byte) error
type InferenceCheckpointOperation ¶ added in v0.12.0
type InferenceCheckpointOperation struct {
// Operation ID
ID string `json:"id" api:"required"`
// Operation status
//
// Any of "TRAINING_OPERATION_STATUS_UNSPECIFIED",
// "TRAINING_OPERATION_STATUS_PENDING", "TRAINING_OPERATION_STATUS_RUNNING",
// "TRAINING_OPERATION_STATUS_COMPLETED", "TRAINING_OPERATION_STATUS_FAILED".
Status TrainingOperationStatus `json:"status" api:"required"`
// Error details on failure
Error TrainingOperationError `json:"error"`
// Result on success
Output InferenceCheckpointResult `json:"output"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Status respjson.Field
Error respjson.Field
Output respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Async inference checkpoint operation
func (InferenceCheckpointOperation) RawJSON ¶ added in v0.12.0
func (r InferenceCheckpointOperation) RawJSON() string
Returns the unmodified JSON received from the API
func (*InferenceCheckpointOperation) UnmarshalJSON ¶ added in v0.12.0
func (r *InferenceCheckpointOperation) UnmarshalJSON(data []byte) error
type InferenceCheckpointRegistration ¶ added in v0.12.0
type InferenceCheckpointRegistration struct {
// Registered model name for downloading the checkpoint
ModelName string `json:"model_name" api:"required"`
// Timestamp when the model was registered
RegisteredAt time.Time `json:"registered_at" api:"required" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ModelName respjson.Field
RegisteredAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Model registration details
func (InferenceCheckpointRegistration) RawJSON ¶ added in v0.12.0
func (r InferenceCheckpointRegistration) RawJSON() string
Returns the unmodified JSON received from the API
func (*InferenceCheckpointRegistration) UnmarshalJSON ¶ added in v0.12.0
func (r *InferenceCheckpointRegistration) UnmarshalJSON(data []byte) error
type InferenceCheckpointResult ¶ added in v0.12.0
type InferenceCheckpointResult struct {
// Registered model name for downloading the checkpoint
ModelName string `json:"model_name" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ModelName respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Result of an inference checkpoint operation
func (InferenceCheckpointResult) RawJSON ¶ added in v0.12.0
func (r InferenceCheckpointResult) RawJSON() string
Returns the unmodified JSON received from the API
func (*InferenceCheckpointResult) UnmarshalJSON ¶ added in v0.12.0
func (r *InferenceCheckpointResult) UnmarshalJSON(data []byte) error
type InferenceCheckpointStepUnion ¶ added in v0.12.0
type InferenceCheckpointStepUnion 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 [int64] instead of an object.
OfInt int64 `json:",inline"`
JSON struct {
OfString respjson.Field
OfInt respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
InferenceCheckpointStepUnion contains all possible properties and values from [string], [int64].
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 OfInt]
func (InferenceCheckpointStepUnion) AsInt ¶ added in v0.12.0
func (u InferenceCheckpointStepUnion) AsInt() (v int64)
func (InferenceCheckpointStepUnion) AsString ¶ added in v0.12.0
func (u InferenceCheckpointStepUnion) AsString() (v string)
func (InferenceCheckpointStepUnion) RawJSON ¶ added in v0.12.0
func (u InferenceCheckpointStepUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*InferenceCheckpointStepUnion) UnmarshalJSON ¶ added in v0.12.0
func (r *InferenceCheckpointStepUnion) UnmarshalJSON(data []byte) error
type InferenceInstanceType ¶ added in v0.11.0
type InferenceInstanceType struct {
// Stable hardware instance type identifier used by deployment configs.
ID string `json:"id" api:"required"`
// Human-readable summary of the hardware configuration.
Description string `json:"description" api:"required"`
// Number of GPUs in one replica of this instance type.
GPUCount int64 `json:"gpuCount" api:"required"`
// Memory available on each GPU, in GiB.
GPUMemoryGib int64 `json:"gpuMemoryGib" api:"required"`
// GPU accelerator model, such as `H100` or `B200`.
GPUType string `json:"gpuType" api:"required"`
// Human-readable instance type name.
Name string `json:"name" api:"required"`
// On-demand price for one running replica, in US cents per hour.
PriceCentsPerHour int64 `json:"priceCentsPerHour" api:"required"`
// Regions where this instance type is offered.
Regions []InferenceInstanceTypeRegion `json:"regions" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Description respjson.Field
GPUCount respjson.Field
GPUMemoryGib respjson.Field
GPUType respjson.Field
Name respjson.Field
PriceCentsPerHour respjson.Field
Regions respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
GPU hardware configuration on which one inference replica can run.
func (InferenceInstanceType) RawJSON ¶ added in v0.11.0
func (r InferenceInstanceType) RawJSON() string
Returns the unmodified JSON received from the API
func (*InferenceInstanceType) UnmarshalJSON ¶ added in v0.11.0
func (r *InferenceInstanceType) UnmarshalJSON(data []byte) error
type InferenceInstanceTypeRegion ¶ added in v0.11.0
type InferenceInstanceTypeRegion struct {
// Region name where an instance type is offered.
Name string `json:"name" api:"required"`
// Best-effort estimate of how many additional replicas currently fit in a region.
Headroom InferenceInstanceTypeRegionHeadroom `json:"headroom"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Name respjson.Field
Headroom respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Region where an instance type is offered.
func (InferenceInstanceTypeRegion) RawJSON ¶ added in v0.11.0
func (r InferenceInstanceTypeRegion) RawJSON() string
Returns the unmodified JSON received from the API
func (*InferenceInstanceTypeRegion) UnmarshalJSON ¶ added in v0.11.0
func (r *InferenceInstanceTypeRegion) UnmarshalJSON(data []byte) error
type InferenceInstanceTypeRegionHeadroom ¶ added in v0.11.0
type InferenceInstanceTypeRegionHeadroom struct {
// Whether the value is exact or a lower bound.
//
// Any of "RELATION_EQ", "RELATION_GTE".
Relation string `json:"relation" api:"required"`
// Capped count of replicas that currently fit.
Value int64 `json:"value"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Relation respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Best-effort estimate of how many additional replicas currently fit in a region.
func (InferenceInstanceTypeRegionHeadroom) RawJSON ¶ added in v0.11.0
func (r InferenceInstanceTypeRegionHeadroom) RawJSON() string
Returns the unmodified JSON received from the API
func (*InferenceInstanceTypeRegionHeadroom) UnmarshalJSON ¶ added in v0.11.0
func (r *InferenceInstanceTypeRegionHeadroom) UnmarshalJSON(data []byte) error
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) UnmarshalJSON ¶
type LoraConfig ¶ added in v0.12.0
type LoraConfig struct {
// Alpha of the LoRA adapter
Alpha int64 `json:"alpha"`
// Dropout of the LoRA adapter
Dropout float64 `json:"dropout"`
// Whether to enable LoRA fine-tuning. If false, full fine-tuning is used.
Enable bool `json:"enable"`
// Rank of the LoRA adapter
Rank int64 `json:"rank"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Alpha respjson.Field
Dropout respjson.Field
Enable respjson.Field
Rank respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
LoRA adapter configuration
func (LoraConfig) RawJSON ¶ added in v0.12.0
func (r LoraConfig) RawJSON() string
Returns the unmodified JSON received from the API
func (LoraConfig) ToParam ¶ added in v0.12.0
func (r LoraConfig) ToParam() LoraConfigParam
ToParam converts this LoraConfig to a LoraConfigParam.
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 LoraConfigParam.Overrides()
func (*LoraConfig) UnmarshalJSON ¶ added in v0.12.0
func (r *LoraConfig) UnmarshalJSON(data []byte) error
type LoraConfigParam ¶ added in v0.12.0
type LoraConfigParam struct {
// Alpha of the LoRA adapter
Alpha param.Opt[int64] `json:"alpha,omitzero"`
// Dropout of the LoRA adapter
Dropout param.Opt[float64] `json:"dropout,omitzero"`
// Whether to enable LoRA fine-tuning. If false, full fine-tuning is used.
Enable param.Opt[bool] `json:"enable,omitzero"`
// Rank of the LoRA adapter
Rank param.Opt[int64] `json:"rank,omitzero"`
// contains filtered or unexported fields
}
LoRA adapter configuration
func (LoraConfigParam) MarshalJSON ¶ added in v0.12.0
func (r LoraConfigParam) MarshalJSON() (data []byte, err error)
func (*LoraConfigParam) UnmarshalJSON ¶ added in v0.12.0
func (r *LoraConfigParam) UnmarshalJSON(data []byte) error
type LossAdvantagesParam ¶ added in v0.12.0
type LossAdvantagesParam struct {
// Float array of per-token advantages
Data []float64 `json:"data,omitzero" api:"required"`
// Data type of the float array (D_TYPE_FLOAT32 or D_TYPE_BFLOAT16)
//
// Any of "D_TYPE_UNSPECIFIED", "D_TYPE_INT64", "D_TYPE_FLOAT32",
// "D_TYPE_BFLOAT16".
Dtype DType `json:"dtype,omitzero"`
// contains filtered or unexported fields
}
The property Data is required.
func (LossAdvantagesParam) MarshalJSON ¶ added in v0.12.0
func (r LossAdvantagesParam) MarshalJSON() (data []byte, err error)
func (*LossAdvantagesParam) UnmarshalJSON ¶ added in v0.12.0
func (r *LossAdvantagesParam) UnmarshalJSON(data []byte) error
type LossConfigParam ¶ added in v0.12.0
type LossConfigParam struct {
// Type of loss function to use
//
// Any of "LOSS_TYPE_UNSPECIFIED", "LOSS_TYPE_CROSS_ENTROPY", "LOSS_TYPE_GRPO",
// "LOSS_TYPE_IMPORTANCE_SAMPLING", "LOSS_TYPE_PPO", "LOSS_TYPE_CISPO",
// "LOSS_TYPE_DRO".
Type LossType `json:"type,omitzero" api:"required"`
CispoParams CispoLossParams `json:"cispo_params,omitzero"`
// Cross-entropy loss parameters (currently empty).
CrossEntropyParams CrossEntropyLossParams `json:"cross_entropy_params,omitzero"`
DroParams DroLossParams `json:"dro_params,omitzero"`
GrpoParams GrpoLossParams `json:"grpo_params,omitzero"`
PpoParams PpoLossParams `json:"ppo_params,omitzero"`
// contains filtered or unexported fields
}
The property Type is required.
func (LossConfigParam) MarshalJSON ¶ added in v0.12.0
func (r LossConfigParam) MarshalJSON() (data []byte, err error)
func (*LossConfigParam) UnmarshalJSON ¶ added in v0.12.0
func (r *LossConfigParam) UnmarshalJSON(data []byte) error
type LossInputsParam ¶ added in v0.12.0
type LossInputsParam struct {
// Target tokens for loss computation
TargetTokens LossTargetTokensParam `json:"target_tokens,omitzero" api:"required"`
CispoInputs CispoLossInputsParam `json:"cispo_inputs,omitzero"`
DroInputs DroLossInputsParam `json:"dro_inputs,omitzero"`
// Inputs required when the loss type is GRPO
GrpoInputs GrpoLossInputsParam `json:"grpo_inputs,omitzero"`
// Inputs required when the loss type is importance sampling
ImportanceSamplingInputs ImportanceSamplingLossInputsParam `json:"importance_sampling_inputs,omitzero"`
// Per-token loss mask (1=compute loss, 0=ignore). Required for cross-entropy
// forward-backward; optional for forward and advantage-based losses, where
// omission includes all tokens.
LossMask LossMaskParam `json:"loss_mask,omitzero"`
PpoInputs PpoLossInputsParam `json:"ppo_inputs,omitzero"`
// contains filtered or unexported fields
}
Token-level inputs used to compute the loss for one training sample.
The property TargetTokens is required.
func (LossInputsParam) MarshalJSON ¶ added in v0.12.0
func (r LossInputsParam) MarshalJSON() (data []byte, err error)
func (*LossInputsParam) UnmarshalJSON ¶ added in v0.12.0
func (r *LossInputsParam) UnmarshalJSON(data []byte) error
type LossLogprobsParam ¶ added in v0.12.0
type LossLogprobsParam struct {
// Float array of per-token log probabilities
Data []float64 `json:"data,omitzero" api:"required"`
// Data type of the float array (D_TYPE_FLOAT32 or D_TYPE_BFLOAT16)
//
// Any of "D_TYPE_UNSPECIFIED", "D_TYPE_INT64", "D_TYPE_FLOAT32",
// "D_TYPE_BFLOAT16".
Dtype DType `json:"dtype,omitzero"`
// contains filtered or unexported fields
}
The property Data is required.
func (LossLogprobsParam) MarshalJSON ¶ added in v0.12.0
func (r LossLogprobsParam) MarshalJSON() (data []byte, err error)
func (*LossLogprobsParam) UnmarshalJSON ¶ added in v0.12.0
func (r *LossLogprobsParam) UnmarshalJSON(data []byte) error
type LossMaskDataUnionParam ¶ added in v0.12.0
type LossMaskDataUnionParam struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfInt param.Opt[int64] `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 (LossMaskDataUnionParam) MarshalJSON ¶ added in v0.12.0
func (u LossMaskDataUnionParam) MarshalJSON() ([]byte, error)
func (*LossMaskDataUnionParam) UnmarshalJSON ¶ added in v0.12.0
func (u *LossMaskDataUnionParam) UnmarshalJSON(data []byte) error
type LossMaskParam ¶ added in v0.12.0
type LossMaskParam struct {
// Integer array of per-token mask values (0s and 1s)
Data []LossMaskDataUnionParam `json:"data,omitzero" api:"required"`
// Data type of the integer array (must be D_TYPE_INT64)
//
// Any of "D_TYPE_UNSPECIFIED", "D_TYPE_INT64", "D_TYPE_FLOAT32",
// "D_TYPE_BFLOAT16".
Dtype DType `json:"dtype,omitzero"`
// contains filtered or unexported fields
}
Per-token loss mask (1=compute loss, 0=ignore)
The property Data is required.
func (LossMaskParam) MarshalJSON ¶ added in v0.12.0
func (r LossMaskParam) MarshalJSON() (data []byte, err error)
func (*LossMaskParam) UnmarshalJSON ¶ added in v0.12.0
func (r *LossMaskParam) UnmarshalJSON(data []byte) error
type LossTargetTokensDataUnionParam ¶ added in v0.12.0
type LossTargetTokensDataUnionParam struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfInt param.Opt[int64] `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 (LossTargetTokensDataUnionParam) MarshalJSON ¶ added in v0.12.0
func (u LossTargetTokensDataUnionParam) MarshalJSON() ([]byte, error)
func (*LossTargetTokensDataUnionParam) UnmarshalJSON ¶ added in v0.12.0
func (u *LossTargetTokensDataUnionParam) UnmarshalJSON(data []byte) error
type LossTargetTokensParam ¶ added in v0.12.0
type LossTargetTokensParam struct {
// Integer array of target tokens
Data []LossTargetTokensDataUnionParam `json:"data,omitzero" api:"required"`
// Data type of the integer array
//
// Any of "D_TYPE_UNSPECIFIED", "D_TYPE_INT64", "D_TYPE_FLOAT32",
// "D_TYPE_BFLOAT16".
Dtype DType `json:"dtype,omitzero"`
// contains filtered or unexported fields
}
The property Data is required.
func (LossTargetTokensParam) MarshalJSON ¶ added in v0.12.0
func (r LossTargetTokensParam) MarshalJSON() (data []byte, err error)
func (*LossTargetTokensParam) UnmarshalJSON ¶ added in v0.12.0
func (r *LossTargetTokensParam) UnmarshalJSON(data []byte) error
type LossType ¶ added in v0.12.0
type LossType string
Type of loss function used for RL training.
const ( LossTypeLossTypeUnspecified LossType = "LOSS_TYPE_UNSPECIFIED" LossTypeLossTypeCrossEntropy LossType = "LOSS_TYPE_CROSS_ENTROPY" LossTypeLossTypeGrpo LossType = "LOSS_TYPE_GRPO" LossTypeLossTypeImportanceSampling LossType = "LOSS_TYPE_IMPORTANCE_SAMPLING" LossTypeLossTypePpo LossType = "LOSS_TYPE_PPO" LossTypeLossTypeCispo LossType = "LOSS_TYPE_CISPO" LossTypeLossTypeDro LossType = "LOSS_TYPE_DRO" )
type Model ¶ added in v0.11.0
type Model struct {
// Unique model identifier.
ID string `json:"id" api:"required"`
// Project-qualified model name in the form `<project_slug>/<model_name>`. Create
// and update requests may use the bare or qualified form.
Name string `json:"name" api:"required"`
// ID of the organization that owns the model's project.
OrganizationID string `json:"organizationId" api:"required"`
// ID of the project that owns the model.
ProjectID string `json:"projectId" api:"required"`
// Who can discover the model. `VISIBILITY_PRIVATE` restricts it to the project;
// `VISIBILITY_INTERNAL` shares it with the organization.
//
// Any of "VISIBILITY_PRIVATE", "VISIBILITY_INTERNAL".
Visibility ModelVisibility `json:"visibility" api:"required"`
// Architecture, size, precision, and speculative-decoding metadata derived from
// the model files.
Weights ModelWeights `json:"weights" api:"required"`
// Resource name of the base model, using
// `projects/{baseProject}/models/{baseModelId}`; empty when the model has no base.
BaseModel string `json:"baseModel"`
// ID of the supported or custom base model from which this model was derived.
BaseModelID string `json:"baseModelId"`
// Human-readable description of the model and its intended use.
Description string `json:"description"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Name respjson.Field
OrganizationID respjson.Field
ProjectID respjson.Field
Visibility respjson.Field
Weights respjson.Field
BaseModel respjson.Field
BaseModelID respjson.Field
Description respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Custom or derived model registered in a project and backed by versioned weight files.
func (*Model) UnmarshalJSON ¶ added in v0.11.0
type ModelInputChunkEncodedTextParam ¶ added in v0.12.0
type ModelInputChunkEncodedTextParam struct {
// Pre-tokenized text input
Tokens []ModelInputChunkEncodedTextTokenUnionParam `json:"tokens,omitzero" api:"required"`
// contains filtered or unexported fields
}
Pre-tokenized text content for this input chunk.
The property Tokens is required.
func (ModelInputChunkEncodedTextParam) MarshalJSON ¶ added in v0.12.0
func (r ModelInputChunkEncodedTextParam) MarshalJSON() (data []byte, err error)
func (*ModelInputChunkEncodedTextParam) UnmarshalJSON ¶ added in v0.12.0
func (r *ModelInputChunkEncodedTextParam) UnmarshalJSON(data []byte) error
type ModelInputChunkEncodedTextTokenUnionParam ¶ added in v0.12.0
type ModelInputChunkEncodedTextTokenUnionParam struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfInt param.Opt[int64] `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 (ModelInputChunkEncodedTextTokenUnionParam) MarshalJSON ¶ added in v0.12.0
func (u ModelInputChunkEncodedTextTokenUnionParam) MarshalJSON() ([]byte, error)
func (*ModelInputChunkEncodedTextTokenUnionParam) UnmarshalJSON ¶ added in v0.12.0
func (u *ModelInputChunkEncodedTextTokenUnionParam) UnmarshalJSON(data []byte) error
type ModelInputChunkParam ¶ added in v0.12.0
type ModelInputChunkParam struct {
// Pre-tokenized text content for this input chunk.
EncodedText ModelInputChunkEncodedTextParam `json:"encoded_text,omitzero" api:"required"`
// contains filtered or unexported fields
}
A single chunk of model input content.
The property EncodedText is required.
func (ModelInputChunkParam) MarshalJSON ¶ added in v0.12.0
func (r ModelInputChunkParam) MarshalJSON() (data []byte, err error)
func (*ModelInputChunkParam) UnmarshalJSON ¶ added in v0.12.0
func (r *ModelInputChunkParam) UnmarshalJSON(data []byte) error
type ModelInputParam ¶ added in v0.12.0
type ModelInputParam struct {
// Input chunks for the model
Chunks []ModelInputChunkParam `json:"chunks,omitzero" api:"required"`
// contains filtered or unexported fields
}
The property Chunks is required.
func (ModelInputParam) MarshalJSON ¶ added in v0.12.0
func (r ModelInputParam) MarshalJSON() (data []byte, err error)
func (*ModelInputParam) UnmarshalJSON ¶ added in v0.12.0
func (r *ModelInputParam) 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 ModelResources ¶ added in v0.12.0
type ModelResources struct {
// Unique identifier for the model resource
ID string `json:"id" api:"required"`
// Base model the resource is provisioned for
BaseModel string `json:"base_model" api:"required"`
// Compute layout provisioned for the resource.
ComputeConfig ModelResourcesComputeConfig `json:"compute_config" api:"required"`
// Timestamp when the model resource was created
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// ID of the user who created the model resource
CreatedBy string `json:"created_by" api:"required"`
// Whether the resource hosts LoRA sessions or a full-weight session
LoraEnabled bool `json:"lora_enabled" api:"required"`
// Optimizer configuration for this resource.
OptimizerConfig OptimizerConfig `json:"optimizer_config" api:"required"`
// Lifecycle status of the model resource
//
// Any of "MODEL_RESOURCES_STATUS_PENDING", "MODEL_RESOURCES_STATUS_CREATING",
// "MODEL_RESOURCES_STATUS_READY", "MODEL_RESOURCES_STATUS_ERROR",
// "MODEL_RESOURCES_STATUS_STOPPED", "MODEL_RESOURCES_STATUS_STOPPING".
Status ModelResourcesStatus `json:"status" api:"required"`
// Timestamp when the model resource was last updated
UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
// Structured detail for the model resource's current error. Set when the resource
// is in an error state.
Error ModelResourcesError `json:"error"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
BaseModel respjson.Field
ComputeConfig respjson.Field
CreatedAt respjson.Field
CreatedBy respjson.Field
LoraEnabled respjson.Field
OptimizerConfig respjson.Field
Status respjson.Field
UpdatedAt respjson.Field
Error respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Allocated GPU resources that training sessions attach to
func (ModelResources) RawJSON ¶ added in v0.12.0
func (r ModelResources) RawJSON() string
Returns the unmodified JSON received from the API
func (*ModelResources) UnmarshalJSON ¶ added in v0.12.0
func (r *ModelResources) UnmarshalJSON(data []byte) error
type ModelResourcesComputeConfig ¶ added in v0.12.0
type ModelResourcesComputeConfig struct {
// Number of generator replicas. 0 means the resource runs the trainer only, with
// no generator.
NumGeneratorReplicas int64 `json:"num_generator_replicas" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
NumGeneratorReplicas respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Compute layout provisioned for the resource.
func (ModelResourcesComputeConfig) RawJSON ¶ added in v0.12.0
func (r ModelResourcesComputeConfig) RawJSON() string
Returns the unmodified JSON received from the API
func (*ModelResourcesComputeConfig) UnmarshalJSON ¶ added in v0.12.0
func (r *ModelResourcesComputeConfig) UnmarshalJSON(data []byte) error
type ModelResourcesError ¶ added in v0.12.0
type ModelResourcesError struct {
// Finite machine-readable reason code for UI branching
//
// Any of "MODEL_RESOURCES_ERROR_CODE_CAPACITY_UNAVAILABLE",
// "MODEL_RESOURCES_ERROR_CODE_PROVISIONING_FAILED".
Code ModelResourcesErrorCode `json:"code" api:"required"`
// User-safe human-readable detail for the current status
Message string `json:"message" api:"required"`
// Timestamp when this error was reported
OccurredAt time.Time `json:"occurred_at" api:"required" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Code respjson.Field
Message respjson.Field
OccurredAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Structured detail for the model resource's current error
func (ModelResourcesError) RawJSON ¶ added in v0.12.0
func (r ModelResourcesError) RawJSON() string
Returns the unmodified JSON received from the API
func (*ModelResourcesError) UnmarshalJSON ¶ added in v0.12.0
func (r *ModelResourcesError) UnmarshalJSON(data []byte) error
type ModelResourcesErrorCode ¶ added in v0.12.0
type ModelResourcesErrorCode string
Finite machine-readable model resource lifecycle error code
const ( ModelResourcesErrorCodeModelResourcesErrorCodeProvisioningFailed ModelResourcesErrorCode = "MODEL_RESOURCES_ERROR_CODE_PROVISIONING_FAILED" )
type ModelResourcesEstimateCostResponse ¶ added in v0.12.0
type ModelResourcesEstimateCostResponse struct {
// ISO 4217 currency code.
Currency string `json:"currency" api:"required"`
// Estimated on-demand price per hour in the currency's major unit.
PricePerHour float64 `json:"price_per_hour" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Currency respjson.Field
PricePerHour respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ModelResourcesEstimateCostResponse) RawJSON ¶ added in v0.12.0
func (r ModelResourcesEstimateCostResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ModelResourcesEstimateCostResponse) UnmarshalJSON ¶ added in v0.12.0
func (r *ModelResourcesEstimateCostResponse) UnmarshalJSON(data []byte) error
type ModelResourcesListResponse ¶ added in v0.12.0
type ModelResourcesListResponse struct {
// List of model resources
Data []ModelResources `json:"data" api:"required"`
// Pagination metadata
Meta ModelResourcesListResponseMeta `json:"meta" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Paginated list of model resources
func (ModelResourcesListResponse) RawJSON ¶ added in v0.12.0
func (r ModelResourcesListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ModelResourcesListResponse) UnmarshalJSON ¶ added in v0.12.0
func (r *ModelResourcesListResponse) UnmarshalJSON(data []byte) error
type ModelResourcesListResponseMeta ¶ added in v0.12.0
type ModelResourcesListResponseMeta struct {
// Whether more items exist beyond this page
HasMore bool `json:"has_more"`
// Maximum number of items returned per page
Limit int64 `json:"limit"`
// Cursor to use as the 'after' parameter for the next page. Empty when has_more is
// false.
NextCursor string `json:"next_cursor"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
HasMore respjson.Field
Limit respjson.Field
NextCursor respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Pagination metadata
func (ModelResourcesListResponseMeta) RawJSON ¶ added in v0.12.0
func (r ModelResourcesListResponseMeta) RawJSON() string
Returns the unmodified JSON received from the API
func (*ModelResourcesListResponseMeta) UnmarshalJSON ¶ added in v0.12.0
func (r *ModelResourcesListResponseMeta) UnmarshalJSON(data []byte) error
type ModelResourcesStatus ¶ added in v0.12.0
type ModelResourcesStatus string
Lifecycle status of a model resource
const ( ModelResourcesStatusModelResourcesStatusPending ModelResourcesStatus = "MODEL_RESOURCES_STATUS_PENDING" ModelResourcesStatusModelResourcesStatusCreating ModelResourcesStatus = "MODEL_RESOURCES_STATUS_CREATING" ModelResourcesStatusModelResourcesStatusReady ModelResourcesStatus = "MODEL_RESOURCES_STATUS_READY" ModelResourcesStatusModelResourcesStatusError ModelResourcesStatus = "MODEL_RESOURCES_STATUS_ERROR" ModelResourcesStatusModelResourcesStatusStopped ModelResourcesStatus = "MODEL_RESOURCES_STATUS_STOPPED" ModelResourcesStatusModelResourcesStatusStopping ModelResourcesStatus = "MODEL_RESOURCES_STATUS_STOPPING" )
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
func (r ModelUploadStatusResponseArgs) RawJSON() string
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
func (r ModelUploadStatusResponseStatusUpdate) RawJSON() string
Returns the unmodified JSON received from the API
func (*ModelUploadStatusResponseStatusUpdate) UnmarshalJSON ¶ added in v0.6.0
func (r *ModelUploadStatusResponseStatusUpdate) UnmarshalJSON(data []byte) error
type ModelVisibility ¶ added in v0.11.0
type ModelVisibility string
Who can discover the model. `VISIBILITY_PRIVATE` restricts it to the project; `VISIBILITY_INTERNAL` shares it with the organization.
const ( ModelVisibilityVisibilityPrivate ModelVisibility = "VISIBILITY_PRIVATE" ModelVisibilityVisibilityInternal ModelVisibility = "VISIBILITY_INTERNAL" )
type ModelWeights ¶ added in v0.11.0
type ModelWeights struct {
// Model architecture detected from the weight metadata.
Architecture string `json:"architecture"`
// Maximum context length reported by the model metadata.
ContextLength string `json:"contextLength"`
// Draft-model speculator family for draft speculative decoding.
//
// Any of "DRAFT_SPECULATOR_TYPE_EAGLE", "DRAFT_SPECULATOR_TYPE_PHOENIX".
DraftSpeculatorType string `json:"draftSpeculatorType"`
// Total parameter count and breakdown by numerical data type.
Parameters ModelWeightsParameters `json:"parameters"`
// Speculative decoding mechanism for speculator weights.
//
// Any of "SPECULATOR_MECHANISM_DRAFT", "SPECULATOR_MECHANISM_LOOKAHEAD",
// "SPECULATOR_MECHANISM_MTP".
SpeculatorMechanism string `json:"speculatorMechanism"`
// Role of the weights: full model, speculative draft model, or LoRA adapter.
//
// Any of "WEIGHTS_TYPE_DEFAULT", "WEIGHTS_TYPE_SPECULATOR",
// "WEIGHTS_TYPE_ADAPTER".
Type string `json:"type"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Architecture respjson.Field
ContextLength respjson.Field
DraftSpeculatorType respjson.Field
Parameters respjson.Field
SpeculatorMechanism respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Architecture, size, precision, and speculative-decoding metadata derived from the model files.
func (ModelWeights) RawJSON ¶ added in v0.11.0
func (r ModelWeights) RawJSON() string
Returns the unmodified JSON received from the API
func (*ModelWeights) UnmarshalJSON ¶ added in v0.11.0
func (r *ModelWeights) UnmarshalJSON(data []byte) error
type ModelWeightsParameters ¶ added in v0.11.0
type ModelWeightsParameters struct {
// Parameter counts grouped by numerical data type.
ByDtype []ModelWeightsParametersByDtype `json:"byDtype" api:"required"`
// Total number of parameters in the model weights.
Total string `json:"total" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ByDtype respjson.Field
Total respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Total parameter count and breakdown by numerical data type.
func (ModelWeightsParameters) RawJSON ¶ added in v0.11.0
func (r ModelWeightsParameters) RawJSON() string
Returns the unmodified JSON received from the API
func (*ModelWeightsParameters) UnmarshalJSON ¶ added in v0.11.0
func (r *ModelWeightsParameters) UnmarshalJSON(data []byte) error
type ModelWeightsParametersByDtype ¶ added in v0.11.0
type ModelWeightsParametersByDtype struct {
// Number of model parameters stored with this data type.
Count string `json:"count" api:"required"`
// Numerical data type, such as `float16`, `bfloat16`, or `int8`.
Dtype string `json:"dtype" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Count respjson.Field
Dtype respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Number of model parameters stored in one numerical data type.
func (ModelWeightsParametersByDtype) RawJSON ¶ added in v0.11.0
func (r ModelWeightsParametersByDtype) RawJSON() string
Returns the unmodified JSON received from the API
func (*ModelWeightsParametersByDtype) UnmarshalJSON ¶ added in v0.11.0
func (r *ModelWeightsParametersByDtype) UnmarshalJSON(data []byte) error
type MuonOptimizerConfig ¶ added in v0.12.0
type MuonOptimizerConfig struct {
// Scaling strategy for the Muon optimizer.
//
// Any of "MUON_SCALING_STRATEGY_UNSPECIFIED", "MUON_SCALING_STRATEGY_MATCH_ADAMW",
// "MUON_SCALING_STRATEGY_ORIGINAL".
ScalingStrategy MuonScalingStrategy `json:"scaling_strategy"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ScalingStrategy respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Advanced configuration for the Muon optimizer.
func (MuonOptimizerConfig) RawJSON ¶ added in v0.12.0
func (r MuonOptimizerConfig) RawJSON() string
Returns the unmodified JSON received from the API
func (MuonOptimizerConfig) ToParam ¶ added in v0.12.0
func (r MuonOptimizerConfig) ToParam() MuonOptimizerConfigParam
ToParam converts this MuonOptimizerConfig to a MuonOptimizerConfigParam.
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 MuonOptimizerConfigParam.Overrides()
func (*MuonOptimizerConfig) UnmarshalJSON ¶ added in v0.12.0
func (r *MuonOptimizerConfig) UnmarshalJSON(data []byte) error
type MuonOptimizerConfigParam ¶ added in v0.12.0
type MuonOptimizerConfigParam struct {
// Scaling strategy for the Muon optimizer.
//
// Any of "MUON_SCALING_STRATEGY_UNSPECIFIED", "MUON_SCALING_STRATEGY_MATCH_ADAMW",
// "MUON_SCALING_STRATEGY_ORIGINAL".
ScalingStrategy MuonScalingStrategy `json:"scaling_strategy,omitzero"`
// contains filtered or unexported fields
}
Advanced configuration for the Muon optimizer.
func (MuonOptimizerConfigParam) MarshalJSON ¶ added in v0.12.0
func (r MuonOptimizerConfigParam) MarshalJSON() (data []byte, err error)
func (*MuonOptimizerConfigParam) UnmarshalJSON ¶ added in v0.12.0
func (r *MuonOptimizerConfigParam) UnmarshalJSON(data []byte) error
type MuonOptimizerParams ¶ added in v0.12.0
type MuonOptimizerParams struct {
// Learning rate for this Muon optimizer step.
LearningRate param.Opt[float64] `json:"learning_rate,omitzero"`
// Momentum coefficient
Momentum param.Opt[float64] `json:"momentum,omitzero"`
// Number of Newton-Schulz iterations
NewtonSchulzSteps param.Opt[int64] `json:"newton_schulz_steps,omitzero"`
// Weight decay coefficient
WeightDecay param.Opt[float64] `json:"weight_decay,omitzero"`
// Per-step AdamW optimizer overrides for the AdamW-tuned parameters in a
// Muon-tuned optimizer session.
Adamw AdamwOptimizerParams `json:"adamw,omitzero"`
// contains filtered or unexported fields
}
Per-step Muon optimizer overrides
func (MuonOptimizerParams) MarshalJSON ¶ added in v0.12.0
func (r MuonOptimizerParams) MarshalJSON() (data []byte, err error)
func (*MuonOptimizerParams) UnmarshalJSON ¶ added in v0.12.0
func (r *MuonOptimizerParams) UnmarshalJSON(data []byte) error
type MuonScalingStrategy ¶ added in v0.12.0
type MuonScalingStrategy string
const ( MuonScalingStrategyMuonScalingStrategyUnspecified MuonScalingStrategy = "MUON_SCALING_STRATEGY_UNSPECIFIED" MuonScalingStrategyMuonScalingStrategyMatchAdamw MuonScalingStrategy = "MUON_SCALING_STRATEGY_MATCH_ADAMW" MuonScalingStrategyMuonScalingStrategyOriginal MuonScalingStrategy = "MUON_SCALING_STRATEGY_ORIGINAL" )
type OptimStepOperation ¶ added in v0.12.0
type OptimStepOperation struct {
// Operation ID
ID string `json:"id" api:"required"`
// Operation status
//
// Any of "TRAINING_OPERATION_STATUS_UNSPECIFIED",
// "TRAINING_OPERATION_STATUS_PENDING", "TRAINING_OPERATION_STATUS_RUNNING",
// "TRAINING_OPERATION_STATUS_COMPLETED", "TRAINING_OPERATION_STATUS_FAILED".
Status TrainingOperationStatus `json:"status" api:"required"`
// Error details on failure
Error TrainingOperationError `json:"error"`
// Result on success
Output OptimStepResult `json:"output"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Status respjson.Field
Error respjson.Field
Output respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Async optimizer step operation
func (OptimStepOperation) RawJSON ¶ added in v0.12.0
func (r OptimStepOperation) RawJSON() string
Returns the unmodified JSON received from the API
func (*OptimStepOperation) UnmarshalJSON ¶ added in v0.12.0
func (r *OptimStepOperation) UnmarshalJSON(data []byte) error
type OptimStepResult ¶ added in v0.12.0
type OptimStepResult struct {
// Step number
Step OptimStepResultStepUnion `json:"step" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Step respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Result of an optimizer step operation
func (OptimStepResult) RawJSON ¶ added in v0.12.0
func (r OptimStepResult) RawJSON() string
Returns the unmodified JSON received from the API
func (*OptimStepResult) UnmarshalJSON ¶ added in v0.12.0
func (r *OptimStepResult) UnmarshalJSON(data []byte) error
type OptimStepResultStepUnion ¶ added in v0.12.0
type OptimStepResultStepUnion 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 [int64] instead of an object.
OfInt int64 `json:",inline"`
JSON struct {
OfString respjson.Field
OfInt respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
OptimStepResultStepUnion contains all possible properties and values from [string], [int64].
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 OfInt]
func (OptimStepResultStepUnion) AsInt ¶ added in v0.12.0
func (u OptimStepResultStepUnion) AsInt() (v int64)
func (OptimStepResultStepUnion) AsString ¶ added in v0.12.0
func (u OptimStepResultStepUnion) AsString() (v string)
func (OptimStepResultStepUnion) RawJSON ¶ added in v0.12.0
func (u OptimStepResultStepUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*OptimStepResultStepUnion) UnmarshalJSON ¶ added in v0.12.0
func (r *OptimStepResultStepUnion) UnmarshalJSON(data []byte) error
type OptimizerConfig ¶ added in v0.12.0
type OptimizerConfig struct {
// Use the AdamW optimizer.
Adamw AdamwOptimizerConfig `json:"adamw"`
// Use the Muon optimizer.
Muon MuonOptimizerConfig `json:"muon"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Adamw respjson.Field
Muon respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Optimizer configuration
func (OptimizerConfig) RawJSON ¶ added in v0.12.0
func (r OptimizerConfig) RawJSON() string
Returns the unmodified JSON received from the API
func (OptimizerConfig) ToParam ¶ added in v0.12.0
func (r OptimizerConfig) ToParam() OptimizerConfigParam
ToParam converts this OptimizerConfig to a OptimizerConfigParam.
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 OptimizerConfigParam.Overrides()
func (*OptimizerConfig) UnmarshalJSON ¶ added in v0.12.0
func (r *OptimizerConfig) UnmarshalJSON(data []byte) error
type OptimizerConfigParam ¶ added in v0.12.0
type OptimizerConfigParam struct {
// Use the AdamW optimizer.
Adamw AdamwOptimizerConfig `json:"adamw,omitzero"`
// Use the Muon optimizer.
Muon MuonOptimizerConfigParam `json:"muon,omitzero"`
// contains filtered or unexported fields
}
Optimizer configuration
func (OptimizerConfigParam) MarshalJSON ¶ added in v0.12.0
func (r OptimizerConfigParam) MarshalJSON() (data []byte, err error)
func (*OptimizerConfigParam) UnmarshalJSON ¶ added in v0.12.0
func (r *OptimizerConfigParam) UnmarshalJSON(data []byte) error
type PlacementProfile ¶ added in v0.11.0
type PlacementProfile struct {
// Unique placement profile identifier.
ID string `json:"id" api:"required"`
// Human-readable placement profile name.
Name string `json:"name" api:"required"`
// Organization that owns the placement profile.
OrganizationID string `json:"organizationId" api:"required"`
// Preferred deployment regions in descending priority order.
PreferredRegions []string `json:"preferredRegions" api:"required"`
// Project that owns the placement profile.
ProjectID string `json:"projectId" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Name respjson.Field
OrganizationID respjson.Field
PreferredRegions respjson.Field
ProjectID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Reusable ordered region preferences for scheduling a project's deployments.
func (PlacementProfile) RawJSON ¶ added in v0.11.0
func (r PlacementProfile) RawJSON() string
Returns the unmodified JSON received from the API
func (*PlacementProfile) UnmarshalJSON ¶ added in v0.11.0
func (r *PlacementProfile) UnmarshalJSON(data []byte) error
type PolicyVersionSegment ¶ added in v0.12.0
type PolicyVersionSegment struct {
// Index of the first token of this segment within the sampled sequence. Always 0
// for the first segment.
StartToken int64 `json:"start_token" api:"required"`
// Model version under which this segment of tokens was generated
Version int64 `json:"version" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
StartToken respjson.Field
Version respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A (policy version, starting token) span within a sampled sequence. Version 0 is the initial model; each optim_step call increments the version by 1.
func (PolicyVersionSegment) RawJSON ¶ added in v0.12.0
func (r PolicyVersionSegment) RawJSON() string
Returns the unmodified JSON received from the API
func (PolicyVersionSegment) ToParam ¶ added in v0.12.0
func (r PolicyVersionSegment) ToParam() PolicyVersionSegmentParam
ToParam converts this PolicyVersionSegment to a PolicyVersionSegmentParam.
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 PolicyVersionSegmentParam.Overrides()
func (*PolicyVersionSegment) UnmarshalJSON ¶ added in v0.12.0
func (r *PolicyVersionSegment) UnmarshalJSON(data []byte) error
type PolicyVersionSegmentParam ¶ added in v0.12.0
type PolicyVersionSegmentParam struct {
// Index of the first token of this segment within the sampled sequence. Always 0
// for the first segment.
StartToken int64 `json:"start_token" api:"required"`
// Model version under which this segment of tokens was generated
Version int64 `json:"version" api:"required"`
// contains filtered or unexported fields
}
A (policy version, starting token) span within a sampled sequence. Version 0 is the initial model; each optim_step call increments the version by 1.
The properties StartToken, Version are required.
func (PolicyVersionSegmentParam) MarshalJSON ¶ added in v0.12.0
func (r PolicyVersionSegmentParam) MarshalJSON() (data []byte, err error)
func (*PolicyVersionSegmentParam) UnmarshalJSON ¶ added in v0.12.0
func (r *PolicyVersionSegmentParam) UnmarshalJSON(data []byte) error
type PpoLossInputsParam ¶ added in v0.12.0
type PpoLossInputsParam struct {
// Per-token advantages for PPO
Advantages LossAdvantagesParam `json:"advantages,omitzero" api:"required"`
// Generator log probabilities for PPO
GeneratorLogprobs LossLogprobsParam `json:"generator_logprobs,omitzero" api:"required"`
// contains filtered or unexported fields
}
The properties Advantages, GeneratorLogprobs are required.
func (PpoLossInputsParam) MarshalJSON ¶ added in v0.12.0
func (r PpoLossInputsParam) MarshalJSON() (data []byte, err error)
func (*PpoLossInputsParam) UnmarshalJSON ¶ added in v0.12.0
func (r *PpoLossInputsParam) UnmarshalJSON(data []byte) error
type PpoLossParams ¶ added in v0.12.0
type PpoLossParams struct {
// Upper absolute bound for the importance ratio in the clipped surrogate. Must
// be >= 1.
ClipHighThreshold param.Opt[float64] `json:"clip_high_threshold,omitzero"`
// Lower absolute bound for the importance ratio in the clipped surrogate. Must be
// <= 1.
ClipLowThreshold param.Opt[float64] `json:"clip_low_threshold,omitzero"`
// contains filtered or unexported fields
}
func (PpoLossParams) MarshalJSON ¶ added in v0.12.0
func (r PpoLossParams) MarshalJSON() (data []byte, err error)
func (*PpoLossParams) UnmarshalJSON ¶ added in v0.12.0
func (r *PpoLossParams) 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.
// - `REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT`: Evicts the VM without
// provisioning a replacement.
// - `REMEDIATION_MODE_REBOOT_VM`: Reboots the VM in place.
// - `REMEDIATION_MODE_HOST_POWER_CYCLE`: Cordons and power-cycles the bare-metal
// host while preserving host and node identity.
//
// Any of "REMEDIATION_MODE_VM_ONLY", "REMEDIATION_MODE_HOST_AWARE",
// "REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT", "REMEDIATION_MODE_REBOOT_VM",
// "REMEDIATION_MODE_HOST_POWER_CYCLE".
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.
// - `QUARANTINING`: Cordoning or preparing the host before remediation.
// - `QUARANTINED`: Host has been cordoned or isolated for remediation.
//
// Any of "PENDING_APPROVAL", "PENDING", "RUNNING", "SUCCEEDED", "FAILED",
// "CANCELLED", "AUTO_RESOLVED", "QUARANTINING", "QUARANTINED".
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 alerts linked to this remediation, including resolved
// alerts.
LinkedAlerts []RemediationLinkedAlert `json:"linked_alerts"`
// 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
LinkedAlerts 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 RemediationLinkedAlert ¶ added in v0.11.0
type RemediationLinkedAlert struct {
// Alertmanager alert name.
AlertName string `json:"alert_name" api:"required"`
// Alertmanager annotations as key-value strings.
Annotations map[string]string `json:"annotations" api:"required"`
// Cluster UUID the alert was raised against.
ClusterID string `json:"cluster_id" api:"required"`
// Primary key UUID for the passive health check alert.
PassiveHealthCheckAlertID string `json:"passive_health_check_alert_id" api:"required"`
// Canonical severity tier for the alert.
//
// Any of "PHC_SEVERITY_INFO", "PHC_SEVERITY_WARNING", "PHC_SEVERITY_CRITICAL".
Severity string `json:"severity" api:"required"`
// Time when the underlying alert first fired.
StartedAt time.Time `json:"started_at" api:"required" format:"date-time"`
// VM name extracted from the Alertmanager labels.
TargetVm string `json:"target_vm" api:"required"`
// Resolved instance UUID. Empty until the alert is joined to an instance.
InstanceID string `json:"instance_id"`
// Remediation intent UUID attached to this alert, if any.
NodeRemediationIntentID string `json:"node_remediation_intent_id"`
// Time when the underlying alert resolved. Empty while the alert is firing.
ResolvedAt time.Time `json:"resolved_at" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AlertName respjson.Field
Annotations respjson.Field
ClusterID respjson.Field
PassiveHealthCheckAlertID respjson.Field
Severity respjson.Field
StartedAt respjson.Field
TargetVm respjson.Field
InstanceID respjson.Field
NodeRemediationIntentID respjson.Field
ResolvedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Passive health check alert returned by the health check API.
func (RemediationLinkedAlert) RawJSON ¶ added in v0.11.0
func (r RemediationLinkedAlert) RawJSON() string
Returns the unmodified JSON received from the API
func (*RemediationLinkedAlert) UnmarshalJSON ¶ added in v0.11.0
func (r *RemediationLinkedAlert) UnmarshalJSON(data []byte) error
type RemediationLinkedAlertParam ¶ added in v0.11.0
type RemediationLinkedAlertParam struct {
// contains filtered or unexported fields
}
Passive health check alert returned by the health check API.
The properties AlertName, Annotations, ClusterID, PassiveHealthCheckAlertID, Severity, StartedAt, TargetVm are required.
func (RemediationLinkedAlertParam) MarshalJSON ¶ added in v0.11.0
func (r RemediationLinkedAlertParam) MarshalJSON() (data []byte, err error)
func (*RemediationLinkedAlertParam) UnmarshalJSON ¶ added in v0.11.0
func (r *RemediationLinkedAlertParam) 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.
- `REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT`: Evicts the VM without provisioning a replacement.
- `REMEDIATION_MODE_REBOOT_VM`: Reboots the VM in place.
- `REMEDIATION_MODE_HOST_POWER_CYCLE`: Cordons and power-cycles the bare-metal host while preserving host and node identity.
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" RemediationModeRemediationModeHostPowerCycle RemediationMode = "REMEDIATION_MODE_HOST_POWER_CYCLE" )
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.
// - `REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT`: Evicts the VM without
// provisioning a replacement.
// - `REMEDIATION_MODE_REBOOT_VM`: Reboots the VM in place.
// - `REMEDIATION_MODE_HOST_POWER_CYCLE`: Cordons and power-cycles the bare-metal
// host while preserving host and node identity.
//
// Any of "REMEDIATION_MODE_VM_ONLY", "REMEDIATION_MODE_HOST_AWARE",
// "REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT", "REMEDIATION_MODE_REBOOT_VM",
// "REMEDIATION_MODE_HOST_POWER_CYCLE".
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.
- `QUARANTINING`: Cordoning or preparing the host before remediation.
- `QUARANTINED`: Host has been cordoned or isolated for remediation.
const ( RemediationStatePendingApproval RemediationState = "PENDING_APPROVAL" RemediationStatePending RemediationState = "PENDING" RemediationStateRunning RemediationState = "RUNNING" RemediationStateSucceeded RemediationState = "SUCCEEDED" RemediationStateFailed RemediationState = "FAILED" RemediationStateCancelled RemediationState = "CANCELLED" RemediationStateAutoResolved RemediationState = "AUTO_RESOLVED" RemediationStateQuarantining RemediationState = "QUARANTINING" RemediationStateQuarantined RemediationState = "QUARANTINED" )
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 ¶
func (r RerankNewResponseResultDocument) RawJSON() string
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 ¶
func (r *RerankService) New(ctx context.Context, body RerankNewParams, opts ...option.RequestOption) (res *RerankNewResponse, err error)
Rerank a list of documents by relevance to a query. Returns a relevance score and ordering index for each document.
type RlSupportedModel ¶ added in v0.12.0
type RlSupportedModel struct {
// Base model identifier to pass as base_model when creating a model resource
BaseModel string `json:"base_model" api:"required"`
// Inference config. Set when the model can be provisioned with generator replicas.
GeneratorConfig RlSupportedModelGeneratorConfig `json:"generator_config"`
// Training config. Set when the model supports at least one training mode.
TrainerConfig RlSupportedModelTrainerConfig `json:"trainer_config"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
BaseModel respjson.Field
GeneratorConfig respjson.Field
TrainerConfig respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A base model supported by the RL service. Per-mode configs are present only when the model supports that mode.
func (RlSupportedModel) RawJSON ¶ added in v0.12.0
func (r RlSupportedModel) RawJSON() string
Returns the unmodified JSON received from the API
func (*RlSupportedModel) UnmarshalJSON ¶ added in v0.12.0
func (r *RlSupportedModel) UnmarshalJSON(data []byte) error
type RlSupportedModelGeneratorConfig ¶ added in v0.12.0
type RlSupportedModelGeneratorConfig struct {
// Maximum tokens in a single inference request (prompt + completion)
ContextLength int64 `json:"context_length" api:"required"`
// Default sampling parameters used for sample requests.
SamplingDefaults RlSupportedModelGeneratorConfigSamplingDefaults `json:"sampling_defaults" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ContextLength respjson.Field
SamplingDefaults respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Inference config. Set when the model can be provisioned with generator replicas.
func (RlSupportedModelGeneratorConfig) RawJSON ¶ added in v0.12.0
func (r RlSupportedModelGeneratorConfig) RawJSON() string
Returns the unmodified JSON received from the API
func (*RlSupportedModelGeneratorConfig) UnmarshalJSON ¶ added in v0.12.0
func (r *RlSupportedModelGeneratorConfig) UnmarshalJSON(data []byte) error
type RlSupportedModelGeneratorConfigSamplingDefaults ¶ added in v0.12.0
type RlSupportedModelGeneratorConfigSamplingDefaults struct {
// Number of logprobs to return per token
Logprobs int64 `json:"logprobs" api:"required"`
// Maximum tokens generated per completion
MaxTokens int64 `json:"max_tokens" api:"required"`
// Number of completions per prompt
N int64 `json:"n" api:"required"`
// Sampling temperature
Temperature float64 `json:"temperature" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Logprobs respjson.Field
MaxTokens respjson.Field
N respjson.Field
Temperature respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Default sampling parameters used for sample requests.
func (RlSupportedModelGeneratorConfigSamplingDefaults) RawJSON ¶ added in v0.12.0
func (r RlSupportedModelGeneratorConfigSamplingDefaults) RawJSON() string
Returns the unmodified JSON received from the API
func (*RlSupportedModelGeneratorConfigSamplingDefaults) UnmarshalJSON ¶ added in v0.12.0
func (r *RlSupportedModelGeneratorConfigSamplingDefaults) UnmarshalJSON(data []byte) error
type RlSupportedModelTrainerConfig ¶ added in v0.12.0
type RlSupportedModelTrainerConfig struct {
// Full-weight training config. Set when the model supports full-weight training.
Full RlSupportedModelTrainerConfigFull `json:"full"`
// LoRA training config. Set when the model supports LoRA training.
Lora RlSupportedModelTrainerConfigLora `json:"lora"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Full respjson.Field
Lora respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Training config. Set when the model supports at least one training mode.
func (RlSupportedModelTrainerConfig) RawJSON ¶ added in v0.12.0
func (r RlSupportedModelTrainerConfig) RawJSON() string
Returns the unmodified JSON received from the API
func (*RlSupportedModelTrainerConfig) UnmarshalJSON ¶ added in v0.12.0
func (r *RlSupportedModelTrainerConfig) UnmarshalJSON(data []byte) error
type RlSupportedModelTrainerConfigFull ¶ added in v0.12.0
type RlSupportedModelTrainerConfigFull struct {
// Maximum global batch size accepted by a forward-backward step
MaxBatchSize int64 `json:"max_batch_size" api:"required"`
// Maximum sequence length in tokens
MaxSeqLength int64 `json:"max_seq_length" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
MaxBatchSize respjson.Field
MaxSeqLength respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Full-weight training config. Set when the model supports full-weight training.
func (RlSupportedModelTrainerConfigFull) RawJSON ¶ added in v0.12.0
func (r RlSupportedModelTrainerConfigFull) RawJSON() string
Returns the unmodified JSON received from the API
func (*RlSupportedModelTrainerConfigFull) UnmarshalJSON ¶ added in v0.12.0
func (r *RlSupportedModelTrainerConfigFull) UnmarshalJSON(data []byte) error
type RlSupportedModelTrainerConfigLora ¶ added in v0.12.0
type RlSupportedModelTrainerConfigLora struct {
// Maximum global batch size accepted by a forward-backward step
MaxBatchSize int64 `json:"max_batch_size" api:"required"`
// Maximum LoRA rank
MaxRank int64 `json:"max_rank" api:"required"`
// Maximum sequence length in tokens
MaxSeqLength int64 `json:"max_seq_length" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
MaxBatchSize respjson.Field
MaxRank respjson.Field
MaxSeqLength respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
LoRA training config. Set when the model supports LoRA training.
func (RlSupportedModelTrainerConfigLora) RawJSON ¶ added in v0.12.0
func (r RlSupportedModelTrainerConfigLora) RawJSON() string
Returns the unmodified JSON received from the API
func (*RlSupportedModelTrainerConfigLora) UnmarshalJSON ¶ added in v0.12.0
func (r *RlSupportedModelTrainerConfigLora) UnmarshalJSON(data []byte) error
type RlSupportedModels ¶ added in v0.12.0
type RlSupportedModels struct {
// Supported base models for RL
Data []RlSupportedModel `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:"-"`
}
List of base models supported by the RL service
func (RlSupportedModels) RawJSON ¶ added in v0.12.0
func (r RlSupportedModels) RawJSON() string
Returns the unmodified JSON received from the API
func (*RlSupportedModels) UnmarshalJSON ¶ added in v0.12.0
func (r *RlSupportedModels) UnmarshalJSON(data []byte) error
type SampleOperation ¶ added in v0.12.0
type SampleOperation struct {
// Operation ID
ID string `json:"id" api:"required"`
// Operation status
//
// Any of "TRAINING_OPERATION_STATUS_UNSPECIFIED",
// "TRAINING_OPERATION_STATUS_PENDING", "TRAINING_OPERATION_STATUS_RUNNING",
// "TRAINING_OPERATION_STATUS_COMPLETED", "TRAINING_OPERATION_STATUS_FAILED".
Status TrainingOperationStatus `json:"status" api:"required"`
// Error details on failure
Error TrainingOperationError `json:"error"`
// Result on success
Output SampleOperationOutput `json:"output"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Status respjson.Field
Error respjson.Field
Output respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Async sample operation
func (SampleOperation) RawJSON ¶ added in v0.12.0
func (r SampleOperation) RawJSON() string
Returns the unmodified JSON received from the API
func (*SampleOperation) UnmarshalJSON ¶ added in v0.12.0
func (r *SampleOperation) UnmarshalJSON(data []byte) error
type SampleOperationOutput ¶ added in v0.12.0
type SampleOperationOutput struct {
// One result per model input
Results []SampleResult `json:"results" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Results respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Result on success
func (SampleOperationOutput) RawJSON ¶ added in v0.12.0
func (r SampleOperationOutput) RawJSON() string
Returns the unmodified JSON received from the API
func (*SampleOperationOutput) UnmarshalJSON ¶ added in v0.12.0
func (r *SampleOperationOutput) UnmarshalJSON(data []byte) error
type SampleResult ¶ added in v0.12.0
type SampleResult struct {
// Policy versions that produced these completions
PolicySegments []PolicyVersionSegment `json:"policy_segments" api:"required"`
// Generated completions
Sequences []SampledSequence `json:"sequences" api:"required"`
// Teacher-forced log-probabilities for the model input tokens, one per token after
// the first (log P(token*i | token*<i)). Present only when return_prompt_logprobs
// was set on the request.
PromptLogprobs []float64 `json:"prompt_logprobs"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
PolicySegments respjson.Field
Sequences respjson.Field
PromptLogprobs respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Completions generated for a single model input
func (SampleResult) RawJSON ¶ added in v0.12.0
func (r SampleResult) RawJSON() string
Returns the unmodified JSON received from the API
func (*SampleResult) UnmarshalJSON ¶ added in v0.12.0
func (r *SampleResult) UnmarshalJSON(data []byte) error
type SampledSequence ¶ added in v0.12.0
type SampledSequence struct {
// Reason for stopping generation
//
// Any of "STOP_REASON_LENGTH", "STOP_REASON_STOP".
StopReason StopReason `json:"stop_reason" api:"required"`
// Generated token IDs
Tokens []SampledSequenceTokenUnion `json:"tokens" api:"required"`
// Log probabilities for each generated token
Logprobs []float64 `json:"logprobs"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
StopReason respjson.Field
Tokens respjson.Field
Logprobs respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A single generated completion sequence with tokens and logprobs
func (SampledSequence) RawJSON ¶ added in v0.12.0
func (r SampledSequence) RawJSON() string
Returns the unmodified JSON received from the API
func (*SampledSequence) UnmarshalJSON ¶ added in v0.12.0
func (r *SampledSequence) UnmarshalJSON(data []byte) error
type SampledSequenceTokenUnion ¶ added in v0.12.0
type SampledSequenceTokenUnion 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 [int64] instead of an object.
OfInt int64 `json:",inline"`
JSON struct {
OfString respjson.Field
OfInt respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
SampledSequenceTokenUnion contains all possible properties and values from [string], [int64].
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 OfInt]
func (SampledSequenceTokenUnion) AsInt ¶ added in v0.12.0
func (u SampledSequenceTokenUnion) AsInt() (v int64)
func (SampledSequenceTokenUnion) AsString ¶ added in v0.12.0
func (u SampledSequenceTokenUnion) AsString() (v string)
func (SampledSequenceTokenUnion) RawJSON ¶ added in v0.12.0
func (u SampledSequenceTokenUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*SampledSequenceTokenUnion) UnmarshalJSON ¶ added in v0.12.0
func (r *SampledSequenceTokenUnion) UnmarshalJSON(data []byte) error
type SamplingParams ¶ added in v0.12.0
type SamplingParams struct {
// Maximum number of tokens to generate per completion
MaxTokens param.Opt[int64] `json:"max_tokens,omitzero"`
// When true, also return teacher-forced log-probabilities for the model input
// tokens in `SampleResult.prompt_logprobs`.
ReturnPromptLogprobs param.Opt[bool] `json:"return_prompt_logprobs,omitzero"`
// Sampling temperature
Temperature param.Opt[float64] `json:"temperature,omitzero"`
// Top-k sampling limit
TopK param.Opt[int64] `json:"top_k,omitzero"`
// Nucleus sampling probability threshold
TopP param.Opt[float64] `json:"top_p,omitzero"`
// Random seed for reproducibility
Seed SamplingParamsSeedUnion `json:"seed,omitzero"`
// Generation stops when any of these strings is produced
Stop []string `json:"stop,omitzero"`
// contains filtered or unexported fields
}
func (SamplingParams) MarshalJSON ¶ added in v0.12.0
func (r SamplingParams) MarshalJSON() (data []byte, err error)
func (*SamplingParams) UnmarshalJSON ¶ added in v0.12.0
func (r *SamplingParams) UnmarshalJSON(data []byte) error
type SamplingParamsSeedUnion ¶ added in v0.12.0
type SamplingParamsSeedUnion struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfInt param.Opt[int64] `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 (SamplingParamsSeedUnion) MarshalJSON ¶ added in v0.12.0
func (u SamplingParamsSeedUnion) MarshalJSON() ([]byte, error)
func (*SamplingParamsSeedUnion) UnmarshalJSON ¶ added in v0.12.0
func (u *SamplingParamsSeedUnion) UnmarshalJSON(data []byte) error
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) UnmarshalJSON ¶ added in v0.6.0
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 ¶
func (r SessionListResponseDataSession) RawJSON() string
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 ¶
func (u SessionListResponseErrorUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*SessionListResponseErrorUnion) UnmarshalJSON ¶
func (r *SessionListResponseErrorUnion) UnmarshalJSON(data []byte) error
type ShadowAdaptiveKeyBasedSamplingParam ¶ added in v0.11.0
type ShadowAdaptiveKeyBasedSamplingParam struct {
// Required request-body field used as the sticky sampling key.
Key string `json:"key" api:"required"`
// Required per-gateway-replica target QPS for adaptive sampling.
TargetQps float64 `json:"targetQps" api:"required"`
// Optional sliding window for QPS observation. Defaults to 60s and must not be
// negative.
Window param.Opt[string] `json:"window,omitzero"`
// contains filtered or unexported fields
}
Adaptive sticky-key sampling that throttles toward a target QPS.
The properties Key, TargetQps are required.
func (ShadowAdaptiveKeyBasedSamplingParam) MarshalJSON ¶ added in v0.11.0
func (r ShadowAdaptiveKeyBasedSamplingParam) MarshalJSON() (data []byte, err error)
func (*ShadowAdaptiveKeyBasedSamplingParam) UnmarshalJSON ¶ added in v0.11.0
func (r *ShadowAdaptiveKeyBasedSamplingParam) UnmarshalJSON(data []byte) error
type ShadowAdaptiveUniformSamplingParam ¶ added in v0.11.0
type ShadowAdaptiveUniformSamplingParam struct {
// Required per-gateway-replica target QPS for adaptive sampling.
TargetQps float64 `json:"targetQps" api:"required"`
// Optional sliding window for QPS observation. Defaults to 60s and must not be
// negative.
Window param.Opt[string] `json:"window,omitzero"`
// contains filtered or unexported fields
}
Adaptive random sampling that throttles toward a target QPS.
The property TargetQps is required.
func (ShadowAdaptiveUniformSamplingParam) MarshalJSON ¶ added in v0.11.0
func (r ShadowAdaptiveUniformSamplingParam) MarshalJSON() (data []byte, err error)
func (*ShadowAdaptiveUniformSamplingParam) UnmarshalJSON ¶ added in v0.11.0
func (r *ShadowAdaptiveUniformSamplingParam) UnmarshalJSON(data []byte) error
type ShadowEndpointSourceParam ¶ added in v0.11.0
type ShadowEndpointSourceParam struct {
// Sampling strategy for endpoint-level shadow traffic. Exactly one strategy must
// be set.
Sampling ShadowEndpointSourceSamplingUnionParam `json:"sampling,omitzero" api:"required"`
// contains filtered or unexported fields
}
Endpoint-level source that samples endpoint traffic at the API gateway.
The property Sampling is required.
func (ShadowEndpointSourceParam) MarshalJSON ¶ added in v0.11.0
func (r ShadowEndpointSourceParam) MarshalJSON() (data []byte, err error)
func (*ShadowEndpointSourceParam) UnmarshalJSON ¶ added in v0.11.0
func (r *ShadowEndpointSourceParam) UnmarshalJSON(data []byte) error
type ShadowEndpointSourceSamplingAdaptiveKeyBasedParam ¶ added in v0.11.0
type ShadowEndpointSourceSamplingAdaptiveKeyBasedParam struct {
// Adaptive sticky-key sampling that throttles toward a target QPS.
AdaptiveKeyBased ShadowAdaptiveKeyBasedSamplingParam `json:"adaptiveKeyBased,omitzero" api:"required"`
// contains filtered or unexported fields
}
The property AdaptiveKeyBased is required.
func (ShadowEndpointSourceSamplingAdaptiveKeyBasedParam) MarshalJSON ¶ added in v0.11.0
func (r ShadowEndpointSourceSamplingAdaptiveKeyBasedParam) MarshalJSON() (data []byte, err error)
func (*ShadowEndpointSourceSamplingAdaptiveKeyBasedParam) UnmarshalJSON ¶ added in v0.11.0
func (r *ShadowEndpointSourceSamplingAdaptiveKeyBasedParam) UnmarshalJSON(data []byte) error
type ShadowEndpointSourceSamplingAdaptiveUniformParam ¶ added in v0.11.0
type ShadowEndpointSourceSamplingAdaptiveUniformParam struct {
// Adaptive random sampling that throttles toward a target QPS.
AdaptiveUniform ShadowAdaptiveUniformSamplingParam `json:"adaptiveUniform,omitzero" api:"required"`
// contains filtered or unexported fields
}
The property AdaptiveUniform is required.
func (ShadowEndpointSourceSamplingAdaptiveUniformParam) MarshalJSON ¶ added in v0.11.0
func (r ShadowEndpointSourceSamplingAdaptiveUniformParam) MarshalJSON() (data []byte, err error)
func (*ShadowEndpointSourceSamplingAdaptiveUniformParam) UnmarshalJSON ¶ added in v0.11.0
func (r *ShadowEndpointSourceSamplingAdaptiveUniformParam) UnmarshalJSON(data []byte) error
type ShadowEndpointSourceSamplingKeyBasedParam ¶ added in v0.11.0
type ShadowEndpointSourceSamplingKeyBasedParam struct {
// Fixed-rate sampling of distinct key values with sticky decisions.
KeyBased ShadowKeyBasedSamplingParam `json:"keyBased,omitzero" api:"required"`
// contains filtered or unexported fields
}
The property KeyBased is required.
func (ShadowEndpointSourceSamplingKeyBasedParam) MarshalJSON ¶ added in v0.11.0
func (r ShadowEndpointSourceSamplingKeyBasedParam) MarshalJSON() (data []byte, err error)
func (*ShadowEndpointSourceSamplingKeyBasedParam) UnmarshalJSON ¶ added in v0.11.0
func (r *ShadowEndpointSourceSamplingKeyBasedParam) UnmarshalJSON(data []byte) error
type ShadowEndpointSourceSamplingUniformParam ¶ added in v0.11.0
type ShadowEndpointSourceSamplingUniformParam struct {
// Fixed-rate random sampling of endpoint requests.
Uniform ShadowUniformSamplingParam `json:"uniform,omitzero" api:"required"`
// contains filtered or unexported fields
}
The property Uniform is required.
func (ShadowEndpointSourceSamplingUniformParam) MarshalJSON ¶ added in v0.11.0
func (r ShadowEndpointSourceSamplingUniformParam) MarshalJSON() (data []byte, err error)
func (*ShadowEndpointSourceSamplingUniformParam) UnmarshalJSON ¶ added in v0.11.0
func (r *ShadowEndpointSourceSamplingUniformParam) UnmarshalJSON(data []byte) error
type ShadowEndpointSourceSamplingUnionParam ¶ added in v0.11.0
type ShadowEndpointSourceSamplingUnionParam struct {
OfUniform *ShadowEndpointSourceSamplingUniformParam `json:",omitzero,inline"`
OfKeyBased *ShadowEndpointSourceSamplingKeyBasedParam `json:",omitzero,inline"`
OfAdaptiveUniform *ShadowEndpointSourceSamplingAdaptiveUniformParam `json:",omitzero,inline"`
OfAdaptiveKeyBased *ShadowEndpointSourceSamplingAdaptiveKeyBasedParam `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 (ShadowEndpointSourceSamplingUnionParam) MarshalJSON ¶ added in v0.11.0
func (u ShadowEndpointSourceSamplingUnionParam) MarshalJSON() ([]byte, error)
func (*ShadowEndpointSourceSamplingUnionParam) UnmarshalJSON ¶ added in v0.11.0
func (u *ShadowEndpointSourceSamplingUnionParam) UnmarshalJSON(data []byte) error
type ShadowExperiment ¶ added in v0.11.0
type ShadowExperiment struct {
// Output only. Unique shadow experiment identifier.
ID string `json:"id" api:"required"`
// Timestamp when the experiment was created.
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
// Identifier of the principal that created the experiment.
CreatedBy string `json:"createdBy" api:"required"`
// Output only. Endpoint whose traffic this experiment samples.
EndpointID string `json:"endpointId" api:"required"`
// Opaque version tag for optimistic concurrency control. Returned on read; set it
// on update or delete requests for consistent read-modify-write.
Etag string `json:"etag" api:"required"`
// Human-readable shadow experiment name, unique within the endpoint. At most 256
// characters.
Name string `json:"name" api:"required"`
// Output only. Project that owns the parent endpoint.
ProjectID string `json:"projectId" api:"required"`
// Endpoint traffic source returned for a shadow experiment.
Source ShadowExperimentSource `json:"source" api:"required"`
// Derived serving state, active when the experiment has at least one target.
//
// Any of "SHADOW_EXPERIMENT_STATE_ACTIVE", "SHADOW_EXPERIMENT_STATE_INACTIVE".
State ShadowExperimentState `json:"state" api:"required"`
// Target deployments that receive mirrored traffic.
Targets []ShadowExperimentTarget `json:"targets" api:"required"`
// Timestamp when the experiment was last updated.
UpdatedAt time.Time `json:"updatedAt" api:"required" format:"date-time"`
// User defined description.
Description string `json:"description"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
CreatedBy respjson.Field
EndpointID respjson.Field
Etag respjson.Field
Name respjson.Field
ProjectID respjson.Field
Source respjson.Field
State respjson.Field
Targets respjson.Field
UpdatedAt respjson.Field
Description respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Experiment that mirrors sampled endpoint requests to target deployments without changing client responses.
func (ShadowExperiment) RawJSON ¶ added in v0.11.0
func (r ShadowExperiment) RawJSON() string
Returns the unmodified JSON received from the API
func (*ShadowExperiment) UnmarshalJSON ¶ added in v0.11.0
func (r *ShadowExperiment) UnmarshalJSON(data []byte) error
type ShadowExperimentSource ¶ added in v0.11.0
type ShadowExperimentSource struct {
// Endpoint-level source returned for a shadow experiment.
Endpoint ShadowExperimentSourceEndpoint `json:"endpoint" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Endpoint respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Endpoint traffic source returned for a shadow experiment.
func (ShadowExperimentSource) RawJSON ¶ added in v0.11.0
func (r ShadowExperimentSource) RawJSON() string
Returns the unmodified JSON received from the API
func (*ShadowExperimentSource) UnmarshalJSON ¶ added in v0.11.0
func (r *ShadowExperimentSource) UnmarshalJSON(data []byte) error
type ShadowExperimentSourceEndpoint ¶ added in v0.11.0
type ShadowExperimentSourceEndpoint struct {
// Sampling strategy returned for endpoint-level shadow traffic.
Sampling ShadowExperimentSourceEndpointSamplingUnion `json:"sampling" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Sampling respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Endpoint-level source returned for a shadow experiment.
func (ShadowExperimentSourceEndpoint) RawJSON ¶ added in v0.11.0
func (r ShadowExperimentSourceEndpoint) RawJSON() string
Returns the unmodified JSON received from the API
func (*ShadowExperimentSourceEndpoint) UnmarshalJSON ¶ added in v0.11.0
func (r *ShadowExperimentSourceEndpoint) UnmarshalJSON(data []byte) error
type ShadowExperimentSourceEndpointSamplingAdaptiveKeyBased ¶ added in v0.11.0
type ShadowExperimentSourceEndpointSamplingAdaptiveKeyBased struct {
// Adaptive sticky-key sampling returned by the API.
AdaptiveKeyBased ShadowExperimentSourceEndpointSamplingAdaptiveKeyBasedAdaptiveKeyBased `json:"adaptiveKeyBased" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AdaptiveKeyBased respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ShadowExperimentSourceEndpointSamplingAdaptiveKeyBased) RawJSON ¶ added in v0.11.0
func (r ShadowExperimentSourceEndpointSamplingAdaptiveKeyBased) RawJSON() string
Returns the unmodified JSON received from the API
func (*ShadowExperimentSourceEndpointSamplingAdaptiveKeyBased) UnmarshalJSON ¶ added in v0.11.0
func (r *ShadowExperimentSourceEndpointSamplingAdaptiveKeyBased) UnmarshalJSON(data []byte) error
type ShadowExperimentSourceEndpointSamplingAdaptiveKeyBasedAdaptiveKeyBased ¶ added in v0.11.0
type ShadowExperimentSourceEndpointSamplingAdaptiveKeyBasedAdaptiveKeyBased struct {
// Request-body field used as the sticky sampling key.
Key string `json:"key" api:"required"`
// Per-gateway-replica target QPS.
TargetQps float64 `json:"targetQps" api:"required"`
// Sliding window for QPS observation when explicitly configured.
Window string `json:"window"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Key respjson.Field
TargetQps respjson.Field
Window respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Adaptive sticky-key sampling returned by the API.
func (ShadowExperimentSourceEndpointSamplingAdaptiveKeyBasedAdaptiveKeyBased) RawJSON ¶ added in v0.11.0
func (r ShadowExperimentSourceEndpointSamplingAdaptiveKeyBasedAdaptiveKeyBased) RawJSON() string
Returns the unmodified JSON received from the API
func (*ShadowExperimentSourceEndpointSamplingAdaptiveKeyBasedAdaptiveKeyBased) UnmarshalJSON ¶ added in v0.11.0
func (r *ShadowExperimentSourceEndpointSamplingAdaptiveKeyBasedAdaptiveKeyBased) UnmarshalJSON(data []byte) error
type ShadowExperimentSourceEndpointSamplingAdaptiveUniform ¶ added in v0.11.0
type ShadowExperimentSourceEndpointSamplingAdaptiveUniform struct {
// Adaptive random sampling returned by the API.
AdaptiveUniform ShadowExperimentSourceEndpointSamplingAdaptiveUniformAdaptiveUniform `json:"adaptiveUniform" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AdaptiveUniform respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ShadowExperimentSourceEndpointSamplingAdaptiveUniform) RawJSON ¶ added in v0.11.0
func (r ShadowExperimentSourceEndpointSamplingAdaptiveUniform) RawJSON() string
Returns the unmodified JSON received from the API
func (*ShadowExperimentSourceEndpointSamplingAdaptiveUniform) UnmarshalJSON ¶ added in v0.11.0
func (r *ShadowExperimentSourceEndpointSamplingAdaptiveUniform) UnmarshalJSON(data []byte) error
type ShadowExperimentSourceEndpointSamplingAdaptiveUniformAdaptiveUniform ¶ added in v0.11.0
type ShadowExperimentSourceEndpointSamplingAdaptiveUniformAdaptiveUniform struct {
// Per-gateway-replica target QPS.
TargetQps float64 `json:"targetQps" api:"required"`
// Sliding window for QPS observation when explicitly configured.
Window string `json:"window"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
TargetQps respjson.Field
Window respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Adaptive random sampling returned by the API.
func (ShadowExperimentSourceEndpointSamplingAdaptiveUniformAdaptiveUniform) RawJSON ¶ added in v0.11.0
func (r ShadowExperimentSourceEndpointSamplingAdaptiveUniformAdaptiveUniform) RawJSON() string
Returns the unmodified JSON received from the API
func (*ShadowExperimentSourceEndpointSamplingAdaptiveUniformAdaptiveUniform) UnmarshalJSON ¶ added in v0.11.0
func (r *ShadowExperimentSourceEndpointSamplingAdaptiveUniformAdaptiveUniform) UnmarshalJSON(data []byte) error
type ShadowExperimentSourceEndpointSamplingKeyBased ¶ added in v0.11.0
type ShadowExperimentSourceEndpointSamplingKeyBased struct {
// Fixed-rate sticky-key sampling returned by the API. A zero rate may be omitted
// by JSON serialization.
KeyBased ShadowExperimentSourceEndpointSamplingKeyBasedKeyBased `json:"keyBased" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
KeyBased respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ShadowExperimentSourceEndpointSamplingKeyBased) RawJSON ¶ added in v0.11.0
func (r ShadowExperimentSourceEndpointSamplingKeyBased) RawJSON() string
Returns the unmodified JSON received from the API
func (*ShadowExperimentSourceEndpointSamplingKeyBased) UnmarshalJSON ¶ added in v0.11.0
func (r *ShadowExperimentSourceEndpointSamplingKeyBased) UnmarshalJSON(data []byte) error
type ShadowExperimentSourceEndpointSamplingKeyBasedKeyBased ¶ added in v0.11.0
type ShadowExperimentSourceEndpointSamplingKeyBasedKeyBased struct {
// Request-body field used as the sticky sampling key.
Key string `json:"key" api:"required"`
// Fraction of distinct key values sampled, from 0.0 to 1.0.
Rate float64 `json:"rate"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Key respjson.Field
Rate respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Fixed-rate sticky-key sampling returned by the API. A zero rate may be omitted by JSON serialization.
func (ShadowExperimentSourceEndpointSamplingKeyBasedKeyBased) RawJSON ¶ added in v0.11.0
func (r ShadowExperimentSourceEndpointSamplingKeyBasedKeyBased) RawJSON() string
Returns the unmodified JSON received from the API
func (*ShadowExperimentSourceEndpointSamplingKeyBasedKeyBased) UnmarshalJSON ¶ added in v0.11.0
func (r *ShadowExperimentSourceEndpointSamplingKeyBasedKeyBased) UnmarshalJSON(data []byte) error
type ShadowExperimentSourceEndpointSamplingUniform ¶ added in v0.11.0
type ShadowExperimentSourceEndpointSamplingUniform struct {
// Fixed-rate random sampling returned by the API. A zero rate may be omitted by
// JSON serialization.
Uniform ShadowExperimentSourceEndpointSamplingUniformUniform `json:"uniform" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Uniform respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ShadowExperimentSourceEndpointSamplingUniform) RawJSON ¶ added in v0.11.0
func (r ShadowExperimentSourceEndpointSamplingUniform) RawJSON() string
Returns the unmodified JSON received from the API
func (*ShadowExperimentSourceEndpointSamplingUniform) UnmarshalJSON ¶ added in v0.11.0
func (r *ShadowExperimentSourceEndpointSamplingUniform) UnmarshalJSON(data []byte) error
type ShadowExperimentSourceEndpointSamplingUniformUniform ¶ added in v0.11.0
type ShadowExperimentSourceEndpointSamplingUniformUniform struct {
// Fraction of requests sampled, from 0.0 to 1.0.
Rate float64 `json:"rate"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Rate respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Fixed-rate random sampling returned by the API. A zero rate may be omitted by JSON serialization.
func (ShadowExperimentSourceEndpointSamplingUniformUniform) RawJSON ¶ added in v0.11.0
func (r ShadowExperimentSourceEndpointSamplingUniformUniform) RawJSON() string
Returns the unmodified JSON received from the API
func (*ShadowExperimentSourceEndpointSamplingUniformUniform) UnmarshalJSON ¶ added in v0.11.0
func (r *ShadowExperimentSourceEndpointSamplingUniformUniform) UnmarshalJSON(data []byte) error
type ShadowExperimentSourceEndpointSamplingUnion ¶ added in v0.11.0
type ShadowExperimentSourceEndpointSamplingUnion struct {
// This field is from variant [ShadowExperimentSourceEndpointSamplingUniform].
Uniform ShadowExperimentSourceEndpointSamplingUniformUniform `json:"uniform"`
// This field is from variant [ShadowExperimentSourceEndpointSamplingKeyBased].
KeyBased ShadowExperimentSourceEndpointSamplingKeyBasedKeyBased `json:"keyBased"`
// This field is from variant
// [ShadowExperimentSourceEndpointSamplingAdaptiveUniform].
AdaptiveUniform ShadowExperimentSourceEndpointSamplingAdaptiveUniformAdaptiveUniform `json:"adaptiveUniform"`
// This field is from variant
// [ShadowExperimentSourceEndpointSamplingAdaptiveKeyBased].
AdaptiveKeyBased ShadowExperimentSourceEndpointSamplingAdaptiveKeyBasedAdaptiveKeyBased `json:"adaptiveKeyBased"`
JSON struct {
Uniform respjson.Field
KeyBased respjson.Field
AdaptiveUniform respjson.Field
AdaptiveKeyBased respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ShadowExperimentSourceEndpointSamplingUnion contains all possible properties and values from ShadowExperimentSourceEndpointSamplingUniform, ShadowExperimentSourceEndpointSamplingKeyBased, ShadowExperimentSourceEndpointSamplingAdaptiveUniform, ShadowExperimentSourceEndpointSamplingAdaptiveKeyBased.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (ShadowExperimentSourceEndpointSamplingUnion) AsAdaptiveKeyBased ¶ added in v0.11.0
func (u ShadowExperimentSourceEndpointSamplingUnion) AsAdaptiveKeyBased() (v ShadowExperimentSourceEndpointSamplingAdaptiveKeyBased)
func (ShadowExperimentSourceEndpointSamplingUnion) AsAdaptiveUniform ¶ added in v0.11.0
func (u ShadowExperimentSourceEndpointSamplingUnion) AsAdaptiveUniform() (v ShadowExperimentSourceEndpointSamplingAdaptiveUniform)
func (ShadowExperimentSourceEndpointSamplingUnion) AsKeyBased ¶ added in v0.11.0
func (u ShadowExperimentSourceEndpointSamplingUnion) AsKeyBased() (v ShadowExperimentSourceEndpointSamplingKeyBased)
func (ShadowExperimentSourceEndpointSamplingUnion) AsUniform ¶ added in v0.11.0
func (u ShadowExperimentSourceEndpointSamplingUnion) AsUniform() (v ShadowExperimentSourceEndpointSamplingUniform)
func (ShadowExperimentSourceEndpointSamplingUnion) RawJSON ¶ added in v0.11.0
func (u ShadowExperimentSourceEndpointSamplingUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ShadowExperimentSourceEndpointSamplingUnion) UnmarshalJSON ¶ added in v0.11.0
func (r *ShadowExperimentSourceEndpointSamplingUnion) UnmarshalJSON(data []byte) error
type ShadowExperimentState ¶ added in v0.11.0
type ShadowExperimentState string
Derived serving state, active when the experiment has at least one target.
const ( ShadowExperimentStateShadowExperimentStateActive ShadowExperimentState = "SHADOW_EXPERIMENT_STATE_ACTIVE" ShadowExperimentStateShadowExperimentStateInactive ShadowExperimentState = "SHADOW_EXPERIMENT_STATE_INACTIVE" )
type ShadowExperimentTarget ¶ added in v0.11.0
type ShadowExperimentTarget struct {
// Output only. Unique shadow experiment target identifier.
ID string `json:"id" api:"required"`
// Output only. Timestamp when the target was created.
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
// Opaque version tag for optimistic concurrency control. Returned on read; set it
// on update or delete requests for consistent read-modify-write.
Etag string `json:"etag" api:"required"`
// Output only. Shadow experiment this target belongs to.
ExperimentID string `json:"experimentId" api:"required"`
// Human-readable target name, unique within the shadow experiment. At most 256
// characters.
Name string `json:"name" api:"required"`
// Deployment under the parent endpoint that receives mirrored traffic. Shadow
// targets should be excluded from the endpoint's live traffic split.
TargetDeploymentID string `json:"targetDeploymentId" api:"required"`
// Output only. Timestamp when the target was last updated.
UpdatedAt time.Time `json:"updatedAt" api:"required" format:"date-time"`
// Optional free-form target description.
Description string `json:"description"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
Etag respjson.Field
ExperimentID respjson.Field
Name respjson.Field
TargetDeploymentID respjson.Field
UpdatedAt respjson.Field
Description respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Deployment that receives mirrored traffic for a shadow experiment.
func (ShadowExperimentTarget) RawJSON ¶ added in v0.11.0
func (r ShadowExperimentTarget) RawJSON() string
Returns the unmodified JSON received from the API
func (*ShadowExperimentTarget) UnmarshalJSON ¶ added in v0.11.0
func (r *ShadowExperimentTarget) UnmarshalJSON(data []byte) error
type ShadowKeyBasedSamplingParam ¶ added in v0.11.0
type ShadowKeyBasedSamplingParam struct {
// Required request-body field used as the sticky sampling key.
Key string `json:"key" api:"required"`
// Required fraction of distinct key values to sample, from 0.0 to 1.0.
Rate float64 `json:"rate" api:"required"`
// contains filtered or unexported fields
}
Fixed-rate sampling of distinct key values with sticky decisions.
The properties Key, Rate are required.
func (ShadowKeyBasedSamplingParam) MarshalJSON ¶ added in v0.11.0
func (r ShadowKeyBasedSamplingParam) MarshalJSON() (data []byte, err error)
func (*ShadowKeyBasedSamplingParam) UnmarshalJSON ¶ added in v0.11.0
func (r *ShadowKeyBasedSamplingParam) UnmarshalJSON(data []byte) error
type ShadowSourceParam ¶ added in v0.11.0
type ShadowSourceParam struct {
// Endpoint-level source that samples endpoint traffic at the API gateway.
Endpoint ShadowEndpointSourceParam `json:"endpoint,omitzero" api:"required"`
// contains filtered or unexported fields
}
Traffic source for a shadow experiment. The public API supports endpoint sources only.
The property Endpoint is required.
func (ShadowSourceParam) MarshalJSON ¶ added in v0.11.0
func (r ShadowSourceParam) MarshalJSON() (data []byte, err error)
func (*ShadowSourceParam) UnmarshalJSON ¶ added in v0.11.0
func (r *ShadowSourceParam) UnmarshalJSON(data []byte) error
type ShadowUniformSamplingParam ¶ added in v0.11.0
type ShadowUniformSamplingParam struct {
// Required fraction of requests to sample, from 0.0 to 1.0.
Rate float64 `json:"rate" api:"required"`
// contains filtered or unexported fields
}
Fixed-rate random sampling of endpoint requests.
The property Rate is required.
func (ShadowUniformSamplingParam) MarshalJSON ¶ added in v0.11.0
func (r ShadowUniformSamplingParam) MarshalJSON() (data []byte, err error)
func (*ShadowUniformSamplingParam) UnmarshalJSON ¶ added in v0.11.0
func (r *ShadowUniformSamplingParam) UnmarshalJSON(data []byte) error
type StopReason ¶ added in v0.12.0
type StopReason string
Reason generation stopped.
const ( StopReasonStopReasonLength StopReason = "STOP_REASON_LENGTH" StopReasonStopReasonStop StopReason = "STOP_REASON_STOP" )
type SupportedModel ¶ added in v0.11.0
type SupportedModel struct {
// Unique ID of the deployable Together-hosted base model.
ID string `json:"id" api:"required"`
// Resource name for the base model as `projects/{projectId}/models/{modelId}`;
// empty when unresolved.
BaseModel string `json:"baseModel" api:"required"`
// Bare model ID for the architecture's base model; empty when no base model is
// linked.
BaseModelID string `json:"baseModelId" api:"required"`
// High-level tasks the model supports.
//
// Any of "CAPABILITY_CHAT", "CAPABILITY_EMBEDDING", "CAPABILITY_RERANKING",
// "CAPABILITY_IMAGE_GENERATION", "CAPABILITY_VIDEO_GENERATION".
Capabilities []string `json:"capabilities" api:"required"`
// Timestamp when the catalog entry was created.
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
// Certified deployment profiles available for the model.
DeploymentProfiles []SupportedModelDeploymentProfile `json:"deploymentProfiles" api:"required"`
// Catalog-controlled human-readable model name.
DisplayName string `json:"displayName" api:"required"`
// UI-facing model type badge, such as chat, language, code, image, embedding,
// rerank, moderation, audio, video, or transcribe.
DisplayType string `json:"displayType" api:"required"`
// Input modalities supported by the model.
//
// Any of "MODALITY_TEXT", "MODALITY_IMAGE", "MODALITY_AUDIO", "MODALITY_VIDEO".
InputModalities []string `json:"inputModalities" api:"required"`
// Catalog-controlled HF model ID used for inference.
Name string `json:"name" api:"required"`
// Output modalities produced by the model.
//
// Any of "MODALITY_TEXT", "MODALITY_IMAGE", "MODALITY_AUDIO", "MODALITY_VIDEO".
OutputModalities []string `json:"outputModalities" api:"required"`
// Product surfaces where the model is offered.
//
// Any of "PRODUCT_SERVERLESS", "PRODUCT_DEDICATED", "PRODUCT_FINE_TUNING".
Products []string `json:"products" api:"required"`
// Organization or publisher associated with the model.
Publisher string `json:"publisher" api:"required"`
// Catalog recommendation status for the model.
//
// Any of "SUPPORTED_MODEL_STATUS_RECOMMENDED", "SUPPORTED_MODEL_STATUS_SUPPORTED",
// "SUPPORTED_MODEL_STATUS_DEPRECATED", "SUPPORTED_MODEL_STATUS_HIDDEN".
Status SupportedModelStatus `json:"status" api:"required"`
// Timestamp when the catalog entry was last updated.
UpdatedAt time.Time `json:"updatedAt" api:"required" format:"date-time"`
// Model architecture from the underlying weights metadata.
Architecture string `json:"architecture"`
// Maximum context length from the underlying weights metadata.
ContextLength string `json:"contextLength"`
// Human-readable model description.
Description string `json:"description"`
// Model family identifier for related catalog entries.
FamilyID string `json:"familyId"`
// Advanced features exposed by the model.
//
// Any of "FEATURE_TOOL_CALLING", "FEATURE_STRUCTURED_OUTPUT", "FEATURE_REASONING".
Features []string `json:"features"`
// Preferred input format for the model.
InputFormat string `json:"inputFormat"`
// Preferred output format for the model.
OutputFormat string `json:"outputFormat"`
// Serverless endpoint name for inference, if available.
ServerlessEndpoint string `json:"serverlessEndpoint"`
// Searchable catalog tags for the model.
Tags []string `json:"tags"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
BaseModel respjson.Field
BaseModelID respjson.Field
Capabilities respjson.Field
CreatedAt respjson.Field
DeploymentProfiles respjson.Field
DisplayName respjson.Field
DisplayType respjson.Field
InputModalities respjson.Field
Name respjson.Field
OutputModalities respjson.Field
Products respjson.Field
Publisher respjson.Field
Status respjson.Field
UpdatedAt respjson.Field
Architecture respjson.Field
ContextLength respjson.Field
Description respjson.Field
FamilyID respjson.Field
Features respjson.Field
InputFormat respjson.Field
OutputFormat respjson.Field
ServerlessEndpoint respjson.Field
Tags respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Curated catalog entry for a platform-supported model.
func (SupportedModel) RawJSON ¶ added in v0.11.0
func (r SupportedModel) RawJSON() string
Returns the unmodified JSON received from the API
func (*SupportedModel) UnmarshalJSON ¶ added in v0.11.0
func (r *SupportedModel) UnmarshalJSON(data []byte) error
type SupportedModelDeploymentProfile ¶ added in v0.11.0
type SupportedModelDeploymentProfile struct {
// Certified configuration revision identifier.
CertifiedConfigRevisionID string `json:"certifiedConfigRevisionId" api:"required"`
// Certified model weight revision identifier, if available.
CertifiedModelRevisionID string `json:"certifiedModelRevisionId" api:"required"`
// Certified config revision in the form
// `projects/{projectId}/configs/{configRevisionId}`. Omitted when the profile does
// not pin a config.
Config string `json:"config" api:"required"`
// Number of GPUs required by the profile.
GPUCount int64 `json:"gpuCount" api:"required"`
// GPU instance type for the profile.
GPUType string `json:"gpuType" api:"required"`
// Deployable model resource in the form
// `projects/{projectId}/models/{modelId}[/revisions/{revisionId}]`. Omitted when
// the profile does not pin model weights.
Model string `json:"model" api:"required"`
// Free-form parallelism spec for the profile, such as TP8, TP4, EP, or PD;
// supersedes tensor_parallel_size.
Parallelism string `json:"parallelism" api:"required"`
// Performance benchmarks for the profile, if available.
PerformanceBenchmarks SupportedModelPerformanceBenchmarks `json:"performanceBenchmarks" api:"required"`
// Stable profile identifier, usually the certified config id.
ProfileID string `json:"profileId" api:"required"`
// Quantization method for the profile, if available.
Quantization string `json:"quantization" api:"required"`
// Deprecated. Use `parallelism`. Legacy tensor-parallel shard count for the
// profile.
//
// Deprecated: deprecated
TensorParallelSize int64 `json:"tensorParallelSize"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CertifiedConfigRevisionID respjson.Field
CertifiedModelRevisionID respjson.Field
Config respjson.Field
GPUCount respjson.Field
GPUType respjson.Field
Model respjson.Field
Parallelism respjson.Field
PerformanceBenchmarks respjson.Field
ProfileID respjson.Field
Quantization respjson.Field
TensorParallelSize respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Certified deployment profile for a supported model.
func (SupportedModelDeploymentProfile) RawJSON ¶ added in v0.11.0
func (r SupportedModelDeploymentProfile) RawJSON() string
Returns the unmodified JSON received from the API
func (*SupportedModelDeploymentProfile) UnmarshalJSON ¶ added in v0.11.0
func (r *SupportedModelDeploymentProfile) UnmarshalJSON(data []byte) error
type SupportedModelPerformanceBenchmarks ¶ added in v0.11.0
type SupportedModelPerformanceBenchmarks struct {
// Decoding throughput in tokens per second.
DecodingSpeedTps float64 `json:"decodingSpeedTps"`
// Maximum context length supported by the profile.
MaxContextLength string `json:"maxContextLength"`
// Time to first token in milliseconds.
TimeToFirstTokenMs int64 `json:"timeToFirstTokenMs"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
DecodingSpeedTps respjson.Field
MaxContextLength respjson.Field
TimeToFirstTokenMs respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Performance benchmark metrics for a supported model profile.
func (SupportedModelPerformanceBenchmarks) RawJSON ¶ added in v0.11.0
func (r SupportedModelPerformanceBenchmarks) RawJSON() string
Returns the unmodified JSON received from the API
func (*SupportedModelPerformanceBenchmarks) UnmarshalJSON ¶ added in v0.11.0
func (r *SupportedModelPerformanceBenchmarks) UnmarshalJSON(data []byte) error
type SupportedModelStatus ¶ added in v0.11.0
type SupportedModelStatus string
Catalog recommendation status for the model.
const ( SupportedModelStatusSupportedModelStatusRecommended SupportedModelStatus = "SUPPORTED_MODEL_STATUS_RECOMMENDED" SupportedModelStatusSupportedModelStatusSupported SupportedModelStatus = "SUPPORTED_MODEL_STATUS_SUPPORTED" SupportedModelStatusSupportedModelStatusDeprecated SupportedModelStatus = "SUPPORTED_MODEL_STATUS_DEPRECATED" SupportedModelStatusSupportedModelStatusHidden SupportedModelStatus = "SUPPORTED_MODEL_STATUS_HIDDEN" )
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 TrainingCheckpoint ¶ added in v0.12.0
type TrainingCheckpoint struct {
// Unique identifier for the checkpoint
ID string `json:"id" api:"required"`
// Timestamp when the checkpoint was created
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// Training step at time of save
Step TrainingCheckpointStepUnion `json:"step" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
Step respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Saved training checkpoint
func (TrainingCheckpoint) RawJSON ¶ added in v0.12.0
func (r TrainingCheckpoint) RawJSON() string
Returns the unmodified JSON received from the API
func (*TrainingCheckpoint) UnmarshalJSON ¶ added in v0.12.0
func (r *TrainingCheckpoint) UnmarshalJSON(data []byte) error
type TrainingCheckpointOperation ¶ added in v0.12.0
type TrainingCheckpointOperation struct {
// Operation ID
ID string `json:"id" api:"required"`
// Operation status
//
// Any of "TRAINING_OPERATION_STATUS_UNSPECIFIED",
// "TRAINING_OPERATION_STATUS_PENDING", "TRAINING_OPERATION_STATUS_RUNNING",
// "TRAINING_OPERATION_STATUS_COMPLETED", "TRAINING_OPERATION_STATUS_FAILED".
Status TrainingOperationStatus `json:"status" api:"required"`
// Error details on failure
Error TrainingOperationError `json:"error"`
// Result on success
Output TrainingCheckpointResult `json:"output"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Status respjson.Field
Error respjson.Field
Output respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Async save training checkpoint operation
func (TrainingCheckpointOperation) RawJSON ¶ added in v0.12.0
func (r TrainingCheckpointOperation) RawJSON() string
Returns the unmodified JSON received from the API
func (*TrainingCheckpointOperation) UnmarshalJSON ¶ added in v0.12.0
func (r *TrainingCheckpointOperation) UnmarshalJSON(data []byte) error
type TrainingCheckpointResult ¶ added in v0.12.0
type TrainingCheckpointResult struct {
// ID of the saved training checkpoint (use for resume via Start)
CheckpointID string `json:"checkpoint_id" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CheckpointID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Result of a save training checkpoint operation
func (TrainingCheckpointResult) RawJSON ¶ added in v0.12.0
func (r TrainingCheckpointResult) RawJSON() string
Returns the unmodified JSON received from the API
func (*TrainingCheckpointResult) UnmarshalJSON ¶ added in v0.12.0
func (r *TrainingCheckpointResult) UnmarshalJSON(data []byte) error
type TrainingCheckpointStepUnion ¶ added in v0.12.0
type TrainingCheckpointStepUnion 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 [int64] instead of an object.
OfInt int64 `json:",inline"`
JSON struct {
OfString respjson.Field
OfInt respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
TrainingCheckpointStepUnion contains all possible properties and values from [string], [int64].
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 OfInt]
func (TrainingCheckpointStepUnion) AsInt ¶ added in v0.12.0
func (u TrainingCheckpointStepUnion) AsInt() (v int64)
func (TrainingCheckpointStepUnion) AsString ¶ added in v0.12.0
func (u TrainingCheckpointStepUnion) AsString() (v string)
func (TrainingCheckpointStepUnion) RawJSON ¶ added in v0.12.0
func (u TrainingCheckpointStepUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*TrainingCheckpointStepUnion) UnmarshalJSON ¶ added in v0.12.0
func (r *TrainingCheckpointStepUnion) UnmarshalJSON(data []byte) error
type TrainingOperationError ¶ added in v0.12.0
type TrainingOperationError struct {
// Application error code
//
// Any of "TRAINING_OPERATION_ERROR_CODE_UNSPECIFIED",
// "TRAINING_OPERATION_ERROR_CODE_RESOURCE_EXHAUSTED",
// "TRAINING_OPERATION_ERROR_CODE_TIMEOUT",
// "TRAINING_OPERATION_ERROR_CODE_INTERNAL_ERROR",
// "TRAINING_OPERATION_ERROR_CODE_SESSION_NOT_ACTIVE",
// "TRAINING_OPERATION_ERROR_CODE_INVALID_INPUT".
Code TrainingOperationErrorCode `json:"code"`
// Human-readable error message
Message string `json:"message"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Code respjson.Field
Message respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Error details for a failed training operation
func (TrainingOperationError) RawJSON ¶ added in v0.12.0
func (r TrainingOperationError) RawJSON() string
Returns the unmodified JSON received from the API
func (*TrainingOperationError) UnmarshalJSON ¶ added in v0.12.0
func (r *TrainingOperationError) UnmarshalJSON(data []byte) error
type TrainingOperationErrorCode ¶ added in v0.12.0
type TrainingOperationErrorCode string
const ( TrainingOperationErrorCodeTrainingOperationErrorCodeUnspecified TrainingOperationErrorCode = "TRAINING_OPERATION_ERROR_CODE_UNSPECIFIED" TrainingOperationErrorCodeTrainingOperationErrorCodeResourceExhausted TrainingOperationErrorCode = "TRAINING_OPERATION_ERROR_CODE_RESOURCE_EXHAUSTED" TrainingOperationErrorCodeTrainingOperationErrorCodeTimeout TrainingOperationErrorCode = "TRAINING_OPERATION_ERROR_CODE_TIMEOUT" TrainingOperationErrorCodeTrainingOperationErrorCodeInternalError TrainingOperationErrorCode = "TRAINING_OPERATION_ERROR_CODE_INTERNAL_ERROR" TrainingOperationErrorCodeTrainingOperationErrorCodeSessionNotActive TrainingOperationErrorCode = "TRAINING_OPERATION_ERROR_CODE_SESSION_NOT_ACTIVE" TrainingOperationErrorCodeTrainingOperationErrorCodeInvalidInput TrainingOperationErrorCode = "TRAINING_OPERATION_ERROR_CODE_INVALID_INPUT" )
type TrainingOperationStatus ¶ added in v0.12.0
type TrainingOperationStatus string
const ( TrainingOperationStatusTrainingOperationStatusUnspecified TrainingOperationStatus = "TRAINING_OPERATION_STATUS_UNSPECIFIED" TrainingOperationStatusTrainingOperationStatusPending TrainingOperationStatus = "TRAINING_OPERATION_STATUS_PENDING" TrainingOperationStatusTrainingOperationStatusRunning TrainingOperationStatus = "TRAINING_OPERATION_STATUS_RUNNING" TrainingOperationStatusTrainingOperationStatusCompleted TrainingOperationStatus = "TRAINING_OPERATION_STATUS_COMPLETED" TrainingOperationStatusTrainingOperationStatusFailed TrainingOperationStatus = "TRAINING_OPERATION_STATUS_FAILED" )
type TrainingSession ¶ added in v0.12.0
type TrainingSession struct {
// ID of the training session
ID string `json:"id" api:"required"`
// Timestamp when the training session was created
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// ID of the user who created the training session
CreatedBy string `json:"created_by" api:"required"`
// List of saved inference checkpoints for this session
InferenceCheckpoints []InferenceCheckpoint `json:"inference_checkpoints" api:"required"`
// LoRA adapter configuration for this session
LoraConfig LoraConfig `json:"lora_config" api:"required"`
// Model resource this session is attached to. The session runs on that resource's
// GPU pods.
ModelResourcesID string `json:"model_resources_id" api:"required"`
// Status of the training session
//
// Any of "TRAINING_SESSION_STATUS_UNSPECIFIED",
// "TRAINING_SESSION_STATUS_CREATING", "TRAINING_SESSION_STATUS_RUNNING",
// "TRAINING_SESSION_STATUS_STOPPED", "TRAINING_SESSION_STATUS_STOPPING",
// "TRAINING_SESSION_STATUS_ERROR", "TRAINING_SESSION_STATUS_EXPIRED".
Status TrainingSessionStatus `json:"status" api:"required"`
// Current training step
Step TrainingSessionStepUnion `json:"step" api:"required"`
// List of saved training checkpoints for this session
TrainingCheckpoints []TrainingCheckpoint `json:"training_checkpoints" api:"required"`
// Timestamp when the training session was last updated
UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
// Structured detail for the training session's current error. Set when the session
// is in an error state.
Error TrainingSessionError `json:"error"`
// Checkpoint ID this session was resumed from
ResumeFromCheckpointID string `json:"resume_from_checkpoint_id"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
CreatedBy respjson.Field
InferenceCheckpoints respjson.Field
LoraConfig respjson.Field
ModelResourcesID respjson.Field
Status respjson.Field
Step respjson.Field
TrainingCheckpoints respjson.Field
UpdatedAt respjson.Field
Error respjson.Field
ResumeFromCheckpointID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A training session and its current state
func (TrainingSession) RawJSON ¶ added in v0.12.0
func (r TrainingSession) RawJSON() string
Returns the unmodified JSON received from the API
func (*TrainingSession) UnmarshalJSON ¶ added in v0.12.0
func (r *TrainingSession) UnmarshalJSON(data []byte) error
type TrainingSessionError ¶ added in v0.12.0
type TrainingSessionError struct {
// Finite machine-readable reason code for UI branching
//
// Any of "TRAINING_SESSION_ERROR_CODE_RESOURCE_UNAVAILABLE",
// "TRAINING_SESSION_ERROR_CODE_RESOURCE_AT_CAPACITY",
// "TRAINING_SESSION_ERROR_CODE_TIMED_OUT",
// "TRAINING_SESSION_ERROR_CODE_SESSION_FAILED".
Code TrainingSessionErrorCode `json:"code" api:"required"`
// User-safe human-readable detail for the current status
Message string `json:"message" api:"required"`
// Timestamp when this error was reported
OccurredAt time.Time `json:"occurred_at" api:"required" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Code respjson.Field
Message respjson.Field
OccurredAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Structured detail for the training session's current error
func (TrainingSessionError) RawJSON ¶ added in v0.12.0
func (r TrainingSessionError) RawJSON() string
Returns the unmodified JSON received from the API
func (*TrainingSessionError) UnmarshalJSON ¶ added in v0.12.0
func (r *TrainingSessionError) UnmarshalJSON(data []byte) error
type TrainingSessionErrorCode ¶ added in v0.12.0
type TrainingSessionErrorCode string
Finite machine-readable training session lifecycle error code
const ( TrainingSessionErrorCodeTrainingSessionErrorCodeResourceAtCapacity TrainingSessionErrorCode = "TRAINING_SESSION_ERROR_CODE_RESOURCE_AT_CAPACITY" TrainingSessionErrorCodeTrainingSessionErrorCodeTimedOut TrainingSessionErrorCode = "TRAINING_SESSION_ERROR_CODE_TIMED_OUT" TrainingSessionErrorCodeTrainingSessionErrorCodeSessionFailed TrainingSessionErrorCode = "TRAINING_SESSION_ERROR_CODE_SESSION_FAILED" )
type TrainingSessionStatus ¶ added in v0.12.0
type TrainingSessionStatus string
Status of the training session
const ( TrainingSessionStatusTrainingSessionStatusUnspecified TrainingSessionStatus = "TRAINING_SESSION_STATUS_UNSPECIFIED" TrainingSessionStatusTrainingSessionStatusCreating TrainingSessionStatus = "TRAINING_SESSION_STATUS_CREATING" TrainingSessionStatusTrainingSessionStatusRunning TrainingSessionStatus = "TRAINING_SESSION_STATUS_RUNNING" TrainingSessionStatusTrainingSessionStatusStopped TrainingSessionStatus = "TRAINING_SESSION_STATUS_STOPPED" TrainingSessionStatusTrainingSessionStatusStopping TrainingSessionStatus = "TRAINING_SESSION_STATUS_STOPPING" TrainingSessionStatusTrainingSessionStatusError TrainingSessionStatus = "TRAINING_SESSION_STATUS_ERROR" TrainingSessionStatusTrainingSessionStatusExpired TrainingSessionStatus = "TRAINING_SESSION_STATUS_EXPIRED" )
type TrainingSessionStepUnion ¶ added in v0.12.0
type TrainingSessionStepUnion 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 [int64] instead of an object.
OfInt int64 `json:",inline"`
JSON struct {
OfString respjson.Field
OfInt respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
TrainingSessionStepUnion contains all possible properties and values from [string], [int64].
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 OfInt]
func (TrainingSessionStepUnion) AsInt ¶ added in v0.12.0
func (u TrainingSessionStepUnion) AsInt() (v int64)
func (TrainingSessionStepUnion) AsString ¶ added in v0.12.0
func (u TrainingSessionStepUnion) AsString() (v string)
func (TrainingSessionStepUnion) RawJSON ¶ added in v0.12.0
func (u TrainingSessionStepUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*TrainingSessionStepUnion) UnmarshalJSON ¶ added in v0.12.0
func (r *TrainingSessionStepUnion) UnmarshalJSON(data []byte) error
type TrainingSessionsListResponse ¶ added in v0.12.0
type TrainingSessionsListResponse struct {
// List of training sessions
Data []TrainingSession `json:"data"`
// Pagination metadata
Meta TrainingSessionsListResponseMeta `json:"meta"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Paginated list of training sessions
func (TrainingSessionsListResponse) RawJSON ¶ added in v0.12.0
func (r TrainingSessionsListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*TrainingSessionsListResponse) UnmarshalJSON ¶ added in v0.12.0
func (r *TrainingSessionsListResponse) UnmarshalJSON(data []byte) error
type TrainingSessionsListResponseMeta ¶ added in v0.12.0
type TrainingSessionsListResponseMeta struct {
// Whether more items exist beyond this page
HasMore bool `json:"has_more"`
// Maximum number of items returned per page
Limit int64 `json:"limit"`
// Cursor to use as the 'after' parameter for the next page. Empty when has_more is
// false.
NextCursor string `json:"next_cursor"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
HasMore respjson.Field
Limit respjson.Field
NextCursor respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Pagination metadata
func (TrainingSessionsListResponseMeta) RawJSON ¶ added in v0.12.0
func (r TrainingSessionsListResponseMeta) RawJSON() string
Returns the unmodified JSON received from the API
func (*TrainingSessionsListResponseMeta) UnmarshalJSON ¶ added in v0.12.0
func (r *TrainingSessionsListResponseMeta) 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) UnmarshalJSON ¶
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) UnmarshalJSON ¶ added in v0.6.0
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
type WeightSyncType ¶ added in v0.12.0
type WeightSyncType string
How the trainer's updated weights are propagated to the generator after an optimizer step. SYNCHRONOUS publishes inline before the step returns; BACKGROUND_PUBLISH returns immediately and publishes once in-flight rollouts drain; PIPELINE overlaps the publish with in-flight rollouts so they continue decoding under the new weights.
const ( WeightSyncTypeWeightSyncTypeUnspecified WeightSyncType = "WEIGHT_SYNC_TYPE_UNSPECIFIED" WeightSyncTypeWeightSyncTypeSynchronous WeightSyncType = "WEIGHT_SYNC_TYPE_SYNCHRONOUS" WeightSyncTypeWeightSyncTypeBackgroundPublish WeightSyncType = "WEIGHT_SYNC_TYPE_BACKGROUND_PUBLISH" WeightSyncTypeWeightSyncTypePipeline WeightSyncType = "WEIGHT_SYNC_TYPE_PIPELINE" )
type WhoamiResponse ¶ added in v0.11.0
type WhoamiResponse struct {
// The ID of the API key that authenticated the request.
APIKeyID string `json:"api_key_id" api:"required"`
// The ID of the organization that owns the project.
OrganizationID string `json:"organization_id" api:"required"`
// Human-readable name of the organization.
OrganizationName string `json:"organization_name" api:"required"`
// The ID of the project the API key is scoped to.
ProjectID string `json:"project_id" api:"required"`
// Human-readable name of the project.
ProjectName string `json:"project_name" api:"required"`
// DNS-friendly project identifier. Used with an endpoint slug as
// `<project_slug>/<endpoint_slug>` to form the `model` value in dedicated endpoint
// inference calls.
ProjectSlug string `json:"project_slug" api:"required"`
// The ID of the authenticated user, if available.
UserID string `json:"user_id"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
APIKeyID respjson.Field
OrganizationID respjson.Field
OrganizationName respjson.Field
ProjectID respjson.Field
ProjectName respjson.Field
ProjectSlug respjson.Field
UserID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WhoamiResponse) RawJSON ¶ added in v0.11.0
func (r WhoamiResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*WhoamiResponse) UnmarshalJSON ¶ added in v0.11.0
func (r *WhoamiResponse) UnmarshalJSON(data []byte) error
Source Files
¶
- aliases.go
- audio.go
- audiospeech.go
- audiotranscription.go
- audiotranslation.go
- audiovoice.go
- batch.go
- beta.go
- betacluster.go
- betaclusterremediation.go
- betaclusterstorage.go
- betaendpoint.go
- betaendpointabexperiment.go
- betaendpointadapter.go
- betaendpointdeployment.go
- betaendpointhardware.go
- betaendpointplacementprofile.go
- betaendpointshadowexperiment.go
- betaendpointshadowexperimenttarget.go
- betajig.go
- betajigqueue.go
- betajigsecret.go
- betajigvolume.go
- betamodel.go
- betamodelconfig.go
- betamodelremoteupload.go
- betarl.go
- betarlcheckpoint.go
- betarlmodelresource.go
- betarloperation.go
- betarlsession.go
- betarlsupportedmodel.go
- chat.go
- chatcompletion.go
- client.go
- codeinterpreter.go
- codeinterpretersession.go
- completion.go
- default_http_client.go
- embedding.go
- endpoint.go
- endpointadapter.go
- eval.go
- field.go
- file.go
- finetuning.go
- image.go
- model.go
- modelupload.go
- rerank.go
- together.go
- video.go
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
|
|