Documentation ¶
Overview ¶
Package clarifai provides a client interface to the Clarifai public API
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { ClientID string ClientSecret string AccessToken string APIRoot string Throttled bool }
Client contains scoped variables forindividual clients
func (*Client) Feedback ¶
func (client *Client) Feedback(form FeedbackForm) (*FeedbackResp, error)
Feedback allows the user to provide contextual feedback to Clarifai in order to improve their results
type FeedbackForm ¶
type FeedbackForm struct { DocIDs []string `json:"docids,omitempty"` URLs []string `json:"url,omitempty"` AddTags []string `json:"add_tags,omitempty"` RemoveTags []string `json:"remove_tags,omitempty"` DissimilarDocIDs []string `json:"dissimilar_docids,omitempty"` SimilarDocIDs []string `json:"similar_docids,omitempty"` SearchClick []string `json:"search_click,omitempty"` }
FeedbackForm is used to send feedback back to Clarifai
type FeedbackResp ¶
type FeedbackResp struct { StatusCode string `json:"status_code"` StatusMessage string `json:"status_msg"` }
FeedbackResp is the expected response from /feedback/
type InfoResp ¶
type InfoResp struct { StatusCode string `json:"status_code"` StatusMessage string `json:"status_msg"` Results struct { MaxImageSize int `json:"max_image_size"` DefaultLanguage string `json:"default_language"` MaxVideoSize int `json:"max_video_size"` MaxImageBytes int `json:"max_image_bytes"` DefaultModel string `json:"default_model"` MaxVideoBytes int `json:"max_video_bytes"` MaxVideoDuration int `json:"max_video_duration"` MaxVideoBatchSize int `json:"max_video_batch_size"` MinVideoSize int `json:"min_video_size"` MinImageSize int `json:"min_image_size"` MaxBatchSize int `json:"max_batch_size"` APIVersion float32 `json:"api_version"` } }
InfoResp represents the expected JSON response from /info/
type TagRequest ¶
type TagRequest struct { URLs []string `json:"url"` LocalIDs []string `json:"local_ids,omitempty"` Model string `json:"model,omitempty"` }
TagRequest represents a JSON request for /tag/
type TagResp ¶
type TagResp struct { StatusCode string `json:"status_code"` StatusMessage string `json:"status_msg"` Meta struct { Tag struct { Timestamp json.Number `json:"timestamp"` Model string `json:"model"` Config string `json:"config"` } } Results []TagResult }
TagResp represents the expected JSON response from /tag/
type TagResult ¶
type TagResult struct { DocID *big.Int `json:"docid"` URL string `json:"url"` StatusCode string `json:"status_code"` StatusMessage string `json:"status_msg"` LocalID string `json:"local_id"` Result struct { Tag struct { Classes []string `json:"classes"` CatIDs []string `json:"catids"` Probs []float32 `json:"probs"` } } DocIDString string `json:"docid_str"` }
TagResult represents the expected data for a single tag result
Click to show internal directories.
Click to hide internal directories.