Skip to content

Latest commit

 

History

History
48 lines (37 loc) · 1.41 KB

README.md

File metadata and controls

48 lines (37 loc) · 1.41 KB

avata-sdk-go

快速开始

引入依赖

 go get -u github.com/bianjieai/avata-sdk-go/v3

创建和使用客户端

import (
	"time"
	
	"github.com/sirupsen/logrus"

	sdk "github.com/bianjieai/avata-sdk-go/v3"
	"github.com/bianjieai/avata-sdk-go/v3/configs"
)
    // 非必填参数(不填写将使用默认值)
    log := logrus.New()
    log.SetLevel(logrus.DebugLevel)
    
    options := []configs.Options{
		configs.Logger(log), // 日志
		configs.HttpTimeout(15 * time.Second), // 响应超时时间,默认: 10s
    }
    
    client = sdk.NewClient("域名,不同环境对应不同的域名,如测试环境: https://stage.apis.avata.bianjie.ai", "项目参数 API KEY", "项目参数 API SECRET", options...)