embed-client 4.0.45__tar.gz → 4.0.46__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {embed_client-4.0.45/embed_client.egg-info → embed_client-4.0.46}/PKG-INFO +6 -2
- {embed_client-4.0.45 → embed_client-4.0.46}/README.md +5 -1
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client/__init__.py +1 -1
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client/embedding_client.py +62 -54
- {embed_client-4.0.45 → embed_client-4.0.46/embed_client.egg-info}/PKG-INFO +6 -2
- {embed_client-4.0.45 → embed_client-4.0.46}/pyproject.toml +1 -1
- embed_client-4.0.46/tests/test_vectorization_modes_client.py +245 -0
- embed_client-4.0.45/tests/test_vectorization_modes_client.py +0 -152
- {embed_client-4.0.45 → embed_client-4.0.46}/CONFIGURATION.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/LICENSE +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/MANIFEST.in +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/configs/basic_auth.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/configs/http.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/configs/http_8001_test.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/configs/http_correct.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/configs/http_simple.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/configs/http_test.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/configs/http_token.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/configs/http_token_correct.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/configs/http_token_roles.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/configs/http_token_roles_token_roles.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/configs/http_token_token_roles.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/configs/https.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/configs/https_8001_test.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/configs/https_api_test.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/configs/https_simple.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/configs/https_test.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/configs/https_token.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/configs/https_token_8001.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/configs/https_token_roles.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/configs/https_token_roles_token_roles.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/configs/https_token_token_roles.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/configs/jwt.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/configs/mtls.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/configs/mtls_8001.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/configs/mtls_8001_test.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/configs/mtls_correct.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/configs/mtls_roles.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/configs/mtls_roles_token_roles.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/configs/mtls_test.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/configs/mtls_token_roles.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/configs/mtls_via_adapter.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/configs/roles.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/configs/test_http_simple.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/configs/test_http_token.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/configs/test_http_token_roles.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/configs/test_https_simple.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/configs/test_https_token.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/configs/test_https_token_roles.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/configs/test_mtls_roles.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/configs/test_mtls_simple.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/configs/test_server_http.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/configs/test_server_https.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/configs/test_server_mtls.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/BUGREPORT_queue_manager_daemonic.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/IDENTIFIER_ANALYSIS_REPORT.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/PROPOSAL_SERVER_REQUEST_COALESCING.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/PROPOSAL_TWO_CHANNEL_OR_PUSH.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/SERVER_MODES_AND_CLIENT.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/api_format.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/client_integration_guide.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/coverage_report.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/error_500_analysis.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/error_handling_complete.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/error_handling_issue.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/_template/README.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/_template/example_global_step/example_tactical_step/example_atomic_step.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/_template/example_global_step/example_tactical_step/spec.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/_template/example_global_step/spec.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/_template/spec.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/baseline_audit_and_contract_capture/migration_baseline_deliverable/ATOMIC_STEPS_INDEX.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/baseline_audit_and_contract_capture/migration_baseline_deliverable/freeze-migration-baseline-evidence-links.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/baseline_audit_and_contract_capture/migration_baseline_deliverable/spec.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/baseline_audit_and_contract_capture/spec.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/spec.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/ATOMIC_STEPS_INDEX.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-01.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-02.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-03.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-04.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-05.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-06.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-07.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-08.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-09.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-10.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-11.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-12.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-13.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-14.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-15.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-16.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-17.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-18.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-19.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-20.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-21.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-22.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/plan.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/production_migration_and_legacy_removal/canonical_client_migration/ATOMIC_STEPS_INDEX.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/production_migration_and_legacy_removal/canonical_client_migration/PARALLEL_WAVES.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/production_migration_and_legacy_removal/canonical_client_migration/atomic-01-port-constants-and-exceptions.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/production_migration_and_legacy_removal/canonical_client_migration/atomic-02-port-embedding-client-helpers-and-status-store.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/production_migration_and_legacy_removal/canonical_client_migration/atomic-03-port-embedding-client-core.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/production_migration_and_legacy_removal/canonical_client_migration/atomic-04-package-init-version-and-canonical-exports.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/production_migration_and_legacy_removal/canonical_client_migration/atomic-05-remove-legacy-async-stack-and-adapter-transport.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/production_migration_and_legacy_removal/canonical_client_migration/atomic-06-remove-testing-client-and-duplicate-helpers.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/production_migration_and_legacy_removal/canonical_client_migration/atomic-07-rewire-cli-factory-and-minimal-entry-points.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/production_migration_and_legacy_removal/canonical_client_migration/spec.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/production_migration_and_legacy_removal/spec.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/README.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/rv_automated_security_matrix/spec.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/rv_canonical_mtls_real_server_gate/spec.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/rv_localhost_vectorization/spec.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/rv_packaging_and_prereqs/spec.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/rv_pypi_publication/spec.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/rv_surviving_examples_executable/spec.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/spec.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/ATOMIC_STEPS_INDEX.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/placeholder-corrective-rv01-security-matrix.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/placeholder-corrective-rv02-vectorization.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/placeholder-corrective-rv03-broken-example.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/placeholder-corrective-rv04-canonical-gate.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/placeholder-corrective-rv05-packaging.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/placeholder-corrective-rv06-duplicate-version-or-auth.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/rv01-execute-automated-security-matrix.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/rv02-execute-localhost-vectorization-mtls-8001.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/rv03-execute-surviving-examples-sweep.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/rv04-execute-canonical-mtls-real-server-gate.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/rv04-supplementary-pytest-canonical-example-contract.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/rv05-build-artifacts-twine-version-gate.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/rv06-pypi-upload.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/spec.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/tests_scripts_and_dependency_cleanup/spec.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/tests_scripts_and_dependency_cleanup/steps/ATOMIC_STEPS_INDEX.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/tests_scripts_and_dependency_cleanup/steps/align-package-version-with-pyproject-metadata.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/tests_scripts_and_dependency_cleanup/steps/canonical-localhost-8001-mtls-example-and-execution-tests.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/tests_scripts_and_dependency_cleanup/steps/consolidate-pytest-configuration-single-source.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/tests_scripts_and_dependency_cleanup/steps/consolidate-redundant-coverage-test-modules.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/tests_scripts_and_dependency_cleanup/steps/delete-or-replace-skipped-auth-and-ssl-test-modules.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/tests_scripts_and_dependency_cleanup/steps/extract-async-client-adapter-tests-remove-legacy-aiohttp.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/tests_scripts_and_dependency_cleanup/steps/fix-or-remove-embed-client-auth-examples.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/tests_scripts_and_dependency_cleanup/steps/normalize-pyproject-runtime-deps-and-optional-extras.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/tests_scripts_and_dependency_cleanup/steps/replace-hardcoded-venv-site-packages-in-scripts-and-tests.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/specs/server_client_convergence_and_release/tests_scripts_and_dependency_cleanup/tasks/tsc_linter_exclusions_and_migration_inventory.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/tech_spec/branches/documentation_normalization/README.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/tech_spec/branches/documentation_normalization/tasks/doc_alignment_verification_and_closure.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/tech_spec/branches/documentation_normalization/tasks/doc_guides_examples_canonical_mtls.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/tech_spec/branches/documentation_normalization/tasks/doc_legacy_tree_prune_and_governance.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/docs/tech_spec/branches/documentation_normalization/tasks/doc_root_metadata_and_pypi_surface.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client/__main__.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client/adapter_config_factory.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client/adapter_config_normalizer.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client/adapter_generator_bridge.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client/auth.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client/cli.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client/cli_core.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client/client_factory.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client/client_factory_examples.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client/client_factory_helpers.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client/config.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client/config_defaults.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client/config_examples.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client/config_generator.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client/config_generator_cli.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client/config_presets.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client/config_validator.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client/config_validator_cli.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client/constants.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client/demo_cli.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client/demo_security_cli.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client/embed_file_output_validate.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client/embed_file_status_store.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client/embedding_client_helpers.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client/example_async_usage.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client/example_async_usage_demo.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client/example_async_usage_ru.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client/example_async_usage_ru_demo.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client/exceptions.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client/identifier_types.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client/json_embed_file_preflight.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client/local_json_embed_file.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client/md_embed_file_prep.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client/response_normalizer.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client/response_parsers.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client/security_cli.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client/security_cli_core.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client/ssl_examples.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client/ssl_manager.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client.egg-info/SOURCES.txt +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client.egg-info/dependency_links.txt +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client.egg-info/entry_points.txt +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client.egg-info/requires.txt +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/embed_client.egg-info/top_level.txt +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/examples/README.md +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/examples/__init__.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/examples/async_testing_client_example.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/examples/canonical_mtls_localhost_8001.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/examples/configs/http_simple.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/examples/configs/https_token.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/examples/configs/mtls_roles.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/examples/data/embed_file_json_array_sample.json +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/examples/embed_file_json_local.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/examples/security_examples.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/examples/security_examples_ru.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/setup.cfg +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/tests/test_adapter_integration.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/tests/test_adapter_phase1.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/tests/test_adapter_phase2.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/tests/test_all_security_modes.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/tests/test_async_client_adapter.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/tests/test_async_client_real.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/tests/test_async_client_real_fixtures.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/tests/test_async_client_stress.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/tests/test_async_client_stress_new.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/tests/test_async_client_stress_updated.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/tests/test_auth_manager.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/tests/test_canonical_mtls_example.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/tests/test_cli_embed_file_json.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/tests/test_cli_exit_codes_insecure.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/tests/test_client_factory.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/tests/test_client_factory_convenience.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/tests/test_client_factory_integration.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/tests/test_config.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/tests/test_embed_file_aggregation_method.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/tests/test_embed_file_output_validate.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/tests/test_embed_immediate_mode.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/tests/test_example_async_usage.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/tests/test_json_embed_file_preflight.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/tests/test_local_json_embed_file.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/tests/test_md_embed_file_prep.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/tests/test_security_matrix.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/tests/test_ssl_manager.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/tests/test_terminal_delivery_events.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/tests/test_wait_for_job_ws_fallback.py +0 -0
- {embed_client-4.0.45 → embed_client-4.0.46}/tests/test_with_auth.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: embed-client
|
|
3
|
-
Version: 4.0.
|
|
3
|
+
Version: 4.0.46
|
|
4
4
|
Summary: Async client for the Embedding Service API. Canonical class: EmbeddingClient (JSON-RPC via mcp-proxy-adapter >=8.10).
|
|
5
5
|
Author-email: Vasiliy Zdanovskiy <vasilyvz@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -104,7 +104,11 @@ Public queue-oriented helpers include **`embed`**, **`wait_for_job`**, **`job_st
|
|
|
104
104
|
|
|
105
105
|
**`embed_file` vs local JSON without shared server disk:** use **`embed_file`** with a server-visible **`input_file`** when the input already exists on the service host. For a **`json_array`** file that exists only on the client machine (no shared filesystem), use the CLI **`embed-file-json`** subcommand (or **`embed_file_from_local_json_file`**) so the client validates, uploads through the adapter, resolves **`storage_path`** via **`get_upload_session`**, then runs **`embed_file`** with that path and **`format=json_array`**. For Markdown sources (e.g. with YAML front matter), run **`prepare-embed-file-json`** first to emit a valid **`json_array`** (array of strings): the body is split **only** on blank lines (**`\n\n`**) into paragraph-sized strings, with per-paragraph UTF-8 size limits and **no** automatic oversize split — oversized paragraphs require editing the source or raising the byte cap; then **`embed-file-json`**. Add **`--show-progress`** to stream server WebSocket/status lines to stderr during the job wait (see **`CLI_README.md`**).
|
|
106
106
|
|
|
107
|
-
**
|
|
107
|
+
**Providers (server 4.0.46+):** the full model id is provider + model. **`embed`** and **`embed_file`** take an optional **`provider`** (`"local"` = the server's own model, or a live macsc provider id such as `"openai"`); it is sent only when not `None`. There is no `backend` argument any more (a `TypeError` is raised for `backend=`); the `backend` field of results and `models()` entries is still returned. **`default_model()`** returns exactly `{model, dimension, provider}`; **`models()`** returns `{use_own_model, default: {provider, model}, external: {configured, service}, models: [...]}` with entries `{name, provider, dimension, supported_dimensions, max_tokens, backend, residency (local)}`.
|
|
108
|
+
|
|
109
|
+
Resolution order (server): provider given -> must be known, model omitted -> the default model of that provider (it must be the default provider's, else `UNKNOWN_MODEL`); provider and model omitted -> the default pair; provider omitted and model given -> the default provider first (if it lists the model it is used and macsc is not consulted for a local default), else the other providers are searched: exactly one offers it -> used, several -> `PROVIDER_REQUIRED`, none -> `UNKNOWN_MODEL`. Dimension omitted -> the entry's default; given -> must satisfy `supported_dimensions` else `UNSUPPORTED_DIMENSION`.
|
|
110
|
+
|
|
111
|
+
Error codes (`error.data.code` / `error.data.kind`, surfaced unchanged): `-32602` `UNKNOWN_PROVIDER`, `UNKNOWN_MODEL`, `UNSUPPORTED_DIMENSION`, `PROVIDER_REQUIRED`; `-32003` `EXTERNAL_UNAVAILABLE`, `EXTERNAL_UPSTREAM_FAILURE`, `EXTERNAL_BAD_RESPONSE`, `EXTERNAL_INVALID_REQUEST`; `-32001` `MODEL_LOADING` (retry); `-32004` `OWN_MODEL_DISABLED`; `-32005` `GPU_DISABLED`; `-32603` `MODEL_LOAD_FAILED`, `NO_GPU_AVAILABLE`. **`model_offload()`** moves the resident local model VRAM -> RAM (pinned against the GPU watcher) and **`model_load(model=None, device=None, wait=None)`** moves it back (`wait=False` returns at once while the load continues, `wait=True` blocks until it is in VRAM); neither takes a provider. Refusals of `model_offload`/`model_load`/`default_model` arrive as **`EmbedAPIError`** carrying the server error object. Every embed result carries `provider`, `model`, `dimension` and `backend`; external results also carry `usage`.
|
|
108
112
|
|
|
109
113
|
## Documentation
|
|
110
114
|
|
|
@@ -57,7 +57,11 @@ Public queue-oriented helpers include **`embed`**, **`wait_for_job`**, **`job_st
|
|
|
57
57
|
|
|
58
58
|
**`embed_file` vs local JSON without shared server disk:** use **`embed_file`** with a server-visible **`input_file`** when the input already exists on the service host. For a **`json_array`** file that exists only on the client machine (no shared filesystem), use the CLI **`embed-file-json`** subcommand (or **`embed_file_from_local_json_file`**) so the client validates, uploads through the adapter, resolves **`storage_path`** via **`get_upload_session`**, then runs **`embed_file`** with that path and **`format=json_array`**. For Markdown sources (e.g. with YAML front matter), run **`prepare-embed-file-json`** first to emit a valid **`json_array`** (array of strings): the body is split **only** on blank lines (**`\n\n`**) into paragraph-sized strings, with per-paragraph UTF-8 size limits and **no** automatic oversize split — oversized paragraphs require editing the source or raising the byte cap; then **`embed-file-json`**. Add **`--show-progress`** to stream server WebSocket/status lines to stderr during the job wait (see **`CLI_README.md`**).
|
|
59
59
|
|
|
60
|
-
**
|
|
60
|
+
**Providers (server 4.0.46+):** the full model id is provider + model. **`embed`** and **`embed_file`** take an optional **`provider`** (`"local"` = the server's own model, or a live macsc provider id such as `"openai"`); it is sent only when not `None`. There is no `backend` argument any more (a `TypeError` is raised for `backend=`); the `backend` field of results and `models()` entries is still returned. **`default_model()`** returns exactly `{model, dimension, provider}`; **`models()`** returns `{use_own_model, default: {provider, model}, external: {configured, service}, models: [...]}` with entries `{name, provider, dimension, supported_dimensions, max_tokens, backend, residency (local)}`.
|
|
61
|
+
|
|
62
|
+
Resolution order (server): provider given -> must be known, model omitted -> the default model of that provider (it must be the default provider's, else `UNKNOWN_MODEL`); provider and model omitted -> the default pair; provider omitted and model given -> the default provider first (if it lists the model it is used and macsc is not consulted for a local default), else the other providers are searched: exactly one offers it -> used, several -> `PROVIDER_REQUIRED`, none -> `UNKNOWN_MODEL`. Dimension omitted -> the entry's default; given -> must satisfy `supported_dimensions` else `UNSUPPORTED_DIMENSION`.
|
|
63
|
+
|
|
64
|
+
Error codes (`error.data.code` / `error.data.kind`, surfaced unchanged): `-32602` `UNKNOWN_PROVIDER`, `UNKNOWN_MODEL`, `UNSUPPORTED_DIMENSION`, `PROVIDER_REQUIRED`; `-32003` `EXTERNAL_UNAVAILABLE`, `EXTERNAL_UPSTREAM_FAILURE`, `EXTERNAL_BAD_RESPONSE`, `EXTERNAL_INVALID_REQUEST`; `-32001` `MODEL_LOADING` (retry); `-32004` `OWN_MODEL_DISABLED`; `-32005` `GPU_DISABLED`; `-32603` `MODEL_LOAD_FAILED`, `NO_GPU_AVAILABLE`. **`model_offload()`** moves the resident local model VRAM -> RAM (pinned against the GPU watcher) and **`model_load(model=None, device=None, wait=None)`** moves it back (`wait=False` returns at once while the load continues, `wait=True` blocks until it is in VRAM); neither takes a provider. Refusals of `model_offload`/`model_load`/`default_model` arrive as **`EmbedAPIError`** carrying the server error object. Every embed result carries `provider`, `model`, `dimension` and `backend`; external results also carry `usage`.
|
|
61
65
|
|
|
62
66
|
## Documentation
|
|
63
67
|
|
|
@@ -650,7 +650,7 @@ class EmbeddingClient:
|
|
|
650
650
|
wait_timeout: int = 60,
|
|
651
651
|
poll_interval: float = 1.0,
|
|
652
652
|
use_push: bool = True,
|
|
653
|
-
|
|
653
|
+
provider: Optional[str] = None,
|
|
654
654
|
) -> Dict[str, Any]:
|
|
655
655
|
"""
|
|
656
656
|
Generate embeddings for texts (via queue).
|
|
@@ -675,30 +675,37 @@ class EmbeddingClient:
|
|
|
675
675
|
wait_timeout: Max time to wait (seconds); 0 = no timeout.
|
|
676
676
|
poll_interval: Unused (kept for API compatibility).
|
|
677
677
|
use_push: Unused; WS is always used when wait=True.
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
is
|
|
691
|
-
``
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
678
|
+
provider: Optional provider id of the full model id (provider +
|
|
679
|
+
model). ``"local"`` is the server's own model; any other id is
|
|
680
|
+
a live macsc vectorization provider (for example ``"openai"``).
|
|
681
|
+
Sent only when not ``None`` (never injected by the client).
|
|
682
|
+
Resolution on the server (default first): provider given ->
|
|
683
|
+
must be known (else UNKNOWN_PROVIDER); model omitted -> the
|
|
684
|
+
default model, which must belong to that provider (else
|
|
685
|
+
UNKNOWN_MODEL). Provider omitted and model omitted -> the
|
|
686
|
+
default pair. Provider omitted and model given -> the default
|
|
687
|
+
provider is tried first (if it lists the model it is used,
|
|
688
|
+
macsc is not consulted for a local default); otherwise the
|
|
689
|
+
other providers are searched: exactly one offering the model
|
|
690
|
+
is used, several -> PROVIDER_REQUIRED, none -> UNKNOWN_MODEL.
|
|
691
|
+
``dimension`` omitted -> the entry's default dimension; given
|
|
692
|
+
-> must satisfy its supported dimensions (else
|
|
693
|
+
UNSUPPORTED_DIMENSION). Errors arrive with ``error.data.code``
|
|
694
|
+
and ``error.data.kind`` unchanged: -32602 UNKNOWN_PROVIDER,
|
|
695
|
+
UNKNOWN_MODEL, UNSUPPORTED_DIMENSION, PROVIDER_REQUIRED;
|
|
696
|
+
-32003 EXTERNAL_UNAVAILABLE, EXTERNAL_UPSTREAM_FAILURE,
|
|
697
|
+
EXTERNAL_BAD_RESPONSE, EXTERNAL_INVALID_REQUEST; -32001
|
|
698
|
+
MODEL_LOADING (retry); -32004 OWN_MODEL_DISABLED; -32005
|
|
699
|
+
GPU_DISABLED; -32603 MODEL_LOAD_FAILED, NO_GPU_AVAILABLE.
|
|
700
|
+
``device``, ``aggregation_method`` and ``parts`` are accepted
|
|
701
|
+
only with the effective provider ``"local"``.
|
|
695
702
|
|
|
696
703
|
Returns:
|
|
697
704
|
If wait=False: ``{"job_id", "status", "message"}``; when the server hit
|
|
698
705
|
its synchronous execution cap and fell back to the queue, responses may
|
|
699
706
|
include ``queued_after_timeout: true`` (mcp-proxy-adapter >= 8.10).
|
|
700
707
|
If wait=True: {"results": [...], "model", "dimension"} (and optional
|
|
701
|
-
"device", "backend" and timing fields such as ``timing_total_seconds``,
|
|
708
|
+
"device", "provider", "backend" and timing fields such as ``timing_total_seconds``,
|
|
702
709
|
``timing_encode_seconds``, ``timing_tokenization_seconds``,
|
|
703
710
|
``timing_median_per_text_encode_seconds``), matching server embed
|
|
704
711
|
result data.
|
|
@@ -742,8 +749,8 @@ class EmbeddingClient:
|
|
|
742
749
|
params["aggregation_method"] = aggregation_method
|
|
743
750
|
if parts is not None:
|
|
744
751
|
params["parts"] = parts
|
|
745
|
-
if
|
|
746
|
-
params["
|
|
752
|
+
if provider is not None:
|
|
753
|
+
params["provider"] = provider
|
|
747
754
|
|
|
748
755
|
# When wait=True use execute_async("embed_execute") for in-process execution
|
|
749
756
|
# (no queue, no worker spawn) to avoid large per-request delay.
|
|
@@ -1113,7 +1120,7 @@ class EmbeddingClient:
|
|
|
1113
1120
|
device: Optional[str] = None,
|
|
1114
1121
|
error_policy: Optional[str] = None,
|
|
1115
1122
|
aggregation_method: Optional[str] = None,
|
|
1116
|
-
|
|
1123
|
+
provider: Optional[str] = None,
|
|
1117
1124
|
wait: bool = True,
|
|
1118
1125
|
wait_timeout: int = 600,
|
|
1119
1126
|
download_to: Optional[str] = None,
|
|
@@ -1145,8 +1152,9 @@ class EmbeddingClient:
|
|
|
1145
1152
|
aggregation_method: Same semantics as :meth:`embed`: resolved by
|
|
1146
1153
|
priority call -> config -> constant when omitted; applied
|
|
1147
1154
|
per-item, one line/array entry at a time.
|
|
1148
|
-
|
|
1149
|
-
|
|
1155
|
+
provider: Same semantics as :meth:`embed` (``"local"`` or a live
|
|
1156
|
+
macsc provider id; sent only when not ``None``; resolution order
|
|
1157
|
+
and error codes as documented there).
|
|
1150
1158
|
wait: If True, block until job completes (WebSocket).
|
|
1151
1159
|
wait_timeout: Seconds for wait (0 treated as 600 for WS wait).
|
|
1152
1160
|
download_to: If set, write the downloaded result JSON to this path. If
|
|
@@ -1194,8 +1202,8 @@ class EmbeddingClient:
|
|
|
1194
1202
|
params["error_policy"] = EMBED_COMMAND_SCHEMA_DEFAULT_ERROR_POLICY
|
|
1195
1203
|
if aggregation_method is not None:
|
|
1196
1204
|
params["aggregation_method"] = aggregation_method
|
|
1197
|
-
if
|
|
1198
|
-
params["
|
|
1205
|
+
if provider is not None:
|
|
1206
|
+
params["provider"] = provider
|
|
1199
1207
|
|
|
1200
1208
|
response = await self.client.jsonrpc_call("embed_file", params)
|
|
1201
1209
|
if "error" in response:
|
|
@@ -1396,12 +1404,15 @@ class EmbeddingClient:
|
|
|
1396
1404
|
List available models (shape matches server models command result.data).
|
|
1397
1405
|
|
|
1398
1406
|
Returns:
|
|
1399
|
-
{"
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1407
|
+
``{"use_own_model": "none"|"ram"|"gpu", "default": {provider,
|
|
1408
|
+
model}, "external": {configured, service}, "models": [...]}``; each
|
|
1409
|
+
entry has name, provider, dimension, supported_dimensions,
|
|
1410
|
+
max_tokens, backend and (local entries) residency. Entries are
|
|
1411
|
+
unique by (provider, name). The local entry is listed only when
|
|
1412
|
+
``use_own_model`` is not ``"none"``; macsc entries are the live
|
|
1413
|
+
list of providers with vectorization. macsc configured but down
|
|
1414
|
+
raises -32003 EXTERNAL_UNAVAILABLE (no static fallback). The method
|
|
1415
|
+
takes no parameters.
|
|
1405
1416
|
|
|
1406
1417
|
Raises:
|
|
1407
1418
|
EmbedClientError: If models request fails
|
|
@@ -1421,19 +1432,19 @@ class EmbeddingClient:
|
|
|
1421
1432
|
return result.get("data", {})
|
|
1422
1433
|
|
|
1423
1434
|
async def default_model(self) -> Dict[str, Any]:
|
|
1424
|
-
"""
|
|
1435
|
+
"""Default pair of the server (provider + model) and its dimension.
|
|
1425
1436
|
|
|
1426
|
-
The server takes no parameters.
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
model is loaded.
|
|
1437
|
+
The server takes no parameters. The default pair is the configured
|
|
1438
|
+
default provider and model; the dimension is the configured default
|
|
1439
|
+
dimension, else the entry's default dimension (local: the loaded
|
|
1440
|
+
dimension). Calls that name no provider use this pair.
|
|
1431
1441
|
|
|
1432
1442
|
Returns:
|
|
1433
|
-
``{model, dimension}``.
|
|
1443
|
+
Exactly ``{model, dimension, provider}``.
|
|
1434
1444
|
|
|
1435
1445
|
Raises:
|
|
1436
|
-
EmbedAPIError: -
|
|
1446
|
+
EmbedAPIError: -32001 MODEL_LOADING (local default not loaded yet),
|
|
1447
|
+
-32003 EXTERNAL_* when macsc fails or does not list the
|
|
1437
1448
|
configured default model.
|
|
1438
1449
|
"""
|
|
1439
1450
|
return await self._service_command("default_model", {})
|
|
@@ -1464,10 +1475,10 @@ class EmbeddingClient:
|
|
|
1464
1475
|
The hold lasts until ``model_load`` (or a model selection): neither the
|
|
1465
1476
|
GPU watcher nor a local request moves it back; local requests are
|
|
1466
1477
|
served on the CPU from the RAM image meanwhile. Idempotent.
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
no
|
|
1478
|
+
use_own_model ``gpu``: VRAM -> RAM, the GPU is released. ``ram``: an
|
|
1479
|
+
idempotent success (residency ``ram``, device ``cpu``, ``changed``
|
|
1480
|
+
false). ``none``: refused with -32004 OWN_MODEL_DISABLED. The command
|
|
1481
|
+
takes no ``provider``.
|
|
1471
1482
|
|
|
1472
1483
|
Args:
|
|
1473
1484
|
model: Local model to offload; defaults to the resident model.
|
|
@@ -1478,7 +1489,7 @@ class EmbeddingClient:
|
|
|
1478
1489
|
|
|
1479
1490
|
Raises:
|
|
1480
1491
|
EmbedAPIError: -32602 invalid parameter or MODEL_NOT_RESIDENT,
|
|
1481
|
-
-32001 MODEL_LOADING, -
|
|
1492
|
+
-32001 MODEL_LOADING, -32004 OWN_MODEL_DISABLED.
|
|
1482
1493
|
"""
|
|
1483
1494
|
params: Dict[str, Any] = {}
|
|
1484
1495
|
if model is not None:
|
|
@@ -1493,11 +1504,9 @@ class EmbeddingClient:
|
|
|
1493
1504
|
) -> Dict[str, Any]:
|
|
1494
1505
|
"""Move a local model RAM -> VRAM (or load it from disk).
|
|
1495
1506
|
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
model into RAM (residency ``"ram"``, device ``"cpu"``). Mode external:
|
|
1500
|
-
no local model, refused with -32002.
|
|
1507
|
+
use_own_model ``gpu``: the model goes onto the GPU. ``ram``: refused
|
|
1508
|
+
with -32005 GPU_DISABLED (any arguments). ``none``: refused with -32004
|
|
1509
|
+
OWN_MODEL_DISABLED. The command takes no ``provider``.
|
|
1501
1510
|
|
|
1502
1511
|
Args:
|
|
1503
1512
|
model: Local model to load; defaults to the server's ``embedding.model_name``.
|
|
@@ -1507,13 +1516,12 @@ class EmbeddingClient:
|
|
|
1507
1516
|
``True`` blocks until the model is in VRAM or the load failed.
|
|
1508
1517
|
|
|
1509
1518
|
Returns:
|
|
1510
|
-
``{model, dimension, residency: "loading"|"vram"
|
|
1511
|
-
|
|
1512
|
-
async}``.
|
|
1519
|
+
``{model, dimension, residency: "loading"|"vram",
|
|
1520
|
+
previous_residency, device, changed, async}``.
|
|
1513
1521
|
|
|
1514
1522
|
Raises:
|
|
1515
1523
|
EmbedAPIError: -32602 invalid parameter, -32603 NO_GPU_AVAILABLE or
|
|
1516
|
-
MODEL_LOAD_FAILED, -
|
|
1524
|
+
MODEL_LOAD_FAILED, -32004 OWN_MODEL_DISABLED, -32005 GPU_DISABLED.
|
|
1517
1525
|
"""
|
|
1518
1526
|
params: Dict[str, Any] = {}
|
|
1519
1527
|
if model is not None:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: embed-client
|
|
3
|
-
Version: 4.0.
|
|
3
|
+
Version: 4.0.46
|
|
4
4
|
Summary: Async client for the Embedding Service API. Canonical class: EmbeddingClient (JSON-RPC via mcp-proxy-adapter >=8.10).
|
|
5
5
|
Author-email: Vasiliy Zdanovskiy <vasilyvz@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -104,7 +104,11 @@ Public queue-oriented helpers include **`embed`**, **`wait_for_job`**, **`job_st
|
|
|
104
104
|
|
|
105
105
|
**`embed_file` vs local JSON without shared server disk:** use **`embed_file`** with a server-visible **`input_file`** when the input already exists on the service host. For a **`json_array`** file that exists only on the client machine (no shared filesystem), use the CLI **`embed-file-json`** subcommand (or **`embed_file_from_local_json_file`**) so the client validates, uploads through the adapter, resolves **`storage_path`** via **`get_upload_session`**, then runs **`embed_file`** with that path and **`format=json_array`**. For Markdown sources (e.g. with YAML front matter), run **`prepare-embed-file-json`** first to emit a valid **`json_array`** (array of strings): the body is split **only** on blank lines (**`\n\n`**) into paragraph-sized strings, with per-paragraph UTF-8 size limits and **no** automatic oversize split — oversized paragraphs require editing the source or raising the byte cap; then **`embed-file-json`**. Add **`--show-progress`** to stream server WebSocket/status lines to stderr during the job wait (see **`CLI_README.md`**).
|
|
106
106
|
|
|
107
|
-
**
|
|
107
|
+
**Providers (server 4.0.46+):** the full model id is provider + model. **`embed`** and **`embed_file`** take an optional **`provider`** (`"local"` = the server's own model, or a live macsc provider id such as `"openai"`); it is sent only when not `None`. There is no `backend` argument any more (a `TypeError` is raised for `backend=`); the `backend` field of results and `models()` entries is still returned. **`default_model()`** returns exactly `{model, dimension, provider}`; **`models()`** returns `{use_own_model, default: {provider, model}, external: {configured, service}, models: [...]}` with entries `{name, provider, dimension, supported_dimensions, max_tokens, backend, residency (local)}`.
|
|
108
|
+
|
|
109
|
+
Resolution order (server): provider given -> must be known, model omitted -> the default model of that provider (it must be the default provider's, else `UNKNOWN_MODEL`); provider and model omitted -> the default pair; provider omitted and model given -> the default provider first (if it lists the model it is used and macsc is not consulted for a local default), else the other providers are searched: exactly one offers it -> used, several -> `PROVIDER_REQUIRED`, none -> `UNKNOWN_MODEL`. Dimension omitted -> the entry's default; given -> must satisfy `supported_dimensions` else `UNSUPPORTED_DIMENSION`.
|
|
110
|
+
|
|
111
|
+
Error codes (`error.data.code` / `error.data.kind`, surfaced unchanged): `-32602` `UNKNOWN_PROVIDER`, `UNKNOWN_MODEL`, `UNSUPPORTED_DIMENSION`, `PROVIDER_REQUIRED`; `-32003` `EXTERNAL_UNAVAILABLE`, `EXTERNAL_UPSTREAM_FAILURE`, `EXTERNAL_BAD_RESPONSE`, `EXTERNAL_INVALID_REQUEST`; `-32001` `MODEL_LOADING` (retry); `-32004` `OWN_MODEL_DISABLED`; `-32005` `GPU_DISABLED`; `-32603` `MODEL_LOAD_FAILED`, `NO_GPU_AVAILABLE`. **`model_offload()`** moves the resident local model VRAM -> RAM (pinned against the GPU watcher) and **`model_load(model=None, device=None, wait=None)`** moves it back (`wait=False` returns at once while the load continues, `wait=True` blocks until it is in VRAM); neither takes a provider. Refusals of `model_offload`/`model_load`/`default_model` arrive as **`EmbedAPIError`** carrying the server error object. Every embed result carries `provider`, `model`, `dimension` and `backend`; external results also carry `usage`.
|
|
108
112
|
|
|
109
113
|
## Documentation
|
|
110
114
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "embed-client"
|
|
7
|
-
version = "4.0.
|
|
7
|
+
version = "4.0.46"
|
|
8
8
|
description = """Async client for the Embedding Service API. Canonical class: EmbeddingClient (JSON-RPC via mcp-proxy-adapter >=8.10).
|
|
9
9
|
|
|
10
10
|
Public API highlights:
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Client surface of the server's provider contract: the ``provider`` parameter of
|
|
3
|
+
embed / embed_file (no ``backend``), default_model / models and the
|
|
4
|
+
model_offload / model_load commands.
|
|
5
|
+
|
|
6
|
+
Author: Vasiliy Zdanovskiy
|
|
7
|
+
email: vasilyvz@gmail.com
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
import inspect
|
|
11
|
+
from typing import Optional
|
|
12
|
+
from unittest.mock import AsyncMock
|
|
13
|
+
|
|
14
|
+
import pytest
|
|
15
|
+
|
|
16
|
+
from embed_client.embedding_client import EmbeddingClient
|
|
17
|
+
from embed_client.exceptions import EmbedAPIError
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def _client() -> EmbeddingClient:
|
|
21
|
+
return EmbeddingClient(protocol="http", host="127.0.0.1", port=8080)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def _ok(data):
|
|
25
|
+
return {"result": {"success": True, "data": data}}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@pytest.mark.asyncio
|
|
29
|
+
async def test_embed_forwards_provider_only_when_supplied():
|
|
30
|
+
client = _client()
|
|
31
|
+
client.client.jsonrpc_call = AsyncMock(return_value=_ok({"job_id": "j1"}))
|
|
32
|
+
|
|
33
|
+
await client.embed(["a"], provider="openai", model="text-embedding-3-small")
|
|
34
|
+
_method, params = client.client.jsonrpc_call.await_args.args
|
|
35
|
+
assert params["provider"] == "openai"
|
|
36
|
+
assert params["model"] == "text-embedding-3-small"
|
|
37
|
+
|
|
38
|
+
await client.embed(["a"])
|
|
39
|
+
_method, params = client.client.jsonrpc_call.await_args.args
|
|
40
|
+
assert "provider" not in params
|
|
41
|
+
assert "backend" not in params
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
@pytest.mark.asyncio
|
|
45
|
+
async def test_embed_file_forwards_provider_only_when_supplied():
|
|
46
|
+
client = _client()
|
|
47
|
+
client.client.jsonrpc_call = AsyncMock(return_value=_ok({"job_id": "j1"}))
|
|
48
|
+
|
|
49
|
+
await client.embed_file("/srv/input.txt", provider="local", wait=False)
|
|
50
|
+
method, params = client.client.jsonrpc_call.await_args.args
|
|
51
|
+
assert method == "embed_file"
|
|
52
|
+
assert params["provider"] == "local"
|
|
53
|
+
|
|
54
|
+
await client.embed_file("/srv/input.txt", wait=False)
|
|
55
|
+
_method, params = client.client.jsonrpc_call.await_args.args
|
|
56
|
+
assert "provider" not in params
|
|
57
|
+
assert "backend" not in params
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
@pytest.mark.asyncio
|
|
61
|
+
async def test_embed_wait_true_carries_provider_to_embed_execute():
|
|
62
|
+
client = _client()
|
|
63
|
+
seen = {}
|
|
64
|
+
|
|
65
|
+
async def fake(params, wait_timeout):
|
|
66
|
+
seen.update(params)
|
|
67
|
+
return {
|
|
68
|
+
"results": [],
|
|
69
|
+
"model": "m",
|
|
70
|
+
"dimension": 1,
|
|
71
|
+
"provider": "openai",
|
|
72
|
+
"backend": "external",
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
client._embed_via_execute_async = fake
|
|
76
|
+
result = await client.embed(["a"], provider="openai", wait=True)
|
|
77
|
+
assert seen["provider"] == "openai"
|
|
78
|
+
assert "backend" not in seen
|
|
79
|
+
assert result["provider"] == "openai"
|
|
80
|
+
assert result["backend"] == "external"
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
@pytest.mark.asyncio
|
|
84
|
+
async def test_backend_kwarg_is_removed():
|
|
85
|
+
client = _client()
|
|
86
|
+
client.client.jsonrpc_call = AsyncMock(return_value=_ok({"job_id": "j1"}))
|
|
87
|
+
|
|
88
|
+
with pytest.raises(TypeError):
|
|
89
|
+
await client.embed(["a"], backend="external")
|
|
90
|
+
with pytest.raises(TypeError):
|
|
91
|
+
await client.embed(["a"], backend="local", wait=True)
|
|
92
|
+
with pytest.raises(TypeError):
|
|
93
|
+
await client.embed_file("/srv/input.txt", backend="local", wait=False)
|
|
94
|
+
client.client.jsonrpc_call.assert_not_awaited()
|
|
95
|
+
for name in ("embed", "embed_file"):
|
|
96
|
+
assert "backend" not in inspect.signature(getattr(client, name)).parameters
|
|
97
|
+
assert "use_own_model" not in inspect.signature(getattr(client, name)).parameters
|
|
98
|
+
assert getattr(client, name).__annotations__["provider"] == Optional[str]
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
@pytest.mark.asyncio
|
|
102
|
+
async def test_raw_parameter_invocation_still_sends_backend():
|
|
103
|
+
client = _client()
|
|
104
|
+
error = {"code": -32602, "data": {"violation": "unknown", "field": "backend"}}
|
|
105
|
+
client.client.jsonrpc_call = AsyncMock(return_value={"error": error})
|
|
106
|
+
|
|
107
|
+
response = await client.jsonrpc("embed", {"texts": ["a"], "backend": "local"})
|
|
108
|
+
method, params = client.client.jsonrpc_call.await_args.args
|
|
109
|
+
assert (method, params) == ("embed", {"texts": ["a"], "backend": "local"})
|
|
110
|
+
assert response == {"error": error}
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
@pytest.mark.asyncio
|
|
114
|
+
async def test_model_offload_builds_params_and_returns_data():
|
|
115
|
+
client = _client()
|
|
116
|
+
data = {"model": "m", "residency": "ram", "changed": True}
|
|
117
|
+
client.client.jsonrpc_call = AsyncMock(return_value=_ok(data))
|
|
118
|
+
|
|
119
|
+
assert await client.model_offload() == data
|
|
120
|
+
method, params = client.client.jsonrpc_call.await_args.args
|
|
121
|
+
assert (method, params) == ("model_offload", {})
|
|
122
|
+
|
|
123
|
+
await client.model_offload("all-MiniLM-L6-v2")
|
|
124
|
+
_method, params = client.client.jsonrpc_call.await_args.args
|
|
125
|
+
assert params == {"model": "all-MiniLM-L6-v2"}
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
@pytest.mark.asyncio
|
|
129
|
+
async def test_model_load_builds_params():
|
|
130
|
+
client = _client()
|
|
131
|
+
client.client.jsonrpc_call = AsyncMock(return_value=_ok({"residency": "loading"}))
|
|
132
|
+
|
|
133
|
+
await client.model_load()
|
|
134
|
+
method, params = client.client.jsonrpc_call.await_args.args
|
|
135
|
+
assert (method, params) == ("model_load", {})
|
|
136
|
+
|
|
137
|
+
await client.model_load("all-MiniLM-L6-v2", device="cuda:0", wait=True)
|
|
138
|
+
_method, params = client.client.jsonrpc_call.await_args.args
|
|
139
|
+
assert params == {"model": "all-MiniLM-L6-v2", "device": "cuda:0", "wait": True}
|
|
140
|
+
|
|
141
|
+
await client.model_load(wait=False)
|
|
142
|
+
_method, params = client.client.jsonrpc_call.await_args.args
|
|
143
|
+
assert params == {"wait": False}
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
@pytest.mark.asyncio
|
|
147
|
+
async def test_refusals_arrive_as_api_errors_with_the_server_error():
|
|
148
|
+
client = _client()
|
|
149
|
+
refusal = {
|
|
150
|
+
"code": -32004,
|
|
151
|
+
"message": "own model is disabled (use_own_model none)",
|
|
152
|
+
"data": {
|
|
153
|
+
"code": "OWN_MODEL_DISABLED",
|
|
154
|
+
"use_own_model": "none",
|
|
155
|
+
"command": "model_offload",
|
|
156
|
+
},
|
|
157
|
+
}
|
|
158
|
+
client.client.jsonrpc_call = AsyncMock(
|
|
159
|
+
return_value={"result": {"success": False, "error": refusal}}
|
|
160
|
+
)
|
|
161
|
+
with pytest.raises(EmbedAPIError) as info:
|
|
162
|
+
await client.model_offload()
|
|
163
|
+
assert info.value.error == refusal
|
|
164
|
+
|
|
165
|
+
client.client.jsonrpc_call = AsyncMock(return_value={"error": refusal})
|
|
166
|
+
with pytest.raises(EmbedAPIError) as info:
|
|
167
|
+
await client.model_load(wait=True)
|
|
168
|
+
assert info.value.error == refusal
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
@pytest.mark.asyncio
|
|
172
|
+
async def test_default_model_sends_no_parameters_and_returns_exact_triple():
|
|
173
|
+
client = _client()
|
|
174
|
+
data = {"model": "BAAI/bge-m3", "dimension": 1024, "provider": "local"}
|
|
175
|
+
client.client.jsonrpc_call = AsyncMock(return_value=_ok(data))
|
|
176
|
+
|
|
177
|
+
result = await client.default_model()
|
|
178
|
+
assert result == data
|
|
179
|
+
assert set(result) == {"model", "dimension", "provider"}
|
|
180
|
+
method, params = client.client.jsonrpc_call.await_args.args
|
|
181
|
+
assert (method, params) == ("default_model", {})
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
@pytest.mark.asyncio
|
|
185
|
+
async def test_default_model_surfaces_error_code_and_kind():
|
|
186
|
+
client = _client()
|
|
187
|
+
error = {
|
|
188
|
+
"code": -32003,
|
|
189
|
+
"message": "x",
|
|
190
|
+
"data": {"code": "EXTERNAL_UNAVAILABLE", "service": "macsc", "reason": "connect"},
|
|
191
|
+
}
|
|
192
|
+
client.client.jsonrpc_call = AsyncMock(return_value={"error": error})
|
|
193
|
+
|
|
194
|
+
with pytest.raises(EmbedAPIError) as info:
|
|
195
|
+
await client.default_model()
|
|
196
|
+
assert info.value.error == error
|
|
197
|
+
assert info.value.error["data"]["code"] == "EXTERNAL_UNAVAILABLE"
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
@pytest.mark.asyncio
|
|
201
|
+
async def test_resolution_error_keeps_data_code_and_kind():
|
|
202
|
+
client = _client()
|
|
203
|
+
error = {
|
|
204
|
+
"code": -32602,
|
|
205
|
+
"message": "unknown provider",
|
|
206
|
+
"data": {
|
|
207
|
+
"code": "UNKNOWN_PROVIDER",
|
|
208
|
+
"kind": "unknown_provider",
|
|
209
|
+
"violation": "value",
|
|
210
|
+
"field": "provider",
|
|
211
|
+
"provider_id": "nope",
|
|
212
|
+
"available": ["local", "openai"],
|
|
213
|
+
},
|
|
214
|
+
}
|
|
215
|
+
client.client.jsonrpc_call = AsyncMock(return_value={"error": error})
|
|
216
|
+
with pytest.raises(Exception) as info:
|
|
217
|
+
await client.embed(["a"], provider="nope")
|
|
218
|
+
assert "UNKNOWN_PROVIDER" in str(info.value)
|
|
219
|
+
assert "unknown_provider" in str(info.value)
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
@pytest.mark.asyncio
|
|
223
|
+
async def test_models_returns_payload_unchanged():
|
|
224
|
+
client = _client()
|
|
225
|
+
data = {
|
|
226
|
+
"use_own_model": "ram",
|
|
227
|
+
"default": {"provider": "local", "model": "BAAI/bge-m3"},
|
|
228
|
+
"external": {"configured": True, "service": "macsc"},
|
|
229
|
+
"models": [
|
|
230
|
+
{
|
|
231
|
+
"name": "BAAI/bge-m3",
|
|
232
|
+
"provider": "local",
|
|
233
|
+
"dimension": 1024,
|
|
234
|
+
"supported_dimensions": {"fixed": 1024},
|
|
235
|
+
"max_tokens": 8192,
|
|
236
|
+
"backend": "local",
|
|
237
|
+
"residency": "ram",
|
|
238
|
+
}
|
|
239
|
+
],
|
|
240
|
+
}
|
|
241
|
+
client.client.jsonrpc_call = AsyncMock(return_value=_ok(data))
|
|
242
|
+
|
|
243
|
+
assert await client.models() == data
|
|
244
|
+
method, params = client.client.jsonrpc_call.await_args.args
|
|
245
|
+
assert (method, params) == ("models", {})
|