@@ -391,7 +391,7 @@ func TestOpenAIHandler_Chat(t *testing.T) {
391391 ClusterID : "test-cls" ,
392392 }, nil )
393393 tester .mocks .openAIComp .EXPECT ().GetModelByID (mock .Anything , "testuser" , "model1:svc1" ).Return (model , nil )
394- tester .mocks .openAIComp .EXPECT ().CheckBalance (mock .Anything , "testuser" , model , "" ).Return (nil )
394+ tester .mocks .openAIComp .EXPECT ().CheckBalance (mock .Anything , "testuser" ).Return (nil )
395395 expectReq := ChatCompletionRequest {}
396396 _ = json .Unmarshal (body , & expectReq )
397397 tester .mocks .moderationComp .EXPECT ().CheckChatPrompts (mock .Anything , expectReq .Messages , "testuuid:" + model .ID ).
@@ -435,7 +435,7 @@ func TestOpenAIHandler_Chat(t *testing.T) {
435435 ClusterID : "test-cls" ,
436436 }, nil )
437437 tester .mocks .openAIComp .EXPECT ().GetModelByID (mock .Anything , "testuser" , "model1:svc1" ).Return (model , nil )
438- tester .mocks .openAIComp .EXPECT ().CheckBalance (mock .Anything , "testuser" , model , "" ).Return (nil )
438+ tester .mocks .openAIComp .EXPECT ().CheckBalance (mock .Anything , "testuser" ).Return (nil )
439439 expectReq := ChatCompletionRequest {}
440440 _ = json .Unmarshal (body , & expectReq )
441441 tester .mocks .moderationComp .EXPECT ().CheckChatPrompts (mock .Anything , expectReq .Messages , "testuuid:" + model .ID ).
@@ -479,7 +479,7 @@ func TestOpenAIHandler_Chat(t *testing.T) {
479479 ClusterID : "test-cls" ,
480480 }, nil )
481481 tester .mocks .openAIComp .EXPECT ().GetModelByID (mock .Anything , "testuser" , "model1:svc1" ).Return (model , nil )
482- tester .mocks .openAIComp .EXPECT ().CheckBalance (mock .Anything , "testuser" , model , "" ).Return (nil )
482+ tester .mocks .openAIComp .EXPECT ().CheckBalance (mock .Anything , "testuser" ).Return (nil )
483483 expectReq := ChatCompletionRequest {}
484484 _ = json .Unmarshal (body , & expectReq )
485485 tester .mocks .moderationComp .EXPECT ().CheckChatPrompts (mock .Anything , expectReq .Messages , "testuuid:" + model .ID ).
@@ -540,7 +540,7 @@ func TestOpenAIHandler_Chat(t *testing.T) {
540540 ClusterID : "test-cls" ,
541541 }, nil )
542542 tester .mocks .openAIComp .EXPECT ().GetModelByID (mock .Anything , "testuser" , "model1:svc1" ).Return (model , nil )
543- tester .mocks .openAIComp .EXPECT ().CheckBalance (mock .Anything , "testuser" , model , "" ).Return (nil )
543+ tester .mocks .openAIComp .EXPECT ().CheckBalance (mock .Anything , "testuser" ).Return (nil )
544544 expectReq := ChatCompletionRequest {}
545545 _ = json .Unmarshal (body , & expectReq )
546546 tester .mocks .moderationComp .EXPECT ().CheckChatPrompts (mock .Anything , expectReq .Messages , "testuuid:" + model .ID ).
@@ -740,7 +740,7 @@ func TestOpenAIHandler_Embedding(t *testing.T) {
740740 Return (tokenCounter ).Once ()
741741 tester .mocks .openAIComp .EXPECT ().GetModelByID (mock .Anything , "testuser" , "model1" ).
742742 Return (model , nil )
743- tester .mocks .openAIComp .EXPECT ().CheckBalance (mock .Anything , "testuser" , model , "" ).Return (nil )
743+ tester .mocks .openAIComp .EXPECT ().CheckBalance (mock .Anything , "testuser" ).Return (nil )
744744 tester .mocks .openAIComp .EXPECT ().RecordUsage (mock .Anything , "testuuid" , model , mock .Anything , mock .Anything ).RunAndReturn (
745745 func (ctx context.Context , userID string , model * types.Model , counter token.Counter , sceneValue string ) error {
746746 wg .Done ()
@@ -877,7 +877,7 @@ func TestOpenAIHandler_GenerateImage(t *testing.T) {
877877 Endpoint : "https://api.example.com/images/generations" ,
878878 }
879879 tester .mocks .openAIComp .EXPECT ().GetModelByID (mock .Anything , "testuser" , "test-model" ).Return (model , nil )
880- tester .mocks .openAIComp .EXPECT ().CheckBalance (mock .Anything , "testuser" , model , mock . Anything ).Return (nil )
880+ tester .mocks .openAIComp .EXPECT ().CheckBalance (mock .Anything , "testuser" ).Return (nil )
881881 tester .mocks .moderationComp .EXPECT ().CheckImagePrompts (mock .Anything , "sensitive prompt" , "testuuid" ).Return (& rpc.CheckResult {IsSensitive : true }, nil )
882882
883883 tester .handler .GenerateImage (c )
@@ -910,7 +910,7 @@ func TestOpenAIHandler_GenerateImage(t *testing.T) {
910910 Endpoint : "https://api.example.com/images/generations" ,
911911 }
912912 tester .mocks .openAIComp .EXPECT ().GetModelByID (mock .Anything , "testuser" , "test-model" ).Return (model , nil )
913- tester .mocks .openAIComp .EXPECT ().CheckBalance (mock .Anything , "testuser" , model , mock . Anything ).Return (nil )
913+ tester .mocks .openAIComp .EXPECT ().CheckBalance (mock .Anything , "testuser" ).Return (nil )
914914 tester .mocks .moderationComp .EXPECT ().CheckImagePrompts (mock .Anything , "test prompt" , "testuuid" ).Return (nil , errors .New ("moderation service error" ))
915915
916916 tester .handler .GenerateImage (c )
0 commit comments