gnodet-bot commented on code in PR #26606:
URL: https://github.com/apache/camel/pull/26606#discussion_r4075168663
##########
dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/OpenAIEndpointBuilderFactory.java:
##########
@@ -7061,10 +7065,38 @@ default OpenAIEndpointBuilder openai(String path) {
default OpenAIEndpointBuilder openai(String componentName, String
path) {
return OpenAIEndpointBuilderFactory.endpointBuilder(componentName,
path);
}
+ /**
+ * OpenAI (camel-openai)
+ * 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.
+ *
+ * Category: ai
+ * Since: 4.17
+ * Maven coordinates: org.apache.camel:camel-openai
+ *
+ * Syntax: <code>llm:operation</code>
+ *
+ * Path parameter: operation (required)
+ * The operation to perform: 'chat-completion', 'responses',
+ * 'responses-retrieve', 'responses-cancel', 'embeddings',
+ * 'tool-execution', 'audio-transcription', 'audio-translation',
+ * 'audio-speech', 'moderation', 'image-generation', or 'image-edit'
+ * There are 12 enums and the value can be one of: chat-completion,
+ * responses, responses-retrieve, responses-cancel, embeddings,
+ * tool-execution, audio-transcription, audio-translation,
audio-speech,
+ * moderation, image-generation, image-edit
Review Comment:
⚠️ **`llm()` operation list is stale — missing the 5 operations added in the
main merge**
The `openai(String path)` method above (line 7023) lists 17 operations
including `batch`, `batch-retrieve`, `batch-cancel`, `batch-results`, and
`webhook`. The `llm()` method here still lists only 12 (the pre-merge set).
Since `llm:` is a full alias for the same endpoint, both schemes support all
the same operations — the Javadoc should match.
This was introduced by the merge resolution: `llm()` was hand-added at
commit `828bbd5` before the batch/webhook operations landed on `main`. The
regeneration step in the merge commit did not update the `llm()` overloads.
Fix: regenerate the endpoint DSL after rebasing onto current `main`.
##########
dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/OpenAIEndpointBuilderFactory.java:
##########
@@ -7061,10 +7065,38 @@ default OpenAIEndpointBuilder openai(String path) {
default OpenAIEndpointBuilder openai(String componentName, String
path) {
return OpenAIEndpointBuilderFactory.endpointBuilder(componentName,
path);
}
+ /**
+ * OpenAI (camel-openai)
+ * 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.
+ *
+ * Category: ai
+ * Since: 4.17
+ * Maven coordinates: org.apache.camel:camel-openai
+ *
+ * Syntax: <code>llm:operation</code>
+ *
+ * Path parameter: operation (required)
+ * The operation to perform: 'chat-completion', 'responses',
+ * 'responses-retrieve', 'responses-cancel', 'embeddings',
+ * 'tool-execution', 'audio-transcription', 'audio-translation',
+ * 'audio-speech', 'moderation', 'image-generation', or 'image-edit'
+ * There are 12 enums and the value can be one of: chat-completion,
+ * responses, responses-retrieve, responses-cancel, embeddings,
+ * tool-execution, audio-transcription, audio-translation,
audio-speech,
+ * moderation, image-generation, image-edit
+ *
+ * @param path operation
+ * @return the dsl builder
+ */
+ default OpenAIEndpointBuilder llm(String path) {
+ return OpenAIEndpointBuilderFactory.endpointBuilder("llm", path);
+ }
Review Comment:
⚠️ **Missing `llm(String componentName, String path)` two-arg overload**
`openai(String componentName, String path)` exists at line 7065. The `llm()`
entry directly below has only the single-arg form. The two-arg overload is the
standard way to register a custom component bean under a given scheme; omitting
it for `llm` while providing it for `openai` is an asymmetry that will confuse
users who switch from `openai` to `llm`.
This can be added manually or fixed by running the DSL generator, which
should produce it automatically once the `llm` scheme is registered.
##########
dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java:
##########
@@ -11272,6 +11272,34 @@ public static
LdifEndpointBuilderFactory.LdifEndpointBuilder ldif(String path) {
public static LdifEndpointBuilderFactory.LdifEndpointBuilder ldif(String
componentName, String path) {
return LdifEndpointBuilderFactory.endpointBuilder(componentName, path);
}
+ /**
+ * OpenAI (camel-openai)
Review Comment:
⚠️ **Wrong Javadoc title — `"OpenAI (camel-openai)"` should be `"LLM
(camel-openai)"`**
The block starting at this line describes the `llm(String path)` method
added below. The title was not updated from the generated template.
```suggestion
/**
* LLM (camel-openai)
```
##########
dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java:
##########
@@ -11272,6 +11272,34 @@ public static
LdifEndpointBuilderFactory.LdifEndpointBuilder ldif(String path) {
public static LdifEndpointBuilderFactory.LdifEndpointBuilder ldif(String
componentName, String path) {
return LdifEndpointBuilderFactory.endpointBuilder(componentName, path);
}
+ /**
+ * OpenAI (camel-openai)
+ * 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.
+ *
+ * Category: ai
+ * Since: 4.17
+ * Maven coordinates: org.apache.camel:camel-openai
+ *
+ * Syntax: <code>llm:operation</code>
+ *
+ * Path parameter: operation (required)
+ * The operation to perform: 'chat-completion', 'responses',
+ * 'responses-retrieve', 'responses-cancel', 'embeddings',
'tool-execution',
+ * 'audio-transcription', 'audio-translation', 'audio-speech',
'moderation',
+ * 'image-generation', or 'image-edit'
+ * There are 12 enums and the value can be one of: chat-completion,
+ * responses, responses-retrieve, responses-cancel, embeddings,
+ * tool-execution, audio-transcription, audio-translation, audio-speech,
+ * moderation, image-generation, image-edit
+ *
+ * @param path operation
+ * @return the dsl builder
+ */
+ public static OpenAIEndpointBuilderFactory.OpenAIEndpointBuilder
llm(String path) {
+ return openai("llm", path);
+ }
Review Comment:
⚠️ **Missing `llm(String componentName, String path)` two-arg static
overload + stale operation list**
The `openai(String componentName, String path)` overload exists in this
class. `llm` needs the same. Additionally, the operation list in the
`llm(String path)` Javadoc above lists 12 operations — the pre-merge set —
while `openai(String path)` now lists 17. Both should be regenerated.
Note: `llm(String path)` delegates to `openai("llm", path)` — the two-arg
`llm` overload should simply be:
```java
public static OpenAIEndpointBuilderFactory.OpenAIEndpointBuilder
llm(String componentName, String path) {
return openai(componentName, path);
}
```
##########
dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointHeaderBuilders.java:
##########
@@ -2994,9 +2994,10 @@ public static
OpaEndpointBuilderFactory.OpaHeaderNameBuilder opa() {
return OpaEndpointBuilderFactory.OpaHeaderNameBuilder.INSTANCE;
}
/**
- * OpenAI (camel-openai)
- * OpenAI endpoint for chat completion, Responses API, embeddings, audio
- * transcription, audio translation, and text-to-speech.
+ * LLM (camel-openai)
+ * 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.
*
* Category: ai
* Since: 4.17
Review Comment:
⚠️ **Missing `llm()` header builder alias**
This class provides `openai()` → `OpenAIHeaderNameBuilder.INSTANCE`. Users
who write their routes using the `llm:` scheme and the fluent header DSL will
look for `llm()` here, not `openai()`. Since the header constants are
scheme-agnostic, the fix is a one-liner alias:
```java
/**
* LLM (camel-openai)
* 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.
*
* @return the dsl builder for the headers' name.
*/
@Deprecated
public static OpenAIEndpointBuilderFactory.OpenAIHeaderNameBuilder llm()
{
return OpenAIEndpointBuilderFactory.OpenAIHeaderNameBuilder.INSTANCE;
}
```
(The `@Deprecated` is not required here — `openai()` itself is not
deprecated — this is just for discoverability. Drop the annotation if the
intent is parity with `openai()` which is also non-deprecated.)
##########
dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/OpenAIEndpointBuilderFactory.java:
##########
@@ -7061,10 +7065,38 @@ default OpenAIEndpointBuilder openai(String path) {
default OpenAIEndpointBuilder openai(String componentName, String
path) {
return OpenAIEndpointBuilderFactory.endpointBuilder(componentName,
path);
}
+ /**
+ * OpenAI (camel-openai)
Review Comment:
⚠️ **Wrong Javadoc title — `"OpenAI (camel-openai)"` should be `"LLM
(camel-openai)"`**
All other `llm()` Javadoc blocks in this file use `"LLM (camel-openai)"`
(e.g. line 6990, 7005, 7036). This one was copied from the `openai()` block and
the title was not updated.
```suggestion
/**
* LLM (camel-openai)
```
--
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]