numind 0.3.0__tar.gz → 0.3.1__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.
- {numind-0.3.0 → numind-0.3.1}/.github/workflows/lint.yml +1 -1
- {numind-0.3.0 → numind-0.3.1}/.github/workflows/publish-pypi.yml +2 -2
- {numind-0.3.0 → numind-0.3.1}/.github/workflows/sdk-auto-update.yml +2 -2
- {numind-0.3.0 → numind-0.3.1}/.github/workflows/tests.yml +1 -1
- {numind-0.3.0 → numind-0.3.1}/PKG-INFO +92 -36
- {numind-0.3.0 → numind-0.3.1}/README.md +90 -34
- numind-0.3.1/docs/Content.md +30 -0
- {numind-0.3.0 → numind-0.3.1}/docs/ContentExtractionApi.md +49 -26
- {numind-0.3.0 → numind-0.3.1}/docs/ContentExtractionProjectManagementApi.md +146 -57
- {numind-0.3.0 → numind-0.3.1}/docs/ContentExtractionResponse.md +4 -1
- {numind-0.3.0 → numind-0.3.1}/docs/ContentProjectResponse.md +3 -1
- {numind-0.3.0 → numind-0.3.1}/docs/ContentProjectSettingsResponse.md +13 -4
- {numind-0.3.0 → numind-0.3.1}/docs/CreateContentProjectRequest.md +3 -1
- {numind-0.3.0 → numind-0.3.1}/docs/CreateOrUpdateStructuredExampleRequest.md +14 -4
- {numind-0.3.0 → numind-0.3.1}/docs/CreateStructuredProjectRequest.md +12 -4
- {numind-0.3.0 → numind-0.3.1}/docs/DefaultApi.md +7 -17
- {numind-0.3.0 → numind-0.3.1}/docs/DocumentInfo.md +1 -0
- {numind-0.3.0 → numind-0.3.1}/docs/DocumentsApi.md +58 -44
- {numind-0.3.0 → numind-0.3.1}/docs/FilesApi.md +31 -28
- {numind-0.3.0 → numind-0.3.1}/docs/ImageInfo.md +1 -0
- numind-0.3.1/docs/ImportProjectResponse.md +32 -0
- {numind-0.3.0 → numind-0.3.1}/docs/InferenceApi.md +98 -58
- {numind-0.3.0 → numind-0.3.1}/docs/InferenceValidationError.md +3 -1
- {numind-0.3.0 → numind-0.3.1}/docs/InformationResponse.md +3 -1
- {numind-0.3.0 → numind-0.3.1}/docs/JobStatusResponse.md +1 -0
- {numind-0.3.0 → numind-0.3.1}/docs/JobsApi.md +120 -22
- numind-0.3.1/docs/ProjectImportExportApi.md +171 -0
- numind-0.3.1/docs/Structured.md +30 -0
- {numind-0.3.0 → numind-0.3.1}/docs/StructuredDataExtractionApi.md +58 -31
- {numind-0.3.0 → numind-0.3.1}/docs/StructuredExampleResponse.md +3 -1
- {numind-0.3.0 → numind-0.3.1}/docs/StructuredExtractionExamplesApi.md +91 -37
- {numind-0.3.0 → numind-0.3.1}/docs/StructuredExtractionProjectManagementApi.md +301 -121
- {numind-0.3.0 → numind-0.3.1}/docs/StructuredExtractionResponse.md +4 -1
- {numind-0.3.0 → numind-0.3.1}/docs/StructuredInferenceExample.md +3 -1
- {numind-0.3.0 → numind-0.3.1}/docs/StructuredProjectResponse.md +3 -1
- {numind-0.3.0 → numind-0.3.1}/docs/StructuredProjectSettingsResponse.md +15 -4
- {numind-0.3.0 → numind-0.3.1}/docs/TemplateGenerationApi.md +32 -19
- {numind-0.3.0 → numind-0.3.1}/docs/UpdateContentProjectRequest.md +3 -1
- {numind-0.3.0 → numind-0.3.1}/docs/UpdateContentProjectSettingsRequest.md +15 -4
- {numind-0.3.0 → numind-0.3.1}/docs/UpdateStructuredProjectRequest.md +12 -4
- {numind-0.3.0 → numind-0.3.1}/docs/UpdateStructuredProjectSettingsRequest.md +15 -4
- {numind-0.3.0 → numind-0.3.1}/pyproject.toml +2 -2
- {numind-0.3.0 → numind-0.3.1}/sdk_generation/pyproject_base.toml +1 -8
- {numind-0.3.0 → numind-0.3.1}/src/numind/exceptions.py +1 -1
- numind-0.3.1/src/numind/models/__init__.py +68 -0
- numind-0.3.1/src/numind/models/content.py +102 -0
- numind-0.3.1/src/numind/models/content_extraction_response.py +135 -0
- numind-0.3.1/src/numind/models/content_project_response.py +126 -0
- numind-0.3.1/src/numind/models/content_project_settings_response.py +114 -0
- numind-0.3.1/src/numind/models/convert_request.py +85 -0
- numind-0.3.1/src/numind/models/create_content_project_request.py +87 -0
- numind-0.3.1/src/numind/models/create_or_update_structured_example_request.py +87 -0
- numind-0.3.1/src/numind/models/create_structured_project_request.py +99 -0
- {numind-0.3.0 → numind-0.3.1}/src/numind/models/document_info.py +1 -1
- numind-0.3.1/src/numind/models/document_response.py +112 -0
- numind-0.3.1/src/numind/models/error.py +86 -0
- numind-0.3.1/src/numind/models/file_response.py +106 -0
- numind-0.3.1/src/numind/models/health_response.py +99 -0
- numind-0.3.1/src/numind/models/image_info.py +129 -0
- numind-0.3.1/src/numind/models/import_project_response.py +157 -0
- numind-0.3.1/src/numind/models/inference_status.py +85 -0
- numind-0.3.1/src/numind/models/inference_validation_error.py +89 -0
- {numind-0.3.0 → numind-0.3.1}/src/numind/models/information_response.py +1 -1
- numind-0.3.1/src/numind/models/invalid_information.py +101 -0
- numind-0.3.1/src/numind/models/job_id_response.py +82 -0
- numind-0.3.1/src/numind/models/job_status_response.py +127 -0
- numind-0.3.1/src/numind/models/paginated_response_t.py +111 -0
- numind-0.3.1/src/numind/models/service_status.py +90 -0
- numind-0.3.1/src/numind/models/structured.py +102 -0
- numind-0.3.1/src/numind/models/structured_example_response.py +128 -0
- {numind-0.3.0 → numind-0.3.1}/src/numind/models/structured_extraction_response.py +6 -1
- numind-0.3.1/src/numind/models/structured_inference_example.py +106 -0
- {numind-0.3.0 → numind-0.3.1}/src/numind/models/structured_project_response.py +1 -1
- numind-0.3.1/src/numind/models/structured_project_settings_response.py +137 -0
- numind-0.3.1/src/numind/models/template_request.py +82 -0
- {numind-0.3.0 → numind-0.3.1}/src/numind/models/template_response.py +1 -1
- numind-0.3.1/src/numind/models/text_info.py +123 -0
- numind-0.3.1/src/numind/models/text_request.py +82 -0
- numind-0.3.1/src/numind/models/update_content_project_request.py +89 -0
- numind-0.3.1/src/numind/models/update_content_project_settings_request.py +123 -0
- numind-0.3.1/src/numind/models/update_structured_project_request.py +105 -0
- {numind-0.3.0 → numind-0.3.1}/src/numind/models/update_structured_project_settings_request.py +10 -3
- numind-0.3.1/src/numind/models/valid_information.py +94 -0
- numind-0.3.1/src/numind/models/version_response.py +97 -0
- {numind-0.3.0 → numind-0.3.1}/src/numind/nuextract_utils/__init__.py +2 -2
- {numind-0.3.0/src/numind/nuextract_utils/json_schema → numind-0.3.1/src/numind/nuextract_utils/template_conversion}/__init__.py +7 -3
- {numind-0.3.0/src/numind/nuextract_utils/json_schema → numind-0.3.1/src/numind/nuextract_utils/template_conversion}/constants.py +1 -0
- numind-0.3.0/src/numind/nuextract_utils/json_schema/conversion.py → numind-0.3.1/src/numind/nuextract_utils/template_conversion/json_schema.py +647 -290
- numind-0.3.1/src/numind/nuextract_utils/template_conversion/pydantic.py +156 -0
- numind-0.3.1/src/numind/nuextract_utils/template_conversion/utils.py +13 -0
- {numind-0.3.0 → numind-0.3.1}/src/numind/numind.py +20 -10
- {numind-0.3.0 → numind-0.3.1}/src/numind/openapi_client/__init__.py +13 -1
- {numind-0.3.0 → numind-0.3.1}/src/numind/openapi_client/api/__init__.py +1 -0
- {numind-0.3.0 → numind-0.3.1}/src/numind/openapi_client/api/content_extraction_api.py +59 -28
- {numind-0.3.0 → numind-0.3.1}/src/numind/openapi_client/api/content_extraction_project_management_api.py +10 -10
- {numind-0.3.0 → numind-0.3.1}/src/numind/openapi_client/api/default_api.py +1 -1
- {numind-0.3.0 → numind-0.3.1}/src/numind/openapi_client/api/documents_api.py +52 -19
- {numind-0.3.0 → numind-0.3.1}/src/numind/openapi_client/api/files_api.py +1 -1
- {numind-0.3.0 → numind-0.3.1}/src/numind/openapi_client/api/inference_api.py +132 -70
- {numind-0.3.0 → numind-0.3.1}/src/numind/openapi_client/api/jobs_api.py +279 -7
- numind-0.3.1/src/numind/openapi_client/api/project_import_export_api.py +635 -0
- {numind-0.3.0 → numind-0.3.1}/src/numind/openapi_client/api/structured_data_extraction_api.py +57 -26
- {numind-0.3.0 → numind-0.3.1}/src/numind/openapi_client/api/structured_extraction_examples_api.py +1 -1
- {numind-0.3.0 → numind-0.3.1}/src/numind/openapi_client/api/structured_extraction_project_management_api.py +10 -10
- {numind-0.3.0 → numind-0.3.1}/src/numind/openapi_client/api/template_generation_api.py +7 -7
- {numind-0.3.0 → numind-0.3.1}/src/numind/openapi_client/api_client.py +1 -1
- {numind-0.3.0 → numind-0.3.1}/src/numind/openapi_client/configuration.py +1 -1
- {numind-0.3.0 → numind-0.3.1}/src/numind/openapi_client/rest.py +1 -1
- {numind-0.3.0 → numind-0.3.1}/src/numind/openapi_client_async/__init__.py +13 -1
- {numind-0.3.0 → numind-0.3.1}/src/numind/openapi_client_async/api/__init__.py +3 -0
- {numind-0.3.0 → numind-0.3.1}/src/numind/openapi_client_async/api/content_extraction_api.py +59 -28
- {numind-0.3.0 → numind-0.3.1}/src/numind/openapi_client_async/api/content_extraction_project_management_api.py +10 -10
- {numind-0.3.0 → numind-0.3.1}/src/numind/openapi_client_async/api/default_api.py +1 -1
- {numind-0.3.0 → numind-0.3.1}/src/numind/openapi_client_async/api/documents_api.py +52 -19
- {numind-0.3.0 → numind-0.3.1}/src/numind/openapi_client_async/api/files_api.py +1 -1
- {numind-0.3.0 → numind-0.3.1}/src/numind/openapi_client_async/api/inference_api.py +132 -70
- {numind-0.3.0 → numind-0.3.1}/src/numind/openapi_client_async/api/jobs_api.py +279 -7
- numind-0.3.1/src/numind/openapi_client_async/api/project_import_export_api.py +635 -0
- {numind-0.3.0 → numind-0.3.1}/src/numind/openapi_client_async/api/structured_data_extraction_api.py +57 -26
- {numind-0.3.0 → numind-0.3.1}/src/numind/openapi_client_async/api/structured_extraction_examples_api.py +1 -1
- {numind-0.3.0 → numind-0.3.1}/src/numind/openapi_client_async/api/structured_extraction_project_management_api.py +10 -10
- {numind-0.3.0 → numind-0.3.1}/src/numind/openapi_client_async/api/template_generation_api.py +7 -7
- {numind-0.3.0 → numind-0.3.1}/src/numind/openapi_client_async/api_client.py +1 -1
- {numind-0.3.0 → numind-0.3.1}/src/numind/openapi_client_async/configuration.py +1 -1
- {numind-0.3.0 → numind-0.3.1}/src/numind/openapi_client_async/rest.py +1 -1
- numind-0.3.1/tests/openapi_client/test_content.py +81 -0
- numind-0.3.1/tests/openapi_client/test_content_extraction_api.py +34 -0
- numind-0.3.1/tests/openapi_client/test_content_extraction_project_management_api.py +48 -0
- numind-0.3.1/tests/openapi_client/test_content_extraction_response.py +67 -0
- numind-0.3.1/tests/openapi_client/test_content_project_response.py +76 -0
- numind-0.3.1/tests/openapi_client/test_content_project_settings_response.py +63 -0
- numind-0.3.1/tests/openapi_client/test_convert_request.py +53 -0
- numind-0.3.1/tests/openapi_client/test_create_content_project_request.py +55 -0
- numind-0.3.1/tests/openapi_client/test_create_or_update_structured_example_request.py +57 -0
- numind-0.3.1/tests/openapi_client/test_create_structured_project_request.py +61 -0
- numind-0.3.1/tests/openapi_client/test_default_api.py +43 -0
- numind-0.3.1/tests/openapi_client/test_document_info.py +67 -0
- numind-0.3.1/tests/openapi_client/test_document_response.py +58 -0
- numind-0.3.1/tests/openapi_client/test_documents_api.py +40 -0
- numind-0.3.1/tests/openapi_client/test_error.py +55 -0
- numind-0.3.1/tests/openapi_client/test_file_response.py +59 -0
- numind-0.3.1/tests/openapi_client/test_files_api.py +40 -0
- numind-0.3.1/tests/openapi_client/test_health_response.py +57 -0
- numind-0.3.1/tests/openapi_client/test_image_info.py +65 -0
- numind-0.3.1/tests/openapi_client/test_import_project_response.py +95 -0
- numind-0.3.1/tests/openapi_client/test_inference_api.py +47 -0
- numind-0.3.1/tests/openapi_client/test_inference_status.py +55 -0
- numind-0.3.1/tests/openapi_client/test_inference_validation_error.py +55 -0
- numind-0.3.1/tests/openapi_client/test_information_response.py +57 -0
- numind-0.3.1/tests/openapi_client/test_invalid_information.py +57 -0
- numind-0.3.1/tests/openapi_client/test_job_id_response.py +53 -0
- numind-0.3.1/tests/openapi_client/test_job_status_response.py +69 -0
- numind-0.3.1/tests/openapi_client/test_jobs_api.py +40 -0
- numind-0.3.1/tests/openapi_client/test_paginated_response_t.py +67 -0
- numind-0.3.1/tests/openapi_client/test_project_import_export_api.py +34 -0
- numind-0.3.1/tests/openapi_client/test_service_status.py +56 -0
- numind-0.3.1/tests/openapi_client/test_structured.py +95 -0
- numind-0.3.1/tests/openapi_client/test_structured_data_extraction_api.py +36 -0
- numind-0.3.1/tests/openapi_client/test_structured_example_response.py +65 -0
- numind-0.3.1/tests/openapi_client/test_structured_extraction_examples_api.py +51 -0
- numind-0.3.1/tests/openapi_client/test_structured_extraction_project_management_api.py +71 -0
- numind-0.3.1/tests/openapi_client/test_structured_extraction_response.py +79 -0
- numind-0.3.1/tests/openapi_client/test_structured_inference_example.py +58 -0
- numind-0.3.1/tests/openapi_client/test_structured_project_response.py +90 -0
- numind-0.3.1/tests/openapi_client/test_structured_project_settings_response.py +69 -0
- numind-0.3.1/tests/openapi_client/test_template_generation_api.py +34 -0
- numind-0.3.1/tests/openapi_client/test_template_request.py +53 -0
- numind-0.3.1/tests/openapi_client/test_template_response.py +68 -0
- numind-0.3.1/tests/openapi_client/test_text_info.py +63 -0
- numind-0.3.1/tests/openapi_client/test_text_request.py +53 -0
- numind-0.3.1/tests/openapi_client/test_update_content_project_request.py +53 -0
- numind-0.3.1/tests/openapi_client/test_update_content_project_settings_request.py +58 -0
- numind-0.3.1/tests/openapi_client/test_update_structured_project_request.py +57 -0
- numind-0.3.1/tests/openapi_client/test_update_structured_project_settings_request.py +62 -0
- numind-0.3.1/tests/openapi_client/test_valid_information.py +55 -0
- numind-0.3.1/tests/openapi_client/test_version_response.py +59 -0
- numind-0.3.1/tests/openapi_client_async/test_content.py +81 -0
- numind-0.3.1/tests/openapi_client_async/test_content_extraction_api.py +34 -0
- numind-0.3.1/tests/openapi_client_async/test_content_extraction_project_management_api.py +50 -0
- numind-0.3.1/tests/openapi_client_async/test_content_extraction_response.py +67 -0
- numind-0.3.1/tests/openapi_client_async/test_content_project_response.py +76 -0
- numind-0.3.1/tests/openapi_client_async/test_content_project_settings_response.py +63 -0
- numind-0.3.1/tests/openapi_client_async/test_convert_request.py +53 -0
- numind-0.3.1/tests/openapi_client_async/test_create_content_project_request.py +55 -0
- numind-0.3.1/tests/openapi_client_async/test_create_or_update_structured_example_request.py +57 -0
- numind-0.3.1/tests/openapi_client_async/test_create_structured_project_request.py +61 -0
- numind-0.3.1/tests/openapi_client_async/test_default_api.py +43 -0
- numind-0.3.1/tests/openapi_client_async/test_document_info.py +67 -0
- numind-0.3.1/tests/openapi_client_async/test_document_response.py +58 -0
- numind-0.3.1/tests/openapi_client_async/test_documents_api.py +40 -0
- numind-0.3.1/tests/openapi_client_async/test_error.py +55 -0
- numind-0.3.1/tests/openapi_client_async/test_file_response.py +59 -0
- numind-0.3.1/tests/openapi_client_async/test_files_api.py +40 -0
- numind-0.3.1/tests/openapi_client_async/test_health_response.py +57 -0
- numind-0.3.1/tests/openapi_client_async/test_image_info.py +65 -0
- numind-0.3.1/tests/openapi_client_async/test_import_project_response.py +95 -0
- numind-0.3.1/tests/openapi_client_async/test_inference_api.py +49 -0
- numind-0.3.1/tests/openapi_client_async/test_inference_status.py +55 -0
- numind-0.3.1/tests/openapi_client_async/test_inference_validation_error.py +55 -0
- numind-0.3.1/tests/openapi_client_async/test_information_response.py +57 -0
- numind-0.3.1/tests/openapi_client_async/test_invalid_information.py +57 -0
- numind-0.3.1/tests/openapi_client_async/test_job_id_response.py +53 -0
- numind-0.3.1/tests/openapi_client_async/test_job_status_response.py +69 -0
- numind-0.3.1/tests/openapi_client_async/test_jobs_api.py +40 -0
- numind-0.3.1/tests/openapi_client_async/test_paginated_response_t.py +67 -0
- numind-0.3.1/tests/openapi_client_async/test_project_import_export_api.py +36 -0
- numind-0.3.1/tests/openapi_client_async/test_service_status.py +56 -0
- numind-0.3.1/tests/openapi_client_async/test_structured.py +95 -0
- numind-0.3.1/tests/openapi_client_async/test_structured_data_extraction_api.py +40 -0
- numind-0.3.1/tests/openapi_client_async/test_structured_example_response.py +65 -0
- numind-0.3.1/tests/openapi_client_async/test_structured_extraction_examples_api.py +55 -0
- numind-0.3.1/tests/openapi_client_async/test_structured_extraction_project_management_api.py +85 -0
- numind-0.3.1/tests/openapi_client_async/test_structured_extraction_response.py +79 -0
- numind-0.3.1/tests/openapi_client_async/test_structured_inference_example.py +58 -0
- numind-0.3.1/tests/openapi_client_async/test_structured_project_response.py +90 -0
- numind-0.3.1/tests/openapi_client_async/test_structured_project_settings_response.py +69 -0
- numind-0.3.1/tests/openapi_client_async/test_template_generation_api.py +36 -0
- numind-0.3.1/tests/openapi_client_async/test_template_request.py +53 -0
- numind-0.3.1/tests/openapi_client_async/test_template_response.py +68 -0
- numind-0.3.1/tests/openapi_client_async/test_text_info.py +63 -0
- numind-0.3.1/tests/openapi_client_async/test_text_request.py +53 -0
- numind-0.3.1/tests/openapi_client_async/test_update_content_project_request.py +53 -0
- numind-0.3.1/tests/openapi_client_async/test_update_content_project_settings_request.py +58 -0
- numind-0.3.1/tests/openapi_client_async/test_update_structured_project_request.py +57 -0
- numind-0.3.1/tests/openapi_client_async/test_update_structured_project_settings_request.py +62 -0
- numind-0.3.1/tests/openapi_client_async/test_valid_information.py +55 -0
- numind-0.3.1/tests/openapi_client_async/test_version_response.py +59 -0
- numind-0.3.0/tests/test_json_schema.py → numind-0.3.1/tests/test_conversion_json_schema.py +307 -36
- numind-0.3.1/tests/test_conversion_pydantic.py +193 -0
- {numind-0.3.0 → numind-0.3.1}/tests/test_json_schema_descriptions.py +36 -17
- {numind-0.3.0 → numind-0.3.1}/tests/test_project.py +12 -4
- numind-0.3.0/src/numind/models/__init__.py +0 -65
- numind-0.3.0/src/numind/models/content_extraction_response.py +0 -130
- numind-0.3.0/src/numind/models/content_project_response.py +0 -126
- numind-0.3.0/src/numind/models/content_project_settings_response.py +0 -108
- numind-0.3.0/src/numind/models/convert_request.py +0 -85
- numind-0.3.0/src/numind/models/create_content_project_request.py +0 -87
- numind-0.3.0/src/numind/models/create_or_update_structured_example_request.py +0 -87
- numind-0.3.0/src/numind/models/create_structured_project_request.py +0 -99
- numind-0.3.0/src/numind/models/document_response.py +0 -112
- numind-0.3.0/src/numind/models/error.py +0 -86
- numind-0.3.0/src/numind/models/file_response.py +0 -106
- numind-0.3.0/src/numind/models/health_response.py +0 -99
- numind-0.3.0/src/numind/models/image_info.py +0 -124
- numind-0.3.0/src/numind/models/inference_status.py +0 -85
- numind-0.3.0/src/numind/models/inference_validation_error.py +0 -89
- numind-0.3.0/src/numind/models/invalid_information.py +0 -101
- numind-0.3.0/src/numind/models/job_id_response.py +0 -82
- numind-0.3.0/src/numind/models/job_status_response.py +0 -122
- numind-0.3.0/src/numind/models/paginated_response_t.py +0 -111
- numind-0.3.0/src/numind/models/service_status.py +0 -90
- numind-0.3.0/src/numind/models/structured_example_response.py +0 -128
- numind-0.3.0/src/numind/models/structured_inference_example.py +0 -106
- numind-0.3.0/src/numind/models/structured_project_settings_response.py +0 -131
- numind-0.3.0/src/numind/models/template_request.py +0 -82
- numind-0.3.0/src/numind/models/text_info.py +0 -123
- numind-0.3.0/src/numind/models/text_request.py +0 -82
- numind-0.3.0/src/numind/models/update_content_project_request.py +0 -89
- numind-0.3.0/src/numind/models/update_content_project_settings_request.py +0 -116
- numind-0.3.0/src/numind/models/update_structured_project_request.py +0 -105
- numind-0.3.0/src/numind/models/valid_information.py +0 -94
- numind-0.3.0/src/numind/models/version_response.py +0 -97
- numind-0.3.0/tests/openapi_client/test_content_extraction_api.py +0 -34
- numind-0.3.0/tests/openapi_client/test_content_extraction_project_management_api.py +0 -48
- numind-0.3.0/tests/openapi_client/test_content_extraction_response.py +0 -65
- numind-0.3.0/tests/openapi_client/test_content_project_response.py +0 -74
- numind-0.3.0/tests/openapi_client/test_content_project_settings_response.py +0 -61
- numind-0.3.0/tests/openapi_client/test_convert_request.py +0 -53
- numind-0.3.0/tests/openapi_client/test_create_content_project_request.py +0 -55
- numind-0.3.0/tests/openapi_client/test_create_or_update_structured_example_request.py +0 -57
- numind-0.3.0/tests/openapi_client/test_create_structured_project_request.py +0 -61
- numind-0.3.0/tests/openapi_client/test_default_api.py +0 -43
- numind-0.3.0/tests/openapi_client/test_document_info.py +0 -65
- numind-0.3.0/tests/openapi_client/test_document_response.py +0 -58
- numind-0.3.0/tests/openapi_client/test_documents_api.py +0 -40
- numind-0.3.0/tests/openapi_client/test_error.py +0 -55
- numind-0.3.0/tests/openapi_client/test_file_response.py +0 -59
- numind-0.3.0/tests/openapi_client/test_files_api.py +0 -40
- numind-0.3.0/tests/openapi_client/test_health_response.py +0 -57
- numind-0.3.0/tests/openapi_client/test_image_info.py +0 -63
- numind-0.3.0/tests/openapi_client/test_inference_api.py +0 -47
- numind-0.3.0/tests/openapi_client/test_inference_status.py +0 -55
- numind-0.3.0/tests/openapi_client/test_inference_validation_error.py +0 -55
- numind-0.3.0/tests/openapi_client/test_information_response.py +0 -57
- numind-0.3.0/tests/openapi_client/test_invalid_information.py +0 -57
- numind-0.3.0/tests/openapi_client/test_job_id_response.py +0 -53
- numind-0.3.0/tests/openapi_client/test_job_status_response.py +0 -67
- numind-0.3.0/tests/openapi_client/test_jobs_api.py +0 -37
- numind-0.3.0/tests/openapi_client/test_paginated_response_t.py +0 -67
- numind-0.3.0/tests/openapi_client/test_service_status.py +0 -56
- numind-0.3.0/tests/openapi_client/test_structured_data_extraction_api.py +0 -36
- numind-0.3.0/tests/openapi_client/test_structured_example_response.py +0 -65
- numind-0.3.0/tests/openapi_client/test_structured_extraction_examples_api.py +0 -51
- numind-0.3.0/tests/openapi_client/test_structured_extraction_project_management_api.py +0 -71
- numind-0.3.0/tests/openapi_client/test_structured_extraction_response.py +0 -77
- numind-0.3.0/tests/openapi_client/test_structured_inference_example.py +0 -58
- numind-0.3.0/tests/openapi_client/test_structured_project_response.py +0 -88
- numind-0.3.0/tests/openapi_client/test_structured_project_settings_response.py +0 -67
- numind-0.3.0/tests/openapi_client/test_template_generation_api.py +0 -34
- numind-0.3.0/tests/openapi_client/test_template_request.py +0 -53
- numind-0.3.0/tests/openapi_client/test_template_response.py +0 -68
- numind-0.3.0/tests/openapi_client/test_text_info.py +0 -63
- numind-0.3.0/tests/openapi_client/test_text_request.py +0 -53
- numind-0.3.0/tests/openapi_client/test_update_content_project_request.py +0 -53
- numind-0.3.0/tests/openapi_client/test_update_content_project_settings_request.py +0 -57
- numind-0.3.0/tests/openapi_client/test_update_structured_project_request.py +0 -57
- numind-0.3.0/tests/openapi_client/test_update_structured_project_settings_request.py +0 -61
- numind-0.3.0/tests/openapi_client/test_valid_information.py +0 -55
- numind-0.3.0/tests/openapi_client/test_version_response.py +0 -59
- numind-0.3.0/tests/openapi_client_async/test_content_extraction_api.py +0 -34
- numind-0.3.0/tests/openapi_client_async/test_content_extraction_project_management_api.py +0 -50
- numind-0.3.0/tests/openapi_client_async/test_content_extraction_response.py +0 -65
- numind-0.3.0/tests/openapi_client_async/test_content_project_response.py +0 -74
- numind-0.3.0/tests/openapi_client_async/test_content_project_settings_response.py +0 -61
- numind-0.3.0/tests/openapi_client_async/test_convert_request.py +0 -53
- numind-0.3.0/tests/openapi_client_async/test_create_content_project_request.py +0 -55
- numind-0.3.0/tests/openapi_client_async/test_create_or_update_structured_example_request.py +0 -57
- numind-0.3.0/tests/openapi_client_async/test_create_structured_project_request.py +0 -61
- numind-0.3.0/tests/openapi_client_async/test_default_api.py +0 -43
- numind-0.3.0/tests/openapi_client_async/test_document_info.py +0 -65
- numind-0.3.0/tests/openapi_client_async/test_document_response.py +0 -58
- numind-0.3.0/tests/openapi_client_async/test_documents_api.py +0 -40
- numind-0.3.0/tests/openapi_client_async/test_error.py +0 -55
- numind-0.3.0/tests/openapi_client_async/test_file_response.py +0 -59
- numind-0.3.0/tests/openapi_client_async/test_files_api.py +0 -40
- numind-0.3.0/tests/openapi_client_async/test_health_response.py +0 -57
- numind-0.3.0/tests/openapi_client_async/test_image_info.py +0 -63
- numind-0.3.0/tests/openapi_client_async/test_inference_api.py +0 -49
- numind-0.3.0/tests/openapi_client_async/test_inference_status.py +0 -55
- numind-0.3.0/tests/openapi_client_async/test_inference_validation_error.py +0 -55
- numind-0.3.0/tests/openapi_client_async/test_information_response.py +0 -57
- numind-0.3.0/tests/openapi_client_async/test_invalid_information.py +0 -57
- numind-0.3.0/tests/openapi_client_async/test_job_id_response.py +0 -53
- numind-0.3.0/tests/openapi_client_async/test_job_status_response.py +0 -67
- numind-0.3.0/tests/openapi_client_async/test_jobs_api.py +0 -37
- numind-0.3.0/tests/openapi_client_async/test_paginated_response_t.py +0 -67
- numind-0.3.0/tests/openapi_client_async/test_service_status.py +0 -56
- numind-0.3.0/tests/openapi_client_async/test_structured_data_extraction_api.py +0 -40
- numind-0.3.0/tests/openapi_client_async/test_structured_example_response.py +0 -65
- numind-0.3.0/tests/openapi_client_async/test_structured_extraction_examples_api.py +0 -55
- numind-0.3.0/tests/openapi_client_async/test_structured_extraction_project_management_api.py +0 -85
- numind-0.3.0/tests/openapi_client_async/test_structured_extraction_response.py +0 -77
- numind-0.3.0/tests/openapi_client_async/test_structured_inference_example.py +0 -58
- numind-0.3.0/tests/openapi_client_async/test_structured_project_response.py +0 -88
- numind-0.3.0/tests/openapi_client_async/test_structured_project_settings_response.py +0 -67
- numind-0.3.0/tests/openapi_client_async/test_template_generation_api.py +0 -36
- numind-0.3.0/tests/openapi_client_async/test_template_request.py +0 -53
- numind-0.3.0/tests/openapi_client_async/test_template_response.py +0 -68
- numind-0.3.0/tests/openapi_client_async/test_text_info.py +0 -63
- numind-0.3.0/tests/openapi_client_async/test_text_request.py +0 -53
- numind-0.3.0/tests/openapi_client_async/test_update_content_project_request.py +0 -53
- numind-0.3.0/tests/openapi_client_async/test_update_content_project_settings_request.py +0 -57
- numind-0.3.0/tests/openapi_client_async/test_update_structured_project_request.py +0 -57
- numind-0.3.0/tests/openapi_client_async/test_update_structured_project_settings_request.py +0 -61
- numind-0.3.0/tests/openapi_client_async/test_valid_information.py +0 -55
- numind-0.3.0/tests/openapi_client_async/test_version_response.py +0 -59
- {numind-0.3.0 → numind-0.3.1}/.github/codecov.yml +0 -0
- {numind-0.3.0 → numind-0.3.1}/.github/dependabot.yml +0 -0
- {numind-0.3.0 → numind-0.3.1}/.github/workflows/update-api-build-version-repo-var.yml +0 -0
- {numind-0.3.0 → numind-0.3.1}/.gitignore +0 -0
- {numind-0.3.0 → numind-0.3.1}/LICENSE +0 -0
- {numind-0.3.0 → numind-0.3.1}/docs/ConvertRequest.md +0 -0
- {numind-0.3.0 → numind-0.3.1}/docs/DocumentResponse.md +0 -0
- {numind-0.3.0 → numind-0.3.1}/docs/Error.md +0 -0
- {numind-0.3.0 → numind-0.3.1}/docs/FileResponse.md +0 -0
- {numind-0.3.0 → numind-0.3.1}/docs/HealthResponse.md +0 -0
- {numind-0.3.0 → numind-0.3.1}/docs/InferenceStatus.md +0 -0
- {numind-0.3.0 → numind-0.3.1}/docs/InvalidInformation.md +0 -0
- {numind-0.3.0 → numind-0.3.1}/docs/JobIdResponse.md +0 -0
- {numind-0.3.0 → numind-0.3.1}/docs/PaginatedResponseT.md +0 -0
- {numind-0.3.0 → numind-0.3.1}/docs/ServiceStatus.md +0 -0
- {numind-0.3.0 → numind-0.3.1}/docs/TemplateRequest.md +0 -0
- {numind-0.3.0 → numind-0.3.1}/docs/TemplateResponse.md +0 -0
- {numind-0.3.0 → numind-0.3.1}/docs/TextInfo.md +0 -0
- {numind-0.3.0 → numind-0.3.1}/docs/TextRequest.md +0 -0
- {numind-0.3.0 → numind-0.3.1}/docs/ValidInformation.md +0 -0
- {numind-0.3.0 → numind-0.3.1}/docs/VersionResponse.md +0 -0
- {numind-0.3.0 → numind-0.3.1}/sdk_generation/.openapi-generator-ignore +0 -0
- {numind-0.3.0 → numind-0.3.1}/sdk_generation/adapt_openapi_client_init.py +0 -0
- {numind-0.3.0 → numind-0.3.1}/sdk_generation/adapt_pyproject.py +0 -0
- {numind-0.3.0 → numind-0.3.1}/sdk_generation/collate_documentation_readme.py +0 -0
- {numind-0.3.0 → numind-0.3.1}/sdk_generation/config.json +0 -0
- {numind-0.3.0 → numind-0.3.1}/sdk_generation/gen_sdk.sh +0 -0
- {numind-0.3.0 → numind-0.3.1}/sdk_generation/remove_unused_models_from_openapi_spec_file.py +0 -0
- {numind-0.3.0 → numind-0.3.1}/src/numind/__init__.py +0 -0
- {numind-0.3.0 → numind-0.3.1}/src/numind/api_response.py +0 -0
- {numind-0.3.0 → numind-0.3.1}/src/numind/constants.py +0 -0
- {numind-0.3.0/src/numind/nuextract_utils/json_schema → numind-0.3.1/src/numind/nuextract_utils/template_conversion}/validation.py +0 -0
- {numind-0.3.0 → numind-0.3.1}/src/numind/openapi_client/py.typed +0 -0
- {numind-0.3.0 → numind-0.3.1}/src/numind/openapi_client_async/py.typed +0 -0
- {numind-0.3.0 → numind-0.3.1}/tests/__init__.py +0 -0
- {numind-0.3.0 → numind-0.3.1}/tests/conftest.py +0 -0
- {numind-0.3.0 → numind-0.3.1}/tests/json_schema_test_cases/1.json +0 -0
- {numind-0.3.0 → numind-0.3.1}/tests/openapi_client/__init__.py +0 -0
- {numind-0.3.0 → numind-0.3.1}/tests/openapi_client_async/__init__.py +0 -0
- {numind-0.3.0 → numind-0.3.1}/tests/test_cases/vacation/examples.csv +0 -0
- {numind-0.3.0 → numind-0.3.1}/tests/test_cases/vacation/files/tahiti.docx +0 -0
- {numind-0.3.0 → numind-0.3.1}/tests/test_cases/vacation/files_examples/kyoto.docx +0 -0
- {numind-0.3.0 → numind-0.3.1}/tests/test_cases/vacation/schema.json +0 -0
- {numind-0.3.0 → numind-0.3.1}/tests/test_cases/vacation/texts.csv +0 -0
- {numind-0.3.0 → numind-0.3.1}/tests/test_numarkdown.py +0 -0
|
@@ -17,9 +17,9 @@ jobs:
|
|
|
17
17
|
name: Build distribution
|
|
18
18
|
runs-on: ubuntu-latest
|
|
19
19
|
steps:
|
|
20
|
-
- uses: actions/checkout@
|
|
20
|
+
- uses: actions/checkout@v7
|
|
21
21
|
- name: Set up Python
|
|
22
|
-
uses: actions/setup-python@
|
|
22
|
+
uses: actions/setup-python@v7
|
|
23
23
|
with:
|
|
24
24
|
python-version: "3.x"
|
|
25
25
|
- name: Install hatch
|
|
@@ -22,7 +22,7 @@ jobs:
|
|
|
22
22
|
steps:
|
|
23
23
|
# Step 1: Check out the repository's code
|
|
24
24
|
- name: Checkout repository
|
|
25
|
-
uses: actions/checkout@
|
|
25
|
+
uses: actions/checkout@v7
|
|
26
26
|
|
|
27
27
|
# Step 2: Fetch the latest buildVersion from the API
|
|
28
28
|
- name: Fetch latest API version
|
|
@@ -68,7 +68,7 @@ jobs:
|
|
|
68
68
|
# Step 5: Setup Python
|
|
69
69
|
- name: Set up Python
|
|
70
70
|
if: steps.check_pr.outputs.pr_exists == 'false'
|
|
71
|
-
uses: actions/setup-python@
|
|
71
|
+
uses: actions/setup-python@v7
|
|
72
72
|
with:
|
|
73
73
|
python-version: "3.x"
|
|
74
74
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: numind
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.1
|
|
4
4
|
Summary: SDK to interact with the NuMind models API.
|
|
5
5
|
Project-URL: Homepage, https://github.com/numindai/nuextract-platform-sdk
|
|
6
6
|
Project-URL: Repository, https://github.com/numindai/nuextract-platform-sdk.git
|
|
@@ -101,6 +101,7 @@ from numind import NuMindAsync
|
|
|
101
101
|
client = NuMindAsync(api_key="API_KEY")
|
|
102
102
|
requests = [{}]
|
|
103
103
|
|
|
104
|
+
|
|
104
105
|
async def main():
|
|
105
106
|
return [
|
|
106
107
|
await client.extract_structured_data(project_id, **request_kwargs)
|
|
@@ -122,14 +123,14 @@ template = {
|
|
|
122
123
|
"destination": {
|
|
123
124
|
"name": "verbatim-string",
|
|
124
125
|
"zip_code": "string",
|
|
125
|
-
"country": "string"
|
|
126
|
+
"country": "string",
|
|
126
127
|
},
|
|
127
128
|
"accommodation": "verbatim-string",
|
|
128
129
|
"activities": ["verbatim-string"],
|
|
129
130
|
"duration": {
|
|
130
131
|
"time_unit": ["day", "week", "month", "year"],
|
|
131
|
-
"time_quantity": "integer"
|
|
132
|
-
}
|
|
132
|
+
"time_quantity": "integer",
|
|
133
|
+
},
|
|
133
134
|
}
|
|
134
135
|
input_text = """My dream vacation would be a month-long escape to the stunning islands of Tahiti.
|
|
135
136
|
I’d stay in an overwater bungalow in Bora Bora, waking up to crystal-clear turquoise waters and breathtaking sunrises.
|
|
@@ -168,7 +169,7 @@ print(output)
|
|
|
168
169
|
|
|
169
170
|
### Create a good template
|
|
170
171
|
|
|
171
|
-
NuExtract uses JSON
|
|
172
|
+
NuExtract uses JSON extraction templates which specify the information to retrieve and their types, which are:
|
|
172
173
|
|
|
173
174
|
* **string**: a text, whose value can be abstract, i.e. totally free and can be deduced from calculations, reasoning, external knowledge;
|
|
174
175
|
* **verbatim-string**: a purely extractive text whose value must be present in the document. Some flexibility might be allowed on the formatting, e.g. new lines and escaped characters (e.g. `\n`) in a documents might be represented with a space;
|
|
@@ -184,7 +185,33 @@ Additionally, the value of a field can be:
|
|
|
184
185
|
* an **enum**, i.e. a list of elements to choose from of the form `["choice1", "choice2", ...]`. For values of this type, just set the value of the item to choose, e.g. "choice1", and do not set the value as an array containing the item such as `["choice1"]`;
|
|
185
186
|
* a **multi-enum**, i.e. a list from which multiple elements can be picked, of the form `[["choice1", "choice2", ...]]` (double square brackets).
|
|
186
187
|
|
|
187
|
-
|
|
188
|
+
### Converting JSON schema / Pydantic models to NuExtract template
|
|
189
|
+
|
|
190
|
+
The SDK offers a method to convert JSON schemas to NuExtract templates:
|
|
191
|
+
|
|
192
|
+
```Python
|
|
193
|
+
from typing import Literal
|
|
194
|
+
|
|
195
|
+
from pydantic import Field, BaseModel
|
|
196
|
+
from numind.nuextract_utils import convert_json_schema_to_nuextract_template
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
class HotelBooking(BaseModel):
|
|
200
|
+
city: str
|
|
201
|
+
check_in_date: str = Field(description="date")
|
|
202
|
+
check_out_date: str = Field(description="date")
|
|
203
|
+
number_of_guests: int
|
|
204
|
+
room_type: Literal["single", "double", "suite"]
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
template, dropped_branches, descriptions = convert_json_schema_to_nuextract_template(
|
|
208
|
+
HotelBooking.model_json_schema()
|
|
209
|
+
)
|
|
210
|
+
|
|
211
|
+
# {'check_in_date': 'date', 'check_out_date': 'date', 'city': 'string', 'number_of_guests': 'integer', 'room_type': ['single', 'double', 'suite']}
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Inferring a template
|
|
188
215
|
|
|
189
216
|
The "infer_template" method allows to quickly create a template that you can start to work with from a text description.
|
|
190
217
|
|
|
@@ -272,41 +299,52 @@ markdown = client.extract_content(input_file)
|
|
|
272
299
|
|
|
273
300
|
### Extracting Information from Documents
|
|
274
301
|
|
|
275
|
-
Once your project is ready,
|
|
276
|
-
|
|
277
|
-
Each project has its own extraction endpoint:
|
|
302
|
+
Once your structured extraction project is ready, submit a document to the endpoint:
|
|
278
303
|
|
|
279
|
-
`https://nuextract.ai/api/
|
|
304
|
+
`https://nuextract.ai/api/structured-extraction/{structuredProjectId}/jobs`
|
|
280
305
|
|
|
281
|
-
|
|
306
|
+
To use it, you need:
|
|
282
307
|
|
|
283
308
|
- To create an API key in the [Account section](https://nuextract.ai/app/user?content=api)
|
|
284
|
-
- To replace `{
|
|
309
|
+
- To replace `{structuredProjectId}` by the project ID found in the API tab of the structured extraction project
|
|
285
310
|
|
|
286
|
-
|
|
311
|
+
This endpoint creates an asynchronous extraction job. Use the returned `jobId` to retrieve the result from:
|
|
312
|
+
|
|
313
|
+
`https://nuextract.ai/api/structured-extraction/jobs/{structuredExtractionJobId}`
|
|
314
|
+
|
|
315
|
+
You can test your extraction endpoint in your terminal using this command-line example with curl (make sure that you replace values of `STRUCTURED_PROJECT_ID` and `NUEXTRACT_API_KEY`):
|
|
287
316
|
|
|
288
317
|
```bash
|
|
289
318
|
NUEXTRACT_API_KEY=\"_your_api_key_here_\"; \\
|
|
290
|
-
|
|
291
|
-
curl \"https://nuextract.ai/api/
|
|
319
|
+
STRUCTURED_PROJECT_ID=\"a24fd84a-44ab-4fd4-95a9-bebd46e4768b\"; \\
|
|
320
|
+
JOB_ID=$(curl \"https://nuextract.ai/api/structured-extraction/${STRUCTURED_PROJECT_ID}/jobs\" \\
|
|
292
321
|
-X POST \\
|
|
293
322
|
-H \"Authorization: Bearer ${NUEXTRACT_API_KEY}\" \\
|
|
294
|
-
-
|
|
295
|
-
|
|
323
|
+
-F \"file=@${FILE_NAME}\" | jq -r '.jobId')
|
|
324
|
+
|
|
325
|
+
curl \"https://nuextract.ai/api/structured-extraction/jobs/${JOB_ID}\" \\
|
|
326
|
+
-H \"Authorization: Bearer ${NUEXTRACT_API_KEY}\"
|
|
296
327
|
```
|
|
297
328
|
|
|
298
329
|
You can also use the [Python SDK](https://github.com/numindai/nuextract-platform-sdk#documentation), by replacing the
|
|
299
|
-
`project_id`, `api_key` and
|
|
330
|
+
`project_id`, `api_key` and request values in the following code:
|
|
300
331
|
|
|
301
332
|
```python
|
|
302
|
-
|
|
303
|
-
from
|
|
333
|
+
import asyncio
|
|
334
|
+
from numind import NuMindAsync
|
|
304
335
|
|
|
305
|
-
client =
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
336
|
+
client = NuMindAsync(api_key=api_key)
|
|
337
|
+
requests = [{}]
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
async def main():
|
|
341
|
+
return [
|
|
342
|
+
await client.extract_structured_data(project_id, **request_kwargs)
|
|
343
|
+
for request_kwargs in requests
|
|
344
|
+
]
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
responses = asyncio.run(main())
|
|
310
348
|
```
|
|
311
349
|
|
|
312
350
|
### Using the Platform via API
|
|
@@ -317,20 +355,32 @@ Everything you can do on the web platform can be done via API -
|
|
|
317
355
|
|
|
318
356
|
#### Main resources
|
|
319
357
|
|
|
320
|
-
- **Project** - user project, identified by `
|
|
358
|
+
- **Structured Extraction Project** - user project for structured extraction, identified by `structuredProjectId`
|
|
359
|
+
- **Content Extraction Project** - user project for content extraction, identified by `contentProjectId`
|
|
321
360
|
- **File** - uploaded file, identified by `fileId`, stored up to two weeks if not tied to an **Example**
|
|
322
|
-
- **Document** - internal representation of a document, identified by `documentId`, created from a File
|
|
323
|
-
- **Example** - document-extraction pair given to teach NuExtract, identified by `
|
|
361
|
+
- **Document** - internal representation of a document, identified by `documentId`, created from a File, stored up to two weeks if not tied to an Example
|
|
362
|
+
- **Example** - document-extraction pair given to teach NuExtract, identified by `structuredExampleId`, created from a Document
|
|
363
|
+
- **Job** - asynchronous extraction task, identified by `structuredExtractionJobId`
|
|
324
364
|
|
|
325
365
|
#### Most common API operations
|
|
326
366
|
|
|
327
|
-
|
|
328
|
-
|
|
367
|
+
##### Structured extraction
|
|
368
|
+
|
|
369
|
+
- Creating a **Structured Extraction Project** via `POST /api/structured-extraction`
|
|
370
|
+
- Changing the template of a **Structured Extraction Project** via `PATCH /api/structured-extraction/{structuredProjectId}`
|
|
371
|
+
- Changing settings of a **Structured Extraction Project** via `PATCH /api/structured-extraction/{structuredProjectId}/settings`
|
|
372
|
+
- Uploading a file to a **File** via `POST /api/files` (up to 2 weeks storage)
|
|
373
|
+
- Starting a structured extraction **Job** via `POST /api/structured-extraction/{structuredProjectId}/jobs`
|
|
374
|
+
- Reading a structured extraction **Job** result via `GET /api/structured-extraction/jobs/{structuredExtractionJobId}`
|
|
375
|
+
- Adding an **Example** to a **Structured Extraction Project** via `POST /api/structured-extraction/{structuredProjectId}/examples`
|
|
376
|
+
|
|
377
|
+
##### Content extraction
|
|
378
|
+
|
|
379
|
+
- Creating a **Content Extraction Project** via `POST /api/content-extraction`
|
|
380
|
+
- Changing settings of a **Content Extraction Project** via `PATCH /api/content-extraction/{contentProjectId}/settings`
|
|
329
381
|
- Uploading a file to a **File** via `POST /api/files` (up to 2 weeks storage)
|
|
330
|
-
-
|
|
331
|
-
-
|
|
332
|
-
- Changing Project settings via `POST /api/projects/{projectId}/settings`
|
|
333
|
-
- Locking a **Project** via `POST /api/projects/{projectId}/lock`
|
|
382
|
+
- Starting a content extraction **Job** via `POST /api/content-extraction/jobs`
|
|
383
|
+
- Reading a content extraction **Job** result via `GET /api/content-extraction/jobs/{contentExtractionJobId}`
|
|
334
384
|
|
|
335
385
|
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
|
336
386
|
|
|
@@ -359,7 +409,7 @@ Class | Method | HTTP request | Description
|
|
|
359
409
|
*DefaultApi* | [**get_api_ping**](docs/DefaultApi.md#get_api_ping) | **GET** /api/ping |
|
|
360
410
|
*DefaultApi* | [**get_api_version**](docs/DefaultApi.md#get_api_version) | **GET** /api/version |
|
|
361
411
|
*DocumentsApi* | [**get_api_documents_documentid**](docs/DocumentsApi.md#get_api_documents_documentid) | **GET** /api/documents/{documentId} |
|
|
362
|
-
*DocumentsApi* | [**
|
|
412
|
+
*DocumentsApi* | [**get_api_documents_documentid_parts_partindex_image**](docs/DocumentsApi.md#get_api_documents_documentid_parts_partindex_image) | **GET** /api/documents/{documentId}/parts/{partIndex}/image |
|
|
363
413
|
*DocumentsApi* | [**post_api_documents_documentid_new_owner**](docs/DocumentsApi.md#post_api_documents_documentid_new_owner) | **POST** /api/documents/{documentId}/new-owner |
|
|
364
414
|
*DocumentsApi* | [**post_api_documents_text**](docs/DocumentsApi.md#post_api_documents_text) | **POST** /api/documents/text |
|
|
365
415
|
*FilesApi* | [**get_api_files_fileid**](docs/FilesApi.md#get_api_files_fileid) | **GET** /api/files/{fileId} |
|
|
@@ -374,6 +424,9 @@ Class | Method | HTTP request | Description
|
|
|
374
424
|
*JobsApi* | [**get_api_jobs**](docs/JobsApi.md#get_api_jobs) | **GET** /api/jobs |
|
|
375
425
|
*JobsApi* | [**get_api_jobs_jobid_status**](docs/JobsApi.md#get_api_jobs_jobid_status) | **GET** /api/jobs/{jobId}/status |
|
|
376
426
|
*JobsApi* | [**get_api_jobs_jobid_stream**](docs/JobsApi.md#get_api_jobs_jobid_stream) | **GET** /api/jobs/{jobId}/stream |
|
|
427
|
+
*JobsApi* | [**post_api_jobs_jobid_cancel**](docs/JobsApi.md#post_api_jobs_jobid_cancel) | **POST** /api/jobs/{jobId}/cancel |
|
|
428
|
+
*ProjectImportExportApi* | [**get_api_extraction_projectkind_projectid_export**](docs/ProjectImportExportApi.md#get_api_extraction_projectkind_projectid_export) | **GET** /api/extraction/{projectKind}/{projectId}/export |
|
|
429
|
+
*ProjectImportExportApi* | [**post_api_extraction_import**](docs/ProjectImportExportApi.md#post_api_extraction_import) | **POST** /api/extraction/import |
|
|
377
430
|
*StructuredDataExtractionApi* | [**get_api_structured_extraction_jobs_structuredextractionjobid**](docs/StructuredDataExtractionApi.md#get_api_structured_extraction_jobs_structuredextractionjobid) | **GET** /api/structured-extraction/jobs/{structuredExtractionJobId} |
|
|
378
431
|
*StructuredDataExtractionApi* | [**post_api_structured_extraction_structuredprojectid_jobs**](docs/StructuredDataExtractionApi.md#post_api_structured_extraction_structuredprojectid_jobs) | **POST** /api/structured-extraction/{structuredProjectId}/jobs |
|
|
379
432
|
*StructuredExtractionExamplesApi* | [**delete_api_structured_extraction_structuredprojectid_examples_structuredexampleid**](docs/StructuredExtractionExamplesApi.md#delete_api_structured_extraction_structuredprojectid_examples_structuredexampleid) | **DELETE** /api/structured-extraction/{structuredProjectId}/examples/{structuredExampleId} |
|
|
@@ -400,6 +453,7 @@ Class | Method | HTTP request | Description
|
|
|
400
453
|
|
|
401
454
|
### Documentation For Models
|
|
402
455
|
|
|
456
|
+
- [Content](docs/Content.md)
|
|
403
457
|
- [ContentExtractionResponse](docs/ContentExtractionResponse.md)
|
|
404
458
|
- [ContentProjectResponse](docs/ContentProjectResponse.md)
|
|
405
459
|
- [ContentProjectSettingsResponse](docs/ContentProjectSettingsResponse.md)
|
|
@@ -413,6 +467,7 @@ Class | Method | HTTP request | Description
|
|
|
413
467
|
- [FileResponse](docs/FileResponse.md)
|
|
414
468
|
- [HealthResponse](docs/HealthResponse.md)
|
|
415
469
|
- [ImageInfo](docs/ImageInfo.md)
|
|
470
|
+
- [ImportProjectResponse](docs/ImportProjectResponse.md)
|
|
416
471
|
- [InferenceStatus](docs/InferenceStatus.md)
|
|
417
472
|
- [InferenceValidationError](docs/InferenceValidationError.md)
|
|
418
473
|
- [InformationResponse](docs/InformationResponse.md)
|
|
@@ -421,6 +476,7 @@ Class | Method | HTTP request | Description
|
|
|
421
476
|
- [JobStatusResponse](docs/JobStatusResponse.md)
|
|
422
477
|
- [PaginatedResponseT](docs/PaginatedResponseT.md)
|
|
423
478
|
- [ServiceStatus](docs/ServiceStatus.md)
|
|
479
|
+
- [Structured](docs/Structured.md)
|
|
424
480
|
- [StructuredExampleResponse](docs/StructuredExampleResponse.md)
|
|
425
481
|
- [StructuredExtractionResponse](docs/StructuredExtractionResponse.md)
|
|
426
482
|
- [StructuredInferenceExample](docs/StructuredInferenceExample.md)
|
|
@@ -36,6 +36,7 @@ from numind import NuMindAsync
|
|
|
36
36
|
client = NuMindAsync(api_key="API_KEY")
|
|
37
37
|
requests = [{}]
|
|
38
38
|
|
|
39
|
+
|
|
39
40
|
async def main():
|
|
40
41
|
return [
|
|
41
42
|
await client.extract_structured_data(project_id, **request_kwargs)
|
|
@@ -57,14 +58,14 @@ template = {
|
|
|
57
58
|
"destination": {
|
|
58
59
|
"name": "verbatim-string",
|
|
59
60
|
"zip_code": "string",
|
|
60
|
-
"country": "string"
|
|
61
|
+
"country": "string",
|
|
61
62
|
},
|
|
62
63
|
"accommodation": "verbatim-string",
|
|
63
64
|
"activities": ["verbatim-string"],
|
|
64
65
|
"duration": {
|
|
65
66
|
"time_unit": ["day", "week", "month", "year"],
|
|
66
|
-
"time_quantity": "integer"
|
|
67
|
-
}
|
|
67
|
+
"time_quantity": "integer",
|
|
68
|
+
},
|
|
68
69
|
}
|
|
69
70
|
input_text = """My dream vacation would be a month-long escape to the stunning islands of Tahiti.
|
|
70
71
|
I’d stay in an overwater bungalow in Bora Bora, waking up to crystal-clear turquoise waters and breathtaking sunrises.
|
|
@@ -103,7 +104,7 @@ print(output)
|
|
|
103
104
|
|
|
104
105
|
### Create a good template
|
|
105
106
|
|
|
106
|
-
NuExtract uses JSON
|
|
107
|
+
NuExtract uses JSON extraction templates which specify the information to retrieve and their types, which are:
|
|
107
108
|
|
|
108
109
|
* **string**: a text, whose value can be abstract, i.e. totally free and can be deduced from calculations, reasoning, external knowledge;
|
|
109
110
|
* **verbatim-string**: a purely extractive text whose value must be present in the document. Some flexibility might be allowed on the formatting, e.g. new lines and escaped characters (e.g. `\n`) in a documents might be represented with a space;
|
|
@@ -119,7 +120,33 @@ Additionally, the value of a field can be:
|
|
|
119
120
|
* an **enum**, i.e. a list of elements to choose from of the form `["choice1", "choice2", ...]`. For values of this type, just set the value of the item to choose, e.g. "choice1", and do not set the value as an array containing the item such as `["choice1"]`;
|
|
120
121
|
* a **multi-enum**, i.e. a list from which multiple elements can be picked, of the form `[["choice1", "choice2", ...]]` (double square brackets).
|
|
121
122
|
|
|
122
|
-
|
|
123
|
+
### Converting JSON schema / Pydantic models to NuExtract template
|
|
124
|
+
|
|
125
|
+
The SDK offers a method to convert JSON schemas to NuExtract templates:
|
|
126
|
+
|
|
127
|
+
```Python
|
|
128
|
+
from typing import Literal
|
|
129
|
+
|
|
130
|
+
from pydantic import Field, BaseModel
|
|
131
|
+
from numind.nuextract_utils import convert_json_schema_to_nuextract_template
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
class HotelBooking(BaseModel):
|
|
135
|
+
city: str
|
|
136
|
+
check_in_date: str = Field(description="date")
|
|
137
|
+
check_out_date: str = Field(description="date")
|
|
138
|
+
number_of_guests: int
|
|
139
|
+
room_type: Literal["single", "double", "suite"]
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
template, dropped_branches, descriptions = convert_json_schema_to_nuextract_template(
|
|
143
|
+
HotelBooking.model_json_schema()
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
# {'check_in_date': 'date', 'check_out_date': 'date', 'city': 'string', 'number_of_guests': 'integer', 'room_type': ['single', 'double', 'suite']}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Inferring a template
|
|
123
150
|
|
|
124
151
|
The "infer_template" method allows to quickly create a template that you can start to work with from a text description.
|
|
125
152
|
|
|
@@ -207,41 +234,52 @@ markdown = client.extract_content(input_file)
|
|
|
207
234
|
|
|
208
235
|
### Extracting Information from Documents
|
|
209
236
|
|
|
210
|
-
Once your project is ready,
|
|
211
|
-
|
|
212
|
-
Each project has its own extraction endpoint:
|
|
237
|
+
Once your structured extraction project is ready, submit a document to the endpoint:
|
|
213
238
|
|
|
214
|
-
`https://nuextract.ai/api/
|
|
239
|
+
`https://nuextract.ai/api/structured-extraction/{structuredProjectId}/jobs`
|
|
215
240
|
|
|
216
|
-
|
|
241
|
+
To use it, you need:
|
|
217
242
|
|
|
218
243
|
- To create an API key in the [Account section](https://nuextract.ai/app/user?content=api)
|
|
219
|
-
- To replace `{
|
|
244
|
+
- To replace `{structuredProjectId}` by the project ID found in the API tab of the structured extraction project
|
|
220
245
|
|
|
221
|
-
|
|
246
|
+
This endpoint creates an asynchronous extraction job. Use the returned `jobId` to retrieve the result from:
|
|
247
|
+
|
|
248
|
+
`https://nuextract.ai/api/structured-extraction/jobs/{structuredExtractionJobId}`
|
|
249
|
+
|
|
250
|
+
You can test your extraction endpoint in your terminal using this command-line example with curl (make sure that you replace values of `STRUCTURED_PROJECT_ID` and `NUEXTRACT_API_KEY`):
|
|
222
251
|
|
|
223
252
|
```bash
|
|
224
253
|
NUEXTRACT_API_KEY=\"_your_api_key_here_\"; \\
|
|
225
|
-
|
|
226
|
-
curl \"https://nuextract.ai/api/
|
|
254
|
+
STRUCTURED_PROJECT_ID=\"a24fd84a-44ab-4fd4-95a9-bebd46e4768b\"; \\
|
|
255
|
+
JOB_ID=$(curl \"https://nuextract.ai/api/structured-extraction/${STRUCTURED_PROJECT_ID}/jobs\" \\
|
|
227
256
|
-X POST \\
|
|
228
257
|
-H \"Authorization: Bearer ${NUEXTRACT_API_KEY}\" \\
|
|
229
|
-
-
|
|
230
|
-
|
|
258
|
+
-F \"file=@${FILE_NAME}\" | jq -r '.jobId')
|
|
259
|
+
|
|
260
|
+
curl \"https://nuextract.ai/api/structured-extraction/jobs/${JOB_ID}\" \\
|
|
261
|
+
-H \"Authorization: Bearer ${NUEXTRACT_API_KEY}\"
|
|
231
262
|
```
|
|
232
263
|
|
|
233
264
|
You can also use the [Python SDK](https://github.com/numindai/nuextract-platform-sdk#documentation), by replacing the
|
|
234
|
-
`project_id`, `api_key` and
|
|
265
|
+
`project_id`, `api_key` and request values in the following code:
|
|
235
266
|
|
|
236
267
|
```python
|
|
237
|
-
|
|
238
|
-
from
|
|
268
|
+
import asyncio
|
|
269
|
+
from numind import NuMindAsync
|
|
239
270
|
|
|
240
|
-
client =
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
271
|
+
client = NuMindAsync(api_key=api_key)
|
|
272
|
+
requests = [{}]
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
async def main():
|
|
276
|
+
return [
|
|
277
|
+
await client.extract_structured_data(project_id, **request_kwargs)
|
|
278
|
+
for request_kwargs in requests
|
|
279
|
+
]
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
responses = asyncio.run(main())
|
|
245
283
|
```
|
|
246
284
|
|
|
247
285
|
### Using the Platform via API
|
|
@@ -252,20 +290,32 @@ Everything you can do on the web platform can be done via API -
|
|
|
252
290
|
|
|
253
291
|
#### Main resources
|
|
254
292
|
|
|
255
|
-
- **Project** - user project, identified by `
|
|
293
|
+
- **Structured Extraction Project** - user project for structured extraction, identified by `structuredProjectId`
|
|
294
|
+
- **Content Extraction Project** - user project for content extraction, identified by `contentProjectId`
|
|
256
295
|
- **File** - uploaded file, identified by `fileId`, stored up to two weeks if not tied to an **Example**
|
|
257
|
-
- **Document** - internal representation of a document, identified by `documentId`, created from a File
|
|
258
|
-
- **Example** - document-extraction pair given to teach NuExtract, identified by `
|
|
296
|
+
- **Document** - internal representation of a document, identified by `documentId`, created from a File, stored up to two weeks if not tied to an Example
|
|
297
|
+
- **Example** - document-extraction pair given to teach NuExtract, identified by `structuredExampleId`, created from a Document
|
|
298
|
+
- **Job** - asynchronous extraction task, identified by `structuredExtractionJobId`
|
|
259
299
|
|
|
260
300
|
#### Most common API operations
|
|
261
301
|
|
|
262
|
-
|
|
263
|
-
|
|
302
|
+
##### Structured extraction
|
|
303
|
+
|
|
304
|
+
- Creating a **Structured Extraction Project** via `POST /api/structured-extraction`
|
|
305
|
+
- Changing the template of a **Structured Extraction Project** via `PATCH /api/structured-extraction/{structuredProjectId}`
|
|
306
|
+
- Changing settings of a **Structured Extraction Project** via `PATCH /api/structured-extraction/{structuredProjectId}/settings`
|
|
307
|
+
- Uploading a file to a **File** via `POST /api/files` (up to 2 weeks storage)
|
|
308
|
+
- Starting a structured extraction **Job** via `POST /api/structured-extraction/{structuredProjectId}/jobs`
|
|
309
|
+
- Reading a structured extraction **Job** result via `GET /api/structured-extraction/jobs/{structuredExtractionJobId}`
|
|
310
|
+
- Adding an **Example** to a **Structured Extraction Project** via `POST /api/structured-extraction/{structuredProjectId}/examples`
|
|
311
|
+
|
|
312
|
+
##### Content extraction
|
|
313
|
+
|
|
314
|
+
- Creating a **Content Extraction Project** via `POST /api/content-extraction`
|
|
315
|
+
- Changing settings of a **Content Extraction Project** via `PATCH /api/content-extraction/{contentProjectId}/settings`
|
|
264
316
|
- Uploading a file to a **File** via `POST /api/files` (up to 2 weeks storage)
|
|
265
|
-
-
|
|
266
|
-
-
|
|
267
|
-
- Changing Project settings via `POST /api/projects/{projectId}/settings`
|
|
268
|
-
- Locking a **Project** via `POST /api/projects/{projectId}/lock`
|
|
317
|
+
- Starting a content extraction **Job** via `POST /api/content-extraction/jobs`
|
|
318
|
+
- Reading a content extraction **Job** result via `GET /api/content-extraction/jobs/{contentExtractionJobId}`
|
|
269
319
|
|
|
270
320
|
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
|
271
321
|
|
|
@@ -294,7 +344,7 @@ Class | Method | HTTP request | Description
|
|
|
294
344
|
*DefaultApi* | [**get_api_ping**](docs/DefaultApi.md#get_api_ping) | **GET** /api/ping |
|
|
295
345
|
*DefaultApi* | [**get_api_version**](docs/DefaultApi.md#get_api_version) | **GET** /api/version |
|
|
296
346
|
*DocumentsApi* | [**get_api_documents_documentid**](docs/DocumentsApi.md#get_api_documents_documentid) | **GET** /api/documents/{documentId} |
|
|
297
|
-
*DocumentsApi* | [**
|
|
347
|
+
*DocumentsApi* | [**get_api_documents_documentid_parts_partindex_image**](docs/DocumentsApi.md#get_api_documents_documentid_parts_partindex_image) | **GET** /api/documents/{documentId}/parts/{partIndex}/image |
|
|
298
348
|
*DocumentsApi* | [**post_api_documents_documentid_new_owner**](docs/DocumentsApi.md#post_api_documents_documentid_new_owner) | **POST** /api/documents/{documentId}/new-owner |
|
|
299
349
|
*DocumentsApi* | [**post_api_documents_text**](docs/DocumentsApi.md#post_api_documents_text) | **POST** /api/documents/text |
|
|
300
350
|
*FilesApi* | [**get_api_files_fileid**](docs/FilesApi.md#get_api_files_fileid) | **GET** /api/files/{fileId} |
|
|
@@ -309,6 +359,9 @@ Class | Method | HTTP request | Description
|
|
|
309
359
|
*JobsApi* | [**get_api_jobs**](docs/JobsApi.md#get_api_jobs) | **GET** /api/jobs |
|
|
310
360
|
*JobsApi* | [**get_api_jobs_jobid_status**](docs/JobsApi.md#get_api_jobs_jobid_status) | **GET** /api/jobs/{jobId}/status |
|
|
311
361
|
*JobsApi* | [**get_api_jobs_jobid_stream**](docs/JobsApi.md#get_api_jobs_jobid_stream) | **GET** /api/jobs/{jobId}/stream |
|
|
362
|
+
*JobsApi* | [**post_api_jobs_jobid_cancel**](docs/JobsApi.md#post_api_jobs_jobid_cancel) | **POST** /api/jobs/{jobId}/cancel |
|
|
363
|
+
*ProjectImportExportApi* | [**get_api_extraction_projectkind_projectid_export**](docs/ProjectImportExportApi.md#get_api_extraction_projectkind_projectid_export) | **GET** /api/extraction/{projectKind}/{projectId}/export |
|
|
364
|
+
*ProjectImportExportApi* | [**post_api_extraction_import**](docs/ProjectImportExportApi.md#post_api_extraction_import) | **POST** /api/extraction/import |
|
|
312
365
|
*StructuredDataExtractionApi* | [**get_api_structured_extraction_jobs_structuredextractionjobid**](docs/StructuredDataExtractionApi.md#get_api_structured_extraction_jobs_structuredextractionjobid) | **GET** /api/structured-extraction/jobs/{structuredExtractionJobId} |
|
|
313
366
|
*StructuredDataExtractionApi* | [**post_api_structured_extraction_structuredprojectid_jobs**](docs/StructuredDataExtractionApi.md#post_api_structured_extraction_structuredprojectid_jobs) | **POST** /api/structured-extraction/{structuredProjectId}/jobs |
|
|
314
367
|
*StructuredExtractionExamplesApi* | [**delete_api_structured_extraction_structuredprojectid_examples_structuredexampleid**](docs/StructuredExtractionExamplesApi.md#delete_api_structured_extraction_structuredprojectid_examples_structuredexampleid) | **DELETE** /api/structured-extraction/{structuredProjectId}/examples/{structuredExampleId} |
|
|
@@ -335,6 +388,7 @@ Class | Method | HTTP request | Description
|
|
|
335
388
|
|
|
336
389
|
### Documentation For Models
|
|
337
390
|
|
|
391
|
+
- [Content](docs/Content.md)
|
|
338
392
|
- [ContentExtractionResponse](docs/ContentExtractionResponse.md)
|
|
339
393
|
- [ContentProjectResponse](docs/ContentProjectResponse.md)
|
|
340
394
|
- [ContentProjectSettingsResponse](docs/ContentProjectSettingsResponse.md)
|
|
@@ -348,6 +402,7 @@ Class | Method | HTTP request | Description
|
|
|
348
402
|
- [FileResponse](docs/FileResponse.md)
|
|
349
403
|
- [HealthResponse](docs/HealthResponse.md)
|
|
350
404
|
- [ImageInfo](docs/ImageInfo.md)
|
|
405
|
+
- [ImportProjectResponse](docs/ImportProjectResponse.md)
|
|
351
406
|
- [InferenceStatus](docs/InferenceStatus.md)
|
|
352
407
|
- [InferenceValidationError](docs/InferenceValidationError.md)
|
|
353
408
|
- [InformationResponse](docs/InformationResponse.md)
|
|
@@ -356,6 +411,7 @@ Class | Method | HTTP request | Description
|
|
|
356
411
|
- [JobStatusResponse](docs/JobStatusResponse.md)
|
|
357
412
|
- [PaginatedResponseT](docs/PaginatedResponseT.md)
|
|
358
413
|
- [ServiceStatus](docs/ServiceStatus.md)
|
|
414
|
+
- [Structured](docs/Structured.md)
|
|
359
415
|
- [StructuredExampleResponse](docs/StructuredExampleResponse.md)
|
|
360
416
|
- [StructuredExtractionResponse](docs/StructuredExtractionResponse.md)
|
|
361
417
|
- [StructuredInferenceExample](docs/StructuredInferenceExample.md)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Content
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Properties
|
|
5
|
+
|
|
6
|
+
Name | Type | Description | Notes
|
|
7
|
+
------------ | ------------- | ------------- | -------------
|
|
8
|
+
**project** | [**ContentProjectResponse**](ContentProjectResponse.md) | |
|
|
9
|
+
**type** | **str** | |
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```python
|
|
14
|
+
from numind.models.content import Content
|
|
15
|
+
|
|
16
|
+
# TODO update the JSON string below
|
|
17
|
+
json = "{}"
|
|
18
|
+
# create an instance of Content from a JSON string
|
|
19
|
+
content_instance = Content.from_json(json)
|
|
20
|
+
# print the JSON string representation of the object
|
|
21
|
+
print(Content.to_json())
|
|
22
|
+
|
|
23
|
+
# convert the object into a dict
|
|
24
|
+
content_dict = content_instance.to_dict()
|
|
25
|
+
# create an instance of Content from a dict
|
|
26
|
+
content_from_dict = Content.from_dict(content_dict)
|
|
27
|
+
```
|
|
28
|
+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
29
|
+
|
|
30
|
+
|