Repository navigation
Add support for Jev-style decision models - #103
Merged
Merged
Conversation
âĶ models support decisions
Collaborator
|
My local results: Do we want to add |
Collaborator
Author
The issue here is these pills currently output capabilities that the PHP AI Client is returning and "Decision" isn't yet a supported capability there. If you want to see that output here, we could hardcode that capability ourselves until it is supported upstream, just something we'll need to remember to come back to and remove. |
Collaborator
|
Ok, we'll just await the PHP client allowing for that |
2 of 4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the Change
The latest version of Ollama (v0.35) added support for Jev-style decision models. Since these models function differently than a standard text-generation model, they aren't natively supported with the PHP AI Client (see WordPress/php-ai-client#296 that is tracking this). This means in order to make these models work here, we need to add our own custom model support for now, which is what this PR does (ideally most of this is added to the PHP AI Client and the code here can then be simplified).
OllamaDecisionModelclass that is responsible for making API requests to a decision model via the/v1/systemoneendpointdecisionModelthat can be used directly to call a decision model. This is the only entry point until the PHP AI Client properly supports decision model routingHow to test the Change
tev1:0.8bis the smallest:test-decisions.phpand runwp eval-file test-decisions.php:Expected Result:
â wp eval-file test-decisions.php Decision models: tev1:latest label: bug (confidence 0.82, confident at 0.8: yes) urgent: 0.901 probability of yes severity: 2.30 on a 0-3 scale (confidence 0.26) tokens: 753 in / 4 out Validation: A choice question needs between 2 and 26 criteria, 1 given. Success: Decision request completed.Also check that a normal text prompt with no model specified, e.g.
wp_ai_client_prompt( 'Hi' )->using_provider( 'ollama' )->generate_text(), doesn't use the decision model when other models are installed.Changelog Entry
Credits
Props @dkotter
Checklist: