WeaviateEx.Integrations (WeaviateEx v0.7.4)

View Source

API integration header builders for external AI providers.

Weaviate uses custom HTTP headers to pass API keys for various AI service integrations (vectorizers, generative modules, rerankers).

Examples

# Single provider
headers = Integrations.openai(api_key: "sk-...")

# Multiple providers
headers = Integrations.merge([
  Integrations.openai(api_key: "sk-..."),
  Integrations.cohere(api_key: "cohere-key"),
  Integrations.huggingface(api_key: "hf-key")
])

# Use with client
WeaviateEx.Client.new(
  base_url: "http://localhost:8080",
  headers: headers
)

Summary

Functions

Anthropic integration headers.

AWS integration headers.

Azure OpenAI integration headers.

Cohere integration headers.

Databricks integration headers.

Google/Vertex AI integration headers.

HuggingFace integration headers.

JinaAI integration headers.

Merge multiple integration header lists.

Mistral integration headers.

NVIDIA integration headers.

OpenAI integration headers.

VoyageAI integration headers.

Types

headers()

@type headers() :: [{String.t(), String.t()}]

Functions

anthropic(opts)

@spec anthropic(keyword()) :: headers()

Anthropic integration headers.

Options

  • :api_key - Anthropic API key (required)

Examples

Integrations.anthropic(api_key: "anthropic-key")

aws(opts)

@spec aws(keyword()) :: headers()

AWS integration headers.

Options

  • :access_key - AWS access key ID (required)
  • :secret_key - AWS secret access key (required)
  • :session_token - AWS session token (optional, for temporary credentials)

Examples

Integrations.aws(access_key: "AKIA...", secret_key: "secret")
Integrations.aws(access_key: "AKIA...", secret_key: "secret", session_token: "token")

azure_openai(opts)

@spec azure_openai(keyword()) :: headers()

Azure OpenAI integration headers.

Options

  • :api_key - Azure OpenAI API key (required)

Examples

Integrations.azure_openai(api_key: "azure-key")

cohere(opts)

@spec cohere(keyword()) :: headers()

Cohere integration headers.

Options

  • :api_key - Cohere API key (required)
  • :requests_per_minute_embeddings - Rate limit for embedding requests per minute (optional)
  • :base_url - Custom base URL for the API (optional)

Examples

Integrations.cohere(api_key: "cohere-key")
Integrations.cohere(api_key: "cohere-key", requests_per_minute_embeddings: 1000)

databricks(opts)

@spec databricks(keyword()) :: headers()

Databricks integration headers.

Options

  • :token - Databricks access token (required)

Examples

Integrations.databricks(token: "dapi...")

google(opts)

@spec google(keyword()) :: headers()

Google/Vertex AI integration headers.

Options

  • :api_key - Google API key (required)
  • :vertex - Set to true for Vertex AI (optional)

Examples

Integrations.google(api_key: "google-key")
Integrations.google(api_key: "google-key", vertex: true)

huggingface(opts)

@spec huggingface(keyword()) :: headers()

HuggingFace integration headers.

Options

  • :api_key - HuggingFace API key (required)

Examples

Integrations.huggingface(api_key: "hf-key")

jinaai(opts)

@spec jinaai(keyword()) :: headers()

JinaAI integration headers.

Options

  • :api_key - JinaAI API key (required)

Examples

Integrations.jinaai(api_key: "jina-key")

merge(header_lists)

@spec merge([headers()]) :: headers()

Merge multiple integration header lists.

Examples

headers = Integrations.merge([
  Integrations.openai(api_key: "sk-..."),
  Integrations.cohere(api_key: "cohere-key")
])

mistral(opts)

@spec mistral(keyword()) :: headers()

Mistral integration headers.

Options

  • :api_key - Mistral API key (required)

Examples

Integrations.mistral(api_key: "mistral-key")

nvidia(opts)

@spec nvidia(keyword()) :: headers()

NVIDIA integration headers.

Options

  • :api_key - NVIDIA API key (required)

Examples

Integrations.nvidia(api_key: "nvidia-key")

openai(opts)

@spec openai(keyword()) :: headers()

OpenAI integration headers.

Options

  • :api_key - OpenAI API key (required)
  • :organization - OpenAI organization ID (optional)
  • :requests_per_minute_embeddings - Rate limit for embedding requests per minute (optional)
  • :tokens_per_minute_embeddings - Rate limit for tokens per minute for embeddings (optional)
  • :base_url - Custom base URL for the API (optional)

Examples

Integrations.openai(api_key: "sk-...")
Integrations.openai(api_key: "sk-...", organization: "org-123")
Integrations.openai(api_key: "sk-...", requests_per_minute_embeddings: 3000)

voyageai(opts)

@spec voyageai(keyword()) :: headers()

VoyageAI integration headers.

Options

  • :api_key - VoyageAI API key (required)

Examples

Integrations.voyageai(api_key: "voyage-key")