Fix & improve error AI solutions #628
Merged
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.
This pull request introduces enhancements to the Restify framework, focusing on improved AI solution configuration, better resource publishing, and updates to exception handling. The changes include transitioning from static AI model settings to configurable options, adding support for publishing views, and refining how OpenAI solutions are generated.
AI Solution Configuration Updates:
config/restify.php
: Replaced the booleanai_solutions
setting with a configuration array, allowing specification of the OpenAI model (gpt-4.1-mini
) and maximum tokens (1000
). This makes the AI solution more customizable.Exception Handling Enhancements:
src/Exceptions/Solutions/OpenAiSolution.php
: Updated the OpenAI integration to use thechat
endpoint instead ofcompletions
. The model and max tokens are now dynamically fetched from the configuration, and the prompt structure has been improved for clarity and specificity.The completions endpoint is deprecated:
https://github.com/openai-php/client?tab=readme-ov-file#completions-resource
Resource Publishing Improvements:
src/Commands/SetupCommand.php
: Added a step to publish Restify views during the setup process, enhancing usability for developers who want to customize views.src/LaravelRestifyServiceProvider.php
: Registered a new publishing group for Restify views, enabling developers to publish default views to their project.