Azure OpenAI by YOOV icon

Azure OpenAI by YOOV

Interact with Azure OpenAI API, powered by YOOV

Actions7

Overview

The Embeddings → Create operation in the "Azure OpenAI by YOOV" n8n node allows you to generate vector embeddings for input text using Azure's OpenAI service. Embeddings are numerical representations of text that capture semantic meaning, making them useful for tasks such as semantic search, clustering, recommendation systems, and machine learning pipelines.

Common scenarios:

  • Creating semantic search engines (e.g., finding similar documents or questions).
  • Clustering or classifying text data based on meaning.
  • Feeding embeddings into downstream ML models for advanced analytics.

Practical example:
You could use this node to convert a list of customer support tickets into embeddings, then compare new tickets to existing ones to suggest relevant solutions automatically.


Properties

Name Meaning
API Version The version of the Azure OpenAI API to use. Options: 2023-07-01-preview, 2023-06-01-preview, 2023-05-15, 2023-03-15-preview, 2022-12-01, 2022-03-01-preview.
Model in Current Deployment The deployed model to use for generating embeddings. Options: gpt-35-turbo, gpt-35-turbo-16k, text-embedding-ada-002.
User The ID of the end-user, used for tracking and rate-limiting. Optional.
Input The input text to generate embeddings for. Can be a single string or an array of strings. Each input must not exceed 2048 tokens. For best results, replace newlines with spaces unless embedding code.
Input Type Specifies the type of embedding search to use. Optional.

Output

The node outputs a JSON object containing the embeddings generated by the selected model. The structure typically includes:

{
  "data": [
    {
      "embedding": [/* array of numbers */],
      "index": 0,
      "object": "embedding"
    }
    // ...more items if multiple inputs provided
  ],
  "model": "text-embedding-ada-002",
  "object": "list",
  "usage": {
    "prompt_tokens": 5,
    "total_tokens": 5
  }
}
  • data: Array of objects, each containing:
    • embedding: The vector representation (array of floats) for the input text.
    • index: Position of the input in the original request.
    • object: Always "embedding".
  • model: The model used for embedding.
  • object: Always "list".
  • usage: Token usage statistics.

Note: The actual output may vary slightly depending on the API version and model.


Dependencies

  • External Service: Requires access to Azure OpenAI service.
  • API Key/Credentials: You must configure the yoovAzureOpenAIApi credential in n8n, which should include your Azure OpenAI endpoint and API key.
  • n8n Configuration: Ensure the credentials are set up and the node is allowed to make outbound HTTP requests.

Troubleshooting

Common issues:

  • Invalid API Key or Endpoint: If credentials are incorrect, you'll receive authentication errors. Double-check your Azure OpenAI resource keys and endpoint URL.
  • Input Too Long: If the input exceeds 2048 tokens, the API will return an error. Shorten your input or split it into smaller chunks.
  • Model Not Deployed: If the specified model is not available in your Azure deployment, you'll get a model-not-found error. Check your Azure portal for available models.
  • Rate Limiting: If you exceed your quota, the API may return rate limit errors. Use the "User" property to help with tracking and managing limits.

Error messages:

  • "Resource not found": Likely due to incorrect model name or API version.
  • "Authentication failed": Check your API key and endpoint.
  • "Input too long": Reduce the size of your input text.

Links and References

Discussion