mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-16 13:13:41 +08:00
Compare commits
4 Commits
16b490a666
...
fe90d10e12
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fe90d10e12 | ||
|
|
8df4a2670b | ||
|
|
a78360efd8 | ||
|
|
8f6b13c2fe |
@@ -72,7 +72,7 @@ _✨ 通过标准的 OpenAI API 格式访问所有的大模型,开箱即用
|
||||
+ [x] [Anthropic Claude 系列模型](https://anthropic.com) (支持 AWS Claude)
|
||||
+ [x] [Google PaLM2/Gemini 系列模型](https://developers.generativeai.google)
|
||||
+ [x] [Mistral 系列模型](https://mistral.ai/)
|
||||
+ [x] [字节跳动豆包大模型](https://console.volcengine.com/ark/region:ark+cn-beijing/model)
|
||||
+ [x] [字节跳动豆包大模型(火山引擎)](https://www.volcengine.com/experience/ark?utm_term=202502dsinvite&ac=DSASUQY5&rc=2QXCA1VI)
|
||||
+ [x] [百度文心一言系列模型](https://cloud.baidu.com/doc/WENXINWORKSHOP/index.html)
|
||||
+ [x] [阿里通义千问系列模型](https://help.aliyun.com/document_detail/2400395.html)
|
||||
+ [x] [讯飞星火认知大模型](https://www.xfyun.cn/doc/spark/Web.html)
|
||||
|
||||
@@ -12,6 +12,22 @@ const (
|
||||
)
|
||||
|
||||
func Notify(by string, title string, description string, content string) error {
|
||||
|
||||
if by == ByAll {
|
||||
var errMsgs []string
|
||||
if err := SendEmail(title, config.RootUserEmail, content); err != nil {
|
||||
errMsgs = append(errMsgs, fmt.Sprintf("failed to send email: %v", err))
|
||||
}
|
||||
if err := SendMessage(title, description, content); err != nil {
|
||||
errMsgs = append(errMsgs, fmt.Sprintf("failed to send message: %v", err))
|
||||
}
|
||||
|
||||
if len(errMsgs) > 0 {
|
||||
return fmt.Errorf("multiple errors occurred: %v", errMsgs)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
if by == ByEmail {
|
||||
return SendEmail(title, config.RootUserEmail, content)
|
||||
}
|
||||
|
||||
@@ -266,7 +266,7 @@ func testChannels(ctx context.Context, notify bool, scope string) error {
|
||||
if notify {
|
||||
err := message.Notify(message.ByAll, "渠道测试完成", "", "渠道测试完成,如果没有收到禁用通知,说明所有渠道都正常")
|
||||
if err != nil {
|
||||
logger.SysError(fmt.Sprintf("failed to send email: %s", err.Error()))
|
||||
logger.SysError(fmt.Sprintf("failed to send notify: %s", err.Error()))
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
Reference in New Issue
Block a user