WeaviateEx.API.Vectorizers.Text2VecOpenAI (WeaviateEx v0.7.4)
View SourceText2Vec-OpenAI vectorizer configuration.
Uses OpenAI's embedding models for text vectorization.
Example
# Basic usage with default model
Text2VecOpenAI.new(model: "text-embedding-ada-002")
# With dimensions (for text-embedding-3-* models)
Text2VecOpenAI.new(
model: "text-embedding-3-small",
dimensions: 512
)
# Full configuration
Text2VecOpenAI.new(
model: "text-embedding-3-large",
dimensions: 1024,
base_url: "https://custom.openai.com",
type: :text,
vectorize_collection_name: false
)
Summary
Functions
Parse configuration from API response.
Create a new Text2Vec-OpenAI configuration.
Convert configuration to API format.
Returns the vectorizer name for the API.
Types
@type embedding_type() :: :text | :code
@type t() :: %WeaviateEx.API.Vectorizers.Text2VecOpenAI{ base_url: String.t() | nil, dimensions: pos_integer() | nil, model: String.t() | nil, type: embedding_type() | nil, vectorize_collection_name: boolean() }
Functions
Parse configuration from API response.
Create a new Text2Vec-OpenAI configuration.
Options
:model- OpenAI model name (e.g., "text-embedding-ada-002", "text-embedding-3-small"):dimensions- Output dimensions (only for text-embedding-3-* models):base_url- Custom OpenAI API endpoint:type- Embedding type, either:textor:code:vectorize_collection_name- Include collection name in vectorization (default: true)
Convert configuration to API format.
@spec vectorizer_name() :: String.t()
Returns the vectorizer name for the API.