Skip to content

Python: Bug: logging agent steps does nothing #12516

Closed
@parzi-val

Description

@parzi-val

Describe the bug
I was following the multi agent orchestrating - handoff tutorial and it has this piece of code which says its for logging the different steps involved in the entire process.

def agent_response_callback(message: ChatMessageContent) -> None:
    """Observer function to print the messages from the agents.

    Please note that this function is called whenever the agent generates a response,
    including the internal processing messages (such as tool calls) that are not visible
    to other agents in the orchestration.
    """
    print(f"{message.name}: {message.content}")
    for item in message.items:
        if isinstance(item, FunctionCallContent):
            print(f"Calling '{item.name}' with arguments '{item.arguments}'")
        if isinstance(item, FunctionResultContent):
            print(f"Result from '{item.name}' is '{item.result}'")

To Reproduce
Steps to reproduce the behavior:

  1. Run this file
  2. Follow the example input/outputs

Expected behavior
Expected to see a clear trace of all the events that occured during the process.

Screenshots
If applicable, add screenshots to help explain your problem.

Image

Platform

  • Language: Python
  • Source: pip, version 1.33.0
  • AI model: Azure OpenAI:GPT-4o
  • IDE: VS Code
  • OS: Windows

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

agentsbugSomething isn't workingpythonPull requests for the Python Semantic Kernel

Type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions