Some fixes on model server (#362)

* Some fixes on model server

* Remove prompt_prefilling message

* Fix logging

* Fix poetry issues

* Improve logging and update the support for text truncation

* Fix tests

* Fix tests

* Fix tests

* Fix modelserver tests

* Update modelserver tests
This commit is contained in:
Shuguang Chen 2025-01-10 16:45:36 -08:00 committed by GitHub
parent ebda682b30
commit 88a02dc478
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 1090 additions and 1666 deletions

View file

@ -1,13 +1,9 @@
import json
import os
import pytest
import requests
from deepdiff import DeepDiff
import logging
import yaml
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
MODEL_SERVER_ENDPOINT = os.getenv(
"MODEL_SERVER_ENDPOINT", "http://localhost:51000/function_calling"
@ -37,13 +33,9 @@ def test_model_server(test_data):
response = requests.post(MODEL_SERVER_ENDPOINT, json=input)
assert response.status_code == 200
# print(json.dumps(response.json()))
# ensure that response is json
assert response.headers["content-type"] == "application/json"
response_json = response.json()
assert response_json
metadata = response_json.get("metadata", [])
metadata = response_json.get("metadata", {})
assert (metadata["hallucination"].lower() == "true") == expected[0]["hallucination"]
assert (metadata["prompt_prefilling"].lower() == "true") == expected[0][
"prompt_prefilling"
]