Skip to content

Conversation

@nbw
Copy link

@nbw nbw commented Dec 21, 2025

Extracts hardcoded modes from single file into separate modules that each implement a common Mode Behaviour, allowing users to define custom modes without modifying the library.

Comments

I'm not expecting this PR to get merged necessarily, but I wanted to propose a possible way of making run Modes more approachable with a Behaviour pattern.

I found myself wanting to write my own "mode" to have control over the restart strategy, but some functions like do_run are private and unaccessible. So I'd end up using the :step mode and then copying some of the private functions internals. Perhaps that's the intention of the author, in which case feel free to close this PR. By having a module that defines the Mode behaviour, you can pass it in as an option and the higher level api of calling LLMChain.run(...) stays the same in your code.

Extracts hardcoded modes from single file into separate modules
that each implement a common Mode behaviour, allowing users to
define custom modes without modifying the library.
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.

1 participant