markdown-flow 0.2.14__tar.gz → 0.2.15__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.

Potentially problematic release.


This version of markdown-flow might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: markdown-flow
3
- Version: 0.2.14
3
+ Version: 0.2.15
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
@@ -83,4 +83,4 @@ __all__ = [
83
83
  "replace_variables_in_text",
84
84
  ]
85
85
 
86
- __version__ = "0.2.14"
86
+ __version__ = "0.2.15"
@@ -925,61 +925,67 @@ Original Error: {error_message}
925
925
  # System prompt for detection
926
926
  system_prompt = """You are an intelligent document processing assistant specializing in creating interactive forms.
927
927
 
928
- Task: Analyze the given content block and determine if it needs to be converted to an interaction block.
929
-
930
- **CORE PRINCIPLE**: Focus on INTENT and PATTERNS, not specific keywords.
931
-
932
- **CONVERSION REQUIRED when the text shows:**
933
-
934
- 1. **Collection Pattern**:
935
- - PATTERN: [Action verb] + [choices/options] + [storage indicator]
936
- - PATTERN: Request for user input/selection/choice + destination variable
937
- - PATTERN: Interactive UI request with specific options
938
-
939
- 2. **Storage Indicators** (language-agnostic):
940
- - Presence of target variable for NEW data: {{new_variable}}
941
- - Assignment operators or arrows: →, =>, "to", "into", "as"
942
- - Save/store/record semantics in ANY language
943
-
944
- 3. **Interactive Intent Signals**:
945
- - Imperative mood requesting user action
946
- - Multiple specific options provided (not just descriptions)
947
- - Form-like structure with fields to fill
948
-
949
- **DO NOT CONVERT when the text shows:**
950
-
951
- 1. **Display/Reference Pattern**:
952
- - PATTERN: Using {{existing_var}} + display/list/show action
953
- - PATTERN: Information presentation without collection
954
- - Keywords suggesting reference/viewing (regardless of language):
955
- * "for reference", "供参考", "zur Referenz", "pour référence"
956
- * "display", "show", "list", "罗列", "afficher", "anzeigen"
957
-
958
- 2. **Information Flow**:
959
- - Data flows FROM variable TO display (not from user to variable)
960
- - Descriptive or explanatory content
961
- - Recommendations or suggestions without explicit selection request
962
-
963
- **Language-Agnostic Examples**:
964
-
965
- ❌ Don't convert (any language):
966
- - "Based on {{history}}, list/display/show [items] for reference"
967
- - "根据{{history}}的选择,罗列该朝代的皇帝或者年号,供用户参考"
968
- - "Selon {{history}}, afficher les empereurs pour référence"
969
-
970
- Convert (any language):
971
- - "Ask user to select [option] and save to {{variable}}"
972
- - "让用户选择风格并记录到{{style}}"
973
- - "Create buttons: Yes/No" (implies interaction needed)
974
- - "Demander à l'utilisateur de choisir et enregistrer dans {{choix}}"
975
-
976
- **Decision Rule**:
977
- Look for the SEMANTIC INTENT, not specific words:
978
- - Is NEW information being COLLECTED from user? Convert
979
- - Is EXISTING information being DISPLAYED to user? Don't convert
980
- - When uncertain, check: Does this create a new {{variable}} or just use existing ones?
981
-
982
- If conversion is needed, generate a STANDARD interaction block format."""
928
+ Task: Analyze the given content block and determine if it needs to be converted to an interaction block to collect user information.
929
+
930
+ **ABSOLUTE RULE**: Convert ONLY when ALL THREE mandatory elements are explicitly present:
931
+ 1. Storage action word + target connector + variable
932
+ 2. No exceptions, no implications, no assumptions
933
+
934
+ **MANDATORY TRIPLE PATTERN (ALL REQUIRED):**
935
+
936
+ **Element 1: Storage Action Words**
937
+ - Chinese: "记录", "保存", "存储", "收集", "采集"
938
+ - English: "save", "store", "record", "collect", "gather"
939
+
940
+ **Element 2: Target Connection Words**
941
+ - Chinese: "到", "", "", ""
942
+ - English: "to", "as", "in", "into"
943
+
944
+ **Element 3: Target Variable**
945
+ - Must contain {{variable_name}} syntax for NEW data storage
946
+ - Variable must be for collecting NEW information, not using existing data
947
+
948
+ **VALID CONVERSION FORMULA:**
949
+ [Storage Word] + [Connector] + {{new_variable}}
950
+
951
+ Examples of VALID patterns:
952
+ - "...记录到{{姓名}}"
953
+ - "...保存为{{偏好}}"
954
+ - "...存储在{{选择}}"
955
+ - "...save to {{preference}}"
956
+ - "...collect as {{user_input}}"
957
+
958
+ **STRICT EXCLUSION RULES:**
959
+
960
+ NEVER convert if missing ANY element:
961
+ - No storage action word = NO conversion
962
+ - No target connector = NO conversion
963
+ - No {{variable}} = NO conversion
964
+ - Using existing {{variable}} instead of collecting new = NO conversion
965
+
966
+ NEVER convert casual conversation:
967
+ - Simple questions without storage intent
968
+ - Introduction requests without persistence
969
+ - General inquiries without data collection
970
+ - Educational or exploratory content
971
+
972
+ NEVER infer or assume storage intent:
973
+ - Don't assume "询问姓名" means "保存姓名"
974
+ - Don't assume "了解偏好" means "记录偏好"
975
+ - Don't assume data collection without explicit storage words
976
+
977
+ **PATTERN ANALYSIS METHOD:**
978
+ 1. **Exact Pattern Match**: Search for [Storage Word] + [Connector] + {{variable}}
979
+ 2. **No Pattern = No Conversion**: If exact pattern not found, return needs_interaction: false
980
+ 3. **Zero Tolerance**: No partial matches, no similar meanings, no interpretations
981
+
982
+ **ULTRA-CONSERVATIVE APPROACH:**
983
+ - If there's ANY doubt about storage intent = DON'T convert
984
+ - If storage pattern is not 100% explicit = DON'T convert
985
+ - If you need to "interpret" or "infer" storage intent = DON'T convert
986
+ - Prefer false negatives over false positives
987
+
988
+ When exact pattern is found, generate structured interaction data. Otherwise, always return needs_interaction: false."""
983
989
 
984
990
  # User message with content and context
985
991
  # Build user prompt with document context
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: markdown-flow
3
- Version: 0.2.14
3
+ Version: 0.2.15
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