embed-client 4.0.58__tar.gz → 4.0.60__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.58/embed_client.egg-info → embed_client-4.0.60}/PKG-INFO +1 -1
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client/__init__.py +1 -1
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client/adapter_config_factory.py +4 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client/config.py +9 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client/embedding_client_helpers.py +34 -3
- {embed_client-4.0.58 → embed_client-4.0.60/embed_client.egg-info}/PKG-INFO +1 -1
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client.egg-info/SOURCES.txt +2 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/examples/async_testing_client_example.py +30 -9
- {embed_client-4.0.58 → embed_client-4.0.60}/examples/canonical_mtls_localhost_8001.py +20 -4
- {embed_client-4.0.58 → embed_client-4.0.60}/examples/embed_file_json_local.py +5 -1
- {embed_client-4.0.58 → embed_client-4.0.60}/pyproject.toml +1 -1
- embed_client-4.0.60/tests/test_config_explicit_host_not_overridden.py +34 -0
- embed_client-4.0.60/tests/test_wait_for_job_poll_queue_shape.py +122 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/CONFIGURATION.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/LICENSE +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/MANIFEST.in +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/README.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/configs/basic_auth.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/configs/http.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/configs/http_8001_test.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/configs/http_correct.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/configs/http_simple.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/configs/http_test.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/configs/http_token.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/configs/http_token_correct.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/configs/http_token_roles.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/configs/http_token_roles_token_roles.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/configs/http_token_token_roles.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/configs/https.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/configs/https_8001_test.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/configs/https_api_test.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/configs/https_simple.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/configs/https_test.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/configs/https_token.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/configs/https_token_8001.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/configs/https_token_roles.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/configs/https_token_roles_token_roles.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/configs/https_token_token_roles.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/configs/jwt.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/configs/mtls.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/configs/mtls_8001.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/configs/mtls_8001_test.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/configs/mtls_correct.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/configs/mtls_roles.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/configs/mtls_roles_token_roles.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/configs/mtls_test.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/configs/mtls_token_roles.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/configs/mtls_via_adapter.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/configs/roles.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/configs/test_http_simple.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/configs/test_http_token.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/configs/test_http_token_roles.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/configs/test_https_simple.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/configs/test_https_token.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/configs/test_https_token_roles.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/configs/test_mtls_roles.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/configs/test_mtls_simple.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/configs/test_server_http.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/configs/test_server_https.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/configs/test_server_mtls.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/BUGREPORT_queue_manager_daemonic.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/IDENTIFIER_ANALYSIS_REPORT.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/PROPOSAL_SERVER_REQUEST_COALESCING.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/PROPOSAL_TWO_CHANNEL_OR_PUSH.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/SERVER_MODES_AND_CLIENT.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/api_format.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/client_integration_guide.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/coverage_report.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/error_500_analysis.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/error_handling_complete.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/error_handling_issue.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/specs/_template/README.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/specs/_template/example_global_step/example_tactical_step/example_atomic_step.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/specs/_template/example_global_step/example_tactical_step/spec.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/specs/_template/example_global_step/spec.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/specs/_template/spec.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/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.58 → embed_client-4.0.60}/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.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/baseline_audit_and_contract_capture/migration_baseline_deliverable/spec.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/baseline_audit_and_contract_capture/spec.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/documentation_normalization/spec.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/ATOMIC_STEPS_INDEX.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-01.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-02.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-03.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-04.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-05.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-06.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-07.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-08.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-09.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-10.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-11.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-12.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-13.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-14.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-15.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-16.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-17.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-18.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-19.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-20.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-21.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/documentation_normalization/steps/DN-AT-22.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/plan.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/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.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/production_migration_and_legacy_removal/canonical_client_migration/PARALLEL_WAVES.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/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.58 → embed_client-4.0.60}/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.58 → embed_client-4.0.60}/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.58 → embed_client-4.0.60}/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.58 → embed_client-4.0.60}/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.58 → embed_client-4.0.60}/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.58 → embed_client-4.0.60}/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.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/production_migration_and_legacy_removal/canonical_client_migration/spec.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/production_migration_and_legacy_removal/spec.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/README.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/rv_automated_security_matrix/spec.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/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.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/rv_localhost_vectorization/spec.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/rv_packaging_and_prereqs/spec.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/rv_pypi_publication/spec.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/rv_surviving_examples_executable/spec.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/spec.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/ATOMIC_STEPS_INDEX.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/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.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/placeholder-corrective-rv02-vectorization.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/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.58 → embed_client-4.0.60}/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.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/placeholder-corrective-rv05-packaging.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/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.58 → embed_client-4.0.60}/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.58 → embed_client-4.0.60}/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.58 → embed_client-4.0.60}/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.58 → embed_client-4.0.60}/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.58 → embed_client-4.0.60}/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.58 → embed_client-4.0.60}/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.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/release_validation_and_pypi_publication/steps/rv06-pypi-upload.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/spec.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/tests_scripts_and_dependency_cleanup/spec.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/specs/server_client_convergence_and_release/tests_scripts_and_dependency_cleanup/steps/ATOMIC_STEPS_INDEX.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/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.58 → embed_client-4.0.60}/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.58 → embed_client-4.0.60}/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.58 → embed_client-4.0.60}/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.58 → embed_client-4.0.60}/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.58 → embed_client-4.0.60}/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.58 → embed_client-4.0.60}/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.58 → embed_client-4.0.60}/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.58 → embed_client-4.0.60}/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.58 → embed_client-4.0.60}/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.58 → embed_client-4.0.60}/docs/tech_spec/branches/documentation_normalization/README.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/tech_spec/branches/documentation_normalization/tasks/doc_alignment_verification_and_closure.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/tech_spec/branches/documentation_normalization/tasks/doc_guides_examples_canonical_mtls.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/tech_spec/branches/documentation_normalization/tasks/doc_legacy_tree_prune_and_governance.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/docs/tech_spec/branches/documentation_normalization/tasks/doc_root_metadata_and_pypi_surface.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client/__main__.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client/adapter_config_normalizer.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client/adapter_generator_bridge.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client/auth.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client/cli.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client/cli_core.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client/client_factory.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client/client_factory_examples.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client/client_factory_helpers.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client/config_defaults.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client/config_examples.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client/config_generator.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client/config_generator_cli.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client/config_presets.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client/config_validator.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client/config_validator_cli.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client/constants.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client/demo_cli.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client/demo_security_cli.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client/embed_file_output_validate.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client/embed_file_status_store.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client/embedding_client.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client/example_async_usage.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client/example_async_usage_demo.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client/example_async_usage_ru.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client/example_async_usage_ru_demo.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client/exceptions.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client/identifier_types.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client/json_embed_file_preflight.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client/local_json_embed_file.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client/md_embed_file_prep.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client/response_normalizer.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client/response_parsers.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client/security_cli.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client/security_cli_core.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client/ssl_examples.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client/ssl_manager.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client.egg-info/dependency_links.txt +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client.egg-info/entry_points.txt +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client.egg-info/requires.txt +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/embed_client.egg-info/top_level.txt +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/examples/README.md +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/examples/__init__.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/examples/configs/http_simple.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/examples/configs/https_token.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/examples/configs/mtls_roles.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/examples/data/embed_file_json_array_sample.json +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/examples/security_examples.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/examples/security_examples_ru.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/setup.cfg +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/tests/test_adapter_integration.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/tests/test_adapter_phase1.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/tests/test_adapter_phase2.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/tests/test_all_security_modes.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/tests/test_async_client_adapter.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/tests/test_async_client_real.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/tests/test_async_client_real_fixtures.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/tests/test_async_client_stress.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/tests/test_async_client_stress_new.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/tests/test_async_client_stress_updated.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/tests/test_auth_manager.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/tests/test_canonical_mtls_example.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/tests/test_cli_embed_file_json.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/tests/test_cli_exit_codes_insecure.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/tests/test_client_factory.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/tests/test_client_factory_convenience.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/tests/test_client_factory_integration.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/tests/test_config.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/tests/test_embed_file_aggregation_method.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/tests/test_embed_file_output_validate.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/tests/test_embed_immediate_mode.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/tests/test_example_async_usage.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/tests/test_input_limit_commands_client.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/tests/test_json_embed_file_preflight.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/tests/test_local_json_embed_file.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/tests/test_md_embed_file_prep.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/tests/test_security_matrix.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/tests/test_ssl_manager.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/tests/test_structured_terminal_error.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/tests/test_terminal_delivery_events.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/tests/test_vectorization_modes_client.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/tests/test_wait_for_job_ws_fallback.py +0 -0
- {embed_client-4.0.58 → embed_client-4.0.60}/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.60
|
|
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
|
|
@@ -46,6 +46,10 @@ class AdapterConfigFactory:
|
|
|
46
46
|
)
|
|
47
47
|
port = server_config.get("port", 8001)
|
|
48
48
|
|
|
49
|
+
# A bare host/IP (as the config generator writes it) has no scheme;
|
|
50
|
+
# give urlparse a netloc so the host is kept instead of dropped.
|
|
51
|
+
if "://" not in base_url:
|
|
52
|
+
base_url = f"http://{base_url}"
|
|
49
53
|
parsed = urlparse(base_url)
|
|
50
54
|
protocol = parsed.scheme or "http"
|
|
51
55
|
host = parsed.hostname or "localhost"
|
|
@@ -58,6 +58,15 @@ class ClientConfig:
|
|
|
58
58
|
try:
|
|
59
59
|
with open(self.config_path, "r", encoding="utf-8") as f:
|
|
60
60
|
file_config = json.load(f)
|
|
61
|
+
# The default ``server.base_url`` must not override an
|
|
62
|
+
# explicitly configured host/port (adapter prefers base_url).
|
|
63
|
+
file_server = file_config.get("server")
|
|
64
|
+
if (
|
|
65
|
+
isinstance(file_server, dict)
|
|
66
|
+
and ("host" in file_server or "port" in file_server)
|
|
67
|
+
and "base_url" not in file_server
|
|
68
|
+
):
|
|
69
|
+
self.config_data["server"].pop("base_url", None)
|
|
61
70
|
update_nested_dict(self.config_data, file_config)
|
|
62
71
|
except Exception as e:
|
|
63
72
|
print(f"Error loading config from {self.config_path}: {e}")
|
|
@@ -7,11 +7,38 @@ email: vasilyvz@gmail.com
|
|
|
7
7
|
|
|
8
8
|
import asyncio
|
|
9
9
|
import time
|
|
10
|
-
from typing import Any, Dict, Union, cast
|
|
10
|
+
from typing import Any, Dict, Optional, Union, cast
|
|
11
11
|
|
|
12
12
|
from embed_client.exceptions import EmbedClientError
|
|
13
13
|
|
|
14
14
|
|
|
15
|
+
def _status_exists(status: Dict[str, Any]) -> bool:
|
|
16
|
+
"""Whether a job_status dict names a known job.
|
|
17
|
+
|
|
18
|
+
embed_job_status carries an explicit ``exists`` flag. queue_get_job_status data does not
|
|
19
|
+
(it has ``job_id``/``status``/``result``/``error`` only), so a queue status that names a
|
|
20
|
+
state means the job exists. An empty payload or ``exists: false`` means it is missing.
|
|
21
|
+
"""
|
|
22
|
+
if "exists" in status:
|
|
23
|
+
return bool(status.get("exists"))
|
|
24
|
+
return bool(status.get("status"))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def _nested_result_data(inner: Dict[str, Any]) -> Optional[Dict[str, Any]]:
|
|
28
|
+
"""Return the first ``data`` dict inside the ``result`` chain of a queue status result.
|
|
29
|
+
|
|
30
|
+
queue_get_job_status keeps the embed envelope one level deeper than embed_job_status:
|
|
31
|
+
``result = {job_id, command, result: {success, data: <embed result>}}``.
|
|
32
|
+
"""
|
|
33
|
+
node: Any = inner.get("result")
|
|
34
|
+
while isinstance(node, dict):
|
|
35
|
+
data = node.get("data")
|
|
36
|
+
if isinstance(data, dict):
|
|
37
|
+
return data
|
|
38
|
+
node = node.get("result")
|
|
39
|
+
return None
|
|
40
|
+
|
|
41
|
+
|
|
15
42
|
async def wait_for_job_poll(
|
|
16
43
|
job_status_fn: Any,
|
|
17
44
|
job_id: str,
|
|
@@ -21,13 +48,14 @@ async def wait_for_job_poll(
|
|
|
21
48
|
"""
|
|
22
49
|
Poll job_status until done or timeout.
|
|
23
50
|
|
|
24
|
-
job_status_fn: async callable(job_id) -> status dict
|
|
51
|
+
job_status_fn: async callable(job_id) -> status dict, in either the embed_job_status
|
|
52
|
+
shape (``exists``/``done``) or the queue_get_job_status shape (``status``/``result``).
|
|
25
53
|
Returns result data on completion; raises EmbedClientError or TimeoutError.
|
|
26
54
|
"""
|
|
27
55
|
start_time = time.time()
|
|
28
56
|
while timeout == 0 or (time.time() - start_time < timeout):
|
|
29
57
|
status = await job_status_fn(job_id)
|
|
30
|
-
if not status
|
|
58
|
+
if not _status_exists(status):
|
|
31
59
|
raise EmbedClientError(f"Job {job_id} not found")
|
|
32
60
|
done = status.get("done", False) or status.get("status") in (
|
|
33
61
|
"completed",
|
|
@@ -42,6 +70,9 @@ async def wait_for_job_poll(
|
|
|
42
70
|
data = inner.get("data")
|
|
43
71
|
if data is not None:
|
|
44
72
|
return cast(Dict[str, Any], data)
|
|
73
|
+
nested = _nested_result_data(inner)
|
|
74
|
+
if nested is not None:
|
|
75
|
+
return cast(Dict[str, Any], nested)
|
|
45
76
|
return cast(Dict[str, Any], inner if isinstance(inner, dict) else {})
|
|
46
77
|
if job_status in ("failed", "error"):
|
|
47
78
|
error = status.get("error") or status.get("message", "Unknown error")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: embed-client
|
|
3
|
-
Version: 4.0.
|
|
3
|
+
Version: 4.0.60
|
|
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
|
|
@@ -218,6 +218,7 @@ tests/test_client_factory.py
|
|
|
218
218
|
tests/test_client_factory_convenience.py
|
|
219
219
|
tests/test_client_factory_integration.py
|
|
220
220
|
tests/test_config.py
|
|
221
|
+
tests/test_config_explicit_host_not_overridden.py
|
|
221
222
|
tests/test_embed_file_aggregation_method.py
|
|
222
223
|
tests/test_embed_file_output_validate.py
|
|
223
224
|
tests/test_embed_immediate_mode.py
|
|
@@ -231,5 +232,6 @@ tests/test_ssl_manager.py
|
|
|
231
232
|
tests/test_structured_terminal_error.py
|
|
232
233
|
tests/test_terminal_delivery_events.py
|
|
233
234
|
tests/test_vectorization_modes_client.py
|
|
235
|
+
tests/test_wait_for_job_poll_queue_shape.py
|
|
234
236
|
tests/test_wait_for_job_ws_fallback.py
|
|
235
237
|
tests/test_with_auth.py
|
|
@@ -38,6 +38,7 @@ from __future__ import annotations
|
|
|
38
38
|
import asyncio
|
|
39
39
|
import sys
|
|
40
40
|
from pathlib import Path
|
|
41
|
+
from typing import Any, Dict, Optional
|
|
41
42
|
|
|
42
43
|
_ROOT = Path(__file__).resolve().parent.parent
|
|
43
44
|
if str(_ROOT) not in sys.path:
|
|
@@ -48,26 +49,46 @@ from embed_client.config_validator import ConfigValidator # noqa: E402
|
|
|
48
49
|
from embed_client.embedding_client import EmbeddingClient # noqa: E402
|
|
49
50
|
|
|
50
51
|
|
|
51
|
-
async def
|
|
52
|
+
async def run_example(
|
|
53
|
+
host: str = "localhost",
|
|
54
|
+
port: int = 8001,
|
|
55
|
+
protocol: str = "http",
|
|
56
|
+
ca_path: Optional[str] = None,
|
|
57
|
+
output_dir: Optional[Path] = None,
|
|
58
|
+
) -> Dict[str, Any]:
|
|
59
|
+
"""Generate, validate and use a client config; return the ``health()`` result.
|
|
60
|
+
|
|
61
|
+
``protocol`` is ``http`` or ``https`` (``https`` takes *ca_path*). Defaults reproduce the original behaviour: localhost, 8001, http,
|
|
62
|
+
config written under ``<repo>/configs``.
|
|
63
|
+
"""
|
|
52
64
|
gen = ClientConfigGenerator()
|
|
53
|
-
|
|
65
|
+
out_dir = Path(output_dir) if output_dir is not None else _ROOT / "configs"
|
|
66
|
+
out = out_dir / "_example_generated_http.json"
|
|
54
67
|
out.parent.mkdir(parents=True, exist_ok=True)
|
|
55
|
-
|
|
56
|
-
host=
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
68
|
+
if protocol == "http":
|
|
69
|
+
config = gen.generate_http_config(host=host, port=port, output_path=out)
|
|
70
|
+
elif protocol == "https":
|
|
71
|
+
config = gen.generate_https_config(
|
|
72
|
+
host=host, port=port, ca_cert_file=ca_path, output_path=out
|
|
73
|
+
)
|
|
74
|
+
else:
|
|
75
|
+
raise ValueError(f"unsupported protocol {protocol!r}")
|
|
60
76
|
print(
|
|
61
77
|
"Generated config dict keys:",
|
|
62
78
|
list(config.keys()) if isinstance(config, dict) else type(config),
|
|
63
79
|
)
|
|
64
80
|
|
|
65
|
-
valid, errors = ConfigValidator().validate_config_file(
|
|
66
|
-
print("validate_config:", valid, errors)
|
|
81
|
+
valid, message, errors = ConfigValidator().validate_config_file(out)
|
|
82
|
+
print("validate_config:", valid, message, errors)
|
|
67
83
|
|
|
68
84
|
async with EmbeddingClient.from_config_file(out) as client:
|
|
69
85
|
h = await client.health()
|
|
70
86
|
print("health:", h)
|
|
87
|
+
return h
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
async def main() -> None:
|
|
91
|
+
await run_example()
|
|
71
92
|
|
|
72
93
|
|
|
73
94
|
if __name__ == "__main__":
|
|
@@ -126,8 +126,17 @@ def build_mtls_localhost_8001_config(root: Path) -> Dict[str, Any]:
|
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
DEFAULT_MODEL = "text-embedding-3-small"
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
async def run_live_capabilities(
|
|
133
|
+
client: EmbeddingClient, model: str = DEFAULT_MODEL
|
|
134
|
+
) -> List[str]:
|
|
135
|
+
"""Execute capability checks; return human-readable step log lines.
|
|
136
|
+
|
|
137
|
+
Every embed call requests *model* (billable-safe ``text-embedding-3-small``
|
|
138
|
+
by default) instead of relying on the server default.
|
|
139
|
+
"""
|
|
131
140
|
lines: List[str] = []
|
|
132
141
|
|
|
133
142
|
h = await client.health()
|
|
@@ -141,19 +150,26 @@ async def run_live_capabilities(client: EmbeddingClient) -> List[str]:
|
|
|
141
150
|
|
|
142
151
|
emb_cmd = await client.cmd(
|
|
143
152
|
"embed",
|
|
144
|
-
{
|
|
153
|
+
{
|
|
154
|
+
"texts": ["canonical cmd embed"],
|
|
155
|
+
"model": model,
|
|
156
|
+
"error_policy": "continue",
|
|
157
|
+
},
|
|
145
158
|
)
|
|
146
159
|
lines.append(f"cmd(embed): {str(emb_cmd)[:200]}...")
|
|
147
160
|
|
|
148
161
|
sync_result = await client.embed(
|
|
149
162
|
["hello from wait=True"],
|
|
163
|
+
model=model,
|
|
150
164
|
wait=True,
|
|
151
165
|
wait_timeout=120,
|
|
152
166
|
error_policy="continue",
|
|
153
167
|
)
|
|
154
168
|
lines.append(f"embed(wait=True): has results = {'results' in sync_result}")
|
|
155
169
|
|
|
156
|
-
queued = await client.embed(
|
|
170
|
+
queued = await client.embed(
|
|
171
|
+
["queued path"], model=model, wait=False, error_policy="continue"
|
|
172
|
+
)
|
|
157
173
|
jid = queued.get("job_id") if isinstance(queued, dict) else None
|
|
158
174
|
lines.append(f"embed(wait=False): job_id={jid!r}")
|
|
159
175
|
if jid:
|
|
@@ -30,13 +30,17 @@ from embed_client.exceptions import EmbedClientError
|
|
|
30
30
|
from embed_client.json_embed_file_preflight import iter_json_array_block_texts
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
DEFAULT_MODEL = "text-embedding-3-small"
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
async def _run(json_path: str, model: str = DEFAULT_MODEL) -> int:
|
|
34
37
|
blocks = iter_json_array_block_texts(json_path)
|
|
35
38
|
client: EmbeddingClient = ClientFactory.from_environment()
|
|
36
39
|
async with client:
|
|
37
40
|
t0 = time.perf_counter()
|
|
38
41
|
out = await client.embed_file_from_local_json_file(
|
|
39
42
|
json_path,
|
|
43
|
+
model=model,
|
|
40
44
|
wait_timeout=600,
|
|
41
45
|
)
|
|
42
46
|
elapsed = time.perf_counter() - t0
|
|
@@ -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.60"
|
|
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,34 @@
|
|
|
1
|
+
"""Explicit server host/port must not be overridden by the default base_url (bug 480c027c)."""
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
|
|
5
|
+
import pytest
|
|
6
|
+
|
|
7
|
+
from embed_client.adapter_config_factory import AdapterConfigFactory
|
|
8
|
+
from embed_client.config import ClientConfig
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def _adapter(tmp_path, server):
|
|
12
|
+
path = tmp_path / "c.json"
|
|
13
|
+
path.write_text(json.dumps({"server": server}), encoding="utf-8")
|
|
14
|
+
cfg = ClientConfig()
|
|
15
|
+
cfg.load_from_file(str(path))
|
|
16
|
+
return AdapterConfigFactory.from_client_config(cfg)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@pytest.mark.parametrize(
|
|
20
|
+
"server,expected",
|
|
21
|
+
[
|
|
22
|
+
({"host": "192.168.254.26", "port": 8001}, ("http", "192.168.254.26", 8001)),
|
|
23
|
+
({"host": "https://10.1.2.3:9443"}, ("https", "10.1.2.3", 9443)),
|
|
24
|
+
({"port": 9000}, ("http", "localhost", 9000)),
|
|
25
|
+
(
|
|
26
|
+
{"host": "h", "port": 1, "base_url": "https://x.example:2"},
|
|
27
|
+
("https", "x.example", 2),
|
|
28
|
+
),
|
|
29
|
+
({}, ("http", "localhost", 8001)),
|
|
30
|
+
],
|
|
31
|
+
)
|
|
32
|
+
def test_explicit_server_wins_over_default_base_url(tmp_path, server, expected):
|
|
33
|
+
a = _adapter(tmp_path, server)
|
|
34
|
+
assert (a["protocol"], a["host"], a["port"]) == expected
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Bug 57d507b7: wait_for_job_poll must accept the queue_get_job_status shape.
|
|
3
|
+
|
|
4
|
+
`EmbeddingClient.job_status` returns the raw data of `queue_get_job_status`, which carries
|
|
5
|
+
`job_id`, `status`, `result`, `error`, timestamps and diagnostics but no `exists`/`done` keys.
|
|
6
|
+
The poll helper used to raise `Job <id> not found` on the first poll because
|
|
7
|
+
`status.get("exists")` was falsy. These tests pin the queue shape through the poll helper and
|
|
8
|
+
through `EmbeddingClient.job_status`, and keep the genuinely-missing-job error unchanged.
|
|
9
|
+
|
|
10
|
+
Author: Vasiliy Zdanovskiy
|
|
11
|
+
email: vasilyvz@gmail.com
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
import asyncio
|
|
15
|
+
from typing import Any, Dict, List
|
|
16
|
+
|
|
17
|
+
import pytest
|
|
18
|
+
|
|
19
|
+
from embed_client.embedding_client import EmbeddingClient
|
|
20
|
+
from embed_client.embedding_client_helpers import wait_for_job_poll
|
|
21
|
+
from embed_client.exceptions import EmbedClientError
|
|
22
|
+
|
|
23
|
+
_JOB_ID = "7710c931-b3ec-45b4-8a90-b5f1c0241d7c"
|
|
24
|
+
_ROW = {"body": "x", "embedding": [0.1, 0.2], "tokens": ["x"], "bm25_tokens": ["x"], "error": None}
|
|
25
|
+
_EMBED_DATA = {"results": [_ROW], "model": "m", "dimension": 2}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def _queue_status(status: str, **extra: Any) -> Dict[str, Any]:
|
|
29
|
+
"""Shape of queue_get_job_status data (adapter commands/queue/get_status_command.py)."""
|
|
30
|
+
base: Dict[str, Any] = {
|
|
31
|
+
"job_id": _JOB_ID,
|
|
32
|
+
"status": status,
|
|
33
|
+
"progress": 0,
|
|
34
|
+
"description": "",
|
|
35
|
+
"result": None,
|
|
36
|
+
"error": None,
|
|
37
|
+
"created_at": "2026-10-22T04:08:05Z",
|
|
38
|
+
"started_at": None,
|
|
39
|
+
"completed_at": None,
|
|
40
|
+
}
|
|
41
|
+
base.update(extra)
|
|
42
|
+
return base
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def _completed_queue_status() -> Dict[str, Any]:
|
|
46
|
+
# Wrapper the queue store keeps for an embed job: {job_id, command, result: {success, data}}.
|
|
47
|
+
inner = {"success": True, "data": _EMBED_DATA}
|
|
48
|
+
return _queue_status(
|
|
49
|
+
"completed",
|
|
50
|
+
result={"job_id": _JOB_ID, "command": "embed_thin", "result": inner},
|
|
51
|
+
completed_at="2026-10-22T04:08:09Z",
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
class _ScriptedStatus:
|
|
56
|
+
"""Async job_status double returning a scripted sequence (last item repeats)."""
|
|
57
|
+
|
|
58
|
+
def __init__(self, statuses: List[Dict[str, Any]]) -> None:
|
|
59
|
+
self._statuses = list(statuses)
|
|
60
|
+
self.calls = 0
|
|
61
|
+
|
|
62
|
+
async def __call__(self, job_id: str) -> Dict[str, Any]:
|
|
63
|
+
assert job_id == _JOB_ID
|
|
64
|
+
self.calls += 1
|
|
65
|
+
if len(self._statuses) > 1:
|
|
66
|
+
return self._statuses.pop(0)
|
|
67
|
+
return self._statuses[0]
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
class _QueueTransport:
|
|
71
|
+
"""Adapter client double: queue_get_job_status answers with the scripted queue data."""
|
|
72
|
+
|
|
73
|
+
def __init__(self, statuses: List[Dict[str, Any]]) -> None:
|
|
74
|
+
self._statuses = list(statuses)
|
|
75
|
+
|
|
76
|
+
async def jsonrpc_call(self, method: str, params: Dict[str, Any]) -> Dict[str, Any]:
|
|
77
|
+
assert method == "queue_get_job_status"
|
|
78
|
+
status = self._statuses.pop(0) if len(self._statuses) > 1 else self._statuses[0]
|
|
79
|
+
return {"jsonrpc": "2.0", "id": 1, "result": {"success": True, "data": status}}
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def _client(transport: _QueueTransport) -> EmbeddingClient:
|
|
83
|
+
client = EmbeddingClient.__new__(EmbeddingClient)
|
|
84
|
+
client.client = transport # type: ignore[attr-defined]
|
|
85
|
+
return client
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def test_poll_accepts_queue_shape_pending_running_then_completed() -> None:
|
|
89
|
+
status_fn = _ScriptedStatus(
|
|
90
|
+
[_queue_status("pending"), _queue_status("running"), _completed_queue_status()]
|
|
91
|
+
)
|
|
92
|
+
result = asyncio.run(wait_for_job_poll(status_fn, _JOB_ID, timeout=5, poll_interval=0.0))
|
|
93
|
+
assert result == _EMBED_DATA
|
|
94
|
+
assert status_fn.calls == 3
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def test_poll_queue_shape_through_embedding_client_job_status() -> None:
|
|
98
|
+
transport = _QueueTransport(
|
|
99
|
+
[_queue_status("pending"), _queue_status("running"), _completed_queue_status()]
|
|
100
|
+
)
|
|
101
|
+
client = _client(transport)
|
|
102
|
+
result = asyncio.run(
|
|
103
|
+
wait_for_job_poll(client.job_status, _JOB_ID, timeout=5, poll_interval=0.0)
|
|
104
|
+
)
|
|
105
|
+
assert result == _EMBED_DATA
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def test_poll_queue_shape_terminal_failed_raises_job_failed() -> None:
|
|
109
|
+
status_fn = _ScriptedStatus([_queue_status("failed", error="worker crashed")])
|
|
110
|
+
with pytest.raises(EmbedClientError, match="Job failed: worker crashed"):
|
|
111
|
+
asyncio.run(wait_for_job_poll(status_fn, _JOB_ID, timeout=5, poll_interval=0.0))
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
def test_poll_genuinely_missing_job_still_raises_not_found() -> None:
|
|
115
|
+
# Embed shape for an unknown job (embed_job_status: exists false).
|
|
116
|
+
status_fn = _ScriptedStatus([{"exists": False, "status": "unknown", "done": False}])
|
|
117
|
+
with pytest.raises(EmbedClientError, match=f"Job {_JOB_ID} not found"):
|
|
118
|
+
asyncio.run(wait_for_job_poll(status_fn, _JOB_ID, timeout=5, poll_interval=0.0))
|
|
119
|
+
# Empty payload (no status at all) is also a missing job.
|
|
120
|
+
status_fn_empty = _ScriptedStatus([{}])
|
|
121
|
+
with pytest.raises(EmbedClientError, match=f"Job {_JOB_ID} not found"):
|
|
122
|
+
asyncio.run(wait_for_job_poll(status_fn_empty, _JOB_ID, timeout=5, poll_interval=0.0))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{embed_client-4.0.58 → embed_client-4.0.60}/docs/specs/_template/example_global_step/spec.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|