Azure OpenAI Embeddor

Enterprise Azure Embeddings

Overview

Generate embeddings using Azure OpenAI's enterprise-grade models. Features secure Azure integration, flexible deployment options, and version control through API versioning.

Azure OpenAI Embeddor Diagram

Available Models

  • text-embedding-ada-002
  • text-embedding-3-small
  • text-embedding-3-large

Key Features

  • Azure security integration
  • API version control
  • Custom deployments
  • Flexible dimensions

Configuration

Required Parameters

  • modelAzure OpenAI model name
  • azureEndpointAzure endpoint URL
  • deploymentNameAzure deployment name
  • apiKeyAzure API key

Optional Parameters

  • apiVersionDefault: 2023-05-15
  • dimensionsOutput vector dimensions

Example Usage

// Basic configuration
const embedder = new AzureOpenAIEmbeddor({
  model: "text-embedding-ada-002",
  azureEndpoint: "https://your-resource.openai.azure.com",
  deploymentName: "your-deployment",
  apiKey: "your-api-key"
});

// Advanced configuration
const advancedEmbedder = new AzureOpenAIEmbeddor({
  model: "text-embedding-3-large",
  azureEndpoint: "https://your-resource.openai.azure.com",
  deploymentName: "your-deployment",
  apiKey: "your-api-key",
  apiVersion: "2024-02-15",
  dimensions: 1536
});

// Generate embeddings
const result = await embedder.embed({
  input: "Your text to embed"
});

// Batch processing
const batchResult = await embedder.embedBatch({
  inputs: [
    "First text to embed",
    "Second text to embed"
  ]
});

Best Practices

  • Use environment variables for keys
  • Implement proper error handling
  • Monitor API usage
  • Cache frequent embeddings

Azure Tips

  • Use managed identities when possible
  • Set up monitoring alerts
  • Configure appropriate quotas

Response Format

{
  "embeddings": {
    "vectors": number[][],
    "dimensions": number,
    "model": string
  },
  "usage": {
    "prompt_tokens": number,
    "total_tokens": number
  },
  "metadata": {
    "model_version": string,
    "api_version": string,
    "deployment": string,
    "processing_time": number
  },
  "status": {
    "success": boolean,
    "error": string | null
  }
}