gnodet-bot commented on code in PR #26606:
URL: https://github.com/apache/camel/pull/26606#discussion_r4051883195
##########
dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/OpenAIEndpointBuilderFactory.java:
##########
@@ -27,16 +27,17 @@
import org.apache.camel.builder.endpoint.AbstractEndpointBuilder;
/**
- * OpenAI endpoint for chat completion, Responses API, embeddings, audio
- * transcription, audio translation, and text-to-speech.
+ * LLM endpoint for chat completion, Responses API, embeddings, audio
+ * transcription, audio translation, and text-to-speech using OpenAI-compatible
+ * APIs. The openai scheme is a supported alias.
*
* Generated by camel build tools - do NOT edit this file!
*/
@Generated("org.apache.camel.maven.packaging.EndpointDslMojo")
public interface OpenAIEndpointBuilderFactory {
Review Comment:
⛔ **Blocker (carry-over from review #2) — Endpoint DSL fluent builder
methods still missing**
The catalog JSON files in this commit (`llm.json`, `openai.json`) correctly
include all parameters — `background`, `connectTimeout`, `readTimeout`,
`conversationId`, `imageBackground`, `imageCount`, `imageModel`, `imageSize`,
`imageStyle`, `imageQuality`, `moderationModel`, `tags`, and more. But
`OpenAIEndpointBuilderFactory.java` still doesn't expose fluent builder methods
for any of them. The `OpenAIEndpointBuilder` interface needs one `default`
method per parameter (e.g., `background(boolean)`, `connectTimeout(long)`,
etc.) so that users can write:
```java
from("llm:image-generation").background(true).imageModel("gpt-image-1")...
```
This file should be much larger than the 164-line diff shown here. The fix
is to run the full regeneration:
```
./mvnw -pl dsl/camel-endpointdsl generate-sources -Dfastinstall
```
Commit the full regenerated file.
##########
dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/OpenAIEndpointBuilderFactory.java:
##########
@@ -2225,13 +2246,43 @@ default OpenAIEndpointBuilder openai(String path) {
* @param path operation
* @return the dsl builder
*/
- default OpenAIEndpointBuilder openai(String componentName, String
path) {
+ default OpenAIEndpointBuilder llm(String componentName, String path) {
return OpenAIEndpointBuilderFactory.endpointBuilder(componentName,
path);
}
Review Comment:
⛔ **New blocker — `openai(String componentName, String path)` two-arg
interface overload removed without a deprecated bridge**
The two-arg `default OpenAIEndpointBuilder openai(String componentName,
String path)` was renamed to `llm(String componentName, String path)` with no
deprecated delegate left behind. Any user calling `.openai("myOpenai",
"chat-completion")` on a route builder now gets a compile error — the same
binary-incompatible pattern that review #1 found for the header builder and
review #2's fix restored for the single-arg `openai(String path)`.
Add the deprecated bridge alongside `llm(String componentName, String path)`:
```java
/** @deprecated use {@link #llm(String, String)} instead. */
@Deprecated
default OpenAIEndpointBuilder openai(String componentName, String path) {
return llm(componentName, path);
}
```
This must also be reflected in the `endpoint-builder.vm` template so future
regenerations don't silently remove it again.
##########
dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java:
##########
@@ -12750,37 +12859,9 @@ public static
OpaEndpointBuilderFactory.OpaEndpointBuilder opa(String componentN
* @param path operation
* @return the dsl builder
*/
+ @Deprecated
public static OpenAIEndpointBuilderFactory.OpenAIEndpointBuilder
openai(String path) {
Review Comment:
⛔ **New blocker — `StaticEndpointBuilders.openai(String componentName,
String path)` two-arg static overload removed without a deprecated bridge**
Same issue as above but for the static utility class. The two-arg overload
`openai(String componentName, String path)` was deleted outright — any code
calling `StaticEndpointBuilders.openai("myOpenai", "chat-completion")` gets
`NoSuchMethodError` at runtime.
Add a deprecated static bridge after the single-arg `openai(String path)`
method:
```java
/** @deprecated use {@link #llm(String, String)} instead. */
@Deprecated
public static OpenAIEndpointBuilderFactory.OpenAIEndpointBuilder
openai(String componentName, String path) {
return llm(componentName, path);
}
```
The `endpoint-static-builders.vm` template needs the equivalent change so
regeneration emits this bridge automatically for all scheme aliases.
--
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]