Skip to content

Commit e0d97d6

Browse files
committed
Add support for a Qwen3-VL model and handle OpenRouter 502 errors + update Qwen model in tests to use a more modern one
1 parent 9fa1df1 commit e0d97d6

File tree

3 files changed

+17
-2
lines changed
  • integration-tests/src
    • jvmMain/kotlin/ai/koog/integration/tests/utils/annotations
    • jvmTest/kotlin/ai/koog/integration/tests/utils
  • prompt/prompt-executor/prompt-executor-clients/prompt-executor-openrouter-client/src/commonMain/kotlin/ai/koog/prompt/executor/clients/openrouter

3 files changed

+17
-2
lines changed

integration-tests/src/jvmMain/kotlin/ai/koog/integration/tests/utils/annotations/RetryExtension.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class RetryExtension : InvocationInterceptor {
1919
private const val OPENAI_500_ERROR = "Error from OpenAI API: 500 Internal Server Error"
2020
private const val OPENAI_503_ERROR = "Error from OpenAI API: 503 Service Unavailable"
2121
private const val MISTRAL_503_ERROR = "Error from MistralAILLMClient API: 503 Service Unavailable"
22+
private const val OPENROUTER_ERROR = "Error from client: OpenRouterLLMClient"
2223
}
2324

2425
private fun isThirdPartyError(e: Throwable): Boolean {
@@ -32,6 +33,7 @@ class RetryExtension : InvocationInterceptor {
3233
OPENAI_500_ERROR,
3334
OPENAI_503_ERROR,
3435
MISTRAL_503_ERROR,
36+
OPENROUTER_ERROR,
3537
)
3638
return e.message?.let { message -> message in errorMessages } == true
3739
}

integration-tests/src/jvmTest/kotlin/ai/koog/integration/tests/utils/Models.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ object Models {
4242
@JvmStatic
4343
fun openRouterModels(): Stream<LLModel> = Stream.of(
4444
OpenRouterModels.DeepSeekV30324,
45-
OpenRouterModels.Qwen2_5,
45+
OpenRouterModels.Qwen3VL,
4646
)
4747

4848
@JvmStatic

prompt/prompt-executor/prompt-executor-clients/prompt-executor-openrouter-client/src/commonMain/kotlin/ai/koog/prompt/executor/clients/openrouter/OpenRouterModels.kt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,8 +429,21 @@ public object OpenRouterModels : LLModelDefinitions {
429429
public val Qwen2_5: LLModel = LLModel(
430430
provider = LLMProvider.OpenRouter,
431431
id = "qwen/qwen-2.5-72b-instruct",
432-
capabilities = standardCapabilities,
432+
capabilities = standardCapabilities + additionalCapabilities,
433433
contextLength = 131_072,
434434
maxOutputTokens = 8_192,
435435
)
436+
437+
/**
438+
* Qwen 3 model with 8B parameters from Alibaba.
439+
* Multimodal vision-language model from the Qwen3-VL series, built for high-fidelity understanding
440+
* and reasoning across text, images, and video.
441+
*/
442+
public val Qwen3VL: LLModel = LLModel(
443+
provider = LLMProvider.OpenRouter,
444+
id = "qwen/qwen3-vl-8b-instruct",
445+
capabilities = multimodalCapabilities + additionalCapabilities,
446+
contextLength = 131_072,
447+
maxOutputTokens = 33_000,
448+
)
436449
}

0 commit comments

Comments
 (0)