numind 0.0.2__tar.gz → 0.0.3__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.0.2 → numind-0.0.3}/PKG-INFO +3 -1
- {numind-0.0.2 → numind-0.0.3}/README.md +2 -0
- {numind-0.0.2 → numind-0.0.3}/docs/ExtractionApi.md +17 -8
- {numind-0.0.2 → numind-0.0.3}/docs/InferenceApi.md +86 -0
- numind-0.0.3/docs/ModelUsageResponse.md +31 -0
- {numind-0.0.2 → numind-0.0.3}/docs/ProjectManagementApi.md +5 -1
- {numind-0.0.2 → numind-0.0.3}/docs/ProjectSettingsResponse.md +2 -0
- {numind-0.0.2 → numind-0.0.3}/docs/UpdateProjectSettingsRequest.md +2 -0
- {numind-0.0.2 → numind-0.0.3}/gen_sdk.sh +1 -0
- {numind-0.0.2 → numind-0.0.3}/pyproject.toml +1 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/numind.py +48 -2
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/__init__.py +5 -0
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/api/authentication_api.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/api/default_api.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/api/documents_api.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/api/examples_api.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/api/extraction_api.py +127 -4
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/api/files_api.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/api/inference_api.py +254 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/api/jobs_api.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/api/organizations_api.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/api/playground_api.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/api/project_management_api.py +6 -7
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/api_client.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/configuration.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/exceptions.py +0 -3
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/__init__.py +2 -0
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/api_key_response.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/convert_request.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/create_api_key.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/create_or_update_example_request.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/create_or_update_playground_item_request.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/create_organization_request.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/create_project_request.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/document_info.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/document_response.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/error.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/example_response.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/extraction_response.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/file_response.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/health_response.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/image_info.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/inference_response.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/information_response.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/invalid_information.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/invitation_response.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/invite_member_request.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/job_id_response.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/job_response.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/member_response.py +0 -1
- numind-0.0.3/src/numind/openapi_client/models/model_usage_response.py +89 -0
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/organization_response.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/playground_item_response.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/project_response.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/project_settings_response.py +15 -2
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/raw_result.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/service_status.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/template_request.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/text_info.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/text_request.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/token_code_request.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/token_refresh_request.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/token_request.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/token_response.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/update_api_key.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/update_organization_request.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/update_project_request.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/update_project_settings_request.py +17 -2
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/update_project_template_request.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/user.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/valid_information.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/models/version_response.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/rest.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/src/pyproject_base.toml +1 -2
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_api_key_response.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_authentication_api.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_convert_request.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_create_api_key.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_create_or_update_example_request.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_create_or_update_playground_item_request.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_create_organization_request.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_create_project_request.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_default_api.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_document_info.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_document_response.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_documents_api.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_error.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_example_response.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_examples_api.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_extraction_api.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_extraction_response.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_file_response.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_files_api.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_health_response.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_image_info.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_inference_api.py +3 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_inference_response.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_information_response.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_invalid_information.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_invitation_response.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_invite_member_request.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_job_id_response.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_job_response.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_jobs_api.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_member_response.py +0 -1
- numind-0.0.3/tests/openapi_client/test_model_usage_response.py +57 -0
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_organization_response.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_organizations_api.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_playground_api.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_playground_item_response.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_project_management_api.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_project_response.py +6 -3
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_project_settings_response.py +5 -2
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_raw_result.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_service_status.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_template_request.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_text_info.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_text_request.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_token_code_request.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_token_refresh_request.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_token_request.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_token_response.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_update_api_key.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_update_organization_request.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_update_project_request.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_update_project_settings_request.py +3 -2
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_update_project_template_request.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_user.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_valid_information.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/openapi_client/test_version_response.py +0 -1
- {numind-0.0.2 → numind-0.0.3}/tests/test_project.py +5 -0
- {numind-0.0.2 → numind-0.0.3}/.github/codecov.yml +0 -0
- {numind-0.0.2 → numind-0.0.3}/.github/dependabot.yml +0 -0
- {numind-0.0.2 → numind-0.0.3}/.github/workflows/lint.yml +0 -0
- {numind-0.0.2 → numind-0.0.3}/.github/workflows/publish-pypi.yml +0 -0
- {numind-0.0.2 → numind-0.0.3}/.github/workflows/sdk-auto-update.yml +0 -0
- {numind-0.0.2 → numind-0.0.3}/.github/workflows/tests.yml +0 -0
- {numind-0.0.2 → numind-0.0.3}/.github/workflows/update-api-build-version-repo-var.yml +0 -0
- {numind-0.0.2 → numind-0.0.3}/.gitignore +0 -0
- {numind-0.0.2 → numind-0.0.3}/LICENSE +0 -0
- {numind-0.0.2 → numind-0.0.3}/config.json +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/ApiKeyResponse.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/AuthenticationApi.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/ConvertRequest.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/CreateApiKey.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/CreateOrUpdateExampleRequest.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/CreateOrUpdatePlaygroundItemRequest.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/CreateOrganizationRequest.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/CreateProjectRequest.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/DefaultApi.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/DocumentInfo.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/DocumentResponse.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/DocumentsApi.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/Error.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/ExampleResponse.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/ExamplesApi.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/ExtractionResponse.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/FileResponse.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/FilesApi.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/HealthResponse.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/ImageInfo.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/InferenceResponse.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/InformationResponse.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/InvalidInformation.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/InvitationResponse.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/InviteMemberRequest.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/JobIdResponse.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/JobResponse.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/JobsApi.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/MemberResponse.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/OrganizationResponse.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/OrganizationsApi.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/PlaygroundApi.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/PlaygroundItemResponse.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/ProjectResponse.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/RawResult.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/ServiceStatus.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/TemplateRequest.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/TextInfo.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/TextRequest.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/TokenCodeRequest.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/TokenRefreshRequest.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/TokenRequest.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/TokenResponse.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/UpdateApiKey.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/UpdateOrganizationRequest.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/UpdateProjectRequest.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/UpdateProjectTemplateRequest.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/User.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/ValidInformation.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/docs/VersionResponse.md +0 -0
- {numind-0.0.2 → numind-0.0.3}/src/.openapi-generator-ignore +0 -0
- {numind-0.0.2 → numind-0.0.3}/src/adapt_pyproject.py +0 -0
- {numind-0.0.2 → numind-0.0.3}/src/collate_documentation_readme.py +0 -0
- {numind-0.0.2 → numind-0.0.3}/src/numind/__init__.py +0 -0
- {numind-0.0.2 → numind-0.0.3}/src/numind/constants.py +0 -0
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/api/__init__.py +0 -0
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/api_response.py +0 -0
- {numind-0.0.2 → numind-0.0.3}/src/numind/openapi_client/py.typed +0 -0
- {numind-0.0.2 → numind-0.0.3}/src/remove_unused_models_from_openapi_spec_file.py +0 -0
- {numind-0.0.2/tests/openapi_client → numind-0.0.3/tests}/__init__.py +0 -0
- {numind-0.0.2 → numind-0.0.3}/tests/conftest.py +0 -0
- {numind-0.0.2/tests → numind-0.0.3/tests/openapi_client}/__init__.py +0 -0
- {numind-0.0.2 → numind-0.0.3}/tests/test_cases/vacation/examples.csv +0 -0
- {numind-0.0.2 → numind-0.0.3}/tests/test_cases/vacation/files/tahiti.docx +0 -0
- {numind-0.0.2 → numind-0.0.3}/tests/test_cases/vacation/files_examples/kyoto.docx +0 -0
- {numind-0.0.2 → numind-0.0.3}/tests/test_cases/vacation/schema.json +0 -0
- {numind-0.0.2 → numind-0.0.3}/tests/test_cases/vacation/texts.csv +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: numind
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.3
|
|
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
|
|
@@ -330,6 +330,7 @@ Class | Method | HTTP request | Description
|
|
|
330
330
|
*FilesApi* | [**post_api_files**](docs/FilesApi.md#post_api_files) | **POST** /api/files |
|
|
331
331
|
*FilesApi* | [**post_api_files_fileid_convert_to_document**](docs/FilesApi.md#post_api_files_fileid_convert_to_document) | **POST** /api/files/{fileId}/convert-to-document |
|
|
332
332
|
*InferenceApi* | [**post_api_infer_template**](docs/InferenceApi.md#post_api_infer_template) | **POST** /api/infer-template |
|
|
333
|
+
*InferenceApi* | [**post_api_infer_template_async**](docs/InferenceApi.md#post_api_infer_template_async) | **POST** /api/infer-template-async |
|
|
333
334
|
*InferenceApi* | [**post_api_infer_template_document_documentid**](docs/InferenceApi.md#post_api_infer_template_document_documentid) | **POST** /api/infer-template/document/{documentId} |
|
|
334
335
|
*InferenceApi* | [**post_api_infer_template_file**](docs/InferenceApi.md#post_api_infer_template_file) | **POST** /api/infer-template/file |
|
|
335
336
|
*InferenceApi* | [**post_api_projects_projectid_infer_document_async_documentid**](docs/InferenceApi.md#post_api_projects_projectid_infer_document_async_documentid) | **POST** /api/projects/{projectId}/infer-document-async/{documentId} |
|
|
@@ -397,6 +398,7 @@ Class | Method | HTTP request | Description
|
|
|
397
398
|
- [JobIdResponse](docs/JobIdResponse.md)
|
|
398
399
|
- [JobResponse](docs/JobResponse.md)
|
|
399
400
|
- [MemberResponse](docs/MemberResponse.md)
|
|
401
|
+
- [ModelUsageResponse](docs/ModelUsageResponse.md)
|
|
400
402
|
- [OrganizationResponse](docs/OrganizationResponse.md)
|
|
401
403
|
- [PlaygroundItemResponse](docs/PlaygroundItemResponse.md)
|
|
402
404
|
- [ProjectResponse](docs/ProjectResponse.md)
|
|
@@ -269,6 +269,7 @@ Class | Method | HTTP request | Description
|
|
|
269
269
|
*FilesApi* | [**post_api_files**](docs/FilesApi.md#post_api_files) | **POST** /api/files |
|
|
270
270
|
*FilesApi* | [**post_api_files_fileid_convert_to_document**](docs/FilesApi.md#post_api_files_fileid_convert_to_document) | **POST** /api/files/{fileId}/convert-to-document |
|
|
271
271
|
*InferenceApi* | [**post_api_infer_template**](docs/InferenceApi.md#post_api_infer_template) | **POST** /api/infer-template |
|
|
272
|
+
*InferenceApi* | [**post_api_infer_template_async**](docs/InferenceApi.md#post_api_infer_template_async) | **POST** /api/infer-template-async |
|
|
272
273
|
*InferenceApi* | [**post_api_infer_template_document_documentid**](docs/InferenceApi.md#post_api_infer_template_document_documentid) | **POST** /api/infer-template/document/{documentId} |
|
|
273
274
|
*InferenceApi* | [**post_api_infer_template_file**](docs/InferenceApi.md#post_api_infer_template_file) | **POST** /api/infer-template/file |
|
|
274
275
|
*InferenceApi* | [**post_api_projects_projectid_infer_document_async_documentid**](docs/InferenceApi.md#post_api_projects_projectid_infer_document_async_documentid) | **POST** /api/projects/{projectId}/infer-document-async/{documentId} |
|
|
@@ -336,6 +337,7 @@ Class | Method | HTTP request | Description
|
|
|
336
337
|
- [JobIdResponse](docs/JobIdResponse.md)
|
|
337
338
|
- [JobResponse](docs/JobResponse.md)
|
|
338
339
|
- [MemberResponse](docs/MemberResponse.md)
|
|
340
|
+
- [ModelUsageResponse](docs/ModelUsageResponse.md)
|
|
339
341
|
- [OrganizationResponse](docs/OrganizationResponse.md)
|
|
340
342
|
- [PlaygroundItemResponse](docs/PlaygroundItemResponse.md)
|
|
341
343
|
- [ProjectResponse](docs/ProjectResponse.md)
|
|
@@ -9,12 +9,13 @@ Method | HTTP request | Description
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
# **post_api_projects_projectid_extract**
|
|
12
|
-
> ExtractionResponse post_api_projects_projectid_extract(project_id, body, temperature=temperature, rasterization_dpi=rasterization_dpi, max_output_tokens=max_output_tokens)
|
|
12
|
+
> ExtractionResponse post_api_projects_projectid_extract(project_id, body, temperature=temperature, rasterization_dpi=rasterization_dpi, max_output_tokens=max_output_tokens, degraded_mode=degraded_mode, max_tokens_smart_example=max_tokens_smart_example)
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
Extract information from the provided text or file. Some files are converted to images -
|
|
16
|
-
the **rasterizationDPI** parameter controls their resolution. When **temperature**, **rasterizationDPI
|
|
17
|
-
|
|
16
|
+
the **rasterizationDPI** parameter controls their resolution. When **temperature**, **rasterizationDPI**,
|
|
17
|
+
**maxOutputTokens**, **degradedMode** and **maxTokensSmartExample** parameters are not specified,
|
|
18
|
+
they are set to their project-setting values.
|
|
18
19
|
|
|
19
20
|
#### Response:
|
|
20
21
|
Returns a JSON representing the extracted information.
|
|
@@ -61,9 +62,11 @@ with numind.openapi_client.ApiClient(configuration) as api_client:
|
|
|
61
62
|
temperature = 3.4 # float | Model temperature (optional). Controls output diversity. When not specified, the project value is used. Ranges between 0 and 1. (optional)
|
|
62
63
|
rasterization_dpi = 56 # int | Resolution used to convert formatted documents (PDFs, etc.) to images, in dot per inch (optional). Ranges between 1 and 300. (optional)
|
|
63
64
|
max_output_tokens = 56 # int | Maximum number of output tokens (optional). Must be positive. Set to 0 for no limit. (optional)
|
|
65
|
+
degraded_mode = 'degraded_mode_example' # str | Controls whether a response is returned when smart example is not functionning. Rejects by default. (optional)
|
|
66
|
+
max_tokens_smart_example = 56 # int | Controls the maximum number of tokens that can be allocated to the examples. Must be positive. Ranges in the context window of the model. (optional)
|
|
64
67
|
|
|
65
68
|
try:
|
|
66
|
-
api_response = api_instance.post_api_projects_projectid_extract(project_id, body, temperature=temperature, rasterization_dpi=rasterization_dpi, max_output_tokens=max_output_tokens)
|
|
69
|
+
api_response = api_instance.post_api_projects_projectid_extract(project_id, body, temperature=temperature, rasterization_dpi=rasterization_dpi, max_output_tokens=max_output_tokens, degraded_mode=degraded_mode, max_tokens_smart_example=max_tokens_smart_example)
|
|
67
70
|
print("The response of ExtractionApi->post_api_projects_projectid_extract:\n")
|
|
68
71
|
pprint(api_response)
|
|
69
72
|
except Exception as e:
|
|
@@ -82,6 +85,8 @@ Name | Type | Description | Notes
|
|
|
82
85
|
**temperature** | **float**| Model temperature (optional). Controls output diversity. When not specified, the project value is used. Ranges between 0 and 1. | [optional]
|
|
83
86
|
**rasterization_dpi** | **int**| Resolution used to convert formatted documents (PDFs, etc.) to images, in dot per inch (optional). Ranges between 1 and 300. | [optional]
|
|
84
87
|
**max_output_tokens** | **int**| Maximum number of output tokens (optional). Must be positive. Set to 0 for no limit. | [optional]
|
|
88
|
+
**degraded_mode** | **str**| Controls whether a response is returned when smart example is not functionning. Rejects by default. | [optional]
|
|
89
|
+
**max_tokens_smart_example** | **int**| Controls the maximum number of tokens that can be allocated to the examples. Must be positive. Ranges in the context window of the model. | [optional]
|
|
85
90
|
|
|
86
91
|
### Return type
|
|
87
92
|
|
|
@@ -101,13 +106,13 @@ Name | Type | Description | Notes
|
|
|
101
106
|
| Status code | Description | Response headers |
|
|
102
107
|
|-------------|-------------|------------------|
|
|
103
108
|
**200** | | - |
|
|
104
|
-
**400** | Invalid value for: query parameter temperature, Invalid value for: query parameter rasterizationDPI, Invalid value for: query parameter maxOutputTokens, Invalid value for: body | - |
|
|
109
|
+
**400** | Invalid value for: query parameter temperature, Invalid value for: query parameter rasterizationDPI, Invalid value for: query parameter maxOutputTokens, Invalid value for: query parameter maxTokensSmartExample, Invalid value for: body | - |
|
|
105
110
|
**0** | | - |
|
|
106
111
|
|
|
107
112
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
108
113
|
|
|
109
114
|
# **post_api_projects_projectid_extract_async**
|
|
110
|
-
> JobIdResponse post_api_projects_projectid_extract_async(project_id, body, temperature=temperature, dpi=dpi, max_output_tokens=max_output_tokens)
|
|
115
|
+
> JobIdResponse post_api_projects_projectid_extract_async(project_id, body, temperature=temperature, dpi=dpi, max_output_tokens=max_output_tokens, degraded_mode=degraded_mode, max_tokens_smart_example=max_tokens_smart_example)
|
|
111
116
|
|
|
112
117
|
Start file extraction as async job
|
|
113
118
|
|
|
@@ -143,9 +148,11 @@ with numind.openapi_client.ApiClient(configuration) as api_client:
|
|
|
143
148
|
temperature = 3.4 # float | Model temperature (optional). Controls output diversity. When not specified, the project value is used. Ranges between 0 and 1. (optional)
|
|
144
149
|
dpi = 56 # int | DPI for file rasterization (optional). When not specified, the project value is used. If the file is already an image or a text, this parameter is ignored. (optional)
|
|
145
150
|
max_output_tokens = 56 # int | Maximum number of output tokens (optional). When not specified, the project value is used. Use 0 to indicate no limit. (optional)
|
|
151
|
+
degraded_mode = 'degraded_mode_example' # str | Controls whether a response is returned when smart example is not functionning. Rejects by default. (optional)
|
|
152
|
+
max_tokens_smart_example = 56 # int | Controls the maximum number of tokens that can be allocated to the examples. Must be positive. Ranges in the context window of the model. (optional)
|
|
146
153
|
|
|
147
154
|
try:
|
|
148
|
-
api_response = api_instance.post_api_projects_projectid_extract_async(project_id, body, temperature=temperature, dpi=dpi, max_output_tokens=max_output_tokens)
|
|
155
|
+
api_response = api_instance.post_api_projects_projectid_extract_async(project_id, body, temperature=temperature, dpi=dpi, max_output_tokens=max_output_tokens, degraded_mode=degraded_mode, max_tokens_smart_example=max_tokens_smart_example)
|
|
149
156
|
print("The response of ExtractionApi->post_api_projects_projectid_extract_async:\n")
|
|
150
157
|
pprint(api_response)
|
|
151
158
|
except Exception as e:
|
|
@@ -164,6 +171,8 @@ Name | Type | Description | Notes
|
|
|
164
171
|
**temperature** | **float**| Model temperature (optional). Controls output diversity. When not specified, the project value is used. Ranges between 0 and 1. | [optional]
|
|
165
172
|
**dpi** | **int**| DPI for file rasterization (optional). When not specified, the project value is used. If the file is already an image or a text, this parameter is ignored. | [optional]
|
|
166
173
|
**max_output_tokens** | **int**| Maximum number of output tokens (optional). When not specified, the project value is used. Use 0 to indicate no limit. | [optional]
|
|
174
|
+
**degraded_mode** | **str**| Controls whether a response is returned when smart example is not functionning. Rejects by default. | [optional]
|
|
175
|
+
**max_tokens_smart_example** | **int**| Controls the maximum number of tokens that can be allocated to the examples. Must be positive. Ranges in the context window of the model. | [optional]
|
|
167
176
|
|
|
168
177
|
### Return type
|
|
169
178
|
|
|
@@ -183,7 +192,7 @@ Name | Type | Description | Notes
|
|
|
183
192
|
| Status code | Description | Response headers |
|
|
184
193
|
|-------------|-------------|------------------|
|
|
185
194
|
**200** | | - |
|
|
186
|
-
**400** | Invalid value for: query parameter temperature, Invalid value for: query parameter dpi, Invalid value for: query parameter maxOutputTokens, Invalid value for: body | - |
|
|
195
|
+
**400** | Invalid value for: query parameter temperature, Invalid value for: query parameter dpi, Invalid value for: query parameter maxOutputTokens, Invalid value for: query parameter maxTokensSmartExample, Invalid value for: body | - |
|
|
187
196
|
**0** | | - |
|
|
188
197
|
|
|
189
198
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
@@ -5,6 +5,7 @@ All URIs are relative to *https://nuextract.ai*
|
|
|
5
5
|
Method | HTTP request | Description
|
|
6
6
|
------------- | ------------- | -------------
|
|
7
7
|
[**post_api_infer_template**](InferenceApi.md#post_api_infer_template) | **POST** /api/infer-template |
|
|
8
|
+
[**post_api_infer_template_async**](InferenceApi.md#post_api_infer_template_async) | **POST** /api/infer-template-async |
|
|
8
9
|
[**post_api_infer_template_document_documentid**](InferenceApi.md#post_api_infer_template_document_documentid) | **POST** /api/infer-template/document/{documentId} |
|
|
9
10
|
[**post_api_infer_template_file**](InferenceApi.md#post_api_infer_template_file) | **POST** /api/infer-template/file |
|
|
10
11
|
[**post_api_projects_projectid_infer_document_async_documentid**](InferenceApi.md#post_api_projects_projectid_infer_document_async_documentid) | **POST** /api/projects/{projectId}/infer-document-async/{documentId} |
|
|
@@ -97,6 +98,91 @@ Name | Type | Description | Notes
|
|
|
97
98
|
|
|
98
99
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
99
100
|
|
|
101
|
+
# **post_api_infer_template_async**
|
|
102
|
+
> JobIdResponse post_api_infer_template_async(template_request)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
Derive a template from the provided natural language description.
|
|
106
|
+
Potentially, this endpoint can equally be used to correct the template to conform to the NuExtract standard.
|
|
107
|
+
The resulting template is a JSON object that can be used as a project template.
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
#### Response:
|
|
111
|
+
Returns a JSON representing the derived template.
|
|
112
|
+
The response is an empty template if the derivation fails.
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
### Example
|
|
117
|
+
|
|
118
|
+
* OAuth Authentication (oauth2Auth):
|
|
119
|
+
|
|
120
|
+
```python
|
|
121
|
+
import numind.openapi_client
|
|
122
|
+
from numind.openapi_client.models.job_id_response import JobIdResponse
|
|
123
|
+
from numind.openapi_client.models.template_request import TemplateRequest
|
|
124
|
+
from numind.openapi_client.rest import ApiException
|
|
125
|
+
from pprint import pprint
|
|
126
|
+
|
|
127
|
+
# Defining the host is optional and defaults to https://nuextract.ai
|
|
128
|
+
# See configuration.py for a list of all supported configuration parameters.
|
|
129
|
+
configuration = numind.openapi_client.Configuration(
|
|
130
|
+
host = "https://nuextract.ai"
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
# The client must configure the authentication and authorization parameters
|
|
134
|
+
# in accordance with the API server security policy.
|
|
135
|
+
# Examples for each auth method are provided below, use the example that
|
|
136
|
+
# satisfies your auth use case.
|
|
137
|
+
|
|
138
|
+
configuration.access_token = os.environ["ACCESS_TOKEN"]
|
|
139
|
+
|
|
140
|
+
# Enter a context with an instance of the API client
|
|
141
|
+
with numind.openapi_client.ApiClient(configuration) as api_client:
|
|
142
|
+
# Create an instance of the API class
|
|
143
|
+
api_instance = numind.openapi_client.InferenceApi(api_client)
|
|
144
|
+
template_request = {description=[EXAMPLE ONLY] Create a template that extracts key information from an order confirmation email. The template should be able to pull details like the order ID, customer ID, date and time of the order, status, total amount, currency, item details (product ID, quantity, and unit price), shipping address, any customer requests or delivery preferences, and the estimated delivery date.} # TemplateRequest |
|
|
145
|
+
|
|
146
|
+
try:
|
|
147
|
+
api_response = api_instance.post_api_infer_template_async(template_request)
|
|
148
|
+
print("The response of InferenceApi->post_api_infer_template_async:\n")
|
|
149
|
+
pprint(api_response)
|
|
150
|
+
except Exception as e:
|
|
151
|
+
print("Exception when calling InferenceApi->post_api_infer_template_async: %s\n" % e)
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
### Parameters
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
Name | Type | Description | Notes
|
|
160
|
+
------------- | ------------- | ------------- | -------------
|
|
161
|
+
**template_request** | [**TemplateRequest**](TemplateRequest.md)| |
|
|
162
|
+
|
|
163
|
+
### Return type
|
|
164
|
+
|
|
165
|
+
[**JobIdResponse**](JobIdResponse.md)
|
|
166
|
+
|
|
167
|
+
### Authorization
|
|
168
|
+
|
|
169
|
+
[oauth2Auth](../README.md#oauth2Auth)
|
|
170
|
+
|
|
171
|
+
### HTTP request headers
|
|
172
|
+
|
|
173
|
+
- **Content-Type**: application/json
|
|
174
|
+
- **Accept**: application/json, text/plain
|
|
175
|
+
|
|
176
|
+
### HTTP response details
|
|
177
|
+
|
|
178
|
+
| Status code | Description | Response headers |
|
|
179
|
+
|-------------|-------------|------------------|
|
|
180
|
+
**200** | | - |
|
|
181
|
+
**400** | Invalid value for: body | - |
|
|
182
|
+
**0** | | - |
|
|
183
|
+
|
|
184
|
+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
185
|
+
|
|
100
186
|
# **post_api_infer_template_document_documentid**
|
|
101
187
|
> object post_api_infer_template_document_documentid(document_id)
|
|
102
188
|
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# ModelUsageResponse
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Properties
|
|
5
|
+
|
|
6
|
+
Name | Type | Description | Notes
|
|
7
|
+
------------ | ------------- | ------------- | -------------
|
|
8
|
+
**usage** | **int** | |
|
|
9
|
+
**balance** | **int** | |
|
|
10
|
+
**overage** | **int** | |
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```python
|
|
15
|
+
from numind.openapi_client.models.model_usage_response import ModelUsageResponse
|
|
16
|
+
|
|
17
|
+
# TODO update the JSON string below
|
|
18
|
+
json = "{}"
|
|
19
|
+
# create an instance of ModelUsageResponse from a JSON string
|
|
20
|
+
model_usage_response_instance = ModelUsageResponse.from_json(json)
|
|
21
|
+
# print the JSON string representation of the object
|
|
22
|
+
print(ModelUsageResponse.to_json())
|
|
23
|
+
|
|
24
|
+
# convert the object into a dict
|
|
25
|
+
model_usage_response_dict = model_usage_response_instance.to_dict()
|
|
26
|
+
# create an instance of ModelUsageResponse from a dict
|
|
27
|
+
model_usage_response_from_dict = ModelUsageResponse.from_dict(model_usage_response_dict)
|
|
28
|
+
```
|
|
29
|
+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
30
|
+
|
|
31
|
+
|
|
@@ -398,7 +398,7 @@ with numind.openapi_client.ApiClient(configuration) as api_client:
|
|
|
398
398
|
# Create an instance of the API class
|
|
399
399
|
api_instance = numind.openapi_client.ProjectManagementApi(api_client)
|
|
400
400
|
project_id = 'project_id_example' # str | Unique project identifier.
|
|
401
|
-
update_project_settings_request = {"temperature":0,"rasterizationDPI":115,"maxOutputTokens":0} # UpdateProjectSettingsRequest |
|
|
401
|
+
update_project_settings_request = {"temperature":0,"rasterizationDPI":115,"maxOutputTokens":0,"degradedMode":"Reject","maxTokensSmartExample":16000} # UpdateProjectSettingsRequest |
|
|
402
402
|
|
|
403
403
|
try:
|
|
404
404
|
api_response = api_instance.patch_api_projects_projectid_settings(project_id, update_project_settings_request)
|
|
@@ -464,6 +464,8 @@ A **Project** is created with default settings:
|
|
|
464
464
|
`temperature` | 0.0 |
|
|
465
465
|
`rasterizationDPI` | 115 |
|
|
466
466
|
`maxOutputTokens` | 0 (no limit) |
|
|
467
|
+
`degradedMode` | Reject |
|
|
468
|
+
`maxTokensSmartExample` | 16000 |
|
|
467
469
|
|
|
468
470
|
|
|
469
471
|
If *ownerOrganization* is not provided, the **Project** will be owned by the authenticated user.
|
|
@@ -733,6 +735,8 @@ Default values are:
|
|
|
733
735
|
`temperature` | 0.0 |
|
|
734
736
|
`rasterizationDPI` | 115 |
|
|
735
737
|
`maxOutputTokens` | 0 (no limit) |
|
|
738
|
+
`degradedMode` | Reject |
|
|
739
|
+
`maxTokensSmartExample` | 16000 |
|
|
736
740
|
|
|
737
741
|
#### Error Responses:
|
|
738
742
|
`404 Not Found` - If a **Project** with the specified `projectId` does not exist.
|
|
@@ -9,6 +9,8 @@ Name | Type | Description | Notes
|
|
|
9
9
|
**temperature** | **float** | Model temperature. |
|
|
10
10
|
**rasterization_dpi** | **int** | Resolution used to convert formatted documents to images. |
|
|
11
11
|
**max_output_tokens** | **int** | Maximum number of output tokens (optional). Must be positive. Set to 0 for no limit. |
|
|
12
|
+
**degraded_mode** | **str** | Controls whether a response is returned when smart example is not functionning. Rejects by default. |
|
|
13
|
+
**max_tokens_smart_example** | **int** | Maximum number of output tokens for smart examples (optional). Must be positive. |
|
|
12
14
|
|
|
13
15
|
## Example
|
|
14
16
|
|
|
@@ -8,6 +8,8 @@ Name | Type | Description | Notes
|
|
|
8
8
|
**temperature** | **float** | Model temperature (optional). | [optional]
|
|
9
9
|
**rasterization_dpi** | **int** | Resolution used to convert formatted documents to images (optional). | [optional]
|
|
10
10
|
**max_output_tokens** | **int** | Maximum number of output tokens (optional). Must be positive. Set to 0 for no limit. | [optional]
|
|
11
|
+
**degraded_mode** | **str** | Controls whether a response is returned when smart example is not functionning. Rejects by default. | [optional]
|
|
12
|
+
**max_tokens_smart_example** | **int** | Maximum number of output tokens for smart examples (optional). Must be positive. | [optional]
|
|
11
13
|
|
|
12
14
|
## Example
|
|
13
15
|
|
|
@@ -37,6 +37,7 @@ openapi-generator-cli generate \
|
|
|
37
37
|
# Run ruff to lint as much as possible
|
|
38
38
|
uvx ruff format
|
|
39
39
|
uvx ruff check --fix --exit-zero
|
|
40
|
+
uvx ruff format # second pass to catch more fixable cases
|
|
40
41
|
|
|
41
42
|
# Integrate client dependencies and client pyproject tools into project pyproject
|
|
42
43
|
python src/adapt_pyproject.py --project-pyproject-path=src/pyproject_base.toml --client-pyproject-path=src/pyproject.toml --client-requirements-path src/requirements.txt
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "numind"
|
|
7
|
-
version = "0.0.
|
|
7
|
+
version = "0.0.3"
|
|
8
8
|
description = "SDK to interact with the NuMind models API."
|
|
9
9
|
requires-python = ">=3.9"
|
|
10
10
|
keywords = [ "artificial intelligence", "deep learning", "structured",]
|
|
@@ -21,11 +21,14 @@ from .openapi_client import (
|
|
|
21
21
|
ExtractionResponse,
|
|
22
22
|
FilesApi,
|
|
23
23
|
InferenceApi,
|
|
24
|
+
JobsApi,
|
|
24
25
|
OrganizationsApi,
|
|
25
26
|
ProjectManagementApi,
|
|
26
27
|
TextRequest,
|
|
27
28
|
)
|
|
28
29
|
|
|
30
|
+
JOB_STATUS_COMPLETED = "completed"
|
|
31
|
+
|
|
29
32
|
|
|
30
33
|
class NuMind(
|
|
31
34
|
DocumentsApi,
|
|
@@ -33,6 +36,7 @@ class NuMind(
|
|
|
33
36
|
ExtractionApi,
|
|
34
37
|
FilesApi,
|
|
35
38
|
InferenceApi,
|
|
39
|
+
JobsApi,
|
|
36
40
|
OrganizationsApi,
|
|
37
41
|
ProjectManagementApi,
|
|
38
42
|
):
|
|
@@ -151,8 +155,20 @@ class NuMind(
|
|
|
151
155
|
else:
|
|
152
156
|
input_, _ = self.__parse_input_file(input_file)
|
|
153
157
|
|
|
154
|
-
#
|
|
155
|
-
|
|
158
|
+
# Call model using server sent events streaming
|
|
159
|
+
job_id_response = self.post_api_projects_projectid_extract_async(
|
|
160
|
+
project_id, input_, **kwargs
|
|
161
|
+
)
|
|
162
|
+
job_output = self.get_api_jobs_jobid_stream(
|
|
163
|
+
job_id_response.job_id, _headers={"Accept": "text/event-stream"}
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
# Parsing the server's response
|
|
167
|
+
messages = _parse_sse_string(job_output)
|
|
168
|
+
if messages[-1]["event"] != JOB_STATUS_COMPLETED:
|
|
169
|
+
raise ValueError(_ := f"Request couldn't be completed:\n{messages[-1]}")
|
|
170
|
+
output = json.loads(json.loads(messages[-1]["data"])["outputData"])
|
|
171
|
+
output = ExtractionResponse(**output)
|
|
156
172
|
|
|
157
173
|
# Delete temporary project if necessary
|
|
158
174
|
if not project_id_provided:
|
|
@@ -209,3 +225,33 @@ class NuMind(
|
|
|
209
225
|
)
|
|
210
226
|
|
|
211
227
|
return files_ids, documents_ids
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
def _parse_sse_string(raw: str) -> list[dict[str, str]]:
|
|
231
|
+
messages = []
|
|
232
|
+
msg = {}
|
|
233
|
+
data_buf = []
|
|
234
|
+
for line in raw.splitlines():
|
|
235
|
+
if not line.strip(): # blank line = end of message
|
|
236
|
+
if data_buf or msg:
|
|
237
|
+
msg["data"] = "\n".join(data_buf)
|
|
238
|
+
messages.append(msg)
|
|
239
|
+
msg, data_buf = {}, []
|
|
240
|
+
continue
|
|
241
|
+
|
|
242
|
+
if line.startswith(":"): # comment line
|
|
243
|
+
continue
|
|
244
|
+
|
|
245
|
+
field, _, value = line.partition(":")
|
|
246
|
+
value = value.lstrip(" ")
|
|
247
|
+
if field == "data":
|
|
248
|
+
data_buf.append(value)
|
|
249
|
+
else:
|
|
250
|
+
msg[field] = value
|
|
251
|
+
|
|
252
|
+
# handle final pending message
|
|
253
|
+
if data_buf or msg:
|
|
254
|
+
msg["data"] = "\n".join(data_buf)
|
|
255
|
+
messages.append(msg)
|
|
256
|
+
|
|
257
|
+
return messages
|
|
@@ -60,6 +60,7 @@ __all__ = [
|
|
|
60
60
|
"JobIdResponse",
|
|
61
61
|
"JobResponse",
|
|
62
62
|
"MemberResponse",
|
|
63
|
+
"ModelUsageResponse",
|
|
63
64
|
"OrganizationResponse",
|
|
64
65
|
"PlaygroundItemResponse",
|
|
65
66
|
"ProjectResponse",
|
|
@@ -172,6 +173,9 @@ if __import__("typing").TYPE_CHECKING:
|
|
|
172
173
|
from numind.openapi_client.models.member_response import (
|
|
173
174
|
MemberResponse as MemberResponse,
|
|
174
175
|
)
|
|
176
|
+
from numind.openapi_client.models.model_usage_response import (
|
|
177
|
+
ModelUsageResponse as ModelUsageResponse,
|
|
178
|
+
)
|
|
175
179
|
from numind.openapi_client.models.organization_response import (
|
|
176
180
|
OrganizationResponse as OrganizationResponse,
|
|
177
181
|
)
|
|
@@ -280,6 +284,7 @@ from numind.openapi_client.models.invite_member_request import InviteMemberReque
|
|
|
280
284
|
from numind.openapi_client.models.job_id_response import JobIdResponse as JobIdResponse
|
|
281
285
|
from numind.openapi_client.models.job_response import JobResponse as JobResponse
|
|
282
286
|
from numind.openapi_client.models.member_response import MemberResponse as MemberResponse
|
|
287
|
+
from numind.openapi_client.models.model_usage_response import ModelUsageResponse as ModelUsageResponse
|
|
283
288
|
from numind.openapi_client.models.organization_response import OrganizationResponse as OrganizationResponse
|
|
284
289
|
from numind.openapi_client.models.playground_item_response import PlaygroundItemResponse as PlaygroundItemResponse
|
|
285
290
|
from numind.openapi_client.models.project_response import ProjectResponse as ProjectResponse
|