Files
sdk/model_knowledge_search_out.go

193 lines
5.5 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 KnowledgeSearchOut type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &KnowledgeSearchOut{}
// KnowledgeSearchOut struct for KnowledgeSearchOut
type KnowledgeSearchOut struct {
// Degraded is true when a leg FAILED — the query could not be embedded, or a store could not be read — and Hits are what the other leg found, possibly nothing. A RAG caller continues with what it got instead of failing the turn. Absent on a normal answer, including one from a deployment that runs only one of the legs.
Degraded *bool `json:"degraded,omitempty"`
// Hits are the matching documents, most relevant first: the order is the two legs fused, so a document both the semantic and the keyword leg found comes before one only a single leg found.
Hits []KnowledgeHit `json:"hits,omitempty"`
AdditionalProperties map[string]interface{}
}
type _KnowledgeSearchOut KnowledgeSearchOut
// NewKnowledgeSearchOut instantiates a new KnowledgeSearchOut 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 NewKnowledgeSearchOut() *KnowledgeSearchOut {
this := KnowledgeSearchOut{}
return &this
}
// NewKnowledgeSearchOutWithDefaults instantiates a new KnowledgeSearchOut 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 NewKnowledgeSearchOutWithDefaults() *KnowledgeSearchOut {
this := KnowledgeSearchOut{}
return &this
}
// GetDegraded returns the Degraded field value if set, zero value otherwise.
func (o *KnowledgeSearchOut) GetDegraded() bool {
if o == nil || IsNil(o.Degraded) {
var ret bool
return ret
}
return *o.Degraded
}
// GetDegradedOk returns a tuple with the Degraded field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KnowledgeSearchOut) GetDegradedOk() (*bool, bool) {
if o == nil || IsNil(o.Degraded) {
return nil, false
}
return o.Degraded, true
}
// HasDegraded returns a boolean if a field has been set.
func (o *KnowledgeSearchOut) HasDegraded() bool {
if o != nil && !IsNil(o.Degraded) {
return true
}
return false
}
// SetDegraded gets a reference to the given bool and assigns it to the Degraded field.
func (o *KnowledgeSearchOut) SetDegraded(v bool) {
o.Degraded = &v
}
// GetHits returns the Hits field value if set, zero value otherwise.
func (o *KnowledgeSearchOut) GetHits() []KnowledgeHit {
if o == nil || IsNil(o.Hits) {
var ret []KnowledgeHit
return ret
}
return o.Hits
}
// GetHitsOk returns a tuple with the Hits field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KnowledgeSearchOut) GetHitsOk() ([]KnowledgeHit, bool) {
if o == nil || IsNil(o.Hits) {
return nil, false
}
return o.Hits, true
}
// HasHits returns a boolean if a field has been set.
func (o *KnowledgeSearchOut) HasHits() bool {
if o != nil && !IsNil(o.Hits) {
return true
}
return false
}
// SetHits gets a reference to the given []KnowledgeHit and assigns it to the Hits field.
func (o *KnowledgeSearchOut) SetHits(v []KnowledgeHit) {
o.Hits = v
}
func (o KnowledgeSearchOut) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o KnowledgeSearchOut) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Degraded) {
toSerialize["degraded"] = o.Degraded
}
if !IsNil(o.Hits) {
toSerialize["hits"] = o.Hits
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *KnowledgeSearchOut) UnmarshalJSON(data []byte) (err error) {
varKnowledgeSearchOut := _KnowledgeSearchOut{}
err = json.Unmarshal(data, &varKnowledgeSearchOut)
if err != nil {
return err
}
*o = KnowledgeSearchOut(varKnowledgeSearchOut)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "degraded")
delete(additionalProperties, "hits")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableKnowledgeSearchOut struct {
value *KnowledgeSearchOut
isSet bool
}
func (v NullableKnowledgeSearchOut) Get() *KnowledgeSearchOut {
return v.value
}
func (v *NullableKnowledgeSearchOut) Set(val *KnowledgeSearchOut) {
v.value = val
v.isSet = true
}
func (v NullableKnowledgeSearchOut) IsSet() bool {
return v.isSet
}
func (v *NullableKnowledgeSearchOut) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableKnowledgeSearchOut(val *KnowledgeSearchOut) *NullableKnowledgeSearchOut {
return &NullableKnowledgeSearchOut{value: val, isSet: true}
}
func (v NullableKnowledgeSearchOut) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableKnowledgeSearchOut) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}