@@ -25,6 +25,7 @@ public class AIApiTest extends TestClient {
2525 private static final long userId = 2L ;
2626 private static final long customPlaceholderId = 2L ;
2727 private static final long aiPromptId = 3L ;
28+ private static final long providerId = 0L ;
2829 private static final long progress = 100L ;
2930 private static final int year = 119 ;
3031 private static final int month = Calendar .SEPTEMBER ;
@@ -64,6 +65,7 @@ public class AIApiTest extends TestClient {
6465 private static final String AI_PROMPT_COMPLETION = "%s/users/%d/ai/prompts/%d/completions/%s" ;
6566 private static final String AI_PROMPT_COMPLETION_DOWNLOAD = "%s/users/%d/ai/prompts/%d/completions/%s/download" ;
6667 private static final String PROXY_CHAT = "%s/users/%d/ai/providers/%d/chat/completions" ;
68+ private static final String LIST_SUPPORTED_AI_PROVIDER_MODELS = "%s/users/%d/ai/providers/supported-models" ;
6769
6870 @ Override
6971 public List <RequestMock > getMocks () {
@@ -103,7 +105,8 @@ public List<RequestMock> getMocks() {
103105 RequestMock .build (String .format (AI_PROMPT , this .url , userId , aiPromptId ), HttpGet .METHOD_NAME , "api/ai/promptResponse.json" ),
104106 RequestMock .build (String .format (AI_PROMPT , this .url , userId , aiPromptId ), HttpDelete .METHOD_NAME ),
105107 RequestMock .build (String .format (AI_PROMPT , this .url , userId , aiPromptId ), HttpPatch .METHOD_NAME , "api/ai/editPromptRequest.json" , "api/ai/promptResponse.json" ),
106- RequestMock .build (String .format (PROXY_CHAT , this .url , userId , aiPromptId ), HttpPost .METHOD_NAME , "api/ai/proxyChatCompletionRequest.json" , "api/ai/proxyChatCompletionResponse.json" )
108+ RequestMock .build (String .format (PROXY_CHAT , this .url , userId , aiPromptId ), HttpPost .METHOD_NAME , "api/ai/proxyChatCompletionRequest.json" , "api/ai/proxyChatCompletionResponse.json" ),
109+ RequestMock .build (String .format (LIST_SUPPORTED_AI_PROVIDER_MODELS , this .url , userId ), HttpGet .METHOD_NAME , "api/ai/listSupportedAiProviderModels.json" )
107110 );
108111 }
109112
@@ -515,4 +518,17 @@ public void createProxyChatCompletionTest() {
515518
516519 assertEquals (proxyChatCompletion .getData ().size (), 0 );
517520 }
521+
522+ @ Test
523+ public void listSupportedAiProviderModelsTest () {
524+ ResponseList <AiSupportedModel > response = this .getAiApi ().listSupportedAiProviderModels (userId , null , null , null , null , null );
525+
526+ assertEquals (1 , response .getData ().size ());
527+ assertEquals (providerId , response .getData ().get (0 ).getData ().getProviderId ());
528+ assertTrue (response .getData ().get (0 ).getData ().getFeatures ().getStreaming ());
529+ assertEquals (new Date (year , Calendar .AUGUST , 24 , 14 , 15 , 22 ), response .getData ().get (0 ).getData ().getKnowledgeCutoff ());
530+ assertTrue (response .getData ().get (0 ).getData ().getModalities ().getInput ().getText ());
531+ assertTrue (response .getData ().get (0 ).getData ().getModalities ().getOutput ().getImage ());
532+ assertEquals (0.1 , response .getData ().get (0 ).getData ().getPrice ().getInput ());
533+ }
518534}
0 commit comments