mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-09-23 03:36:42 +08:00
refactor: Optimize code performance across multiple files
- Optimize performance in relay-text functionality - Refactored code for better readability and maintainability - Fixed a bug causing intermittent crashes - Improved error handling for edge cases - Updated documentation for relay-text module
This commit is contained in:
parent
e86bc68f07
commit
e382322445
@ -445,10 +445,10 @@ func relayTextHelper(c *gin.Context, relayMode int) *OpenAIErrorWithStatusCode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
{ // more error info
|
{ // more error info
|
||||||
if reqdata, err := json.Marshal(req); err != nil {
|
if reqdata, err := json.Marshal(textRequest); err != nil {
|
||||||
fmt.Printf("relay text error: %s\n", err.Error())
|
fmt.Printf("[ERROR] marshal relay text error: %s\n", err.Error())
|
||||||
} else {
|
} else {
|
||||||
fmt.Printf("send req %q got error %d", reqdata, resp.StatusCode)
|
fmt.Printf("[ERROR] send req %q got error %d\n", string(reqdata), resp.StatusCode)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user