Git Product home page Git Product logo

qwen-sdk's Introduction

Qwen SDK

GitHub release (latest by date) Go Report Card GitHub license

Qwen SDK 是一个专为开发者打造的便捷工具包,提供了一系列功能强大的API和工具函数,帮助您轻松实现与通义千问平台的集成。

特性

  • 简单易用:Qwen SDK 提供了简单易用的API,帮助您轻松实现与通义千问平台的集成。
  • 功能丰富:Qwen SDK 提供了丰富的API,涵盖了通义千问平台的各项功能。
  • 持续更新:Qwen SDK 持续跟进通义千问平台的最新功能,为您提供全面的开发支持。

安装

在您的Go项目中通过 go get 命令安装Qwen SDK:

go get github.com/xinggaoya/qwen-sdk

或者将它添加到您的项目 go.mod 文件中的依赖列表:

require github.com/xinggaoya/qwen-sdk v1.0.0

快速开始

import "github.com/xinggaoya/qwen-sdk"

func main() {
   // 初始化QWEN聊天机器人客户端,使用您的API密钥
   apiKey := "your api key"
   qwenclient := chat.NewWithDefaultChat(apiKey)

   //qwenclient.QWenModel = "new model"

   // 定义一条消息对话的历史记录
   messages := []qwenmodel.Messages{
   {Role: qwenmodel.ChatUser, Content: "你好"},
   {Role: qwenmodel.ChatBot, Content: "你好!有什么我能为你做的吗?"},
   {Role: qwenmodel.ChatUser, Content: "我想买一件衬衫"},
   }

   // 获取AI对消息的回复
   resp := qwenclient.GetAIReply(messages)

   // 打印收到的回复
   fmt.Printf("收到的回复:%v\n", resp.Output.Text)
}

文档

详细文档及API参考,请访问 Qwen SDK Docs

示例

查看项目中的 /build_test 目录获取更多使用示例。

贡献

欢迎贡献代码、报告问题或提出改进建议!请参阅 CONTRIBUTING.md 获取更多关于参与本项目的指南。

许可证

Qwen SDK 遵循 MIT 许可证。有关详细信息,请参阅 LICENSE 文件。


qwen-sdk's People

Contributors

xinggaoya avatar neoshui avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.