From c16ccc2c223381290fc53f09e71884af549a48e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Boschi?= Date: Thu, 29 Jan 2026 16:57:51 +0100 Subject: [PATCH] fix: hindsight-embed on macos crashes (#228) * fix: hindsight-embed on macos crashes * fix: hindsight-embed on macos crashes * fix(doc): improve docs versioning and release * fix(doc): improve docs versioning and release * fixes --- hindsight-api/hindsight_api/daemon.py | 5 +- .../hindsight_api/engine/cross_encoder.py | 102 +------ .../hindsight_api/engine/embeddings.py | 94 +------ hindsight-api/hindsight_api/main.py | 12 +- .../tests/test_cross_encoder_xpc_recovery.py | 148 ---------- .../tests/test_embedding_xpc_recovery.py | 148 ---------- .../python/hindsight_client_api/__init__.py | 4 +- .../hindsight_client_api/api/banks_api.py | 2 +- .../api/directives_api.py | 2 +- .../hindsight_client_api/api/documents_api.py | 2 +- .../hindsight_client_api/api/entities_api.py | 2 +- .../hindsight_client_api/api/memory_api.py | 2 +- .../api/mental_models_api.py | 2 +- .../api/monitoring_api.py | 2 +- .../api/operations_api.py | 2 +- .../python/hindsight_client_api/api_client.py | 2 +- .../hindsight_client_api/configuration.py | 4 +- .../python/hindsight_client_api/exceptions.py | 2 +- .../hindsight_client_api/models/__init__.py | 2 +- .../models/add_background_request.py | 2 +- .../models/async_operation_submit_response.py | 2 +- .../models/background_response.py | 2 +- .../models/bank_list_item.py | 2 +- .../models/bank_list_response.py | 2 +- .../models/bank_profile_response.py | 2 +- .../models/bank_stats_response.py | 2 +- .../hindsight_client_api/models/budget.py | 2 +- .../models/cancel_operation_response.py | 2 +- .../hindsight_client_api/models/chunk_data.py | 2 +- .../models/chunk_include_options.py | 2 +- .../models/chunk_response.py | 2 +- .../models/consolidation_response.py | 2 +- .../models/create_bank_request.py | 2 +- .../models/create_directive_request.py | 2 +- .../models/create_mental_model_request.py | 2 +- .../models/create_mental_model_response.py | 2 +- .../models/delete_document_response.py | 2 +- .../models/delete_response.py | 2 +- .../models/directive_list_response.py | 2 +- .../models/directive_response.py | 2 +- .../models/disposition_traits.py | 2 +- .../models/document_response.py | 2 +- .../models/entity_detail_response.py | 2 +- .../models/entity_include_options.py | 2 +- .../models/entity_input.py | 2 +- .../models/entity_list_item.py | 2 +- .../models/entity_list_response.py | 2 +- .../models/entity_observation_response.py | 2 +- .../models/entity_state_response.py | 2 +- .../models/features_info.py | 2 +- .../models/graph_data_response.py | 2 +- .../models/http_validation_error.py | 2 +- .../models/include_options.py | 2 +- .../models/list_documents_response.py | 2 +- .../models/list_memory_units_response.py | 2 +- .../models/list_tags_response.py | 2 +- .../models/memory_item.py | 2 +- .../models/mental_model_list_response.py | 2 +- .../models/mental_model_response.py | 2 +- .../models/mental_model_trigger.py | 2 +- .../models/operation_response.py | 2 +- .../models/operation_status_response.py | 2 +- .../models/operations_list_response.py | 2 +- .../models/recall_request.py | 2 +- .../models/recall_response.py | 2 +- .../models/recall_result.py | 2 +- .../models/reflect_based_on.py | 2 +- .../models/reflect_directive.py | 2 +- .../models/reflect_fact.py | 2 +- .../models/reflect_include_options.py | 2 +- .../models/reflect_llm_call.py | 2 +- .../models/reflect_mental_model.py | 2 +- .../models/reflect_request.py | 2 +- .../models/reflect_response.py | 2 +- .../models/reflect_tool_call.py | 2 +- .../models/reflect_trace.py | 2 +- .../models/retain_request.py | 2 +- .../models/retain_response.py | 2 +- .../hindsight_client_api/models/tag_item.py | 2 +- .../models/token_usage.py | 2 +- .../models/tool_calls_include_options.py | 2 +- .../models/update_directive_request.py | 2 +- .../models/update_disposition_request.py | 2 +- .../models/update_mental_model_request.py | 2 +- .../models/validation_error.py | 2 +- .../models/validation_error_loc_inner.py | 2 +- .../models/version_response.py | 2 +- .../python/hindsight_client_api/rest.py | 2 +- hindsight-docs/docs/sdks/embed.md | 262 ++++++++++++++++++ hindsight-docs/static/openapi.json | 2 +- hindsight-embed/hindsight_embed/cli.py | 19 ++ .../hindsight_embed/daemon_client.py | 8 +- 92 files changed, 386 insertions(+), 582 deletions(-) delete mode 100644 hindsight-api/tests/test_cross_encoder_xpc_recovery.py delete mode 100644 hindsight-api/tests/test_embedding_xpc_recovery.py create mode 100644 hindsight-docs/docs/sdks/embed.md diff --git a/hindsight-api/hindsight_api/daemon.py b/hindsight-api/hindsight_api/daemon.py index 094a2b3d..5a9c2ccd 100644 --- a/hindsight-api/hindsight_api/daemon.py +++ b/hindsight-api/hindsight_api/daemon.py @@ -52,7 +52,10 @@ class IdleTimeoutMiddleware: logger.info(f"Idle timeout reached ({self.idle_timeout}s), shutting down daemon") # Give a moment for any in-flight requests await asyncio.sleep(1) - os._exit(0) + # Send SIGTERM to ourselves to trigger graceful shutdown + import signal + + os.kill(os.getpid(), signal.SIGTERM) class DaemonLock: diff --git a/hindsight-api/hindsight_api/engine/cross_encoder.py b/hindsight-api/hindsight_api/engine/cross_encoder.py index 4d91bdb1..c655cd62 100644 --- a/hindsight-api/hindsight_api/engine/cross_encoder.py +++ b/hindsight-api/hindsight_api/engine/cross_encoder.py @@ -178,108 +178,16 @@ class LocalSTCrossEncoder(CrossEncoderModel): else: logger.info("Reranker: local provider initialized (using existing executor)") - def _is_xpc_error(self, error: Exception) -> bool: - """ - Check if an error is an XPC connection error (macOS daemon issue). - - On macOS, long-running daemons can lose XPC connections to system services - when the process is idle for extended periods. - """ - error_str = str(error).lower() - return "xpc_error_connection_invalid" in error_str or "xpc error" in error_str - - def _reinitialize_model_sync(self) -> None: - """ - Clear and reinitialize the cross-encoder model synchronously. - - This is used to recover from XPC errors on macOS where the - PyTorch/MPS backend loses its connection to system services. - """ - logger.warning(f"Reinitializing reranker model {self.model_name} due to backend error") - - # Clear existing model - self._model = None - - # Force garbage collection to free resources - import gc - - import torch - - gc.collect() - - # If using CUDA/MPS, clear the cache - if torch.cuda.is_available(): - torch.cuda.empty_cache() - elif hasattr(torch.backends, "mps") and torch.backends.mps.is_available(): - try: - torch.mps.empty_cache() - except AttributeError: - pass # Method might not exist in all PyTorch versions - - # Reinitialize the model - try: - from sentence_transformers import CrossEncoder - except ImportError: - raise ImportError( - "sentence-transformers is required for LocalSTCrossEncoder. " - "Install it with: pip install sentence-transformers" - ) - - # Determine device based on hardware availability - if self.force_cpu: - device = "cpu" - else: - # Wrap in try-except to gracefully handle any device detection issues - device = "cpu" # Default to CPU - try: - has_gpu = torch.cuda.is_available() or ( - hasattr(torch.backends, "mps") and torch.backends.mps.is_available() - ) - if has_gpu: - device = None # Let sentence-transformers auto-detect GPU/MPS - except Exception as e: - logger.warning(f"Failed to detect GPU/MPS during reinit, falling back to CPU: {e}") - - self._model = CrossEncoder( - self.model_name, - device=device, - model_kwargs={"low_cpu_mem_usage": False}, - ) - - logger.info("Reranker: local provider reinitialized successfully") - - def _predict_with_recovery(self, pairs: list[tuple[str, str]]) -> list[float]: - """ - Predict with automatic recovery from XPC errors. - - This runs synchronously in the thread pool. - """ - max_retries = 1 - for attempt in range(max_retries + 1): - try: - scores = self._model.predict(pairs, show_progress_bar=False) - return scores.tolist() if hasattr(scores, "tolist") else list(scores) - except Exception as e: - # Check if this is an XPC error (macOS daemon issue) - if self._is_xpc_error(e) and attempt < max_retries: - logger.warning(f"XPC error detected in reranker (attempt {attempt + 1}): {e}") - try: - self._reinitialize_model_sync() - logger.info("Reranker reinitialized successfully, retrying prediction") - continue - except Exception as reinit_error: - logger.error(f"Failed to reinitialize reranker: {reinit_error}") - raise Exception(f"Failed to recover from XPC error: {str(e)}") - else: - # Not an XPC error or out of retries - raise + def _predict_sync(self, pairs: list[tuple[str, str]]) -> list[float]: + """Synchronous prediction wrapper for thread pool execution.""" + scores = self._model.predict(pairs, show_progress_bar=False) + return scores.tolist() if hasattr(scores, "tolist") else list(scores) async def predict(self, pairs: list[tuple[str, str]]) -> list[float]: """ Score query-document pairs for relevance. Uses a dedicated thread pool with limited workers to prevent CPU thrashing. - Automatically recovers from XPC errors on macOS by reinitializing the model. Args: pairs: List of (query, document) tuples to score @@ -294,7 +202,7 @@ class LocalSTCrossEncoder(CrossEncoderModel): loop = asyncio.get_event_loop() return await loop.run_in_executor( LocalSTCrossEncoder._executor, - self._predict_with_recovery, + self._predict_sync, pairs, ) diff --git a/hindsight-api/hindsight_api/engine/embeddings.py b/hindsight-api/hindsight_api/engine/embeddings.py index af60cc73..c7699670 100644 --- a/hindsight-api/hindsight_api/engine/embeddings.py +++ b/hindsight-api/hindsight_api/engine/embeddings.py @@ -166,82 +166,10 @@ class LocalSTEmbeddings(Embeddings): self._dimension = self._model.get_sentence_embedding_dimension() logger.info(f"Embeddings: local provider initialized (dim: {self._dimension})") - def _is_xpc_error(self, error: Exception) -> bool: - """ - Check if an error is an XPC connection error (macOS daemon issue). - - On macOS, long-running daemons can lose XPC connections to system services - when the process is idle for extended periods. - """ - error_str = str(error).lower() - return "xpc_error_connection_invalid" in error_str or "xpc error" in error_str - - def _reinitialize_model_sync(self) -> None: - """ - Clear and reinitialize the embedding model synchronously. - - This is used to recover from XPC errors on macOS where the - PyTorch/MPS backend loses its connection to system services. - """ - logger.warning(f"Reinitializing embedding model {self.model_name} due to backend error") - - # Clear existing model - self._model = None - - # Force garbage collection to free resources - import gc - - import torch - - gc.collect() - - # If using CUDA/MPS, clear the cache - if torch.cuda.is_available(): - torch.cuda.empty_cache() - elif hasattr(torch.backends, "mps") and torch.backends.mps.is_available(): - try: - torch.mps.empty_cache() - except AttributeError: - pass # Method might not exist in all PyTorch versions - - # Reinitialize the model (inline version of initialize() but synchronous) - try: - from sentence_transformers import SentenceTransformer - except ImportError: - raise ImportError( - "sentence-transformers is required for LocalSTEmbeddings. " - "Install it with: pip install sentence-transformers" - ) - - # Determine device based on hardware availability - if self.force_cpu: - device = "cpu" - else: - # Wrap in try-except to gracefully handle any device detection issues - device = "cpu" # Default to CPU - try: - has_gpu = torch.cuda.is_available() or ( - hasattr(torch.backends, "mps") and torch.backends.mps.is_available() - ) - if has_gpu: - device = None # Let sentence-transformers auto-detect GPU/MPS - except Exception as e: - logger.warning(f"Failed to detect GPU/MPS during reinit, falling back to CPU: {e}") - - self._model = SentenceTransformer( - self.model_name, - device=device, - model_kwargs={"low_cpu_mem_usage": False}, - ) - - logger.info("Embeddings: local provider reinitialized successfully") - def encode(self, texts: list[str]) -> list[list[float]]: """ Generate embeddings for a list of texts. - Automatically recovers from XPC errors on macOS by reinitializing the model. - Args: texts: List of text strings to encode @@ -251,26 +179,8 @@ class LocalSTEmbeddings(Embeddings): if self._model is None: raise RuntimeError("Embeddings not initialized. Call initialize() first.") - # Try encoding with automatic recovery from XPC errors - max_retries = 1 - for attempt in range(max_retries + 1): - try: - embeddings = self._model.encode(texts, convert_to_numpy=True, show_progress_bar=False) - return [emb.tolist() for emb in embeddings] - except Exception as e: - # Check if this is an XPC error (macOS daemon issue) - if self._is_xpc_error(e) and attempt < max_retries: - logger.warning(f"XPC error detected in embedding generation (attempt {attempt + 1}): {e}") - try: - self._reinitialize_model_sync() - logger.info("Model reinitialized successfully, retrying embedding generation") - continue - except Exception as reinit_error: - logger.error(f"Failed to reinitialize model: {reinit_error}") - raise Exception(f"Failed to recover from XPC error: {str(e)}") - else: - # Not an XPC error or out of retries - raise + embeddings = self._model.encode(texts, convert_to_numpy=True, show_progress_bar=False) + return [emb.tolist() for emb in embeddings] class RemoteTEIEmbeddings(Embeddings): diff --git a/hindsight-api/hindsight_api/main.py b/hindsight-api/hindsight_api/main.py index 1f045817..3262064d 100644 --- a/hindsight-api/hindsight_api/main.py +++ b/hindsight-api/hindsight_api/main.py @@ -140,13 +140,6 @@ def main(): args.port = DEFAULT_DAEMON_PORT args.host = "127.0.0.1" # Only bind to localhost for security - # Force CPU mode for daemon to avoid macOS MPS/XPC issues - # MPS (Metal Performance Shaders) has unstable XPC connections in background processes - # that can cause assertion failures and process crashes at the C++ level - # (which Python exception handlers cannot catch) - os.environ["HINDSIGHT_API_EMBEDDINGS_LOCAL_FORCE_CPU"] = "1" - os.environ["HINDSIGHT_API_RERANKER_LOCAL_FORCE_CPU"] = "1" - # Check if another daemon is already running daemon_lock = DaemonLock() if not daemon_lock.acquire(): @@ -353,6 +346,7 @@ def main(): # Start idle checker in daemon mode if idle_middleware is not None: # Start the idle checker in a background thread with its own event loop + import logging import threading def run_idle_checker(): @@ -363,8 +357,8 @@ def main(): loop = asyncio.new_event_loop() asyncio.set_event_loop(loop) loop.run_until_complete(idle_middleware._check_idle()) - except Exception: - pass + except Exception as e: + logging.error(f"Idle checker error: {e}", exc_info=True) threading.Thread(target=run_idle_checker, daemon=True).start() diff --git a/hindsight-api/tests/test_cross_encoder_xpc_recovery.py b/hindsight-api/tests/test_cross_encoder_xpc_recovery.py deleted file mode 100644 index 2bb38c58..00000000 --- a/hindsight-api/tests/test_cross_encoder_xpc_recovery.py +++ /dev/null @@ -1,148 +0,0 @@ -""" -Tests for XPC error recovery in LocalSTCrossEncoder. - -This tests the automatic reinitialization of the cross-encoder model when -XPC connection errors occur on macOS (common in long-running daemon processes). -""" - -import asyncio -from unittest.mock import MagicMock, patch - -import pytest - -from hindsight_api.engine.cross_encoder import LocalSTCrossEncoder - - -class TestCrossEncoderXPCErrorRecovery: - """Tests for XPC error detection and recovery in LocalSTCrossEncoder.""" - - @pytest.fixture - def cross_encoder(self): - """Create a LocalSTCrossEncoder instance.""" - return LocalSTCrossEncoder(model_name="cross-encoder/ms-marco-TinyBERT-L-2-v2") - - def test_is_xpc_error_detection(self, cross_encoder): - """Test that XPC errors are correctly detected.""" - # Test various XPC error message formats - xpc_error = Exception("Compiler encountered XPC_ERROR_CONNECTION_INVALID (is the OS shutting down?)") - assert cross_encoder._is_xpc_error(xpc_error) - - xpc_error2 = Exception("XPC error occurred") - assert cross_encoder._is_xpc_error(xpc_error2) - - # Test that non-XPC errors are not detected - normal_error = Exception("Some other error") - assert not cross_encoder._is_xpc_error(normal_error) - - @pytest.mark.asyncio - async def test_predict_with_xpc_recovery(self, cross_encoder): - """Test that predict() recovers from XPC errors by reinitializing.""" - # Initialize the cross-encoder - await cross_encoder.initialize() - - # Track calls to reinitialize - reinit_called = False - original_reinit = cross_encoder._reinitialize_model_sync - - def track_reinit(): - nonlocal reinit_called - reinit_called = True - original_reinit() - - # Track predict attempts - predict_attempts = [] - original_predict = cross_encoder._model.predict - - def mock_predict(*args, **kwargs): - predict_attempts.append(1) - # Only fail on first attempt - if len(predict_attempts) == 1: - raise RuntimeError("Compiler encountered XPC_ERROR_CONNECTION_INVALID (is the OS shutting down?)") - else: - # After reinit: succeed - return original_predict(*args, **kwargs) - - # Mock the initial predict to fail, reinit happens, then new model succeeds - with patch.object(cross_encoder, "_reinitialize_model_sync", side_effect=track_reinit): - with patch.object(cross_encoder._model, "predict", side_effect=mock_predict): - # This should trigger XPC error on first attempt, then recover and succeed - result = await cross_encoder.predict([("query", "document")]) - - # Verify we got a result - assert result is not None - assert len(result) == 1 - assert isinstance(result[0], float) - assert reinit_called # Should have reinitialized - assert len(predict_attempts) >= 1 # At least one attempt was made - - @pytest.mark.asyncio - async def test_predict_fails_on_non_xpc_error(self, cross_encoder): - """Test that predict() does not retry for non-XPC errors.""" - # Initialize the cross-encoder - await cross_encoder.initialize() - - # Create a mock that raises a non-XPC error - def mock_predict(*args, **kwargs): - raise RuntimeError("Some other error") - - # Patch the model's predict method - with patch.object(cross_encoder._model, "predict", side_effect=mock_predict): - # This should fail without retry - with pytest.raises(RuntimeError) as exc_info: - await cross_encoder.predict([("query", "document")]) - - assert "Some other error" in str(exc_info.value) - - @pytest.mark.asyncio - async def test_reinitialize_clears_model(self, cross_encoder): - """Test that _reinitialize_model_sync properly clears and reinits the model.""" - # Initialize the cross-encoder - await cross_encoder.initialize() - - original_model = cross_encoder._model - assert original_model is not None - - # Reinitialize - cross_encoder._reinitialize_model_sync() - - # Model should be reinitialized (new instance) - assert cross_encoder._model is not None - assert cross_encoder._model is not original_model - - # Should still work - result = await cross_encoder.predict([("test query", "test document")]) - assert len(result) == 1 - assert isinstance(result[0], float) - - @pytest.mark.asyncio - async def test_xpc_recovery_exhausts_retries(self, cross_encoder): - """Test that XPC recovery gives up after max retries.""" - # Initialize the cross-encoder - await cross_encoder.initialize() - - # Track reinit calls - reinit_count = 0 - original_reinit = cross_encoder._reinitialize_model_sync - - def track_and_fail_reinit(): - nonlocal reinit_count - reinit_count += 1 - # Call original reinit, but the new model will also be mocked to fail - original_reinit() - # After reinit, patch the new model too - cross_encoder._model.predict = MagicMock( - side_effect=RuntimeError("Compiler encountered XPC_ERROR_CONNECTION_INVALID") - ) - - # Mock that always raises XPC error - cross_encoder._model.predict = MagicMock( - side_effect=RuntimeError("Compiler encountered XPC_ERROR_CONNECTION_INVALID") - ) - - with patch.object(cross_encoder, "_reinitialize_model_sync", side_effect=track_and_fail_reinit): - # Should try once, reinitialize, try again, and fail - with pytest.raises(Exception) as exc_info: - await cross_encoder.predict([("query", "document")]) - - assert "XPC_ERROR_CONNECTION_INVALID" in str(exc_info.value) or "Failed to recover" in str(exc_info.value) - assert reinit_count == 1 # Should have tried to reinitialize once diff --git a/hindsight-api/tests/test_embedding_xpc_recovery.py b/hindsight-api/tests/test_embedding_xpc_recovery.py deleted file mode 100644 index 38045146..00000000 --- a/hindsight-api/tests/test_embedding_xpc_recovery.py +++ /dev/null @@ -1,148 +0,0 @@ -""" -Tests for XPC error recovery in LocalSTEmbeddings. - -This tests the automatic reinitialization of the embedding model when -XPC connection errors occur on macOS (common in long-running daemon processes). -""" - -import asyncio -from unittest.mock import MagicMock, patch - -import pytest - -from hindsight_api.engine.embeddings import LocalSTEmbeddings - - -class TestXPCErrorRecovery: - """Tests for XPC error detection and recovery in LocalSTEmbeddings.""" - - @pytest.fixture - def embeddings(self): - """Create a LocalSTEmbeddings instance.""" - return LocalSTEmbeddings(model_name="sentence-transformers/all-MiniLM-L6-v2") - - def test_is_xpc_error_detection(self, embeddings): - """Test that XPC errors are correctly detected.""" - # Test various XPC error message formats - xpc_error = Exception("Compiler encountered XPC_ERROR_CONNECTION_INVALID (is the OS shutting down?)") - assert embeddings._is_xpc_error(xpc_error) - - xpc_error2 = Exception("XPC error occurred") - assert embeddings._is_xpc_error(xpc_error2) - - # Test that non-XPC errors are not detected - normal_error = Exception("Some other error") - assert not embeddings._is_xpc_error(normal_error) - - @pytest.mark.asyncio - async def test_encode_with_xpc_recovery(self, embeddings): - """Test that encode() recovers from XPC errors by reinitializing.""" - # Initialize the embeddings - await embeddings.initialize() - - # Track calls to reinitialize - reinit_called = False - original_reinit = embeddings._reinitialize_model_sync - - def track_reinit(): - nonlocal reinit_called - reinit_called = True - original_reinit() - - # Track encode attempts - encode_attempts = [] - original_encode = embeddings._model.encode - - def mock_encode(*args, **kwargs): - encode_attempts.append(1) - # Only fail on first attempt - if len(encode_attempts) == 1: - raise RuntimeError("Compiler encountered XPC_ERROR_CONNECTION_INVALID (is the OS shutting down?)") - else: - # After reinit: succeed - return original_encode(*args, **kwargs) - - # Mock the initial encode to fail, reinit happens, then new model succeeds - with patch.object(embeddings, "_reinitialize_model_sync", side_effect=track_reinit): - with patch.object(embeddings._model, "encode", side_effect=mock_encode): - # This should trigger XPC error on first attempt, then recover and succeed - result = embeddings.encode(["test text"]) - - # Verify we got a result - assert result is not None - assert len(result) == 1 - assert len(result[0]) > 0 # Should have embedding vector - assert reinit_called # Should have reinitialized - assert len(encode_attempts) >= 1 # At least one attempt was made - - @pytest.mark.asyncio - async def test_encode_fails_on_non_xpc_error(self, embeddings): - """Test that encode() does not retry for non-XPC errors.""" - # Initialize the embeddings - await embeddings.initialize() - - # Create a mock that raises a non-XPC error - def mock_encode(*args, **kwargs): - raise RuntimeError("Some other error") - - # Patch the model's encode method - with patch.object(embeddings._model, "encode", side_effect=mock_encode): - # This should fail without retry - with pytest.raises(RuntimeError) as exc_info: - embeddings.encode(["test text"]) - - assert "Some other error" in str(exc_info.value) - - @pytest.mark.asyncio - async def test_reinitialize_clears_model(self, embeddings): - """Test that _reinitialize_model_sync properly clears and reinits the model.""" - # Initialize the embeddings - await embeddings.initialize() - - original_model = embeddings._model - assert original_model is not None - - # Reinitialize - embeddings._reinitialize_model_sync() - - # Model should be reinitialized (new instance) - assert embeddings._model is not None - assert embeddings._model is not original_model - - # Should still work - result = embeddings.encode(["test"]) - assert len(result) == 1 - assert len(result[0]) > 0 - - @pytest.mark.asyncio - async def test_xpc_recovery_exhausts_retries(self, embeddings): - """Test that XPC recovery gives up after max retries.""" - # Initialize the embeddings - await embeddings.initialize() - - # Track reinit calls - reinit_count = 0 - original_reinit = embeddings._reinitialize_model_sync - - def track_and_fail_reinit(): - nonlocal reinit_count - reinit_count += 1 - # Call original reinit, but the new model will also be mocked to fail - original_reinit() - # After reinit, patch the new model too - embeddings._model.encode = MagicMock( - side_effect=RuntimeError("Compiler encountered XPC_ERROR_CONNECTION_INVALID") - ) - - # Mock that always raises XPC error - embeddings._model.encode = MagicMock( - side_effect=RuntimeError("Compiler encountered XPC_ERROR_CONNECTION_INVALID") - ) - - with patch.object(embeddings, "_reinitialize_model_sync", side_effect=track_and_fail_reinit): - # Should try once, reinitialize, try again, and fail - with pytest.raises(RuntimeError) as exc_info: - embeddings.encode(["test"]) - - assert "XPC_ERROR_CONNECTION_INVALID" in str(exc_info.value) - assert reinit_count == 1 # Should have tried to reinitialize once diff --git a/hindsight-clients/python/hindsight_client_api/__init__.py b/hindsight-clients/python/hindsight_client_api/__init__.py index 294361f1..f92c01c0 100644 --- a/hindsight-clients/python/hindsight_client_api/__init__.py +++ b/hindsight-clients/python/hindsight_client_api/__init__.py @@ -7,14 +7,14 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. """ # noqa: E501 -__version__ = "0.4.1" +__version__ = "0.0.7" # import apis into sdk package from hindsight_client_api.api.banks_api import BanksApi diff --git a/hindsight-clients/python/hindsight_client_api/api/banks_api.py b/hindsight-clients/python/hindsight_client_api/api/banks_api.py index c6e32b7e..10cc5675 100644 --- a/hindsight-clients/python/hindsight_client_api/api/banks_api.py +++ b/hindsight-clients/python/hindsight_client_api/api/banks_api.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/api/directives_api.py b/hindsight-clients/python/hindsight_client_api/api/directives_api.py index ee68bb69..e14099f8 100644 --- a/hindsight-clients/python/hindsight_client_api/api/directives_api.py +++ b/hindsight-clients/python/hindsight_client_api/api/directives_api.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/api/documents_api.py b/hindsight-clients/python/hindsight_client_api/api/documents_api.py index b20811cd..9a089443 100644 --- a/hindsight-clients/python/hindsight_client_api/api/documents_api.py +++ b/hindsight-clients/python/hindsight_client_api/api/documents_api.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/api/entities_api.py b/hindsight-clients/python/hindsight_client_api/api/entities_api.py index 45fa6b10..dd2249cc 100644 --- a/hindsight-clients/python/hindsight_client_api/api/entities_api.py +++ b/hindsight-clients/python/hindsight_client_api/api/entities_api.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/api/memory_api.py b/hindsight-clients/python/hindsight_client_api/api/memory_api.py index 655385c0..af5728e0 100644 --- a/hindsight-clients/python/hindsight_client_api/api/memory_api.py +++ b/hindsight-clients/python/hindsight_client_api/api/memory_api.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/api/mental_models_api.py b/hindsight-clients/python/hindsight_client_api/api/mental_models_api.py index 4be327a3..0ad5751d 100644 --- a/hindsight-clients/python/hindsight_client_api/api/mental_models_api.py +++ b/hindsight-clients/python/hindsight_client_api/api/mental_models_api.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/api/monitoring_api.py b/hindsight-clients/python/hindsight_client_api/api/monitoring_api.py index e837fe83..e3ba6eb2 100644 --- a/hindsight-clients/python/hindsight_client_api/api/monitoring_api.py +++ b/hindsight-clients/python/hindsight_client_api/api/monitoring_api.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/api/operations_api.py b/hindsight-clients/python/hindsight_client_api/api/operations_api.py index 2780724e..3a03f3a9 100644 --- a/hindsight-clients/python/hindsight_client_api/api/operations_api.py +++ b/hindsight-clients/python/hindsight_client_api/api/operations_api.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/api_client.py b/hindsight-clients/python/hindsight_client_api/api_client.py index 08085474..f75bc364 100644 --- a/hindsight-clients/python/hindsight_client_api/api_client.py +++ b/hindsight-clients/python/hindsight_client_api/api_client.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/configuration.py b/hindsight-clients/python/hindsight_client_api/configuration.py index d4ea8d15..3a0d7c65 100644 --- a/hindsight-clients/python/hindsight_client_api/configuration.py +++ b/hindsight-clients/python/hindsight_client_api/configuration.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -489,7 +489,7 @@ class Configuration: return "Python SDK Debug Report:\n"\ "OS: {env}\n"\ "Python Version: {pyversion}\n"\ - "Version of the API: 0.4.0\n"\ + "Version of the API: 0.4.1\n"\ "SDK Package Version: 0.0.7".\ format(env=sys.platform, pyversion=sys.version) diff --git a/hindsight-clients/python/hindsight_client_api/exceptions.py b/hindsight-clients/python/hindsight_client_api/exceptions.py index 96dcd0ee..784672b9 100644 --- a/hindsight-clients/python/hindsight_client_api/exceptions.py +++ b/hindsight-clients/python/hindsight_client_api/exceptions.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/__init__.py b/hindsight-clients/python/hindsight_client_api/models/__init__.py index cf6bbe8e..6fc7d0d1 100644 --- a/hindsight-clients/python/hindsight_client_api/models/__init__.py +++ b/hindsight-clients/python/hindsight_client_api/models/__init__.py @@ -6,7 +6,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/add_background_request.py b/hindsight-clients/python/hindsight_client_api/models/add_background_request.py index 889c3be1..6d7e4052 100644 --- a/hindsight-clients/python/hindsight_client_api/models/add_background_request.py +++ b/hindsight-clients/python/hindsight_client_api/models/add_background_request.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/async_operation_submit_response.py b/hindsight-clients/python/hindsight_client_api/models/async_operation_submit_response.py index 49bdce5f..0baf95c4 100644 --- a/hindsight-clients/python/hindsight_client_api/models/async_operation_submit_response.py +++ b/hindsight-clients/python/hindsight_client_api/models/async_operation_submit_response.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/background_response.py b/hindsight-clients/python/hindsight_client_api/models/background_response.py index ad8998ee..022ae709 100644 --- a/hindsight-clients/python/hindsight_client_api/models/background_response.py +++ b/hindsight-clients/python/hindsight_client_api/models/background_response.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/bank_list_item.py b/hindsight-clients/python/hindsight_client_api/models/bank_list_item.py index febd933d..d9db6bf4 100644 --- a/hindsight-clients/python/hindsight_client_api/models/bank_list_item.py +++ b/hindsight-clients/python/hindsight_client_api/models/bank_list_item.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/bank_list_response.py b/hindsight-clients/python/hindsight_client_api/models/bank_list_response.py index b2ebe4ea..de9e16f5 100644 --- a/hindsight-clients/python/hindsight_client_api/models/bank_list_response.py +++ b/hindsight-clients/python/hindsight_client_api/models/bank_list_response.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/bank_profile_response.py b/hindsight-clients/python/hindsight_client_api/models/bank_profile_response.py index ee352f74..1e237712 100644 --- a/hindsight-clients/python/hindsight_client_api/models/bank_profile_response.py +++ b/hindsight-clients/python/hindsight_client_api/models/bank_profile_response.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/bank_stats_response.py b/hindsight-clients/python/hindsight_client_api/models/bank_stats_response.py index bb013670..85f3a8e7 100644 --- a/hindsight-clients/python/hindsight_client_api/models/bank_stats_response.py +++ b/hindsight-clients/python/hindsight_client_api/models/bank_stats_response.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/budget.py b/hindsight-clients/python/hindsight_client_api/models/budget.py index 5038e1ca..61da313f 100644 --- a/hindsight-clients/python/hindsight_client_api/models/budget.py +++ b/hindsight-clients/python/hindsight_client_api/models/budget.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/cancel_operation_response.py b/hindsight-clients/python/hindsight_client_api/models/cancel_operation_response.py index d15385cd..20c6a3b0 100644 --- a/hindsight-clients/python/hindsight_client_api/models/cancel_operation_response.py +++ b/hindsight-clients/python/hindsight_client_api/models/cancel_operation_response.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/chunk_data.py b/hindsight-clients/python/hindsight_client_api/models/chunk_data.py index 337142c2..6f5b7fd6 100644 --- a/hindsight-clients/python/hindsight_client_api/models/chunk_data.py +++ b/hindsight-clients/python/hindsight_client_api/models/chunk_data.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/chunk_include_options.py b/hindsight-clients/python/hindsight_client_api/models/chunk_include_options.py index 5bec8cef..6d21f2b4 100644 --- a/hindsight-clients/python/hindsight_client_api/models/chunk_include_options.py +++ b/hindsight-clients/python/hindsight_client_api/models/chunk_include_options.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/chunk_response.py b/hindsight-clients/python/hindsight_client_api/models/chunk_response.py index 221e425c..f7324b31 100644 --- a/hindsight-clients/python/hindsight_client_api/models/chunk_response.py +++ b/hindsight-clients/python/hindsight_client_api/models/chunk_response.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/consolidation_response.py b/hindsight-clients/python/hindsight_client_api/models/consolidation_response.py index 4de77612..fbd3fd52 100644 --- a/hindsight-clients/python/hindsight_client_api/models/consolidation_response.py +++ b/hindsight-clients/python/hindsight_client_api/models/consolidation_response.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/create_bank_request.py b/hindsight-clients/python/hindsight_client_api/models/create_bank_request.py index 29f1dff5..f2d8e516 100644 --- a/hindsight-clients/python/hindsight_client_api/models/create_bank_request.py +++ b/hindsight-clients/python/hindsight_client_api/models/create_bank_request.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/create_directive_request.py b/hindsight-clients/python/hindsight_client_api/models/create_directive_request.py index 4d1291e7..7dfb75bf 100644 --- a/hindsight-clients/python/hindsight_client_api/models/create_directive_request.py +++ b/hindsight-clients/python/hindsight_client_api/models/create_directive_request.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/create_mental_model_request.py b/hindsight-clients/python/hindsight_client_api/models/create_mental_model_request.py index 4f14725a..b262afd7 100644 --- a/hindsight-clients/python/hindsight_client_api/models/create_mental_model_request.py +++ b/hindsight-clients/python/hindsight_client_api/models/create_mental_model_request.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/create_mental_model_response.py b/hindsight-clients/python/hindsight_client_api/models/create_mental_model_response.py index 632ec9f7..06291c37 100644 --- a/hindsight-clients/python/hindsight_client_api/models/create_mental_model_response.py +++ b/hindsight-clients/python/hindsight_client_api/models/create_mental_model_response.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/delete_document_response.py b/hindsight-clients/python/hindsight_client_api/models/delete_document_response.py index 64714757..3e22f4ec 100644 --- a/hindsight-clients/python/hindsight_client_api/models/delete_document_response.py +++ b/hindsight-clients/python/hindsight_client_api/models/delete_document_response.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/delete_response.py b/hindsight-clients/python/hindsight_client_api/models/delete_response.py index 1c187278..35d1a97e 100644 --- a/hindsight-clients/python/hindsight_client_api/models/delete_response.py +++ b/hindsight-clients/python/hindsight_client_api/models/delete_response.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/directive_list_response.py b/hindsight-clients/python/hindsight_client_api/models/directive_list_response.py index 48c8343b..05e9b543 100644 --- a/hindsight-clients/python/hindsight_client_api/models/directive_list_response.py +++ b/hindsight-clients/python/hindsight_client_api/models/directive_list_response.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/directive_response.py b/hindsight-clients/python/hindsight_client_api/models/directive_response.py index 45012821..4bcabfa7 100644 --- a/hindsight-clients/python/hindsight_client_api/models/directive_response.py +++ b/hindsight-clients/python/hindsight_client_api/models/directive_response.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/disposition_traits.py b/hindsight-clients/python/hindsight_client_api/models/disposition_traits.py index ac18b40e..03576e12 100644 --- a/hindsight-clients/python/hindsight_client_api/models/disposition_traits.py +++ b/hindsight-clients/python/hindsight_client_api/models/disposition_traits.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/document_response.py b/hindsight-clients/python/hindsight_client_api/models/document_response.py index 409e9e19..e47620d2 100644 --- a/hindsight-clients/python/hindsight_client_api/models/document_response.py +++ b/hindsight-clients/python/hindsight_client_api/models/document_response.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/entity_detail_response.py b/hindsight-clients/python/hindsight_client_api/models/entity_detail_response.py index 6be3aaa5..914922c7 100644 --- a/hindsight-clients/python/hindsight_client_api/models/entity_detail_response.py +++ b/hindsight-clients/python/hindsight_client_api/models/entity_detail_response.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/entity_include_options.py b/hindsight-clients/python/hindsight_client_api/models/entity_include_options.py index 0b5dbe88..c1fc38e1 100644 --- a/hindsight-clients/python/hindsight_client_api/models/entity_include_options.py +++ b/hindsight-clients/python/hindsight_client_api/models/entity_include_options.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/entity_input.py b/hindsight-clients/python/hindsight_client_api/models/entity_input.py index f23a3c97..74d79b51 100644 --- a/hindsight-clients/python/hindsight_client_api/models/entity_input.py +++ b/hindsight-clients/python/hindsight_client_api/models/entity_input.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/entity_list_item.py b/hindsight-clients/python/hindsight_client_api/models/entity_list_item.py index 7be3130b..b0682a4c 100644 --- a/hindsight-clients/python/hindsight_client_api/models/entity_list_item.py +++ b/hindsight-clients/python/hindsight_client_api/models/entity_list_item.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/entity_list_response.py b/hindsight-clients/python/hindsight_client_api/models/entity_list_response.py index 5fd6f320..f20af9d5 100644 --- a/hindsight-clients/python/hindsight_client_api/models/entity_list_response.py +++ b/hindsight-clients/python/hindsight_client_api/models/entity_list_response.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/entity_observation_response.py b/hindsight-clients/python/hindsight_client_api/models/entity_observation_response.py index e4b63477..b798ea23 100644 --- a/hindsight-clients/python/hindsight_client_api/models/entity_observation_response.py +++ b/hindsight-clients/python/hindsight_client_api/models/entity_observation_response.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/entity_state_response.py b/hindsight-clients/python/hindsight_client_api/models/entity_state_response.py index 72027fef..d420a531 100644 --- a/hindsight-clients/python/hindsight_client_api/models/entity_state_response.py +++ b/hindsight-clients/python/hindsight_client_api/models/entity_state_response.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/features_info.py b/hindsight-clients/python/hindsight_client_api/models/features_info.py index 18d5d71d..76362f2a 100644 --- a/hindsight-clients/python/hindsight_client_api/models/features_info.py +++ b/hindsight-clients/python/hindsight_client_api/models/features_info.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/graph_data_response.py b/hindsight-clients/python/hindsight_client_api/models/graph_data_response.py index c34cba65..907dc3c7 100644 --- a/hindsight-clients/python/hindsight_client_api/models/graph_data_response.py +++ b/hindsight-clients/python/hindsight_client_api/models/graph_data_response.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/http_validation_error.py b/hindsight-clients/python/hindsight_client_api/models/http_validation_error.py index ebe89755..f76b3199 100644 --- a/hindsight-clients/python/hindsight_client_api/models/http_validation_error.py +++ b/hindsight-clients/python/hindsight_client_api/models/http_validation_error.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/include_options.py b/hindsight-clients/python/hindsight_client_api/models/include_options.py index 2623ace2..b7bf73ab 100644 --- a/hindsight-clients/python/hindsight_client_api/models/include_options.py +++ b/hindsight-clients/python/hindsight_client_api/models/include_options.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/list_documents_response.py b/hindsight-clients/python/hindsight_client_api/models/list_documents_response.py index e2c46ba4..4baa8a3f 100644 --- a/hindsight-clients/python/hindsight_client_api/models/list_documents_response.py +++ b/hindsight-clients/python/hindsight_client_api/models/list_documents_response.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/list_memory_units_response.py b/hindsight-clients/python/hindsight_client_api/models/list_memory_units_response.py index 69a2c79a..ef331e28 100644 --- a/hindsight-clients/python/hindsight_client_api/models/list_memory_units_response.py +++ b/hindsight-clients/python/hindsight_client_api/models/list_memory_units_response.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/list_tags_response.py b/hindsight-clients/python/hindsight_client_api/models/list_tags_response.py index fc499615..42a6631f 100644 --- a/hindsight-clients/python/hindsight_client_api/models/list_tags_response.py +++ b/hindsight-clients/python/hindsight_client_api/models/list_tags_response.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/memory_item.py b/hindsight-clients/python/hindsight_client_api/models/memory_item.py index 93f02fd6..e764b687 100644 --- a/hindsight-clients/python/hindsight_client_api/models/memory_item.py +++ b/hindsight-clients/python/hindsight_client_api/models/memory_item.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/mental_model_list_response.py b/hindsight-clients/python/hindsight_client_api/models/mental_model_list_response.py index 860ef410..f1c0aa4f 100644 --- a/hindsight-clients/python/hindsight_client_api/models/mental_model_list_response.py +++ b/hindsight-clients/python/hindsight_client_api/models/mental_model_list_response.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/mental_model_response.py b/hindsight-clients/python/hindsight_client_api/models/mental_model_response.py index a1d8d4ad..7921353c 100644 --- a/hindsight-clients/python/hindsight_client_api/models/mental_model_response.py +++ b/hindsight-clients/python/hindsight_client_api/models/mental_model_response.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/mental_model_trigger.py b/hindsight-clients/python/hindsight_client_api/models/mental_model_trigger.py index 503e132a..fa97e30d 100644 --- a/hindsight-clients/python/hindsight_client_api/models/mental_model_trigger.py +++ b/hindsight-clients/python/hindsight_client_api/models/mental_model_trigger.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/operation_response.py b/hindsight-clients/python/hindsight_client_api/models/operation_response.py index 55bd7311..fcb85208 100644 --- a/hindsight-clients/python/hindsight_client_api/models/operation_response.py +++ b/hindsight-clients/python/hindsight_client_api/models/operation_response.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/operation_status_response.py b/hindsight-clients/python/hindsight_client_api/models/operation_status_response.py index a32ab6e9..bcc803ce 100644 --- a/hindsight-clients/python/hindsight_client_api/models/operation_status_response.py +++ b/hindsight-clients/python/hindsight_client_api/models/operation_status_response.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/operations_list_response.py b/hindsight-clients/python/hindsight_client_api/models/operations_list_response.py index 5f50ef31..292a8ff0 100644 --- a/hindsight-clients/python/hindsight_client_api/models/operations_list_response.py +++ b/hindsight-clients/python/hindsight_client_api/models/operations_list_response.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/recall_request.py b/hindsight-clients/python/hindsight_client_api/models/recall_request.py index 440a6f44..b8ddc833 100644 --- a/hindsight-clients/python/hindsight_client_api/models/recall_request.py +++ b/hindsight-clients/python/hindsight_client_api/models/recall_request.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/recall_response.py b/hindsight-clients/python/hindsight_client_api/models/recall_response.py index e1b1f200..5d5ed010 100644 --- a/hindsight-clients/python/hindsight_client_api/models/recall_response.py +++ b/hindsight-clients/python/hindsight_client_api/models/recall_response.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/recall_result.py b/hindsight-clients/python/hindsight_client_api/models/recall_result.py index 5dfb1b35..4742336e 100644 --- a/hindsight-clients/python/hindsight_client_api/models/recall_result.py +++ b/hindsight-clients/python/hindsight_client_api/models/recall_result.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/reflect_based_on.py b/hindsight-clients/python/hindsight_client_api/models/reflect_based_on.py index 5dafa13d..98d9fe2c 100644 --- a/hindsight-clients/python/hindsight_client_api/models/reflect_based_on.py +++ b/hindsight-clients/python/hindsight_client_api/models/reflect_based_on.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/reflect_directive.py b/hindsight-clients/python/hindsight_client_api/models/reflect_directive.py index 0f938398..d9395ffc 100644 --- a/hindsight-clients/python/hindsight_client_api/models/reflect_directive.py +++ b/hindsight-clients/python/hindsight_client_api/models/reflect_directive.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/reflect_fact.py b/hindsight-clients/python/hindsight_client_api/models/reflect_fact.py index 14fb6738..ae550a9a 100644 --- a/hindsight-clients/python/hindsight_client_api/models/reflect_fact.py +++ b/hindsight-clients/python/hindsight_client_api/models/reflect_fact.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/reflect_include_options.py b/hindsight-clients/python/hindsight_client_api/models/reflect_include_options.py index 9cbad7ac..c9ab5c05 100644 --- a/hindsight-clients/python/hindsight_client_api/models/reflect_include_options.py +++ b/hindsight-clients/python/hindsight_client_api/models/reflect_include_options.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/reflect_llm_call.py b/hindsight-clients/python/hindsight_client_api/models/reflect_llm_call.py index b8030452..8112ed52 100644 --- a/hindsight-clients/python/hindsight_client_api/models/reflect_llm_call.py +++ b/hindsight-clients/python/hindsight_client_api/models/reflect_llm_call.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/reflect_mental_model.py b/hindsight-clients/python/hindsight_client_api/models/reflect_mental_model.py index fcba6092..8ffff83d 100644 --- a/hindsight-clients/python/hindsight_client_api/models/reflect_mental_model.py +++ b/hindsight-clients/python/hindsight_client_api/models/reflect_mental_model.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/reflect_request.py b/hindsight-clients/python/hindsight_client_api/models/reflect_request.py index b262e496..116adf95 100644 --- a/hindsight-clients/python/hindsight_client_api/models/reflect_request.py +++ b/hindsight-clients/python/hindsight_client_api/models/reflect_request.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/reflect_response.py b/hindsight-clients/python/hindsight_client_api/models/reflect_response.py index 89bad2fd..6c5743bb 100644 --- a/hindsight-clients/python/hindsight_client_api/models/reflect_response.py +++ b/hindsight-clients/python/hindsight_client_api/models/reflect_response.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/reflect_tool_call.py b/hindsight-clients/python/hindsight_client_api/models/reflect_tool_call.py index 7622328c..8a3e3625 100644 --- a/hindsight-clients/python/hindsight_client_api/models/reflect_tool_call.py +++ b/hindsight-clients/python/hindsight_client_api/models/reflect_tool_call.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/reflect_trace.py b/hindsight-clients/python/hindsight_client_api/models/reflect_trace.py index fde07928..074f260a 100644 --- a/hindsight-clients/python/hindsight_client_api/models/reflect_trace.py +++ b/hindsight-clients/python/hindsight_client_api/models/reflect_trace.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/retain_request.py b/hindsight-clients/python/hindsight_client_api/models/retain_request.py index a15166d4..ba34e6dd 100644 --- a/hindsight-clients/python/hindsight_client_api/models/retain_request.py +++ b/hindsight-clients/python/hindsight_client_api/models/retain_request.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/retain_response.py b/hindsight-clients/python/hindsight_client_api/models/retain_response.py index ac091daa..4207a5f1 100644 --- a/hindsight-clients/python/hindsight_client_api/models/retain_response.py +++ b/hindsight-clients/python/hindsight_client_api/models/retain_response.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/tag_item.py b/hindsight-clients/python/hindsight_client_api/models/tag_item.py index 99fa7ffc..8992d869 100644 --- a/hindsight-clients/python/hindsight_client_api/models/tag_item.py +++ b/hindsight-clients/python/hindsight_client_api/models/tag_item.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/token_usage.py b/hindsight-clients/python/hindsight_client_api/models/token_usage.py index 404d5a35..83b13966 100644 --- a/hindsight-clients/python/hindsight_client_api/models/token_usage.py +++ b/hindsight-clients/python/hindsight_client_api/models/token_usage.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/tool_calls_include_options.py b/hindsight-clients/python/hindsight_client_api/models/tool_calls_include_options.py index 358fc02f..2791f953 100644 --- a/hindsight-clients/python/hindsight_client_api/models/tool_calls_include_options.py +++ b/hindsight-clients/python/hindsight_client_api/models/tool_calls_include_options.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/update_directive_request.py b/hindsight-clients/python/hindsight_client_api/models/update_directive_request.py index f019d910..d207a623 100644 --- a/hindsight-clients/python/hindsight_client_api/models/update_directive_request.py +++ b/hindsight-clients/python/hindsight_client_api/models/update_directive_request.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/update_disposition_request.py b/hindsight-clients/python/hindsight_client_api/models/update_disposition_request.py index 98b8b50f..3e5c9a20 100644 --- a/hindsight-clients/python/hindsight_client_api/models/update_disposition_request.py +++ b/hindsight-clients/python/hindsight_client_api/models/update_disposition_request.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/update_mental_model_request.py b/hindsight-clients/python/hindsight_client_api/models/update_mental_model_request.py index 34dca1b3..8daebb06 100644 --- a/hindsight-clients/python/hindsight_client_api/models/update_mental_model_request.py +++ b/hindsight-clients/python/hindsight_client_api/models/update_mental_model_request.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/validation_error.py b/hindsight-clients/python/hindsight_client_api/models/validation_error.py index 5ee8a5ed..dfcc0582 100644 --- a/hindsight-clients/python/hindsight_client_api/models/validation_error.py +++ b/hindsight-clients/python/hindsight_client_api/models/validation_error.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/validation_error_loc_inner.py b/hindsight-clients/python/hindsight_client_api/models/validation_error_loc_inner.py index 88342d97..122a1d6b 100644 --- a/hindsight-clients/python/hindsight_client_api/models/validation_error_loc_inner.py +++ b/hindsight-clients/python/hindsight_client_api/models/validation_error_loc_inner.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/models/version_response.py b/hindsight-clients/python/hindsight_client_api/models/version_response.py index 354f1aa0..f6bafd3d 100644 --- a/hindsight-clients/python/hindsight_client_api/models/version_response.py +++ b/hindsight-clients/python/hindsight_client_api/models/version_response.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-clients/python/hindsight_client_api/rest.py b/hindsight-clients/python/hindsight_client_api/rest.py index e0870937..59610c5d 100644 --- a/hindsight-clients/python/hindsight_client_api/rest.py +++ b/hindsight-clients/python/hindsight_client_api/rest.py @@ -5,7 +5,7 @@ HTTP API for Hindsight - The version of the OpenAPI document: 0.4.0 + The version of the OpenAPI document: 0.4.1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/hindsight-docs/docs/sdks/embed.md b/hindsight-docs/docs/sdks/embed.md new file mode 100644 index 00000000..72088e15 --- /dev/null +++ b/hindsight-docs/docs/sdks/embed.md @@ -0,0 +1,262 @@ +--- +sidebar_position: 4 +--- + +# Embedded SDK (hindsight-embed) + +Zero-configuration local memory system with automatic daemon management. Perfect for development, prototyping, and single-user applications. + +## Overview + +`hindsight-embed` is a zero-configuration SDK that wraps the Hindsight API and PostgreSQL database into a single auto-managed local daemon. It's designed for development, prototyping, and single-user applications where you want memory capabilities without infrastructure overhead. + +**How it works:** + +1. **First command triggers startup**: When you run any `hindsight-embed` command, it checks if a local daemon is running +2. **Auto-daemon management**: If no daemon exists, it automatically spawns `hindsight-api --daemon` in the background +3. **Embedded database**: The daemon uses `pg0` (embedded PostgreSQL) — no separate database installation required +4. **Command forwarding**: Your command is forwarded to the local daemon via HTTP (localhost:8889) +5. **Auto-shutdown**: After 5 minutes of inactivity (configurable), the daemon gracefully shuts down to free resources + +**Key features:** + +- **Zero setup** — One `configure` command and you're ready +- **Automatic lifecycle** — Daemon starts on-demand, stops when idle +- **Isolated storage** — Each bank gets its own embedded PostgreSQL database +- **Local-only** — Binds to `127.0.0.1:8889`, not accessible from network +- **Production-grade engine** — Uses the same memory engine as the full API service + +Think of it as SQLite for long-term memory — all the power of Hindsight without managing servers. + +## Installation + +Install via `uvx` (recommended - always latest version): + +```bash +# Run directly without installation +uvx hindsight-embed@latest configure + +# Or use pipx for persistent installation +pipx install hindsight-embed +``` + +## Quick Start + +### 1. Configure + +```bash +# Interactive configuration +hindsight-embed configure + +# Or non-interactive via environment variables +export HINDSIGHT_EMBED_LLM_PROVIDER=openai +export HINDSIGHT_EMBED_LLM_API_KEY=sk-xxxxxxxxxxxx +export HINDSIGHT_EMBED_LLM_MODEL=gpt-4o-mini +hindsight-embed configure +``` + +Configuration is saved to `~/.hindsight/embed`: + +```bash +HINDSIGHT_EMBED_LLM_PROVIDER=openai +HINDSIGHT_EMBED_LLM_MODEL=gpt-4o-mini +HINDSIGHT_EMBED_BANK_ID=default +HINDSIGHT_EMBED_LLM_API_KEY=sk-xxxxxxxxxxxx + +# Daemon settings (macOS: force CPU to avoid MPS/XPC issues) +HINDSIGHT_API_EMBEDDINGS_LOCAL_FORCE_CPU=1 +HINDSIGHT_API_RERANKER_LOCAL_FORCE_CPU=1 +``` + +### 2. Use Memory Operations + +```bash +# Store a memory +hindsight-embed memory retain default "User prefers dark mode" + +# Query memories +hindsight-embed memory recall default "user preferences" + +# Reasoning with memory +hindsight-embed memory reflect default "What color scheme should I use?" +``` + +The daemon starts automatically on first use! + +## Environment Variables + +| Variable | Description | Default | +|----------|-------------|---------| +| `HINDSIGHT_EMBED_LLM_API_KEY` | **Required**. API key for LLM provider | - | +| `HINDSIGHT_EMBED_LLM_PROVIDER` | LLM provider: `openai`, `anthropic`, `gemini`, `groq`, `ollama` | `openai` | +| `HINDSIGHT_EMBED_LLM_MODEL` | Model name | `gpt-4o-mini` | +| `HINDSIGHT_EMBED_BANK_ID` | Default memory bank ID | `default` | +| `HINDSIGHT_EMBED_DAEMON_IDLE_TIMEOUT` | Seconds before daemon auto-exits when idle (0 = never) | `300` | + +**Provider Examples:** + +```bash +# OpenAI +export HINDSIGHT_EMBED_LLM_PROVIDER=openai +export HINDSIGHT_EMBED_LLM_API_KEY=sk-xxxxxxxxxxxx +export HINDSIGHT_EMBED_LLM_MODEL=gpt-4o + +# Groq (fast inference) +export HINDSIGHT_EMBED_LLM_PROVIDER=groq +export HINDSIGHT_EMBED_LLM_API_KEY=gsk_xxxxxxxxxxxx +export HINDSIGHT_EMBED_LLM_MODEL=llama-3.3-70b-versatile + +# Anthropic +export HINDSIGHT_EMBED_LLM_PROVIDER=anthropic +export HINDSIGHT_EMBED_LLM_API_KEY=sk-ant-xxxxxxxxxxxx +export HINDSIGHT_EMBED_LLM_MODEL=claude-sonnet-4-20250514 +``` + +## Daemon Management + +### Idle Timeout + +Customize how long the daemon stays alive when idle: + +```bash +# Never timeout (daemon runs until manually stopped) +export HINDSIGHT_EMBED_DAEMON_IDLE_TIMEOUT=0 + +# Shorter timeout: 1 minute +export HINDSIGHT_EMBED_DAEMON_IDLE_TIMEOUT=60 + +# Longer timeout: 30 minutes +export HINDSIGHT_EMBED_DAEMON_IDLE_TIMEOUT=1800 +``` + +### Daemon Commands + +```bash +# Check daemon status +hindsight-embed daemon status + +# View daemon logs in real-time +hindsight-embed daemon logs -f + +# Stop daemon manually +hindsight-embed daemon stop +``` + +## Commands + +All memory operations follow the same interface as the CLI: + +### Retain (Store Memory) + +```bash +hindsight-embed memory retain "content" + +# With context +hindsight-embed memory retain "content" --context "source information" + +# Background processing +hindsight-embed memory retain "content" --async +``` + +### Recall (Search) + +```bash +hindsight-embed memory recall "query" + +# With budget control +hindsight-embed memory recall "query" --budget high + +# Show trace +hindsight-embed memory recall "query" --trace +``` + +### Reflect (Generate Response) + +```bash +hindsight-embed memory reflect "prompt" + +# With additional context +hindsight-embed memory reflect "prompt" --context "additional info" +``` + +### Bank Management + +```bash +# List all banks +hindsight-embed bank list + +# View bank stats +hindsight-embed bank stats + +# Set bank name +hindsight-embed bank name "My Assistant" + +# Set bank mission +hindsight-embed bank mission "I am a helpful AI assistant" +``` + +## Troubleshooting + +### Daemon Won't Start + +Check the daemon logs: + +```bash +hindsight-embed daemon logs +# Or watch in real-time +hindsight-embed daemon logs -f +``` + +Common issues: +- **Missing API key**: Set `HINDSIGHT_EMBED_LLM_API_KEY` +- **Port conflict**: Another service using port 8889 +- **Permissions**: Check `~/.hindsight/` directory permissions + +### Daemon Exits Immediately + +Check if you have the idle timeout set too low: + +```bash +# Disable idle timeout for debugging +export HINDSIGHT_EMBED_DAEMON_IDLE_TIMEOUT=0 +hindsight-embed daemon status +``` + +### Reset Configuration + +```bash +# Remove config file and reconfigure +rm ~/.hindsight/embed +hindsight-embed configure +``` + +## Advanced Configuration + +While `hindsight-embed` aims to be zero-config, you can customize the underlying API behavior by setting `HINDSIGHT_API_*` variables in `~/.hindsight/embed`: + +```bash +# Example: Custom embedding model +HINDSIGHT_API_EMBEDDINGS_PROVIDER=openai +HINDSIGHT_API_EMBEDDINGS_OPENAI_MODEL=text-embedding-3-large + +# Example: Verbose extraction +HINDSIGHT_API_RETAIN_EXTRACTION_MODE=verbose +``` + +See [Configuration](/developer/configuration) for all available `HINDSIGHT_API_*` options. + +## When to Use + +**Perfect for:** +- Development and prototyping +- Single-user applications +- Local-first tools +- Quick experiments with Hindsight + +**Not suitable for:** +- Production multi-user deployments +- Network-accessible services +- High-availability requirements +- Multi-tenant applications + +For production deployments, use the [API Service](/developer/services) with external PostgreSQL instead. diff --git a/hindsight-docs/static/openapi.json b/hindsight-docs/static/openapi.json index 1649373e..3e8705d3 100644 --- a/hindsight-docs/static/openapi.json +++ b/hindsight-docs/static/openapi.json @@ -10,7 +10,7 @@ "name": "Apache 2.0", "url": "https://www.apache.org/licenses/LICENSE-2.0.html" }, - "version": "0.4.0" + "version": "0.4.1" }, "paths": { "/health": { diff --git a/hindsight-embed/hindsight_embed/cli.py b/hindsight-embed/hindsight_embed/cli.py index bda475b8..2ebfa628 100644 --- a/hindsight-embed/hindsight_embed/cli.py +++ b/hindsight-embed/hindsight_embed/cli.py @@ -15,6 +15,7 @@ Environment variables: HINDSIGHT_EMBED_LLM_PROVIDER: Optional. LLM provider (default: "openai"). HINDSIGHT_EMBED_LLM_MODEL: Optional. LLM model (default: "gpt-4o-mini"). HINDSIGHT_EMBED_BANK_ID: Optional. Memory bank ID (default: "default"). + HINDSIGHT_EMBED_DAEMON_IDLE_TIMEOUT: Optional. Seconds before daemon auto-exits when idle (default: 300). """ import argparse @@ -159,6 +160,15 @@ def _do_configure_from_env(): if api_key: f.write(f"HINDSIGHT_EMBED_LLM_API_KEY={api_key}\n") + # Force CPU mode for embeddings/reranker on macOS to avoid MPS/XPC crashes in daemon mode + # On Linux, users can set these to 0 to use CUDA if available + import platform + + if platform.system() == "Darwin": # macOS + f.write("\n# Daemon settings (macOS: force CPU to avoid MPS/XPC issues)\n") + f.write("HINDSIGHT_API_EMBEDDINGS_LOCAL_FORCE_CPU=1\n") + f.write("HINDSIGHT_API_RERANKER_LOCAL_FORCE_CPU=1\n") + CONFIG_FILE.chmod(0o600) print() @@ -324,6 +334,15 @@ def _do_configure_interactive(): if api_key: f.write(f"HINDSIGHT_EMBED_LLM_API_KEY={api_key}\n") + # Force CPU mode for embeddings/reranker on macOS to avoid MPS/XPC crashes in daemon mode + # On Linux, users can set these to 0 to use CUDA if available + import platform + + if platform.system() == "Darwin": # macOS + f.write("\n# Daemon settings (macOS: force CPU to avoid MPS/XPC issues)\n") + f.write("HINDSIGHT_API_EMBEDDINGS_LOCAL_FORCE_CPU=1\n") + f.write("HINDSIGHT_API_RERANKER_LOCAL_FORCE_CPU=1\n") + CONFIG_FILE.chmod(0o600) # Stop existing daemon if running (it needs to pick up new config) diff --git a/hindsight-embed/hindsight_embed/daemon_client.py b/hindsight-embed/hindsight_embed/daemon_client.py index 1437122f..6d6eecf5 100644 --- a/hindsight-embed/hindsight_embed/daemon_client.py +++ b/hindsight-embed/hindsight_embed/daemon_client.py @@ -18,7 +18,8 @@ logger = logging.getLogger(__name__) DAEMON_PORT = 8889 DAEMON_URL = f"http://127.0.0.1:{DAEMON_PORT}" DAEMON_STARTUP_TIMEOUT = 180 # seconds - needs to be long for first run (downloads dependencies) -DAEMON_IDLE_TIMEOUT = 300 # 5 minutes - auto-exit after idle +# Default idle timeout: 5 minutes - users can override with HINDSIGHT_EMBED_DAEMON_IDLE_TIMEOUT env var +DEFAULT_DAEMON_IDLE_TIMEOUT = 300 # CLI paths - check multiple locations CLI_INSTALL_DIRS = [ @@ -75,7 +76,10 @@ def _start_daemon(config: dict) -> bool: env["HINDSIGHT_API_DATABASE_URL"] = f"pg0://hindsight-embed-{bank_id}" env["HINDSIGHT_API_LOG_LEVEL"] = "info" - cmd = _find_hindsight_api_command() + ["--daemon", "--idle-timeout", str(DAEMON_IDLE_TIMEOUT)] + # Get idle timeout from environment or use default + idle_timeout = int(os.getenv("HINDSIGHT_EMBED_DAEMON_IDLE_TIMEOUT", str(DEFAULT_DAEMON_IDLE_TIMEOUT))) + + cmd = _find_hindsight_api_command() + ["--daemon", "--idle-timeout", str(idle_timeout)] # Create log directory log_dir = Path.home() / ".hindsight"