This PR represents a set of changes to the way Actions are constructed and maintained in the codebase.
Built-in actions are now constructed using a factory function create_action in ollama.actions.factory
Users can construct actions similar to the built-ins by calling the create_action function themselves, as described in the README.
I'm considering adding more options / hooks to this builder, to make it even easier to tweak actions with your own custom logic. Let me know what you think.
display_prompt action is no longer necessary - it is currently a direct reference to display.
display, display_insert, and display_replace all show the parsed prompt at the top of the new window. This is the new opinionated default as it offers a nicer experience.
If you want to omit the parsed prompt, or change the window to a split or vsplit, you can use the create_action with your desired options.
This PR represents a set of changes to the way Actions are constructed and maintained in the codebase.
Built-in actions are now constructed using a factory function
create_action
inollama.actions.factory
Users can construct actions similar to the built-ins by calling the create_action function themselves, as described in the README.
display_prompt
action is no longer necessary - it is currently a direct reference todisplay
.display
,display_insert
, anddisplay_replace
all show the parsed prompt at the top of the new window. This is the new opinionated default as it offers a nicer experience.If you want to omit the parsed prompt, or change the window to a
split
orvsplit
, you can use thecreate_action
with your desired options.