Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Clarifai/clarifai-go
DEPRECATED: please use https://github.com/Clarifai/clarifai-go-grpc
https://github.com/Clarifai/clarifai-go
clarifai go golang
Last synced: 3 months ago
JSON representation
DEPRECATED: please use https://github.com/Clarifai/clarifai-go-grpc
- Host: GitHub
- URL: https://github.com/Clarifai/clarifai-go
- Owner: Clarifai
- License: other
- Created: 2015-09-28T23:33:59.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-08-28T17:25:50.000Z (about 7 years ago)
- Last Synced: 2024-05-29T21:29:05.622Z (5 months ago)
- Topics: clarifai, go, golang
- Language: Go
- Homepage:
- Size: 32.2 KB
- Stars: 55
- Watchers: 41
- Forks: 15
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go-extra - clarifai-go - go-grpc|56|14|8|2015-09-28T23:33:59Z|2017-08-28T17:25:50Z| (Third-party APIs / Fail injection)
README
# Clarifai Golang Library
Library for our v1 [API](https://clarifai.com/developer/guide-v1/).
[![GoDoc](https://godoc.org/github.com/Clarifai/clarifai-go?status.svg)](https://godoc.org/github.com/Clarifai/clarifai-go)
## Disclaimer
This API client only supports Clarifai v1 API. Stay tuned for the v2 support.
## Usage
`go get github.com/clarifai/clarifai-go````go
package mainimport (
"fmt""github.com/clarifai/clarifai-go"
)func main() {
client := clarifai.NewClient("", "")
// Get the current status of things
info, err := client.Info()
if err != nil {
fmt.Println(err)
} else {
fmt.Printf("%+v\n", info)
}
// Let's get some context about these images
urls := []string{"https://samples.clarifai.com/metro-north.jpg", "https://samples.clarifai.com/puppy.jpeg"}
// Give it to Clarifai to run their magic
tag_data, err := client.Tag(clarifai.TagRequest{URLs: urls})if err != nil {
fmt.Println(err)
} else {
fmt.Printf("%+v\n", tag_data) // See what we got!
}feedback_data, err := client.Feedback(clarifai.FeedbackForm{
URLs: urls,
AddTags: []string{"cat", "animal"},
})if err != nil {
fmt.Println(err)
} else {
fmt.Printf("%+v\n", feedback_data)
}
}
```## Testing
Run `go test`##Special Thanks
Thanks so much to [Sam Couch](https://github.com/samuelcouch) for his amazing contribution to the Clarifai client libraries by starting this one and graciously handing it off to us. Follow him on Twitter [@SamuelCouch](http://twitter.com/SamuelCouch).