Description
Describe the bug
There is two agent - Agent1 and Agent2. I am using AgentGroupChat using ChatCompletionAgent. It is multi turn conversation based. Then complete chat history is getting passed to llm. Each agent has its own Kernel
instance.
This is what currently I observerd from two DEBUG logs of Semantic-Kernel
This is the each item content in json_data for a llm api calls request has -
ROLE, CONTENT
- system, Agent1 Prompt
- user, task
- assistant, tool_calls
- tool, tool_calls result
- assistant, Agent1 response
- assistant, Agent1 response
- assistant, Agent2 Prompt
- assistant, Agent1 response
- assistant, Agent1 response
- assistant, Agent2 response
As its clear for more iterations it will pass more such messages and we will get token limit exceeded error.
Currently for my use case I just need this for any llm api call
- system prompt
2, user task - assistant tool_calls
- tool response
- assistant response
- assistnat response
To Reproduce
Steps to reproduce the behavior:
- This can be observed in Semantic Kernel DEBUG log for any multi-turn group chat for atleast 10 iterations
Expected behavior
6 message items should be enough.
When its turn then this should be the llm api call payload:
- system prompt
2, user task - assistant tool_calls
- tool response
- assistant response
- assistnat response
When its turn then this should be the llm api call payload:
- system prompt
2, user task - assistant tool_calls
- tool response
- assistant response
- assistnat response
Screenshots
If applicable, add screenshots to help explain your problem.
Platform
- Language: Python
- Source: main branch , 1.30.0 Semantic kernel version
- AI model: Currently I used gpt-4o using Azure
- IDE: Vscode
- OS: Windows
Additional context
Add any other context about the problem here.
Metadata
Metadata
Assignees
Type
Projects
Status