mirror of
https://github.com/NovaOSS/nova-api.git
synced 2024-11-25 18:33:57 +01:00
disabled prompt logging
This commit is contained in:
parent
7ae9918758
commit
7fffcf124b
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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."""
|
||||
|
|
Loading…
Reference in a new issue