Documentation
¶
Overview ¶
Package input provides types that can be used as input when sending messages. Only types that can be used as input but not as output are included. Types that can be used as both input and output are in the output package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Any ¶
type Any struct {
Type string `json:"type"`
// contains filtered or unexported fields
}
Any is a partial representation of a content object with only the "type" field unmarshaled. It can be used to find a correct type and further unmarshal the raw content.
func (Any) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface. It just returns the saved raw content.
func (Any) String ¶
String implements the fmt.Stringer interface. Returns the raw content as a string.
func (*Any) Unmarshal ¶
Unmarshal unmarshals the full content into a type specified in the "type" field.
func (*Any) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface. It extracts only the "type" field, then saves the raw JSON for later.
func (*Any) UnmarshalToTarget ¶
UnmarshalToTarget unmarshals the content into a given target.
type ImageFile ¶
type ImageFile struct {
Type string `json:"type"` // "image_file"
File struct {
FileID string `json:"file_id"` // required
Detail string `json:"detail,omitempty"` // optional; "auto", "high", "low"
} `json:"image_file"`
}
ImageFile is an image referenced by a file ID.
func (ImageFile) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface. It fills in the "type" field with "image_file", discarding any prior value.
type ImageURL ¶
type ImageURL struct {
Type string `json:"type"` // "image_url"
Image struct {
URL string `json:"url"` // required
Detail string `json:"detail,omitempty"` // optional; "auto", "high", "low"
} `json:"image_url"`
}
ImageURL is an image referenced by a URL or as base64 encoded data.
func (ImageURL) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface. It fills in the "type" field with "image_url", discarding any prior value.
type InputFile ¶
type InputFile struct {
Type string `json:"type"` // "input_file"
FileData string `json:"file_data,omitempty"`
FileName string `json:"filename,omitempty"`
FileID string `json:"file_id,omitempty"`
}
InputFile is a file given to the model.
func (InputFile) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface. It fills in the "type" field with "input_file", discarding any prior value.
type InputImage ¶
type InputImage struct {
Type string `json:"type"` // "input_image"
Detail string `json:"detail,omitempty"` // "auto", "high", "low"
ImageURL string `json:"image_url,omitempty"`
FileID string `json:"file_id,omitempty"`
}
InputImage is an image given to the model.
func (InputImage) MarshalJSON ¶
func (i InputImage) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface. It fills in the "type" field with "input_image", discarding any prior value.
type InputText ¶
InputText is a text content.
func (InputText) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface. It fills in the "type" field with "input_text", discarding any prior value.
type ItemReference ¶
ItemReference describes a reference to an item by ID.
func (ItemReference) MarshalJSON ¶
func (i ItemReference) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface. It fills in the "type" field with "item_reference", discarding any prior value.
type Text ¶
Text is a string content.
func (Text) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface. It fills in the "type" field with "text", discarding any prior value.