Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MagenticOne - expose Ledger messages #5127

Open
michalmar opened this issue Jan 21, 2025 · 1 comment
Open

MagenticOne - expose Ledger messages #5127

michalmar opened this issue Jan 21, 2025 · 1 comment

Comments

@michalmar
Copy link

What feature would you like to be added?

we are trying to capture ledger and display ledger messages/status in MagenticOne - but those updates/messages are not visible in standard "stream" of messages when you start the task - has anyone some guidance/advice on how to actually do that, please?

we are starting the exexution like:

team = MagenticOneGroupChat(
            participants=self.agents,
            model_client=self.client,
            max_turns=self.max_rounds,
            max_stalls=self.max_stalls_before_replan,
            
        )
        stream = team.run_stream(task=task)

and then capturing the messages:

 async for log_entry in stream:
            display_log_message(log_entry=log_entry, logs_dir=logs_dir)

(the ledger messages from orchestrator was exposed in 0.2 version)

Why is this needed?

it helps explains the overal progress and help understanding the process in whole

@ekzhu
Copy link
Collaborator

ekzhu commented Jan 22, 2025

We can have a text message emitted right here:

Just add

await self.publish_message(
    GroupChatMessage(TextMessage(content=json.dumps(progress_ledger), source=self._name)),
    topic_id=DefaultTopicId(type=self._output_topic_type),
)

This will be serialized JSON. However, we can add a new message type for structured messages to help the consumer understand what to expect in the message itself. This also allows for filtering at the consumer of the stream to decide whether to display the message to the console.

@afourney

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants