Skip to content

Commit e31c0d8

Browse files
jfrench9claude
andauthored
Add materialization_embeddings option to materialization API (#83)
## Summary This PR introduces a new `materialization_embeddings` option to the materialization pipeline, allowing clients to control whether embeddings are materialized as part of a materialization request. ## Key Changes - **`MaterializationOptions`**: Added a new `materialization_embeddings` boolean field (defaulting to `False`) to the options model, giving users fine-grained control over embedding materialization behavior. - **`MaterializeRequest`**: Extended the request model with the corresponding `materialization_embeddings` parameter, ensuring it is properly propagated through the request payload. - **`MaterializationClient`**: Updated the client extension to pass the `materialization_embeddings` option from `MaterializationOptions` into the `MaterializeRequest` construction, wiring the full flow end-to-end. ## Breaking Changes None. The new field defaults to `False`, preserving existing behavior for all current consumers. This is a purely additive, backwards-compatible change. ## Testing Notes - Verify that existing materialization requests continue to work without specifying the new option (default `False` behavior). - Test that setting `materialization_embeddings=True` in `MaterializationOptions` correctly includes the flag in the outgoing `MaterializeRequest` payload. - Validate the serialized request body against the expected API contract to ensure the new field is properly included when set. ## Infrastructure Considerations - The backend/API must already support the `materialization_embeddings` field in the materialization endpoint; otherwise, the parameter may be silently ignored or cause validation errors depending on the server's strictness. - No new dependencies or environment changes are required. --- 🤖 Generated with [Claude Code](https://claude.ai/code) **Branch Info:** - Source: `feature/materialize-embeddings` - Target: `main` - Type: feature Co-Authored-By: Claude <noreply@anthropic.com>
2 parents e2ee130 + cbfd83d commit e31c0d8

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

‎robosystems_client/extensions/materialization_client.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class MaterializationOptions:
2727
ignore_errors: bool = True
2828
rebuild: bool = False
2929
force: bool = False
30+
materialize_embeddings: bool = False
3031
on_progress: Optional[Callable[[str], None]] = None
3132
timeout: Optional[int] = 600 # 10 minute default timeout
3233

@@ -112,6 +113,7 @@ def materialize(
112113
ignore_errors=options.ignore_errors,
113114
rebuild=options.rebuild,
114115
force=options.force,
116+
materialize_embeddings=options.materialize_embeddings,
115117
)
116118

117119
from ..client import AuthenticatedClient

‎robosystems_client/models/materialize_request.py‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,17 @@ class MaterializeRequest:
2222
source (None | str | Unset): Data source for materialization. Auto-detected from graph type if not specified.
2323
'staged' materializes from uploaded files (generic graphs). 'extensions' materializes from the extensions OLTP
2424
database (entity graphs).
25+
materialize_embeddings (bool | Unset): Include embedding columns in materialization and build HNSW vector
26+
indexes in the graph database. When false (default), embedding columns are NULLed out to save space. Set to true
27+
for graphs that need vector search. Default: False.
2528
"""
2629

2730
force: bool | Unset = False
2831
rebuild: bool | Unset = False
2932
ignore_errors: bool | Unset = True
3033
dry_run: bool | Unset = False
3134
source: None | str | Unset = UNSET
35+
materialize_embeddings: bool | Unset = False
3236

3337
def to_dict(self) -> dict[str, Any]:
3438
force = self.force
@@ -45,6 +49,8 @@ def to_dict(self) -> dict[str, Any]:
4549
else:
4650
source = self.source
4751

52+
materialize_embeddings = self.materialize_embeddings
53+
4854
field_dict: dict[str, Any] = {}
4955

5056
field_dict.update({})
@@ -58,6 +64,8 @@ def to_dict(self) -> dict[str, Any]:
5864
field_dict["dry_run"] = dry_run
5965
if source is not UNSET:
6066
field_dict["source"] = source
67+
if materialize_embeddings is not UNSET:
68+
field_dict["materialize_embeddings"] = materialize_embeddings
6169

6270
return field_dict
6371

@@ -81,12 +89,15 @@ def _parse_source(data: object) -> None | str | Unset:
8189

8290
source = _parse_source(d.pop("source", UNSET))
8391

92+
materialize_embeddings = d.pop("materialize_embeddings", UNSET)
93+
8494
materialize_request = cls(
8595
force=force,
8696
rebuild=rebuild,
8797
ignore_errors=ignore_errors,
8898
dry_run=dry_run,
8999
source=source,
100+
materialize_embeddings=materialize_embeddings,
90101
)
91102

92103
return materialize_request

0 commit comments

Comments
 (0)