-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdoc.go
More file actions
44 lines (34 loc) · 1.18 KB
/
doc.go
File metadata and controls
44 lines (34 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
Captionbot is a simple API wrapper for https://www.captionbot.ai/
Usage
package main
import (
"fmt"
"os"
"github.com/nhatbui/captionbot"
)
func main() {
bot, err := captionbot.New()
if err != nil {
fmt.Printf("error instantiating bot %s\n", err)
os.Exit(1)
}
// caption a remote image by provideing a URL
imgURL := "http://www.nhatqbui.com/assets/me.jpg"
caption, err := bot.URLCaption(imgURL)
if err != nil {
fmt.Printf("error uploading caption %s\n", err)
os.Exit(1)
}
fmt.Println(caption)
// caption a local image by uploading it
imgFile := "./sample.jpg"
caption, err = bot.UploadCaption(imgFile)
if err != nil {
fmt.Printf("error uploading caption %s\n", err)
os.Exit(1)
}
fmt.Println(caption)
}
*/
package captionbot