Skip to content
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
29 changes: 20 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,24 @@ jobs:
with:
message: "Prepare release ${{github.ref_name}}"
github_token: ${{ secrets.GH_BOT_TOKEN }}

- name: Build and deploy to Maven repository
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
cache: maven
server-id: central
server-username: MAVEN_CENTRAL_USERNAME
server-password: MAVEN_CENTRAL_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE

- name: Deploy with Maven
run: ./mvnw clean deploy -Psign
env:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}


# - name: Build and deploy to Maven repository
# uses: actions/setup-java@v4
# with:
# distribution: temurin
# java-version: 17
# server-id: central
# server-username: username
# server-password: password
# gpg-private-key: gpg-key
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.ibm.watsonx.ai.core.chat.JsonSchema.IntegerSchema;
import com.ibm.watsonx.ai.core.chat.JsonSchema.NumberSchema;
import com.ibm.watsonx.ai.core.chat.JsonSchema.ObjectSchema;
import com.ibm.watsonx.ai.core.chat.JsonSchema.ObjectSchema.Builder;
import com.ibm.watsonx.ai.core.chat.JsonSchema.StringSchema;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ interface AsyncChain {
* Proceeds with the execution of the async HTTP request.
*
* @param request the HTTP request to execute
* @param bodyHandler the body handler for processing the response
* @param handler the body handler for processing the response
* @param executor the executor that is used for executing asynchronous tasks
* @param <T> the type of the response body
* @return the {@link CompletableFuture} of the HTTP response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public SyncHttpClient(Builder builder) {
* Sends an synchronous HTTP request.
*
* @param request the HTTP request to send
* @param handler the body handler for the response
* @param bodyHandler the body handler for the response
* @param <T> the type of the response body
* @return a HTTP response
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public interface JsonAdapter {
* Deserializes a JSON string into an instance of the specified class.
*
* @param json the JSON content.
* @param type the target class.
* @param clazz the target class.
* @param <T> the result type.
* @return the deserialized object.
* @throws RuntimeException if deserialization fails.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static abstract class Builder<T extends Builder<T>> {
/**
* Sets the project id.
*
* @param spaceId Project id value
* @param projectId Project id value
*/
public T projectId(String projectId) {
this.projectId = projectId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public T version(String version) {
* <p>
* If you want to override this value, use the {@link WatsonxParameters}.
*
* @param spaceId Project id value
* @param projectId Project id value
*/
public T projectId(String projectId) {
this.projectId = projectId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
* <p>
* This record contains information about the number of tokens used during the processing of a chat request, including prompt tokens, completion
* tokens, and the total number of tokens consumed.
*
* @param completionTokens the number of tokens generated in the completion phase
* @param promptTokens the number of tokens used in the prompt
* @param totalTokens the total number of tokens consumed (prompt + completion)
*/
public class ChatUsage {
private Integer completionTokens;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* @param id The unique identifier of the tool call
* @param type the type of tool call, always {@code function}
* @param Function The function call details
* @param function The function call details
*/
public final record ToolCall(Integer index, String id, String type, FunctionCall function) {

Expand Down
80 changes: 73 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<name>IBM watsonx.ai Java SDK</name>
<groupId>com.ibm.watsonx</groupId>
<artifactId>watsonx-ai-parent</artifactId>
<version>999-SNAPSHOT</version>
<packaging>pom</packaging>

<url>https://github.com/IBM/watsonx-ai-java-sdk</url>
<description>Java client library and SDK for IBM watsonx.ai</description>

<modules>
<module>modules/watsonx-ai-core</module>
<module>modules/watsonx-ai</module>
Expand All @@ -31,6 +34,9 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven-source-plugin-version>3.3.1</maven-source-plugin-version>
<maven-javadoc-plugin-version>3.11.2</maven-javadoc-plugin-version>
<maven-gpg-plugin-version>3.2.8</maven-gpg-plugin-version>
<central-publishing-maven-plugin-version>0.8.0</central-publishing-maven-plugin-version>
<maven-compiler-plugin-version>3.14.0</maven-compiler-plugin-version>
<build-helper-maven-plugin-version>3.6.1</build-helper-maven-plugin-version>
<license-maven-plugin-version>5.0.0</license-maven-plugin-version>
Expand All @@ -49,7 +55,7 @@
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
Expand Down Expand Up @@ -159,7 +165,7 @@
</execution>
</executions>
</plugin>

<plugin>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
Expand Down Expand Up @@ -233,16 +239,76 @@
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin-version}</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<failOnError>false</failOnError>
<additionalJOption>-Xdoclint:none</additionalJOption>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>samples</id>
<modules>
<module>samples</module>
</modules>
<id>sign</id>
<properties>
<skipTests>true</skipTests>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>${maven-gpg-plugin-version}</version>
<executions>
<execution>
<id>sign</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>${central-publishing-maven-plugin-version}</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
<autoPublish>true</autoPublish>
<waitUntil>published</waitUntil>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<developers>
<developer>
<name>Andrea Di Maio</name>
<email>andrea.dimaio@it.ibm.com</email>
</developer>
</developers>

<scm>
<connection>scm:git:git://github.com:IBM/watsonx-ai-java-sdk.git</connection>
<developerConnection>scm:git:ssh://github.com:IBM/watsonx-ai-java-sdk.git</developerConnection>
<url>https://github.com/IBM/watsonx-ai-java-sdk</url>
</scm>

</project>