1- from jedi .plugins import pytest
2- from uaclient .api .u .pro .security .fix .cve .plan .v1 import endpoint
3-
41from predictionguard import PredictionGuard
52
63
@@ -13,55 +10,55 @@ def test_models_list():
1310 assert type (response ["data" ][0 ]["id" ]) is str
1411
1512
16- def test_models_list_completion_chat ():
13+ def test_models_list_chat_completion ():
1714 test_client = PredictionGuard ()
1815
1916 response = test_client .models .list (
20- endpoint = "completion- chat"
17+ capability = " chat-completion "
2118 )
2219
2320 assert len (response ["data" ]) > 0
2421 assert type (response ["data" ][0 ]["id" ]) is str
2522
2623
27- def test_models_list_completion ():
24+ def test_models_list_chat_with_image ():
2825 test_client = PredictionGuard ()
2926
3027 response = test_client .models .list (
31- endpoint = "completion "
28+ capability = "chat-with-image "
3229 )
3330
3431 assert len (response ["data" ]) > 0
3532 assert type (response ["data" ][0 ]["id" ]) is str
3633
3734
38- def test_models_list_vision ():
35+ def test_models_list_completion ():
3936 test_client = PredictionGuard ()
4037
4138 response = test_client .models .list (
42- endpoint = "vision "
39+ capability = "completion "
4340 )
4441
4542 assert len (response ["data" ]) > 0
4643 assert type (response ["data" ][0 ]["id" ]) is str
4744
4845
49- def test_models_list_text_embeddings ():
46+ def test_models_list_embedding ():
5047 test_client = PredictionGuard ()
5148
5249 response = test_client .models .list (
53- endpoint = "text-embeddings "
50+ capability = "embedding "
5451 )
5552
5653 assert len (response ["data" ]) > 0
5754 assert type (response ["data" ][0 ]["id" ]) is str
5855
5956
60- def test_models_list_image_embeddings ():
57+ def test_models_list_embedding_with_image ():
6158 test_client = PredictionGuard ()
6259
6360 response = test_client .models .list (
64- endpoint = "image-embeddings "
61+ capability = "embedding-with-image "
6562 )
6663
6764 assert len (response ["data" ]) > 0
@@ -72,19 +69,8 @@ def test_models_list_tokenize():
7269 test_client = PredictionGuard ()
7370
7471 response = test_client .models .list (
75- endpoint = "tokenize"
72+ capability = "tokenize"
7673 )
7774
7875 assert len (response ["data" ]) > 0
7976 assert type (response ["data" ][0 ]["id" ]) is str
80-
81-
82- def test_models_list_fail ():
83- test_client = PredictionGuard ()
84-
85- models_error = ""
86-
87- with pytest .raises (ValueError , match = models_error ):
88- test_client .models .list (
89- endpoint = "fail"
90- )
0 commit comments