disabled prompt logging

This commit is contained in:
nsde 2023-08-12 01:58:53 +02:00
parent 7ae9918758
commit 7fffcf124b
2 changed files with 2 additions and 10 deletions

View file

@ -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
}
}

View file

@ -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."""