gnodet-bot commented on code in PR #26606:
URL: https://github.com/apache/camel/pull/26606#discussion_r4075345843
##########
components/camel-ai/camel-openai/src/main/java/org/apache/camel/component/openai/OpenAIEndpoint.java:
##########
@@ -73,12 +73,12 @@
import org.slf4j.LoggerFactory;
/**
- * 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 {@code openai} scheme is a
supported alias.
*/
@UriEndpoint(firstVersion = "4.17.0",
Review Comment:
⚠️ **`title = "LLM"` breaks the multi-scheme title convention — catalog
regression for `openai` users.**
Camel's code generator maps titles to schemes positionally: `scheme[i]` →
`title[i]`. With `scheme = "openai,llm"` and a single `title = "LLM"`, the
generator assigns `"LLM"` as the title for `openai.json` — confirmed by the
diff (`-"title": "OpenAI"` → `+"title": "LLM"` in
`catalog/components/openai.json`). Any catalog consumer, IDE plugin, or
camel-jbang completion that looks up the `openai` component by name now sees
`"LLM"` instead of `"OpenAI"`.
The precedent is clear:
- `@UriEndpoint(scheme = "http,https", title = "HTTP,HTTPS")` → `http.json`
title: `HTTP`, `https.json` title: `HTTPS (Secure)`
- `@UriEndpoint(scheme = "imap,imaps,pop3,pop3s,smtp,smtps", title =
"IMAP,IMAPS,POP3,POP3S,SMTP,SMTPS")`
Fix:
```suggestion
scheme = "openai,llm",
title = "OpenAI,LLM",
```
Then regenerate so `openai.json` gets title `"OpenAI"` and `llm.json` gets
title `"LLM"`.
##########
dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java:
##########
@@ -11272,6 +11272,36 @@ public static
LdifEndpointBuilderFactory.LdifEndpointBuilder ldif(String path) {
public static LdifEndpointBuilderFactory.LdifEndpointBuilder ldif(String
componentName, String path) {
return LdifEndpointBuilderFactory.endpointBuilder(componentName, path);
}
+ /**
+ * 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
+ * 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', 'batch', 'batch-retrieve',
+ * 'batch-cancel', 'batch-results', 'embeddings', 'tool-execution',
+ * 'audio-transcription', 'audio-translation', 'audio-speech',
'moderation',
+ * 'image-generation', 'image-edit', or 'webhook' (a consumer)
+ * There are 17 enums and the value can be one of: chat-completion,
+ * responses, responses-retrieve, responses-cancel, batch, batch-retrieve,
+ * batch-cancel, batch-results, embeddings, tool-execution,
+ * audio-transcription, audio-translation, audio-speech, moderation,
+ * image-generation, image-edit, webhook
+ *
+ * @param path operation
+ * @return the dsl builder
+ */
+ public static OpenAIEndpointBuilderFactory.OpenAIEndpointBuilder
llm(String path) {
Review Comment:
⚠️ **`llm(String componentName, String path)` static two-arg overload still
missing (raised in review #9).**
`openai(String componentName, String path)` exists in this class. The `llm`
entry only has `llm(String path)`. Add the two-arg static method:
```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.
*
* @param componentName to use a custom component name for the endpoint
instead of the default name
* @param path operation
* @return the dsl builder
*/
public static OpenAIEndpointBuilderFactory.OpenAIEndpointBuilder
llm(String componentName, String path) {
return openai(componentName, path);
}
```
##########
dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/OpenAIEndpointBuilderFactory.java:
##########
@@ -7061,10 +7065,41 @@ default OpenAIEndpointBuilder openai(String path) {
default OpenAIEndpointBuilder openai(String componentName, String
path) {
return OpenAIEndpointBuilderFactory.endpointBuilder(componentName,
path);
}
+ /**
+ * 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
+ * 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', 'batch', 'batch-retrieve',
+ * 'batch-cancel', 'batch-results', 'embeddings', 'tool-execution',
+ * 'audio-transcription', 'audio-translation', 'audio-speech',
+ * 'moderation', 'image-generation', 'image-edit', or 'webhook' (a
+ * consumer)
+ * There are 17 enums and the value can be one of: chat-completion,
+ * responses, responses-retrieve, responses-cancel, batch,
+ * batch-retrieve, batch-cancel, batch-results, embeddings,
+ * tool-execution, audio-transcription, audio-translation,
audio-speech,
+ * moderation, image-generation, image-edit, webhook
+ *
+ * @param path operation
+ * @return the dsl builder
+ */
+ default OpenAIEndpointBuilder llm(String path) {
+ return OpenAIEndpointBuilderFactory.endpointBuilder("llm", path);
Review Comment:
⚠️ **`llm(String componentName, String path)` two-arg overload still missing
(raised in review #9).**
`openai(String componentName, String path)` exists at line 7061 in this
file. The `llm` entry has only the single-arg form. Users switching from
`openai` to `llm` who use the two-arg form (needed when registering a custom
component bean under the `llm` scheme name) will find no equivalent and must
fall back to `openai()` — defeating the purpose of the alias.
Add immediately after the `llm(String path)` method:
```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.
*
* @param componentName to use a custom component name for the
endpoint instead of the default name
* @param path operation
* @return the dsl builder
*/
default OpenAIEndpointBuilder llm(String componentName, String path)
{
return
OpenAIEndpointBuilderFactory.endpointBuilder(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:
⚠️ **`llm()` header builder alias still missing (raised in review #9).**
This file exposes `openai()` → `OpenAIHeaderNameBuilder.INSTANCE`. Users
writing routes with the `llm:` scheme and the fluent header DSL will look for
`llm()` here. The method is a trivial one-liner. Add it directly after the
`openai()` block:
```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.
*
* Category: ai
* Since: 4.17
* Maven coordinates: org.apache.camel:camel-openai
*
* @return the dsl builder
*/
public static OpenAIEndpointBuilderFactory.OpenAIHeaderNameBuilder llm()
{
return OpenAIEndpointBuilderFactory.OpenAIHeaderNameBuilder.INSTANCE;
}
```
--
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]