Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance dotAI Functionality: Model Listing, Exception Handling, Improved Logging, and Updated Tests #29587

Closed
Tracked by #28813
victoralfaro-dotcms opened this issue Aug 14, 2024 · 2 comments · Fixed by #29588

Comments

@victoralfaro-dotcms
Copy link
Contributor

victoralfaro-dotcms commented Aug 14, 2024

Parent Issue

#28813

User Story

As a Java developer, I want to perform several enhancements to the current dotAI functionality so that it is more reliable, better documented, and easier to debug.

  • In the config endpoint at the availableModels array, return a list of JSON objects containing the name and type of the models.
  • Throw exceptions when the dotAI functionality needs to be consumed, but the AppConfig is disabled due to missing API URLs or API key.
  • Introduce better logging, preferably using the AppConfig.debugLogger() method, at critical points in the code, like OpenAI interaction.
  • When resolving a model, check against the list of supported models returned by the OpenAI models endpoint.
  • Update integration/Postman tests to check for the added changes.

Acceptance Criteria

  • Config endpoint returns a list of JSON objects with name and type for the availableModels.
  • Exceptions are thrown when AppConfig is disabled due to missing API URLs or API key.
  • Logging is enhanced using AppConfig.debugLogger() at critical points, particularly for OpenAI interactions.
  • Models are resolved by checking against the supported models list from OpenAI's models endpoint.
  • Integration/Postman tests are updated to verify the above changes.

dotCMS Version

master

Proposed Objective

Core Features

Proposed Priority

Priority 2 - High

External Links... Slack Conversations, Support Tickets, Figma Designs, etc.

to_define

Assumptions & Initiation Needs

  • OpenAI models endpoint provides a comprehensive and up-to-date list of supported models.
  • AppConfig will provide appropriate fallback mechanisms if logging fails.

Quality Assurance Notes & Workarounds

  • Ensure that integration tests simulate scenarios where API URLs or API keys are missing to trigger the exception handling.
  • Verify that the logging enhancements provide meaningful insights without overwhelming the logs.

Sub-Tasks & Estimates

  1. Modify config endpoint to return availableModels with name and type (4 hours).
  2. Implement exception handling for missing API URLs or API key in AppConfig (3 hours).
  3. Enhance logging using AppConfig.debugLogger() at critical points (3 hours).
  4. Update model resolution logic to check against OpenAI supported models (4 hours).
  5. Update and run integration/Postman tests (5 hours).
@victoralfaro-dotcms victoralfaro-dotcms self-assigned this Aug 14, 2024
victoralfaro-dotcms added a commit that referenced this issue Aug 14, 2024
…d 'type' instead of just a list os strings. Throwing exceptions when AppConfig.isEnabled() is false to break the tests when any of AI API url or AI API key are missing. Clean the default values for model names. Added better logging at key places when interacting with OpenAI provider. Tests were added/updated.
victoralfaro-dotcms added a commit that referenced this issue Aug 14, 2024
…d 'type' instead of just a list os strings. Throwing exceptions when AppConfig.isEnabled() is false to break the tests when any of AI API url or AI API key are missing. Clean the default values for model names. Added better logging at key places when interacting with OpenAI provider. Tests were added/updated.
victoralfaro-dotcms added a commit that referenced this issue Aug 14, 2024
…d 'type' instead of just a list os strings. Throwing exceptions when AppConfig.isEnabled() is false to break the tests when any of AI API url or AI API key are missing. Clean the default values for model names. Added better logging at key places when interacting with OpenAI provider. Tests were added/updated.
victoralfaro-dotcms added a commit that referenced this issue Aug 15, 2024
victoralfaro-dotcms added a commit that referenced this issue Aug 15, 2024
@victoralfaro-dotcms
Copy link
Contributor Author

@victoralfaro-dotcms
Copy link
Contributor Author

QA Notes
With IQA done at #29281 it's enough to test this enhancements.

@dsilvam dsilvam moved this from Internal QA to Done in dotCMS - Product Planning Aug 19, 2024
@dsilvam dsilvam closed this as completed Aug 21, 2024
@github-project-automation github-project-automation bot moved this from Done to Internal QA in dotCMS - Product Planning Aug 21, 2024
@dsilvam dsilvam moved this from Internal QA to Done in dotCMS - Product Planning Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants