Skip to content

Conversation

@AngeloDanducci
Copy link

@AngeloDanducci AngeloDanducci commented Jan 27, 2026

Misc PR

Type of PR

  • Bug Fix
  • New Feature
  • Documentation
  • Other

Description

Testing

  • Tests added to the respective file if code was changed
  • New code has 100% coverage if code as added
  • Ensure existing tests and github automation passes (a maintainer will kick off the github automation when the rest of the PR is populated)

@github-actions
Copy link
Contributor

The PR description has been updated. Please fill out the template for your PR to be reviewed.

@mergify
Copy link

mergify bot commented Jan 27, 2026

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert|release)(?:\(.+\))?:

@AngeloDanducci AngeloDanducci changed the title [Docs] add decompose to tutorial with example docs: add decompose to tutorial with example Jan 27, 2026
#### Decompose
For large prompts Mellea offers a decompose function to break down the initial prompt into a series of smaller ones. In addition, the intermediary output allows for constraints and validation to be applied to the output of each step. The final output is done by composing these intermediate steps.

See [`mellea/docs/examples/m_decompose/`](./examples/m_decompose/) for an input example prompt, intermdiary json and python representations, and the final output.
Copy link
Member

Choose a reason for hiding this comment

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

It might be helpful to have example commands so that folks can follow along (similar to the IVR section)

@@ -0,0 +1,750 @@
**Event Strategy Document**
Copy link
Member

Choose a reason for hiding this comment

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

Is there a smaller / simpler example we could include too? While this really shows the power of what can be done, for someone new it's a lot to try to wrap your head around.

Copy link
Author

Choose a reason for hiding this comment

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

I can include a second example that is a bit more digestible for users.

Copy link
Member

@psschwei psschwei left a comment

Choose a reason for hiding this comment

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

LGTM

cc @nrfulton in case you had any feedback

@planetf1
Copy link
Contributor

Suggestion to keep our tests working nicely...

To align with the recently merged PR #372 (optimizing example testing in pytest) and ensure consistency with other examples:

  1. Add Classification Marker: Add # pytest: ollama to the top of the file. This allows pytest to appropriately skip the example in environments (like CI) where Ollama is unavailable. (Consistent with simple_example.py and others).

  2. Prevent Import-Time Execution: Wrap the start_session() logic in if __name__ == "__main__":. Without this, pytest executes the code immediately upon import (during the collection phase), which bypasses markers and slows down test discovery. (Consistent with simple_example.py and generative_gsm8k.py).

@AngeloDanducci
Copy link
Author

To align with the recently merged PR #372 (optimizing example testing in pytest) and ensure consistency with other examples

These are generated outputs directly from decompose based on the prompt - mainly for users to see how you go from input prompt to intermediary to final answer.

I've updated it to match the new test structure as this will live in examples and we do have that as part of our test suite.

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