rob-9 opened a new pull request, #883:
URL: https://github.com/apache/flink-agents/pull/883

   fixes #464
   
   ### purpose
   
   the Java OpenAI chat model connections (`OpenAICompletionsConnection` and 
`AzureOpenAIChatModelConnection`) didn't set explicit defaults for `timeout` 
and `max_retries`, falling thru to the openai-java SDK's internal values. the 
Python SDK explicitly defaults to `timeout=60s` and `max_retries=3`, meaning 
the same agent config behaves differently across languages.
   
   this PR aligns Java to match Python:
   - adds shared `DEFAULT_TIMEOUT_SECONDS = 60` / `DEFAULT_MAX_RETRIES = 3` 
constants.
   - both Java connections now resolve these via `Optional.orElse(DEFAULT_*)` 
so absent args get the explicit default.
   - invalid values (timeout ≤ 0, retries < 0) are clamped to the default 
instead of silently skipped.
   - javadoc updated to document the new defaults.
   
   ### testing
   
   - new `OpenAICompletionsConnectionTest` asserts correct defaults, explicit 
overrides work, and api_key validation holds.
   - extended `AzureOpenAIChatModelConnectionTest` with default-resolution and 
override assertions.
   - new Python test pinning `timeout == 60.0` and `max_retries == 3`.
   
   ### docs
   - [x] `doc-not-needed`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to