overlay: 1.0.0
info:
title: CodeSamples overlay for python target
version: 0.0.0
actions:
- target: $["paths"]["/api/v1/destinations/"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "list_destinations"
"source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient() 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 operations, shared\n\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.destinations.create_destination(request=operations.CreateDestinationRequest(\n create_destination_connector=shared.CreateDestinationConnector(\n name=\"\",\n type=shared.DestinationConnectorType.MOTHERDUCK,\n config={\n \"hosts\": [],\n \"index_name\": \"\",\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\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.destinations.delete_destination(request={\n \"destination_id\": \"f50b6b0c-1177-4edb-ae10-68199cd00ba6\",\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\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.destinations.get_destination(request={\n \"destination_id\": \"6352107c-44bd-4a20-a286-de73a4d9c9bd\",\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\nfrom unstructured_client.models import operations, shared\n\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.destinations.update_destination(request=operations.UpdateDestinationRequest(\n destination_id=\"9726962d-9d1e-4f84-8787-c7313d183927\",\n update_destination_connector=shared.UpdateDestinationConnector(\n config={\n \"bootstrap_servers\": \"\",\n \"port\": 9092,\n \"topic\": \"\",\n \"kafka_api_key\": \"\",\n \"secret\": \"\",\n \"batch_size\": 100,\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}/connection-check"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "get_connection_check_destinations"
"source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.destinations.get_connection_check_destinations(request={\n \"destination_id\": \"c95687a3-239f-485c-946b-4c8fe314ef82\",\n })\n\n assert res.dag_node_connection_check is not None\n\n # Handle response\n print(res.dag_node_connection_check)"
- target: $["paths"]["/api/v1/destinations/{destination_id}/connection-check"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "create_connection_check_destinations"
"source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.destinations.create_connection_check_destinations(request={\n \"destination_id\": \"cb9e35c1-0b04-4d98-83fa-fa6241323f96\",\n })\n\n assert res.dag_node_connection_check is not None\n\n # Handle response\n print(res.dag_node_connection_check)"
- target: $["paths"]["/api/v1/jobs/"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "list_jobs"
"source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient() 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/"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "create_job"
"source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.jobs.create_job(request={\n \"body_create_job\": {\n \"request_data\": \"\",\n },\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}"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "get_job"
"source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.jobs.get_job(request={\n \"job_id\": \"d95a05b3-3446-4f3d-806c-904b6a7ba40a\",\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\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.jobs.cancel_job(request={\n \"job_id\": \"2fafd129-04f3-4201-a0e7-fe33e937b367\",\n })\n\n assert res.any is not None\n\n # Handle response\n print(res.any)"
- target: $["paths"]["/api/v1/jobs/{job_id}/details"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "get_job_details"
"source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.jobs.get_job_details(request={\n \"job_id\": \"14cc95f9-4174-46b3-81f5-7089b87a4787\",\n })\n\n assert res.job_details is not None\n\n # Handle response\n print(res.job_details)"
- target: $["paths"]["/api/v1/jobs/{job_id}/download"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "download_job_output"
"source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.jobs.download_job_output(request={\n \"job_id\": \"06d1b7b8-8642-4793-b37e-e45d97d53bc3\",\n \"file_id\": \"\",\n })\n\n assert res.any is not None\n\n # Handle response\n print(res.any)"
- target: $["paths"]["/api/v1/jobs/{job_id}/failed-files"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "get_job_failed_files"
"source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.jobs.get_job_failed_files(request={\n \"job_id\": \"ad262041-3530-40a9-9f83-b004e947a203\",\n })\n\n assert res.job_failed_files is not None\n\n # Handle response\n print(res.job_failed_files)"
- target: $["paths"]["/api/v1/sources/"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "list_sources"
"source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient() 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\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.sources.create_source(request={\n \"create_source_connector\": {\n \"name\": \"\",\n \"type\": shared.SourceConnectorType.DROPBOX,\n \"config\": {\n \"box_app_config\": \"\",\n \"remote_url\": \"https://ugly-ribbon.info\",\n \"recursive\": True,\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\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.sources.delete_source(request={\n \"source_id\": \"296c4009-7b81-4144-9c7c-e058204aeb93\",\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\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.sources.get_source(request={\n \"source_id\": \"df7d5ab1-bb15-4f1a-8dc0-c92a9a28a585\",\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\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.sources.update_source(request={\n \"source_id\": \"6ddfe201-42c1-4097-a271-1fc2801d1903\",\n \"update_source_connector\": {\n \"config\": {\n \"bucket\": \"\",\n \"connection_string\": \"\",\n \"batch_size\": 615322,\n \"username\": \"Lue.Murphy87\",\n \"password\": \"qfyDYveMwvwoQEV\",\n \"collection_id\": \"\",\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}/connection-check"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "get_connection_check_sources"
"source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.sources.get_connection_check_sources(request={\n \"source_id\": \"4df23b66-dae2-44ea-8dd3-329184d5644a\",\n })\n\n assert res.dag_node_connection_check is not None\n\n # Handle response\n print(res.dag_node_connection_check)"
- target: $["paths"]["/api/v1/sources/{source_id}/connection-check"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "create_connection_check_sources"
"source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.sources.create_connection_check_sources(request={\n \"source_id\": \"8d49e3f2-3e6d-4973-bc61-292af66829d7\",\n })\n\n assert res.dag_node_connection_check is not None\n\n # Handle response\n print(res.dag_node_connection_check)"
- target: $["paths"]["/api/v1/templates/"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "list_templates"
"source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.templates.list_templates(request={})\n\n assert res.response_list_templates is not None\n\n # Handle response\n print(res.response_list_templates)"
- target: $["paths"]["/api/v1/templates/{template_id}"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "get_template"
"source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.templates.get_template(request={\n \"template_id\": \"\",\n })\n\n assert res.template_detail is not None\n\n # Handle response\n print(res.template_detail)"
- target: $["paths"]["/api/v1/workflows/"]["get"]
update:
"x-codeSamples":
- "lang": "python"
"label": "list_workflows"
"source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient() 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\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.workflows.create_workflow(request={\n \"create_workflow\": {\n \"name\": \"\",\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\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.workflows.delete_workflow(request={\n \"workflow_id\": \"3e61b8a6-32b6-47cf-bce7-6d13357b30eb\",\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\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.workflows.get_workflow(request={\n \"workflow_id\": \"d031b0e5-7ca7-4a2b-b3cc-d869d2df3e76\",\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\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.workflows.update_workflow(request={\n \"workflow_id\": \"b9b7e688-353f-4ff2-bcd7-a49b5fa5f6c7\",\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\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.workflows.run_workflow(request={\n \"workflow_id\": \"e7054f23-ce92-4bf1-a1d7-7cf9cb14d013\",\n })\n\n assert res.job_information is not None\n\n # Handle response\n print(res.job_information)"
- target: $["paths"]["/general/v0/general"]["post"]
update:
"x-codeSamples":
- "lang": "python"
"label": "partition"
"source": "from unstructured_client import UnstructuredClient\nfrom unstructured_client.models import shared\n\n\nwith UnstructuredClient() 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 \"strategy\": shared.Strategy.AUTO,\n \"vlm_model_provider\": shared.VLMModelProvider.OPENAI,\n \"vlm_model\": \"gpt-4o\",\n \"chunking_strategy\": \"by_title\",\n \"split_pdf_page_range\": [\n 1,\n 10,\n ],\n \"split_pdf_cache_tmp_data_dir\": \"\",\n },\n })\n\n assert res.elements is not None\n\n # Handle response\n print(res.elements)"