-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0be8fe0
commit 3b4e708
Showing
5 changed files
with
43 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ deploy: | |
|
||
service: | ||
name: /generate | ||
port: 8000 | ||
port: 6701 | ||
request: | ||
names: | ||
- prompt | ||
|
19 changes: 19 additions & 0 deletions
19
tests/functional_tests/test_cases/serve/build_dag/test_call.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import unittest | ||
import requests | ||
|
||
class TestAPI(unittest.TestCase): | ||
def test_generate_endpoint(self): | ||
url = "http://127.0.0.1:6701/generate" | ||
headers = {"Content-Type": "application/json", "accept": "application/json"} | ||
test_data = {"prompt": "Introduce BAAI."} | ||
|
||
response = requests.post(url, headers=headers, json=test_data) | ||
|
||
self.assertEqual(response.status_code, 200, | ||
f"Expected status code 200, got {response.status_code}. Response: {response.text}") | ||
|
||
self.assertGreater(len(response.text), 0, | ||
"Generated text should not be empty") | ||
|
||
if __name__ == '__main__': | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters