Documentation ¶
Overview ¶
Package ai 智能接口
Index ¶
- func AICrop(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
- func AddVoiceToRecoForText(ctx *offiaccount.OffiAccount, media string, params url.Values) (resp []byte, err error)
- func OCRBankcard(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
- func OCRBizLicense(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
- func OCRCommon(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
- func OCRDrivingLicense(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
- func OCRIDCard(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
- func QRCode(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
- func QueryRecoResultForText(ctx *offiaccount.OffiAccount, payload []byte, params url.Values) (resp []byte, err error)
- func Semantic(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
- func SuperResolution(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
- func TranslateContent(ctx *offiaccount.OffiAccount, payload []byte, params url.Values) (resp []byte, err error)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AICrop ¶
func AICrop(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
图片智能裁剪
See: https://developers.weixin.qq.com/doc/offiaccount/Intelligent_Interface/Img_Proc.html
POST https://api.weixin.qq.com/cv/img/aicrop?img_url=ENCODE_URL&access_token=ACCESS_TOCKEN
Example ¶
package main import ( "fmt" "github.com/fastwego/offiaccount" "github.com/fastwego/offiaccount/apis/ai" ) func main() { var ctx *offiaccount.OffiAccount payload := []byte("{}") resp, err := ai.AICrop(ctx, payload) fmt.Println(resp, err) }
Output:
func AddVoiceToRecoForText ¶
func AddVoiceToRecoForText(ctx *offiaccount.OffiAccount, media string, params url.Values) (resp []byte, err error)
提交语音
See: https://developers.weixin.qq.com/doc/offiaccount/Intelligent_Interface/AI_Open_API.html
Example ¶
package main import ( "fmt" "net/url" "github.com/fastwego/offiaccount" "github.com/fastwego/offiaccount/apis/ai" ) func main() { var ctx *offiaccount.OffiAccount media := "" params := url.Values{} resp, err := ai.AddVoiceToRecoForText(ctx, media, params) fmt.Println(resp, err) }
Output:
func OCRBankcard ¶
func OCRBankcard(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
银行卡OCR识别
See: https://developers.weixin.qq.com/doc/offiaccount/Intelligent_Interface/OCR.html
POST https://api.weixin.qq.com/cv/ocr/bankcard
Example ¶
package main import ( "fmt" "github.com/fastwego/offiaccount" "github.com/fastwego/offiaccount/apis/ai" ) func main() { var ctx *offiaccount.OffiAccount payload := []byte("{}") resp, err := ai.OCRBankcard(ctx, payload) fmt.Println(resp, err) }
Output:
func OCRBizLicense ¶
func OCRBizLicense(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
营业执照OCR识别
See: https://developers.weixin.qq.com/doc/offiaccount/Intelligent_Interface/OCR.html
POST https://api.weixin.qq.com/cv/ocr/bizlicense?img_url=ENCODE_URL&access_token=ACCESS_TOCKEN
Example ¶
package main import ( "fmt" "github.com/fastwego/offiaccount" "github.com/fastwego/offiaccount/apis/ai" ) func main() { var ctx *offiaccount.OffiAccount payload := []byte("{}") resp, err := ai.OCRBizLicense(ctx, payload) fmt.Println(resp, err) }
Output:
func OCRCommon ¶
func OCRCommon(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
通用印刷体OCR识别
See: https://developers.weixin.qq.com/doc/offiaccount/Intelligent_Interface/OCR.html
POST https://api.weixin.qq.com/cv/ocr/comm?img_url=ENCODE_URL&access_token=ACCESS_TOCKEN
Example ¶
package main import ( "fmt" "github.com/fastwego/offiaccount" "github.com/fastwego/offiaccount/apis/ai" ) func main() { var ctx *offiaccount.OffiAccount payload := []byte("{}") resp, err := ai.OCRCommon(ctx, payload) fmt.Println(resp, err) }
Output:
func OCRDrivingLicense ¶
func OCRDrivingLicense(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
行驶证/驾驶证 OCR识别
See: https://developers.weixin.qq.com/doc/offiaccount/Intelligent_Interface/OCR.html
POST https://api.weixin.qq.com/cv/ocr/drivinglicense?img_url=ENCODE_URL&access_token=ACCESS_TOCKEN
Example ¶
package main import ( "fmt" "github.com/fastwego/offiaccount" "github.com/fastwego/offiaccount/apis/ai" ) func main() { var ctx *offiaccount.OffiAccount payload := []byte("{}") resp, err := ai.OCRDrivingLicense(ctx, payload) fmt.Println(resp, err) }
Output:
func OCRIDCard ¶
func OCRIDCard(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
身份证OCR识别
See: https://developers.weixin.qq.com/doc/offiaccount/Intelligent_Interface/OCR.html
POST https://api.weixin.qq.com/cv/ocr/idcard?img_url=ENCODE_URL&access_token=ACCESS_TOCKEN
Example ¶
package main import ( "fmt" "github.com/fastwego/offiaccount" "github.com/fastwego/offiaccount/apis/ai" ) func main() { var ctx *offiaccount.OffiAccount payload := []byte("{}") resp, err := ai.OCRIDCard(ctx, payload) fmt.Println(resp, err) }
Output:
func QRCode ¶
func QRCode(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
二维码/条码识别
See: https://developers.weixin.qq.com/doc/offiaccount/Intelligent_Interface/Img_Proc.html
POST https://api.weixin.qq.com/cv/img/qrcode?img_url=ENCODE_URL&access_token=ACCESS_TOCKEN
Example ¶
package main import ( "fmt" "github.com/fastwego/offiaccount" "github.com/fastwego/offiaccount/apis/ai" ) func main() { var ctx *offiaccount.OffiAccount payload := []byte("{}") resp, err := ai.QRCode(ctx, payload) fmt.Println(resp, err) }
Output:
func QueryRecoResultForText ¶
func QueryRecoResultForText(ctx *offiaccount.OffiAccount, payload []byte, params url.Values) (resp []byte, err error)
获取语音识别结果
See: https://developers.weixin.qq.com/doc/offiaccount/Intelligent_Interface/AI_Open_API.html
Example ¶
package main import ( "fmt" "net/url" "github.com/fastwego/offiaccount" "github.com/fastwego/offiaccount/apis/ai" ) func main() { var ctx *offiaccount.OffiAccount payload := []byte("{}") params := url.Values{} resp, err := ai.QueryRecoResultForText(ctx, payload, params) fmt.Println(resp, err) }
Output:
func Semantic ¶
func Semantic(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
语义理解
POST https://api.weixin.qq.com/semantic/semproxy/search?access_token=YOUR_ACCESS_TOKEN
Example ¶
package main import ( "fmt" "github.com/fastwego/offiaccount" "github.com/fastwego/offiaccount/apis/ai" ) func main() { var ctx *offiaccount.OffiAccount payload := []byte("{}") resp, err := ai.Semantic(ctx, payload) fmt.Println(resp, err) }
Output:
func SuperResolution ¶
func SuperResolution(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)
图片高清化
See: https://developers.weixin.qq.com/doc/offiaccount/Intelligent_Interface/Img_Proc.html
POST https://api.weixin.qq.com/cv/img/superresolution?img_url=ENCODE_URL&access_token=ACCESS_TOCKEN
Example ¶
package main import ( "fmt" "github.com/fastwego/offiaccount" "github.com/fastwego/offiaccount/apis/ai" ) func main() { var ctx *offiaccount.OffiAccount payload := []byte("{}") resp, err := ai.SuperResolution(ctx, payload) fmt.Println(resp, err) }
Output:
func TranslateContent ¶
func TranslateContent(ctx *offiaccount.OffiAccount, payload []byte, params url.Values) (resp []byte, err error)
微信翻译
See: https://developers.weixin.qq.com/doc/offiaccount/Intelligent_Interface/AI_Open_API.html
Example ¶
package main import ( "fmt" "net/url" "github.com/fastwego/offiaccount" "github.com/fastwego/offiaccount/apis/ai" ) func main() { var ctx *offiaccount.OffiAccount payload := []byte("{}") params := url.Values{} resp, err := ai.TranslateContent(ctx, payload, params) fmt.Println(resp, err) }
Output:
Types ¶
This section is empty.