Skip to content

Conversation

@olimorris
Copy link
Owner

Description

The Ollama model allows schema.models.default and schema.models.choices to be functions. Without caching, during the same request, this is potentially "expensive" as the adapter class has to resolve them.

The handlers.on_exit function is the ideal place to reset the cache however it's only called when the request ends completely. If the user cancels the request then previously it was not called.

This PR fixes the above and also streamlines Ollama's inline_output method.

@olimorris olimorris changed the title fix(adapters): on_exit is called when request is cancelled and ollama models are cached Ollama - Fix inline output parsing and adapter caching Feb 18, 2025
@olimorris olimorris merged commit df2c5f6 into main Feb 18, 2025
4 checks passed
@olimorris olimorris deleted the fix/ollama-inline-assistant branch February 27, 2025 14:32
cleong14 pushed a commit to cleong14/codecompanion.nvim that referenced this pull request May 21, 2025
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.

2 participants