fix(logging): add debug log for truncated messages
Added a debug-level log statement to capture the final set of messages before returning, which aids in tracing message processing and debugging potential issues in the message truncation logic. This enhances transparency and facilitates easier troubleshooting.
This commit is contained in:
parent
21edc48050
commit
253c7e581f
1 changed files with 5 additions and 1 deletions
|
@ -487,12 +487,16 @@ class OpenAI(BaseAI):
|
|||
),
|
||||
}
|
||||
|
||||
return (
|
||||
final_messages = (
|
||||
[system_message_dict]
|
||||
+ [truncated_messages[0]]
|
||||
+ list(reversed(truncated_messages[1:]))
|
||||
)
|
||||
|
||||
self.logger.log(f"Truncated messages: {final_messages}", "debug")
|
||||
|
||||
return final_messages
|
||||
|
||||
async def generate_chat_response(
|
||||
self,
|
||||
messages: List[Dict[str, str]],
|
||||
|
|
Loading…
Reference in a new issue