{"id":13651134,"url":"https://github.com/ConnectAI-E/Go-Minimax","last_synced_at":"2025-04-22T22:30:30.726Z","repository":{"id":172413578,"uuid":"649252111","full_name":"ConnectAI-E/Go-Minimax","owner":"ConnectAI-E","description":"💸   MiniMax wrapper for Go SDK MINIMAX 大语言模型 golang SDK","archived":false,"fork":false,"pushed_at":"2023-06-22T09:26:20.000Z","size":43,"stargazers_count":17,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-20T01:33:06.702Z","etag":null,"topics":["connect-ai","go","golang","minimax"],"latest_commit_sha":null,"homepage":"https://api.minimax.chat/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ConnectAI-E.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-06-04T09:20:04.000Z","updated_at":"2025-03-01T02:43:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"c7b4a3b8-920f-48c5-b60c-e0ca00aeb491","html_url":"https://github.com/ConnectAI-E/Go-Minimax","commit_stats":null,"previous_names":["connectai-e/go-minimax"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ConnectAI-E%2FGo-Minimax","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ConnectAI-E%2FGo-Minimax/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ConnectAI-E%2FGo-Minimax/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ConnectAI-E%2FGo-Minimax/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ConnectAI-E","download_url":"https://codeload.github.com/ConnectAI-E/Go-Minimax/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250333856,"owners_count":21413470,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["connect-ai","go","golang","minimax"],"created_at":"2024-08-02T02:00:45.591Z","updated_at":"2025-04-22T22:30:30.705Z","avatar_url":"https://github.com/ConnectAI-E.png","language":"Go","funding_links":[],"categories":["企联AI"],"sub_categories":[],"readme":"\n\n\u003cp align='center'\u003e\n    \u003cimg src='https://github.com/ConnectAI-E/go-minimax/assets/50035229/c87ca385-f9a6-4f81-a0a9-67828af63334' alt='' width='1300'/\u003e\n\u003c/p\u003e\n\n## MINIMAX-SDK\n\u003e 大语言模型 MiniMax API\n\n[😎点击查看官方文档](https://api.minimax.chat/)\n\n### 功能及特点\n\n1. 全接口字段注释\n2. Chatcompletion 文本对话接口\n3. Embeddings 向量化接口\n4. T2A 文本转语音接口\n5. 无缝对接官方文档：单轮问答、历史记忆问答、流返回\n6. 支持Swagger文档 和 ApiFox 文档\n\n### Swagger 文档\n\n- [打开在线Swagger编辑器](https://editor.swagger.io/)\n- 导入[Swagger Api 文档](./output/apis.swagger.yaml)\n\n \u003cimg width=\"800\" alt=\"image\" src=\"https://github.com/ConnectAI-E/Go-Minimax/assets/50035229/cafe6492-2375-4b6f-9dcf-e651c06aa94a\"\u003e\n\n\n### 使用方法\n\n1. 访问 [MiniMax](https://api.minimax.chat/document/guides/example) 管理后台。\n2. 获取取 [groupID](https://api.minimax.chat/basic-information) 和 [API_token](https://api.minimax.chat/basic-information/interface-key)\n3. 参考下面示例\n\n### 示例\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\ttextv1 \"github.com/ConnectAI-E/go-minimax/gen/go/minimax/text/v1\"\n\t\"github.com/ConnectAI-E/go-minimax/minimax\"\n)\n\n\n\nfunc main() {\n\tctx := context.Background()\n\t\n\t//init client\n\tclient, _ := minimax.New(\n\t\tminimax.WithApiToken(os.Getenv(\"TEST_MINIMAX_API_TOKEN\")),\n\t\tminimax.WithGroupId(os.Getenv(\"TEST_MINIMAX_GROUP_ID\")),\n\t)\n\n\t//chat\n\treq := \u0026textv1.ChatCompletionsRequest{\n\t\tMessages: []*textv1.Message{\n\t\t\t{\n\t\t\t\tSenderType: \"USER\",\n\t\t\t\tText:       \"hi~\",\n\t\t\t},\n\t\t},\n\t\tModel:       \"abab5-chat\",\n\t\tTemperature: 0.7,\n\t}\n\tres, _ := client.ChatCompletions(ctx, req)\n\n\tfmt.Println(res.Choices) // output: 你好！有什么我可以帮助你的吗？\n}\n\n```\n\n\n### 快速上手:\n\n\u003cdetails\u003e\n\u003csummary\u003eMiniMax completion\u003c/summary\u003e\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\ttextv1 \"github.com/ConnectAI-E/go-minimax/gen/go/minimax/text/v1\"\n\t\"github.com/ConnectAI-E/go-minimax/minimax\"\n)\n\n\n\nfunc main() {\n\tctx := context.Background()\n\t\n\t//init client\n\tclient, _ := minimax.New(\n\t\tminimax.WithApiToken(os.Getenv(\"TEST_MINIMAX_API_TOKEN\")),\n\t\tminimax.WithGroupId(os.Getenv(\"TEST_MINIMAX_GROUP_ID\")),\n\t)\n\n\t//chat\n\treq := \u0026textv1.ChatCompletionsRequest{\n\t\tMessages: []*textv1.Message{\n\t\t\t{\n\t\t\t\tSenderType: \"USER\",\n\t\t\t\tText:       \"hi~\",\n\t\t\t},\n\t\t},\n\t\tModel:       \"abab5-chat\",\n\t\tTemperature: 0.7,\n\t}\n\tres, _ := client.ChatCompletions(ctx, req)\n\n\tfmt.Println(res.Choices) // output: 你好！有什么我可以帮助你的吗？\n}\n```\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\n\u003csummary\u003eMiniMax stream completion\u003c/summary\u003e\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\ttextv1 \"github.com/ConnectAI-E/go-minimax/gen/go/minimax/text/v1\"\n\t\"github.com/ConnectAI-E/go-minimax/minimax\"\n\t\"io\"\n\t\"os\"\n)\n\n\n\nfunc main() {\n\tctx := context.Background()\n\t\n\t//init client\n\tclient, _ := minimax.New(\n\t\tminimax.WithApiToken(os.Getenv(\"TEST_MINIMAX_API_TOKEN\")),\n\t\tminimax.WithGroupId(os.Getenv(\"TEST_MINIMAX_GROUP_ID\")),\n\t)\n\n\t//chat\n\treq := \u0026textv1.ChatCompletionsRequest{\n\t\tMessages: []*textv1.Message{\n\t\t\t{\n\t\t\t\tSenderType: \"USER\",\n\t\t\t\tText:       \"hi~\",\n\t\t\t},\n\t\t},\n\t\tModel:       \"abab5-chat\",\n\t\tTemperature: 0.7,\n\t}\n\n\tstream, _ := client.ChatCompletionStream(ctx, req)\n\tdefer stream.CloseSend()\n\tfor {\n\t\tresponse, err := stream.Recv()\n\t\tif errors.Is(err, io.EOF) {\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t\tbreak\n\t\t}\n\t\tfmt.Printf(response.Choices[0].Delta + \"\\n\") //嗨！有什么我可以帮助您的吗？\n\t}\n}\n\n\n```\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\n\u003csummary\u003eMiniMax history stream completion\u003c/summary\u003e\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\ttextv1 \"github.com/ConnectAI-E/go-minimax/gen/go/minimax/text/v1\"\n\t\"github.com/ConnectAI-E/go-minimax/minimax\"\n\t\"io\"\n\t\"os\"\n)\n\n\n\nfunc main() {\n\tctx := context.Background()\n\t\n\t//init client\n\tclient, _ := minimax.New(\n\t\tminimax.WithApiToken(os.Getenv(\"TEST_MINIMAX_API_TOKEN\")),\n\t\tminimax.WithGroupId(os.Getenv(\"TEST_MINIMAX_GROUP_ID\")),\n\t)\n\t\n\t//chat\n\treq := \u0026textv1.ChatCompletionsRequest{\n\t\tMessages: []*textv1.Message{\n\t\t\t{\n\t\t\t    \"sender_type\": \"USER\",\n\t\t\t    \"text\": \"路卡，今天在干什么呢？\"\n\t\t\t},\n\t\t\t{\n\t\t\t    \"sender_type\": \"BOT\",\n\t\t\t    \"text\": \"我今天在家里复习功课，准备期末考试呢！\"\n\t\t\t},\n\t\t\t{\n\t\t\t    \"sender_type\": \"USER\",\n\t\t\t    \"text\": \"期末考试怎么样，有把握吗？\"\n\t\t\t}\n\t\t},\n\t\tModel:       \"abab5-chat\",\n\t\tTemperature: 0.7,\n\t}\n\n\tstream, _ := client.ChatCompletionStream(ctx, req)\n\tdefer stream.CloseSend()\n\tfor {\n\t\tresponse, err := stream.Recv()\n\t\tif errors.Is(err, io.EOF) {\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t\tbreak\n\t\t}\n\t\tfmt.Printf(response.Choices[0].Delta + \"\\n\") //放轻松，一切尽在掌握中\n\t}\n}\n\n```\n\u003c/details\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FConnectAI-E%2FGo-Minimax","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FConnectAI-E%2FGo-Minimax","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FConnectAI-E%2FGo-Minimax/lists"}