(func)
| 6 | from app.config import EVENTS_ENGINE |
| 7 | |
| 8 | def failsoft(func): |
| 9 | @wraps(func) |
| 10 | def wrapper(*args, **kwargs): |
| 11 | try: |
| 12 | result = func(*args, **kwargs) |
| 13 | except Exception as e: |
| 14 | print('error logging with ', e) |
| 15 | result = None |
| 16 | return result |
| 17 | return wrapper |
| 18 | |
| 19 | def log_apicall(duration, provider, model, input_tokens, output_tokens, service, purpose, session_id=None, success=True, log_message=None): |
| 20 | if not EVENTS_ENGINE: |
nothing calls this directly
no outgoing calls
no test coverage detected