Skip to content

Python: Bug: Python 1.34.0 ChatHistoryTruncationReducer deletes the System Prompt #12612

Open
@imperonas

Description

@imperonas

Describe the bug
When using the ChatHistoryTruncationReducer the reducer reduces the system prompt (both if added to the constructor via system_message or when manually added as first message to the history )

To Reproduce
Steps to reproduce the behavior:

  1. Create a History using the ChatHistoryTruncationReducer, and add a target_count
  2. populate the ChatHistory with more elements than the target_count
  3. call the reduce function

Expected behavior
I expect the System Prompt to be kept, as it is an integral part of the conversation

Screenshots
see first comment.

Platform

  • Language: Python
  • Source: pip semantic-kernel 1.34.0
  • AI model: OpenAI:GPT-4o-mini(2024-12-01-preview)
  • IDE: VS Code
  • OS: Windows

Additional context
Nothing, but additional context can be provided if needed.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpythonPull requests for the Python Semantic Kernel

Type

Projects

Status

Bug

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions