New Feature: Add AiAssertionOptions.AssertionImageType to Support Actual Image Validation
We previously introduced AI Assertion which utilizes a comparison image for assertions. However, we noticed the current implementation struggled with optimal performance due to image size constraints, where sufficient context size is crucial for accurate AI analysis. To address this, we've introduced the AssertionImageType
parameter. You can now specify the image type via AiAssertionOptions
.
sealed interface AssertionImageType {
class Comparison : AssertionImageType
class Actual : AssertionImageType
}
Bug Fix: Improved AI Assertion OpenAI API Error Messaging
Previously, API error messages were unclear and unhelpful. We've revamped the error handling to provide meaningful feedback, including proper API status details.
Before:
Fields [object, created, model, choices] are required for type with serial name 'com.github.takahirom.roborazzi.ChatCompletionResponse', but they were missing at path: $
kotlinx.serialization.MissingFieldException: Fields [object, created, model, choices] are required for type with serial name 'com.github.takahirom.roborazzi.ChatCompletionResponse', but they were missing at path: $
After:
Caused by: java.util.concurrent.ExecutionException: com.github.takahirom.roborazzi.AiAssertionApiException: {
"error": {
"message": "You didn't provide an API key. You need to provide your API key in an Authorization header using Bearer auth (i.e. Authorization: Bearer YOUR_KEY), or as the password field (with blank username) if you're accessing the API from your browser and are prompted for a username and password. You can obtain an API key from https://platform.openai.com/account/api-keys.",
"type": "invalid_request_error",
"param": null,
"code": null
}
}
Changes from 1.40.0
We initially introduced AssertionImageType.Reference
instead of AssertionImageType.Actual
in version 1.40.0. This was a mistake, as it referred to old images, a feature we've determined to be unnecessary. We have corrected this in the current release by using AssertionImageType.Actual
.
What's Changed
- [Not Roborazzi Library dependency update] Update actions/upload-artifact digest to 65c4c4a by @renovate in #619
- [Not Roborazzi Library dependency update] Update dependency androidx.compose.material:material to v1.7.6 by @renovate in #629
- [Not Roborazzi Library dependency update] Update dependency androidx.compose.runtime:runtime to v1.7.6 by @renovate in #630
- [Not Roborazzi Library dependency update] Update dependency androidx.compose.ui:ui-test-junit4 to v1.7.6 by @renovate in #631
- [Not Roborazzi Library dependency update] Update dependency androidx.compose.ui:ui-test-manifest to v1.7.6 by @renovate in #632
- Add AssertionImageType to support reference image validation in AI Assertion by @takahirom in #637
- Improve OpenAI api error handling by @takahirom in #638
- Use class instead of object to maintain compatibility by @takahirom in #639
- Use Actual image instead of Reference image for image assertion by @takahirom in #640
Full Changelog: 1.39.0...1.40.1