Skip to content

Commit

Permalink
Add test case for POST /v1/embeddings (#63)
Browse files Browse the repository at this point in the history
Signed-off-by: Tyson Dai <[email protected]>
  • Loading branch information
Murkeee authored Aug 23, 2024
1 parent 5cdb5f4 commit e3c7ec7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions example/test_apis.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ def test_inference_by_request_stream(self):
res=requests.post(url=self.base_url+"/v1/chat/completions", json=data,headers={"Content-Type": "application/json", "Authorization":"Bearer no-key"},)
self.assertEqual(res.status_code, 200)

def test_embedding_api(self):
data = {
"input": "Hello, world!",
"model": "all-MiniLM-L6-v2"
}
res = requests.post(url=self.base_url+"/v1/embeddings", json=data, headers={"Content-Type": "application/json", "Authorization":"Bearer no-key"})
self.assertEqual(res.status_code, 200)

def test_api_key(self):
res=requests.get(url=self.base_url+"/v1/token/api-key")
Expand Down

0 comments on commit e3c7ec7

Please sign in to comment.