diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index ef835b94..7905f94a 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 8b5fa338-9106-4734-abf0-e30d67044a90 management: - docChecksum: 0f9100e28d13105be2af4e576ea4572c - docVersion: 1.0.68 + docChecksum: 83f88cfa4bd77e1d3065b11a97119361 + docVersion: 1.0.78 speakeasyVersion: 1.490.0 generationVersion: 2.512.0 - releaseVersion: 0.30.5 - configChecksum: 25a75f7add3305b685de164ad454cb9a + releaseVersion: 0.30.6 + configChecksum: c946e26d3a3b2fe2756ff169416b448c repoURL: https://github.com/Unstructured-IO/unstructured-python-client.git repoSubDirectory: . installationURL: https://github.com/Unstructured-IO/unstructured-python-client.git @@ -143,6 +143,8 @@ generatedFiles: - docs/models/shared/outlooksourceconnectorconfiginput.md - docs/models/shared/outputformat.md - docs/models/shared/partitionparameters.md + - docs/models/shared/partitionparametersschemasstrategy.md + - docs/models/shared/partitionparametersstrategy.md - docs/models/shared/postgresdestinationconnectorconfig.md - docs/models/shared/postgresdestinationconnectorconfiginput.md - docs/models/shared/qdrantclouddestinationconnectorconfig.md @@ -536,7 +538,7 @@ examples: partition: speakeasy-default-partition: requestBody: - multipart/form-data: {"chunking_strategy": "by_title", "combine_under_n_chars": null, "content_type": null, "coordinates": false, "encoding": null, "files": {"": "{\"summary\":\"File to be partitioned\",\"externalValue\":\"https://github.com/Unstructured-IO/unstructured/blob/98d3541909f64290b5efb65a226fc3ee8a7cc5ee/example-docs/layout-parser-paper.pdf\"}"}, "gz_uncompressed_content_type": null, "hi_res_model_name": null, "include_orig_elements": null, "include_page_breaks": false, "include_slide_notes": true, "max_characters": null, "multipage_sections": true, "new_after_n_chars": null, "output_format": "application/json", "overlap": 0, "overlap_all": false, "pdf_infer_table_structure": true, "similarity_threshold": null, "split_pdf_allow_failed": false, "split_pdf_cache_tmp_data": false, "split_pdf_cache_tmp_data_dir": "", "split_pdf_concurrency_level": 5, "split_pdf_page": true, "split_pdf_page_range": [1, 10], "starting_page_number": null, "strategy": "hi_res", "table_ocr_agent": null, "unique_element_ids": false, "xml_keep_tags": false} + multipart/form-data: {"chunking_strategy": "by_title", "combine_under_n_chars": null, "content_type": null, "coordinates": false, "encoding": null, "files": {"": "{\"summary\":\"File to be partitioned\",\"externalValue\":\"https://github.com/Unstructured-IO/unstructured/blob/98d3541909f64290b5efb65a226fc3ee8a7cc5ee/example-docs/layout-parser-paper.pdf\"}"}, "gz_uncompressed_content_type": null, "hi_res_model_name": null, "include_orig_elements": null, "include_page_breaks": false, "include_slide_notes": true, "max_characters": null, "multipage_sections": true, "new_after_n_chars": null, "output_format": "application/json", "overlap": 0, "overlap_all": false, "pdf_infer_table_structure": true, "similarity_threshold": null, "split_pdf_allow_failed": false, "split_pdf_cache_tmp_data": false, "split_pdf_cache_tmp_data_dir": "", "split_pdf_concurrency_level": 5, "split_pdf_page": true, "split_pdf_page_range": [1, 10], "starting_page_number": null, "strategy": "vlm", "table_ocr_agent": null, "unique_element_ids": false, "vlm_model": "gpt-4o", "vlm_model_provider": "openai", "xml_keep_tags": false} responses: "200": application/json: [{"type": "Title", "element_id": "6aa0ff22f91bbe7e26e8e25ca8052acd", "text": "LayoutParser: A Unified Toolkit for Deep Learning Based Document Image Analysis", "metadata": {"languages": ["eng"], "page_number": 1, "filename": "layout-parser-paper.pdf", "filetype": "application/pdf"}}] diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index b5b27aa7..b0d3c49b 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,21 +1,21 @@ -speakeasyVersion: 1.504.1 +speakeasyVersion: 1.505.0 sources: my-source: sourceNamespace: my-source - sourceRevisionDigest: sha256:4f63229dca06781c54905bcb9c2769ef714dccbd7b347d72ed6b9c0a57f768f9 - sourceBlobDigest: sha256:24d7c75ebda9119f02eec391b4ac5697e7f909341f1694177d9d164ff90e39be + sourceRevisionDigest: sha256:8cba0cf748e247efccefbb5d1839dbeb6e2e3210bb2c90f7b75b9034c22ae24a + sourceBlobDigest: sha256:69fef8ed681f1d68013e71f67927821d64fc1045d3956ace3775fe62ed76b8bb tags: - latest - - speakeasy-sdk-regen-1740499439 + - speakeasy-sdk-regen-1740605410 - 1.0.68 targets: unstructured-python: source: my-source sourceNamespace: my-source - sourceRevisionDigest: sha256:4f63229dca06781c54905bcb9c2769ef714dccbd7b347d72ed6b9c0a57f768f9 - sourceBlobDigest: sha256:24d7c75ebda9119f02eec391b4ac5697e7f909341f1694177d9d164ff90e39be + sourceRevisionDigest: sha256:8cba0cf748e247efccefbb5d1839dbeb6e2e3210bb2c90f7b75b9034c22ae24a + sourceBlobDigest: sha256:69fef8ed681f1d68013e71f67927821d64fc1045d3956ace3775fe62ed76b8bb codeSamplesNamespace: my-source-code-samples - codeSamplesRevisionDigest: sha256:c7f49ae4ef636cb4f1f872f62dbec7312d7cff92d59e1de774428843f0474b91 + codeSamplesRevisionDigest: sha256:d7a20fe1c8d687f377099cdb412c6d0dd733dd982ec4662052df0894da211da2 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index fff05426..075d2bee 100755 --- a/README.md +++ b/README.md @@ -449,6 +449,7 @@ Certain SDK methods accept file objects as part of a request body or multi-part ```python from unstructured_client import UnstructuredClient +from unstructured_client.models import shared with UnstructuredClient() as uc_client: @@ -462,6 +463,8 @@ with UnstructuredClient() as uc_client: 1, 10, ], + "vlm_model": shared.PartitionParametersStrategy.GPT_4O, + "vlm_model_provider": shared.PartitionParametersSchemasStrategy.OPENAI, }, }) diff --git a/RELEASES.md b/RELEASES.md index 24787505..7a7a0c0e 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -824,4 +824,14 @@ Based on: ### Generated - [python v0.31.0] . ### Releases -- [PyPI v0.31.0] https://pypi.org/project/unstructured-client/0.31.0 - . \ No newline at end of file +- [PyPI v0.31.0] https://pypi.org/project/unstructured-client/0.31.0 - . + +## 2025-02-26 21:29:54 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.505.0 (2.531.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.30.6] . +### Releases +- [PyPI v0.30.6] https://pypi.org/project/unstructured-client/0.30.6 - . diff --git a/codeSamples.yaml b/codeSamples.yaml index ced172de..37e062dc 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -8,118 +8,118 @@ actions: "x-codeSamples": - "lang": "python" "label": "list_destinations" - "source": "from unstructured_client import UnstructuredClient\n\nwith UnstructuredClient(\n server_url=\"https://api.example.com\",\n) as uc_client:\n\n res = uc_client.destinations.list_destinations(request={})\n\n assert res.response_list_destinations is not None\n\n # Handle response\n print(res.response_list_destinations)" + "source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient(\n server_url=\"https://api.example.com\",\n) as uc_client:\n\n res = uc_client.destinations.list_destinations(request={})\n\n assert res.response_list_destinations is not None\n\n # Handle response\n print(res.response_list_destinations)" - target: $["paths"]["/api/v1/destinations/"]["post"] update: "x-codeSamples": - "lang": "python" "label": "create_destination" - "source": "from unstructured_client import UnstructuredClient\nfrom unstructured_client.models import shared\n\nwith UnstructuredClient(\n server_url=\"https://api.example.com\",\n) as uc_client:\n\n res = uc_client.destinations.create_destination(request={\n \"create_destination_connector\": {\n \"name\": \"\",\n \"type\": shared.DestinationConnectorType.AZURE_AI_SEARCH,\n \"config\": {\n \"collection_name\": \"\",\n \"batch_size\": 20,\n \"api_endpoint\": \"\",\n \"token\": \"\",\n },\n },\n })\n\n assert res.destination_connector_information is not None\n\n # Handle response\n print(res.destination_connector_information)" + "source": "from unstructured_client import UnstructuredClient\nfrom unstructured_client.models import shared\n\n\nwith UnstructuredClient(\n server_url=\"https://api.example.com\",\n) as uc_client:\n\n res = uc_client.destinations.create_destination(request={\n \"create_destination_connector\": {\n \"name\": \"\",\n \"type\": shared.DestinationConnectorType.AZURE_AI_SEARCH,\n \"config\": {\n \"collection_name\": \"\",\n \"batch_size\": 20,\n \"api_endpoint\": \"\",\n \"token\": \"\",\n },\n },\n })\n\n assert res.destination_connector_information is not None\n\n # Handle response\n print(res.destination_connector_information)" - target: $["paths"]["/api/v1/destinations/{destination_id}"]["delete"] update: "x-codeSamples": - "lang": "python" "label": "delete_destination" - "source": "from unstructured_client import UnstructuredClient\n\nwith UnstructuredClient(\n server_url=\"https://api.example.com\",\n) as uc_client:\n\n res = uc_client.destinations.delete_destination(request={\n \"destination_id\": \"10a88d76-65fb-4c88-8488-9e7d272c6373\",\n })\n\n assert res.any is not None\n\n # Handle response\n print(res.any)" + "source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient(\n server_url=\"https://api.example.com\",\n) as uc_client:\n\n res = uc_client.destinations.delete_destination(request={\n \"destination_id\": \"10a88d76-65fb-4c88-8488-9e7d272c6373\",\n })\n\n assert res.any is not None\n\n # Handle response\n print(res.any)" - target: $["paths"]["/api/v1/destinations/{destination_id}"]["get"] update: "x-codeSamples": - "lang": "python" "label": "get_destination" - "source": "from unstructured_client import UnstructuredClient\n\nwith UnstructuredClient(\n server_url=\"https://api.example.com\",\n) as uc_client:\n\n res = uc_client.destinations.get_destination(request={\n \"destination_id\": \"41ba03fb-faa3-4e9e-8cfb-27f133c4198a\",\n })\n\n assert res.destination_connector_information is not None\n\n # Handle response\n print(res.destination_connector_information)" + "source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient(\n server_url=\"https://api.example.com\",\n) as uc_client:\n\n res = uc_client.destinations.get_destination(request={\n \"destination_id\": \"41ba03fb-faa3-4e9e-8cfb-27f133c4198a\",\n })\n\n assert res.destination_connector_information is not None\n\n # Handle response\n print(res.destination_connector_information)" - target: $["paths"]["/api/v1/destinations/{destination_id}"]["put"] update: "x-codeSamples": - "lang": "python" "label": "update_destination" - "source": "from unstructured_client import UnstructuredClient\n\nwith UnstructuredClient(\n server_url=\"https://api.example.com\",\n) as uc_client:\n\n res = uc_client.destinations.update_destination(request={\n \"destination_id\": \"9ea9d27c-4e2e-4cb5-9a69-71bd7ec9d226\",\n \"update_destination_connector\": {\n \"config\": {\n \"host\": \"acidic-patroller.com\",\n \"database\": \"\",\n \"port\": 832931,\n \"username\": \"Salvador.Walsh-Thiel\",\n \"password\": \"vIMqbllzrdJBExE\",\n \"table_name\": \"\",\n \"batch_size\": 977983,\n },\n },\n })\n\n assert res.destination_connector_information is not None\n\n # Handle response\n print(res.destination_connector_information)" + "source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient(\n server_url=\"https://api.example.com\",\n) as uc_client:\n\n res = uc_client.destinations.update_destination(request={\n \"destination_id\": \"9ea9d27c-4e2e-4cb5-9a69-71bd7ec9d226\",\n \"update_destination_connector\": {\n \"config\": {\n \"host\": \"acidic-patroller.com\",\n \"database\": \"\",\n \"port\": 832931,\n \"username\": \"Salvador.Walsh-Thiel\",\n \"password\": \"vIMqbllzrdJBExE\",\n \"table_name\": \"\",\n \"batch_size\": 977983,\n },\n },\n })\n\n assert res.destination_connector_information is not None\n\n # Handle response\n print(res.destination_connector_information)" - target: $["paths"]["/api/v1/jobs/"]["get"] update: "x-codeSamples": - "lang": "python" "label": "list_jobs" - "source": "from unstructured_client import UnstructuredClient\n\nwith UnstructuredClient(\n server_url=\"https://api.example.com\",\n) as uc_client:\n\n res = uc_client.jobs.list_jobs(request={})\n\n assert res.response_list_jobs is not None\n\n # Handle response\n print(res.response_list_jobs)" + "source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient(\n server_url=\"https://api.example.com\",\n) as uc_client:\n\n res = uc_client.jobs.list_jobs(request={})\n\n assert res.response_list_jobs is not None\n\n # Handle response\n print(res.response_list_jobs)" - target: $["paths"]["/api/v1/jobs/{job_id}"]["get"] update: "x-codeSamples": - "lang": "python" "label": "get_job" - "source": "from unstructured_client import UnstructuredClient\n\nwith UnstructuredClient(\n server_url=\"https://api.example.com\",\n) as uc_client:\n\n res = uc_client.jobs.get_job(request={\n \"job_id\": \"6bb4cb72-a072-4398-9de3-194e59352a3c\",\n })\n\n assert res.job_information is not None\n\n # Handle response\n print(res.job_information)" + "source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient(\n server_url=\"https://api.example.com\",\n) as uc_client:\n\n res = uc_client.jobs.get_job(request={\n \"job_id\": \"6bb4cb72-a072-4398-9de3-194e59352a3c\",\n })\n\n assert res.job_information is not None\n\n # Handle response\n print(res.job_information)" - target: $["paths"]["/api/v1/jobs/{job_id}/cancel"]["post"] update: "x-codeSamples": - "lang": "python" "label": "cancel_job" - "source": "from unstructured_client import UnstructuredClient\n\nwith UnstructuredClient(\n server_url=\"https://api.example.com\",\n) as uc_client:\n\n res = uc_client.jobs.cancel_job(request={\n \"job_id\": \"ec29bf67-0f30-4793-b5ee-8fc0da196032\",\n })\n\n assert res.any is not None\n\n # Handle response\n print(res.any)" + "source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient(\n server_url=\"https://api.example.com\",\n) as uc_client:\n\n res = uc_client.jobs.cancel_job(request={\n \"job_id\": \"ec29bf67-0f30-4793-b5ee-8fc0da196032\",\n })\n\n assert res.any is not None\n\n # Handle response\n print(res.any)" - target: $["paths"]["/api/v1/sources/"]["get"] update: "x-codeSamples": - "lang": "python" "label": "list_sources" - "source": "from unstructured_client import UnstructuredClient\n\nwith UnstructuredClient(\n server_url=\"https://api.example.com\",\n) as uc_client:\n\n res = uc_client.sources.list_sources(request={})\n\n assert res.response_list_sources is not None\n\n # Handle response\n print(res.response_list_sources)" + "source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient(\n server_url=\"https://api.example.com\",\n) as uc_client:\n\n res = uc_client.sources.list_sources(request={})\n\n assert res.response_list_sources is not None\n\n # Handle response\n print(res.response_list_sources)" - target: $["paths"]["/api/v1/sources/"]["post"] update: "x-codeSamples": - "lang": "python" "label": "create_source" - "source": "from unstructured_client import UnstructuredClient\nfrom unstructured_client.models import shared\n\nwith UnstructuredClient(\n server_url=\"https://api.example.com\",\n) as uc_client:\n\n res = uc_client.sources.create_source(request={\n \"create_source_connector\": {\n \"name\": \"\",\n \"type\": shared.SourceConnectorType.SALESFORCE,\n \"config\": {\n \"username\": \"Eldora_Casper\",\n \"consumer_key\": \"\",\n \"private_key\": \"\",\n \"categories\": [\n \"\",\n ],\n },\n },\n })\n\n assert res.source_connector_information is not None\n\n # Handle response\n print(res.source_connector_information)" + "source": "from unstructured_client import UnstructuredClient\nfrom unstructured_client.models import shared\n\n\nwith UnstructuredClient(\n server_url=\"https://api.example.com\",\n) as uc_client:\n\n res = uc_client.sources.create_source(request={\n \"create_source_connector\": {\n \"name\": \"\",\n \"type\": shared.SourceConnectorType.S3,\n \"config\": {\n \"username\": \"Eldora_Casper\",\n \"consumer_key\": \"\",\n \"private_key\": \"\",\n \"categories\": [\n \"\",\n ],\n },\n },\n })\n\n assert res.source_connector_information is not None\n\n # Handle response\n print(res.source_connector_information)" - target: $["paths"]["/api/v1/sources/{source_id}"]["delete"] update: "x-codeSamples": - "lang": "python" "label": "delete_source" - "source": "from unstructured_client import UnstructuredClient\n\nwith UnstructuredClient(\n server_url=\"https://api.example.com\",\n) as uc_client:\n\n res = uc_client.sources.delete_source(request={\n \"source_id\": \"8a24d7ae-5524-45e9-83f9-b0adba5303d4\",\n })\n\n assert res.any is not None\n\n # Handle response\n print(res.any)" + "source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient(\n server_url=\"https://api.example.com\",\n) as uc_client:\n\n res = uc_client.sources.delete_source(request={\n \"source_id\": \"8a24d7ae-5524-45e9-83f9-b0adba5303d4\",\n })\n\n assert res.any is not None\n\n # Handle response\n print(res.any)" - target: $["paths"]["/api/v1/sources/{source_id}"]["get"] update: "x-codeSamples": - "lang": "python" "label": "get_source" - "source": "from unstructured_client import UnstructuredClient\n\nwith UnstructuredClient(\n server_url=\"https://api.example.com\",\n) as uc_client:\n\n res = uc_client.sources.get_source(request={\n \"source_id\": \"e02d8147-b614-4e4c-9c6d-0cd9c4492ea0\",\n })\n\n assert res.source_connector_information is not None\n\n # Handle response\n print(res.source_connector_information)" + "source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient(\n server_url=\"https://api.example.com\",\n) as uc_client:\n\n res = uc_client.sources.get_source(request={\n \"source_id\": \"e02d8147-b614-4e4c-9c6d-0cd9c4492ea0\",\n })\n\n assert res.source_connector_information is not None\n\n # Handle response\n print(res.source_connector_information)" - target: $["paths"]["/api/v1/sources/{source_id}"]["put"] update: "x-codeSamples": - "lang": "python" "label": "update_source" - "source": "from unstructured_client import UnstructuredClient\n\nwith UnstructuredClient(\n server_url=\"https://api.example.com\",\n) as uc_client:\n\n res = uc_client.sources.update_source(request={\n \"source_id\": \"196d27d0-3173-4749-b69d-2ee5d8e2396e\",\n \"update_source_connector\": {\n \"config\": {\n \"client_id\": \"\",\n \"client_cred\": \"\",\n \"recursive\": False,\n \"user_email\": \"\",\n },\n },\n })\n\n assert res.source_connector_information is not None\n\n # Handle response\n print(res.source_connector_information)" + "source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient(\n server_url=\"https://api.example.com\",\n) as uc_client:\n\n res = uc_client.sources.update_source(request={\n \"source_id\": \"7d031737-4969-4d2e-ae5d-8e2396edec43\",\n \"update_source_connector\": {\n \"config\": {\n \"client_id\": \"\",\n \"tenant\": \"\",\n \"authority_url\": \"https://pleasing-hammock.org/\",\n \"user_pname\": \"\",\n \"client_cred\": \"\",\n \"recursive\": False,\n \"path\": \"/etc/namedb\",\n },\n },\n })\n\n assert res.source_connector_information is not None\n\n # Handle response\n print(res.source_connector_information)" - target: $["paths"]["/api/v1/workflows/"]["get"] update: "x-codeSamples": - "lang": "python" "label": "list_workflows" - "source": "from unstructured_client import UnstructuredClient\n\nwith UnstructuredClient(\n server_url=\"https://api.example.com\",\n) as uc_client:\n\n res = uc_client.workflows.list_workflows(request={})\n\n assert res.response_list_workflows is not None\n\n # Handle response\n print(res.response_list_workflows)" + "source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient(\n server_url=\"https://api.example.com\",\n) as uc_client:\n\n res = uc_client.workflows.list_workflows(request={})\n\n assert res.response_list_workflows is not None\n\n # Handle response\n print(res.response_list_workflows)" - target: $["paths"]["/api/v1/workflows/"]["post"] update: "x-codeSamples": - "lang": "python" "label": "create_workflow" - "source": "from unstructured_client import UnstructuredClient\nfrom unstructured_client.models import shared\n\nwith UnstructuredClient(\n server_url=\"https://api.example.com\",\n) as uc_client:\n\n res = uc_client.workflows.create_workflow(request={\n \"create_workflow\": {\n \"name\": \"\",\n \"source_id\": \"b5baba90-bc88-4ea4-b45f-e894788e3f38\",\n \"destination_id\": \"0efa0612-4dfe-411e-b84d-d7cfa1e3fe9e\",\n \"workflow_type\": shared.WorkflowType.ADVANCED,\n },\n })\n\n assert res.workflow_information is not None\n\n # Handle response\n print(res.workflow_information)" + "source": "from unstructured_client import UnstructuredClient\nfrom unstructured_client.models import shared\n\n\nwith UnstructuredClient(\n server_url=\"https://api.example.com\",\n) as uc_client:\n\n res = uc_client.workflows.create_workflow(request={\n \"create_workflow\": {\n \"name\": \"\",\n \"source_id\": \"b5baba90-bc88-4ea4-b45f-e894788e3f38\",\n \"destination_id\": \"0efa0612-4dfe-411e-b84d-d7cfa1e3fe9e\",\n \"workflow_type\": shared.WorkflowType.ADVANCED,\n },\n })\n\n assert res.workflow_information is not None\n\n # Handle response\n print(res.workflow_information)" - target: $["paths"]["/api/v1/workflows/{workflow_id}"]["delete"] update: "x-codeSamples": - "lang": "python" "label": "delete_workflow" - "source": "from unstructured_client import UnstructuredClient\n\nwith UnstructuredClient(\n server_url=\"https://api.example.com\",\n) as uc_client:\n\n res = uc_client.workflows.delete_workflow(request={\n \"workflow_id\": \"26c0bd77-269e-4239-86b8-71541359440c\",\n })\n\n assert res.any is not None\n\n # Handle response\n print(res.any)" + "source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient(\n server_url=\"https://api.example.com\",\n) as uc_client:\n\n res = uc_client.workflows.delete_workflow(request={\n \"workflow_id\": \"26c0bd77-269e-4239-86b8-71541359440c\",\n })\n\n assert res.any is not None\n\n # Handle response\n print(res.any)" - target: $["paths"]["/api/v1/workflows/{workflow_id}"]["get"] update: "x-codeSamples": - "lang": "python" "label": "get_workflow" - "source": "from unstructured_client import UnstructuredClient\n\nwith UnstructuredClient(\n server_url=\"https://api.example.com\",\n) as uc_client:\n\n res = uc_client.workflows.get_workflow(request={\n \"workflow_id\": \"270d9bb5-13f1-4e4d-bb84-4bcc30c93967\",\n })\n\n assert res.workflow_information is not None\n\n # Handle response\n print(res.workflow_information)" + "source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient(\n server_url=\"https://api.example.com\",\n) as uc_client:\n\n res = uc_client.workflows.get_workflow(request={\n \"workflow_id\": \"270d9bb5-13f1-4e4d-bb84-4bcc30c93967\",\n })\n\n assert res.workflow_information is not None\n\n # Handle response\n print(res.workflow_information)" - target: $["paths"]["/api/v1/workflows/{workflow_id}"]["put"] update: "x-codeSamples": - "lang": "python" "label": "update_workflow" - "source": "from unstructured_client import UnstructuredClient\n\nwith UnstructuredClient(\n server_url=\"https://api.example.com\",\n) as uc_client:\n\n res = uc_client.workflows.update_workflow(request={\n \"workflow_id\": \"b63b90df-08ba-41e1-b15b-bc744e5781fa\",\n \"update_workflow\": {},\n })\n\n assert res.workflow_information is not None\n\n # Handle response\n print(res.workflow_information)" + "source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient(\n server_url=\"https://api.example.com\",\n) as uc_client:\n\n res = uc_client.workflows.update_workflow(request={\n \"workflow_id\": \"b63b90df-08ba-41e1-b15b-bc744e5781fa\",\n \"update_workflow\": {},\n })\n\n assert res.workflow_information is not None\n\n # Handle response\n print(res.workflow_information)" - target: $["paths"]["/api/v1/workflows/{workflow_id}/run"]["post"] update: "x-codeSamples": - "lang": "python" "label": "run_workflow" - "source": "from unstructured_client import UnstructuredClient\n\nwith UnstructuredClient(\n server_url=\"https://api.example.com\",\n) as uc_client:\n\n res = uc_client.workflows.run_workflow(request={\n \"workflow_id\": \"6b67be6d-98e9-440c-88fd-721e5d2d0036\",\n })\n\n assert res.workflow_information is not None\n\n # Handle response\n print(res.workflow_information)" + "source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient(\n server_url=\"https://api.example.com\",\n) as uc_client:\n\n res = uc_client.workflows.run_workflow(request={\n \"workflow_id\": \"6b67be6d-98e9-440c-88fd-721e5d2d0036\",\n })\n\n assert res.workflow_information is not None\n\n # Handle response\n print(res.workflow_information)" - target: $["paths"]["/general/v0/general"]["post"] update: "x-codeSamples": - "lang": "python" "label": "partition" - "source": "from unstructured_client import UnstructuredClient\n\nwith UnstructuredClient(\n server_url=\"https://api.example.com\",\n) as uc_client:\n\n res = uc_client.general.partition(request={\n \"partition_parameters\": {\n \"files\": {\n \"file_name\": \"example.file\",\n \"content\": open(\"example.file\", \"rb\"),\n },\n \"split_pdf_page_range\": [\n 1,\n 10,\n ],\n },\n })\n\n assert res.elements is not None\n\n # Handle response\n print(res.elements)" + "source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient(\n server_url=\"https://api.example.com\",\n) as uc_client:\n\n res = uc_client.general.partition(request={\n \"partition_parameters\": {\n \"files\": {\n \"file_name\": \"example.file\",\n \"content\": open(\"example.file\", \"rb\"),\n },\n \"split_pdf_page_range\": [\n 1,\n 10,\n ],\n },\n })\n\n assert res.elements is not None\n\n # Handle response\n print(res.elements)" diff --git a/docs/models/shared/partitionparameters.md b/docs/models/shared/partitionparameters.md index d6cafeaf..e1946c1d 100644 --- a/docs/models/shared/partitionparameters.md +++ b/docs/models/shared/partitionparameters.md @@ -38,4 +38,6 @@ | `strategy` | [Optional[shared.Strategy]](../../models/shared/strategy.md) | :heavy_minus_sign: | The strategy to use for partitioning PDF/image. Options are fast, hi_res, auto. Default: hi_res | auto | | `table_ocr_agent` | *OptionalNullable[str]* | :heavy_minus_sign: | The OCR agent to use for table ocr inference. | | | `unique_element_ids` | *Optional[bool]* | :heavy_minus_sign: | When `True`, assign UUIDs to element IDs, which guarantees their uniqueness (useful when using them as primary keys in database). Otherwise a SHA-256 of element text is used. Default: `False` | | +| `vlm_model` | [Optional[shared.PartitionParametersStrategy]](../../models/shared/partitionparametersstrategy.md) | :heavy_minus_sign: | The VLM Model to use. | gpt-4o | +| `vlm_model_provider` | [Optional[shared.PartitionParametersSchemasStrategy]](../../models/shared/partitionparametersschemasstrategy.md) | :heavy_minus_sign: | The VLM Model provider to use. | openai | | `xml_keep_tags` | *Optional[bool]* | :heavy_minus_sign: | If `True`, will retain the XML tags in the output. Otherwise it will simply extract the text from within the tags. Only applies to XML documents. | | \ No newline at end of file diff --git a/docs/models/shared/partitionparametersschemasstrategy.md b/docs/models/shared/partitionparametersschemasstrategy.md new file mode 100644 index 00000000..dd9f12ec --- /dev/null +++ b/docs/models/shared/partitionparametersschemasstrategy.md @@ -0,0 +1,16 @@ +# PartitionParametersSchemasStrategy + +The VLM Model provider to use. + + +## Values + +| Name | Value | +| ------------------- | ------------------- | +| `OPENAI` | openai | +| `ANTHROPIC` | anthropic | +| `BEDROCK` | bedrock | +| `ANTHROPIC_BEDROCK` | anthropic_bedrock | +| `VERTEXAI` | vertexai | +| `GOOGLE` | google | +| `AZURE_OPENAI` | azure_openai | \ No newline at end of file diff --git a/docs/models/shared/partitionparametersstrategy.md b/docs/models/shared/partitionparametersstrategy.md new file mode 100644 index 00000000..9e656abd --- /dev/null +++ b/docs/models/shared/partitionparametersstrategy.md @@ -0,0 +1,21 @@ +# PartitionParametersStrategy + +The VLM Model to use. + + +## Values + +| Name | Value | +| ---------------------------------------------- | ---------------------------------------------- | +| `CLAUDE_3_5_SONNET_20241022` | claude-3-5-sonnet-20241022 | +| `GPT_4O` | gpt-4o | +| `GEMINI_1_5_PRO` | gemini-1.5-pro | +| `US_AMAZON_NOVA_PRO_V1_0` | us.amazon.nova-pro-v1:0 | +| `US_AMAZON_NOVA_LITE_V1_0` | us.amazon.nova-lite-v1:0 | +| `US_ANTHROPIC_CLAUDE_3_5_SONNET_20241022_V2_0` | us.anthropic.claude-3-5-sonnet-20241022-v2:0 | +| `US_ANTHROPIC_CLAUDE_3_OPUS_20240229_V1_0` | us.anthropic.claude-3-opus-20240229-v1:0 | +| `US_ANTHROPIC_CLAUDE_3_HAIKU_20240307_V1_0` | us.anthropic.claude-3-haiku-20240307-v1:0 | +| `US_ANTHROPIC_CLAUDE_3_SONNET_20240229_V1_0` | us.anthropic.claude-3-sonnet-20240229-v1:0 | +| `US_META_LLAMA3_2_90B_INSTRUCT_V1_0` | us.meta.llama3-2-90b-instruct-v1:0 | +| `US_META_LLAMA3_2_11B_INSTRUCT_V1_0` | us.meta.llama3-2-11b-instruct-v1:0 | +| `GEMINI_2_0_FLASH_001` | gemini-2.0-flash-001 | \ No newline at end of file diff --git a/docs/models/shared/strategy.md b/docs/models/shared/strategy.md index 4bad9a6e..f331220e 100644 --- a/docs/models/shared/strategy.md +++ b/docs/models/shared/strategy.md @@ -11,4 +11,5 @@ The strategy to use for partitioning PDF/image. Options are fast, hi_res, auto. | `HI_RES` | hi_res | | `AUTO` | auto | | `OCR_ONLY` | ocr_only | -| `OD_ONLY` | od_only | \ No newline at end of file +| `OD_ONLY` | od_only | +| `VLM` | vlm | \ No newline at end of file diff --git a/docs/sdks/general/README.md b/docs/sdks/general/README.md index 42d934a9..d23f3888 100644 --- a/docs/sdks/general/README.md +++ b/docs/sdks/general/README.md @@ -15,6 +15,7 @@ Description ```python from unstructured_client import UnstructuredClient +from unstructured_client.models import shared with UnstructuredClient() as uc_client: @@ -28,6 +29,8 @@ with UnstructuredClient() as uc_client: 1, 10, ], + "vlm_model": shared.PartitionParametersStrategy.GPT_4O, + "vlm_model_provider": shared.PartitionParametersSchemasStrategy.OPENAI, }, }) diff --git a/gen.yaml b/gen.yaml index 0b16d552..0d5851fd 100644 --- a/gen.yaml +++ b/gen.yaml @@ -13,7 +13,7 @@ generation: oAuth2ClientCredentialsEnabled: false oAuth2PasswordEnabled: false python: - version: 0.30.5 + version: 0.30.6 additionalDependencies: dev: deepdiff: '>=6.0' diff --git a/pyproject.toml b/pyproject.toml index c2ad1c3f..c7e7bb9c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "unstructured-client" -version = "0.30.5" +version = "0.30.6" description = "Python Client SDK for Unstructured API" authors = [{ name = "Unstructured" },] readme = "README-PYPI.md" diff --git a/src/unstructured_client/_version.py b/src/unstructured_client/_version.py index e157e7e2..a1c80daf 100644 --- a/src/unstructured_client/_version.py +++ b/src/unstructured_client/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "unstructured-client" -__version__: str = "0.30.5" -__openapi_doc_version__: str = "1.0.68" +__version__: str = "0.30.6" +__openapi_doc_version__: str = "1.0.78" __gen_version__: str = "2.512.0" -__user_agent__: str = "speakeasy-sdk/python 0.30.5 2.512.0 1.0.68 unstructured-client" +__user_agent__: str = "speakeasy-sdk/python 0.30.6 2.512.0 1.0.78 unstructured-client" try: if __package__ is not None: diff --git a/src/unstructured_client/models/shared/__init__.py b/src/unstructured_client/models/shared/__init__.py index f12f7a47..50a97a07 100644 --- a/src/unstructured_client/models/shared/__init__.py +++ b/src/unstructured_client/models/shared/__init__.py @@ -211,6 +211,8 @@ FilesTypedDict, OutputFormat, PartitionParameters, + PartitionParametersSchemasStrategy, + PartitionParametersStrategy, PartitionParametersTypedDict, Strategy, ) @@ -451,6 +453,8 @@ "OutlookSourceConnectorConfigTypedDict", "OutputFormat", "PartitionParameters", + "PartitionParametersSchemasStrategy", + "PartitionParametersStrategy", "PartitionParametersTypedDict", "PostgresDestinationConnectorConfig", "PostgresDestinationConnectorConfigInput", diff --git a/src/unstructured_client/models/shared/partition_parameters.py b/src/unstructured_client/models/shared/partition_parameters.py index adf54e13..638deb5e 100644 --- a/src/unstructured_client/models/shared/partition_parameters.py +++ b/src/unstructured_client/models/shared/partition_parameters.py @@ -61,6 +61,44 @@ class Strategy(str, Enum, metaclass=utils.OpenEnumMeta): AUTO = "auto" OCR_ONLY = "ocr_only" OD_ONLY = "od_only" + VLM = "vlm" + + +class PartitionParametersStrategy(str, Enum, metaclass=utils.OpenEnumMeta): + r"""The VLM Model to use.""" + + CLAUDE_3_5_SONNET_20241022 = "claude-3-5-sonnet-20241022" + GPT_4O = "gpt-4o" + GEMINI_1_5_PRO = "gemini-1.5-pro" + US_AMAZON_NOVA_PRO_V1_0 = "us.amazon.nova-pro-v1:0" + US_AMAZON_NOVA_LITE_V1_0 = "us.amazon.nova-lite-v1:0" + US_ANTHROPIC_CLAUDE_3_5_SONNET_20241022_V2_0 = ( + "us.anthropic.claude-3-5-sonnet-20241022-v2:0" + ) + US_ANTHROPIC_CLAUDE_3_OPUS_20240229_V1_0 = ( + "us.anthropic.claude-3-opus-20240229-v1:0" + ) + US_ANTHROPIC_CLAUDE_3_HAIKU_20240307_V1_0 = ( + "us.anthropic.claude-3-haiku-20240307-v1:0" + ) + US_ANTHROPIC_CLAUDE_3_SONNET_20240229_V1_0 = ( + "us.anthropic.claude-3-sonnet-20240229-v1:0" + ) + US_META_LLAMA3_2_90B_INSTRUCT_V1_0 = "us.meta.llama3-2-90b-instruct-v1:0" + US_META_LLAMA3_2_11B_INSTRUCT_V1_0 = "us.meta.llama3-2-11b-instruct-v1:0" + GEMINI_2_0_FLASH_001 = "gemini-2.0-flash-001" + + +class PartitionParametersSchemasStrategy(str, Enum, metaclass=utils.OpenEnumMeta): + r"""The VLM Model provider to use.""" + + OPENAI = "openai" + ANTHROPIC = "anthropic" + BEDROCK = "bedrock" + ANTHROPIC_BEDROCK = "anthropic_bedrock" + VERTEXAI = "vertexai" + GOOGLE = "google" + AZURE_OPENAI = "azure_openai" class PartitionParametersTypedDict(TypedDict): @@ -130,6 +168,10 @@ class PartitionParametersTypedDict(TypedDict): r"""The OCR agent to use for table ocr inference.""" unique_element_ids: NotRequired[bool] r"""When `True`, assign UUIDs to element IDs, which guarantees their uniqueness (useful when using them as primary keys in database). Otherwise a SHA-256 of element text is used. Default: `False`""" + vlm_model: NotRequired[PartitionParametersStrategy] + r"""The VLM Model to use.""" + vlm_model_provider: NotRequired[PartitionParametersSchemasStrategy] + r"""The VLM Model provider to use.""" xml_keep_tags: NotRequired[bool] r"""If `True`, will retain the XML tags in the output. Otherwise it will simply extract the text from within the tags. Only applies to XML documents.""" @@ -278,6 +320,24 @@ class PartitionParameters(BaseModel): unique_element_ids: Annotated[Optional[bool], FieldMetadata(multipart=True)] = False r"""When `True`, assign UUIDs to element IDs, which guarantees their uniqueness (useful when using them as primary keys in database). Otherwise a SHA-256 of element text is used. Default: `False`""" + vlm_model: Annotated[ + Annotated[ + Optional[PartitionParametersStrategy], + PlainValidator(validate_open_enum(False)), + ], + FieldMetadata(multipart=True), + ] = None + r"""The VLM Model to use.""" + + vlm_model_provider: Annotated[ + Annotated[ + Optional[PartitionParametersSchemasStrategy], + PlainValidator(validate_open_enum(False)), + ], + FieldMetadata(multipart=True), + ] = None + r"""The VLM Model provider to use.""" + xml_keep_tags: Annotated[Optional[bool], FieldMetadata(multipart=True)] = False r"""If `True`, will retain the XML tags in the output. Otherwise it will simply extract the text from within the tags. Only applies to XML documents.""" @@ -316,6 +376,8 @@ def serialize_model(self, handler): "strategy", "table_ocr_agent", "unique_element_ids", + "vlm_model", + "vlm_model_provider", "xml_keep_tags", ] nullable_fields = [