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
2 changes: 1 addition & 1 deletion docs/content/migration/0.30.1-to-0.40.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ These do not break compilation, but they change what your code observes at runti

### watsonx.ai API version

The API version sent with every request moved from `2026-07-08` to `2026-08-11`. No request or response shape changed for the operations covered by the SDK.
The API version sent with every request moved from `2026-07-08` to `2026-08-19`. No request or response shape changed for the operations covered by the SDK.

### `502 Bad Gateway` is retried

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
*/
public abstract class WatsonxService {

protected static final String API_VERSION = "2026-08-11";
protected static final String API_VERSION = "2026-08-19";
protected static final String TRANSACTION_ID_HEADER = "X-Global-Transaction-Id";
protected static final Duration TIME_OUT = Duration.ofSeconds(60);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public abstract class AbstractWatsonxTest {

protected static final String ML_API_PATH = "/ml/v1";
protected static final String ML_API_TEXT_PATH = ML_API_PATH.concat("/text");
protected static final String API_VERSION = "2026-08-11";
protected static final String API_VERSION = "2026-08-19";
protected static final String TRANSACTION_ID_HEADER = "X-Global-Transaction-Id";

@Mock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import com.ibm.watsonx.ai.core.auth.ibmcloud.IBMCloudAuthenticator;
import com.ibm.watsonx.ai.core.exception.WatsonxException;
import com.ibm.watsonx.ai.gateway.chat.ModelGatewayChatParameters;
import com.ibm.watsonx.ai.gateway.chat.ModelGatewayChatParameters.ReasoningEffort;
import com.ibm.watsonx.ai.gateway.chat.ModelGatewayChatRequest;
import com.ibm.watsonx.ai.gateway.chat.ModelGatewayChatResponse;
import com.ibm.watsonx.ai.gateway.chat.ModelGatewayChatService;
Expand Down Expand Up @@ -443,6 +444,30 @@ void should_not_force_tool_execution_when_tool_choice_option_is_set_to_none() {
assertNull(assistantMessage.toolCalls());
}

@Test
void should_throw_exception_for_unsupported_model_parameter() {

var modelGatewayChatService = ModelGatewayChatService.builder()
.baseUrl(URL)
.modelId(CHAT_MODEL_GEMMA)
.authenticator(authentication)
.logRequests(true)
.logResponses(true)
.build();

var parameters = ModelGatewayChatParameters.builder()
.reasoningEffort(ReasoningEffort.HIGH)
.build();

var request = ModelGatewayChatRequest.builder()
.messages(UserMessage.text("Hello!"))
.parameters(parameters)
.build();

var ex = assertThrows(WatsonxException.class, () -> modelGatewayChatService.chat(request));
assertTrue(ex.getMessage().contains("gemini does not support parameters: ['reasoning_effort']"));
}

@Test
void should_throw_exception_when_api_key_is_invalid() {

Expand Down