module
Version:
v0.0.1
Opens a new window with list of versions in this module.
Published: Jun 8, 2023
License: MIT
Opens a new window with license information.
README
¶
MINIMAX-SDK
大语言模型 MiniMax API
😎点击查看官方文档
功能及特点
- 全接口字段注释
- Chatcompletion 文本对话接口
- Embeddings 向量化接口
- T2A 文本转语音接口
- 无缝对接官方文档:单轮问答、历史记忆问答、流返回
使用方法
- 访问 MiniMax 管理后台。
- 获取取 groupID 和 API_token
- 参考下面示例
示例
package main
import (
"context"
"fmt"
"os"
textv1 "github.com/ConnectAI-E/go-minimax/gen/go/minimax/text/v1"
"github.com/ConnectAI-E/go-minimax/minimax"
)
//init client
func main() {
ctx := context.Background()
client, _ := minimax.New(
minimax.WithApiToken(os.Getenv("TEST_MINIMAX_API_TOKEN")),
minimax.WithGroupId(os.Getenv("TEST_MINIMAX_GROUP_ID")),
)
//chat
req := &textv1.ChatCompletionsRequest{
Messages: []*textv1.Message{
{
SenderType: "USER",
Text: "hi~",
},
},
Model: "abab5-chat",
Temperature: 0.7,
}
res, _ := client.ChatCompletions(ctx, req)
fmt.Println(res.Choices) // output: 你好!有什么我可以帮助你的吗?
}
Directories
¶
gen
|
|
|
Package textv1 is a reverse proxy. |
|
|
|
|
pkg
|
|
|
|
Click to show internal directories.
Click to hide internal directories.