Skip to content

Integrate with the new wpai_has_ai_credentials filter#43

Merged
dkotter merged 4 commits into
developfrom
feature/set-connected-status
Apr 13, 2026
Merged

Integrate with the new wpai_has_ai_credentials filter#43
dkotter merged 4 commits into
developfrom
feature/set-connected-status

Conversation

@dkotter
Copy link
Copy Markdown
Collaborator

@dkotter dkotter commented Apr 13, 2026

Description of the Change

The AI plugin doesn't see the Ollama Connector as being connected since it doesn't require an API key. A new wpai_has_ai_credentials filter was introduced in that plugin that allows individual Connectors to override this behavior.

This PR hooks into that filter and if we have models available, we assume Ollama is connected and return true.

How to test the Change

  1. Check out this PR
  2. Install the AI plugin
  3. Ensure Ollama is running and go to the AI settings page
  4. Ensure no error message is shown
  5. Turn off Ollama and refresh the settings page
  6. An error should now show

Changelog Entry

Added - Ensure the AI plugin sees Ollama as a valid, connected provider

Credits

Props @dkotter

Checklist:

Open WordPress Playground Preview

dkotter added 2 commits April 13, 2026 11:41
…lama or return an error if something went wrong, like no connection. Add a new is_connected method that uses the get_models method to determine if the AI plugin should show things as being connected or not. This is needed since Ollama doesn't require an API key and thus the AI plugin's detection doesn't work
@dkotter dkotter added this to the 1.1.0 milestone Apr 13, 2026
@dkotter dkotter self-assigned this Apr 13, 2026
@jeffpaul jeffpaul self-requested a review April 13, 2026 17:52
Copy link
Copy Markdown
Collaborator

@jeffpaul jeffpaul left a comment

Choose a reason for hiding this comment

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

Tested and connector continues to work as expected

@dkotter dkotter merged commit 568e1e4 into develop Apr 13, 2026
13 checks passed
@dkotter dkotter deleted the feature/set-connected-status branch April 13, 2026 18:29
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