mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
269 lines
7.8 KiB
Go
269 lines
7.8 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 KnowledgeRetrieveOut type satisfies the MappedNullable interface at compile time
|
||
var _ MappedNullable = &KnowledgeRetrieveOut{}
|
||
|
||
// KnowledgeRetrieveOut struct for KnowledgeRetrieveOut
|
||
type KnowledgeRetrieveOut struct {
|
||
// Degraded is true when a search leg failed along the way.
|
||
Degraded *bool `json:"degraded,omitempty"`
|
||
// Passages are the passages drilled out of those sections, then those the graph reached, each citing file › section › paragraph.
|
||
Passages []KnowledgeCitedPassage `json:"passages,omitempty"`
|
||
// Picked says how the sections were chosen: whole when the documents were short enough to read every section, model when a model read the tables of contents, search when the sections of the best passages stood in — the documents had no headings to choose by, or no model answered.
|
||
Picked *string `json:"picked,omitempty"`
|
||
// Sections are the sections chosen from the candidate documents' tables of contents.
|
||
Sections []KnowledgePickedSection `json:"sections,omitempty"`
|
||
AdditionalProperties map[string]interface{}
|
||
}
|
||
|
||
type _KnowledgeRetrieveOut KnowledgeRetrieveOut
|
||
|
||
// NewKnowledgeRetrieveOut instantiates a new KnowledgeRetrieveOut 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 NewKnowledgeRetrieveOut() *KnowledgeRetrieveOut {
|
||
this := KnowledgeRetrieveOut{}
|
||
return &this
|
||
}
|
||
|
||
// NewKnowledgeRetrieveOutWithDefaults instantiates a new KnowledgeRetrieveOut 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 NewKnowledgeRetrieveOutWithDefaults() *KnowledgeRetrieveOut {
|
||
this := KnowledgeRetrieveOut{}
|
||
return &this
|
||
}
|
||
|
||
// GetDegraded returns the Degraded field value if set, zero value otherwise.
|
||
func (o *KnowledgeRetrieveOut) 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 *KnowledgeRetrieveOut) 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 *KnowledgeRetrieveOut) 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 *KnowledgeRetrieveOut) SetDegraded(v bool) {
|
||
o.Degraded = &v
|
||
}
|
||
|
||
// GetPassages returns the Passages field value if set, zero value otherwise.
|
||
func (o *KnowledgeRetrieveOut) GetPassages() []KnowledgeCitedPassage {
|
||
if o == nil || IsNil(o.Passages) {
|
||
var ret []KnowledgeCitedPassage
|
||
return ret
|
||
}
|
||
return o.Passages
|
||
}
|
||
|
||
// GetPassagesOk returns a tuple with the Passages field value if set, nil otherwise
|
||
// and a boolean to check if the value has been set.
|
||
func (o *KnowledgeRetrieveOut) GetPassagesOk() ([]KnowledgeCitedPassage, bool) {
|
||
if o == nil || IsNil(o.Passages) {
|
||
return nil, false
|
||
}
|
||
return o.Passages, true
|
||
}
|
||
|
||
// HasPassages returns a boolean if a field has been set.
|
||
func (o *KnowledgeRetrieveOut) HasPassages() bool {
|
||
if o != nil && !IsNil(o.Passages) {
|
||
return true
|
||
}
|
||
|
||
return false
|
||
}
|
||
|
||
// SetPassages gets a reference to the given []KnowledgeCitedPassage and assigns it to the Passages field.
|
||
func (o *KnowledgeRetrieveOut) SetPassages(v []KnowledgeCitedPassage) {
|
||
o.Passages = v
|
||
}
|
||
|
||
// GetPicked returns the Picked field value if set, zero value otherwise.
|
||
func (o *KnowledgeRetrieveOut) GetPicked() string {
|
||
if o == nil || IsNil(o.Picked) {
|
||
var ret string
|
||
return ret
|
||
}
|
||
return *o.Picked
|
||
}
|
||
|
||
// GetPickedOk returns a tuple with the Picked field value if set, nil otherwise
|
||
// and a boolean to check if the value has been set.
|
||
func (o *KnowledgeRetrieveOut) GetPickedOk() (*string, bool) {
|
||
if o == nil || IsNil(o.Picked) {
|
||
return nil, false
|
||
}
|
||
return o.Picked, true
|
||
}
|
||
|
||
// HasPicked returns a boolean if a field has been set.
|
||
func (o *KnowledgeRetrieveOut) HasPicked() bool {
|
||
if o != nil && !IsNil(o.Picked) {
|
||
return true
|
||
}
|
||
|
||
return false
|
||
}
|
||
|
||
// SetPicked gets a reference to the given string and assigns it to the Picked field.
|
||
func (o *KnowledgeRetrieveOut) SetPicked(v string) {
|
||
o.Picked = &v
|
||
}
|
||
|
||
// GetSections returns the Sections field value if set, zero value otherwise.
|
||
func (o *KnowledgeRetrieveOut) GetSections() []KnowledgePickedSection {
|
||
if o == nil || IsNil(o.Sections) {
|
||
var ret []KnowledgePickedSection
|
||
return ret
|
||
}
|
||
return o.Sections
|
||
}
|
||
|
||
// GetSectionsOk returns a tuple with the Sections field value if set, nil otherwise
|
||
// and a boolean to check if the value has been set.
|
||
func (o *KnowledgeRetrieveOut) GetSectionsOk() ([]KnowledgePickedSection, bool) {
|
||
if o == nil || IsNil(o.Sections) {
|
||
return nil, false
|
||
}
|
||
return o.Sections, true
|
||
}
|
||
|
||
// HasSections returns a boolean if a field has been set.
|
||
func (o *KnowledgeRetrieveOut) HasSections() bool {
|
||
if o != nil && !IsNil(o.Sections) {
|
||
return true
|
||
}
|
||
|
||
return false
|
||
}
|
||
|
||
// SetSections gets a reference to the given []KnowledgePickedSection and assigns it to the Sections field.
|
||
func (o *KnowledgeRetrieveOut) SetSections(v []KnowledgePickedSection) {
|
||
o.Sections = v
|
||
}
|
||
|
||
func (o KnowledgeRetrieveOut) MarshalJSON() ([]byte, error) {
|
||
toSerialize, err := o.ToMap()
|
||
if err != nil {
|
||
return []byte{}, err
|
||
}
|
||
return json.Marshal(toSerialize)
|
||
}
|
||
|
||
func (o KnowledgeRetrieveOut) ToMap() (map[string]interface{}, error) {
|
||
toSerialize := map[string]interface{}{}
|
||
if !IsNil(o.Degraded) {
|
||
toSerialize["degraded"] = o.Degraded
|
||
}
|
||
if !IsNil(o.Passages) {
|
||
toSerialize["passages"] = o.Passages
|
||
}
|
||
if !IsNil(o.Picked) {
|
||
toSerialize["picked"] = o.Picked
|
||
}
|
||
if !IsNil(o.Sections) {
|
||
toSerialize["sections"] = o.Sections
|
||
}
|
||
|
||
for key, value := range o.AdditionalProperties {
|
||
toSerialize[key] = value
|
||
}
|
||
|
||
return toSerialize, nil
|
||
}
|
||
|
||
func (o *KnowledgeRetrieveOut) UnmarshalJSON(data []byte) (err error) {
|
||
varKnowledgeRetrieveOut := _KnowledgeRetrieveOut{}
|
||
|
||
err = json.Unmarshal(data, &varKnowledgeRetrieveOut)
|
||
|
||
if err != nil {
|
||
return err
|
||
}
|
||
|
||
*o = KnowledgeRetrieveOut(varKnowledgeRetrieveOut)
|
||
|
||
additionalProperties := make(map[string]interface{})
|
||
|
||
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
||
delete(additionalProperties, "degraded")
|
||
delete(additionalProperties, "passages")
|
||
delete(additionalProperties, "picked")
|
||
delete(additionalProperties, "sections")
|
||
o.AdditionalProperties = additionalProperties
|
||
}
|
||
|
||
return err
|
||
}
|
||
|
||
type NullableKnowledgeRetrieveOut struct {
|
||
value *KnowledgeRetrieveOut
|
||
isSet bool
|
||
}
|
||
|
||
func (v NullableKnowledgeRetrieveOut) Get() *KnowledgeRetrieveOut {
|
||
return v.value
|
||
}
|
||
|
||
func (v *NullableKnowledgeRetrieveOut) Set(val *KnowledgeRetrieveOut) {
|
||
v.value = val
|
||
v.isSet = true
|
||
}
|
||
|
||
func (v NullableKnowledgeRetrieveOut) IsSet() bool {
|
||
return v.isSet
|
||
}
|
||
|
||
func (v *NullableKnowledgeRetrieveOut) Unset() {
|
||
v.value = nil
|
||
v.isSet = false
|
||
}
|
||
|
||
func NewNullableKnowledgeRetrieveOut(val *KnowledgeRetrieveOut) *NullableKnowledgeRetrieveOut {
|
||
return &NullableKnowledgeRetrieveOut{value: val, isSet: true}
|
||
}
|
||
|
||
func (v NullableKnowledgeRetrieveOut) MarshalJSON() ([]byte, error) {
|
||
return json.Marshal(v.value)
|
||
}
|
||
|
||
func (v *NullableKnowledgeRetrieveOut) UnmarshalJSON(src []byte) error {
|
||
v.isSet = true
|
||
return json.Unmarshal(src, &v.value)
|
||
}
|