Skip to content

bianjieai/avata-sdk-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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...)