Files
sdk/model_knowledge_cited_passage.go

421 lines
11 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
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 KnowledgeCitedPassage type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &KnowledgeCitedPassage{}
// KnowledgeCitedPassage struct for KnowledgeCitedPassage
type KnowledgeCitedPassage struct {
// Cite is how an answer cites it: file › section path › ¶part.
Cite *string `json:"cite,omitempty"`
// File is the file the passage is from.
File *KnowledgeFileBrief `json:"file,omitempty"`
// Part is the passage's place in its section, from 1.
Part *int64 `json:"part,omitempty"`
// Score is the fused rank score, comparable within one response only.
Score *float64 `json:"score,omitempty"`
// Section is the section it is in.
Section *KnowledgeSectionBrief `json:"section,omitempty"`
// Text is the passage: a span of its section of about 2000 bytes, never crossing into another section.
Text *string `json:"text,omitempty"`
// Via is how retrieval reached it: search (it matched), toc (it is in a section the table of contents pointed at) or graph (a linked section).
Via *string `json:"via,omitempty"`
// Why says, for a passage reached through the graph, which edge led there.
Why *string `json:"why,omitempty"`
AdditionalProperties map[string]interface{}
}
type _KnowledgeCitedPassage KnowledgeCitedPassage
// NewKnowledgeCitedPassage instantiates a new KnowledgeCitedPassage 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 NewKnowledgeCitedPassage() *KnowledgeCitedPassage {
this := KnowledgeCitedPassage{}
return &this
}
// NewKnowledgeCitedPassageWithDefaults instantiates a new KnowledgeCitedPassage 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 NewKnowledgeCitedPassageWithDefaults() *KnowledgeCitedPassage {
this := KnowledgeCitedPassage{}
return &this
}
// GetCite returns the Cite field value if set, zero value otherwise.
func (o *KnowledgeCitedPassage) GetCite() string {
if o == nil || IsNil(o.Cite) {
var ret string
return ret
}
return *o.Cite
}
// GetCiteOk returns a tuple with the Cite field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KnowledgeCitedPassage) GetCiteOk() (*string, bool) {
if o == nil || IsNil(o.Cite) {
return nil, false
}
return o.Cite, true
}
// HasCite returns a boolean if a field has been set.
func (o *KnowledgeCitedPassage) HasCite() bool {
if o != nil && !IsNil(o.Cite) {
return true
}
return false
}
// SetCite gets a reference to the given string and assigns it to the Cite field.
func (o *KnowledgeCitedPassage) SetCite(v string) {
o.Cite = &v
}
// GetFile returns the File field value if set, zero value otherwise.
func (o *KnowledgeCitedPassage) GetFile() KnowledgeFileBrief {
if o == nil || IsNil(o.File) {
var ret KnowledgeFileBrief
return ret
}
return *o.File
}
// GetFileOk returns a tuple with the File field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KnowledgeCitedPassage) GetFileOk() (*KnowledgeFileBrief, bool) {
if o == nil || IsNil(o.File) {
return nil, false
}
return o.File, true
}
// HasFile returns a boolean if a field has been set.
func (o *KnowledgeCitedPassage) HasFile() bool {
if o != nil && !IsNil(o.File) {
return true
}
return false
}
// SetFile gets a reference to the given KnowledgeFileBrief and assigns it to the File field.
func (o *KnowledgeCitedPassage) SetFile(v KnowledgeFileBrief) {
o.File = &v
}
// GetPart returns the Part field value if set, zero value otherwise.
func (o *KnowledgeCitedPassage) GetPart() int64 {
if o == nil || IsNil(o.Part) {
var ret int64
return ret
}
return *o.Part
}
// GetPartOk returns a tuple with the Part field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KnowledgeCitedPassage) GetPartOk() (*int64, bool) {
if o == nil || IsNil(o.Part) {
return nil, false
}
return o.Part, true
}
// HasPart returns a boolean if a field has been set.
func (o *KnowledgeCitedPassage) HasPart() bool {
if o != nil && !IsNil(o.Part) {
return true
}
return false
}
// SetPart gets a reference to the given int64 and assigns it to the Part field.
func (o *KnowledgeCitedPassage) SetPart(v int64) {
o.Part = &v
}
// GetScore returns the Score field value if set, zero value otherwise.
func (o *KnowledgeCitedPassage) GetScore() float64 {
if o == nil || IsNil(o.Score) {
var ret float64
return ret
}
return *o.Score
}
// GetScoreOk returns a tuple with the Score field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KnowledgeCitedPassage) GetScoreOk() (*float64, bool) {
if o == nil || IsNil(o.Score) {
return nil, false
}
return o.Score, true
}
// HasScore returns a boolean if a field has been set.
func (o *KnowledgeCitedPassage) HasScore() bool {
if o != nil && !IsNil(o.Score) {
return true
}
return false
}
// SetScore gets a reference to the given float64 and assigns it to the Score field.
func (o *KnowledgeCitedPassage) SetScore(v float64) {
o.Score = &v
}
// GetSection returns the Section field value if set, zero value otherwise.
func (o *KnowledgeCitedPassage) GetSection() KnowledgeSectionBrief {
if o == nil || IsNil(o.Section) {
var ret KnowledgeSectionBrief
return ret
}
return *o.Section
}
// GetSectionOk returns a tuple with the Section field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KnowledgeCitedPassage) GetSectionOk() (*KnowledgeSectionBrief, bool) {
if o == nil || IsNil(o.Section) {
return nil, false
}
return o.Section, true
}
// HasSection returns a boolean if a field has been set.
func (o *KnowledgeCitedPassage) HasSection() bool {
if o != nil && !IsNil(o.Section) {
return true
}
return false
}
// SetSection gets a reference to the given KnowledgeSectionBrief and assigns it to the Section field.
func (o *KnowledgeCitedPassage) SetSection(v KnowledgeSectionBrief) {
o.Section = &v
}
// GetText returns the Text field value if set, zero value otherwise.
func (o *KnowledgeCitedPassage) GetText() string {
if o == nil || IsNil(o.Text) {
var ret string
return ret
}
return *o.Text
}
// GetTextOk returns a tuple with the Text field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KnowledgeCitedPassage) GetTextOk() (*string, bool) {
if o == nil || IsNil(o.Text) {
return nil, false
}
return o.Text, true
}
// HasText returns a boolean if a field has been set.
func (o *KnowledgeCitedPassage) HasText() bool {
if o != nil && !IsNil(o.Text) {
return true
}
return false
}
// SetText gets a reference to the given string and assigns it to the Text field.
func (o *KnowledgeCitedPassage) SetText(v string) {
o.Text = &v
}
// GetVia returns the Via field value if set, zero value otherwise.
func (o *KnowledgeCitedPassage) GetVia() string {
if o == nil || IsNil(o.Via) {
var ret string
return ret
}
return *o.Via
}
// GetViaOk returns a tuple with the Via field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KnowledgeCitedPassage) GetViaOk() (*string, bool) {
if o == nil || IsNil(o.Via) {
return nil, false
}
return o.Via, true
}
// HasVia returns a boolean if a field has been set.
func (o *KnowledgeCitedPassage) HasVia() bool {
if o != nil && !IsNil(o.Via) {
return true
}
return false
}
// SetVia gets a reference to the given string and assigns it to the Via field.
func (o *KnowledgeCitedPassage) SetVia(v string) {
o.Via = &v
}
// GetWhy returns the Why field value if set, zero value otherwise.
func (o *KnowledgeCitedPassage) GetWhy() string {
if o == nil || IsNil(o.Why) {
var ret string
return ret
}
return *o.Why
}
// GetWhyOk returns a tuple with the Why field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KnowledgeCitedPassage) GetWhyOk() (*string, bool) {
if o == nil || IsNil(o.Why) {
return nil, false
}
return o.Why, true
}
// HasWhy returns a boolean if a field has been set.
func (o *KnowledgeCitedPassage) HasWhy() bool {
if o != nil && !IsNil(o.Why) {
return true
}
return false
}
// SetWhy gets a reference to the given string and assigns it to the Why field.
func (o *KnowledgeCitedPassage) SetWhy(v string) {
o.Why = &v
}
func (o KnowledgeCitedPassage) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o KnowledgeCitedPassage) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Cite) {
toSerialize["cite"] = o.Cite
}
if !IsNil(o.File) {
toSerialize["file"] = o.File
}
if !IsNil(o.Part) {
toSerialize["part"] = o.Part
}
if !IsNil(o.Score) {
toSerialize["score"] = o.Score
}
if !IsNil(o.Section) {
toSerialize["section"] = o.Section
}
if !IsNil(o.Text) {
toSerialize["text"] = o.Text
}
if !IsNil(o.Via) {
toSerialize["via"] = o.Via
}
if !IsNil(o.Why) {
toSerialize["why"] = o.Why
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *KnowledgeCitedPassage) UnmarshalJSON(data []byte) (err error) {
varKnowledgeCitedPassage := _KnowledgeCitedPassage{}
err = json.Unmarshal(data, &varKnowledgeCitedPassage)
if err != nil {
return err
}
*o = KnowledgeCitedPassage(varKnowledgeCitedPassage)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "cite")
delete(additionalProperties, "file")
delete(additionalProperties, "part")
delete(additionalProperties, "score")
delete(additionalProperties, "section")
delete(additionalProperties, "text")
delete(additionalProperties, "via")
delete(additionalProperties, "why")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableKnowledgeCitedPassage struct {
value *KnowledgeCitedPassage
isSet bool
}
func (v NullableKnowledgeCitedPassage) Get() *KnowledgeCitedPassage {
return v.value
}
func (v *NullableKnowledgeCitedPassage) Set(val *KnowledgeCitedPassage) {
v.value = val
v.isSet = true
}
func (v NullableKnowledgeCitedPassage) IsSet() bool {
return v.isSet
}
func (v *NullableKnowledgeCitedPassage) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableKnowledgeCitedPassage(val *KnowledgeCitedPassage) *NullableKnowledgeCitedPassage {
return &NullableKnowledgeCitedPassage{value: val, isSet: true}
}
func (v NullableKnowledgeCitedPassage) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableKnowledgeCitedPassage) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}