mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-09 02:03:42 +08:00
feat: Handle OpenAI requests depending on the model type
- Update `golang.org/x/image` and `golang.org/x/net` to their latest versions. - Convert the request to the correct request type based on the model. - Handle the request and response differently depending on the API type.
This commit is contained in:
@@ -489,7 +489,11 @@ func relayTextHelper(c *gin.Context, relayMode int) *OpenAIErrorWithStatusCode {
|
||||
model.UpdateChannelUsedQuota(channelId, quota)
|
||||
}
|
||||
|
||||
if os.Getenv("LLM_CONSERVATION_AUDIT") != "" {
|
||||
if os.Getenv("LLM_CONSERVATION_AUDIT") != "" &&
|
||||
textRequest.Model != "" ||
|
||||
textRequest.MaxTokens != 0 ||
|
||||
len(textRequest.Messages) != 0 ||
|
||||
textResponse.Content != "" {
|
||||
go func() {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
|
||||
defer cancel()
|
||||
|
||||
Reference in New Issue
Block a user