Spaces:
Paused
Paused
Update app.py
Browse files65 unmodified lines6667686970717273747576777879808165 unmodified linesdef _log_call_start(func_name: str, **kwargs: Any) -> None:try:compact = {k: _serialize_input(v) for k, v in kwargs.items()}print(f"[TOOL CALL] {func_name} inputs: {json.dumps(compact, ensure_ascii=False)[:800]}", flush=True)except Exception as exc:print(f"[TOOL CALL] {func_name} (failed to log inputs: {exc})", flush=True)def _log_call_end(func_name: str, output_desc: str) -> None:try:print(f"[TOOL RESULT] {func_name} output: {output_desc}", flush=True)except Exception as exc:print(f"[TOOL RESULT] {func_name} (failed to log output: {exc})", flush=True)# Ensure Tools modules can import 'app' when this file is executed as a script# (their code does `from app import ...`).65 unmodified lines66676869707172737475767778798081828365 unmodified linesdef _log_call_start(func_name: str, **kwargs: Any) -> None:try:compact = {k: _serialize_input(v) for k, v in kwargs.items()}# Use sys.__stdout__ to avoid capturing logs in redirected outputprint(f"[TOOL CALL] {func_name} inputs: {json.dumps(compact, ensure_ascii=False)[:800]}", flush=True, file=sys.__stdout__)except Exception as exc:print(f"[TOOL CALL] {func_name} (failed to log inputs: {exc})", flush=True, file=sys.__stdout__)def _log_call_end(func_name: str, output_desc: str) -> None:try:# Use sys.__stdout__ to avoid capturing logs in redirected outputprint(f"[TOOL RESULT] {func_name} output: {output_desc}", flush=True, file=sys.__stdout__)except Exception as exc:print(f"[TOOL RESULT] {func_name} (failed to log output: {exc})", flush=True, file=sys.__stdout__)# Ensure Tools modules can import 'app' when this file is executed as a script# (their code does `from app import ...`).
app.py+6-4