mdify-cli 3.3.4__tar.gz → 3.3.6__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.
- {mdify_cli-3.3.4 → mdify_cli-3.3.6}/PKG-INFO +1 -1
- {mdify_cli-3.3.4 → mdify_cli-3.3.6}/mdify/__init__.py +1 -1
- {mdify_cli-3.3.4 → mdify_cli-3.3.6}/mdify/cli.py +5 -25
- {mdify_cli-3.3.4 → mdify_cli-3.3.6}/mdify/ssh/remote_container.py +1 -0
- {mdify_cli-3.3.4 → mdify_cli-3.3.6}/mdify_cli.egg-info/PKG-INFO +1 -1
- {mdify_cli-3.3.4 → mdify_cli-3.3.6}/pyproject.toml +1 -1
- {mdify_cli-3.3.4 → mdify_cli-3.3.6}/LICENSE +0 -0
- {mdify_cli-3.3.4 → mdify_cli-3.3.6}/README.md +0 -0
- {mdify_cli-3.3.4 → mdify_cli-3.3.6}/assets/mdify.png +0 -0
- {mdify_cli-3.3.4 → mdify_cli-3.3.6}/mdify/__main__.py +0 -0
- {mdify_cli-3.3.4 → mdify_cli-3.3.6}/mdify/container.py +0 -0
- {mdify_cli-3.3.4 → mdify_cli-3.3.6}/mdify/docling_client.py +0 -0
- {mdify_cli-3.3.4 → mdify_cli-3.3.6}/mdify/formatting.py +0 -0
- {mdify_cli-3.3.4 → mdify_cli-3.3.6}/mdify/ssh/__init__.py +0 -0
- {mdify_cli-3.3.4 → mdify_cli-3.3.6}/mdify/ssh/client.py +0 -0
- {mdify_cli-3.3.4 → mdify_cli-3.3.6}/mdify/ssh/models.py +0 -0
- {mdify_cli-3.3.4 → mdify_cli-3.3.6}/mdify/ssh/transfer.py +0 -0
- {mdify_cli-3.3.4 → mdify_cli-3.3.6}/mdify_cli.egg-info/SOURCES.txt +0 -0
- {mdify_cli-3.3.4 → mdify_cli-3.3.6}/mdify_cli.egg-info/dependency_links.txt +0 -0
- {mdify_cli-3.3.4 → mdify_cli-3.3.6}/mdify_cli.egg-info/entry_points.txt +0 -0
- {mdify_cli-3.3.4 → mdify_cli-3.3.6}/mdify_cli.egg-info/requires.txt +0 -0
- {mdify_cli-3.3.4 → mdify_cli-3.3.6}/mdify_cli.egg-info/top_level.txt +0 -0
- {mdify_cli-3.3.4 → mdify_cli-3.3.6}/setup.cfg +0 -0
- {mdify_cli-3.3.4 → mdify_cli-3.3.6}/tests/test_cli.py +0 -0
- {mdify_cli-3.3.4 → mdify_cli-3.3.6}/tests/test_container.py +0 -0
- {mdify_cli-3.3.4 → mdify_cli-3.3.6}/tests/test_docling_client.py +0 -0
- {mdify_cli-3.3.4 → mdify_cli-3.3.6}/tests/test_ssh_client.py +0 -0
|
@@ -1056,6 +1056,7 @@ def main_async_remote(args) -> int:
|
|
|
1056
1056
|
async def async_main() -> int:
|
|
1057
1057
|
"""Async implementation of remote conversion."""
|
|
1058
1058
|
from mdify.formatting import Colorizer
|
|
1059
|
+
from mdify.docling_client import _is_error_response, _extract_content
|
|
1059
1060
|
|
|
1060
1061
|
color = Colorizer(sys.stderr)
|
|
1061
1062
|
|
|
@@ -1399,11 +1400,8 @@ def main_async_remote(args) -> int:
|
|
|
1399
1400
|
response_data = json.loads(conversion_output)
|
|
1400
1401
|
color_err = Colorizer(sys.stderr)
|
|
1401
1402
|
|
|
1402
|
-
# Check if response is an error
|
|
1403
|
-
|
|
1404
|
-
response_keys = set(response_data.keys()) if isinstance(response_data, dict) else set()
|
|
1405
|
-
if error_keys & response_keys:
|
|
1406
|
-
# Error response - extract and display error
|
|
1403
|
+
# Check if response is an error response
|
|
1404
|
+
if _is_error_response(response_data):
|
|
1407
1405
|
error_detail = response_data.get("detail", response_data.get("error", str(response_data)))
|
|
1408
1406
|
print(f" {color_err.error('✗ Failed:')} {error_detail}", file=sys.stderr)
|
|
1409
1407
|
if "DOCLING_SERVE_MAX_SYNC_WAIT" in str(error_detail):
|
|
@@ -1412,26 +1410,8 @@ def main_async_remote(args) -> int:
|
|
|
1412
1410
|
failed += 1
|
|
1413
1411
|
break
|
|
1414
1412
|
|
|
1415
|
-
# Extract content from response
|
|
1416
|
-
|
|
1417
|
-
markdown_content = None
|
|
1418
|
-
if "document" in response_data:
|
|
1419
|
-
document = response_data["document"]
|
|
1420
|
-
if "md_content" in document and document["md_content"]:
|
|
1421
|
-
markdown_content = document["md_content"]
|
|
1422
|
-
elif "text_content" in document and document["text_content"]:
|
|
1423
|
-
markdown_content = document["text_content"]
|
|
1424
|
-
elif "results" in response_data and response_data["results"]:
|
|
1425
|
-
# Legacy format fallback
|
|
1426
|
-
result = response_data["results"][0]
|
|
1427
|
-
if "content" in result:
|
|
1428
|
-
content = result["content"]
|
|
1429
|
-
if isinstance(content, dict) and "markdown" in content:
|
|
1430
|
-
markdown_content = content["markdown"]
|
|
1431
|
-
elif isinstance(content, str):
|
|
1432
|
-
markdown_content = content
|
|
1433
|
-
else:
|
|
1434
|
-
markdown_content = str(content)
|
|
1413
|
+
# Extract content from response using proper extraction function
|
|
1414
|
+
markdown_content = _extract_content(response_data)
|
|
1435
1415
|
|
|
1436
1416
|
# Validate content exists and is not empty/too short
|
|
1437
1417
|
if not markdown_content or len(markdown_content.strip()) < 50:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|