Skip to content

Conversation

@ivyleavedtoadflax
Copy link
Contributor

@ivyleavedtoadflax ivyleavedtoadflax commented Dec 29, 2025

Summary

Fixes API compatibility issues in the marimo demo notebooks to correctly access Result object attributes.

Changes

  • demo_chatcontrol.py:
    • Fix QuestionAnswering result access to show individual Q&A pairs
    • Fix InformationExtraction iteration to access .entities attribute

Testing

  • Manually tested with marimo in browser
  • Verified against current sieves API schemas

Related Issues

Fixes issues discovered during demo usage where Result objects were not being accessed according to their Pydantic schema structure.

Commits

  1. fix(demos): Access individual Q&A pairs in chatcontrol demo - Display individual Q&A pairs instead of full list
  2. fix(demos): Access entities attribute in InformationExtraction result - Fixes AttributeError when iterating over InformationExtraction results

- Display first Q&A pair for "What are the risks" question
- Display second Q&A pair for "Why is this an issue again" question
- Matches intended behavior from markdown headers
Fixes AttributeError: 'tuple' object has no attribute 'link'

- Iterate over .entities list instead of Result object directly
- Pydantic BaseModel iteration yields tuples, not objects
- Access entity attributes (.topic, .link) on each item
- Aligns with ResultMulti schema structure
@codecov
Copy link

codecov bot commented Dec 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #250   +/-   ##
=======================================
  Coverage   92.02%   92.02%           
=======================================
  Files          80       80           
  Lines        4462     4462           
=======================================
  Hits         4106     4106           
  Misses        356      356           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@rmitsch rmitsch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! 🙏 These are from the Open Teams demo, haven't gotten around to updating them to the unified Pudantic interface yet.

@ivyleavedtoadflax ivyleavedtoadflax merged commit cfaf887 into main Jan 3, 2026
3 checks passed
@ivyleavedtoadflax ivyleavedtoadflax deleted the fix/demo-result-access branch January 3, 2026 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants