Actions7
Overview
The "Azure OpenAI by YOOV" node for n8n allows users to interact with the Azure OpenAI API, specifically targeting the "Completions" resource and its default operation. This node is useful for generating text completions using various AI models deployed on Azure, such as GPT-3.5 Turbo. Common scenarios include automating content generation, summarizing text, or building conversational agents within n8n workflows.
Practical examples:
- Automatically generate email responses based on input prompts.
- Summarize long documents or extract key points.
- Create chatbots that leverage Azure-hosted OpenAI models.
Properties
Name | Meaning |
---|---|
Model in Current Deployment | Selects which AI model to use for the completion. Options: gpt-35-turbo , gpt-35-turbo-16k , text-embedding-ada-002 . |
Output
- The output is a JSON object containing the response from the Azure OpenAI API for the completion request.
- The structure typically includes fields such as:
id
: Unique identifier for the completion.object
: Type of object returned (e.g., "text_completion").created
: Timestamp of creation.model
: The model used for the completion.choices
: An array of generated completions, each with properties liketext
andfinish_reason
.usage
: Information about token usage (prompt tokens, completion tokens, total tokens).
Example output:
{
"id": "cmpl-abc123",
"object": "text_completion",
"created": 1680000000,
"model": "gpt-35-turbo",
"choices": [
{
"text": "This is the generated completion.",
"index": 0,
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 10,
"completion_tokens": 20,
"total_tokens": 30
}
}
Dependencies
- External Service: Requires access to Azure OpenAI API.
- API Key/Credentials: You must configure the
yoovAzureOpenAIApi
credential in n8n, including the Azure endpoint hostname and authentication details. - n8n Configuration: Ensure the node is properly configured with the correct resource ("completions") and operation.
Troubleshooting
Common issues:
- Invalid Credentials: If the API key or endpoint is incorrect, you may receive authentication errors. Double-check your Azure credentials.
- Model Not Deployed: If the selected model is not available in your Azure deployment, the API will return an error. Make sure the chosen model is deployed and accessible.
- Input Errors: Missing required fields or invalid parameter values can cause the node to fail. Ensure all mandatory properties are set.
Error messages:
"error": "Request failed with status code 401"
– Indicates authentication failure. Check your API key and endpoint."error": "Model not found"
– The specified model is not available. Verify your Azure deployment."error": "Invalid input"
– One or more parameters are missing or malformed.