Sensedia AI Copilot
The Sensedia AI Copilot is an AI assistant specialized in Camel integrations using the YAML DSL format. With this tool, you can quickly create or edit Camel integration scripts, reducing development time and increasing efficiency.
Sensedia AI Copilot is currently in beta version. This means the feature is still evolving and may undergo adjustments. |
To use Sensedia AI Copilot:
-
Click on the
icon in the Source Code tab on the Source screen.
-
Enter the prompt with instructions to create or edit an integration and click the arrow on the right to submit it.
-
Copy the generated code by clicking the copy icon in the top-right corner of the chat box.
-
Paste the script into the
main.yaml
code editor.
The conversation history will be automatically deleted when you leave the Source screen. |
Creating prompts
It is very important that the prompt is clear and specific to achieve the best results. Here are some tips for creating effective prompts:
-
Camel components: explicitly mention the Camel components you want to use and their purpose in the integration route.
Examples
-
Create a route that starts with a
timer
component to execute every 10 seconds. -
Use the
http
component to make a GET call to an external API. -
Send the result to a queue using the
kafka
component.
-
-
Enterprise Integration Patterns (EIPs): specify the EIPs the route should implement and what should be done at each step.
Examples
-
Use the
setProperty
EIP to extract theclientId
field from the JSON body and store it as an exchange property calledidClientProp
. -
Use the
setHeader
EIP to define a header namedStatusProcessing
with the initial valueRECEIVED
. -
Use the
setBody
EIP to transform the message body, selecting only theitem
andquantity
fields from the original JSON using asimple
expression.
-
-
Involved systems and endpoints: describe the source and destination systems, including their respective endpoints (URIs), when possible.
Examples
-
Read from a Kafka queue named
new_orders
. -
Send a
POST
request to thehttp://api.partner.com/webhook
endpoint. -
Write to a file in the
/opt/files/processed
directory.
-
The more details you provide, the more accurate the generated script will be. |
Resource files and flow variables must be created manually, but Sensedia AI Copilot can suggest their content. |
Examples
Check out examples of prompts you can use as references:
The examples below are organized by topic for quicker and smoother reading, but you should type your prompt as a continuous text, without line breaks. |
SQS to HTTP with JSLT transformation and DLQ
-
I want to create an integration that consumes messages from an AWS SQS queue.
-
For each message, which is in JSON format, transform it using a JSLT template.
-
Then, send the transformed JSON in an HTTP POST request.
-
If the HTTP call results in an error, log the error message and the original message body.
-
Next, send the original SQS message to a dead-letter SQS queue.
-
Use placeholders for AWS accessKey and secretKey.
REST API with JSON validation and HTTP enrichment
-
Build an integration with a REST API endpoint
POST /orders
that accepts a JSON payload. -
First, validate the payload against a JSON schema.
-
If validation fails, respond with HTTP 400 and a JSON error body.
-
If valid, extract the
customerId
andorderId
from the payload. Log these IDs. -
Then, enrich the original message by calling an external HTTP GET service. Store the response from this service (JSON) in a property.
-
Finally, build a new JSON response body combining the original order and the
customerDetails
. Log the modified body and return HTTP 200.
Conditional order processing via REST with Camel and Slack
-
Create an integration that exposes a REST POST endpoint at
/api/pedidos
. -
When receiving a request, first log the received message.
-
Then, check if the
statusPedido
property in the request body (JSON) is equal toCONCLUÍDO
. -
If this condition is true, send the original request payload to another HTTP POST endpoint.
-
Otherwise, if the condition is false, send a message to Slack with the text
Pedido com ID não está CONCLUÍDO
.
Additional tips
-
Specify the flow structure: provide as much detail as possible about the desired flow components.
-
Use clear and direct instructions: give concise commands about the specific section or the entire route to be generated by the AI.
-
Mention specific connectors: indicate the names of connectors to be used if you already know them.
-
Break down complex prompts: for elaborate requests, divide the task into smaller steps and request adjustments from the AI as needed.
Share your suggestions with us!
Click here and then [+ Submit idea]