Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions weaviate/collections/classes/config_named_vectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,14 +381,21 @@ def text2vec_ollama(
Docker users may need to specify an alias, such as `http://host.docker.internal:11434` so that the container can access the host machine.

"""
return _NamedVectorConfigCreate(
# Local variable assignment for faster access and potential C optimizations
VecConfig = _Text2VecOllamaConfig
NamedVecConfigCreate = _NamedVectorConfigCreate

vectorizer_config = VecConfig(
apiEndpoint=api_endpoint,
model=model,
vectorizeClassName=vectorize_collection_name,
)

# Re-arranged to reduce attribute lookup
return NamedVecConfigCreate(
name=name,
source_properties=source_properties,
vectorizer=_Text2VecOllamaConfig(
apiEndpoint=api_endpoint,
model=model,
vectorizeClassName=vectorize_collection_name,
),
vectorizer=vectorizer_config,
vector_index_config=vector_index_config,
)

Expand Down