Skip to content

Commit

Permalink
chore: [DevOps] bump com.puppycrawl.tools:checkstyle from 8.41 to 10.…
Browse files Browse the repository at this point in the history
…17.0 in the production-major group (#11)

* chore: [DevOps] bump com.puppycrawl.tools:checkstyle

Bumps the production-major group with 1 update: [com.puppycrawl.tools:checkstyle](https://github.com/checkstyle/checkstyle).


Updates `com.puppycrawl.tools:checkstyle` from 8.41 to 10.17.0
- [Release notes](https://github.com/checkstyle/checkstyle/releases)
- [Commits](checkstyle/checkstyle@checkstyle-8.41...checkstyle-10.17.0)

---
updated-dependencies:
- dependency-name: com.puppycrawl.tools:checkstyle
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: production-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* Updated checkstyle

* Fix checkstyle findings

* Fix checkstyle findings again

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: I538344 <[email protected]>
Co-authored-by: Charles Dubois <[email protected]>
  • Loading branch information
3 people authored Aug 13, 2024
1 parent 6ed9722 commit 75db423
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .pipeline/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<property name="severity" value="info"/>
</module>
<module name="JavadocMethod">
<property name="scope" value="protected"/>
<property name="accessModifiers" value="protected"/>
<property name="allowedAnnotations" value="Override"/>
<property name="severity" value="info"/>
</module>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,24 +84,49 @@ class OpenAiChatUserMessage implements OpenAiChatMessage {
@Getter(onMethod_ = @Nullable)
private final List<ContentPart> content = new ArrayList<>();

/**
* Add text to the user message.
*
* @param content The text content.
* @return The user message.
*/
@Nonnull
public OpenAiChatUserMessage addText(@Nonnull final String content) {
this.content.add(new ContentPartText().setText(content));
return this;
}

/**
* Add an image to the user message.
*
* @param content The image URL.
* @return The user message.
*/
@Nonnull
public OpenAiChatUserMessage addImage(@Nonnull final String content) {
return addImage(content, null);
}

/**
* Add an image to the user message.
*
* @param content The image URL.
* @param detail The detail level of the image.
* @return The user message.
*/
@Nonnull
public OpenAiChatUserMessage addImage(
@Nonnull final String content, @Nullable final ImageDetailLevel detail) {
this.content.add(new ContentPartImage().setUrl(content, detail));
return this;
}

/**
* Add images or text to the user message.
*
* @param content The content(s) to add.
* @return The user message.
*/
@Nonnull
public OpenAiChatUserMessage addContent(@Nonnull final ContentPart... content) {
this.content.addAll(List.of(content));
Expand Down Expand Up @@ -147,18 +172,32 @@ public static class ContentPartImage implements ContentPart {
@Nonnull
private ImageUrl url;

/**
* Set the URL of the image.
*
* @param url The URL of the image.
* @return The image URL.
*/
@Nonnull
public ContentPartImage setUrl(@Nonnull final String url) {
return setUrl(url, null);
}

/**
* Set the URL of the image.
*
* @param url The URL of the image.
* @param detailLevel The detail level of the image.
* @return The image URL.
*/
@Nonnull
public ContentPartImage setUrl(
@Nonnull final String url, @Nullable final ImageDetailLevel detailLevel) {
this.url = new ImageUrl(url, detailLevel);
return this;
}

/** Image URL. */
// { "url": "website.com/picture.jpg" }
@JsonFormat(shape = Shape.OBJECT)
@NoArgsConstructor
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<assertj-core.version>3.25.3</assertj-core.version>
<slf4j.version>2.0.16</slf4j.version>
<spotless.version>2.43.0</spotless.version>
<checkstyle.version>8.41</checkstyle.version>
<checkstyle.version>10.17.0</checkstyle.version>
<system-stubs.version>2.1.3</system-stubs.version>
<surefire.version>3.2.2</surefire.version>
</properties>
Expand Down

0 comments on commit 75db423

Please sign in to comment.