"git@web.lueluesay.top:chenxi/sub2api.git" did not exist on "7ade9baa1559c461dbb103f150377917ad5a2c20"
Commit a9e256ce authored by yangjianbo's avatar yangjianbo
Browse files

fix(openai): 修复 usage 为空导致 panic(P0-02)

parent 7e1674e4
...@@ -969,6 +969,10 @@ func (s *OpenAIGatewayService) Forward(ctx context.Context, c *gin.Context, acco ...@@ -969,6 +969,10 @@ func (s *OpenAIGatewayService) Forward(ctx context.Context, c *gin.Context, acco
} }
} }
if usage == nil {
usage = &OpenAIUsage{}
}
reasoningEffort := extractOpenAIReasoningEffort(reqBody, originalModel) reasoningEffort := extractOpenAIReasoningEffort(reqBody, originalModel)
return &OpenAIForwardResult{ return &OpenAIForwardResult{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment