mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
535 lines
15 KiB
Go
535 lines
15 KiB
Go
/*
|
|
Hanzo Cloud API
|
|
|
|
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
|
|
|
|
API version: v1
|
|
*/
|
|
|
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
|
|
package hanzoai
|
|
|
|
import (
|
|
"encoding/json"
|
|
)
|
|
|
|
// checks if the EventLLMOverview type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &EventLLMOverview{}
|
|
|
|
// EventLLMOverview struct for EventLLMOverview
|
|
type EventLLMOverview struct {
|
|
// Available is true whenever the ledger answered — including with no usage in the window, which is honest zeros rather than a missing lens.
|
|
Available *bool `json:"available,omitempty"`
|
|
// CompletionTokens is the output half of Tokens.
|
|
CompletionTokens *int64 `json:"completionTokens,omitempty"`
|
|
// ErrorRate is Errors/Requests, 0..1, rounded to three places. Zero when there were no requests.
|
|
ErrorRate *float64 `json:"errorRate,omitempty"`
|
|
// Errors is how many of Requests failed.
|
|
Errors *int64 `json:"errors,omitempty"`
|
|
// Models is how many distinct models the org called.
|
|
Models *int64 `json:"models,omitempty"`
|
|
// PromptTokens is the input half of Tokens.
|
|
PromptTokens *int64 `json:"promptTokens,omitempty"`
|
|
// Providers is how many distinct providers served them.
|
|
Providers *int64 `json:"providers,omitempty"`
|
|
// Requests is how many LLM calls the org made in the window.
|
|
Requests *int64 `json:"requests,omitempty"`
|
|
// Source is the warehouse table the lens read.
|
|
Source *string `json:"source,omitempty"`
|
|
// SpendCents is what those calls cost, in cents.
|
|
SpendCents *int64 `json:"spendCents,omitempty"`
|
|
// Tokens is prompt plus completion tokens over those calls.
|
|
Tokens *int64 `json:"tokens,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _EventLLMOverview EventLLMOverview
|
|
|
|
// NewEventLLMOverview instantiates a new EventLLMOverview object
|
|
// This constructor will assign default values to properties that have it defined,
|
|
// and makes sure properties required by API are set, but the set of arguments
|
|
// will change when the set of required properties is changed
|
|
func NewEventLLMOverview() *EventLLMOverview {
|
|
this := EventLLMOverview{}
|
|
return &this
|
|
}
|
|
|
|
// NewEventLLMOverviewWithDefaults instantiates a new EventLLMOverview object
|
|
// This constructor will only assign default values to properties that have it defined,
|
|
// but it doesn't guarantee that properties required by API are set
|
|
func NewEventLLMOverviewWithDefaults() *EventLLMOverview {
|
|
this := EventLLMOverview{}
|
|
return &this
|
|
}
|
|
|
|
// GetAvailable returns the Available field value if set, zero value otherwise.
|
|
func (o *EventLLMOverview) GetAvailable() bool {
|
|
if o == nil || IsNil(o.Available) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.Available
|
|
}
|
|
|
|
// GetAvailableOk returns a tuple with the Available field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EventLLMOverview) GetAvailableOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.Available) {
|
|
return nil, false
|
|
}
|
|
return o.Available, true
|
|
}
|
|
|
|
// HasAvailable returns a boolean if a field has been set.
|
|
func (o *EventLLMOverview) HasAvailable() bool {
|
|
if o != nil && !IsNil(o.Available) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetAvailable gets a reference to the given bool and assigns it to the Available field.
|
|
func (o *EventLLMOverview) SetAvailable(v bool) {
|
|
o.Available = &v
|
|
}
|
|
|
|
// GetCompletionTokens returns the CompletionTokens field value if set, zero value otherwise.
|
|
func (o *EventLLMOverview) GetCompletionTokens() int64 {
|
|
if o == nil || IsNil(o.CompletionTokens) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.CompletionTokens
|
|
}
|
|
|
|
// GetCompletionTokensOk returns a tuple with the CompletionTokens field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EventLLMOverview) GetCompletionTokensOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.CompletionTokens) {
|
|
return nil, false
|
|
}
|
|
return o.CompletionTokens, true
|
|
}
|
|
|
|
// HasCompletionTokens returns a boolean if a field has been set.
|
|
func (o *EventLLMOverview) HasCompletionTokens() bool {
|
|
if o != nil && !IsNil(o.CompletionTokens) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCompletionTokens gets a reference to the given int64 and assigns it to the CompletionTokens field.
|
|
func (o *EventLLMOverview) SetCompletionTokens(v int64) {
|
|
o.CompletionTokens = &v
|
|
}
|
|
|
|
// GetErrorRate returns the ErrorRate field value if set, zero value otherwise.
|
|
func (o *EventLLMOverview) GetErrorRate() float64 {
|
|
if o == nil || IsNil(o.ErrorRate) {
|
|
var ret float64
|
|
return ret
|
|
}
|
|
return *o.ErrorRate
|
|
}
|
|
|
|
// GetErrorRateOk returns a tuple with the ErrorRate field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EventLLMOverview) GetErrorRateOk() (*float64, bool) {
|
|
if o == nil || IsNil(o.ErrorRate) {
|
|
return nil, false
|
|
}
|
|
return o.ErrorRate, true
|
|
}
|
|
|
|
// HasErrorRate returns a boolean if a field has been set.
|
|
func (o *EventLLMOverview) HasErrorRate() bool {
|
|
if o != nil && !IsNil(o.ErrorRate) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetErrorRate gets a reference to the given float64 and assigns it to the ErrorRate field.
|
|
func (o *EventLLMOverview) SetErrorRate(v float64) {
|
|
o.ErrorRate = &v
|
|
}
|
|
|
|
// GetErrors returns the Errors field value if set, zero value otherwise.
|
|
func (o *EventLLMOverview) GetErrors() int64 {
|
|
if o == nil || IsNil(o.Errors) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Errors
|
|
}
|
|
|
|
// GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EventLLMOverview) GetErrorsOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Errors) {
|
|
return nil, false
|
|
}
|
|
return o.Errors, true
|
|
}
|
|
|
|
// HasErrors returns a boolean if a field has been set.
|
|
func (o *EventLLMOverview) HasErrors() bool {
|
|
if o != nil && !IsNil(o.Errors) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetErrors gets a reference to the given int64 and assigns it to the Errors field.
|
|
func (o *EventLLMOverview) SetErrors(v int64) {
|
|
o.Errors = &v
|
|
}
|
|
|
|
// GetModels returns the Models field value if set, zero value otherwise.
|
|
func (o *EventLLMOverview) GetModels() int64 {
|
|
if o == nil || IsNil(o.Models) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Models
|
|
}
|
|
|
|
// GetModelsOk returns a tuple with the Models field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EventLLMOverview) GetModelsOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Models) {
|
|
return nil, false
|
|
}
|
|
return o.Models, true
|
|
}
|
|
|
|
// HasModels returns a boolean if a field has been set.
|
|
func (o *EventLLMOverview) HasModels() bool {
|
|
if o != nil && !IsNil(o.Models) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetModels gets a reference to the given int64 and assigns it to the Models field.
|
|
func (o *EventLLMOverview) SetModels(v int64) {
|
|
o.Models = &v
|
|
}
|
|
|
|
// GetPromptTokens returns the PromptTokens field value if set, zero value otherwise.
|
|
func (o *EventLLMOverview) GetPromptTokens() int64 {
|
|
if o == nil || IsNil(o.PromptTokens) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.PromptTokens
|
|
}
|
|
|
|
// GetPromptTokensOk returns a tuple with the PromptTokens field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EventLLMOverview) GetPromptTokensOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.PromptTokens) {
|
|
return nil, false
|
|
}
|
|
return o.PromptTokens, true
|
|
}
|
|
|
|
// HasPromptTokens returns a boolean if a field has been set.
|
|
func (o *EventLLMOverview) HasPromptTokens() bool {
|
|
if o != nil && !IsNil(o.PromptTokens) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetPromptTokens gets a reference to the given int64 and assigns it to the PromptTokens field.
|
|
func (o *EventLLMOverview) SetPromptTokens(v int64) {
|
|
o.PromptTokens = &v
|
|
}
|
|
|
|
// GetProviders returns the Providers field value if set, zero value otherwise.
|
|
func (o *EventLLMOverview) GetProviders() int64 {
|
|
if o == nil || IsNil(o.Providers) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Providers
|
|
}
|
|
|
|
// GetProvidersOk returns a tuple with the Providers field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EventLLMOverview) GetProvidersOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Providers) {
|
|
return nil, false
|
|
}
|
|
return o.Providers, true
|
|
}
|
|
|
|
// HasProviders returns a boolean if a field has been set.
|
|
func (o *EventLLMOverview) HasProviders() bool {
|
|
if o != nil && !IsNil(o.Providers) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetProviders gets a reference to the given int64 and assigns it to the Providers field.
|
|
func (o *EventLLMOverview) SetProviders(v int64) {
|
|
o.Providers = &v
|
|
}
|
|
|
|
// GetRequests returns the Requests field value if set, zero value otherwise.
|
|
func (o *EventLLMOverview) GetRequests() int64 {
|
|
if o == nil || IsNil(o.Requests) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Requests
|
|
}
|
|
|
|
// GetRequestsOk returns a tuple with the Requests field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EventLLMOverview) GetRequestsOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Requests) {
|
|
return nil, false
|
|
}
|
|
return o.Requests, true
|
|
}
|
|
|
|
// HasRequests returns a boolean if a field has been set.
|
|
func (o *EventLLMOverview) HasRequests() bool {
|
|
if o != nil && !IsNil(o.Requests) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetRequests gets a reference to the given int64 and assigns it to the Requests field.
|
|
func (o *EventLLMOverview) SetRequests(v int64) {
|
|
o.Requests = &v
|
|
}
|
|
|
|
// GetSource returns the Source field value if set, zero value otherwise.
|
|
func (o *EventLLMOverview) GetSource() string {
|
|
if o == nil || IsNil(o.Source) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Source
|
|
}
|
|
|
|
// GetSourceOk returns a tuple with the Source field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EventLLMOverview) GetSourceOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Source) {
|
|
return nil, false
|
|
}
|
|
return o.Source, true
|
|
}
|
|
|
|
// HasSource returns a boolean if a field has been set.
|
|
func (o *EventLLMOverview) HasSource() bool {
|
|
if o != nil && !IsNil(o.Source) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSource gets a reference to the given string and assigns it to the Source field.
|
|
func (o *EventLLMOverview) SetSource(v string) {
|
|
o.Source = &v
|
|
}
|
|
|
|
// GetSpendCents returns the SpendCents field value if set, zero value otherwise.
|
|
func (o *EventLLMOverview) GetSpendCents() int64 {
|
|
if o == nil || IsNil(o.SpendCents) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.SpendCents
|
|
}
|
|
|
|
// GetSpendCentsOk returns a tuple with the SpendCents field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EventLLMOverview) GetSpendCentsOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.SpendCents) {
|
|
return nil, false
|
|
}
|
|
return o.SpendCents, true
|
|
}
|
|
|
|
// HasSpendCents returns a boolean if a field has been set.
|
|
func (o *EventLLMOverview) HasSpendCents() bool {
|
|
if o != nil && !IsNil(o.SpendCents) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSpendCents gets a reference to the given int64 and assigns it to the SpendCents field.
|
|
func (o *EventLLMOverview) SetSpendCents(v int64) {
|
|
o.SpendCents = &v
|
|
}
|
|
|
|
// GetTokens returns the Tokens field value if set, zero value otherwise.
|
|
func (o *EventLLMOverview) GetTokens() int64 {
|
|
if o == nil || IsNil(o.Tokens) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Tokens
|
|
}
|
|
|
|
// GetTokensOk returns a tuple with the Tokens field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EventLLMOverview) GetTokensOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Tokens) {
|
|
return nil, false
|
|
}
|
|
return o.Tokens, true
|
|
}
|
|
|
|
// HasTokens returns a boolean if a field has been set.
|
|
func (o *EventLLMOverview) HasTokens() bool {
|
|
if o != nil && !IsNil(o.Tokens) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTokens gets a reference to the given int64 and assigns it to the Tokens field.
|
|
func (o *EventLLMOverview) SetTokens(v int64) {
|
|
o.Tokens = &v
|
|
}
|
|
|
|
func (o EventLLMOverview) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o EventLLMOverview) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Available) {
|
|
toSerialize["available"] = o.Available
|
|
}
|
|
if !IsNil(o.CompletionTokens) {
|
|
toSerialize["completionTokens"] = o.CompletionTokens
|
|
}
|
|
if !IsNil(o.ErrorRate) {
|
|
toSerialize["errorRate"] = o.ErrorRate
|
|
}
|
|
if !IsNil(o.Errors) {
|
|
toSerialize["errors"] = o.Errors
|
|
}
|
|
if !IsNil(o.Models) {
|
|
toSerialize["models"] = o.Models
|
|
}
|
|
if !IsNil(o.PromptTokens) {
|
|
toSerialize["promptTokens"] = o.PromptTokens
|
|
}
|
|
if !IsNil(o.Providers) {
|
|
toSerialize["providers"] = o.Providers
|
|
}
|
|
if !IsNil(o.Requests) {
|
|
toSerialize["requests"] = o.Requests
|
|
}
|
|
if !IsNil(o.Source) {
|
|
toSerialize["source"] = o.Source
|
|
}
|
|
if !IsNil(o.SpendCents) {
|
|
toSerialize["spendCents"] = o.SpendCents
|
|
}
|
|
if !IsNil(o.Tokens) {
|
|
toSerialize["tokens"] = o.Tokens
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *EventLLMOverview) UnmarshalJSON(data []byte) (err error) {
|
|
varEventLLMOverview := _EventLLMOverview{}
|
|
|
|
err = json.Unmarshal(data, &varEventLLMOverview)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = EventLLMOverview(varEventLLMOverview)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "available")
|
|
delete(additionalProperties, "completionTokens")
|
|
delete(additionalProperties, "errorRate")
|
|
delete(additionalProperties, "errors")
|
|
delete(additionalProperties, "models")
|
|
delete(additionalProperties, "promptTokens")
|
|
delete(additionalProperties, "providers")
|
|
delete(additionalProperties, "requests")
|
|
delete(additionalProperties, "source")
|
|
delete(additionalProperties, "spendCents")
|
|
delete(additionalProperties, "tokens")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableEventLLMOverview struct {
|
|
value *EventLLMOverview
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableEventLLMOverview) Get() *EventLLMOverview {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableEventLLMOverview) Set(val *EventLLMOverview) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableEventLLMOverview) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableEventLLMOverview) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableEventLLMOverview(val *EventLLMOverview) *NullableEventLLMOverview {
|
|
return &NullableEventLLMOverview{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableEventLLMOverview) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableEventLLMOverview) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|