You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Python: Emit partial result for magentic pattern when retrieving final result, if available (#12656)
### Motivation and Context
When using the magentic orchestration pattern, if the `max_round_count`
is hit, the final result shows as:
```
Final result:
Max round count reached.
```
The interim messages do show as part of the `agent_response_callback`;
however, not everyone may have that configured. We should return more
meaningful results, even if partial. This PR updates to try and get a
partial result if it exists. When one calls:
```python
value = await orchestration_result.get()
```
for the `step5_magentic.py` sample, with `max_round_count=1` they should
receive the partial result:
```
Final result:
Based on the available data, here is a comparison of the estimated training and inference energy consumption for ResNet-50, BERT-base, and GPT-2, along with the associated CO₂ emissions when training on an Azure Standard_NC6s_v3 VM for 24 hours.
**Model Architectures and Datasets:**
- **ResNet-50**: Image classification model trained on ImageNet.
- **BERT-base**: Text classification model fine-tuned on the GLUE benchmark.
- **GPT-2**: Text generation model trained on WebText.
... <rest omitted for brevity> ...
```
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
1. Why is this change required?
2. What problem does it solve?
3. What scenario does it contribute to?
4. If it fixes an open issue, please link to the issue here.
-->
### Description
Return partial results for magentic orchestration if they exist.
- Closes#12625
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [X] The code builds clean without any errors or warnings
- [X] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [X] All unit tests pass, and I have added new tests where possible
- [X] I didn't break anyone 😄
0 commit comments