This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git
The following commit(s) were added to refs/heads/main by this push:
new 465cde0d Remove OpenAI related Kamelets since outdated (#2103)
465cde0d is described below
commit 465cde0d8a4ed614ef896dc46c30f98dde334475
Author: Andrea Cosentino <[email protected]>
AuthorDate: Fri Jul 12 11:45:25 2024 +0200
Remove OpenAI related Kamelets since outdated (#2103)
Signed-off-by: Andrea Cosentino <[email protected]>
---
docs/modules/ROOT/nav.adoc | 2 -
kamelets/openai-classification-action.kamelet.yaml | 148 ---------------------
kamelets/openai-completion-action.kamelet.yaml | 109 ---------------
.../openai-classification-action.kamelet.yaml | 148 ---------------------
.../kamelets/openai-completion-action.kamelet.yaml | 109 ---------------
5 files changed, 516 deletions(-)
diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc
index 9630650a..35629fc9 100644
--- a/docs/modules/ROOT/nav.adoc
+++ b/docs/modules/ROOT/nav.adoc
@@ -186,8 +186,6 @@
* xref:nats-source.adoc[]
* xref:nominatim-geocode-action.adoc[]
* xref:ogcapi-features-action.adoc[]
-* xref:openai-classification-action.adoc[]
-* xref:openai-completion-action.adoc[]
* xref:opensearch-index-sink.adoc[]
* xref:opensearch-search-source.adoc[]
* xref:oracle-database-sink.adoc[]
diff --git a/kamelets/openai-classification-action.kamelet.yaml
b/kamelets/openai-classification-action.kamelet.yaml
deleted file mode 100644
index 5d80ec44..00000000
--- a/kamelets/openai-classification-action.kamelet.yaml
+++ /dev/null
@@ -1,148 +0,0 @@
-# ---------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ---------------------------------------------------------------------------
-apiVersion: camel.apache.org/v1
-kind: Kamelet
-metadata:
- name: openai-classification-action
- annotations:
- camel.apache.org/kamelet.support.level: "Stable"
- camel.apache.org/catalog.version: "4.7.0-SNAPSHOT"
- camel.apache.org/kamelet.icon:
"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iODk0IiBoZWlnaHQ9IjE3MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNNjI1LjU1IDM1LjIyYy0xMy43NSAwLTIzLjU3IDQuNy0yOC4zOSAxMy41OWwtMi41OSA0Ljc5VjM3LjU0aC0yMi40djk3Ljg1aDIzLjU2Vjc3LjE4YzAtMTMuOTEgNy41NS0yMS44OSAyMC43My0yMS44OSAxMi41NiAwIDE5Ljc2IDcuNzYgMTkuNzYgMjEuMzF2NTguNzloMjMuNTZ2LTYzYzAtMjMuMjYtMTIuOC0zNy4xNy0zNC4yMy0zNy4xN3ptLTExNC4yMiAwYy0yNy
[...]
- camel.apache.org/provider: "Apache Software Foundation"
- camel.apache.org/kamelet.group: "OpenAI"
- camel.apache.org/kamelet.namespace: "AI"
- labels:
- camel.apache.org/kamelet.type: "action"
-spec:
- definition:
- title: "OpenAI Classification Action"
- description: |
- Classifies a sentence using the OpenAI API.
-
- It requires an OpenAI account (beta accounts available at
https://beta.openai.com/).
-
- Training data for classification can be provided in advance by uploading
a file with purpose="classifications", see:
https://beta.openai.com/docs/api-reference/files/upload.
-
- The Kamelet accepts data in:
-
- - `text/plain` format (default)
- - `application/json` format: see reference at
https://beta.openai.com/docs/api-reference/classifications/create
-
- required:
- - authorizationToken
- type: object
- properties:
- authorizationToken:
- title: Authorization Token
- description: The authorization token to use to contact the openAI API
- type: string
- format: password
- x-descriptors:
- - urn:camel:group:credentials
- format:
- title: Format
- description: The response format ('text/plain' or 'application/json'
are supported)
- type: string
- default: text/plain
- engine:
- title: Engine
- description: The OpenAI engine to use
- type: string
- default: davinci
- file:
- title: Examples File
- description: The ID of an uploaded file containing examples for
classification
- type: string
- example: "file-9HbeJXxtG7pg1YTXRx1v1fmn"
- types:
- in:
- mediaType: text/plain
- out:
- mediaType: text/plain
- dependencies:
- - "mvn:org.apache.camel.kamelets:camel-kamelets-utils:4.7.0-SNAPSHOT"
- - "camel:jackson"
- - "camel:jsonpath"
- - "camel:core"
- - "camel:kamelet"
- - "camel:http"
- template:
- from:
- uri: kamelet:source
- steps:
- - choice:
- when:
- - simple: "${header[Content-Type]} == null ||
${header[Content-Type]} == 'text/plain'"
- steps:
- - convertBodyTo:
- type: "java.lang.String"
- - transform:
- simple: "${bean:type:java.util.Map?method=of('query',
${body})}"
- - marshal:
- json: {}
- - unmarshal:
- json:
- library: Jackson
- unmarshalType: com.fasterxml.jackson.databind.JsonNode
- - choice:
- when:
- - simple: "${body.has('model')} == false"
- steps:
- - setProperty:
- name: "field"
- constant: "model"
- - setProperty:
- name: "value"
- constant: "{{engine}}"
- - bean: "org.apache.camel.kamelets.utils.transform.InsertField"
- - setProperty:
- name: "file"
- constant: "{{file:}}"
- - choice:
- when:
- - simple: "${body.has('file')} == false && ${exchangeProperty.file}
!= null"
- steps:
- - setProperty:
- name: "field"
- constant: "file"
- - setProperty:
- name: "value"
- simple: "${exchangeProperty.file}"
- - bean: "org.apache.camel.kamelets.utils.transform.InsertField"
- - marshal:
- json: {}
- - setHeader:
- name: "Authorization"
- simple: "Bearer {{authorizationToken}}"
- - setHeader:
- name: "Content-Type"
- constant: "application/json"
- - to: "https://api.openai.com/v1/classifications"
- - removeHeader:
- name: "Authorization"
- - setProperty:
- name: format
- constant: "{{format}}"
- - choice:
- when:
- - simple: "${exchangeProperty.format} == 'text/plain'"
- steps:
- - transform:
- jsonpath: "$.label"
- - setHeader:
- name: "Content-Type"
- constant: "text/plain"
diff --git a/kamelets/openai-completion-action.kamelet.yaml
b/kamelets/openai-completion-action.kamelet.yaml
deleted file mode 100644
index fbea55dc..00000000
--- a/kamelets/openai-completion-action.kamelet.yaml
+++ /dev/null
@@ -1,109 +0,0 @@
-# ---------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ---------------------------------------------------------------------------
-apiVersion: camel.apache.org/v1
-kind: Kamelet
-metadata:
- name: openai-completion-action
- annotations:
- camel.apache.org/kamelet.support.level: "Stable"
- camel.apache.org/catalog.version: "4.7.0-SNAPSHOT"
- camel.apache.org/kamelet.icon:
"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iODk0IiBoZWlnaHQ9IjE3MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNNjI1LjU1IDM1LjIyYy0xMy43NSAwLTIzLjU3IDQuNy0yOC4zOSAxMy41OWwtMi41OSA0Ljc5VjM3LjU0aC0yMi40djk3Ljg1aDIzLjU2Vjc3LjE4YzAtMTMuOTEgNy41NS0yMS44OSAyMC43My0yMS44OSAxMi41NiAwIDE5Ljc2IDcuNzYgMTkuNzYgMjEuMzF2NTguNzloMjMuNTZ2LTYzYzAtMjMuMjYtMTIuOC0zNy4xNy0zNC4yMy0zNy4xN3ptLTExNC4yMiAwYy0yNy
[...]
- camel.apache.org/provider: "Apache Software Foundation"
- camel.apache.org/kamelet.group: "OpenAI"
- camel.apache.org/kamelet.namespace: "AI"
- labels:
- camel.apache.org/kamelet.type: "action"
-spec:
- definition:
- title: "OpenAI Completion Action"
- description: |
- Completes a sentence using the OpenAI API.
-
- It requires an OpenAI account (beta accounts available at
https://beta.openai.com/).
-
- The Kamelet accepts data in:
-
- - `text/plain` format (default)
- - `application/json` format: see reference at
https://beta.openai.com/docs/api-reference/completions/create
-
- required:
- - authorizationToken
- type: object
- properties:
- authorizationToken:
- title: Authorization Token
- description: The authorization token to use to contact the openAI API
- type: string
- format: password
- x-descriptors:
- - urn:camel:group:credentials
- format:
- title: Format
- description: The response format ('text/plain' or 'application/json'
are supported)
- type: string
- default: text/plain
- engine:
- title: Engine
- description: The OpenAI engine to use
- type: string
- default: davinci
- types:
- in:
- mediaType: text/plain
- out:
- mediaType: text/plain
- dependencies:
- - "camel:jackson"
- - "camel:jsonpath"
- - "camel:core"
- - "camel:kamelet"
- - "camel:http"
- template:
- from:
- uri: kamelet:source
- steps:
- - choice:
- when:
- - simple: "${header[Content-Type]} == null ||
${header[Content-Type]} == 'text/plain'"
- steps:
- - convertBodyTo:
- type: "java.lang.String"
- - transform:
- simple: "${bean:type:java.util.Map?method=of('prompt',
${body})}"
- - marshal:
- json: {}
- - setHeader:
- name: "Authorization"
- simple: "Bearer {{authorizationToken}}"
- - setHeader:
- name: "Content-Type"
- constant: "application/json"
- - to: "https://api.openai.com/v1/engines/{{engine}}/completions"
- - removeHeader:
- name: "Authorization"
- - setProperty:
- name: format
- constant: "{{format}}"
- - choice:
- when:
- - simple: "${exchangeProperty.format} == 'text/plain'"
- steps:
- - transform:
- jsonpath: "$.choices[0].text"
- - setHeader:
- name: "Content-Type"
- constant: "text/plain"
diff --git
a/library/camel-kamelets/src/main/resources/kamelets/openai-classification-action.kamelet.yaml
b/library/camel-kamelets/src/main/resources/kamelets/openai-classification-action.kamelet.yaml
deleted file mode 100644
index 5d80ec44..00000000
---
a/library/camel-kamelets/src/main/resources/kamelets/openai-classification-action.kamelet.yaml
+++ /dev/null
@@ -1,148 +0,0 @@
-# ---------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ---------------------------------------------------------------------------
-apiVersion: camel.apache.org/v1
-kind: Kamelet
-metadata:
- name: openai-classification-action
- annotations:
- camel.apache.org/kamelet.support.level: "Stable"
- camel.apache.org/catalog.version: "4.7.0-SNAPSHOT"
- camel.apache.org/kamelet.icon:
"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iODk0IiBoZWlnaHQ9IjE3MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNNjI1LjU1IDM1LjIyYy0xMy43NSAwLTIzLjU3IDQuNy0yOC4zOSAxMy41OWwtMi41OSA0Ljc5VjM3LjU0aC0yMi40djk3Ljg1aDIzLjU2Vjc3LjE4YzAtMTMuOTEgNy41NS0yMS44OSAyMC43My0yMS44OSAxMi41NiAwIDE5Ljc2IDcuNzYgMTkuNzYgMjEuMzF2NTguNzloMjMuNTZ2LTYzYzAtMjMuMjYtMTIuOC0zNy4xNy0zNC4yMy0zNy4xN3ptLTExNC4yMiAwYy0yNy
[...]
- camel.apache.org/provider: "Apache Software Foundation"
- camel.apache.org/kamelet.group: "OpenAI"
- camel.apache.org/kamelet.namespace: "AI"
- labels:
- camel.apache.org/kamelet.type: "action"
-spec:
- definition:
- title: "OpenAI Classification Action"
- description: |
- Classifies a sentence using the OpenAI API.
-
- It requires an OpenAI account (beta accounts available at
https://beta.openai.com/).
-
- Training data for classification can be provided in advance by uploading
a file with purpose="classifications", see:
https://beta.openai.com/docs/api-reference/files/upload.
-
- The Kamelet accepts data in:
-
- - `text/plain` format (default)
- - `application/json` format: see reference at
https://beta.openai.com/docs/api-reference/classifications/create
-
- required:
- - authorizationToken
- type: object
- properties:
- authorizationToken:
- title: Authorization Token
- description: The authorization token to use to contact the openAI API
- type: string
- format: password
- x-descriptors:
- - urn:camel:group:credentials
- format:
- title: Format
- description: The response format ('text/plain' or 'application/json'
are supported)
- type: string
- default: text/plain
- engine:
- title: Engine
- description: The OpenAI engine to use
- type: string
- default: davinci
- file:
- title: Examples File
- description: The ID of an uploaded file containing examples for
classification
- type: string
- example: "file-9HbeJXxtG7pg1YTXRx1v1fmn"
- types:
- in:
- mediaType: text/plain
- out:
- mediaType: text/plain
- dependencies:
- - "mvn:org.apache.camel.kamelets:camel-kamelets-utils:4.7.0-SNAPSHOT"
- - "camel:jackson"
- - "camel:jsonpath"
- - "camel:core"
- - "camel:kamelet"
- - "camel:http"
- template:
- from:
- uri: kamelet:source
- steps:
- - choice:
- when:
- - simple: "${header[Content-Type]} == null ||
${header[Content-Type]} == 'text/plain'"
- steps:
- - convertBodyTo:
- type: "java.lang.String"
- - transform:
- simple: "${bean:type:java.util.Map?method=of('query',
${body})}"
- - marshal:
- json: {}
- - unmarshal:
- json:
- library: Jackson
- unmarshalType: com.fasterxml.jackson.databind.JsonNode
- - choice:
- when:
- - simple: "${body.has('model')} == false"
- steps:
- - setProperty:
- name: "field"
- constant: "model"
- - setProperty:
- name: "value"
- constant: "{{engine}}"
- - bean: "org.apache.camel.kamelets.utils.transform.InsertField"
- - setProperty:
- name: "file"
- constant: "{{file:}}"
- - choice:
- when:
- - simple: "${body.has('file')} == false && ${exchangeProperty.file}
!= null"
- steps:
- - setProperty:
- name: "field"
- constant: "file"
- - setProperty:
- name: "value"
- simple: "${exchangeProperty.file}"
- - bean: "org.apache.camel.kamelets.utils.transform.InsertField"
- - marshal:
- json: {}
- - setHeader:
- name: "Authorization"
- simple: "Bearer {{authorizationToken}}"
- - setHeader:
- name: "Content-Type"
- constant: "application/json"
- - to: "https://api.openai.com/v1/classifications"
- - removeHeader:
- name: "Authorization"
- - setProperty:
- name: format
- constant: "{{format}}"
- - choice:
- when:
- - simple: "${exchangeProperty.format} == 'text/plain'"
- steps:
- - transform:
- jsonpath: "$.label"
- - setHeader:
- name: "Content-Type"
- constant: "text/plain"
diff --git
a/library/camel-kamelets/src/main/resources/kamelets/openai-completion-action.kamelet.yaml
b/library/camel-kamelets/src/main/resources/kamelets/openai-completion-action.kamelet.yaml
deleted file mode 100644
index fbea55dc..00000000
---
a/library/camel-kamelets/src/main/resources/kamelets/openai-completion-action.kamelet.yaml
+++ /dev/null
@@ -1,109 +0,0 @@
-# ---------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ---------------------------------------------------------------------------
-apiVersion: camel.apache.org/v1
-kind: Kamelet
-metadata:
- name: openai-completion-action
- annotations:
- camel.apache.org/kamelet.support.level: "Stable"
- camel.apache.org/catalog.version: "4.7.0-SNAPSHOT"
- camel.apache.org/kamelet.icon:
"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iODk0IiBoZWlnaHQ9IjE3MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNNjI1LjU1IDM1LjIyYy0xMy43NSAwLTIzLjU3IDQuNy0yOC4zOSAxMy41OWwtMi41OSA0Ljc5VjM3LjU0aC0yMi40djk3Ljg1aDIzLjU2Vjc3LjE4YzAtMTMuOTEgNy41NS0yMS44OSAyMC43My0yMS44OSAxMi41NiAwIDE5Ljc2IDcuNzYgMTkuNzYgMjEuMzF2NTguNzloMjMuNTZ2LTYzYzAtMjMuMjYtMTIuOC0zNy4xNy0zNC4yMy0zNy4xN3ptLTExNC4yMiAwYy0yNy
[...]
- camel.apache.org/provider: "Apache Software Foundation"
- camel.apache.org/kamelet.group: "OpenAI"
- camel.apache.org/kamelet.namespace: "AI"
- labels:
- camel.apache.org/kamelet.type: "action"
-spec:
- definition:
- title: "OpenAI Completion Action"
- description: |
- Completes a sentence using the OpenAI API.
-
- It requires an OpenAI account (beta accounts available at
https://beta.openai.com/).
-
- The Kamelet accepts data in:
-
- - `text/plain` format (default)
- - `application/json` format: see reference at
https://beta.openai.com/docs/api-reference/completions/create
-
- required:
- - authorizationToken
- type: object
- properties:
- authorizationToken:
- title: Authorization Token
- description: The authorization token to use to contact the openAI API
- type: string
- format: password
- x-descriptors:
- - urn:camel:group:credentials
- format:
- title: Format
- description: The response format ('text/plain' or 'application/json'
are supported)
- type: string
- default: text/plain
- engine:
- title: Engine
- description: The OpenAI engine to use
- type: string
- default: davinci
- types:
- in:
- mediaType: text/plain
- out:
- mediaType: text/plain
- dependencies:
- - "camel:jackson"
- - "camel:jsonpath"
- - "camel:core"
- - "camel:kamelet"
- - "camel:http"
- template:
- from:
- uri: kamelet:source
- steps:
- - choice:
- when:
- - simple: "${header[Content-Type]} == null ||
${header[Content-Type]} == 'text/plain'"
- steps:
- - convertBodyTo:
- type: "java.lang.String"
- - transform:
- simple: "${bean:type:java.util.Map?method=of('prompt',
${body})}"
- - marshal:
- json: {}
- - setHeader:
- name: "Authorization"
- simple: "Bearer {{authorizationToken}}"
- - setHeader:
- name: "Content-Type"
- constant: "application/json"
- - to: "https://api.openai.com/v1/engines/{{engine}}/completions"
- - removeHeader:
- name: "Authorization"
- - setProperty:
- name: format
- constant: "{{format}}"
- - choice:
- when:
- - simple: "${exchangeProperty.format} == 'text/plain'"
- steps:
- - transform:
- jsonpath: "$.choices[0].text"
- - setHeader:
- name: "Content-Type"
- constant: "text/plain"