Skip to content

Commit

Permalink
dev: Enhance logging
Browse files Browse the repository at this point in the history
  • Loading branch information
clemlesne committed Feb 23, 2024
1 parent 52649a3 commit 78e05d2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ async def llm_completion(text: Optional[str], call: CallModel) -> Optional[str]:
If the system prompt is None, no completion will be run and None will be returned. Otherwise, the response of the LLM will be returned.
"""
_logger.debug(f"Running LLM completion ({call.call_id})")
_logger.info(f"Running LLM completion ({call.call_id})")

if not text:
return None
Expand Down Expand Up @@ -713,7 +713,7 @@ async def execute_llm_chat(
user_callback: Callable[[str, MessageStyleEnum], Awaitable],
_retry_remaining: int = 3,
) -> Tuple[bool, CallModel]:
_logger.debug(f"Running LLM chat, remaining {_retry_remaining} ({call.call_id})")
_logger.info(f"Running LLM chat, remaining {_retry_remaining} ({call.call_id})")
should_continue_chat = True

async def _retry() -> Tuple[bool, CallModel]:
Expand Down
2 changes: 1 addition & 1 deletion models/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ async def execute_function(self, plugins: object) -> str:
)
except json.JSONDecodeError:
logger.warn(
f"Error decoding JSON args for function {name}: {self.function_arguments}"
f"Error decoding JSON args for function {name}: {self.function_arguments[:20]}...{self.function_arguments[-20:]}"
)
return f"Bad JSON format, impossible to execute function {name}"

Expand Down

0 comments on commit 78e05d2

Please sign in to comment.