markdown-flow 0.2.79__tar.gz → 0.2.80__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.
Files changed (48) hide show
  1. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/PKG-INFO +1 -1
  2. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/markdown_flow/__init__.py +1 -2
  3. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/markdown_flow/core.py +28 -26
  4. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/markdown_flow/system_prompt.md +1 -1
  5. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/markdown_flow.egg-info/PKG-INFO +1 -1
  6. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/LICENSE +0 -0
  7. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/README.md +0 -0
  8. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/markdown_flow/constants.py +0 -0
  9. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/markdown_flow/constants_system_prompt.py +0 -0
  10. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/markdown_flow/enums.py +0 -0
  11. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/markdown_flow/exceptions.py +0 -0
  12. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/markdown_flow/formatter/__init__.py +0 -0
  13. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/markdown_flow/formatter/classifier.py +0 -0
  14. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/markdown_flow/formatter/format.py +0 -0
  15. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/markdown_flow/formatter/patterns.py +0 -0
  16. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/markdown_flow/formatter/stream.py +0 -0
  17. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/markdown_flow/formatter/types.py +0 -0
  18. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/markdown_flow/llm.py +0 -0
  19. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/markdown_flow/models.py +0 -0
  20. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/markdown_flow/parser/__init__.py +0 -0
  21. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/markdown_flow/parser/code_fence_utils.py +0 -0
  22. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/markdown_flow/parser/html_comment_utils.py +0 -0
  23. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/markdown_flow/parser/interaction.py +0 -0
  24. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/markdown_flow/parser/json_parser.py +0 -0
  25. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/markdown_flow/parser/output.py +0 -0
  26. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/markdown_flow/parser/preprocessor.py +0 -0
  27. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/markdown_flow/parser/validation.py +0 -0
  28. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/markdown_flow/parser/variable.py +0 -0
  29. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/markdown_flow/providers/__init__.py +0 -0
  30. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/markdown_flow/providers/config.py +0 -0
  31. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/markdown_flow/providers/openai.py +0 -0
  32. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/markdown_flow/tag_filter.py +0 -0
  33. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/markdown_flow/utils.py +0 -0
  34. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/markdown_flow.egg-info/SOURCES.txt +0 -0
  35. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/markdown_flow.egg-info/dependency_links.txt +0 -0
  36. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/markdown_flow.egg-info/top_level.txt +0 -0
  37. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/pyproject.toml +0 -0
  38. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/setup.cfg +0 -0
  39. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/tests/test_dynamic_interaction.py +0 -0
  40. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/tests/test_formatter.py +0 -0
  41. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/tests/test_formatter_stream.py +0 -0
  42. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/tests/test_html_comment_utils.py +0 -0
  43. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/tests/test_markdownflow_basic.py +0 -0
  44. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/tests/test_parser_interaction.py +0 -0
  45. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/tests/test_parser_output.py +0 -0
  46. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/tests/test_parser_variable.py +0 -0
  47. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/tests/test_preprocessor.py +0 -0
  48. {markdown_flow-0.2.79 → markdown_flow-0.2.80}/tests/test_preserved_simple.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: markdown-flow
3
- Version: 0.2.79
3
+ Version: 0.2.80
4
4
  Summary: An agent library designed to parse and process MarkdownFlow documents
5
5
  Project-URL: Homepage, https://github.com/ai-shifu/markdown-flow-agent-py
6
6
  Project-URL: Bug Tracker, https://github.com/ai-shifu/markdown-flow-agent-py/issues
@@ -88,5 +88,4 @@ __all__ = [
88
88
  "replace_variables_in_text",
89
89
  ]
90
90
 
91
- __version__ = "0.2.79"
92
- # __version__ = "0.2.45-alpha-1"
91
+ __version__ = "0.2.80"
@@ -666,43 +666,45 @@ class MarkdownFlow:
666
666
 
667
667
  # Extract translatable content (JSON format)
668
668
  translatable_json, interaction_info = self._extract_translatable_content(processed_block.content)
669
- if not interaction_info:
670
- # Parse failed, return original content
671
- return LLMResult(
669
+
670
+ def _render_as_is(*, translation_skipped: bool = False):
671
+ """Return the interaction content unchanged, honoring the mode.
672
+
673
+ STREAM mode must return a generator yielding LLMResult (callers
674
+ iterate the result); COMPLETE returns the LLMResult directly.
675
+ """
676
+ metadata = {
677
+ "block_type": "interaction",
678
+ "block_index": block_index,
679
+ }
680
+ if translation_skipped:
681
+ metadata["translation_skipped"] = True
682
+ result = LLMResult(
672
683
  content=processed_block.content,
673
684
  type=ElementType.INTERACTION,
674
685
  number=block_index,
675
- metadata={
676
- "block_type": "interaction",
677
- "block_index": block_index,
678
- },
686
+ metadata=metadata,
679
687
  )
688
+ if mode == ProcessMode.STREAM:
689
+
690
+ def stream_generator():
691
+ yield result
692
+
693
+ return stream_generator()
694
+ return result
695
+
696
+ if not interaction_info:
697
+ # Parse failed, return original content
698
+ return _render_as_is()
680
699
 
681
700
  # If no translatable content, return directly
682
701
  if not translatable_json or translatable_json == "{}":
683
- return LLMResult(
684
- content=processed_block.content,
685
- type=ElementType.INTERACTION,
686
- number=block_index,
687
- metadata={
688
- "block_type": "interaction",
689
- "block_index": block_index,
690
- },
691
- )
702
+ return _render_as_is()
692
703
 
693
704
  # If no output language is configured, skip translation entirely:
694
705
  # return the interaction content as-is without any LLM call.
695
706
  if not self._output_language:
696
- return LLMResult(
697
- content=processed_block.content,
698
- type=ElementType.INTERACTION,
699
- number=block_index,
700
- metadata={
701
- "block_type": "interaction",
702
- "block_index": block_index,
703
- "translation_skipped": True,
704
- },
705
- )
707
+ return _render_as_is(translation_skipped=True)
706
708
 
707
709
  # Build translation messages
708
710
  messages = self._build_translation_messages(translatable_json)
@@ -9,7 +9,7 @@
9
9
 
10
10
  # 二、html展示内容生成规则
11
11
 
12
- 仅当用户要求生成视觉内容(PPT/页面/HTML/图表)时启用。如果用户要求只生成内容,则不启用该规则。
12
+ 仅当用户要求生成视觉内容(PPT/页面/HTML/图表/图片)时启用。如果用户要求只生成内容,则不启用该规则。
13
13
 
14
14
  ## 1. 渲染机制
15
15
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: markdown-flow
3
- Version: 0.2.79
3
+ Version: 0.2.80
4
4
  Summary: An agent library designed to parse and process MarkdownFlow documents
5
5
  Project-URL: Homepage, https://github.com/ai-shifu/markdown-flow-agent-py
6
6
  Project-URL: Bug Tracker, https://github.com/ai-shifu/markdown-flow-agent-py/issues
File without changes
File without changes
File without changes