mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-09-19 10:06:37 +08:00
- Refactor error handling using `errors/v2` package for improved error management and formatting - Implement changes in relay/controller/text.go, controller/channel-test.go, controller/relay.go, common/message/email.go, relay/controller/audio.go, controller/channel-billing.go, relay/controller/helper.go, relay/channel/common.go, relay/channel/minimax/main.go, and common/message/main.go - Add package imports and update package paths for better code organization - Replace hardcoded strings with error variables for consistency and readability - Implement secure methods for generating unique Message-ID - Improve SMTP handling and authentication in email.go - Update response handling and error messages for better user experience - Add constant checks and modify functions based on imageRequest parameters in helper.go - Use `http.NewRequest` instead of `fmt.Fprint` for improved request handling in relay/channel/common.go - Update error handling and formatting for better consistency across all files
17 lines
431 B
Go
17 lines
431 B
Go
package minimax
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/Laisky/errors/v2"
|
|
"github.com/songquanpeng/one-api/relay/constant"
|
|
"github.com/songquanpeng/one-api/relay/util"
|
|
)
|
|
|
|
func GetRequestURL(meta *util.RelayMeta) (string, error) {
|
|
if meta.Mode == constant.RelayModeChatCompletions {
|
|
return fmt.Sprintf("%s/v1/text/chatcompletion_v2", meta.BaseURL), nil
|
|
}
|
|
return "", errors.Errorf("unsupported relay mode %d for minimax", meta.Mode)
|
|
}
|