Integrations

Azure OpenAI

Build enterprise RAG pipelines using Aether's vector search with Azure-hosted OpenAI models.

Azure OpenAI Service gives you the same GPT models with enterprise-grade security, compliance, and regional availability. Aether handles document storage and semantic retrieval while Azure OpenAI generates grounded, context-aware answers from the retrieved content.


Prerequisites

Install the Aether SDK alongside the OpenAI SDK.

pip install aether-ai openai

Environment variables

Configuration

Set the following environment variables before running the examples below.

  • AZURE_OPENAI_ENDPOINT — your Azure OpenAI resource endpoint (required).
  • AZURE_OPENAI_API_KEY — your Azure OpenAI API key (required).
  • AZURE_OPENAI_DEPLOYMENT — the deployment name for your model (optional, defaults to gpt-4o).
  • AETHER_API_KEY — your Aether API key, loaded and passed to the client below (optional for unauthenticated deployments).

Full working example

The pattern is straightforward: retrieve relevant documents from Aether, inject them as context into an Azure-hosted model prompt, and let the model synthesize a grounded answer.

import os
from aether import AetherClient
from openai import AzureOpenAI

aether = AetherClient(api_key=os.environ.get("AETHER_API_KEY"))
results = aether.retrieve("Can I work from home full time?", k=3)
context = "\n\n".join(f"[{r.title or r.doc_id}]\n{r.content}" for r in results)

client = AzureOpenAI(
    azure_endpoint=os.environ["AZURE_OPENAI_ENDPOINT"],
    api_key=os.environ["AZURE_OPENAI_API_KEY"],
    api_version="2024-06-01",
)

response = client.chat.completions.create(
    model=os.environ.get("AZURE_OPENAI_DEPLOYMENT", "gpt-4o"),
    messages=[
        {"role": "system", "content": f"Answer using only this context:\n\n{context}"},
        {"role": "user", "content": "Can I work from home full time?"},
    ],
)

print(response.choices[0].message.content)