diff --git a/service/generalModel/openai.go b/service/generalModel/openai.go index 0c2ab57..b8dc5d1 100644 --- a/service/generalModel/openai.go +++ b/service/generalModel/openai.go @@ -57,7 +57,9 @@ func OpenAI(modelParam proto.ModelParam, imCtx *proto.IMParamContext, platform s chunk.Created = -1 // 这里由于没有返回结束标志,所以用该字段来判断 } if len(chunk.Choices) > 0 { - println(chunk.Choices[0].Delta.Content) + if proto.Config.LOG_OUTPUT { + log.Printf("openai_%s stream msg:%s\n", platform, chunk.Choices[0].Delta.Content) + } answer += chunk.Choices[0].Delta.Content tokens = chunk.Usage.TotalTokens PromptTokens = chunk.Usage.PromptTokens diff --git a/service/tongyi.go b/service/tongyi.go index 53bbba5..7f7e50f 100644 --- a/service/tongyi.go +++ b/service/tongyi.go @@ -48,7 +48,9 @@ func Tongyi(modelParam proto.ModelParam, imCtx *proto.IMParamContext) { chunk.Created = -1 // 这里由于没有返回结束标志,所以用该字段来判断 } if len(chunk.Choices) > 0 { - println(chunk.Choices[0].Delta.Content) + if proto.Config.LOG_OUTPUT { + log.Printf("tongyi stream msg:%s\n", chunk.Choices[0].Delta.Content) + } answer += chunk.Choices[0].Delta.Content tokens = chunk.Usage.TotalTokens PromptTokens = chunk.Usage.PromptTokens