ai

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package ai 智能接口

Index

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

POST(@media) https://api.weixin.qq.com/cgi-bin/media/voice/addvoicetorecofortext?access_token=ACCESS_TOKEN&format=&voice_id=xxxxxx&lang=zh_CN

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

POST https://api.weixin.qq.com/cgi-bin/media/voice/queryrecoresultfortext?access_token=ACCESS_TOKEN&voice_id=xxxxxx&lang=zh_CN

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)

语义理解

See: https://developers.weixin.qq.com/doc/offiaccount/Intelligent_Interface/Natural_Language_Processing.html

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

POST https://api.weixin.qq.com/cgi-bin/media/voice/translatecontent?access_token=ACCESS_TOKEN&lfrom=xxx&lto=xxx

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL