AI Tutorials
Last updated
Was this helpful?
Last updated
Was this helpful?
With Emporix support for AI, you can enhance text for product descriptions and generate AI completions.
Make sure to configure your API token. To do that, you can use the Configuration Service and store the token under openAiApiToken
key.
You can generate the text by sending a request based on a provided prompt. To send the request, use the Text Generation endpoint.
curl -i -X POST \
'http://api.emporix.io/ai-service/{tenant}/texts' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"id": "en",
"prompt": "Generate a long description for product '\''pipe cutter'\'' in language EN ",
"maxTokens": 2048
}'
Completion is generated based on chat history. It's a generated response or continuation of a conversation, crafted by the AI to address the given input in context. It can include answering questions, providing suggestions, or completing a sentence or thought. The currently supported AI engine for the completion is OpenAI. To generate the AI completion, send the request using the AI Completions endpoint.
curl -i -X POST \
'http://api.emporix.io/ai-service/{tenant}/completions' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"id": "abc-123",
"messages": [
{
"role": "SYSTEM",
"content": "You are an assistant responsible for creating a configuration based on information provided by user."
}
]
}'
To see some more examples of using AI at Emporix, check our guides for Management Dashboard - .
To test the endpoint, open the API reference below or check the example of a curl request.
To test the endpoint, open the API reference below or check the example of a curl request.