diff --git a/api/db/logs.py b/api/db/logs.py index 932370b..caf2baf 100644 --- a/api/db/logs.py +++ b/api/db/logs.py @@ -34,13 +34,6 @@ async def log_api_request(user: dict, incoming_request, target_url: str): if 'JSONDecodeError' in str(exc): pass - last_prompt = None - if 'messages' in payload: - last_prompt = payload['messages'][-1]['content'][:50] - - if len(last_prompt) == 50: - last_prompt += '...' - model = payload.get('model') ip_address = await network.get_ip(incoming_request) useragent = await replacer(incoming_request.headers.get('User-Agent'), UA_SIMPLIFY) @@ -56,7 +49,6 @@ async def log_api_request(user: dict, incoming_request, target_url: str): }, 'details': { 'model': model, - 'last_prompt': last_prompt, 'target_url': target_url } } diff --git a/tests/__main__.py b/tests/__main__.py index 3056715..02932b3 100644 --- a/tests/__main__.py +++ b/tests/__main__.py @@ -83,9 +83,9 @@ def test_all(): # print(test_server()) # print(test_api()) - # print(test_library()) + print(test_library()) # print(test_library_moderation()) - print(test_models()) + # print(test_models()) def test_api_moderation(model: str=MODEL, messages: List[dict]=None) -> dict: """Tests an API api_endpoint."""