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

chore: [DevOps] bump com.puppycrawl.tools:checkstyle from 8.41 to 10.17.0 in the production-major group #11

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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