Files
sdk/model_ask_report.go

307 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 AskReport type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AskReport{}
// AskReport struct for AskReport
type AskReport struct {
// Answer is the grounded prose, with inline markdown citations. Every link in it points at a page in Sources: the citation check runs on the text before it leaves the engine, so a cited URL is one THIS call fetched.
Answer *string `json:"answer,omitempty"`
// FollowUps are the questions worth asking next. Best-effort — an empty list is a normal outcome, not a fault.
FollowUps []string `json:"follow_ups,omitempty"`
// Mode is the profile that ran: search, news, research or deep.
Mode *string `json:"mode,omitempty"`
// Model is the model that synthesized the answer.
Model *string `json:"model,omitempty"`
// Sources are the pages the answer was written from, deduplicated and ranked. Always an array, never null.
Sources []AskSource `json:"sources,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AskReport AskReport
// NewAskReport instantiates a new AskReport 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 NewAskReport() *AskReport {
this := AskReport{}
return &this
}
// NewAskReportWithDefaults instantiates a new AskReport 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 NewAskReportWithDefaults() *AskReport {
this := AskReport{}
return &this
}
// GetAnswer returns the Answer field value if set, zero value otherwise.
func (o *AskReport) GetAnswer() string {
if o == nil || IsNil(o.Answer) {
var ret string
return ret
}
return *o.Answer
}
// GetAnswerOk returns a tuple with the Answer field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AskReport) GetAnswerOk() (*string, bool) {
if o == nil || IsNil(o.Answer) {
return nil, false
}
return o.Answer, true
}
// HasAnswer returns a boolean if a field has been set.
func (o *AskReport) HasAnswer() bool {
if o != nil && !IsNil(o.Answer) {
return true
}
return false
}
// SetAnswer gets a reference to the given string and assigns it to the Answer field.
func (o *AskReport) SetAnswer(v string) {
o.Answer = &v
}
// GetFollowUps returns the FollowUps field value if set, zero value otherwise.
func (o *AskReport) GetFollowUps() []string {
if o == nil || IsNil(o.FollowUps) {
var ret []string
return ret
}
return o.FollowUps
}
// GetFollowUpsOk returns a tuple with the FollowUps field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AskReport) GetFollowUpsOk() ([]string, bool) {
if o == nil || IsNil(o.FollowUps) {
return nil, false
}
return o.FollowUps, true
}
// HasFollowUps returns a boolean if a field has been set.
func (o *AskReport) HasFollowUps() bool {
if o != nil && !IsNil(o.FollowUps) {
return true
}
return false
}
// SetFollowUps gets a reference to the given []string and assigns it to the FollowUps field.
func (o *AskReport) SetFollowUps(v []string) {
o.FollowUps = v
}
// GetMode returns the Mode field value if set, zero value otherwise.
func (o *AskReport) GetMode() string {
if o == nil || IsNil(o.Mode) {
var ret string
return ret
}
return *o.Mode
}
// GetModeOk returns a tuple with the Mode field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AskReport) GetModeOk() (*string, bool) {
if o == nil || IsNil(o.Mode) {
return nil, false
}
return o.Mode, true
}
// HasMode returns a boolean if a field has been set.
func (o *AskReport) HasMode() bool {
if o != nil && !IsNil(o.Mode) {
return true
}
return false
}
// SetMode gets a reference to the given string and assigns it to the Mode field.
func (o *AskReport) SetMode(v string) {
o.Mode = &v
}
// GetModel returns the Model field value if set, zero value otherwise.
func (o *AskReport) GetModel() string {
if o == nil || IsNil(o.Model) {
var ret string
return ret
}
return *o.Model
}
// GetModelOk returns a tuple with the Model field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AskReport) GetModelOk() (*string, bool) {
if o == nil || IsNil(o.Model) {
return nil, false
}
return o.Model, true
}
// HasModel returns a boolean if a field has been set.
func (o *AskReport) HasModel() bool {
if o != nil && !IsNil(o.Model) {
return true
}
return false
}
// SetModel gets a reference to the given string and assigns it to the Model field.
func (o *AskReport) SetModel(v string) {
o.Model = &v
}
// GetSources returns the Sources field value if set, zero value otherwise.
func (o *AskReport) GetSources() []AskSource {
if o == nil || IsNil(o.Sources) {
var ret []AskSource
return ret
}
return o.Sources
}
// GetSourcesOk returns a tuple with the Sources field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AskReport) GetSourcesOk() ([]AskSource, bool) {
if o == nil || IsNil(o.Sources) {
return nil, false
}
return o.Sources, true
}
// HasSources returns a boolean if a field has been set.
func (o *AskReport) HasSources() bool {
if o != nil && !IsNil(o.Sources) {
return true
}
return false
}
// SetSources gets a reference to the given []AskSource and assigns it to the Sources field.
func (o *AskReport) SetSources(v []AskSource) {
o.Sources = v
}
func (o AskReport) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AskReport) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Answer) {
toSerialize["answer"] = o.Answer
}
if !IsNil(o.FollowUps) {
toSerialize["follow_ups"] = o.FollowUps
}
if !IsNil(o.Mode) {
toSerialize["mode"] = o.Mode
}
if !IsNil(o.Model) {
toSerialize["model"] = o.Model
}
if !IsNil(o.Sources) {
toSerialize["sources"] = o.Sources
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AskReport) UnmarshalJSON(data []byte) (err error) {
varAskReport := _AskReport{}
err = json.Unmarshal(data, &varAskReport)
if err != nil {
return err
}
*o = AskReport(varAskReport)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "answer")
delete(additionalProperties, "follow_ups")
delete(additionalProperties, "mode")
delete(additionalProperties, "model")
delete(additionalProperties, "sources")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAskReport struct {
value *AskReport
isSet bool
}
func (v NullableAskReport) Get() *AskReport {
return v.value
}
func (v *NullableAskReport) Set(val *AskReport) {
v.value = val
v.isSet = true
}
func (v NullableAskReport) IsSet() bool {
return v.isSet
}
func (v *NullableAskReport) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAskReport(val *AskReport) *NullableAskReport {
return &NullableAskReport{value: val, isSet: true}
}
func (v NullableAskReport) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAskReport) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}